1 2008-03-14 Martin Baulig <martin@ximian.com>
4 (SymbolWriter): Make this a public static class.
7 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
8 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
10 2008-03-14 Marek Safar <marek.safar@gmail.com>
13 * statement.cs, lambda.cs: Added extra limitations when dealing with void
16 2008-03-14 Marek Safar <marek.safar@gmail.com>
18 * typemanager.cs (CSharpName): Made 250 times faster.
20 2008-03-13 Marek Safar <marek.safar@gmail.com>
22 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
24 2008-03-12 Marek Safar <marek.safar@gmail.com>
26 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
27 crash when predefined field does not exist.
29 2008-03-12 Marek Safar <marek.safar@gmail.com>
31 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
33 2008-03-12 Marek Safar <marek.safar@gmail.com>
35 * class.cs (FixedField): Don't crash when contructors are missing.
37 2008-03-11 Marek Safar <marek.safar@gmail.com>
39 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
40 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
41 check internal types accessibility for internal and external types.
42 Replaced EnumToUnderlying by GetEnumUnderlyingType.
44 2008-03-11 Marek Safar <marek.safar@gmail.com>
46 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
47 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
48 attribute.cs, statement: Use corect instance of predefined types (work
51 2008-03-07 Marek Safar <marek.safar@gmail.com>
53 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
55 2008-03-07 Marek Safar <marek.safar@gmail.com>
57 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
58 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
59 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
60 predefined types clean up, delayed predefined types members initialization
61 (work related to #364674).
63 2008-03-05 Marek Safar <marek.safar@gmail.com>
65 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
67 2008-03-05 Marek Safar <marek.safar@gmail.com>
69 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
70 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
71 predefined types clean up (work related to #364674).
73 2008-03-04 Marek Safar <marek.safar@gmail.com>
75 * ecore.cs: Print an error message instead of throwing exception.
77 2008-03-04 Marek Safar <marek.safar@gmail.com>
79 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
80 expression.cs, statement.cs: Unififed null literal representation.
82 2008-03-03 Marek Safar <marek.safar@gmail.com>
84 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
85 expression.cs: Refactored binary operators resolve phase and improved speed.
86 The nullable code is still missing and won't work correctly, more fixes
89 It also fixes #323726, #324312, #324248, and many other unreported issues.
91 2008-02-29 Zoltan Varga <vargaz@gmail.com>
93 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
96 2008-02-27 Marek Safar <marek.safar@gmail.com>
98 * ecore.cs: Clean-up and split BetterConversion.
100 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
103 * enum.cs (EnumMember.Value): Only access 'value' if
104 ResolveValue says it's ok.
105 (EnumMember.DoResolveValue): Don't set prev_member.value.
106 (Enum.GetDefinition): Reverse arguments of Equals --
107 EnumMember.Value can return 'null'.
109 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
111 2008-02-22 Marek Safar <marek.safar@gmail.com>
113 * generic.cs, expression.cs: More ongoing work on expression trees.
115 2008-02-21 Marek Safar <marek.safar@gmail.com>
117 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
118 handle missing matches when mutiple operators exist.
120 2008-02-20 Marek Safar <marek.safar@gmail.com>
122 A fix for bug #363218
123 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
126 2008-02-20 Marek Safar <marek.safar@gmail.com>
128 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
129 update. This time to deal correctly with SideEffectConstant expression used
130 as an argument for another constant folding.
132 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
134 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
137 2008-02-19 Marek Safar <marek.safar@gmail.com>
139 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
141 2008-02-19 Marek Safar <marek.safar@gmail.com>
143 A fix for bug #328136
144 * expression.cs: Do not fold immediately LogicalAnd operators when the left
145 side is a false constant, because we still need to evaluate the right-hand
148 * statement.cs (If): Emit two types of boolean constants (simple constant,
149 side-effect constant).
151 2008-02-19 Marek Safar <marek.safar@gmail.com>
153 * constant.cs (SideEffectConstant): Don't emit boolean constant.
155 * expression.cs: Fold immediately LogicalAnd operators when both sides are
158 2008-02-18 Marek Safar <marek.safar@gmail.com>
160 A fix for bug #361457
161 * ecore.cs (IsApplicable): Params methods have lower priority.
163 * support.cs: Return correct parameter modifier for params types.
165 2008-02-18 Marek Safar <marek.safar@gmail.com>
167 * generic.cs (TypeParameter): Cache attribute target name.
169 * support.cs: Removed unused variable.
171 * typemanager.cs: Removed debugging leftover.
173 * ecore.cs: Use local type instead of a property;
175 * class.cs (VerifyMembers): Consider also parent to test whether type member
178 * expression.cs (FullMethodDesc): Removed.
180 * attribute.cs (IsValidArgumentType): Made static.
182 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
184 Cleanup to be more readable.
185 * Makefile (GMCS_PROFILE): Remove.
186 (COMPILER_NAME): New helper.
188 2008-02-15 Miguel de Icaza <miguel@novell.com>
190 * cs-tokenizer.cs: if a conditional expression happens inside a
191 (...) this also means that we do not need to de-ambiguate between
192 an parenthesized expression and a cast.
196 * constant.cs (SideEffectConstant): a constant value that happens
197 to have a side effect.
199 Fixes the build regressions introduced by the fix for #359789
201 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
203 * expression.cs (Conditional.Emit): when emitting the ternary
204 operator, use local variables to generate code verifiable code.
206 The verifier cannot infer that the type on stack before the
207 stloc.0 is executed is of type ParentB. This happens because the
208 stack merge algorithm uses only parent types when deciding which
209 is the common type. This is described in Part III 1.8.1.3 of ECMA
212 This code compiled with mcs is not verifiable under MS. The MS
213 verifier picks the first common interface of Foo and Bar, which is
214 wrong, but doesn't use a full join type of the 2 interfaces.
216 CSC uses a clever hack to compile such code in a verifiable
217 way. It stores the intermediate values in a local variable with
222 2008-02-14 Miguel de Icaza <miguel@novell.com>
224 * expression.cs: Do not fold BitwiseAnd operators when the left
225 side is a false constant, because we still need to evaluate the
230 * support.cs: Instead of throwing an InternalErrorException when
231 the position of the stream is outside the boundary of our buffer,
232 reset the state of the reader, and restart the reading from the
233 beginning of the file.
235 2008-02-14 Marek Safar <marek.safar@gmail.com>
237 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
239 2008-02-14 Marek Safar <marek.safar@gmail.com>
241 A fix for bug #361686
242 * decl.cs: A protected types used inside a private class which parents
243 derives from the protected class are accessible.
245 2008-02-13 Marek Safar <marek.safar@gmail.com>
247 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
248 the parameterless constructor.
250 2008-02-13 Marek Safar <marek.safar@gmail.com>
252 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
253 lookup methods to use standard member cache when doing member lookup.
255 2008-02-12 Marek Safar <marek.safar@gmail.com>
257 * driver.cs: Don't report full path for referenced module as assembly error.
259 2008-02-12 Marek Safar <marek.safar@gmail.com>
261 * Makefile: Fixed `qh' target to work on all machines.
263 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
264 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
265 and HasElementType with TypeManager implementation.
267 2008-02-08 Marek Safar <marek.safar@gmail.com>
269 A fix for bugs #325134, #359749
270 * expression.cs, ecore.cs: Try to resolve an extension method even if the
271 first binds point to non-method member expression.
273 2008-02-08 Marek Safar <marek.safar@gmail.com>
275 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
277 2008-02-08 Marek Safar <marek.safar@gmail.com>
279 A fix for bugs #321394, #323028
280 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
281 Reworked naive IsAccessibleAs implementation to handle nested types.
283 2008-02-05 Jb Evain <jbevain@novell.com>
285 * class.cs: use generic type comparison for parameters
288 2008-02-05 Marek Safar <marek.safar@gmail.com>
290 A fix for bug #325372
291 * class.cs: Use generic type comparison when testing method signatures.
293 2008-02-05 Marek Safar <marek.safar@gmail.com>
295 A fix for bug #357047
296 * ecore.cs: Applied C# 3.0 changes to better conversion.
298 2008-02-05 Marek Safar <marek.safar@gmail.com>
300 A fix for bug #358374
301 * cs-parser.jay: Correctly set modifiers for all constructor types.
303 2008-02-04 Marek Safar <marek.safar@gmail.com>
305 A fix for bug #355251
306 * generic.cs: Added base class constraint based type inference.
308 2008-02-01 Marek Safar <marek.safar@gmail.com>
310 A fix for bug #357255
311 * decl.cs: One more missing visibility check.
313 2008-02-01 Marek Safar <marek.safar@gmail.com>
315 * support.cs: Fixed broken return.
317 2008-01-25 Marek Safar <marek.safar@gmail.com>
319 * report.cs: Correctly reset warnings count after probing.
321 2008-01-25 Martin Baulig <martin@ximian.com>
324 (NamespaceEntry.SymbolFileID): Make this work again after
325 MemberName.ToString() is gone.
327 2008-01-25 Marek Safar <marek.safar@gmail.com>
329 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
332 2008-01-25 Marek Safar <marek.safar@gmail.com>
334 * generic.cs: Use full implicit conversion for type inference fixing.
336 2008-01-24 Marek Safar <marek.safar@gmail.com>
338 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
339 Fixed user operator conversions.
341 2008-01-24 Marek Safar <marek.safar@gmail.com>
343 * generic.cs: Do nullable type to null comparison optimization during
346 2008-01-24 Marek Safar <marek.safar@gmail.com>
348 A fix for bug #355163
349 * generic.cs: Enabled l-value resolve on nullable expressions.
351 2008-01-24 Marek Safar <marek.safar@gmail.com>
353 A fix for bug #353986
354 * class.cs: Ingore static ctors with parameters for any further checks.
356 2008-01-24 Marek Safar <marek.safar@gmail.com>
358 A fix for bug #354310
359 * namespace.cs: Removed redundant check.
361 2008-01-24 Marek Safar <marek.safar@gmail.com>
363 A fix for bug #354928
364 * expression.cs: ElementInitializers can be resolved only once.
366 2008-01-24 Marek Safar <marek.safar@gmail.com>
368 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
369 Condition expressions.
371 2008-01-23 Marek Safar <marek.safar@gmail.com>
373 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
375 2008-01-22 Marek Safar <marek.safar@gmail.com>
377 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
380 * generic.cs: Implemented coalesce expression.
382 2008-01-22 Marek Safar <marek.safar@gmail.com>
384 A fix for bug #355145
385 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
386 expression tree type inference.
388 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
391 * expression.cs (Binary.IsUnsignedType): Fix typo.
393 2008-01-22 Marek Safar <marek.safar@gmail.com>
395 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
397 2008-01-22 Marek Safar <marek.safar@gmail.com>
399 A fix for bug #355161
400 * ecore.cs, expression.cs: Wider range of extension method supported
403 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
405 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
406 AssemblyBuilder to operate in compiler context. Fixes mcs part of
409 2008-01-22 Marek Safar <marek.safar@gmail.com>
411 A fix for bug #355148
412 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
414 2008-01-22 Miguel de Icaza <miguel@novell.com>
416 * expression.cs (CreateExpressionTree): Add support for or and
417 logical or, and indent following the coding conventions.
419 * typemanager.cs (LinqExpression): renamed from
420 ExpressionTreeManager, for a shorter name.
422 Use TypeManager.CoreLookupType to lookup types from our core
423 assemblies and turn those into "Type" variables.
425 Consumers that previously used "Namespace" and "Type" from this
426 class should instead use the TypeExpression which is a type that
427 is fully resolved (without involving the regular C# resolution
430 This typically looks like this:
432 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
433 new MemberAccess (texpr, name, type_arguments, loc)
435 This avoids the problem in: #355178
437 2008-01-21 Marek Safar <marek.safar@gmail.com>
439 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
440 feature in parser only as we do in other cases.
442 2008-01-21 Marek Safar <marek.safar@gmail.com>
444 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
445 typemanager.cs: A refactoring of params arguments to reuse existing
446 expressions (params -> array initializer) to emit params argument instead
447 of specialized handling.
448 It was required by expression tree implementation and it has other benefits
449 as well, we now apply same optimization for params arguments as we do for
452 2008-01-18 Marek Safar <marek.safar@gmail.com>
454 A fix for bug #353526
455 * generic.cs: A type inference of params arguments may not required any
456 temporary array creation.
458 2008-01-18 Marek Safar <marek.safar@gmail.com>
460 A fix for bug #353534
461 * generic.cs, ecore.cs, expression.cs: A method group type inference is
462 supported for delegates only.
464 2008-01-18 Marek Safar <marek.safar@gmail.com>
466 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
467 type for more than 1 candidates.
469 2008-01-18 Marek Safar <marek.safar@gmail.com>
471 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
474 2008-01-16 Marek Safar <marek.safar@gmail.com>
476 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
477 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
478 operator) expressions.
480 2008-01-16 Zoltan Varga <vargaz@gmail.com>
482 * statement.cs: Avoid declaring an IL variable for this_variable since it is
483 not accessed from the generated IL.
485 2008-01-14 Marek Safar <marek.safar@gmail.com>
487 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
488 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
489 statement.cs: The first expression tree implementation drop, mostly
492 2008-01-14 Marek Safar <marek.safar@gmail.com>
494 * ecore.cs (IsNestedChild): Refactored.
496 2008-01-11 Marek Safar <marek.safar@gmail.com>
498 * lambda.cs: Don't use a cast on unknown expression statement.
500 2008-01-10 Geoff Norton <gnorton@novell.com>
502 * cs-tokenizer.cs: One more token to distinguish between method and lambda
505 2008-01-09 Marek Safar <marek.safar@gmail.com>
507 * doc.cs: Report better /doc crash details.
509 2008-01-09 Marek Safar <marek.safar@gmail.com>
511 A fix for bug #352536
512 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
514 2008-01-08 Marek Safar <marek.safar@gmail.com>
516 A fix for bug #352287
517 * ecore.cs, expression.cs: Do `this' access checking in all member access
520 2008-01-08 Marek Safar <marek.safar@gmail.com>
522 * rootcontext.cs, driver.cs: Switch to linq mode by default.
524 * report.cs: Reset message stacks.
526 2008-01-08 Marek Safar <marek.safar@gmail.com>
528 * generic.cs (InferInPhases): Correctly calculate params position.
530 2008-01-08 Marek Safar <marek.safar@gmail.com>
532 * cs-tokenizer.cs: No need to parse full string when parsing lambda
535 2008-01-07 Marek Safar <marek.safar@gmail.com>
537 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
539 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
541 * driver.cs: Updated --help option.
543 2008-01-07 Marek Safar <marek.safar@gmail.com>
545 * generic.cs (InferParamsTypeArguments): Removed.
546 (InferInPhases): Add params type inference.
547 (LowerBoundInference): Fixed scoring mechanism.
549 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
551 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
553 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
554 byte array for unsigned "baked" assemblies.
556 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
558 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
559 array for assemblies that are not strongnamed.
561 2008-01-04 Marek Safar <marek.safar@gmail.com>
563 A fix for bug #351481
564 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
565 declaring type for nested generic types.
567 2008-01-04 Marek Safar <marek.safar@gmail.com>
569 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
572 2008-01-03 Marek Safar <marek.safar@gmail.com>
574 A fix for bug #351047
575 * expression.cs (Binary.ResolveOperator): Allow equality operators between
576 null and structs only when equality and inequality operators are defined
577 either as an user-operators or predefined operators.
579 2008-01-03 Marek Safar <marek.safar@gmail.com>
581 A fix for bug #351047
582 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
584 2008-01-03 Marek Safar <marek.safar@gmail.com>
586 A fix for bug #351257
587 * cs-tokenizer.cs: Advance line number for '\r' correctly.
589 2008-01-03 Marek Safar <marek.safar@gmail.com>
591 A fix for bug #351157
592 * class.cs (Using): Fixed yet another broken cloning.
594 (Block): Put back more sensible default value for statements.
596 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
598 * codegen.cs: Allow AssemblyVersion with only major version component.
601 2007-12-29 Marek Safar <marek.safar@gmail.com>
603 A fix for bug #324654
604 * class.cs: Use FullName property as member name.
606 2007-12-28 Marek Safar <marek.safar@gmail.com>
608 A fix for bug #342117
609 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
610 constructor constraint.
612 2007-12-28 Marek Safar <marek.safar@gmail.com>
614 A fix for bug #338273
615 * class.cs (ProbertyBase): Access modifier checks are required for overrides
618 2007-12-28 Marek Safar <marek.safar@gmail.com>
620 A fix for bug #350839
621 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
623 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
625 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
628 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
630 * statement.cs: Changed some Hashtables to use HybridDictionaries
631 instead. It was observed that some HashTables only contained a few
632 items in the vast majority of cases. Since HybridDictionary is
633 more efficient on small sets (<10 elements), "known_variables"
634 from class ExplicitBlock as well as "labels" and "constants " from
635 class Block were changed to HybridDictionaries.
637 Atsai results: (56216kb->54987kb)
639 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
642 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
644 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
647 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
649 * expression.cs: foreach loop to for loop, saved on allocation of
650 enumerator (59333kb->59141kb)
652 * statement.cs. Changed foreach loops to for loops, saved on
653 allocation of enumerator (59141kb->59006kb)
655 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
656 when constructed with no specified capacity. This was causing a
657 few ArrayLists to allocate more memory than they would potentially
658 need in the Block class and MemberCache class. Setting the
659 ArrayLists to construct with a capacity of 1 saves some
660 memory. (56216kb->55585kb)
662 2007-12-27 Marek Safar <marek.safar@gmail.com>
664 A fix for bug #347189 (2nd issue)
665 * expression.cs (MemberAccess): Nested type can be found in base non-generic
668 2007-12-27 Miguel de Icaza <miguel@novell.com>
670 * report.cs: Do not use colors if stdout and stderr are not a
673 2007-12-27 Marek Safar <marek.safar@gmail.com>
675 A fix for bug #346998
676 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
679 2007-12-27 Marek Safar <marek.safar@gmail.com>
681 A fix for bug #343465
682 * class.cs: Explicit method name for nested types uses dots only.
684 2007-12-27 Marek Safar <marek.safar@gmail.com>
686 A fix for bug #343707
687 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
689 2007-12-27 Marek Safar <marek.safar@gmail.com>
691 * ecore.cs: Report type inference errors only when arguments count matches
694 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
696 * expression.cs, report.cs: New warning.
698 * typemanager.cs: Catch anonymous method type too.
700 2007-12-23 Marek Safar <marek.safar@gmail.com>
702 A fix for bug #346379
703 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
705 2007-12-23 Marek Safar <marek.safar@gmail.com>
707 A fix for bug #347359
708 * expression.cs (Invocation): Don't resolve already resolved expression.
710 2007-12-23 Marek Safar <marek.safar@gmail.com>
712 A fix for bug #347189
713 * class.cs (FixedField): Use non-dependent code only in the define phase.
715 2007-12-23 Marek Safar <marek.safar@gmail.com>
717 A fix for bug #348076
718 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
720 2007-12-22 Marek Safar <marek.safar@gmail.com>
722 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
723 discovered extension methods.
725 2007-12-22 Marek Safar <marek.safar@gmail.com>
727 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
730 2007-12-21 Miguel de Icaza <miguel@novell.com>
732 * report.cs (ErrorMessage): Add support for using colors on
733 terminals that support it.
735 2007-12-21 Marek Safar <marek.safar@gmail.com>
737 * ecore.cs: Use information about expanded params for error reporting.
739 2007-12-21 Marek Safar <marek.safar@gmail.com>
741 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
742 and logic for params overloads.
744 2007-12-15 Miguel de Icaza <miguel@novell.com>
746 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
747 as this is also created from the parser. Fixes #349034
749 2007-12-12 Miguel de Icaza <miguel@novell.com>
751 * statement.cs (Throw.CloneTo): it is valid to have empty
752 expressions for throw.
754 2007-12-03 Marek Safar <marek.safar@gmail.com>
756 * cs-parser.jay: Set delegate constraint parsing region correctly.
758 2007-12-03 Marek Safar <marek.safar@gmail.com>
760 A fix for bug #345467
761 * typemanager.cs (IsEqual): Compare generic parameters position only.
763 2007-11-28 Marek Safar <marek.safar@gmail.com>
765 * expression.cs (BaseAccess): Type arguments can be null.
767 2007-11-27 Raja R Harinath <harinath@gmail.com>
769 * statement.cs (Block.Resolve): Ensure flow-branching tree is
770 consistent even when an error has occured.
771 (Switch.Resolve): Likewise.
773 2007-11-22 Marek Safar <marek.safar@gmail.com>
775 A fix for bug #334505
776 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
779 2007-11-22 Marek Safar <marek.safar@gmail.com>
781 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
782 refactorings required to resolve extension methods correctly when mixing
783 generics and non-generics members.
785 2007-11-20 Marek Safar <marek.safar@gmail.com>
787 A fix for bug #342584
788 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
791 2007-11-19 Marek Safar <marek.safar@gmail.com>
793 A fix for bug #342512
794 * delegate.cs: Use delegate argument expression when is available. Don't
795 emit virtual call when class is sealed.
797 2007-11-16 Marek Safar <marek.safar@gmail.com>
799 A fix for bug #325423
800 * assign.cs (FieldInitializer): Use resolved expression for emit.
802 * class.cs: Print less confusing error message.
804 2007-11-16 Marek Safar <marek.safar@gmail.com>
806 * cs-tokenizer.cs: Removed GMCS ifdefs.
808 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
811 * cs-parser.jay: Disabled nullable check.
813 * generic-mcs: Copied more generic stuff.
815 2007-11-16 Marek Safar <marek.safar@gmail.com>
817 * gcs-parser.jay: Merged to cs-parser.jay.
819 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
820 * *.csproj, *.sources: Updated to use only jay parser file.
822 2007-11-16 Marek Safar <marek.safar@gmail.com>
824 * gcs-parser.jay: Added nullable and default expression feature checks.
826 2007-11-16 Marek Safar <marek.safar@gmail.com>
828 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
829 it fixes many TODOs and hidden bugs.
831 * expression: Removed duplicate error check.
833 2007-11-15 Marek Safar <marek.safar@gmail.com>
835 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
836 implicitly type local variable only when it is used in a declaration.
838 2007-11-15 Marek Safar <marek.safar@gmail.com>
840 * attribute.cs: Use CS0612 for empty strings.
842 2007-11-14 Marek Safar <marek.safar@gmail.com>
844 * lambda.cs, statement.cs: Contextual return may act as a statement.
846 2007-11-14 Marek Safar <marek.safar@gmail.com>
848 A fix for a regression cause by #324222
849 * class.cs: Don't report unused even when it implements an interface.
851 2007-11-13 Marek Safar <marek.safar@gmail.com>
853 A fix for bug #341205
854 * ecore.cs, expression.cs: Method group expression cannot do static
855 method access with an instance reference check before overloading takes
858 2007-11-13 Marek Safar <marek.safar@gmail.com>
860 A fix for bug #325359
861 * class.cs: Use predictable name for automatically generated property.
863 2007-11-12 Marek Safar <marek.safar@gmail.com>
865 A fix for bug #324996
866 * expression.cs (Is): Handle case where D is nullable and T is not
869 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
871 2007-11-12 Marek Safar <marek.safar@gmail.com>
873 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
874 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
875 Flush small error reporting changes.
877 2007-11-09 Marek Safar <marek.safar@gmail.com>
879 A fix for bug #324996
880 * expression.cs: Rewrote Is expression implementation to work with
881 generics, nullable types, anonymous method. A const result expression
882 uses existing infrastructure instead of custom not fully-featured one.
884 2007-11-08 Marek Safar <marek.safar@gmail.com>
886 A fix for bug #340202
887 * class.cs: Consider generics for volatile field.
889 2007-11-08 Marek Safar <marek.safar@gmail.com>
891 A fix for bug #335594
892 * expression.cs: Use conversion rules when handling string addition.
894 2007-11-07 Marek Safar <marek.safar@gmail.com>
896 A fix for bug #336651
897 * expression.cs: Fixed a crash when probing is on.
899 2007-11-07 Marek Safar <marek.safar@gmail.com>
901 A fix for bug #324242
902 * covert.cs: Added a conversion from any nullable-type with an
903 underlying enum-type to the type System.Enum.
905 2007-11-07 Marek Safar <marek.safar@gmail.com>
907 A fix for bug #324222
908 * class.cs: Report all non-used event fields.
910 2007-11-07 Marek Safar <marek.safar@gmail.com>
912 A fix for bug #325161
913 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
914 qualifier for generic types.
916 2007-11-07 Marek Safar <marek.safar@gmail.com>
918 A fix for bug #322971
919 * expression.cs, ecore.cs: Added intermediate result value check for
922 2007-11-07 Marek Safar <marek.safar@gmail.com>
924 A fix for bug #324754
925 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
926 when it was requested.
928 2007-11-07 Marek Safar <marek.safar@gmail.com>
930 A fix for bug #325101
931 * expression.cs: Do type not value comparison for `is' expression.
933 2007-11-07 Marek Safar <marek.safar@gmail.com>
935 A fix for bug #320236
936 * convert.cs: Don't apply user conversion on underlying target type.
938 2007-11-06 Marek Safar <marek.safar@gmail.com>
940 * expression.cs: Don't use unresolved expression for error reporting.
942 2007-11-06 Marek Safar <marek.safar@gmail.com>
944 A fix for bugs #337712, #324490
945 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
946 overloading resolution too.
948 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
949 the process consistent and more robust.
951 * expression.cs, linq.cs, report.cs: Update.
953 2007-11-02 Marek Safar <marek.safar@gmail.com>
955 A fix for bug #332909
956 * attribute.cs: Resolve attributes in correct context using error
959 * rootcontext.cs: Define Obsolete attribute members as core members.
961 2007-11-02 Marek Safar <marek.safar@gmail.com>
963 * statement.cs: Removed unused methods.
965 2007-10-31 Wade Berrier <wberrier@novell.com>
967 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
968 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
971 2007-10-31 Marek Safar <marek.safar@gmail.com>
973 A fix for bug #338102
974 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
975 methods registered as non-generics.
977 2007-10-31 Marek Safar <marek.safar@gmail.com>
979 A fix for bugs #337712, #324490
980 * delegate.cs: Delegate covariance and contravariance is not allowed for
983 2007-10-31 Marek Safar <marek.safar@gmail.com>
985 A fix for bug #337719
986 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
989 2007-10-30 Marek Safar <marek.safar@gmail.com>
991 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
993 2007-10-29 Marek Safar <marek.safar@gmail.com>
995 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
998 2007-10-29 Raja R Harinath <rharinath@novell.com>
1000 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
1002 2007-10-29 Marek Safar <marek.safar@gmail.com>
1004 A fix for bug #334652
1005 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
1006 extension methods when we have not found the best candidate in normal
1009 2007-10-27 Marek Safar <marek.safar@gmail.com>
1011 * AssemblyInfo.cs: Keep up-to-date.
1013 2007-10-27 Marek Safar <marek.safar@gmail.com>
1015 * Makefile: Fixed generics compiler name.
1017 2007-10-27 Marek Safar <marek.safar@gmail.com>
1019 * lambda.test: removed, lambda parsing is done differently.
1021 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
1023 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
1025 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
1027 2007-10-27 Marek Safar <marek.safar@gmail.com>
1029 * Makefile, *.sources : All C# compilers are in mcs folder.
1031 * *.cs: Use existing 2_1 define for smcs.
1033 2007-10-26 Marek Safar <marek.safar@gmail.com>
1035 A fix for bug #335847
1036 * assign.cs, expression.cs: Couple of changes to avoid creating a
1037 temporary variable for each object initializer assignment statement. It
1038 simplifies struct initialization too, otherwise two temporary variables
1040 Implemented optimization of redundant default element initializers.
1042 2007-10-25 Marek Safar <marek.safar@gmail.com>
1044 A fix for bug #336766
1045 * expression.cs (Class.CheckBase): Use generic name when method is
1048 2007-10-25 Marek Safar <marek.safar@gmail.com>
1050 A fix for bug #334737
1051 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
1052 variable and not variable argument for prepared copies.
1054 2007-10-24 Marek Safar <marek.safar@gmail.com>
1056 A fix for bug #325110
1057 * class.cs, expression.cs, attribute.cs: Use open generic method when
1058 checking conditional attribute.
1060 2007-10-24 Marek Safar <marek.safar@gmail.com>
1062 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
1063 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
1064 FeatureIsNotAvailable.
1066 2007-10-24 Marek Safar <marek.safar@gmail.com>
1068 ** C# 3.0 Partial methods
1070 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
1071 methods support. Because of member cache issue with generics only
1072 non-generics partial methods are fully supported.
1074 2007-10-23 Marek Safar <marek.safar@gmail.com>
1076 * class.cs, decl.cs: Rewrote member overloads check to cope with
1077 generics and to use member cache for member checking. It also improves
1078 performance and fixes remaining overloads issues.
1080 2007-10-20 Marek Safar <marek.safar@gmail.com>
1082 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
1083 roottypes.cs, typemanager.cs:
1085 A member cache creation logic changed to add members immediately and
1086 not rely on fallback. The member cache is now only prefered way
1087 how to access and find type declaration members. It saves 5 MB of memory
1088 during MWF compilation and makes code ready for more optimizations and
1089 clean-ups, it's also a pre-requirement for partial methods.
1091 2007-10-18 Raja R Harinath <harinath@gmail.com>
1093 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
1094 handling for generic parameters.
1096 2007-10-15 Marek Safar <marek.safar@gmail.com>
1098 * class.cs (FixedField): Removed redundant volatile check.
1100 2007-10-15 Marek Safar <marek.safar@gmail.com>
1102 * class.cs, decl.cs: Fixed overload members verification to do only one
1103 check per possible collision.
1105 2007-10-13 Marek Safar <marek.safar@gmail.com>
1107 A fix for bug #325478
1108 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
1109 and create only one disposable flags container.
1111 2007-10-12 Marek Safar <marek.safar@gmail.com>
1113 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
1114 * statement.cs (Fixed): Fixed variables cloning.
1116 2007-10-12 Marek Safar <marek.safar@gmail.com>
1118 A fix for bug #333342
1119 * class.cs (EventField): Don't mark value type event as synchronized.
1121 2007-10-12 Marek Safar <marek.safar@gmail.com>
1123 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
1124 inference to identify best candidate method correctly.
1125 (ProperyExpr): A range variable is read only and cannot be modified.
1127 2007-10-11 Marek Safar <marek.safar@gmail.com>
1129 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
1130 logic to identify best candidate method correctly.
1132 2007-10-11 Marek Safar <marek.safar@gmail.com>
1134 * location.cs (Equals, GetHashCode): Removed.
1136 2007-10-11 Marek Safar <marek.safar@gmail.com>
1138 * report.cs: Implemented message recorder. It is used mainly for lambda
1139 expressions to capture otherwise swallowed error messages.
1141 * anonymous.cs, lambda.cs.cs: Do full parameters check.
1143 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
1145 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
1147 * expression.cs (MemberAccess): Always report lookup failure.
1149 * location.cs: Implemented Equals, GetHashCode.
1151 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
1153 2007-10-10 Jb Evain <jbevain@novell.com>
1155 * codegen.cs: re-enable assembly version check.
1157 2007-10-09 Marek Safar <marek.safar@gmail.com>
1159 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
1162 * namespace.cs (UsingAlias): Do correct version check.
1164 2007-10-08 Marek Safar <marek.safar@gmail.com>
1166 * expresison.cs, ecore.cs: Issue extension method error message when
1169 * rootcontext.cs: Added ISO_2 compiler mode option.
1171 2007-10-08 Marek Safar <marek.safar@gmail.com>
1173 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
1176 2007-10-08 Marek Safar <marek.safar@gmail.com>
1178 * attribute.cs (GetString, GetBoolean): Work with both literal and
1181 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
1182 Moved method overload specific methods to MethodGroupExpr.
1184 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
1185 it should be less memory consuming.
1187 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
1189 * codegen.cs: remove the assembly version check until the buildbot is
1192 2007-10-07 Jb Evain <jbevain@novell.com>
1194 * attribute.cs (Attribute.GetString): if the value
1195 expression is a StringConstant, return its string value.
1197 2007-10-07 Jb Evain <jbevain@novell.com>
1199 * typemanager.cs: add `assembly_version_attribute_type`.
1200 * codegen.cs: on attribute emission, check that the
1201 AssemblyVersionAttribute doesn't overflow.
1203 2007-10-05 Marek Safar <marek.safar@gmail.com>
1205 A fix for bug #324677
1206 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
1207 parent container of a scope container with currently resolved one.
1209 2007-10-05 Marek Safar <marek.safar@gmail.com>
1211 A fix for bug #325534
1212 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
1215 2007-10-05 Marek Safar <marek.safar@gmail.com>
1217 A fix for bug #327504
1218 * class.cs (Operator.Define): Refactored implicit and explicit user
1219 operator conversion rules.
1221 2007-10-05 Marek Safar <marek.safar@gmail.com>
1223 A fix for bug #327520
1224 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
1226 2007-10-04 Marek Safar <marek.safar@gmail.com>
1228 A fix for bug #328022
1229 * class.cs (MethodData.Define): Use correct method to check whether
1230 a method implementents an accessor.
1232 2007-10-04 Marek Safar <marek.safar@gmail.com>
1234 A fix for bug #330069
1235 * statement.cs (Fixed.Resolve): Read the first array element only when
1236 an array is instantiated.
1238 2007-10-04 Marek Safar <marek.safar@gmail.com>
1240 * expression.cs, assign.cs, generics.cs: Print correct operator when
1241 compound assignment is used.
1243 2007-10-04 Marek Safar <marek.safar@gmail.com>
1245 A fix for bug #325841
1246 * expression.cs (ArrayAccess): Use full argument cloning only for
1247 string compound concatenation.
1249 2007-10-03 Marek Safar <marek.safar@gmail.com>
1251 A fix for bug #328774
1252 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
1254 (PropertyExpr.EmitAssign): Fixed string concatenation compound
1257 2007-10-03 Raja R Harinath <rharinath@novell.com>
1260 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
1261 Event accessibility checks here. Remove some bogus code that
1262 accidently made GenericMethods work.
1263 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
1265 2007-09-25 Marek Safar <marek.safar@gmail.com>
1267 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
1269 * statement.cs (Block): Refactored AddVariable to allow error handling
1272 * generic.cs: New stub.
1274 2007-09-23 Marek Safar <marek.safar@gmail.com>
1276 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
1279 2007-09-17 Marek Safar <marek.safar@gmail.com>
1281 * class.cs: Use partial container to record whether any partial part
1282 contains static field initializer and therefore default contructor has
1285 2007-09-14 Marek Safar <marek.safar@gmail.com>
1287 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
1288 mono-list when only one of two partial parts has defined accessibility
1291 2007-09-14 Marek Safar <marek.safar@gmail.com>
1293 A fix for bug #82845
1295 * class.cs (TypeContainer): Set correct resolve context for all field
1298 2007-09-13 Marek Safar <marek.safar@gmail.com>
1300 * assign.cs: Fixed a crash when field is resolved twice with an error.
1302 * codegen.cs: Changed InFieldInitializer to be flag.
1304 * anonymous.cs, ecore.cs, expression.cs: Update after
1305 IsInFieldInitializer rename.
1307 * const.cs: Removed unused parameter.
1309 * class.cs: Changed the way how we resolve and emit field initializers.
1310 The field initilizers have to have access to contructor block to emit
1311 compiler generated code.
1313 2007-09-13 Marek Safar <marek.safar@gmail.com>
1315 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
1316 generics use TypeContainer instead.
1318 2007-09-12 Marek Safar <marek.safar@gmail.com>
1320 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
1322 * lambda.cs (ResolveParameters): Use more powerful
1323 InflateGenericArgument.
1325 * parameters.cs: Better exception message.
1327 2007-09-10 Marek Safar <marek.safar@gmail.com>
1329 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
1330 correct expression block type.
1332 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
1334 * expression.cs (Invocation): Extracted method group resolve to
1337 2007-09-07 Marek Safar <marek.safar@gmail.com>
1339 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
1340 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
1342 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
1343 generic extension methods.
1345 2007-09-06 Marek Safar <marek.safar@gmail.com>
1347 A fix for bug #82676 (Do I get it right now?)
1348 * convert.cs (Binary.ResolveOperator): An interface is converted to the
1349 object before a standard conversion is applied.
1351 2007-09-06 Marek Safar <marek.safar@gmail.com>
1353 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
1356 2007-09-05 Marek Safar <marek.safar@gmail.com>
1358 A fix for bug #82676
1359 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
1360 non-generic interface types.
1362 2007-09-05 Marek Safar <marek.safar@gmail.com>
1364 A fix for bug #82690
1365 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
1367 2007-09-05 Marek Safar <marek.safar@gmail.com>
1369 A fix for bug #82571
1370 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
1371 modifier for container based methods.
1373 2007-09-05 Marek Safar <marek.safar@gmail.com>
1375 A fix for bug #82676
1376 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
1377 any interface-type T means to any of interface type T.
1379 2007-09-04 Marek Safar <marek.safar@gmail.com>
1381 * namespace.cs: We have 2 versions of System.Core assembly.
1383 2007-09-04 Marek Safar <marek.safar@gmail.com>
1385 A fix for bug #82652
1386 * class.cs (Class.GetClassBases): Compare types and not expressions.
1388 2007-09-04 Marek Safar <marek.safar@gmail.com>
1390 A fix for bug #82620
1391 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
1392 actually never worked before.
1393 (IndexerAccess): Emit prepared arguments before they are modified.
1395 2007-09-04 Marek Safar <marek.safar@gmail.com>
1397 A fix for bug #82563
1398 * assign.cs: Revert wrong fix.
1400 * expression.cs (VariableReference.EmitAssign): Handle ref reference
1402 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
1403 Instead of ldelema/stdind we have to use temporary variables to handle
1404 cases like String.Concat (params string[]).
1406 2007-08-31 Marek Safar <marek.safar@gmail.com>
1408 * class.cs: EmitAttributes to Emit rename.
1410 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
1412 (MemberCore.HasClsCompliantAttribute): Don't depend on
1413 GetClsCompliantAttributeValue execution.
1415 2007-08-31 Marek Safar <marek.safar@gmail.com>
1417 * anonymous.cs: Use shorter type prefix.
1419 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
1422 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
1423 variables when probing is on.
1425 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
1426 unresolved variables.
1427 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
1428 handle transparent identifiers.
1430 2007-08-26 Marek Safar <marek.safar@gmail.com>
1432 * attribute.cs (IsClsCompliant): Add nullable types test.
1434 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
1436 * doc.cs : catch other types of exception than XmlException to
1437 report CS1570. Fixed bug #82565.
1439 2007-08-23 Marek Safar <marek.safar@gmail.com>
1441 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
1442 The number of delegate parameters has to match.
1443 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
1446 2007-08-21 Marek Safar <marek.safar@gmail.com>
1448 * anonymous.cs (AnonymousMethod): Generate private anonymous method
1449 to fix problem with private arguments.
1451 2007-08-20 Marek Safar <marek.safar@gmail.com>
1453 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
1455 * decl.cs (MemberName): Ignore generic type with no generic arguments.
1457 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
1458 empty. Add cloning suport.
1460 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
1462 2007-08-20 Marek Safar <marek.safar@gmail.com>
1464 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
1465 to create EmptyCast. It handles EmptyConstantCast specialization for
1468 2007-08-18 Marek Safar <marek.safar@gmail.com>
1470 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
1471 (EmitArrayArgument): One routine for array arguments.
1472 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
1474 2007-08-17 Marek Safar <marek.safar@gmail.com>
1476 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
1478 2007-08-17 Marek Safar <marek.safar@gmail.com>
1480 * anonymous.cs: MemberLookupFinal update.
1482 * class.cs (ConstructorInitializer): Is expression based.
1484 * delegate.cs: MethodGroupExpr update.
1486 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
1488 (Error_MemberLookupFailed): Customizable error override.
1489 (MethodGroupExpr): Keep queried type for later usage.
1490 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
1493 * expression.cs: Error_MemberLookupFailed refactoring.
1494 (New.DoResolve): Resolve as much as possible.
1495 (ElementInitializer.Error_MemberLookupFailed): Object initializer
1496 customization for invalid member types.
1498 * statement.cs: MethodGroupExpr update.
1500 2007-08-16 Marek Safar <marek.safar@gmail.com>
1502 * modifier.cs (Check): Check all modifiers and not only accessibility
1505 2007-08-16 Marek Safar <marek.safar@gmail.com>
1507 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
1508 type and not an expression.
1510 2007-08-16 Marek Safar <marek.safar@gmail.com>
1512 * statement.cs (Catch.Clone): Type and variable can be null.
1514 2007-08-16 Marek Safar <marek.safar@gmail.com>
1516 A fix for bug #81979
1517 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
1518 I am really not sure whether this is the best fix.
1520 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
1523 2007-08-14 Marek Safar <marek.safar@gmail.com>
1525 ** C# 3.0 Object and collection initializers (major re-write)
1527 * assign.cs (DoResolve): Initializers are not assign related.
1529 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
1530 used during collection or object initialization.
1532 * expression.cs (Error_InvalidArguments): Add initializers specific
1533 messages. More will come later because it requires some general
1535 (New.DoResolve): Better error handling for unsafe types.
1536 (EmptyExpressionStatement): New class.
1537 (ElementInitializer): An object initializer expression.
1538 (CollectionElementInitializer): A collection initializer expression.
1539 (CollectionOrObjectInitializers): A block of object or collection
1541 (NewInitialize): New expression with element/object initializers.
1543 * statement.cs: Reverted object/collection initializer hacks.
1545 * typemanager.cs (CSharpName): Filter __arglist type.
1547 2007-08-09 Marek Safar <marek.safar@gmail.com>
1549 ** C# 3.0 Anonymous Types (update to the latest standard)
1551 * expression.cs (Binary.ResolveOperator): Threat all null based types
1553 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
1554 (AnonymousTypeParameter): Updated.
1556 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
1557 (AnonymousTypeClass): New anonymous type container.
1559 * class.cs (AddField): Return operation result.
1561 * generic.cs: Another empty TypeArguments overload.
1563 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
1564 are stored at top of normal hierarchy.
1566 * typemanager.cs (CSharpName): Filter anonymous types.
1568 2007-08-09 Marek Safar <marek.safar@gmail.com>
1570 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
1571 as single Concat call. How could we miss that :-(
1573 2007-08-08 Marek Safar <marek.safar@gmail.com>
1575 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
1577 2007-08-07 Miguel de Icaza <miguel@novell.com>
1579 * expression.cs: Fix the previous commit, the creation of the
1580 arguments array list needs also to be conditional on the arguments
1583 * class.cs: Add a little bit of help to help narrow down problems.
1585 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
1586 not try to copy in that case.
1588 * driver.cs: When building SMCS, include a new different set of
1589 default assemblies here. Do this here so we can control whether
1590 to include the default assemblies with /noconfig.
1592 2007-08-03 Marek Safar <marek.safar@gmail.com>
1594 A fix for bug #81979
1595 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
1598 2007-08-03 Marek Safar <marek.safar@gmail.com>
1600 A fix for bug #82300
1602 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
1603 we are in probing scope.
1605 2007-08-03 Marek Safar <marek.safar@gmail.com>
1607 A fix for bug #82301
1609 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
1610 (Statement.CloneTo): Clone and not map children blocks.
1612 2007-08-03 Marek Safar <marek.safar@gmail.com>
1614 A fix for bug #82299
1616 * expression.cs (LocalVariableReference.CloneTo): Remap local info
1619 * statement.cs (Statement.CloneTo): Clone variables before statements
1620 to allow remaping of local variables.
1622 2007-08-03 Marek Safar <marek.safar@gmail.com>
1624 A fix for bug #82296
1627 * report.cs: Log crash details for future clone problems.
1629 * statement.cs (Return.Clone): Don't clone non-existent expression.
1631 2007-08-03 Raja R Harinath <harinath@gmail.com>
1633 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
1634 (Class.AddBasesForPart): Move CS0537 check here from ...
1635 * cs-parser.jay (class_declaration): ... here. Move calling of
1636 'AddBasesForPart' to ...
1637 (class_bases): ... here.
1638 (struct_declaration, interface_declaration): Update to changes.
1640 2007-08-02 Marek Safar <marek.safar@gmail.com>
1642 A fix for bug #81923
1644 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
1645 conversion is allowed.
1647 2007-08-02 Marek Safar <marek.safar@gmail.com>
1649 A fix for bug #81564
1651 * ecore.cs (EventExpr): Add IsBase handling.
1653 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
1656 2007-08-02 Raja R Harinath <harinath@gmail.com>
1658 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
1659 * cs-parser.jay: Some whitespace cleanups.
1660 (current_delegate): New.
1662 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
1663 a dummy code block, and use 'type_name' instead of 'member_name'.
1664 (interface_declaration, class_declaration): Likewise.
1665 (delegate_declaration): Likewise. Rearrange slightly and use
1667 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
1668 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
1670 2007-08-02 Marek Safar <marek.safar@gmail.com>
1672 A fix for bug #82039
1674 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
1677 * typemanager.cs (CSharpName): Split to string overload.
1679 2007-08-02 Marek Safar <marek.safar@gmail.com>
1682 * report.cs: Updated warning CS0472.
1684 2007-08-01 Marek Safar <marek.safar@gmail.com>
1686 A fix for bug #82181
1688 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
1690 2007-08-01 Marek Safar <marek.safar@gmail.com>
1692 A fix for bug #82277
1693 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
1695 2007-08-01 Marek Safar <marek.safar@gmail.com>
1697 ** C# 3.0 Type Inference (major bits are working)
1699 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
1700 (.ImplicitStandardConversionExists): Uses compatible.
1701 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
1702 (.InferReturnType): New method.
1703 (.Compatible): Refactored.
1704 (.ResolveParameters): Uses factory to create resolved parameters.
1705 (.CompatibleMethod): Add probing mode support.
1706 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
1707 clearly distinguish between 2 different operations.
1708 (LambdaMethod): Moved to lambda.cs.
1709 (AnonymousMethod): Removed unused fields and methods.
1710 (AnonymousDelegate): Simplified.
1712 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
1714 * convert. cs (ImplicitConversionStandard): Compatible works differently.
1716 * delegate.cs (Delegate): New mehods to reduce code duplication.
1717 (.GetConstructor): New method.
1718 (.GetInvokeMethod): New method.
1719 (DelegateCreation): Updated.
1721 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
1723 (OverloadResolve): Made probing little bit faster.
1725 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
1728 * generic.cs (TypeInferenceContext): Dummy implementation.
1730 * iterators.cs: Updated after Resolve/Define rename.
1732 * lambda.cs (LambdaExpression)
1733 (.ResolveParameters): Handles both type of arguments and type inference too.
1735 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
1736 (InflateTypes): Updated.
1738 * support.cs (InflateTypes): Changed signature and updated.
1740 * typemanager.cs (LookupMemberCache): Better dynamic type check.
1741 (MemberLookup_FindMembers): More MS tricks.
1742 (GetParameterData): Ditto.
1743 (GetDelegateParameters): Uses quick path for dynamic types.
1745 2007-08-01 Marek Safar <marek.safar@gmail.com>
1747 * class.cs (MethodData.Define): EmitContext is required for generic stuff
1750 2007-07-31 Marek Safar <marek.safar@gmail.com>
1752 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
1755 2007-07-26 Jb Evain <jbevain@novell.com>
1757 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
1758 which takes a boolean 'report_errors', similar to the GetMethod.
1759 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
1760 in .net 2.1, do not report errors here.
1762 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
1763 System.Runtime.CompilerServices.RequiredAttributeAttribute and
1764 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
1767 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
1768 of the type InternalsVisibleToAttribute before the first call
1769 to CoreLookupType which is allowed to fail (third boolean parameter
1770 to true). Because, during the resolution for a type that is not
1771 immediately found, we try to check if the type is not defined in
1772 a friend assembly, and to do so, we need the
1773 InternalVisibleToAttribute.
1775 2007-07-23 Miguel de Icaza <miguel@novell.com>
1777 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
1778 feature that allows structs to be compared against null and inline
1779 the result as true or false.
1781 Notice that the same code is not permitted inside a generic block
1782 of code that would do:
1784 class Foo<T> where T : struct {
1791 It is only allowed if the type of T is not bound (no where
1792 clause). In my opinion, this CSC 2 behavior is broken but people
1793 seem to be using it (IronRuby does, a few bug reports on bugzilla
1794 have it and some people have complained about it).
1796 All of the users that depend on this behavior have code that is
1799 * report.cs (Warning, Error): make these take object arguments,
1800 not strings, as that allows us to take advantage of Format.
1802 2007-07-20 William Holmes <billholmes54@gmail.com>
1804 * decl.cs: Changed MemberName.CountTypeArguments to also check the
1805 Left member variable for the Count.
1806 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
1807 MemberName.CountTypeArguments to avoid a NRE.
1809 This code is contributed under the MIT X11 license
1811 2007-07-18 Marek Safar <marek.safar@gmail.com>
1813 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
1815 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
1817 * doc.cs : generic method arguments are written as ``x while generic
1818 type arguments are `x. Combined with the previous change, fixed bug
1821 2007-07-18 Raja R Harinath <rharinath@novell.com>
1824 * expression.cs (Binary.ResolveOperator): When converting
1825 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
1827 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
1829 * doc.cs : when T: or whatever x: is specified, it does not really
1830 check the doc comment's syntax correctness. Fixed bug #82006.
1832 2007-07-18 Marek Safar <marek.safar@gmail.com>
1834 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
1835 LambdaExpression better.
1837 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
1839 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
1841 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
1842 as it can be generated.
1844 * expression.cs (Invocation.Error_InvalidArguments): Show correct
1847 * lambda.cs (LambdaExpression): Refactored to share same code with
1848 AnonymousMethodExpression.
1850 2007-07-17 Marek Safar <marek.safar@gmail.com>
1852 * anonymous.cs (MakeName): Include host name for easier debugging.
1853 (LambdaMethod): New class for lambda spcecific stuff.
1855 * attribute.cs: Set EmitContext return type.
1857 * class.cs: Set EmitContext return type.
1859 * codegen.cs (EmitContext): Return type cannot be null to stop messing
1860 with null/void meaning.
1862 * iterators.cs (ContainerType): Implemented.
1864 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
1866 * statement.cs (Return): Updated to lambda expressions.
1867 (Block.CloneTo): Parent can be null.
1869 2007-07-13 Marek Safar <marek.safar@gmail.com>
1871 A fix for bug #81917
1872 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
1874 * class.cs (FixedField): Check whether field is in unsafe scope.
1876 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
1877 (FieldExpr.Emit): Fixed buffers cannot be volatile.
1879 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
1882 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
1884 2007-07-13 Marek Safar <marek.safar@gmail.com>
1886 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
1887 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
1890 2007-07-13 Marek Safar <marek.safar@gmail.com>
1892 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
1894 2007-07-13 Marek Safar <marek.safar@gmail.com>
1896 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
1897 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
1899 * codegen.cs(EmitContext): Add ProbingMode flag.
1901 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
1903 * driver.cs: For now set both warning values.
1905 * ecore.cs (SimpleName): Name is readonly.
1906 (MethodGroup.OverloadResolve): One quick path for probing.
1908 * expression.cs (Unary): Set Oper r/o.
1909 (Binary): Set Oper r/o.
1910 (ParameterReference): Set few instance variables as r/o.
1911 (ParameterReference.DoResolveBase): Don't capture aruments when
1913 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
1914 (Arglist): arguments are private.
1915 (SizeOf): type is private and r/o.
1916 (MemberAccess): arguments are private.
1918 * report.cs: Enhanced reporting on/off capabilities.
1920 * lambda.cs: Uses ec.IsInProbingMode.
1921 (ContextualReturn): Derives from return.
1923 * rootcontext.cs: For now set both warning values.
1925 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
1927 (Return.Resolve): Don't die immediately.
1928 (Block.Resolve): Speed-up probing.
1929 (Block.CloneTo): Clone only child blocks.
1931 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
1933 * iterators.cs: reverted Miguel's latest change (r81925) as it
1934 breaks the build in System.
1936 2007-07-13 Miguel de Icaza <miguel@novell.com>
1938 * iterators.cs (Yield.CheckContext): Check for the iterator type
1939 also here as we can call into Yield even in codepaths that are not
1941 (MethodOrOperator is the only path that was checked).
1943 In addition to the standard check, use a more specific check for
1944 constructors to report a more verbose error.
1946 2007-07-12 Miguel de Icaza <miguel@novell.com>
1948 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
1949 report the warning and continue
1951 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
1952 values on the stack on the call to Emit. Use EmitStatement if
1953 possible, or using Emit + Pop if not possible. Fixes #82064
1955 2007-07-12 Raja R Harinath <rharinath@novell.com>
1957 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
1958 avoid try...finally in some cases.
1960 2007-07-10 Marek Safar <marek.safar@gmail.com>
1962 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
1964 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
1965 instead of method. Re-use standard error handling.
1966 (ConstructorInitializer.Emit): Simplified.
1968 * delegate.cs: Updated after Invocation.EmitCall change.
1970 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
1971 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
1972 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
1973 method and don't permanently changing input arguments.
1974 (MethodGroupExpr): Introduced resolved best_candidate, when method group
1975 is resolved it has one of the candidates is the best one which is later
1976 used to emit. Removed a few unused method.
1977 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
1979 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
1980 (Binary.ResolveOperator): Ditto.
1981 (ConditionalLogicalOperator.DoResolve): Ditto.
1982 (Invocation): Uses method group.
1983 (Invocation.DoResolve): Simplified.
1984 (Invocation.EmitCall): Removed useless is_static.
1985 (Invocation.Emit): Delegate to method group.
1986 (Invocation.EmitStatement): Simplified.
1987 (New): Uses method group.
1988 (MemberAccess.DoResolve): Don't destroy original expression.
1990 * statement.cs (ForEach.Resolve): Use null for no method arguments.
1992 2007-07-04 Marek Safar <marek.safar@gmail.com>
1994 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
1997 * lambda.cs: Add custom error message type.
1999 2007-07-03 Marek Safar <marek.safar@gmail.com>
2001 * lambda.cs: Simplified little bit.
2003 * parameter.cs: Introduced ImplicitLambdaParameter.
2004 (Parameters.CreateFullyResolved): New factory instead of ctor.
2008 * delegate.cs: Updated parameter creation.
2010 2007-07-03 Marek Safar <marek.safar@gmail.com>
2012 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
2015 * generic.cs: Synchronized with gmcs.
2017 2007-07-03 Marek Safar <marek.safar@gmail.com>
2019 * class.cs (Indexer): Check return type as soon as possible.
2021 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
2024 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
2026 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
2028 * parameter.cs (Parameter): Use expression type when it is available.
2030 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
2031 method modifier for the first parameter only.
2033 2007-06-24 Marek Safar <marek.safar@gmail.com>
2035 A fix for bug #81938
2036 * typemanager.cs (ChangeType): Fixed couple of char conversions.
2038 * constant.cs: Tide up an exception message.
2040 2007-06-22 Marek Safar <marek.safar@gmail.com>
2042 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
2043 an uninitialized variable is used.
2045 * expression.cs (LocalVariableReference.DoResolve): Ditto.
2047 2007-06-22 Marek Safar <marek.safar@gmail.com>
2049 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
2050 not found error handling.
2052 * expression.cs (ArrayCreation): Removed redundant fields and little bit
2054 (ArrayCreation.ResolveArrayElement): To be ready to customization.
2055 (ArrayCreation.DoResolve): Simplified.
2056 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
2057 its own resolve process.
2058 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
2060 2007-06-20 Marek Safar <marek.safar@gmail.com>
2062 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
2065 2007-06-20 Marek Safar <marek.safar@gmail.com>
2067 * cs-tokenizer.cs: Removed var related stuff.
2069 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
2070 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
2071 a type and a keyword at same time.
2073 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
2076 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
2077 implicitly typed arrays, more changes will follow.
2079 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
2081 2007-06-19 Marek Safar <marek.safar@gmail.com>
2083 * ecore.cs (VarExpr): Removed Handled field.
2085 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
2086 build-in assign functionality.
2087 (ForEach.Resolve): Removed all implicitly typed local variable code and
2089 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
2090 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
2092 2007-06-18 Marek Safar <marek.safar@gmail.com>
2094 * assign.cs: Removed implicitly typed local variable check.
2096 * expression.cs (LocalVariableReference.DoResolve): Add check for self
2097 referencing implicitly typed local variable.
2098 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
2101 * statement.cs (Fixed): Removed unsupported implicitly typed local
2104 2007-06-15 Marek Safar <marek.safar@gmail.com>
2106 * decl.cs (MemberName): Moved all Unbound stuff to parser.
2108 2007-06-14 Marek Safar <marek.safar@gmail.com>
2110 A fix for bugs #81855 and #76274
2111 * attribute.cs (AttachTo): Always set owner for global attributes to
2114 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
2117 * cs-parser.jay: Assembly and module attributes must precede all other
2118 elements except using clauses and extern alias declarations.
2120 2007-06-13 Marek Safar <marek.safar@gmail.com>
2122 A fix for bug #81748
2124 * expression.cs: More checks for non ISO-1 features.
2126 2007-06-12 Marek Safar <marek.safar@gmail.com>
2128 A fix for bug #81807
2129 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
2130 present inside switch statement and it is required by nullable check.
2132 2007-06-12 Marek Safar <marek.safar@gmail.com>
2134 A fix for bug #81840
2135 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
2136 when type matching fails.
2138 * namespace.cs: Tiny error message change.
2140 2007-06-12 Marek Safar <marek.safar@gmail.com>
2142 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
2143 reporting. Added automatic property check.
2145 * class.cs: Updated after CheckAbstractAndExtern relocation.
2146 (AEventPropertyAccessor.GetSignatureForError): Customized.
2148 2007-06-11 Marek Safar <marek.safar@gmail.com>
2150 * class.cs (DefineBaseTypes): Base type can be undefined.
2152 * ecore.cs (TypeLookup): Minor refactoring.
2153 (DoResolveAsTypeStep): Removed redundant check.
2155 * namespace.cs (Lookup): Removed redundant check.
2157 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
2158 ResolveAsTypeTerminal step.
2159 (BootstrapCorlib_*): Simplified.
2160 (PopulateCoreType): Core types can be now external.
2162 2007-06-07 Marek Safar <marek.safar@gmail.com>
2164 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
2166 (InferTypeArguments): Infers anonymous expression type arguments.
2167 (Compatible): Split to Compatible and InferTypeArguments.
2169 * lambda.cs: Updated.
2171 2007-06-08 Marek Safar <marek.safar@gmail.com>
2173 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
2175 2007-06-07 Raja R Harinath <harinath@gmail.com>
2177 Fix #80477, cs0135-2.cs, cs0135-3.cs
2178 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
2179 names to the "known" variables list.
2180 (Block.CheckInvariantMeaningInBlock): Handle the fact the
2181 parameter names are also "known".
2182 (Block.CheckError136): Remove.
2183 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
2186 2007-06-07 Marek Safar <marek.safar@gmail.com>
2188 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
2190 2007-06-06 Marek Safar <marek.safar@gmail.com>
2192 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
2193 internal error not an user error.
2195 * expression.cs (IsApplicable): Refactored to make debugging easier.
2197 * support.cs: More tricks for non-mono runtimes.
2199 * typemanager.cs (CoreLookupType): Made public.
2200 (InitSystemCore): All linq specific stuff moved to linq.cs
2202 2007-06-05 Marek Safar <marek.safar@gmail.com>
2204 * typemanager.cs (CSharpSignature): One more missing build-in types
2206 More tricks for non-mono runtime.
2208 2007-06-05 Raja R Harinath <harinath@gmail.com>
2210 * statement.cs (Block.CheckError136_InParents): Remove.
2211 (Block.AddVariable): Use GetParameterInfo instead.
2212 (ToplevelBlock.ProcessArguments): Likewise.
2214 2007-06-04 Raja R Harinath <rharinath@novell.com>
2216 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
2218 (ToplevelBlock.GetParameterInfo): Split out of ...
2219 (ToplevelBlock.GetParameterRefernce): ... this.
2220 (ToplevelBlock.ParameterMap): Remove.
2221 * expression.cs (ParameterReference): Update to use
2222 ToplevelParameterInfo.
2224 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
2227 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
2228 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
2230 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
2231 (ToplevelBlock.ProcessParameters) ... here.
2232 (ToplevelBlock..ctor): Invoke it.
2234 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
2237 * statement.cs (IKnownVariable): New interface.
2238 (LocalInfo): Implement it.
2239 (ToplevelParameterInfo): New class.
2240 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
2241 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
2242 GetKnownVariableInfo.
2244 2007-06-03 Raja R Harinath <harinath@gmail.com>
2246 Partly speed up CS0136 error checks.
2247 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
2248 'recurse' parameter.
2249 (Block.DoCheckError136): Only check errors in parameters. Move
2250 local variable checks ...
2251 (Block.AddVariable): ... here, and ...
2252 (ToplevelBlock.ResolveMeta): ... here.
2254 2007-06-02 Raja R Harinath <harinath@gmail.com>
2256 * statement.cs (Block.IsChildOf): Remove.
2258 * statement.cs (Statement.Clone): Move special case code ...
2259 (Block.CloneTo): ... here.
2261 2007-05-29 Raja R Harinath <rharinath@novell.com>
2263 * statement.cs (ToplevelBlock.container): Remove field. It's
2264 redundant with 'Parent'.
2265 (ToplevelBlock.ContainerBlock): Remove accessor.
2266 (ToplevelBlock..ctor): Update to changes. Register anonymous
2267 child with parent here, ...
2268 * cs-parser.jay (end_anonymous): ... not here. Don't modify
2270 (start_anonymous): Don't save current_block.
2271 (top_current_block): Remove.
2273 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
2274 (Block.Resolve): Update to changes.
2275 (Block..ctor): Move setting of "correct" 'Toplevel'
2276 and 'Explicit' fields to ...
2277 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
2279 2007-05-27 Raja R Harinath <harinath@gmail.com>
2282 * statement.cs (Block.Implicit): Remove.
2283 (Block): Update to changes.
2284 * flowanalysis.cs: Likewise.
2286 Mildly speed up CheckInvariantMeaningInBlock
2287 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
2288 Recursively call AddKnownVariable to all enclosing blocks.
2289 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
2290 Remove recursive calls.
2291 (Block): Update to changes.
2293 New ExplicitBlock invariants
2294 * statement.cs (Block.Explicit): New field. It points to the
2295 immediately enclosing non-implicit block.
2296 (Block..ctor): Maintain the invariant.
2297 * cs-parser.jay: Take advantage of invariant.
2299 Introduce ExplicitBlock
2300 * statement.cs (ExplicitBlock): New.
2301 (ToplevelBlock): Derive from it.
2302 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
2304 (Block.Implicit): Update to changes.
2305 * cs-parser.jay: Update to changes.
2308 * codegen.cs (EmitContext.IsLastStatement): Remove.
2309 * statement.cs (Block.DoEmit): Update to changes.
2311 2007-05-25 Raja R Harinath <rharinath@novell.com>
2313 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
2314 modifying current_block directly.
2316 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
2318 * class.cs: Implemented automatic properties (C# 3.0)
2319 Thanks to Marek for the help.
2321 2007-05-23 Raja R Harinath <rharinath@novell.com>
2323 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
2324 variable as assigned, note also that all its components are
2326 (MyBitVector.SetRange): New. Function to set multiple bits to true.
2328 2007-05-19 Marek Safar <marek.safar@gmail.com>
2330 * anonymous.cs, class.cs: Emit Compiler generated attribute when
2331 member is marked as compiler generated.
2333 * decl.cs (MemberCore): Refactored ModFlags into property.
2335 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
2336 (Check): Check only accessibility modifiers.
2338 2007-05-18 Raja R Harinath <rharinath@novell.com>
2340 Track all assignable slots in one bit array
2341 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
2342 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
2343 logic from VariableMap constructor here. Use the same 'offset'
2344 variable that's later used for computing offsets of local
2346 * flowanalysis.cs (UsageVector.parameters): Remove.
2347 (UsageVector): Update to changes.
2348 (VariableMap): Remove.
2350 Avoid creating ParameterMap in every block
2351 * statement.cs (Block.ParameterMap): Move ...
2352 (ToplevelBlock.ParameterMap): ... here.
2353 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
2355 * flowanalysis.cs (FlowBranching.param_map): Remove.
2356 (FlowBranching.UsageVector): Update to changes.
2357 (FlowBranchingToplevel.CheckOutParameters): Likewise.
2359 * statement.cs (Block.CloneTo): Clone Toplevel field too.
2361 * expression.cs (ParameterReference): Distinguish between block
2362 where parameter was referenced and declared.
2364 2007-05-18 Marek Safar <marek.safar@gmail.com>
2366 * flowanalysis.cs, statement.cs: Put back improved error handling.
2368 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
2372 Imporved object and collection initialization (C# 3.0).
2374 2007-05-15 Marek Safar <marek.safar@gmail.com>
2376 A fix for bug #81380
2377 * expression.cs (Is.DoResolve): Only value types have constant `is'
2380 2007-05-15 Raja R Harinath <rharinath@novell.com>
2382 * statement.cs (ToplevelBlock.child): Remove.
2384 2007-05-15 Raja R Harinath <harinath@gmail.com>
2386 Rationalize ResolveMeta: refactoring
2387 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
2388 out constant handling code into ...
2389 (Block.DoResolveConstants): ... this.
2391 Rationalize ResolveMeta: kill local_map
2392 * statement.cs (Block.local_map, Block.LocalMap): Remove.
2393 (Block.AssignableSlots): New.
2394 (Block.ResolveMeta): Make protected. Don't create a VariableMap
2395 for locals -- move code from VariableMap here. Avoid unnecessary
2397 * flowanalysis.cs (FlowBranching.local_map): Remove.
2398 (FlowBranching..ctor): Use Block.AssignableSlots.
2399 (VariableMap): Remove unused constructors.
2401 2007-05-11 Raja R Harinath <rharinath@novell.com>
2403 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
2405 2007-05-11 Marek Safar <marek.safar@gmail.com>
2407 * typemanager.cs (IsFriendAssembly): Should not be called for building
2410 2007-05-09 Marek Safar <marek.safar@gmail.com>
2412 * literal.cs (NullConstant): Print null in all cases.
2414 * expression.cs (Binary.ResolveOperator): Implemented delegate
2415 comparison based on C# 2.0 changes.
2417 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
2419 This code is contributed under the MIT X11 license
2421 The following enables support for several C# 3.0 language features:
2423 * cs-tokenizer.cs: Added support for the "var" keyword.
2425 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
2426 Added VarExpr class to facilitate type inferencing.
2428 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
2429 to support anonymous types.
2431 * assign.cs: Added support for type inferencing and initialization.
2433 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
2435 * expression.cs: Added implicit array support to ArrayCreation.
2436 Added 5 types and 1 interface:
2438 IInitializable Implementing classes can inject initializing
2439 statements after object instantiation.
2441 Initializer Stores data for object initialization.
2443 AnonymousType An expression for anonymous types.
2445 AnonymousTypeParameter Stores data about an anonymous type's field.
2447 NewInitialize An expression for object initialization.
2449 CollectionInitialize An expression for collection initialization.
2451 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
2454 2007-05-06 Marek Safar <marek.safar@gmail.com>
2456 A fix for bug #81500
2457 * cs-tokenizer.cs: Add special handling for coalescing operator.
2459 2007-05-06 Marek Safar <marek.safar@gmail.com>
2461 A fix for bug #81529
2462 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
2463 its value from base class until it is redefined.
2465 2007-05-02 Raja R Harinath <rharinath@novell.com>
2467 Fix regression in cs0631-3.cs
2468 * cs-parser.jay (operator_declarator): Add opt_attributes to error
2469 fallback. Make error fallback catch more cases.
2471 2007-05-01 Miguel de Icaza <miguel@novell.com>
2473 * cs-parser.jay: Allow parameters in operator declarations to have
2476 2007-04-27 Miguel de Icaza <miguel@novell.com>
2478 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
2481 * lambda.cs (ContextualReturn.Resolve): An expression is valid
2482 inside the ContextualReturn, it does not have to be an
2483 ExpressionStatement.
2485 2007-04-24 Miguel de Icaza <miguel@novell.com>
2487 * lambda.cs (ContextualReturn.Resolve): if the return type is not
2490 2007-04-23 Miguel de Icaza <miguel@novell.com>
2492 * anonymous.cs (AnonymousContainer): split the virtual Resolve
2493 method in two methods: ResolveNoDefine and Resolve.
2495 ResolveNoDefine will stop just after ResolveTopBlock has been
2498 Resolve will then continue by creating a method and issuing the
2499 call to method.Define ().
2501 (AnonymousMethod): Split and implement the new Resolve and
2502 ResolveNoDefine as well.
2504 * lambda.cs (LambdaExpression): Split the anonymous method
2505 resolution code into a separate routine (CoreCompatibilityTest)
2506 from DoCompatibleTest.
2508 (LambdaExpression.TryBuild): New method, this method tries to
2509 build the LambdaExpression with the given set of types to be used
2510 as the types for the various parameters of the lambda expression.
2512 If the compilation succeed with the given types, the infered type
2513 of the Anonymous method is returned, otherwise null is returned.
2515 2007-04-23 Marek Safar <marek.safar@gmail.com>
2517 A fix for bug #81414
2518 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
2520 2007-04-22 Miguel de Icaza <miguel@novell.com>
2522 * cs-tokenizer.cs: Change various identifiers here from the
2523 camelCasing to the recommended Linux-like style for instance
2524 variables from the Coding Guidelines.
2526 2007-04-19 Martin Baulig <martin@ximian.com>
2529 (Convert.ImplicitReferenceConversionCore): Allow conversions from
2530 System.Enum to System.ValueType.
2532 2007-04-13 Martin Baulig <martin@ximian.com>
2534 Rewrote implicit reference conversions. We need to distinguish
2535 between implicit reference conversions (13.1.4) and implicit
2536 boxing conversions (13.1.5).
2538 According to the spec, there's an an implicit conversion
2539 "From a one-dimensional array-type S[] to IList<T> and base
2540 interfaces of this interface, provided there is an implicit
2541 reference conversion from S to T." Note that this does not
2542 include boxing conversions.
2545 (Convert.ImplicitTypeParameterBoxingConversion): New method.
2546 (Convert.ImplicitReferenceConversion): Split into
2547 ImplicitReferenceConversionCore() and
2548 ImplicitBoxingConversionExist().
2549 (Convert.ImplicitReferenceConversionExists): Use the new
2550 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
2552 2007-04-12 Martin Baulig <martin@ximian.com>
2554 * convert.cs (Convert.ImplicitReferenceConversion): Move the
2555 `TypeManager.null_type' checks up to the top of the method.
2557 2007-04-11 Marek Safar <marek.safar@gmail.com>
2559 A fix for bug #81350
2560 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
2563 2007-04-11 Martin Baulig <martin@ximian.com>
2565 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
2566 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
2567 to make this work for generic classes; fixes #79561.
2569 2007-04-11 Martin Baulig <martin@ximian.com>
2571 * expression.cs (As): Add support for nullable types; fixes #79371.
2573 2007-04-11 Martin Baulig <martin@ximian.com>
2575 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
2576 `type.FullName' is null; fixes #80243.
2578 2007-04-11 Martin Baulig <martin@ximian.com>
2580 * expression.cs (Invocation.IsApplicable): Don't modify the method
2581 if type inference succeeded, but the method was not applicable.
2584 2007-04-10 Marek Safar <marek.safar@gmail.com>
2586 A fix for bug #81324
2587 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
2588 internal and external namespaces containers.
2590 2007-04-10 Martin Baulig <martin@ximian.com>
2592 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
2593 TypeManager.DropGenericMethodArguments() so we also call
2594 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
2596 2007-04-10 Martin Baulig <martin@ximian.com>
2598 * iterators.cs (Iterator.CreateIterator): Don't crash if
2599 `method.ReturnType' is null. This happens if something went wrong
2600 while resolving that typ (we already reported an error in this case).
2602 2007-04-10 Martin Baulig <martin@ximian.com>
2604 * expression.cs (New.DoResolve): Don't call CheckComImport() on
2605 generic interfaces; report the CS0144 directly.
2607 2007-04-10 Martin Baulig <martin@ximian.com>
2609 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
2610 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
2612 2007-04-10 Martin Baulig <martin@ximian.com>
2614 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
2616 2007-04-09 Raja R Harinath <rharinath@novell.com>
2619 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
2620 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
2623 * statement.cs (For.Resolve): If resolution fails, use
2626 2007-04-08 Marek Safar <marek.safar@gmail.com>
2628 * anonymous.cs (MakeName): Make faster and zero-based.
2629 (VerifyExplicitParameterCompatibility): Back to mode where generic
2630 parameter is ignored.
2631 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
2633 * class.cs (EmitType): Method can emit another new method.
2635 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
2637 * driver.cs: Updated.
2639 * lambda.cs: Reuse predefined empty parameters.
2641 * parameter.cs: Updated
2643 * support.cs: Implemented InflateTypes.
2645 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
2646 (InitSystemCore): Introduced to isolate 3.0 dependencies.
2648 2007-04-03 Martin Baulig <martin@ximian.com>
2652 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
2653 version of TypeManager.IsOverride() which also works with generic
2656 2007-04-03 Martin Baulig <martin@ximian.com>
2661 (Convert.ExplicitReferenceConversion): We need to cast when
2662 converting from IList<T> to S[].
2664 2007-04-01 Marek Safar <marek.safar@gmail.com>
2666 * decl.cs (FindExtensionMethods): Consider all candidates with same name
2669 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
2671 2007-03-31 Marek Safar <marek.safar@gmail.com>
2673 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
2674 argument and return type inferring.
2676 * codegen.cs (InferReturnType): Flag whether return can be inferred.
2677 (ReturnType): Turned to property.
2679 * statement.cs (Return): Implemented return type inferring.
2681 * support.cs (ReflectionParameters): Use local types if possible.
2683 2007-03-30 Raja R Harinath <rharinath@novell.com>
2685 * flowanalysis.cs (FlowBranching.Reachability): Remove.
2686 (FlowBranching.UsageVector): Update to changes.
2688 Prepare to kill 'Reachability'
2689 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
2690 argument of constructor.
2692 2007-03-29 Raja R Harinath <rharinath@novell.com>
2694 Prepare to kill 'Reachability'
2695 * flowanalysis.cs (UsageVector.is_unreachable): New.
2696 (UsageVector): Update to maintain 'is_unreachable' in parallel to
2697 'reachability', and verify they're consistent.
2700 * expression.cs (New.EmitStatement): Handle type parameters here too.
2702 2007-03-29 Martin Baulig <martin@ximian.com>
2707 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
2708 CompilerGeneratedClass.
2709 (ScopeInfo.EmitScopeInstance): Make this protected.
2710 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
2711 `ec.CurrentAnonymousMethod.Scope == Scope'.
2713 * statement.cs (Block.ScopeInfo): Make this a property.
2715 2007-03-27 Raja R Harinath <harinath@gmail.com>
2717 Prepare to kill 'Reachability'
2718 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
2719 (FlowBranching.UsageVector.Reachability): Remove property.
2720 (FlowBranching.UsageVector.IsUnreachable): New property.
2721 (FlowBranching.UsageVector.ResetBarrier): New.
2722 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
2723 * codegen.cs, statement.cs: Update to changes.
2725 2007-03-27 Martin Baulig <martin@ximian.com>
2730 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
2733 2007-03-26 Raja R Harinath <rharinath@novell.com>
2735 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
2736 instead of TriState. Remove all mention of TriState.
2738 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
2739 replaced by a boolean. Add boolean 'is_unreachable' field, check
2740 and maintain invariants.
2742 2007-03-25 Marek Safar <marek.safar@gmail.com>
2744 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
2746 2007-03-25 Marek Safar <marek.safar@gmail.com>
2748 * expression.cs: Stop using obsolete 2.0 opcodes.
2750 2007-03-25 Marek Safar <marek.safar@gmail.com>
2752 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
2753 one of the latests Martin's fixes.
2755 2007-03-23 Miguel de Icaza <miguel@novell.com>
2757 * expression.cs: On BigEndian systems, swap the bytes, temporary
2758 solution until we get a new bitconverter class.
2760 2007-03-23 Martin Baulig <martin@ximian.com>
2764 * decl.cs (MemberCache.AddMembers): Add generic methods both as
2765 "Method" and "Method`1". Normally, a cache lookup is done on the
2766 "Method" form (ie. without the generic arity), but this one makes
2767 lookups on the full form work as well.
2769 2007-03-22 Raja R Harinath <rharinath@novell.com>
2771 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
2774 2007-03-20 Bill Holmes <billholmes54@gmail.com>
2776 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
2777 ordered_member_list, to TypeBuilder to store members to be defined
2778 in the order they were parsed in.
2779 - ordered_explicit_member_list contains all properties indexers
2780 and methods that are defined as explicit implementation of an
2781 interface or base class.
2782 - ordered_member_list contains all properties indexers and methods
2783 that are not defined as explicit implementation of an interface
2786 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
2787 functionality in these removed classes has been replaced with
2788 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
2789 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
2791 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
2792 to CheckForDuplications inside GetMethod and SetMethod Define Method
2793 to handle method property and indexer name conflicts.
2797 All code is contributed under the MIT/X11 license.
2799 2007-03-20 Martin Baulig <martin@ximian.com>
2801 * class.cs (TypeContainer.Interfaces): Removed; they're now
2802 included in `TypeContainer.Types'.
2804 2007-03-20 Martin Baulig <martin@ximian.com>
2806 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
2808 * class.cs (TypeContainer.CreateType): New public method. This is
2809 now called before DefineType() to create the TypeBuilders.
2810 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
2811 has already been created by CreateType().
2812 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
2813 don't resolve our base classes here; this has been moved into
2814 DefineBaseTypes(). We're now called from CreateType().
2815 (TypeContainer.DefineBaseTypes): New private method; resolve our
2816 base classes here. We're now called from DefineType().
2819 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
2820 our types first to create all the TypeBuilders. After that, call
2821 TypeContainer.DefineType() on all the types which'll resolve their
2822 base classes and setup the resolve order.
2824 2007-03-20 Martin Baulig <martin@ximian.com>
2826 * class.cs (TypeContainer.Enums): Removed; they're now included in
2827 `TypeContainer.Types'.
2829 2007-03-20 Martin Baulig <martin@ximian.com>
2832 (TypeContainer.DefineType): Don't call ResolveMembers() here.
2833 (TypeContainer.DoResolveMembers): Call DefineType() on our
2834 `compiler_generated' classes; moved here from DefineNestedTypes().
2837 (RootContext.ResolveTree): Call ResolveMembers() on all
2838 TypeContainer's in the `type_container_resolve_order'.
2840 2007-03-19 Marek Safar <marek.safar@gmail.com>
2842 * class.cs: Use corlib to handle InternalMethodImplAttribute.
2844 2007-03-17 Marek Safar <marek.safar@gmail.com>
2846 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
2847 implementation flags.
2849 2007-03-17 Marek Safar <marek.safar@gmail.com>
2851 * class.cs: More optimizations for type parameters.
2853 2007-03-15 Marek Safar <marek.safar@gmail.com>
2855 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
2857 * ecore.cs, parameter.cs: More common code for both corlibs.
2859 * typemanager.cs (IsGenericMethod): Simplified.
2861 2007-03-15 Raja R Harinath <rharinath@novell.com>
2863 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2865 * statement.cs, iterators.cs, lambda.cs: Update to changes.
2867 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
2868 unconditionally. Simplify explanation.
2869 (Try.Resolve, Using.Resolve): Likewise.
2871 2007-03-15 Martin Baulig <martin@ximian.com>
2875 * decl.cs (DeclSpace): If we're a partial class, use our
2876 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
2878 2007-03-15 Raja R Harinath <rharinath@novell.com>
2880 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2882 (FlowBranching.UsageVector): Update to changes.
2883 (FlowBranching.MergeSiblings): Likewise.
2884 * statement.cs: Likewise.
2886 2007-03-15 Martin Baulig <martin@ximian.com>
2891 (MemberCache): Added a special .ctor for type parameters.
2894 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
2897 2007-03-09 Martin Baulig <martin@ximian.com>
2899 * enum.cs (Enum): Make this a TypeContainer.
2900 (EnumMember): Derive from `Const'.
2903 (Const.DoResolveValue): New protected virtual method; move most of
2904 the functionality of ResolveValue() here so we can override it in
2906 (Const.CreateConstantReference): Make this virtual.
2908 * class.cs (Kind): Add `Kind.Enum'.
2909 (TypeContainer.Emit): Don't emit the enums here; they're already
2910 in the `RootContext.typecontainer_resolve_order'.
2912 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
2913 here; they're already in the `typecontainer_resolve_order'.
2915 * ecore.cs (EnumConstant.ConvertImplicitly): Add
2916 TypeManager.DropGenericTypeArguments().
2919 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
2920 (TypeManager.IsEnumType): Likewise.
2921 (TypeManager.EnumToUnderlying): Likewise.
2922 (TypeManager.IsEqual): Add support for enums.
2924 2007-03-12 Raja R Harinath <rharinath@novell.com>
2926 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
2927 DefaultParameterValueAttribute to be undefined, say if System.dll
2930 2007-03-11 Marek Safar <marek.safar@gmail.com>
2932 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
2935 2007-03-10 Marek Safar <marek.safar@gmail.com>
2937 * class.cs, parameter.cs: Unified parameters verification.
2939 2007-03-08 Martin Baulig <martin@ximian.com>
2941 * cs-parser.jay (constructor_header): Pass the location to the
2942 newly created TopLevelBlock.
2944 2007-03-07 Martin Baulig <martin@ximian.com>
2946 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
2948 2007-03-06 Miguel de Icaza <miguel@novell.com>
2950 * convert.cs (ExplicitReferenceConversionExists): Sync this method
2951 with the changes from David, fixes the build.
2953 2007-03-05 David Mitchell <dmitchell@logos.com>
2955 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
2956 and its base interfaces to a one-dimensional array type S[],
2957 provided there is an implicit or explicit reference conversion
2960 2007-03-03 Marek Safar <marek.safar@gmail.com>
2962 * cs-tokenizer.cs: Implemented basic linq grammar.
2964 * driver.cs: Set linq lang version on demand.
2966 2007-02-26 Marek Safar <marek.safar@gmail.com>
2968 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
2970 2007-02-25 Marek Safar <marek.safar@gmail.com>
2972 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
2975 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
2977 Check property and event extern attributes.
2979 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
2982 2007-02-24 Marek Safar <marek.safar@gmail.com>
2984 A fix for bug #80407
2985 * ecore.cs: Don't report ambiguity error when methods have same parent.
2987 2007-02-23 Marek Safar <marek.safar@gmail.com>
2989 A fix for bug #80878
2990 * class.cs, cs-parser.jay: Event property can host anonymous methods.
2992 2007-02-22 Marek Safar <marek.safar@gmail.com>
2994 * attribute.cs: Enable ExtensionAttribute presence test.
2996 2007-02-22 Marek Safar <marek.safar@gmail.com>
2998 * class.cs: Warn about missing GetHashCode only when Equals is override.
3000 * decl.cs: Check accessibility of type arguments.
3002 * typemanager.cs: Correctly report nullable array.
3004 2007-02-20 Marek Safar <marek.safar@gmail.com>
3006 * class.cs, report.cs: Capture more details when things go wrong.
3008 2007-02-20 Marek Safar <marek.safar@gmail.com>
3010 A fix for bug #80650
3011 * cs-parser.jay: Anonymous container starts at constructor declaration
3012 and not at block beginning because it has to be usable in constructor
3015 * statement.cs: Use context location and not block one for error reporting.
3017 2007-02-18 Marek Safar <marek.safar@gmail.com>
3019 A fix for bug #78712
3020 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
3023 2007-02-18 Marek Safar <marek.safar@gmail.com>
3025 A fix for bug #80493 by Atsushi Enomoto
3026 * cs-parser.jay: Ignore invalid attribute target.
3028 2007-02-18 Marek Safar <marek.safar@gmail.com>
3030 * cs-tokenizer.cs: Ignore '\0' as white space character.
3032 2007-02-17 Miguel de Icaza <miguel@novell.com>
3034 * cs-parser.jay: Add support for lambda expressions to the mcs
3037 * lambda.cs: Only clone when we are probing, not on the final call
3038 (Compatible is the final call).
3040 * statement.cs (CloneContext): Introduce class to provide block
3041 remapping during clone.
3043 All statements Clone themselves now.
3045 (Clone): special handling for blocks, when we clone a block, we
3046 register the block inside this routine, as children of the block
3047 might trigger a lookup.
3049 * expression.cs: Add support for CloneContext in all expressions.
3051 2007-02-17 Marek Safar <marek.safar@gmail.com>
3053 A fix for bug #80493
3054 * statement.cs: Report ambiguous warning when interfaces are not related.
3056 2007-02-15 Marek Safar <marek.safar@gmail.com>
3058 C# 3.0 extension methods.
3060 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
3061 cannot be used directly.
3063 * class.cs (Class.Emit): Emit extension attribute if any class method
3064 is extension method.
3065 (Method.Define): Add basic extension method validation conditions.
3066 (Method.Emit): Emit extension attribute for method.
3068 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
3069 extension method exists. Currently we follow same approach as Microsoft
3070 does, emit even if a method or a class are private but this can change
3073 * cs-parser.jay: Add handling of `this' keyword in method parameters
3076 * decl.cs (DeclSpace.IsStaticClass): New property.
3077 (MemberCache.FindExtensionMethods): Looks for extension methods with
3078 defined name and extension type.
3080 * doc.cs: Updated after OverloadResolve changes.
3082 * driver.cs: Add new soft reference to System.Core.dll.
3084 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
3085 (ExtensionMethodGroupExpr): Represents group of extension methods.
3087 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
3088 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
3089 to MethodGroupExpr and made non-static for easier customization.
3090 (Invocation.DoResolve): Add extension method lookup when no standard
3092 (MemberAccess.DoResolve): Try extension methods if no member exists.
3094 * modifiers.cs: Add METHOD_EXTENSION modifier.
3096 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
3097 as well as candidate extension type.
3098 (ComputeNamespaces): When assembly constains extension methods registers
3100 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
3101 extension method lookup.
3102 (Namespace.LookupExtensionMethod): Looks for extension method in this
3104 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
3105 find a method which matches name and extensionType.
3107 * parameter.cs (Parameter): Add This modifer.
3108 (HasExtensionMethodModifier): New property.
3109 (Resolve): Add extension parameter check.
3110 (ModFlags): turned to property to exclude this modifier as it is not real
3112 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
3114 * support.cs (ParameterData): Add ExtensionMethodType.
3115 (ReflectionParameters): Implemented ExtensionMethodType interface property.
3117 * typemanager.cs: Add type and ctor extension attribute type.
3119 2007-02-15 Miguel de Icaza <miguel@novell.com>
3121 * report.cs (DisableErrors, EnableErrors): used to prevent error
3122 output when we are "trying" to compile various methods with
3125 * ecore.cs (Expression): Add Clone method that calls the virtual
3126 CloneTo method. The current CloneTo method in Expression throws
3127 an exception so we can track down all the places where this must
3128 be implemented (not using abstract, because that would be a lot of
3129 up-front-work before we can start testing the implementation
3132 Important: we only need Clone capabilities for expressions created
3133 by the parser, as the expressions we will be cloning are
3134 expressions in the pre-resolved state. This vastly simplifies
3137 (SimpleName): Add CloneTo that does nothing.
3138 (EmptyCast): Add CloneTo.
3140 * expression.cs (Binary): Implement CloneTo.
3141 (Invocation.IsApplicable): Store the current ec in
3142 EmitContext.TempEc and restore it on return. This is used so we
3143 do not have to sprinkle hundres of methods with an extra
3144 EmitContext, we know that the only user is the lambda expression
3145 ImplicitConversionExists code.
3147 (Argument): Add Cloning capabilities.
3148 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
3149 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
3150 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
3151 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
3152 IndexerAccess): Add Clone capability.
3154 (LocalVariableReference, This): TODO: needs cloned Block mapping.
3156 (Argument): Add cloning capability.
3158 * assign.cs (Assign): Implement CloneTo.
3160 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
3162 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
3163 version by calling Convert with the EmitContext (that we are
3164 currently storing in ec, this is not great, but will do for now,
3165 to avoid passing EmitContext parameters to hundreds of functions
3166 that do not need them now).
3168 (SetExpression): Remove, it is not needed.
3170 (ContextualReturn): Implement CloneTo.
3172 * statement.cs (Statement): Implement cloning infrastructure,
3173 similar to expressions.
3175 (Block): Partial implementation of Clone for statements.
3177 (Return): Implement clone.
3179 * constant.cs (Constant.CloneTo): New method, does nothing.
3181 * codegen.cs (TempEc): Add a static EmitContext as a temporary
3182 solution, until we decide how to exactly do this.
3184 2007-02-14 Marek Safar <marek.safar@gmail.com>
3186 A fix for bug #80493
3187 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
3188 a property is override we need to use second accessor.
3190 2007-02-13 Marek Safar <marek.safar@gmail.com>
3192 A fix for bug #80418
3193 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
3196 2007-02-13 Marek Safar <marek.safar@gmail.com>
3198 Another fix for bug #80749
3199 * pending.cs: Abstract class has priority over interfaces.
3201 2007-02-13 Marek Safar <marek.safar@gmail.com>
3203 Another fix for bug #80749
3204 * pending.cs: Abstract class has priority over interfaces.
3206 2007-02-13 Marek Safar <marek.safar@gmail.com>
3208 Another fix for bug #80749
3209 * pending.cs: Abstract class has priority over interfaces.
3211 2007-02-13 Marek Safar <marek.safar@gmail.com>
3213 Another fix for bug #80749
3214 * pending.cs: Abstract class has priority over interfaces.
3216 2007-02-13 Marek Safar <marek.safar@gmail.com>
3218 * class.cs Better error message.
3220 * driver.cs: Add shorter versions of -optimize option.
3222 2007-02-13 Martin Baulig <martin@ximian.com>
3224 * class.cs (Constructor.Emit): Check the return value of
3225 ec.ResolveTopBlock() and return on error.
3227 2007-02-13 Raja R Harinath <rharinath@novell.com>
3229 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
3230 message to fix error message regression.
3232 2007-02-12 Marek Safar <marek.safar@gmail.com>
3234 * delegate.cs: Delegate creation expression cannot be of Nullable type.
3236 2007-02-12 Marek Safar <marek.safar@gmail.com>
3238 A fix for bug #80749
3239 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
3240 its parent container.
3242 * class.cs (DefineFieldInitializers): Each initializer can has different
3245 * const.cs: Updated.
3247 2007-02-11 Miguel de Icaza <miguel@novell.com>
3249 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
3250 now all the heavy lifting to check that embedded statements or
3251 expressions have the right form is done in the ContextualReturn.
3253 (ContextualReturn): New class.
3255 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
3256 method that can be invoked to report 201, so we do not replicate
3259 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
3261 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
3262 treating tabs as spaces.
3264 2007-02-09 Marek Safar <marek.safar@gmail.com>
3266 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
3267 * assign.cs: Use full implicit conversion for right side check.
3269 2007-02-09 Marek Safar <marek.safar@gmail.com>
3271 * statement.cs (Switch): Switch over boolean type is not standardized.
3273 2007-02-08 Marek Safar <marek.safar@gmail.com>
3275 A fix for bug #80755
3276 * decl.cs (FindBaseEvent): Don't use method cache for events.
3278 2007-02-07 Marek Safar <marek.safar@gmail.com>
3280 * cs-parser.jay: Better syntax error handling.
3282 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
3283 instead of underlying type value.
3285 2007-02-06 Marek Safar <marek.safar@gmail.com>
3287 * driver.cs: Check define identifier before is registered.
3289 * namespace.cs: Use existing error message.
3291 * report.cs: New warning.
3293 2007-02-06 Marek Safar <marek.safar@gmail.com>
3295 A fix for bug #80742
3296 * expression.cs: Delegate Invoke method can be called directly.
3298 2007-02-06 Marek Safar <marek.safar@gmail.com>
3300 A fix for bug #80676
3301 * class.cs (IsEntryPoint): The Main method can have params modifier.
3303 2007-02-04 Miguel de Icaza <miguel@novell.com>
3305 * parameter.cs (Parameter, Parameters): Add Clone method.
3307 * anonymous.cs (Compatible): Turn method into virtual method, so
3308 LambdaExpression can implement a different behavior.
3310 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
3311 out the basic checking here, so it can be used by
3314 * lambda.cs: Introduce "Compatible" function that will do the
3317 2007-02-02 Marek Safar <marek.safar@gmail.com>
3319 * attribute.cs: Unified one error message.
3321 * class.cs (Class): Use type attributes and not properties to test static
3323 (IsEntryPoint): Don's pass local variable.
3325 * convert.cs: Removed duplicate check.
3327 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
3329 * driver.cs: Don't crash when soft reference does not exist.
3331 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
3332 (UsingEntry): Removed redundant allocation.
3334 * parameter.cs: Add fast path for type parameters.
3336 * support.cs: Don't allocate attribute when it's not used.
3338 2007-01-30 Miguel de Icaza <miguel@novell.com>
3341 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
3342 this into a virtual method, so we can override it in LambdaExpression.
3344 * driver.cs: Improve diagnostics in case of failure.
3346 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
3347 write a function that is slightly more complex and that parses:
3349 type identifier [, type identifier]* )
3351 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
3354 (canEmpty ? i >= 0 : i > 0)
3356 2007-01-30 Raja R Harinath <rharinath@novell.com>
3358 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
3359 exception on possibly valid code.
3361 2007-01-29 Raja R Harinath <rharinath@novell.com>
3363 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
3365 (parse_opt_type_arguments): Remove. It's almost the same as
3367 (parse_namespace_or_typename): Use parse_less_than.
3369 2007-01-28 Miguel de Icaza <miguel@novell.com>
3371 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
3372 this bug took a few hours to find, because the state saved and
3373 restored by PushPosition and PopPosition was ignoring the state of
3374 parse_generic_less_than.
3376 I can also now remove the handling of OP_LT and OP_GT, this solves
3379 * cs-tokenizer.cs: store the location for the ARROW token, we use
3382 (PushPosition, PopPosition): save/restore also `current_token',
3383 restore `parse_generic_less_than' (was missing).
3385 (parse_opt_type_arguments): use parse_type, not
3386 parse_namespace_or_typename to parse types.
3388 * lambda.cs: Empty new file, will eventually have the lambda
3389 expression implementation.
3391 * lambda.test: used to test the internal tokenizer.
3393 * report.cs (FeatureIsNotISO1): Rename from
3394 FeatureIsNotStandardized, because it was about the language level
3395 (1 vs 2) it was not about standarization.
3397 (FeatureRequiresLINQ): New.
3399 * support.cs (SeekableStreamReader): Only require that the reader
3400 is a TextReader, not a StreamReader, so we can plug StringReader.
3402 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
3403 given position in the input stream the following tokens can be
3404 parsed as a type followed by an identifier.
3406 (is_punct): after a '(' if parse_type_and_parameter returns true,
3407 then return a special token OPEN_PARENS_LAMBDA which is used to
3408 avoid reduce/reduce errors in the grammar for the
3409 lambda_expression rules.
3411 (parse_type): implement a type parser inside the
3412 tokenizer, the parser only returns true or false depending on
3413 whether the input at a given position can be parsed as a type.
3415 (peek_token): new method used during type parsing.
3417 2007-01-28 Raja R Harinath <rharinath@novell.com>
3420 * anonymous.cs (ScopeInfo.InflateParameters): New.
3421 (AnonymousContainer.Resolve): Use it to redirect types of
3422 delegate parameters.
3424 2007-01-27 Raja R Harinath <rharinath@novell.com>
3427 * expression.cs (Error_InvalidArguments): Don't use two different
3428 messages for CS1503. Use ExtraInformation and
3429 SymbolRelatedToPreviousError instead.
3432 * decl.cs (DeclSpace.initialize_type_params): Don't access
3433 'type_params' of a partial class directly.
3435 2007-01-26 Miguel de Icaza <miguel@novell.com>
3437 * constant.cs: Removed a handful of out-of-range checks that were
3440 2007-01-25 Marek Safar <marek.safar@gmail.com>
3442 * expression.cs (CheckUselessComparison): Add additional check for char
3445 * namespace.cs: Fixed typo.
3447 2007-01-23 Miguel de Icaza <miguel@novell.com>
3449 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
3450 gone, instead we inline the test, preventing the needless casts to
3451 longs, ulongs and doubles for the parameters, avoiding calls to
3452 methods that overchecked stuff, and instead inlined things
3455 2007-01-20 Marek Safar <marek.safar@gmail.com>
3457 * cs-parser.jay: Better parameter error handling.
3459 2007-01-17 Marek Safar <marek.safar@gmail.com>
3461 A fix for bug #80368, #80522
3462 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
3463 whether array initializer contains constants only.
3464 (ArrayCreation.Emit): Use better formula to decide when
3465 are array initializers for static initialization.
3466 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
3467 have to emit even constants otherwise they are pre-initialized.
3469 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
3470 Raja R Harinath <rharinath@novell.com>
3472 Fix emit order of 'get' vs. 'set'.
3473 * support.cs (Accessors): New.
3474 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
3475 Note the order in which accessors are declared in the source.
3476 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
3477 Refactored from Property.Define and Indexer.Define.
3478 (PropertyBase.DefineAccessors): New helper that calls the above in
3479 appropriate order as noted by the parser.
3480 (Property.Define, Indexer.Define): Update to changes.
3481 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
3483 2007-01-17 Raja R Harinath <rharinath@novell.com>
3485 Fix cs0029-6.cs and gcs0029-2.cs (regression)
3486 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
3487 there's an implicit conversion from the current type to the target
3488 type before converting the underlying constant.
3490 2007-01-16 Marek Safar <marek.safar@gmail.com>
3492 * const.cs (ResolveValue): Updated after constant conversion was made more
3495 * constant.cs (GetAttributableValue): constant to object conversion is
3496 used for attributes only.
3497 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
3498 constant conversions.
3499 (LongConstant.ConvertImplicitly): Ditto.
3501 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
3502 (ImplicitConversionStandard): Handle constant conversion as extra step.
3503 It solves the issue when constant conversion was called indirectly like
3504 inside array initializer and constant folding was skipped.
3506 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
3509 * statement.cs(ImplicitConversionStandard): Updated after constant
3510 conversion was made more generic.
3512 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
3514 * expression.cs (As.DoResolve): Use GenericConstraints instead of
3515 Constraints, solves the problem where the compiler incorrectly
3516 reported that a type parameter was not constrained to a class (Bug
3519 2007-01-14 Marek Habersack <grendello@gmail.com>
3521 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
3523 2007-01-14 Marek Safar <marek.safar@gmail.com>
3525 A fix for bug #80368
3526 * assign.cs (FieldInitializer): New class implements field
3527 initializer statement.
3529 * attribute.cs: Update after FieldMember rename.
3531 * class.cs (PropertyBasedMember): New common class for property based
3533 (InterfaceMemberBase): New base class for all members which can be used as
3534 an interface members.
3535 (MethodCore): Moved really common code to InterfaceMemberBase.
3536 (Method.Define): Equal and GetHasCode detection is relevant for methods
3538 (MethodData.Define): Don't assume that public event implements an
3539 interface automatically.
3540 (MethodData.DefineMethodBuilder): Issue an error even if only extern
3542 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
3543 (FieldMember): Merged with FieldBase.
3544 (EventProperty.AEventPropertyAccessor): New specialization to check whether
3545 event extern modifier can be used.
3546 (EventField.EventFieldAccessor): Moved event field specific code here.
3547 (Event.AllowedModifiers): Even event can be extern.
3548 (Event.FindOutBaseMethod): New override specific to events.
3549 (Indexer.parameters): Reintroduce parameters because base class holds
3550 only properties common data.
3551 (Indexer.CheckForDuplications): Indexers are threated as methods so we
3552 need do extra parameters check.
3554 * const.cs: Update after FieldMember rename.
3556 * decl.cs (MemberCache.FindBaseEvent): New method.
3558 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
3559 to reflect that indexer is now derived from PropertyBased.
3561 * ecore.cs (GetMemberType): Made public.
3562 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
3565 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
3567 * typemanager.cs (CSharpSignature): Correctly print event accessors.
3568 (RegisterEvent): Removed.
3569 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
3570 (GetPrivateFieldOfEvent): Renamed to GetEventField.
3572 2007-01-11 Raja R Harinath <rharinath@novell.com>
3575 * statement.cs (CollectionForeach.TryType): Prefer generic
3576 GetEnumerator over non-generic variant. Fix code to follow comments.
3578 2007-01-09 Raja R Harinath <rharinath@novell.com>
3581 * support.cs (ReflectionParameter): Don't use an invalid index on
3582 the generic parameter data.
3584 2007-01-08 Miguel de Icaza <miguel@novell.com>
3586 * driver.cs: Just add a tiny bit of infrastructure.
3588 2007-01-02 Marek Safar <marek.safar@gmail.com>
3590 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
3591 where field type is struct from current assembly.
3593 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
3596 2007-01-02 Marek Safar <marek.safar@gmail.com>
3598 A fix for bug #80381
3599 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
3602 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
3604 (Namespace.LookupType): Always use core types from corlib when speficied.
3606 * report.cs: A new warning.
3608 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
3609 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
3610 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
3612 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
3613 (InitCoreTypes): Set expression type of object_type and value_type
3614 immediately after lookup.
3616 2007-01-01 Miguel de Icaza <miguel@novell.com>
3618 * cs-tokenizer.cs: Accept Pc class characters (Connector
3619 Punctuation) as valid identifiers. Fixes #78259
3621 * expression.cs (Invocation.DoResolve): Moved the check for the
3622 use of `this' for doing method calls to the Invocation resolution
3623 step, after overload resolution has taken place instead of doing
3624 the check at the low-level `This.DoResolve' level.
3626 The `This.DoResolve'(appens before overload resolution, so it has
3627 no way of knowing if the method that will be called will be
3628 instace or static, triggering an erroneous report for cs0188 (Bug
3631 We now do the check for instance method invocations after we know
3632 what method will be called.
3634 (This.CheckThisUsage): Move the actual use of this structure
3635 checking into its own method and expose it.
3637 * Everywhere that called Error_ValueCannotBeConverted: pass a new
3640 Exceptions: Null.ConvertImplicitly,
3641 Constant.ImplicitConversionRequired as there are too many call
3642 sites for passing the ec.
3644 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
3645 EmitContext, if the value is null, then we do not try to provide
3646 the extra information from the error (If a userdefined conversion
3647 exists, as UserDefinedConversion requires a non null-EmitContext).
3651 2006-12-30 Raja R Harinath <rharinath@novell.com>
3653 * flowanalysis.cs (MyBitVector): Document some invariants.
3654 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
3655 introduced below, and add a couple of others,
3657 2006-12-30 Marek Safar <marek.safar@gmail.com>
3659 * attribute.cs (GetMethodObsoleteAttribute): Uses new
3660 GetPropertyFromAccessor and GetEventFromAccessor.
3662 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
3663 overrides non-obsolete one.
3664 (Indexer.Define): Error message has been moved to the parser.
3666 * cs-parser.jay: Better syntax errors handling.
3668 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
3669 when an invocation has no arguments.
3671 * ecore.cs: Removed not used caching.
3673 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
3676 * report.cs: Add a new warning.
3678 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
3680 * typemanager.cs (enumeration_type): Removed.
3681 (CSharpSignature): Reuses IsSpecialMethod.
3682 (IsEqual): Hack for MS BCL.
3683 (GetPropertyFromAccessor): New method.
3684 (GetEventFromAccessor): New method.
3685 (IsSpecialMethod): Fixed to handle more cases.
3687 2006-12-30 Marek Safar <marek.safar@gmail.com>
3689 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
3690 Made white spaces array static.
3692 * ecore.cs (RemoveGenericArity): Optimized.
3694 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
3696 (MyBitVector.initialize_vector): Simplified.
3698 2006-12-22 Miguel de Icaza <miguel@novell.com>
3700 * ecore.cs: Am not entirely happy with this hack, but it seems to
3701 address the issue in 80257 (a small test case for
3704 I set the MethodGroupExpr.Type to an internal compiler type
3705 (itself in this case) to force the resolution to take place. Why
3706 it does not take place with a null is beyond me.
3708 2006-12-20 Marek Safar <marek.safar@gmail.com>
3710 A fix for bug #80288
3711 * expression.cs (ResolveOperator): Consider user defined conversion for
3712 logical and operator too.
3713 (EmitBranchable): Optimization for logical and when full constant folding
3714 could not be applied but one operand is constant.
3716 2006-12-19 Marek Safar <marek.safar@gmail.com>
3718 * class.cs (GetClassBases): Write 5 times every day, will never use
3719 FullName for error reporting.
3721 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
3723 2006-12-19 Martin Baulig <martin@ximian.com>
3725 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
3726 the symbol file info here.
3728 2006-12-18 Marek Safar <marek.safar@gmail.com>
3730 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
3731 of `elseif' is taking then following sections are not taking.
3732 Fixes an issue reported on mono mailing list.
3734 2006-12-18 Marek Safar <marek.safar@gmail.com>
3736 A fix for bug #80300
3737 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
3738 a caller is not taking.
3740 2006-12-18 Raja R Harinath <rharinath@novell.com>
3742 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
3743 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
3744 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
3745 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
3746 * class.cs: Update to changes.
3748 2006-12-17 Marek Safar <marek.safar@gmail.com>
3750 A fix for bug #79934
3751 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
3754 * class.cs (ResolveMembers): Register an iterator in current container and
3757 2006-12-16 Raja R Harinath <rharinath@novell.com>
3760 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
3761 satisfy a params annotated parameter.
3763 2006-12-16 Marek Safar <marek.safar@gmail.com>
3765 A fix for bug #77014
3766 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
3767 paramters correctly and not rely on hacks in Parameters class.
3768 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
3770 (Invocation.VerifyArgumentsCompat): Ditto.
3771 (Invocation.EmitArguments): Changed to correctly emit params arguments at
3774 * parameter.cs (HasParams): Don't assume that params is the last one.
3776 * support.cs (ReflectionParameters.ctor): Look for params attribute
3778 (ReflectionParameters.ParameterType): Removed hack when we returned last
3779 parameter for out of range parameters.
3780 (ParameterName, ParameterModifier): Ditto.
3782 2006-12-14 Marek Safar <marek.safar@gmail.com>
3784 A fix for bug #79987
3785 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
3786 when assembly is not CLS compliant but type is. I have no idea why is this
3789 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
3791 2006-12-13 Miguel de Icaza <miguel@novell.com>
3793 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
3794 in struct constructors, they are basically no-ops.
3796 2006-12-12 Marek Safar <marek.safar@gmail.com>
3798 * cs-tokenizer.cs (Position): Save preprocessor status too.
3800 2006-12-12 Marek Safar <marek.safar@gmail.com>
3802 A fix for bug #77794
3803 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
3805 2006-12-12 Marek Safar <marek.safar@gmail.com>
3807 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
3809 (pp_expr): Report error for an invalid expression.
3810 (handle_preprocessing_directive): Simplified; add more error checking.
3812 2006-12-11 Marek Safar <marek.safar@gmail.com>
3814 A fix for bug #74939
3815 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
3816 directives handling.
3818 2006-12-10 Marek Safar <marek.safar@gmail.com>
3820 A fix for bugs #80093, and #75984
3821 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
3822 logic, it seems to me as it worked before "by coincidence".
3823 (xtoken): Simplified to use reworked handle_preprocessing_directive.
3824 (cleanup): Enabled endif check.
3826 2006-12-09 Marek Safar <marek.safar@gmail.com>
3828 A fix for bug #80162
3829 * statement.cs (CollectionForeach.TryType): Generics and non-generics
3830 enumerators are never ambiguous.
3832 2006-12-08 Raja R Harinath <rharinath@novell.com>
3835 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
3837 2006-12-06 Marek Safar <marek.safar@gmail.com>
3839 A fix for bug #80144
3840 * class.cs (EventProperty.Define): Explicit implementation means
3841 that an even is used.
3843 2006-12-06 Marek Safar <marek.safar@gmail.com>
3845 Fixes the operators implementation (part II)
3847 * cfold.cs (DoConstantNumericPromotions): Renamed to
3848 DoBinaryNumericPromotions and simplified.
3849 (BinaryFold): Couple of conversion fixes; simplified.
3851 * constant.cs, ecore.cs, literal.cs
3852 (ToType): Renamed to ConvertImplicitly.
3853 (Reduce): Renamed to ConvertExplicitly.
3855 * class.cs, convert.cs: Updated.
3857 * expression.cs: TryReduce doesn't throw an exception.
3859 2006-12-01 Marek Safar <marek.safar@gmail.com>
3861 A fix for bug #80108
3862 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
3865 2006-11-30 Marek Safar <marek.safar@gmail.com>
3867 Fixes unary operators implementation (part I)
3870 * cfold.cs (Error_CompileTimeOverflow): Made internal
3872 * const.cs (IConstant): Changed to use reference to constant and
3873 not constant itself.
3874 Updated IConstant implementations.
3876 * constant.cs (CreateConstant): New factory method.
3877 Updated IConstant implementation.
3879 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
3881 * ecore.cs: Updated to use CreateConstantReference.
3883 * enum.cs: Reflects IConstant changes.
3885 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
3887 * literal.cs (NullConstant): Change to be independently usable.
3889 2006-11-29 Martin Baulig <martin@ximian.com>
3891 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
3892 we need to emit the scope initializer before calling the base .ctor.
3894 * anonymous.cs: Merged back from the new anonymous methods branch.
3895 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
3897 * expression.cs (ParameterReference.DoResolveBase): Create a
3898 "normal" ScopeInfo when capturing parameters rather than using the
3899 root scope; this makes things work with anonymous methods having
3903 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
3905 2006-11-22 Marek Safar <marek.safar@gmail.com>
3907 A fix for bug #79987
3908 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
3909 check to a base class.
3910 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
3911 only when assembly has missing attribute.
3912 * report.cs: Update.
3914 2006-11-21 Marek Safar <marek.safar@gmail.com>
3916 * cs-tokenizer.cs: Merged with gmcs version.
3918 2006-11-20 Marek Safar <marek.safar@gmail.com>
3921 * cs-parser.jay: Better error message when partial keyword is misplaced.
3923 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
3925 A fix for bug #79810
3926 report.cs: CS1058 only applies to 2.0 profile (gmcs).
3927 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
3928 a RuntimeWrappedException by default.
3930 2006-11-18 Marek Safar <marek.safar@gmail.com>
3932 A fix for bug #79843
3933 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
3935 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
3937 2006-11-18 Marek Safar <marek.safar@gmail.com>
3939 * driver.cs, namespace.cs: Uses faster IndexOf version.
3941 2006-11-17 Marek Safar <marek.safar@gmail.com>
3943 A fix for bug #79941
3944 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
3946 (Operator.Define): Implicit/Explicit operator of same type is duplicate
3947 even if internal name is different.
3948 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
3949 (UserDefinedConversion): Simplified as the operators cannot be internal.
3950 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
3952 (MethodLookup): Replaced EmitContext with parentType.
3953 * expression.cs: Updated.
3955 2006-11-09 Raja R Harinath <rharinath@novell.com>
3957 * driver.cs (BadAssembly): Handle all the ugliness of
3958 DefineDynamicAssembly.
3960 2006-11-08 Raja R Harinath <rharinath@novell.com>
3962 Address parts of #58244 -- most of what's left is in the runtime
3963 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
3964 CS1509 error checks, and handle them for all assembly loads, not
3965 just the first invocation.
3966 (LoadModule): Likewise. Move handling of 'adder_method' ...
3967 * codegen.cs (AssemblyClass.AddModule): ... here.
3969 2006-11-02 Marek Safar <marek.safar@gmail.com>
3971 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
3972 IEnumerable<T> is ambiguous.
3974 2006-10-31 Marek Safar <marek.safar@gmail.com>
3976 A fix for bug #67689
3977 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
3978 GetEnumerator is ambiguous.
3980 * report.cs: Add new warning.
3982 2006-10-29 Marek Safar <marek.safar@gmail.com>
3984 A fix for bug #78602
3985 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3986 to protected member can be nested type.
3988 2006-10-28 Marek Safar <marek.safar@gmail.com>
3990 A fix for bug #78965
3991 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3992 to protected member must derive from current type.
3994 2006-10-27 Marek Safar <marek.safar@gmail.com>
3996 assign.cs: Reuses error method.
3998 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
3999 instead of type for constants.
4000 (Expression.Error_ValueAssignment): Common error method.
4002 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
4005 2006-10-27 Marek Safar <marek.safar@gmail.com>
4007 A fix for bug #79081
4008 * expression.cs (MemberAccess.DoResolve): Check nested type
4011 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
4013 * doc.cs : nested delegates were not handled. Fixed bug #79754.
4015 2006-10-26 Marek Safar <marek.safar@gmail.com>
4017 A fix for bug #76591
4018 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
4020 2006-10-26 Marek Safar <marek.safar@gmail.com>
4022 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
4023 type forwarder of the same type multiple times.
4025 2006-10-26 Raja R Harinath <rharinath@novell.com>
4028 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
4029 instance as an rvalue, even when we later resolve as an lvalue.
4031 2006-10-25 Martin Baulig <martin@ximian.com>
4033 * anonymous.cs: Fix #79673.
4035 2006-10-24 Marek Safar <marek.safar@seznam.cz>
4037 A fix for bug #79666
4038 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
4039 ignored when is optimized (= default value) as its value is already set.
4041 2006-10-23 Marek Safar <marek.safar@seznam.cz>
4043 A fix for bug #79724
4044 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
4045 TypeContainer for type lookup.
4047 2006-10-23 Marek Safar <marek.safar@seznam.cz>
4049 A fix for bug #79231
4050 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
4051 * expression.cs (OverloadResolve): Always convert type name for
4053 (ResolveNamespaceOrType): Don't confuse a nested type with any
4056 2006-10-18 Martin Baulig <martin@ximian.com>
4058 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
4060 2006-10-17 Miguel de Icaza <miguel@novell.com>
4062 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
4063 an int32, but requesting an int64 from the conversion
4065 2006-10-12 Martin Baulig <martin@ximian.com>
4068 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
4070 2006-10-12 Martin Baulig <martin@ximian.com>
4073 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
4075 2006-10-11 Miguel de Icaza <miguel@novell.com>
4077 * convert.cs: Remove broken code: I was doing the "Existance"
4078 tests for Implicit conversions.
4080 2006-10-10 Miguel de Icaza <miguel@novell.com>
4082 * convert.cs: Added one missing case in
4083 ImplicitStandardConversionExists uint64 to intptr.
4087 * typemanager.cs (uintptr_type): another core known type.
4089 * ecore.cs (OperatorCast): routine used to do cast operations that
4090 depend on op_Explicit. We could change some of the Decimal
4091 conversions to use this.
4093 This one has a probe mechanism that checks both types for an op_
4094 which it coudl be used to eliminate two classes: CastToDecimal
4095 and CastFromDecimal.
4097 * convert.cs: Implement the conversions documented in #59800
4099 2006-10-10 Martin Baulig <martin@ximian.com>
4101 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
4102 before RootScope.ResolveMembers().
4104 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
4105 `CurrentType' if appropriate.
4107 2006-10-09 Marek Safar <marek.safar@seznam.cz>
4109 A fix for bug #78568
4110 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
4111 when contains binary operators.
4112 * cs-parser.jay: Updated.
4114 2006-10-09 Martin Baulig <martin@ximian.com>
4117 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
4118 moved that into Define() and also do the other type parameter
4119 checks there. Fixes #79094. Added gtest-292.cs.
4122 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
4123 since that doesn't include type parameters; don't use `Ldelema'
4124 for type parameters. Fixes #78980. Added gtest-293.cs.
4126 2006-10-08 Marek Safar <marek.safar@seznam.cz>
4129 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
4130 conversion is allowed.
4132 2006-10-06 Marek Safar <marek.safar@seznam.cz>
4134 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
4135 error reporting when no error occurs.
4137 2006-10-06 Marek Safar <marek.safar@seznam.cz>
4139 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
4142 2006-10-06 Raja R Harinath <rharinath@novell.com>
4145 * class.cs (DefineTypeBuilder): Check circular dependencies before
4146 setting the parent of the TypeBuilder.
4147 (CheckRecursiveDefinition): Don't use 'BaseType', since
4148 it may not be valid until after DefineTypeBuilder. Use
4149 'base_type' instead.
4151 2006-10-04 Martin Baulig <martin@ximian.com>
4153 Merged the Anonymous Methods patch.
4155 * anonymous.cs, iterators.cs: The new anonymous methods code.
4157 * statement.cs (Variable): New public abstract class.
4158 (LocalInfo.Variable): New public property.
4159 (LocalInfo.ResolveVariable): New public method.
4160 (Block.Flags): Add `IsIterator'.
4161 (Block.AddVariable): Improved the CS0136 check.
4162 (Block.AnonymousChildren): New public property.
4163 (Block.AddAnonymousChild): New public method.
4164 (ToplevelBlock): Update to use the new anonymous method framework.
4165 (ToplevelBlock.ctor): `container' is now a `Block' and not a
4166 `ToplevelBlock'; this is required to correctly implement the
4168 (Fixed, Using): Use `TemporaryVariable' instead of directly
4169 creating the `LocalBuilder'.
4171 * parameter.cs (Parameter.ResolveVariable): New public method.
4172 (Parameters.ResolveVariable): Likewise.
4174 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
4176 * class.cs (TypeContainer): Replaced the `iterators' list and
4177 corresponding methods with a list of `CompilerGeneratedClass'es.
4178 (TypeContainer.ResolveMembers): New public method.
4179 (Method): `IIteratorContainer' has been replaced by
4182 * expression.cs (VariableReference): New public abstract base
4183 class for `LocalVariableReference', `ParameterReference' and
4186 * codegen.cs (EmitContext): Removed `capture_context',
4187 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
4188 (EmitContext.EmitThis): Removed.
4190 * cs-parser.jay: Replace `iterator_container' with
4193 2006-10-04 Martin Baulig <martin@ximian.com>
4195 * generic.cs (GenericMethod): Don't make this abstract.
4196 (Constraints.Clone): Added dummy implementation.
4198 2006-10-04 Raja R Harinath <harinath@gmail.com>
4201 * namespace.cs (LookForAnyGenericType): Avoid nullref on
4202 'declspaces'. Avoid allocating arrays willy-nilly.
4205 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
4206 cases out of the switch.
4208 2006-09-28 Marek Safar <marek.safar@seznam.cz>
4210 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
4211 message when non-generic type is used with the type arguments.
4212 * expression.cs: Updated.
4214 2006-09-28 Raja R Harinath <rharinath@novell.com>
4217 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
4218 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4219 Change semantics slightly. Don't insist on having only one
4220 temporary EmptyExpression -- just throttle the creation of new ones.
4223 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
4224 non-interfaces too. If no methods are found, don't try to create
4227 2006-09-28 Marek Safar <marek.safar@seznam.cz>
4229 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
4232 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
4233 us produce better error message.
4235 2006-09-27 Marek Safar <marek.safar@seznam.cz>
4237 * expression.cs (Binary.ResolveOperator): Warn about a side effect
4238 of the `|' operator.
4240 * report.cs: A new warning added.
4242 2006-09-27 Martin Baulig <martin@ximian.com>
4244 * generic.cs (GenericMethod): Don't make this abstract.
4246 2006-09-27 Martin Baulig <martin@ximian.com>
4249 (InternalErrorException): Added overloaded ctor taking a params array.
4251 2006-09-26 Marek Safar <marek.safar@seznam.cz>
4253 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
4254 Fixed the cases when same error was reported twice.
4256 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
4257 now report symbol information.
4259 2006-09-25 Martin Baulig <martin@ximian.com>
4261 * class.cs: Completely unified with the gmcs version.
4263 2006-09-25 Martin Baulig <martin@ximian.com>
4265 * typemanager.cs (TypeManager.IsNullableType): New public function.
4266 (TypeManager.IsNullableTypeOf): Likewise.
4267 (TypeManager.IsNullableValueType): Likewise.
4269 * class.cs (MethodCore): Added the `GenericMethod' argument from
4270 gmcs and also unified all classes derived from `MethodCore' with gmcs.
4272 2006-09-24 Raja R Harinath <harinath@gmail.com>
4274 * convert.cs: Unify with gmcs version.
4276 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4278 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
4279 verify them as well.
4281 * report.cs: New warning.
4283 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4285 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
4286 for anonymous block with out argument.
4288 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4290 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
4291 not used private events only.
4293 2006-09-23 Marek Safar <marek.safar@seznam.cz>
4295 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
4297 * const.cs (Const.Define): Check for constant type.
4298 (Const.IsConstantTypeValid): Looks for valid constant types.
4300 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
4302 * ecore.cs (EmptyConstantCast): New common class for all constant based
4305 * expression.cs (Is.DoResolve): Handle null constant especially.
4306 (New.DoResolve): Check for new void().
4307 (MemberAccess.DoResolve): Cope with all kind of nulls.
4309 * literal.cs (NullConstant): Uses EmptyConstantCast.
4310 (NullDefault): Based on EmptyConstantCast.
4311 (NullLiteral): Uses EmptyConstantCast.
4313 * statement.cs (Block.ResolveMeta): Check for constant type.
4315 2006-09-22 Martin Baulig <martin@ximian.com>
4317 * delegate.cs, attribute.cs: Merged with the gmcs versions.
4319 2006-09-22 Raja R Harinath <rharinath@novell.com>
4321 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
4325 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
4326 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
4329 2006-09-22 Martin Baulig <martin@ximian.com>
4331 * ecore.cs: Merged with the gmcs version.
4333 * generic.cs (ConstructedType): New dummy class.
4334 (TypeArguments): Don't make this abstract.
4337 (TypeManager.IsGenericTypeDefinition): New method.
4338 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
4340 2006-09-22 Raja R Harinath <rharinath@novell.com>
4342 * expression.cs (ComposedCast): Check for arrays of TypedReference
4343 before creating the type, not after.
4345 2006-09-21 Marek Safar <marek.safar@seznam.cz>
4347 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
4348 after ToType change.
4350 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
4351 when constant must be implicitly convertible.
4353 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
4355 * ecore.cs (NullCast): Derives from NullConstant.
4357 * expression.cs (Is.DoResolve): Removed useless variables.
4358 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
4359 (New.Constantify): Add enum support.
4360 (MemberAccess.DoResolve): Add warning when accessing null constant or
4363 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
4366 * literal.cs (NullConstant): New abstract class with common
4367 functionality for all null specializations.
4368 (NullDefault): Represents default(X) when result can be
4370 (NullLiteral): Updated.
4372 * report.cs: Add new warning.
4374 2006-09-21 Martin Baulig <martin@ximian.com>
4376 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
4378 2006-09-21 Martin Baulig <martin@ximian.com>
4380 * generic.cs (GenericConstraints): New dummy class.
4381 (Constraints): Likewise.
4382 (TypeParameter): Likewise.
4383 (TypeParameterName): Likewise.
4384 (GenericMethod): Likewise.
4386 * typemanager.cs (TypeManager.GetGenericArguments): New method.
4388 * decl.cs: Merged with the gmcs version.
4390 2006-09-21 Raja R Harinath <rharinath@novell.com>
4392 * generic.cs (TypeParameter): Implement IMemberContainer.
4393 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
4395 * rootcontext.cs: Unify with gmcs version.
4397 * report.cs: Unify with gmcs version.
4398 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
4399 from gmcs/generics.cs.
4400 * generics.cs (TypeParameter): New dummy class.
4402 * support.cs: Unify with gmcs version.
4404 2006-09-20 Raja R Harinath <rharinath@novell.com>
4406 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
4407 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
4409 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
4410 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
4411 * mcs.exe.sources: Add generic.cs.
4413 * codegen.cs: Unify with gmcs version.
4415 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
4416 (EmitContext): Add GenericDeclContainer implementation.
4417 * decl.cs (MemberCore, DeclSpace): Likewise.
4418 * namespace.cs: Remove #ifdef GMCS_SOURCE.
4420 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
4421 MCS TypeManager has a corresponding dummy method.
4423 2006-09-19 Martin Baulig <martin@ximian.com>
4425 * expression.cs: Completely merged with the gmcs version.
4427 2006-09-19 Martin Baulig <martin@ximian.com>
4429 * expression.cs (Invocation): Merged with the gmcs version.
4430 (ArrayAccess.GetStoreOpcode): Likewise.
4432 2006-09-19 Martin Baulig <martin@ximian.com>
4435 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
4436 (TypeManager.IsGenericMethodDefinition): Likewise.
4438 2006-09-19 Martin Baulig <martin@ximian.com>
4441 (TypeManager.IsEqual): Moved the gmcs implementation here.
4442 (TypeManager.DropGenericTypeArguments): Likewise.
4443 (TypeManager.DropGenericMethodArguments): Likewise.
4444 (TypeManager.GetTypeArguments): Moved here from gmcs.
4445 (TypeManager.HasGenericArguments): Likewise.
4447 2006-09-19 Martin Baulig <martin@ximian.com>
4449 * expression.cs (Binary): Merged with the gmcs version.
4451 2006-09-19 Martin Baulig <martin@ximian.com>
4453 * expression.cs (Probe, As, Is): Merged with the gmcs version.
4455 2006-09-19 Martin Baulig <martin@ximian.com>
4457 * typemanager.cs: Merged with the gmcs version.
4459 2006-09-16 Raja R Harinath <rharinath@novell.com>
4461 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
4462 * driver.cs: Likewise.
4464 2006-09-16 Marek Safar <marek.safar@seznam.cz>
4467 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
4468 only if parent type is class.
4469 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
4472 2006-09-15 Marek Safar <marek.safar@seznam.cz>
4475 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
4477 * typemanager.cs(CSharpName): Converts NullType to null.
4479 2006-09-15 Martin Baulig <martin@ximian.com>
4482 (TypeManager.GetMethodName): Added mcs implementation.
4483 (TypeManager.IsEqual): Likewise.
4486 (SimpleName.RemoveGenericArity): Added dummy implementation.
4488 * pending.cs: Merged with the gmcs version.
4490 2006-09-15 Martin Baulig <martin@ximian.com>
4492 * statement.cs: Merge with the gmcs version.
4494 2006-09-15 Martin Baulig <martin@ximian.com>
4496 * statement.cs (Switch): Merge with the gmcs implementation
4497 (without nullables), which is newer.
4499 2006-09-15 Martin Baulig <martin@ximian.com>
4501 * statement.cs (Block.Variables): Make this public.
4502 (ToplevelBlock.Parameters): Make this a property.
4503 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
4505 2006-09-15 Martin Baulig <martin@ximian.com>
4507 * namespace.cs: Merge with the gmcs version.
4509 2006-09-15 Martin Baulig <martin@ximian.com>
4511 * decl.cs (MemberName): Minor code cleanups.
4513 2006-09-15 Martin Baulig <martin@ximian.com>
4515 * parameter.cs: Merge with the gmcs version.
4517 2006-09-15 Martin Baulig <martin@ximian.com>
4519 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
4520 and an error in mcs.
4522 2006-09-15 Martin Baulig <martin@ximian.com>
4524 * flowanalysis.cs: Merged from GMCS; added the generics code into
4525 a `GMCS_SOURCE' conditional so we can share this file.
4527 2006-09-08 Martin Baulig <martin@ximian.com>
4529 * typemanager.cs (TypeManager.interlocked_type): New public field.
4530 (TypeManager.int_interlocked_compare-exchange): New public field.
4531 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
4532 enumerator types here and call InitGenericCoreTypes().
4533 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
4534 after calling InitEnumUnderlyingTypes().
4537 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
4538 `classes_second_stage'.
4540 2006-09-14 Marek Safar <marek.safar@seznam.cz>
4542 * assign.cs, ecore.cs, expression.cs: Share error message text.
4543 * class.cs (FieldMember.Define): Check for varible of static type.
4544 * driver.cs (LoadAssembly): Uses error output for errors.
4545 * statement.cs: Updated.
4547 2006-09-08 Marek Safar <marek.safar@seznam.cz>
4549 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
4552 2006-09-07 Martin Baulig <martin@ximian.com>
4555 (MainDriver): Revert r62663 from Marek; see #70506 for details.
4557 2006-08-29 Miguel de Icaza <miguel@novell.com>
4559 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
4561 2006-08-17 Miguel de Icaza <miguel@novell.com>
4563 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4564 #52019 and #79064, the use of the \uXXXX sequence in source code
4565 to represent unicode characters.
4567 2006-08-15 Marek Safar <marek.safar@seznam.cz>
4569 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
4571 * class.cs, ecore.cs, statement.cs: Merged to one error message.
4573 2006-08-13 Miguel de Icaza <miguel@novell.com>
4575 * assign.cs: Catch attempts to assign to a method groups in += and
4578 2006-08-13 Marek Safar <marek.safar@seznam.cz>
4581 * cs-parser.jay: Don't destroy current array type by typeof of array's.
4583 2006-08-12 Marek Safar <marek.safar@seznam.cz>
4585 * class.cs (Method.Define): Issue a warning when generic method looks like
4587 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
4590 2006-08-09 Marek Safar <marek.safar@seznam.cz>
4592 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
4594 * decl.cs (MemberCache.FindMembers): When container is interface we need to
4595 search all base interfaces as a member can be ambiguous.
4596 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
4597 Constructor member type filter.
4598 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
4599 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
4600 reporting for returned memberinfos.
4601 * report.cs: Updated.
4602 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
4603 version to work on all runtimes.
4604 (TypeManager.RealMemberLookup): Removed members filtering.
4606 2006-08-08 Raja R Harinath <rharinath@novell.com>
4608 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
4609 (PropertyExpr.EmitAssign): Likewise.
4610 * expression.cs (Indirection.EmitAssign): Likewise.
4611 (LocalVariableReference.EmitAssign): Likewise.
4612 (ParameterReference.EmitAssign): Likewise.
4613 (Invocation.EmitArguments): Likewise.
4614 (ArrayAccess.EmitAssign): Likewise.
4615 (IndexerAccess.EmitAssign): Likewise.
4616 (This.EmitAssign): Likewise.
4617 (ConditionalLogicalOperator.Emit): Likewise.
4620 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
4621 instead of ArrayList. If the hashtable has a LocalBuilder, don't
4622 leave it in after returning it.
4623 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
4625 2006-08-06 Marek Safar <marek.safar@seznam.cz>
4627 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
4630 2006-08-03 Raja R Harinath <rharinath@novell.com>
4632 Fix cs0146-3.cs and cs0146-4.cs.
4633 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
4634 enclosing types don't depend on the current type.
4636 2006-08-02 Raja R Harinath <rharinath@novell.com>
4639 * class.cs (TypeContainer.DoDefineMembers): Use
4640 FindBaseMemberWithSameName on Parent, since we're interested in
4641 whether we hide inherited members or not.
4642 (FindBaseMemberWithSameName): Make slightly more robust.
4644 Fix the non-generic testcase from #77396
4645 * decl.cs (DeclSpace.DeclContainer): Remove override.
4647 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4648 declspaces for doppelgangers too.
4649 (UsingEntry): Implement IResolveContext.
4650 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
4651 'this' as the resolve context.
4652 (LocalAliasEntry): Likewise.
4654 Implement parts of #77403
4655 * roottypes.cs (RootDeclSpace): New. Used to represent the
4656 toplevel declaration space. Each namespace declaration introduces
4657 a "partial" root declaretion space.
4658 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
4659 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
4660 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
4661 from 'current_namespace.SlaveDeclSpace'.
4662 (namespace_declaration): Likewise.
4663 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
4664 check. It can't happen now.
4665 * decl.cs (DeclSpace.LookupType): Likewise.
4666 * driver.cs (MainDriver): Sanity check.
4668 2006-08-01 Raja R Harinath <rharinath@novell.com>
4670 * decl.cs (DeclSpace.FindNestedType): Remove.
4671 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
4672 LookupTypeContainer to get the container of the nested type.
4673 * class.cs (TypeContainer.FindNestedType): Make non-override.
4675 2006-07-31 Raja R Harinath <rharinath@novell.com>
4677 * decl.cs (DeclSpace.PartialContainer): Move field from ...
4678 * class.cs (TypeContainer.PartialContainer): ... here.
4679 (TypeContainer.AddBasesForPart): New helper.
4680 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
4682 * cs-parser.jay (current_class): Convert to DeclSpace.
4683 (struct_declaration, interface_declaration, class_declaration):
4684 Use AddBasesForPart instead of .Bases directly.
4685 * const.cs, iterators.cs: Update to changes.
4687 2006-07-28 Raja R Harinath <rharinath@novell.com>
4689 * class.cs (TypeContainer.AddMemberType): Rename from
4691 (TypeContainer.AddMember): Rename from AddToMemberContainer.
4692 (AddTypeContainer): New. Combine AddClassOrStruct and
4694 (AddPartial): Update. Add 'is_partial' argument.
4695 * roottypes.cs: Update to changes.
4696 * cs-parser.jay (push_current_class): New helper for handling
4697 current_container and current_class.
4698 (struct_declaration, interface_declaration, class_declaration):
4701 2006-07-26 Raja R Harinath <rharinath@novell.com>
4703 * roottypes.cs: Rename from tree.cs.
4705 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
4706 * tree.cs (Tree, ITreeDump): Remove types.
4707 * rootcontext.cs (tree, Tree): Remove fields.
4708 (root, ToplevelTypes): New.
4709 * *.cs: Update to rename.
4711 * tree.cs (Tree.RecordDecl): Remove.
4712 (RootTypes.AddToTypeContainer): Record the toplevel type in its
4714 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
4716 2006-07-23 Raja R Harinath <harinath@gmail.com>
4718 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
4719 DoFlowAnalysis and OmitStructFlowAnalysis here.
4720 (ec.With): Rename from WithUnsafe and generalize.
4721 (ec.WithCheckState): Remove. All users can be handled by 'With'.
4722 (ec.WithFlowAnalyis): New.
4723 * ecore.cs, expression.cs, statement.cs: Update.
4725 2006-07-22 Raja R Harinath <harinath@gmail.com>
4727 * statement.cs (Block.ResolveMeta): Simplify slightly.
4729 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
4730 multiple boolean fields. Convert InUnsafe, constant_check_state,
4731 check_state to flags.
4732 (CheckState, ConstantCheckState): Update.
4733 (InUnsafe): New read-only property.
4734 (FlagsHandle): Rename from CheckStateHandle and convert to handle
4736 (WithUnsafe): New helper similar to WithCheckState.
4737 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
4738 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
4740 2006-07-21 Raja R Harinath <rharinath@novell.com>
4742 Make comparisons use the same IL irrespective of whether they're
4743 in a 'checked' or 'unchecked' context: one of the issues in #78899
4744 * codegen.cs (EmitContext.CheckState): Make read-only property.
4745 (EmitContext.ConstantCheckState): Likewise.
4746 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
4747 helper that implement a save/restore stack for CheckState
4748 values. This is the only way to change check-state.
4749 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
4750 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
4751 (CheckedExpr.EmitBranchable): New forwarding method.
4752 (UnCheckedExpr): Likewise.
4753 * statement.cs (Block.ResolveMeta): Use WithCheckState.
4754 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
4755 (Checked.Resolve, checked.DoEmit): Likewise.
4757 2006-07-20 Miguel de Icaza <miguel@novell.com>
4759 * anonymous.cs: Cache the resolved anonymous delegate, and return
4760 this so that the ResolveTopBlock is only triggered once, not
4763 Currently we trigger ResolvetopBlock twice due to a first pass of
4764 argument check compatibility, and a second pass that does the
4767 2006-07-15 Marek Safar <marek.safar@seznam.cz>
4769 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
4771 * rootcontext.cs (Reset): Add helper_classes.
4773 2006-07-15 Marek Safar <marek.safar@seznam.cz>
4776 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
4779 2006-07-13 Miguel de Icaza <miguel@novell.com>
4781 * statement.cs (Lock): Handle expressions of type
4782 TypeManager.null_type specially. Fixes #78770
4784 2006-07-08 Marek Safar <marek.safar@seznam.cz>
4786 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
4789 2006-07-08 Marek Safar <marek.safar@seznam.cz>
4791 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
4792 for accessors as well.
4793 * ecore.cs (EventExpr): Add AccessorTable.
4795 2006-07-01 Marek Safar <marek.safar@seznam.cz>
4798 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
4799 for CS0122 where appropriate.
4800 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
4802 (Filter): Assembly can be null in the case of top level attributes.
4804 2006-06-25 Marek Safar <marek.safar@seznam.cz>
4808 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
4809 is done at global level.
4811 2006-06-24 Marek Safar <marek.safar@seznam.cz>
4813 A fix for #77002, Implemented TypeForwarder support.
4815 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
4816 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
4817 * typemanager.cs (): Add type_forwarder_attr_type.
4819 2006-06-24 Marek Safar <marek.safar@seznam.cz>
4821 * report.cs: Add CS0469 warning.
4823 2006-06-21 Martin Baulig <martin@ximian.com>
4825 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
4826 the `try'-block, so we also report CS0016 etc. there.
4828 2006-06-21 Martin Baulig <martin@ximian.com>
4831 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
4833 2006-06-21 Martin Baulig <martin@ximian.com>
4835 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
4836 also report CS1686 for parameters.
4838 2006-06-21 Martin Baulig <martin@ximian.com>
4840 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
4841 instead of an error if the value is not implicitly convertible to
4842 the switch types; fixes #77964.
4844 2006-06-21 Raja R Harinath <rharinath@novell.com>
4847 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
4848 FieldBuilder is null.
4851 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
4852 'left' and 'right' before error-checking.
4854 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
4856 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
4858 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
4859 (FieldExpr.DoResolve): likewise.
4860 (PropertyExpr.InstanceResolve): likewise.
4861 (EventExpr.InstanceResolve): likewise.
4863 2006-06-04 Marek Safar <marek.safar@seznam.cz>
4865 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
4866 attribute applicable tests for attribute argument.
4868 2006-06-02 Raja R Harinath <rharinath@novell.com>
4871 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
4872 (Binary.OverloadResolve_PredefinedIntegral): New.
4873 (Binary.OverloadResolve_PredefinedFloating): New.
4874 (Binary.OverloadResolve_PredefinedString): New.
4875 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
4876 Follow the standard more closely, and treat numeric promotions in
4877 terms of overload resolution.
4878 (Binary.CheckShiftArguments): Simplify.
4880 2006-06-01 Raja R Harinath <rharinath@novell.com>
4882 * flowanalysis.cs (MyBitVector): Simplify representation.
4883 (MyBitVector.Clone): Avoid allocating BitArray.
4884 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
4885 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
4886 (*): Update. Change all references to MyBitVector.And and
4887 MyBitVector.Or to &= and |=.
4889 2006-05-29 Raja R Harinath <rharinath@novell.com>
4892 * cs-parser.jay (formal_parameter_list): Extend the pattern below
4893 to param arguments too.
4895 2006-05-26 Miguel de Icaza <miguel@novell.com>
4897 * cs-parser.jay: Catch another parsing form for arglist being
4898 followed by other arguments. Fixes #78313.
4900 2006-05-24 Raja R Harinath <rharinath@novell.com>
4902 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
4903 checking of out parameters to ...
4904 (FlowBranchingToplevel.Merge): ... here.
4905 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
4906 set, propagate the origin upward, and only complain if there was
4908 (FlowBranchingException.AddContinueOrigin): Likewise.
4909 (FlowBranchingException.AddReturnOrigin): Likewise.
4910 (FlowBranchingException.AddGotoOrigin): Likewise.
4912 2006-05-23 Raja R Harinath <rharinath@novell.com>
4914 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
4915 unreachable, skip it.
4916 (FlowBranchingException.Merge): Always propagate jumps, even if
4917 the finally block renders subsequent code unreachable.
4919 2006-05-18 Raja R Harinath <rharinath@novell.com>
4922 * statement.cs (Goto.Resolve): Move responsibility for resolving
4923 'goto' to FlowBranching.AddGotoOrigin.
4924 (Goto.SetResolvedTarget): New. Callback to set the
4925 LabeledStatement that's the target of the goto.
4926 (Goto.DoEmit): Use Leave instead of Br when crossing an
4927 unwind-protect boundary.
4928 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
4929 LookupLabel and adjust to new semantics.
4930 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
4931 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
4932 Goto.SetResolvedTarget to update target.
4933 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
4934 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
4935 AddBreakOrigin & co. Delay propagation until ...
4936 (FlowBranchingException.Merge): ... this.
4938 * statement.cs (Block.Resolve): Always depend on flow-branching to
4939 determine unreachability. Kill workaround that originally emitted
4940 only one statement after an "unreachable" label (see infloop in
4943 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
4944 This is still "wrong", but anything better would probably need a
4945 multi-pass algorithm.
4946 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
4947 usage vector. Force current usage vector to be reachable, to
4948 optimistically signify backward jumps.
4949 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
4951 (FlowBranchingLabeled.Merge): New. If no backward jump was
4952 detected, return the original salted-away usage vector instead,
4953 updated with appropriate changes. Print unreachable warning if
4955 * statement.cs (Block.Resolve): Don't print unreachable warning on
4956 a labeled statement.
4958 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
4960 * driver.cs: Pass filename without path to AssemblyBuilder's
4961 AddResourceFile. Fixes bug #78407.
4963 2006-05-17 Raja R Harinath <rharinath@novell.com>
4965 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
4966 * flowanalysis.cs (FlowBranchingLabeled): ... here.
4967 (FlowBranching.MergeChild): Overwrite
4968 reachability information from Labeled branchings too.
4970 2006-05-16 Raja R Harinath <rharinath@novell.com>
4972 * statement.cs (Goto.Resolve): Merge jump origins here ...
4973 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
4975 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
4976 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
4977 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
4978 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
4980 * statement.cs (Goto.Resolve): ... not here.
4981 (Goto.Emit): Remove CS1632 check.
4983 2006-05-14 Marek Safar <marek.safar@seznam.cz>
4985 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
4988 2006-05-11 Raja R Harinath <rharinath@novell.com>
4990 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
4991 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
4992 (FlowBranchingException.Label): Likewise.
4994 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
4996 (MyBitVector.Or): Use it to avoid losing information (Count).
4997 (FlowBranching.MergeOrigins): Likewise.
4999 * flowanalysis.cs (UsageVector.IsDirty): Remove.
5000 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
5001 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
5002 (UsageVector.ToString): Simplify.
5003 (UsageVector.MergeSiblings): Move here from ...
5004 (FlowBranching.Merge): ... here.
5005 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
5008 2006-05-10 Raja R Harinath <rharinath@novell.com>
5010 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
5011 null bitvector is treated as all-true.
5013 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
5014 (MyBitVector): Rationalize invariants. 'vector != null' implies
5015 that we have our own copy of the bitvector. Otherwise,
5016 'InheritsFrom == null' implies all inherited bits are true.
5018 2006-05-09 Marek Safar <marek.safar@seznam.cz>
5020 * statement.cs (LocalInfo): Add IsConstant.
5021 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
5022 local variable for constants.
5024 2006-05-09 Raja R Harinath <rharinath@novell.com>
5026 * flowanalysis.cs (MyBitVector.Empty): New.
5027 (MyBitVector): Don't allow InheritedFrom to be null.
5028 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
5029 (UsageVector, FlowBranching): Update to changes.
5031 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
5032 recursion. The 'Parent == null' condition isn't sufficient for
5034 (FlowBranching.AddBreakOrigin): Likewise.
5035 (FlowBranching.AddContinueOrigin): Likewise.
5036 (FlowBranching.AddReturnOrigin): Likewise.
5037 (FlowBranching.StealFinallyClauses): Likewise.
5038 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
5039 (FlowBranching.CheckOutParameters): Likewise.
5040 (FlowBranchingToplevel): Terminate all the above recursions here.
5041 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
5042 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
5044 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
5046 (FlowBranchingToplevel): New. Empty for now.
5047 (FlowBranching.MergeTopBlock): Update.
5048 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
5049 branching for the anonymous delegate.
5050 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
5052 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
5053 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
5054 information at the start of the merge. Reorganize.
5056 2006-05-07 Marek Safar <marek.safar@seznam.cz>
5058 * class.cs (MethodData.Define): Method cannot implement interface accessor.
5060 2006-05-07 Marek Safar <marek.safar@seznam.cz>
5062 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
5063 to newly introduced ctor.
5065 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
5066 message to one place.
5067 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
5070 2006-05-07 Marek Safar <marek.safar@seznam.cz>
5072 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
5074 * ecore.cs (Expression.ResolveAsConstant): Updated.
5076 * statement.cs (ResolveMeta): Updated.
5078 2006-05-06 Marek Safar <marek.safar@seznam.cz>
5080 * cs-parser.jay: __arglist cannot be used in initializer.
5082 2006-05-06 Marek Safar <marek.safar@seznam.cz>
5085 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
5088 2006-05-05 Raja R Harinath <rharinath@novell.com>
5090 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
5091 (LabeledStatement): Add 'name' parameter.
5092 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
5093 (Block.AddLabel): Update to changes.
5094 * cs-parser.jay (labeled_statement): Likewise.
5096 * flowanalysis.cs (BranchingType.Labeled): New.
5097 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
5098 (FlowBranchingLabeled): New. Does nothing for now, but will
5099 eventually handle 'goto' flows.
5100 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
5101 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
5102 that's terminated ...
5103 (Block.Resolve): ... here.
5105 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
5106 (UsageVector.MergeFinallyOrigins): Likewise.
5107 (FlowBranching.InTryOrCatch): Likewise.
5108 (FlowBranching.AddFinallyVector): Likewise.
5109 (FlowBranchingException): Update to changes.
5112 * statement.cs (Return.Resolve): Move error checking to ...
5113 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
5114 (FlowBranchingException): Handle return origins like break and
5116 (FlowBranching.UsageVector.CheckOutParameters): Remove.
5118 2006-05-04 Marek Safar <marek.safar@seznam.cz>
5121 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
5124 2006-05-04 Marek Safar <marek.safar@seznam.cz>
5127 * class.cs (MethodData.Define): Do public accessor check only when method
5128 implements an interface.
5130 2006-05-04 Raja R Harinath <rharinath@novell.com>
5132 Remove special handling of 'break'
5133 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
5134 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
5135 (UsageVector.Break): Remove.
5136 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
5138 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
5140 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
5141 UsageVector.Breaks (). Don't set NeedsReturnLabel.
5143 2006-05-03 Marek Safar <marek.safar@seznam.cz>
5146 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
5147 be the interface member.
5149 2006-05-03 Marek Safar <marek.safar@seznam.cz>
5152 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
5153 for emitting small (int) values.
5155 2006-05-03 Raja R Harinath <rharinath@novell.com>
5158 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
5159 control-flow passes through the 'finally' after merging-in all the
5160 control-flows from 'try' and the 'catch' clauses.
5162 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
5163 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
5164 always true at the only non-recursive entry point.
5165 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
5166 FlowBranchingBreakable.
5167 (FlowBranchingLoop): Remove.
5168 * statement.cs (Return.DoResolve): Update to changes.
5171 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
5172 (FlowBranching.CreateBranching): Handle it: create a
5173 FlowBranchingContinuable.
5174 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
5175 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
5176 except that it handles the 'continue' command.
5177 (FlowBranching.UsageVector.MergeOrigins): Rename from
5179 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
5180 except that it overrides AddContinueOrigin.
5181 (FlowBranchingException): Override AddContinueOrigin, similar to
5183 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
5184 Create a new branching around the embedded statement.
5185 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
5186 control flow after the embedded statement.
5187 (Continue.Resolve): Move all error checking to AddContinueOrigin.
5189 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
5190 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
5191 FlowBranchingBreakable.
5192 (FlowBranchingSwitch): Remove.
5195 * statement.cs (Break.Resolve): Simplify. Move responsibility for
5196 error reporting to ...
5197 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
5198 Rename from 'AddBreakVector'. Add new location argument. Return
5199 a bool indicating whether the 'break' crosses an unwind-protect.
5200 (FlowBranchingException.AddBreakOrigin): Add.
5201 (FlowBranchingException.Merge): Propagate 'break's to surrounding
5202 flowbranching after updating with the effects of the 'finally'
5204 (FlowBranchingBreakable): New common base class for
5205 FlowBranchingLoop and FlowBranchingSwitch.
5207 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
5209 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
5211 2006-05-02 Raja R Harinath <rharinath@novell.com>
5213 * statement.cs (Do.Resolve): If the loop is infinite, set the
5215 (While.Resolve, For.Resolve): Set a barrier after the embedded
5216 statement. There's no direct control flow that goes from the end
5217 of the embedded statement to the end of the loop.
5218 * flowanalysis.cs (FlowBranching.Infinite): Remove.
5219 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
5220 above ensure that the reachability is correctly computed.
5222 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
5223 (UsageVector.MergeBreakOrigins): If the current path is
5224 unreachable, treat it as if all parameters/locals are initialized.
5225 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
5226 infinite loops before merging-in break origins.
5228 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
5229 (Reachability.Reachable): Split part into ...
5230 (Reachability.Unreachable): ... this. Simplify.
5231 (Reachability.IsUnreachable): Use 'Unreachable' instead.
5233 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
5234 (Reachability.SetThrowsSometimes): Likewise.
5235 (FlowBranchingBlock.MergeTopBlock): Don't compare against
5236 TriState.Always, use corresponding property.
5237 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
5238 (Block.Resolve): Likewise. Remove some redundant checks.
5240 2006-05-02 Raja R Harinath <harinath@gmail.com>
5242 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
5243 (Reachability.Meet): Don't bother checking AlwaysThrows --
5244 barrier is always set.
5245 (FlowBranchingBlock.Merge): Likewise.
5247 2006-05-01 Raja R Harinath <harinath@gmail.com>
5249 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
5250 checks for unreachable.
5252 2006-05-01 Marek Safar <marek.safar@seznam.cz>
5255 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
5257 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
5258 whether field is really assigned.
5260 2006-04-30 Raja R Harinath <harinath@gmail.com>
5262 * flowanalysis.cs (Reachability): Make 4-argument constructor
5264 (Reachability.Meet): Rename from 'And'. Remove static variant.
5265 (Reachability.Always): Rename from the highly misleading
5266 'Reachability.Never'.
5267 (FlowBranching.Merge): Update to changes. Mark an impossible
5268 situation with a 'throw'.
5269 (*): Update to changes.
5271 2006-04-29 Raja R Harinath <harinath@gmail.com>
5273 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
5275 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
5276 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
5277 (*): Update to changes.
5278 * statement.cs: Update to changes.
5280 2006-04-28 Marek Safar <marek.safar@seznam.cz>
5283 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
5285 2006-04-28 Raja R Harinath <harinath@gmail.com>
5287 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
5290 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
5291 argument to two arguments: an usage-vector and a bool. Move call
5292 to FlowBranching.Merge () ...
5293 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
5295 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
5296 handling of loop and switch reachability to ...
5297 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
5299 2006-04-27 Raja R Harinath <harinath@gmail.com>
5301 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
5302 handling to FlowBranchingLoop.InLoop.
5303 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
5305 2006-04-26 Marek Safar <marek.safar@seznam.cz>
5308 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
5309 anonymous method is allowed from AnonymousContainer here.
5311 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
5313 2006-04-24 Raja R Harinath <rharinath@novell.com>
5316 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
5318 2006-04-23 Marek Safar <marek.safar@seznam.cz>
5321 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
5322 (DoubleConstant.Reduce): Ditto.
5324 2006-04-23 Raja R Harinath <rharinath@novell.com>
5326 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
5327 Remove 'lvalue_right_side' argument. Move parts to ...
5328 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
5329 (LocalVariable.DoResolveLValue): ... these.
5331 2006-04-21 Raja R Harinath <rharinath@novell.com>
5334 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
5335 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
5336 (LocalVariableReference.DoResolveBase): Use it to implement new
5338 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
5339 (Argument.Resolve): Simplify. Move CS1510 check ...
5340 * ecore.cs (Expression.ResolveLValue): ... here.
5341 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
5342 (PropertyExpr.DoResolveLValue): Likewise.
5343 (FieldExpr.Report_AssignToReadonly): Likewise.
5344 (FieldExpr.DoResolve): Add 'out_access' argument. Use
5345 LValueMemberAccess or LValueMemberOutAccess on instance depending
5347 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
5348 DoResolve as appropriate.
5350 2006-04-20 Raja R Harinath <rharinath@novell.com>
5353 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
5354 implicit conversions on 'out' and 'ref' arguments.
5356 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
5357 improve clarity. Remove dead code.
5360 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
5361 (Catch.Resolve): Resolve VarBlock if it exists.
5363 2006-04-19 Miguel de Icaza <miguel@novell.com>
5365 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
5366 twice, this was some residual code, the enumerator was emitted
5367 properly in the two branche of if later.
5369 2006-04-19 Raja R Harinath <rharinath@novell.com>
5371 * expression.cs (Cast.ResolveLValue): Remove. The result of a
5372 cast is never an lvalue.
5373 (Cast.DoResolve, Cast.ResolveRest): Combine.
5374 (Argument.Emit): Simplify slightly. Move 'Expr is
5375 IMemoryLocation' check ...
5376 (Argument.Resolve): ... here.
5377 (Argument.Error_LValueRequired): Remove. Inline into only user.
5379 Simplifications. Fix cs0191-2.cs
5380 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
5381 CS1649 and CS1651 to ...
5382 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
5383 the actual selection of the error code and message to a lookup
5384 table. Add a dummy return value to simplify callsites.
5385 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
5386 readonly fields of other instances of the same type. Move CS0197
5388 * expression.cs (Argument.Resolve): ... here. Simplify code.
5389 Ensure that ec.InRefOutArgumentResolving is only set during LValue
5390 resolution of an out or ref argument. The code simplification
5391 above uses this invariant.
5393 2006-04-18 Raja R Harinath <rharinath@novell.com>
5395 Possibly fix #77752. Fix cs1690-[4-7].cs.
5396 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
5397 CheckMarshallByRefAccess. Drop parameter.
5398 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
5400 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
5402 * report.cs (AllWarnings): Add CS1690.
5403 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
5405 (LocalVariableReference.DoResolveBase): Update.
5407 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5409 * class.cs (MethodOrOperator): Moved common parts from method class.
5410 detect obsolete attributes.
5411 (Method.Define): Simplified as it reuses code from base.
5412 (Constructor.ValidAttributeTargets): Fixed issue found during
5414 (Destructor.ValidAttributeTargets): Fixed issue found during
5416 (Operator): Finished refactoring set off by #78020. Operator class is now
5417 ordinary method class.
5419 * anonymous.cs: Updated.
5421 * decl.cs (DeclSpace): Add IsGeneric
5423 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5425 * class.cs (Constructor.Emit): Don't emit the attributes twice.
5427 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5429 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
5430 detect obsolete attributes.
5431 (Method.CreateEmitContext): Moved to MethodOrOperator.
5433 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5436 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
5437 customized exception to make crash detection easier.
5438 (MethodOrOperator): Started to work on new base class for methods and
5440 (Method): Derives from MethodOrOperator.
5441 (Constructor.Emit): Emits its own attributes.
5442 (AbstractPropertyEventMethod.Emit): Ditto.
5443 (Operator): Derives from MethodOrOperator, will refactor fully in extra
5445 (Operator.Emit): It's temporary more tricky than should be.
5447 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
5449 * report.cs (InternalErrorException): Add ctor with inner exception.
5451 2006-04-08 Marek Safar <marek.safar@seznam.cz>
5454 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
5457 2006-04-07 Marek Safar <marek.safar@seznam.cz>
5460 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
5463 2006-04-06 Marek Safar <marek.safar@seznam.cz>
5465 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
5466 attribute is present and Guid not.
5467 (Interface.ApplyAttributeBuilder): Ditto.
5469 * attribute.cs: Add error message.
5471 2006-04-06 Marek Safar <marek.safar@seznam.cz>
5475 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
5476 sources (it's composite) so hold them in extra array as they are used in
5477 Emit phase only. It worked in the previous versions by mistake.
5478 (Attribute.Emit): Emit attribute for more owners when exist.
5480 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
5481 it has now different behaviour.
5483 2006-04-04 Marek Safar <marek.safar@seznam.cz>
5485 * constant.cs (Constant.IsDefaultInitializer): New method.
5487 * class.cs: Updated.
5489 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
5490 re-initialize default values. It saves KBs almost for every assembly.
5491 Thanks Zoltan for the idea.
5492 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
5493 (ArrayCreation.DoResolve): Resolve only once.
5494 (ArrayCreation.Emit): Emit static initializer only when it is faster.
5495 (ArrayCreation.GetAttributableValue): Cope with optimized values.
5497 2006-04-03 Zoltan Varga <vargaz@gmail.com>
5499 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
5502 2006-04-01 Marek Safar <marek.safar@seznam.cz>
5504 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
5505 in an embedded statement too.
5507 2006-04-01 Raja R Harinath <rharinath@novell.com>
5510 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
5512 2006-04-01 Marek Safar <marek.safar@seznam.cz>
5516 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
5519 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
5521 2006-03-31 Marek Safar <marek.safar@seznam.cz>
5523 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
5526 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
5527 LocalTemporary change.
5529 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
5531 (ClassOrStruct.DefineFieldInitializers): Implemented static field
5532 initializers optimization.
5533 (ClassOrStruct.TypeAttr): Moved from modifiers.
5534 (Constructor.CheckBase): Don't crash when static ctor has parameters.
5535 (FieldBase.ResolveInitializer): Resolves initializer.
5536 (FieldBase.HasDefaultInitializer): New property.
5538 * cs-parser.jay: Removed message.
5540 * expression.cs (CompilerGeneratedThis): New specialization.
5542 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
5544 2006-03-28 Marek Safar <marek.safar@seznam.cz>
5546 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
5548 2006-03-27 Marek Safar <marek.safar@seznam.cz>
5550 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
5551 be now EnumConstants only.
5553 2006-03-27 Marek Safar <marek.safar@seznam.cz>
5555 * attribute.cs, driver.cs: Reset more caches.
5557 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5559 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
5561 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5563 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
5564 for easier reuse. Updated all overrides.
5565 (IntegralConstant): New base class for all integral constants.
5566 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
5567 of the constant range, report custom error.
5568 (UIntConstant.Reduce): Fixed uint conversion.
5570 * ecore.cs, literal.cs: Reduce updates.
5572 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5576 * class.cs (Constructor.Define): Removed extra if for default ctors.
5577 A patch from Atsushi Enomoto.
5579 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5581 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
5582 GetAttributableValue.
5584 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
5587 * convert.cs (ImplicitConversionRequired): Error message moved to
5590 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
5591 automatic implicit conversion of an output value.
5592 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
5594 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
5596 (TypeOf.GetAttributableValue): Add extra handling for object type.
5598 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
5599 special error message.
5601 2006-03-25 Marek Safar <marek.safar@seznam.cz>
5603 * class.cs (Constructor.Emit): Don't crash when struct ctor is
5605 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
5606 compatible with MS runtime.
5608 2006-03-23 Marek Safar <marek.safar@seznam.cz>
5610 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
5611 attribute arguments here.
5613 * class.cs (Indexer.Define): The check was moved to attribute class.
5615 2006-03-22 Marek Safar <marek.safar@seznam.cz>
5617 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
5618 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
5621 2006-03-22 Raja R Harinath <rharinath@novell.com>
5623 Support ParameterDefaultValueAttribute in gmcs. Also applied to
5624 mcs to keep code differences small.
5625 * attribute.cs (Attribute.GetParameterDefaultValue): New.
5626 * typemanager.cs (parameter_default_value_attribute_type): New.
5627 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
5630 2006-03-21 Marek Safar <marek.safar@seznam.cz>
5632 * expression.cs (StringConcat.Append): Reverted back to no warning state.
5634 2006-03-21 Marek Safar <marek.safar@seznam.cz>
5636 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
5638 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
5641 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
5643 * doc-bootstrap.cs : fix build.
5645 2006-03-20 Marek Safar <marek.safar@seznam.cz>
5647 * expression.cs (StringConcat.Append): Issue a warning when empty string
5650 2006-03-20 Marek Safar <marek.safar@seznam.cz>
5652 * assign.cs (CompoundAssign.ResolveSource): Removed.
5654 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
5657 * class.cs (TypeContainer.FindMethods): Removed.
5658 (TypeContainer.CheckMemberUsage): Made static.
5660 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
5662 * constant.cs (CheckRange): Removed unused type argument.
5663 (CheckUnsigned): Removed unused type argument.
5665 * cs-parser.jay: Updated after MemberAccess clean up.
5666 Uses Length for empty string test.
5668 * cs-tokenizer.cs: Uses Length for empty string test.
5669 (IsCastToken): Made static.
5670 (is_hex): Made static.
5671 (real_type_suffix): Made static.
5673 * decl.cs (SetupCache): Made static.
5674 (OnGenerateDocComment): Removed unused ds argument.
5676 * delegate.cs (VerifyDelegate): Removed unused argument.
5678 * doc.cs: Uses Length for empty string test.
5680 * driver.cs: Uses Length for empty string test.
5682 * enum.cs (IsValidEnumType): Made static
5684 * expression.cs (EnumLiftUp): Removed unused argument.
5685 (ResolveMethodGroup): Ditto.
5686 (BetterConversion): Ditto.
5687 (GetVarargsTypes): Ditto.
5688 (UpdateIndices): Ditto.
5689 (ValidateInitializers): Ditto.
5690 (MemberAccess.ctor): Ditto.
5691 (GetIndexersForType): Ditto.
5693 * flowanalysis.cs: (MergeFinally): Removed unused argument.
5695 * iterators.cs: Updated after MemberAccess clean up.
5697 * location.cs: Uses Length for empty string test.
5699 * namespace.cs: Uses Length for empty string test.
5701 * report.cs (CheckWarningCode): Made static.
5703 * statement.cs (LabeledStatement): Removed unused argument.
5705 * typemanager.cs (FilterNone): Removed.
5707 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5709 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
5712 * class.cs: Updated.
5714 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5716 * cs-parser.jay.cs: __arglist is not allowed for delegates.
5718 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5722 * expression.cs (VerifyArgumentsCompat): Reverted to double error
5723 reporting, it's more tricky than I thought.
5725 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5729 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
5731 (AnonymousMethod.ImplicitStandardConversionExists): New method.
5732 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
5733 Add more error reporting; Fixed issue with params.
5735 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
5737 * cs-parser.jay: AnonymousMethod requires host container.
5739 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
5741 2006-03-18 Raja R Harinath <harinath@gmail.com>
5743 * class.cs: Change 'TypeContainer ds' constructor argument to
5744 'DeclSpace parent'. Some classes were missed below due to
5745 different naming convention.
5747 * class.cs (MemberCore.Parent): Delete. This makes the
5748 ParentContainer changes below enforceable by the compiler.
5750 Treat pointers to enclosing declaration space as 'DeclSpace', not
5752 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
5753 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
5755 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
5757 (Block.AddThisVariable): Likewise.
5758 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
5759 (AbstractPropertyEventMethod.Emit): Likewise.
5760 (AbstractPropertyEventMethod.EmitMethod): Likewise.
5761 (GetMethod.Define, SetMethod.Define): Likewise.
5762 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
5763 (DelegateMethod.EmitMethod): Likewise.
5765 Fix regression test-partial-13.cs.
5766 Rationalize use of PartialContainer. Ensure that the partial
5767 class semantics can be tied to type-correctness, i.e., any
5768 violation will cause a compile error.
5769 * class.cs, const.cs: Access all fields that belong to class
5770 TypeContainer via ParentContainer. Arguments of EmitContexts and
5771 Resolve()-like functions still use 'Parent'.
5773 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
5774 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
5775 (PropertyMethod.CheckModifiers): Remove unused argument.
5776 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
5779 2006-03-17 Raja R Harinath <harinath@gmail.com>
5781 Make semantics of PartialContainer simpler.
5782 * decl.cs (DeclSpace.IsPartial): Remove.
5783 * class.cs (TypeContainer.IsPartial): Likewise.
5784 (TypeContainer..ctor): Set PartialContainer to point to self.
5785 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
5786 (TypeContainer.FindNestedType): Likewise.
5787 (MemberCore.ParentContainer): Simplify. Remove deprecation.
5789 2006-03-17 Marek Safar <marek.safar@seznam.cz>
5791 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
5793 2006-03-15 Marek Safar <marek.safar@seznam.cz>
5795 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
5798 2006-03-15 Marek Safar <marek.safar@seznam.cz>
5800 * class.cs (Operator.Define): An error for base conversion was not
5803 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
5805 * iterator.cs : yield break is allowed in try statement which has
5806 catch clauses. Fixed bug #77767.
5808 2006-03-13 Marek Safar <marek.safar@seznam.cz>
5810 A fix for #77593, #77574.
5812 * class.cs (MethodCore.CheckBase): Another if for operator.
5814 2006-03-09 Marek Safar <marek.safar@seznam.cz>
5816 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
5819 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
5820 (DelegateCreation.ImplicitStandardConversionExists): New method for just
5823 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
5826 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
5827 Updated after another emitcontext usage was clean up. It should help us to
5828 synchronize with gmcs easier.
5830 2006-03-04 Marek Safar <marek.safar@seznam.cz>
5834 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
5835 (Event.Define): ditto
5836 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
5838 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
5839 Removed redundant code and set NewSlot for Invoke method too.
5841 * parameter.cs (Parameters.ctor): Add custom, type ctor.
5842 (Parameters.MergeGenerated): New method. Use this method when you merge
5843 compiler generated argument with user arguments.
5845 2006-03-03 Marek Safar <marek.safar@seznam.cz>
5847 * attribute.cs (ResolveAsTypeTerminal): Removed.
5849 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
5850 specialization for predefined types; 30% speed up.
5851 Finally placed obsolete check to right place.
5852 (Expression.ResolveType): Removed.
5854 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
5855 Updated after ResolveType was removed.
5857 * expression.cs (Cast.ctor): Check void cast.
5858 (Binary.ResolveAsTypeTerminal): Is never type.
5859 (Conditional.ResolveAsTypeTerminal): Is never type.
5861 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
5863 2006-03-01 Raja R Harinath <rharinath@novell.com>
5866 * expression.cs (ParameterReference.DoResolveBase): Change return
5868 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
5872 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
5875 * typemanager.cs (GetFullNameSignature): Don't nullref on
5876 protected accessors.
5878 2006-02-27 Marek Safar <marek.safar@seznam.cz>
5880 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
5881 these two separated members to simplify the code.
5882 (Attribute.Resolve): Refactored to use new fields and methods.
5883 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
5884 implemented obsolete attribute checking.
5885 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
5886 implemented obsolete checking again. It look line never ending quest ;-)
5887 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
5889 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
5891 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
5893 *class.cs (Property.Define): Add RegisterProperty call.
5895 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
5896 argument groups (only 2).
5898 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
5899 encoding expression to arguments.
5900 (Expression.ExprClassToResolveFlags): Just turned to property.
5902 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
5903 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
5904 optimized as well as implemented support for zero-length attributes.
5906 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
5907 Add caching of PropertyInfo's.
5909 2006-02-25 Marek Safar <marek.safar@seznam.cz>
5911 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
5912 error multiple times.
5914 2006-02-25 Marek Safar <marek.safar@seznam.cz>
5916 New partial class implementation.
5917 A fix for #77027, #77029, #77403
5919 * attribute.cs (Attributable): Made attributes protected.
5921 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
5922 the replacements of ClassPart and PartialContainer.
5923 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
5924 (TypeContainer.AddInterface): Ditto.
5925 (TypeContainer.AddPartial): The main method for partial classes. It checks
5926 for errors and merges ModFlags and attributes. At the end class is added to
5928 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
5930 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
5931 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
5932 from the rest of partial classes.
5933 (TypeContainer.GetClassBases): Simplified.
5934 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
5936 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
5937 (TypeContainer.HasExplicitLayout): Uses Flags now.
5938 (PartialContainer): Removed.
5939 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
5940 (StaticClass): Was merged with Class.
5941 (Class.GetClassBases): class and static class bases are verified here.
5942 (Class.TypeAttr): Added static attributes when class is static.
5943 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
5944 (MemberBase): In some cases we need to call parent container for partial
5945 class. It should be eliminated but it's not easy now.
5947 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
5949 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
5950 partial classed to accumulate class comments.
5951 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
5953 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
5955 * driver.cs (MainDriver): Tree.GetDecl was removed.
5957 * modifiers.cs (Modifiers): Add partial modifier.
5959 * tree.cs (Tree.decl): Removed.
5960 (RootTypes): Started to use this class more often for root types
5963 2006-02-22 Marek Safar <marek.safar@seznam.cz>
5967 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
5968 external interface does not have an attribute.
5970 2006-02-22 Marek Safar <marek.safar@seznam.cz>
5972 Another prerequisites for new partial classs implementation.
5974 * attribute.cs (Attribute.Equal): Implemented.
5975 (Attribute.Emit): Changed as attributes can be applied more than twice.
5976 (Attributes.Emit): Check for duplicate attributes here.
5978 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
5979 as a parameter, clean-up.
5981 2006-02-11 Marek Safar <marek.safar@seznam.cz>
5985 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
5986 contains obsolete attribute check which can in some cases look for base
5987 type of current class which is not initialized yet.
5988 (TypeContainer.BaseType): Replacement of ptype.
5990 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
5992 2006-02-11 Marek Safar <marek.safar@seznam.cz>
5994 First of prerequisites for new partial classs implemention.
5996 * attribute.cs (Attributable): Extended by ResolveContext;
5997 Attributes finally have correct context for resolving in all cases.
5998 (AttachTo): Attribute owner is assigned here.
6000 * codegen.cs (IResolveContext): Introduce new interface to hold
6001 all information needed in resolving phase.
6002 (EmitContext): Implements IResolveContext; more clean-up needed here.
6004 * decl.cs (MemberCore): Implemented IResolveContext.
6006 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
6007 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
6008 parameter.cs, statement.cs, tree.cs, typemanager.cs:
6009 Refactored to use new IResolveContext instead of EmitContext; cleanup
6011 2006-02-06 Miguel de Icaza <miguel@novell.com>
6013 * codegen.cs (EmitScopeInitFromBlock): check here the
6014 capture_context, there is no need to make two calls to the
6017 * anonymous.cs: Add some debugging messages that might help me
6018 track other instances of this problem in the future (the
6019 regression of test 467).
6021 * cs-parser.jay: track the variable block, as we need to initalize
6022 any captured variables declared in this block for the "catch"
6023 portion of the "Try" statement.
6025 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
6026 scope initialization for captured variables.
6028 Also, move the emit for the variables after the block location has
6031 2006-02-06 Marek Safar <marek.safar@seznam.cz>
6033 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
6035 2006-02-02 Miguel de Icaza <miguel@novell.com>
6037 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
6038 commit yesterday, the initialization for the roots is necessary.
6039 What is not necessary is the scope activation.
6041 2006-02-02 Raja R Harinath <rharinath@novell.com>
6043 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
6044 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
6046 (Argument.Resolve): Remove CS0206 checks.
6048 2006-02-01 Miguel de Icaza <miguel@novell.com>
6050 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
6051 scopes for all the roots, the scopes will now be emitted when the
6052 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
6054 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
6055 code. This reduces a lot of existing cruft.
6057 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
6058 that the ScopeInfo is generated as we enter the scope, not at the
6059 time of use, which is what we used to do before.
6061 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
6062 every time a Block is about to be emitted if we have a
6065 2006-02-01 Raja R Harinath <rharinath@novell.com>
6067 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
6069 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
6071 * typemanager.cs (cons_param_array_attribute): Make private.
6072 (Reset): Set it to null.
6073 (InitCoreHelpers): Don't initialize it.
6074 (ConsParamArrayAttribute): New. Initialize it as needed.
6075 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
6077 2006-01-31 Miguel de Icaza <miguel@novell.com>
6079 * expression.cs: There might be errors reported during the
6080 selection of applicable methods. If there are errors, do not
6081 continue execution as it will lead the compiler to crash.
6083 2006-01-30 Miguel de Icaza <miguel@novell.com>
6085 * expression.cs: Member access is not allowed on anonymous
6086 methods. Fixes #77402.
6088 2006-01-30 Raja R Harinath <rharinath@novell.com>
6091 * cs-parser.jay (VariableDeclaration): Don't set
6092 current_array_type to null.
6093 (field_declaration, event_declaration, declaration_statement):
6094 Set it to null here.
6096 2006-01-28 Raja R Harinath <harinath@gmail.com>
6098 * typemanager.cs (GenericParameterPosition): New.
6101 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
6103 * doc.cs : To process "include" elements, first we should create
6104 another list than XmlNodeList, because it could result in node
6105 removal, which could result in that the XmlNodeList gives up
6108 (Also made code identical to gmcs again.)
6110 2006-01-25 Miguel de Icaza <miguel@novell.com>
6112 * ecore.cs: Introduce an error report that we were not catching
6113 before, if not silent, we must report the error. Gonzalo ran into
6116 2006-01-23 Miguel de Icaza <miguel@novell.com>
6118 A fix for bug: #76957
6120 * iterators.cs (MoveNextMethod.CreateMethodHost): call
6121 ComputeMethodHost before creating the method, this is a new
6124 * anonymous.cs (AnonymousContainer): Now we track all the scopes
6125 that this method references (RegisterScope). The actual scope
6126 where the method is hosted is computed with the ComputeMethodHost
6127 before we create the method.
6129 Moved the Deepest routine here.
6131 (AnonymousContainer.ComputeMethodHost): New routine used to
6132 compute the proper ScopeInfo that will host the anonymous method.
6134 (ScopeInfo): Deal with multiple roots. The problem was that we
6135 did not have a unique root where all ScopeInfos could be hanged
6136 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
6139 Remove AdjustMethodScope which is now computed at the end. Remove
6140 LinkScope which did a partial link, instead link all ScopeInfos
6141 before code generation from the new "LinkScopes" routine.
6143 Simplify all the Add* routines as they no longer need to maintain
6144 the tree, they just need to record that they are using variables
6147 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
6148 routines to produce the forest of ScopeInfo trees.
6150 * class.cs (TypeContainer.AppendMethod): This is just like
6151 AddMethod, but ensures that an interface implementation method
6152 (IEnumerable.XXX) is not inserted at the beginning of the queue of
6153 methods, but at the end.
6155 We use this functionality to ensure that the generated MoveNext
6156 method in the iterator class is resolved/emitted before the
6157 enumerator methods created.
6159 This is required because the MoveNext method computes the right
6160 ScopeInfo for the method. And the other methods will eventually
6161 need to resolve and fetch information computed from the anonymous
6164 2006-01-21 Raja R Harinath <harinath@gmail.com>
6165 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6168 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
6170 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
6171 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
6173 2006-01-18 Raja R Harinath <rharinath@novell.com>
6175 Fix #76656, cs0231-2.cs.
6176 * cs-parser.jay (formal_parameter_list): Make error case catch
6178 (parenthesized_expression_0): Add CS1026 check.
6179 (invocation_expression): Remove unused { $$ = lexer.Location }.
6181 2006-01-17 Raja R Harinath <rharinath@novell.com>
6184 * cs-parser.jay (statement_expression): Don't list out the
6185 individual statement-expressions. Convert syntax error into
6188 2006-01-16 Raja R Harinath <rharinath@novell.com>
6191 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
6192 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
6193 CheckIntermediateModification.
6194 (FieldExpr.DoResolve): Add new two-argument version that
6195 allows us to resolve the InstanceExpression as an lvalue.
6196 The one-argument variant is now just a wrapper.
6197 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
6198 Resolve the lhs as an lvalue if the it has a value type.
6199 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
6200 from Assign.DoResolve.
6201 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
6202 resolved as an lvalue.
6203 (PropertyExpr.DoResolve): Update.
6204 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
6205 has a value type. Move CS1612 check here from
6206 CheckIntermediateModification.
6207 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
6208 * expression.cs (EmptyExpression.OutAccess): New. Used as the
6209 'right_side' of a ResolveLValue on an 'out' argument.
6210 (EmptyExpression.LValueMemberAccess): New. Used as the
6211 'right_side' of a propagated ResolveLValue on a value type.
6212 (LocalVariableReference.DoResolveBase): Recognize
6213 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
6215 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
6216 EmptyExpression.Null.
6218 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
6220 * typemanager.cs : added IsGenericParameter(). In mcs it always
6222 * doc.cs : for generic parameters, use GenericParameterPosition,
6225 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
6227 * expression.cs: Fix Console.WriteLine ((this = x).foo);
6229 2006-01-12 Miguel de Icaza <miguel@novell.com>
6231 This fixes the problem where we used ldfld instead of ldflda to
6232 load the "THIS" pointer on captured parameters, when THIS is a
6233 value type. See bug #77205.
6235 * iterators.cs (CapturedThisReference.Emit): Pass false to
6236 EmitThis (we do not need the address).
6238 * codegen.cs (EmitThis): it needs to know whether we need the
6239 address of `this' or not. This is used by value types.
6241 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
6242 every other call passes false.
6244 2006-01-12 Raja R Harinath <rharinath@novell.com>
6247 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
6249 * expression.cs (Invocation.OverloadResolve): Update.
6250 (Invocation.DoResolve): Avoid double resolution of invocation.
6252 2006-01-11 Raja R Harinath <rharinath@novell.com>
6255 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
6256 unary negation of floating point types as 0-expr; negation cannot
6257 overflow in floating point types.
6260 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
6261 on operands of 'void' type.
6264 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
6265 and ExclusiveOr for boolean constants too.
6267 2006-01-09 Raja R Harinath <rharinath@novell.com>
6270 * expression.cs (Invocation.OverloadResolve): Replace reflected
6271 override methods with their base virtual methods, rather than
6273 * typemanager.cs (TypeManager.GetOverride): New.
6275 2006-01-05 Jb Evain <jbevain@gmail.com>
6277 * class.cs (Property.Define, Indexer.Define): do not tag the
6278 properties as SpecialName | RTSpecialName.
6280 2006-01-04 Miguel de Icaza <miguel@novell.com>
6282 * class.cs (MethodCore.IsDuplicateImplementation): This method was
6283 doing a low-level comparission of parameter types. It was lacking
6284 a check for __argslist.
6286 2005-12-30 Miguel de Icaza <miguel@novell.com>
6288 * expression.cs (ParameterReference.DoResolveBase): Allow
6289 reference parameters if they are local to this block.
6291 This allows the ref and out parameters of a delegate to be used in
6292 an anonymous method, for example:
6294 delegate void set (out int x);
6296 set s = delegate (out int x){
6300 This is used by functionality introduced late in the C# language.
6302 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
6303 method that take ref and out parameters.
6305 Fixes #77119 which was a late change in the spec.
6307 2005-12-23 Miguel de Icaza <miguel@novell.com>
6309 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
6310 parent if its the same scope. Fixes #77060.
6312 2005-12-21 Miguel de Icaza <miguel@novell.com>
6314 * driver.cs: Report the case of no source files and no -out:
6317 2005-12-20 Raja R Harinath <rharinath@novell.com>
6320 * expression.cs (ComposedCast.GetSignatureForError): Define.
6322 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6326 * namespace.cs (NamespaceEntry): Add extern_aliases as a
6327 ListDictionary, to contain the ExternAliasEntry entries (in
6328 addition to the NamespaceEntry.aliases hashtable). This field is
6329 shared between the original entry and its doppelganger (bodyless
6331 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
6332 extern_aliases field.
6333 (NamespaceEntry.Lookup): Move the IsImplicit check after the
6334 lookup in extern_aliases.
6336 2005-12-16 Raja R Harinath <rharinath@novell.com>
6339 * class.cs (TypeContainer.Mark_HasEquals): New.
6340 (TypeContainer.Mark_HasGetHashCode): New.
6341 (ClassPart): Override them.
6342 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
6345 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
6346 'parent' argument to the base constructor.
6348 Remove all mention of TypeContainer from decl.cs.
6349 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
6350 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
6351 (DeclSpace.DeclSpace): Likewise.
6352 (DeclSpace.DefineMembers): Remove unused argument.
6353 * cs-parser.jay (pop_current_class): Update to changes. Simplify
6354 debugging check -- we don't care if the debug code throws an
6355 InvalidCastException instead of an InternalErrorException.
6356 * class.cs (TypeContainer.DefineMembers): Update to changes.
6357 (TypeContainer.DoDefineMembers): Likewise.
6358 (TypeContainer.GetMethods): Likewise.
6359 (PropertyMember.Define): Likewise.
6360 (MemberBase.Parent): New property that forwards to
6361 MemberCore.Parent, but ensures that we get a TypeContainer.
6362 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
6363 (RootContext.PopulateTypes): Likewise. Remove special case code
6364 for !RootContext.StdLib: DefineMembers is idempotent.
6366 2005-12-14 Miguel de Icaza <miguel@novell.com>
6368 * convert.cs (ExplicitConversionCore): Check the return value from
6369 ExplicitConversionCore which can return null on failure. Fixes #76914
6371 2005-12-13 Marek Safar <marek.safar@seznam.cz>
6373 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
6375 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
6377 * doc.cs : The search for referenced namespace was insufficient to
6378 get global one as it used to do. Fixed bug #76965.
6380 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
6382 * doc.cs : check name in cref in the last phase that whether it is
6385 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6387 * cs-tokenizer.cs : reverted the latest change: it somehow broke
6390 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6392 * doc.cs : so it turned out that we cannot skip override check for
6393 interface members. Fixed bug #76954.
6395 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6397 * cs-tokenizer.cs : fixed bug #75984:
6398 - #warning and #error should not be handled when the source line
6400 - #line is not checked strictly when the source line is disabled.
6401 - #define and #undef is on the other hand checked strictly at any
6404 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
6406 * cs-tokenizer.cs : missing Location (actually, filename) in one of
6409 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6411 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
6413 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
6415 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
6416 (FieldBase.Initializer): Initializer is now optional.
6417 (EventField.Define): Only event field can have initializer.
6419 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
6421 * const.cs (Const): Reuse initializer.
6423 * cs-parser.jay: Updated after FieldBase changes.
6424 Added current_array_type to simplify array initializers.
6426 * ecore.cs (NullCast.IsDefaultValue): Implemented.
6428 * expression.cs, iterators.cs: Updated.
6430 * namespace.cs (NamespaceEntry): Made UsingFound private.
6432 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6434 * parameterCollection.cs: Obsolete, removed.
6435 * parser.cs: Obsolete, removed.
6437 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6440 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
6442 * enum.cs (Enum.Define): Set obsolete context here.
6444 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
6447 - FindDocumentedMember() now expects 1) paramList as null
6448 when "we don't have to check the number of parameters" and
6449 2) Type.EmptyTypes when "there is no arguments".
6450 - Introduced FoundMember struct to hold the exact type which was
6451 used to find the documented member (the above change broke
6452 test-xml-044; it might be better just to use DeclaringType than
6453 what MS does, like this change does, but it depends on usage.)
6455 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
6457 * doc.cs : documented member might be from DeclaringType for nested
6458 types. Fixed bug #76782.
6460 2005-12-03 Ben Maurer <bmaurer@ximian.com>
6462 * anonymous.cs: Have the param code handle leaving copies on the
6463 stack etc. Allows anonymous params to take part in the assignment
6464 code (++, +=, etc). Fixes bug #76550
6466 * expression.cs: Handle the prepare_for_load/leave_copy by passing
6467 it down to the anon code.
6469 * iterators.cs: Use dummy var here
6471 * codegen.cs: Handle new vars
6473 2005-12-01 Marek Safar <marek.safar@seznam.cz>
6476 * class.cs (MethodData.Define): Set proper Obsolete context.
6478 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
6480 (FieldExpr.DoResolve): Ditto.
6482 2005-12-01 Marek Safar <marek.safar@seznam.cz>
6485 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
6486 parent is not obsolete.
6488 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
6490 * doc.cs : (FindDocumentedMember) find parameterless members first
6491 and get CS0419 in the early stage. Fixed first case of bug #76727.
6493 2005-11-30 Marek Safar <marek.safar@seznam.cz>
6496 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
6497 no error was reported.
6499 *expression.cs (Binary.DoResolve): left can be null.
6501 2005-11-22 Marek Safar <marek.safar@seznam.cz>
6504 * class.cs (MethodData.Emit): Parameters should be labeled first.
6506 2005-11-21 Marek Safar <marek.safar@seznam.cz>
6509 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
6511 2005-11-18 Marek Safar <marek.safar@seznam.cz>
6513 * attribute.cs (AreParametersCompliant): Moved to Parameter.
6515 * class.cs (MethodCore): Parameter clean up.
6516 (IMethodData): Added ParameterInfo.
6517 (MethodData): Parameter clean up.
6518 (Indexer.Define): Parameter clean up.
6530 * typemanager.cs: Parameter clean up.
6532 * delegate.cs (Define): Get rid of duplicated code.
6534 * expression.cs (ParameterReference): Removed useless parameters
6536 (Invocation): Ditto.
6538 * parameter.cs (ParamsParameter): New class, params specialization.
6539 (ArglistParameter): Attemp to separate arglist.
6540 (Parameter): Refactored to be reusable and faster.
6541 (Parameter.Modifier): Made understandable.
6542 (Parameters): Changed to be used as a class for `this' assembly
6543 parameters. Refactored to use new specialized classes.
6545 * support.cs (ParameterData): Added Types property.
6546 (InternalParameters): Deleted.
6548 2005-08-20 Martin Baulig <martin@ximian.com>
6550 Merging this patch from GMCS to fix #75867.
6552 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
6553 scope if we don't already have it.
6555 2005-11-17 Martin Baulig <martin@ximian.com>
6558 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
6559 inherit the scope from our parent. Fixes #76653.
6561 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6563 * doc.cs : the previous patch does not actually fix the bug.
6564 PropertyInfo override check is now implemented and really fixed it.
6565 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
6567 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6569 * doc.cs : apply "override filter" also to properties.
6572 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6574 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
6575 no need to check overrides. For classes, omit those results from
6576 interfaces since they must exist in the class. Fixed bug #76726.
6578 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6580 * typemanager.cs : (GetFullNameSignature) differentiate indexers
6581 with different parameters. Fixed the second problem in #76685.
6583 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6585 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
6586 get expected 'protected' access in CheckValidFamilyAccess()).
6589 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6591 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
6592 Fixed bug #76705. CS1569 was incorrectly commented out.
6594 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
6596 * doc.cs : use Invocation.IsOverride() to do real override check.
6597 * expression.cs : made Invocation.IsOverride() internal.
6599 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
6601 * doc.cs : use TypeManager.FindMembers() instead of (possible)
6602 TypeBuilder.FindMembers() and filter overriden base members out.
6605 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6607 * doc.cs : ref/out parameters are represented as '@' (instead of
6608 '&' in type FullName). Fixed bug #76630 (additionally crefs).
6610 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6612 * doc.cs : when there was no '.' in cref to methods in doc comment,
6613 then parameters were missing in the output. Fixed bug #76691.
6615 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6617 * driver.cs : don't output docs when there is an error.
6620 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6623 Now it should detect indexers. Fixed primary concern in bug #76685.
6624 Fixed CS0419 message to not show the identical member signature in
6627 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6629 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
6630 instead of Type.FindMembers() since it does not handle events.
6633 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
6635 * codegen.cs: Fixed typo (speficied -> specified).
6637 2005-11-11 Marek Safar <marek.safar@seznam.cz>
6640 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
6642 2005-11-11 Marek Safar <marek.safar@seznam.cz>
6644 * attribute.cs: Changed error message.
6646 * cs-tokenizer.cs: One more check.
6648 2005-11-10 Marek Safar <marek.safar@seznam.cz>
6650 * statement.cs (Block.Resolve): Ignore empty statement.
6652 2005-11-10 Marek Safar <marek.safar@seznam.cz>
6654 * report.cs: Made error/warning methods more strict to avoid
6657 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
6658 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
6659 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
6660 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
6662 2005-11-08 Marek Safar <marek.safar@seznam.cz>
6664 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
6665 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
6667 * class.cs (TypeContainer.IsComImport): New property.
6668 (Constructor.Define): Create proper ctor for ComImport types.
6670 * expression.cs (New.CheckComImport): Fixed.
6672 2005-11-07 Miguel de Icaza <miguel@novell.com>
6674 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
6675 that a parameter has been captured does not mean that we do not
6676 have to do the rest of the processing. This fixes the second part
6677 of #76592. If there was another anonymous method capturing
6678 values in the past, the Scope would never be set for the second
6679 method that captured the same parameter.
6681 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
6682 properly manipulate the stack. Second part of fix for #76592.
6684 * expression.cs (New): Add support for invoking "new" on
6685 interfaces that have been flagged with the ComImport attribute and
6686 the CoClass. Fixes #76637
6688 * statement.cs (Try.DoEmit): When a variable is captured, do not
6689 try to emit the vi.LocalBuilder variable as it has been captured.
6690 Create a temporary variable and store the results on the
6691 FieldBuilder. Fixes #76642
6693 2005-11-07 Marek Safar <marek.safar@seznam.cz>
6695 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
6697 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
6699 * expression.cs (Binary.DoResolve): Added && optimalization.
6701 * typemanager.cs (AddUserType): Removed useless argument.
6703 2005-11-04 Marek Safar <marek.safar@seznam.cz>
6705 * statement.cs (Block.variables): Uses ListDictionary.
6707 2005-11-03 Marek Safar <marek.safar@seznam.cz>
6710 * class.cs (PartialContainer.EmitType): Customized to emit
6711 security attributes.
6712 (ClassPart.ApplyAttributeBuilder): Transform security attribute
6713 for partial classes.
6715 2005-11-03 Marek Safar <marek.safar@seznam.cz>
6718 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
6719 access has to be fixed.
6721 * typemanager.cs (IsUnmanagedType): Wrong common field type.
6723 2005-11-01 Marek Safar <marek.safar@seznam.cz>
6726 * ecore.cs (NullCast.Reduce): Implemented.
6728 * expression.cs (ArrayCreation.CheckIndices): Correcly check
6731 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
6733 (Foreach.Resolve): Catch null properly.
6735 2005-10-29 Marek Safar <marek.safar@seznam.cz>
6737 * cs-tokenizer.cs: Warning text fix.
6739 * driver.cs: AllWarningNumbers exposed on public interface.
6741 * report.cs (): Reviewed warning numbers.
6742 (IsValidWarning): Use binary search.
6744 2005-10-29 Marek Safar <marek.safar@seznam.cz>
6746 * driver.cs: Implemeted resource visibility.
6747 (Resources): New class for code sharing between /res: and
6750 2005-10-28 Marek Safar <marek.safar@seznam.cz>
6753 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
6756 * convert (Convert.ImplicitReferenceConversion): NullCast holds
6759 * ecore.cs (NullCast): Child is contant only.
6761 * literal.cs (NullLiteral.Reduce): null can be converted to any
6764 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
6766 * driver.cs: Use Encoding.Default as default code page instead
6769 2005-10-27 Raja R Harinath <rharinath@novell.com>
6772 * expression.cs (Invocation.Error_InvalidArguments): Handle
6773 __arglist parameters.
6774 (Invocation.VerifyArgumentsCompat): Likewise.
6775 * support.cs (ReflectionParameters.GetSignatureForError): Print
6776 __arglist parameters.
6777 (InternalParamters.GetSignatureForError): Likewise.
6778 * parameter.cs (Parameters.GetSignatureForError): Likewise.
6780 2005-10-26 Marek Safar <marek.safar@seznam.cz>
6782 * attribute.cs (GetPropertyValue): Made public.
6784 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
6786 Add new property WrapNonExceptionThrows to handle 2.0 assembly
6788 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
6791 * driver.cs: Reflect method name change.
6793 * statement.cs (Try.Resolve): Warn when try has both general
6796 * typemanager.cs: runtime_compatibility_attr_type new predefined
6799 2005-10-26 Raja R Harinath <harinath@gmail.com>
6802 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
6803 treat it as an empty parameter list.
6805 2005-10-26 Raja R Harinath <rharinath@novell.com>
6808 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
6809 ResolveAsTypeStep silent.
6810 * statement.cs (Block.AddConstant): Mark block as used.
6811 (Block.ResolveMeta): Avoid piling on error messages
6812 if a constant initializer resolution fails.
6814 2005-10-25 Raja R Harinath <rharinath@novell.com>
6816 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
6818 (NamespaceEntry.VerifyAllUsing): New.
6819 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
6820 behaviour. Delegates actual resolution of alias to ...
6821 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
6822 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
6824 * driver.cs (Driver.MainDriver): Update.
6826 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
6827 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
6829 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
6831 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
6832 RootNamespace.DefineNamespacesForAll.
6834 2005-10-24 Raja R Harinath <harinath@gmail.com>
6836 * typemanager.cs (assemblies, external_aliases, modules)
6837 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
6838 (ComputeNamespaces, GetRootNamespace): Remove extra staging
6839 overhead. Move resposibility ...
6840 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
6841 * driver.cs, attribute.cs, codegen.cs: Update to changes.
6843 2005-10-23 Raja R Harinath <harinath@gmail.com>
6845 * namespace.cs (RootNamespace.all_namespaces): Renamed from
6846 cached_namespaces. Improve usage.
6847 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
6848 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
6849 Move from GlobalRootNamespace and simplify.
6850 (RootNamespace.Global): Make instance variable.
6851 (RootNamespace.RootNamespace): Add "alias name" parameter.
6852 (GlobalRootNamespace): Simplify drastically.
6853 (Namespace.Lookup): Don't use GetNamespace.
6854 * typemanager.cs (GetRootNamespace): Rename from
6855 ComputeNamespaceForAlias.
6856 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
6858 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6860 * anonymous.cs (AnonymousContainer): Don't crash when container
6863 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6865 * expression.cs (Binary.DoResolve): Warn when comparing same
6868 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6871 * expression.cs (Binary.DoResolve): It looks like there are no
6872 convetsion rules in enum context.
6874 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6876 Add support for extern alias qualifiers.
6877 * typemanager.cs: Move some LookupTypeReflection code
6878 to namespace.cs, to have cleaner code. Added some methods
6879 to help us keep track of the extern aliased references.
6880 * driver.cs: Add suport for extern alias assemblies on command
6881 line and check for their warnings/errors. Also keep track of the
6882 extern aliased assemblies.
6883 * namespace.cs: Move the global functionality of Namespace
6884 to GlobalRootNamespace/RootNamespace. Now the global namespace
6885 is GlobalRootNamespace.Globa. Also the code moved from
6886 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
6887 Finally added LocalAliasEntry (AliasEntry before) and
6888 ExternAliasEntry, to handle alias statements.
6889 * cs-parser.jay: Add support in the grammar for extern alias
6891 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
6892 Update callings to Namespace (now in GlobalRootNamespace).
6894 2005-10-18 Raja R Harinath <rharinath@novell.com>
6897 * class.cs (TypeContainer.DefineType): Move updating of
6898 topological sort earlier in the code.
6899 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
6901 2005-10-18 Marek Safar <marek.safar@seznam.cz>
6904 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
6906 * constant.cs (Constant.TryReduce): Moved from Cast class.
6907 (Reduce): Made little bit more OO and fixed missing conversions.
6909 * ecore.cs (Reduce): Implemented.
6910 (Binary.EnumLiftUp): New method to upgrade values to enum values.
6912 * literal.cs (Reduce): Implemented.
6914 * class.cs: Reverted Miguel's wrong commit.
6916 2005-10-14 Miguel de Icaza <miguel@novell.com>
6918 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
6920 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
6922 * cs-parser.jay, expression.cs : CS0214 was missing error location
6923 for constants. Fixed bug #76404.
6925 2005-10-11 Marek Safar <marek.safar@seznam.cz>
6928 * convert.cs (ExplicitConversionCore): Fixed object->enum
6931 2005-10-10 Raja R Harinath <rharinath@novell.com>
6933 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
6935 (PropertyExpr.EmitCall): Likewise.
6936 * expression.cs (Invocation.EmitArguments): Handle case where
6938 (Invocation.EmitCall): Avoid allocating temporary variable if
6939 there are no arguments.
6941 2005-10-07 Raja R Harinath <rharinath@novell.com>
6944 * convert.cs (ImplicitConversionStandard): Move conversion of
6945 void* to arbitrary pointer types ...
6946 (ExplicitConversionStandard): .. here.
6947 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
6948 error to always print typenames.
6950 2005-10-07 Raja R Harinath <rharinath@novell.com>
6952 * convert.cs (GetConversionOperator): Rename from
6953 GetConversionOperators. Move operator selection code from ...
6954 (UserDefinedConversion): ... here.
6956 2005-10-06 Marek Safar <marek.safar@seznam.cz>
6958 * convert.cs (ExplicitConversionCore): Removed duplicate enum
6961 2005-10-05 Marek Safar <marek.safar@seznam.cz>
6963 * assign.cs (Assign.DoResolve): Error method changed.
6965 * cfold.cs (DoConstantNumericPromotions): Error method changed.
6967 * const.cs (ResolveValue): Reset in_transit immediately.
6969 * constant.cs: Error method changed.
6971 * convert.cs: Removed useless location parameter.
6972 (ExplicitNumericConversion): Don't do double enum check.
6973 (ExplicitConversionCore): Renamed from ExplicitConversion.
6974 (ExplicitUnsafe): Extracted from ExplicitConversion.
6975 (ExplicitConversion): Uses for error reporting.
6977 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
6979 (ResolveBoolean): Uses common error method.
6980 (CastToDecimal): Get rid of ec.
6981 (CastFromDecimal): Optimized.
6982 (ConvCast): Get rid of ec.
6984 * enum.cs (ResolveValue): Reset in_transit immediately.
6985 (Emit): Return after first error.
6987 * expression.cs: Convert changes.
6989 * literal.cs: Error method changed.
6991 * statement.cs: Error method changed.
6993 2005-10-03 Raja R Harinath <rharinath@novell.com>
6995 * support.cs (SeekableStreamReader.Position): Don't error out when
6996 the requested position is just beyond the end of the current
6999 2005-09-28 Raja R Harinath <rharinath@novell.com>
7001 * support.cs (SeekableStreamReader): Simplify drastically. Don't
7002 try to keep in sync with the byte count of the underlying Stream.
7003 However, this limits us to a window size of 2048 characters: i.e.,
7004 the maximum lookahead of our lexer/parser can be 2048 characters.
7006 2005-09-28 Marek Safar <marek.safar@seznam.cz>
7009 * driver.cs: Fix compilation files with full root path.
7011 2005-09-25 Miguel de Icaza <miguel@novell.com>
7013 * report.cs (SymbolRelatedToPreviousError): Format the output so
7014 it does not use an open parenthesis that is never closed.
7016 * driver.cs: Follow coding guidelines
7018 2005-09-27 Marek Safar <marek.safar@seznam.cz>
7021 * const.cs (Const.ResolveValue): Check for assigning non-null
7022 value to reference type.
7024 2005-09-27 Marek Safar <marek.safar@seznam.cz>
7026 * anonymous.cs: Implemented ExprClassName.
7028 * assign.cs (Assign.DoResolve): Don't chrash when type is not
7031 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
7034 * class.cs (StaticClass.DefineContainerMembers): Report protected
7037 * codegen.cs: if(ed) PRODUCTION.
7039 * convert.cs (Error_CannotImplicitConversion): Better error
7042 * cs-parser.jay: More error checks.
7044 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
7046 * driver.cs (CSCParseOption): Enabled wrong option check.
7048 * ecore.cs (Expression.ExprClassName): Turned to property.
7049 (MemberExpr.CheckIntermediateModification): For checking boxed
7050 value types modification.
7052 * statement.cs (Fixed.Resolve): Expression type must be
7053 convertible to fixed type.
7054 (CollectionForeach.GetEnumeratorFilter,TryType):
7055 Small refactoring for easier error checking.
7057 2005-09-26 Marek Safar <marek.safar@seznam.cz>
7059 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
7062 * class.cs (GeneratedBaseInitializer): New class for customization
7063 compiler generated initializers.
7064 (MemberBase.DoDefine): Check Obsolete attribute here.
7065 (FieldMember.DoDefine): Ditto.
7067 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
7070 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
7071 (MemberCore.GetObsoleteAttribute): Removed argument.
7072 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
7073 (MemberCore.CheckObsoleteType): New helper.
7077 * statement.cs: Updates after MemberCore changes.
7079 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
7080 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
7082 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
7083 obsolete attribute for compiler construct.
7084 (As.DoResolve): Cache result.
7086 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
7088 2005-09-26 Raja R Harinath <rharinath@novell.com>
7091 * expression.cs (This.VerifyFixed): In a value type T, the type of
7092 'this' is T&, iow, 'this' is either an out or ref parameter. In a
7093 value type R, 'this' is treated as a value parameter.
7095 2005-09-22 Miguel de Icaza <miguel@novell.com>
7097 * statement.cs (Lock): Use the TemporaryVariable class instead of
7098 manually using local variables as those do not work when variables
7101 * ecore.cs: Moved the TemporaryVariable class from being a nested
7102 class inside Foreach to be a public class that can be employed in
7105 2005-09-19 Marek Safar <marek.safar@seznam.cz>
7107 * cs-parser.jay: interface_accessors replaced by
7108 accessor_declarations.
7110 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
7113 * statement.cs (GotoCase.Resolve): Convert null constant to
7115 (SwitchLabel.ResolveAndReduce): Ditto.
7116 (SwitchLabel.NullStringCase): Custom null stamp.
7117 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
7119 typemanager.cs (CSharpSignature): Don't skip first argument
7122 2005-09-18 Miguel de Icaza <miguel@novell.com>
7124 * driver.cs: Set InEmacs based on the environment variable EMACS.
7126 * location.cs (InEmacs): in this mode, do not report column
7127 location as it confuses Emacs.
7129 2005-09-16 Marek Safar <marek.safar@seznam.cz>
7131 * cfold.cs, constant.cs, convert.cs, ecore.cs,
7132 expression.cs, iterators.cs, literal.cs: Store constants and
7135 * class.cs (MemberBase.ShortName): Pass location.
7137 * cs-parser.jay: Some location fixes.
7139 * ecore.cs (Expression.Location): Made virtual.
7141 2005-09-05 Miguel de Icaza <miguel@novell.com>
7143 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
7144 if the underlying types are the same, otherwise we need to produce
7145 code that will do the proper cast.
7147 This was exposed by Marek's constant rewrite which produced
7148 invalid code for the call site:
7151 void Method (X v) {}
7155 This fixes test-49.cs
7157 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
7159 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
7160 Type/Object should be allowed as well. Fixed bug #75968.
7162 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
7164 * expression.cs : (Binary.DoResolve): when one is enum constant and
7165 another is constant 0, then return enum one *as enum type*.
7168 2005-09-02 Raja R Harinath <rharinath@novell.com>
7170 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
7174 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
7175 flow-branching for LocalVariableReferences in case we were invoked
7176 from a MemberAccess.
7177 * expression.cs (LocalVariableReference.VerifyAssigned): New.
7179 (LocalVariableReference.DoResolveBase): ... this.
7180 (MemberAccess.Resolve): Do the check that was disabled during
7183 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
7186 (PartialContainer.Create): check abstract/sealed/static strictly
7187 but abstract/sealed can exist only at one side. Fixed bug #75883.
7189 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
7192 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
7193 specified, don't default to UnmanagedType.I4.
7195 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
7197 * expression.cs : conditional operator should check possibly
7198 incorrect assign expression. Fixed bug #75946.
7200 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
7202 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
7203 Reverting the change. gmcs is much complex than mcs on this matter.
7205 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
7207 * cs-tokenizer.cs : To read another token ahead of the actual
7208 consumption, use new SavedToken and cache token instead of moving
7209 back the stream with SeekableStreamReader (it seemed problematic).
7211 driver.cs : Thus use StreamReader directly.
7212 * support.cs : Thus removed SeekableStreamReader.
7214 2005-08-30 Raja R Harinath <rharinath@novell.com>
7217 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
7218 (ScopeInfo.EmitScopeType): Use it to construct field names from
7219 names of captured locals.
7222 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
7223 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
7224 Pass 'target_type' to BoxedCast. Don't default to 'object'.
7225 (ExplicitConversion): Remove enum cases already handled by
7226 implicit conversion. Move implicit conversion check to the beginning.
7227 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
7228 * expression.cs (ArrayCreation.EmitDynamicInitializers):
7229 Don't treat System.Enum as a struct.
7231 2005-08-30 Jb Evain <jbevain@gmail.com>
7233 * attribute.cs: handles as expression in parameters.
7235 2005-08-30 Raja R Harinath <rharinath@novell.com>
7238 * class.cs (TypeContainer.VerifyClsName): Don't use a
7239 PartialContainer when verifying CLS compliance.
7240 (AbstractPropertyEventMethod): Set Parent here, ...
7241 (PropertyMethod): ... not here.
7243 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
7245 * attribute.cs : escaped attribute name should not be allowed to be
7246 resolved (e.g. @class as classAttribute). Fixed bug #75930.
7248 2005-08-29 Raja R Harinath <rharinath@novell.com>
7251 * convert.cs (ImplicitStandardConversionExists): Allow zero also
7252 when converting a long constant to unsigned long.
7253 * expression.cs (Invocation.OverloadResolve): Add sanity check to
7254 detect where IsApplicable and VerifyArgumentsCompat disagree.
7256 2005-08-29 Raja R Harinath <rharinath@novell.com>
7257 and Carlos Alberto Cortez <carlos@unixmexico.org>
7260 * class.cs (TypeContainer.CanElideInitializer): New helper.
7261 (TypeContainer.EmitFieldInitializers): Use it to determine if we
7262 can safely emitting the initializer of a field.
7264 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7266 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
7267 allowed inside a switch (without loop). Fixed bug #75433.
7269 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
7271 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
7272 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
7274 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7276 * driver.cs : kinda reverting the default encoding changes (not exact
7277 revert since I noticed that "codepage:reset" might not work fine).
7279 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7281 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
7282 Location. Now getter and setter store location correctly.
7283 (errors/cs0111-12.cs now reports the expected location.)
7285 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7287 * driver.cs : Use default encoding on the environment.
7288 Removed (now that) extra parameter for SeekableStreamReader.
7289 * support.cs : (SeekableStreamReader) third .ctor() argument for
7290 StreamReader is not required (always true). preamble size could
7291 be acquired in simpler and safe way.
7293 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
7295 * cs-parser.jay: report CS0642 at warning level 3
7296 and report CS0642 for an if else statement also
7297 fixes bug #74745. Patch by John Luke (and a bit
7299 Removed extra CS0642 warning check for "while",
7301 * statement.cs: In Block.Resolve(), CS0642 check
7302 is reimplemented to check a sequence of an empty
7303 statement and a block.
7305 Both fix bug #66777.
7307 2005-08-24 Marek Safar <marek.safar@seznam.cz>
7309 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
7310 detection until I fix it.
7312 * cs-tokenizer.cs: Changed error message.
7314 * cs-parser.jay: Fixed 2 error locations.
7316 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
7317 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
7320 * enum.cs (GetSignatureForError): Fixed.
7322 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
7326 * typemanager.cs (RegisterProperty): Removed.
7328 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
7330 2005-08-24 Raja R Harinath <rharinath@novell.com>
7333 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
7334 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
7336 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7338 * expression.cs : tiny fix is required for not warning positive ulong.
7341 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7343 * expression.cs : add CS0652 check for constant and integral
7344 expression. Fixed bug #53974.
7346 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7348 * expression.cs : in DoNumericPromotions(), check if there is implicit
7349 conversion overload for string (to check CS0034). Fixed bug #52492.
7351 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7353 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
7355 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7357 * ecore.cs : report location when it is *not* Null.
7359 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7365 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
7366 correctly. Fixed bug #75721.
7368 2005-08-23 Raja R Harinath <rharinath@novell.com>
7370 * support.cs (SeekableStreamReader.Position): Avoid an expensive
7371 loop that performs 'min (pos, char_count)'.
7374 * expression.cs (Unary.ResolveOperator): Don't discard implicit
7375 converted value in Operator.OnesComplement.
7377 2005-08-22 Ben Maurer <bmaurer@ximian.com>
7379 * anonymous.cs: If the anon method is pulled into a helper class,
7380 it needs to be `internal' not `private'. Fixes runtime behavior on
7383 2005-08-20 Martin Baulig <martin@ximian.com>
7385 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7386 scope if we don't already have it.
7388 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7389 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
7392 2005-08-17 Marek Safar <marek.safar@seznam.cz>
7395 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
7398 2005-08-16 Marek Safar <marek.safar@seznam.cz>
7400 The big constants rewrite
7401 Fix #75746, #75685 and more
7402 As a side effect saved 1MB for MWF ;-)
7404 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
7405 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
7406 enum based for corlib compilation.
7408 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
7411 * class.cs (FixedField.Define): Use ResolveAsConstant.
7413 * const.cs (IConstant): Interface constants and enums.
7414 (Const.ResolveValue): New method for constant resolvning.
7415 (ExternalConstant): Constants from imported assemblies.
7417 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
7418 conversion; like enums.
7419 (Constant.ToType): Converts this constant to different type.
7420 (Constant.Increment): Adds 1.
7422 * convert.cs (ImplicitConversionRequired): Simplified.
7424 * cs-parser.jay: Create EnumMember directly.
7426 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
7428 * doc.cs (GenerateEnumDocComment): Removed.
7430 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
7431 (ConvertIntLiteral): Removed.
7432 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
7434 * enum.cs (EnumMember): Implement IConstant.
7435 (Enum.IsValidEnumConstant): Removed.
7436 (Enum.GetNextDefaultValue): Removed.
7437 (Enum.FindMembers): Updated.
7438 (Enum.GenerateDocComment): Iterate enum members.
7440 * expression.cs (Cast.TryReduce): Handle enums correctly.
7441 (New.Constantify): Made public.
7442 (MemberAccess.DoResolve): Removed contant specific if(s).
7444 * literal.cs (NullLiteral): Implement new abstract methods.
7446 * statement.cs (GotoCase.Resolve): Use new constant methods.
7447 (SwitchLabel.ResolveAndReduce): Use new constant methods.
7449 * typemanager.cs (LookupEnum): Removed.
7450 (IsEnumType): Fixed to work with corlib.
7451 (RegisterConstant): Removed.
7452 (LookupConstant): Removed.
7453 (GetConstant): Changed to work with IConstant.
7455 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
7457 * location.cs : Fixed overflown (>255) column number.
7459 2005-08-03 Raja R Harinath <rharinath@novell.com>
7461 First cut of the qualified-alias-member feature.
7462 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
7464 * cs-parser.jay (DOUBLE_COLON): New token.
7465 (namespace_or_type_name): Add rule for recognizing
7466 qualified-alias-members.
7467 (primary_expression): Likewise.
7468 (element_access): Allow QualifiedAliasMember as a possible
7469 type-bearing expression.
7470 (local_variable_type, local_variable_pointer_type): Likewise.
7471 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
7472 aliases in the current and enclosing namespace declarations.
7473 (NamespaceEntry.UsingAlias): Add CS0440 warning.
7474 * decl.cs (MemberName.is_double_colon): New.
7475 (MemberName.MemberName): Add new constructor for alias-member.
7476 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
7477 * expression.cs (QualifiedAliasMember): New expression type.
7479 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7481 * location.cs : it borked when no argument was specified.
7483 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7485 * location.cs : tiny ToString() format fix.
7487 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7489 * statement.cs : oops, it was missing.
7491 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7493 A set of fixes for precise line/column location.
7496 "token" field now holds a file/line "delta", a line number offset
7497 from the segment, and a column number. See also:
7498 http://lists.ximian.com/pipermail/mono-devel-list/2004-
7499 December/009508.html
7500 Removed static IsNull. Use instance IsNull property instead.
7502 For some tokens it stores Location. For Identifier it stores
7503 LocatedToken which is a pair of string name and location.
7504 Column numbers are adjusted only at getChar().
7506 Use Location.ToString() for reporting (it now contains column).
7508 Largely modified to use LocatedToken instead of
7509 string (IDENTIFIER), and to acquire Location from some tokens.
7510 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
7511 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
7513 Now MemberName holds Location. DeclSpace.ctor() receives Location
7514 as a parameter. Removed extra parameters to all derived classes.
7515 Replaced Location.IsNull() with instance property.
7516 * assign.cs, expression.cs :
7517 Added .ctor() overload that omits Location.
7519 Added "nameEscaped" flag that indicates the identifier was escaped
7520 in the source file. This fixes bug #57047.
7522 2005-08-02 Marek Safar <marek.safar@seznam.cz>
7524 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
7525 New method, looking for lo-case imported cls type.
7527 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7530 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
7532 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
7534 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
7536 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
7538 Optimized to save 3.5 MB for SWF compilation.
7540 2005-08-01 Marek Safar <marek.safar@seznam.cz>
7542 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
7543 (PartialContainer.Create): Moved logic AddToContainer.
7544 (PartialContainer.MarkForDuplicationCheck): Shares name.
7546 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
7549 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
7551 (Namespace.GetSignatureForError): New method.
7553 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
7554 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
7556 2005-08-01 Raja R Harinath <rharinath@novell.com>
7559 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
7560 member lookup rather than qualifier_type, since qualifier_type can
7563 2005-08-01 Marek Safar <marek.safar@seznam.cz>
7565 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
7568 2005-07-31 Miguel de Icaza <miguel@novell.com>
7570 * statement.cs: Copy the local exception into the exception
7571 captured local. Fixes 75674
7573 2005-07-31 Raja R Harinath <harinath@gmail.com>
7576 * expression.cs (Invocation.OverloadResolve): Don't report error
7577 CS1501 if error CS1502 has been reported.
7578 (New.DoResolve): Delegate CS1501 reporting to
7579 Invocation.OverloadResolve.
7582 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
7583 invariant-meaning-in-block property in an enclosing block if
7586 2005-07-29 Marek Safar <marek.safar@seznam.cz>
7588 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
7589 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
7590 (Switch.CheckSwitch): Just save 50kb for SWF.
7592 2005-07-27 Martin Baulig <martin@ximian.com>
7594 * anonymous.cs (CaptureContext.AddField): Added
7595 `AnonymousContainer am' argument; compute its toplevel scope if
7596 it's not already computed. Fixes #75649.
7598 2005-07-26 Raja R Harinath <rharinath@novell.com>
7601 * class.cs (Constructor.Emit): Reset block to null if the block
7604 2005-07-25 Marek Safar <marek.safar@seznam.cz>
7606 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
7608 2005-07-25 Marek Safar <marek.safar@seznam.cz>
7610 * class.cs (MethodData.Define): Check whether accessor implementing
7611 interface is public.
7613 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
7615 2005-07-22 Marek Safar <marek.safar@seznam.cz>
7618 * namespace.cs (LookupType): Moved same type check to...
7620 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
7623 2005-07-21 Raja R Harinath <rharinath@novell.com>
7625 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
7626 already found a typebuilder.
7627 * class.cs (MethodCore.IsDuplicateImplementation): Compare
7628 MemberNames, not strings.
7630 * const.cs (Error_ExpressionMustBeConst):
7631 Rename from Error_EpressionMustBeConst.
7632 * const.cs, class.cs, statement.cd: Update.
7634 2005-07-21 Marek Safar <marek.safar@seznam.cz>
7638 * const.cs (Const.LookupConstantValue): Report missing contant expression
7640 (Error_EpressionMustBeConstant): Only one error method.
7642 * class.cs, statement.c: Updated.
7644 2005-07-20 Raja R Harinath <rharinath@novell.com>
7646 * statement.cs (Block.Flags): Add back HasVarargs.
7647 (Block.flags): Make protected.
7648 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
7650 * typemanager.cs (types, typecontainers, user_types): Remove.
7651 (UserTypes, TypeContainers): Likewise.
7652 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
7653 (CleanUp, Reset): Update.
7654 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
7655 (GetNestedType): Use Type.GetNestedType.
7656 (CoreLookupType): Take two arguments, the namespace and the
7657 basename of the type. Update to use the Namespace.Lookup
7659 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
7660 (RealMemberLookup): Use IsNestedChildOf instead of playing with
7661 string concatenation and substring matches.
7662 * class.cs, enum.cs, delegate.cs: Update to changes.
7664 2005-07-20 Marek Safar <marek.safar@seznam.cz>
7666 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
7667 Expression and made virtual.
7669 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
7670 (ImplicitStandardConversionExists): Fixed `byte' typo ?
7672 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
7674 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
7677 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
7680 2005-07-18 Marek Safar <marek.safar@seznam.cz>
7683 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
7684 AssemblyCultureAttribute is not used on executable.
7687 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
7689 2005-07-16 Raja R Harinath <rharinath@novell.com>
7692 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
7693 New. Reports CS0252/CS0253.
7694 Mostly taken from preliminary patch by Duncak Mak.
7695 (Binary.DoResolveOperator): Store results of operator lookup.
7696 Use them to detect if we need to warn about unintended reference
7699 2005-07-15 Raja R Harinath <rharinath@novell.com>
7702 * namespace.cs (Namespace.Lookup): Add back location parameter.
7703 (Namespace.LookupType): Add CS0436 report. Add location parameter.
7704 * delegate.cs, ecore.cs, expression.cs: Update to changes.
7706 * codegen.cs (EmitContext.DeclSpace): Make readonly.
7707 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
7708 (Namespace.LookupType): ... this.
7709 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
7711 * typemanager.cs (LookupTypeReflection): Remove buggy code that
7712 purported to handle pointers.
7713 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
7716 2005-07-15 Marek Safar <marek.safar@seznam.cz>
7718 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
7721 2005-07-15 Raja R Harinath <rharinath@novell.com>
7723 * namespace.cs (Namespace.Lookup): Drop location parameter.
7724 (NamespaceEntry.LookupAlias): Remove. Merge into ...
7725 (NamespaceEntry.Lookup): ... this.
7726 (NamespaceEntry.Error_AmbiguousTypeReference):
7727 Move here from DeclSpace.
7728 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
7730 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
7731 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
7732 Move to NamespaceEntry.
7733 * delegate.cs, expression.cs: Update to changes.
7735 2005-07-14 Marek Safar <marek.safar@seznam.cz>
7737 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
7738 CheckAttributeType and refactored.
7739 (Attribute.ResolvePossibleAttributeType): Changed to reuse
7740 ResolveAsTypeTerminal error handling.
7741 (ResolveAsTypeTerminal): Introduced because of global attributes extra
7743 (GetSignatureForError): Print errors in same way.
7746 * codegen.cs: Reflect attribute GetSignatureForError change.
7749 * expression.cs: Add silent parameter to ResolveAsTypeStep.
7751 * namespace.cs (UsingEntry): Refactored to make fields private.
7754 statement.cs: Error_UnexpectedKind has extra parameter.
7756 2005-07-14 Raja R Harinath <rharinath@novell.com>
7758 * ecore.cs (IAlias): Remove.
7759 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
7760 that implement the interface.
7761 * namespace.cs (Namespace): Likewise.
7762 (Namespace.declspaces): Renamed from 'defined_names'.
7763 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
7764 DeclSpace instead of an IAlias.
7765 * tree.cs (Tree.AddDecl): Update.
7767 2005-07-12 Raja R Harinath <rharinath@novell.com>
7769 * statement.cs (Block.Flags); Remove HasVarargs.
7770 (Block.HasVarargs): Move to ToplevelBlock.
7771 (Block.ThisVariable, Block.AddThisVariable): Likewise.
7772 (Block.Variables): Make protected. Initialize variable hashtable
7774 (Block.AddVariable): Update.
7775 (Block.Resolve): Update to changes.
7776 (ToplevelBlock.HasVarargs): New boolean.
7777 (ToplevelBlock.ThisVariable): Move here from Block.
7778 (ToplevelBlock.AddThisVariable): Likewise.
7779 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
7780 * expression.cs (This.ResolveBase): Update to changes.
7781 (ArglistAccess.DoResolve): Likewise.
7783 2005-07-11 Marek Safar <marek.safar@seznam.cz>
7786 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
7788 * class.cs (TypeContainer.VerifyMembers): Distinguish between
7789 not used and not used & assigned.
7790 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
7792 2005-07-11 Marek Safar <marek.safar@seznam.cz>
7795 * expression.cs (Is.DoResolve): null is never provided type.
7797 2005-07-08 Marek Safar <marek.safar@seznam.cz>
7800 * cs-parser.jay: Less strict event error rule to catch more errors.
7802 2005-07-08 Martin Baulig <martin@ximian.com>
7804 Fix test-iter-10.cs - distinguish whether we `yield' in a property
7805 gettter (allowed) or setter (not allowed).
7807 * class.cs (Accessor): Implement IIteratorContainer.
7808 (Accessor.Yields): New public field.
7809 (PropertyBase.PropertyMethod.Define): Handle iterators on a
7813 (get_accessor_declaration, set_accessor_declaration): Set the
7814 `yields' flag on the accessor, not the property.
7815 (property_declaration): Do the iterators check on a per-accessor
7816 basis and not for the whole property.
7818 2005-07-08 Martin Baulig <martin@ximian.com>
7820 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
7821 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
7823 2005-07-07 Marek Safar <marek.safar@seznam.cz>
7826 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
7827 (ExtractSecurityPermissionSet): Cope with self referencing security
7828 attributes properly.
7830 * driver.cs (SetOutputFile): Made public property OutputFile.
7832 2005-07-07 Raja R Harinath <rharinath@novell.com>
7835 * class.cs (TypeContainer.first_nonstatic_field): Rename from
7836 has_nonstatic_fields. Make into a FieldBase pointer.
7837 (TypeContainer.AddField): Add CS0282 check.
7838 (TypeContainer.EmitType): Update.
7840 2005-07-06 Miguel de Icaza <miguel@novell.com>
7842 * cs-tokenizer.cs (consume_identifier): Do not create strings to
7843 compare if they start with __.
7845 2005-07-06 Raja R Harinath <rharinath@novell.com>
7847 * statement.cs (Switch.SwitchGoverningType): Only look at
7848 UserCasts that don't need implicit standard conversions to one of
7849 the allowed switch types (Fixes test-322.cs).
7850 (LocalInfo.Resolve): Re-enable sanity-test.
7852 2005-07-06 Marek Safar <marek.safar@seznam.cz>
7854 * cs-tokenizer.cs (consume_identifier): Detect double undescores
7856 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
7858 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
7860 2005-07-06 Raja R Harinath <rharinath@novell.com>
7863 * ecore.cs (SimpleName.GetSignatureForError): Add.
7864 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
7865 (MemberAccess.GetSignatureForError): Add.
7867 2005-07-05 Marek Safar <marek.safar@seznam.cz>
7869 The big error and warning messages review.
7899 * typemanager.cs: Updated.
7901 * class.cs: (MethodCore.SetYields): Moved here to share.
7902 (PropertyMethod.Define): Moved iterator setup here.
7904 * iterators.cs: Add orig_method to have full access to parent
7907 2005-07-05 Raja R Harinath <rharinath@novell.com>
7909 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
7910 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
7911 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
7912 variable of struct type.
7913 * expression.cs (Unary.ResolveOperator): Update to change.
7914 (Indirection.VerifyFixed): Likewise.
7915 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
7916 (ParameterReference.VerifyFixed): Value parameters are fixed.
7917 (This.VerifyFixed): Treat 'this' as a value parameter.
7918 * statement.cs (LocalInfo.IsFixed): Remove.
7920 2005-07-01 Martin Baulig <martin@ximian.com>
7922 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
7923 `ec.EmitThis ()' to get the correct scope.
7925 2005-07-01 Martin Baulig <martin@ximian.com>
7927 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
7928 instance is a ParameterReference; fixes #75299.
7930 2005-07-01 Martin Baulig <martin@ximian.com>
7932 Reverted Marek's latest patch (r46725):
7933 - it contains structural changes which are neither mentioned in
7934 the ChangeLog nor explained anywhere; for example the additional
7935 argument of EmitContext's and Iterator's .ctor's and the
7936 TypeContainer.DefineMembers() change.
7937 - structural changes like this should go in in seperate patches
7938 and not be hidden in a huge patch which just seems to affect
7939 warnings and errors.
7940 a big and hard to understand patch.
7941 - it breaks iterators and causes regressions, for instance in
7944 2005-06-30 Raja R Harinath <rharinath@novell.com>
7947 * expression.cs (Indexers.map): Remove.
7948 (Indexers.Append): Filter out inaccessible setters and getters.
7949 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
7952 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
7954 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
7955 (FieldExpr.Emit, PropertyExpr.Emit): Update.
7956 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
7957 * expression.cs (Invocation.EmitCall): Add CS0120 check.
7959 2005-06-30 Marek Safar <marek.safar@seznam.cz>
7962 * class.cs (FieldBase.GetInitializerExpression): One more field
7965 2005-06-28 Miguel de Icaza <miguel@novell.com>
7967 * pending.cs: Do not define a proxy if the base method is virtual,
7968 it will be picked up by the runtime (bug 75270).
7970 2005-06-08 Martin Baulig <martin@ximian.com>
7972 The big Iterators rewrite :-)
7974 * iterators.cs: Rewrite this to use the anonymous methods framework.
7976 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
7977 before the TypeContainers; see 2test-21.cs.
7980 (TypeContainer.DefineType): Don't create a new EmitContext if we
7981 already have one (this only happens if we're an Iterator).
7982 (TypeContainer.Define): Also call Define() on all our iterators.
7983 (Method.CreateEmitContext): Added support for iterators.
7986 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
7987 (AnonymousContainer.CreateMethodHost): Moved here from
7988 AnonymousMethod and made abstract.
7989 (AnonymousContainer.CreateScopeType): New abstract method.
7990 (AnonymousContainer.IsIterator): New public property.
7991 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
7992 get the ScopeTypeBuilder rather than manually defining it here.
7993 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
7996 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
7997 before RootContext.DefineTypes().
7999 * codegen.cs (EmitContext.RemapToProxy): Removed.
8000 (EmitContext.CurrentAnonymousMethod): Changed type from
8001 AnonymousMethod -> AnonymousContainer.
8002 (EmitContext.ResolveTopBlock): Protect from being called twice.
8003 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
8004 (EmitContext.EmitThis): Removed the iterators hacks; use the
8005 anonymous methods framework for that.
8008 (ToplevelBlock.Container): Make this a property, not a field.
8009 (ToplevelBlock.ReParent): New public method; move the
8010 ToplevelBlock into a new container.
8011 (Foreach.TemporaryVariable): Simplify.
8013 2005-06-05 Martin Baulig <martin@ximian.com>
8015 * statement.cs (LocalInfo.CompilerGenerated): New flag.
8016 (Block.AddTemporaryVariable): New public method; creates a new
8017 `LocalInfo' for a temporary variable.
8018 (Block.EmitMeta): Create the LocalBuilders for all the temporary
8020 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
8021 non-iterator variables.
8023 2005-06-05 Martin Baulig <martin@ximian.com>
8025 * statement.cs (Foreach.TemporaryVariable): Create the
8026 LocalBuilder in the Emit phase and not in Resolve since in some
8027 situations, we don't have an ILGenerator during Resolve; see
8028 2test-19.cs for an example.
8030 2005-06-04 Martin Baulig <martin@ximian.com>
8032 **** Merged r45395 from GCS ****
8034 The big Foreach rewrite - Part II.
8036 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
8037 with `PropertyInfo ienumerator_getcurrent'.
8039 * codegen.cs (VariableStorage): Removed.
8042 (Foreach): Derive from Statement, not ExceptionStatement.
8043 (Foreach.CollectionForeach): New nested class. Moved all the code
8044 dealing with collection foreach here.
8045 (Foreach.ForeachHelperMethods): Removed.
8046 (Foreach.TemporaryVariable): Implement IMemoryLocation.
8048 2005-05-23 Martin Baulig <martin@ximian.com>
8050 * statement.cs (Try.DoResolve): Don't create a `finally' if we
8051 don't need to. Fix #75014.
8053 2005-05-20 Martin Baulig <martin@ximian.com>
8055 Merged r44808 from GMCS.
8057 * class.cs (TypeContainer.CircularDepException): Removed.
8058 (TypeContainer.DefineType): Removed the `InTransit' stuff.
8059 (TypeContainer.CheckRecursiveDefinition): Check for circular class
8060 (CS0146) and interface (CS0529) dependencies here.
8062 2005-06-21 Raja R Harinath <rharinath@novell.com>
8064 * expression.cs (Invocation.EmitCall): Fix initialization
8065 'this_call' to reflect current behaviour. Fix indentation.
8067 * convert.cs (FindMostEncompassedType): Add two trivial special
8068 cases (number_of_types == 0 || number_of_types == 1).
8069 (FindMostEncompasingType): Likewise.
8071 2005-06-17 Raja R Harinath <rharinath@novell.com>
8073 Some cleanups preparing for the fix of #75283.
8074 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
8076 (EventExpr.InstanceResolve): Likewise.
8077 (EventExpr.DoResolve): Remove redundant checks.
8079 2005-06-10 Duncan Mak <duncan@novell.com>
8081 * cs-tokenizer.cs (process_directives): New flag for controlling
8082 the processing of preprocessor directives.
8083 (x_token): After seeing a '#', return Token.NONE instead of going
8084 to handle_preprocessing_directive() when not processing
8085 directives. This avoids unnecessary processing during the token peek in
8090 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
8091 the existing error reporting methods instead of Report.Error.
8093 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
8094 after Raja's rewrite.
8096 2005-06-08 Miguel de Icaza <miguel@novell.com>
8098 * class.cs: Small fix.
8100 2005-06-08 Raja R Harinath <rharinath@novell.com>
8103 * class.cs (GetPartialBases): Fix return value check of
8106 2005-06-07 Raja R Harinath <rharinath@novell.com>
8108 Ensure that partial classes are registered in their enclosing
8109 namespace. Initial part of fix of #75160.
8110 * tree.cs (Tree.RecordDecl): Add new namespace argument.
8111 Register declspace with namespace here, not in
8112 DeclSpace.RecordDecl.
8113 * cs-parser.jay: Pass namespace to RecordDecl.
8114 * class.cs (PartialContainer.Create): Likewise.
8115 (ClassPart.DefineType): New sanity-check. Throws an exception if
8117 * decl.cs (Declspace.RecordDecl): Remove.
8118 * namespace.cs (NamespaceEntry.DefineName): Remove.
8120 2005-06-06 Marek Safar <marek.safar@seznam.cz>
8122 * rootcontext.cs: Reset TargetExt as well.
8124 2005-06-03 Raja R Harinath <rharinath@novell.com>
8126 * ecore.cs (Expression.Resolve): Emit CS0654 error when
8129 2005-06-02 Raja R Harinath <rharinath@novell.com>
8131 Fix #75080, cs0119.cs.
8132 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
8134 (Expression.Resolve): ... this. Use it. Remove bogus code
8135 allowing ExprClass.Type and ExprClass.Namespace for
8136 ResolveFlags.VariableOrValue.
8137 (Expression.Resolve) [1-argument variant]: Change default resolve
8138 flags based on language version.
8139 (Expression.Error_UnexpectedKind): Use a simple string array
8140 rather than an ArrayList.
8141 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
8143 (TypeOfVoid.DoResolve): Likewise.
8144 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
8145 flags argument -- it always has the same value.
8147 2005-05-31 Raja R Harinath <rharinath@novell.com>
8150 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
8151 Use it in the error message.
8152 * assign.cs, expression.cs, statement.cs: Update.
8154 2005-05-30 Raja R Harinath <rharinath@novell.com>
8157 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
8158 the "almostMatchedMember" case too.
8159 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
8160 that failed the accessibility checks to 'almost_match'.
8162 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
8164 * attribute.cs: Use internal MethodBuilder methods to set
8165 ExactSpelling and SetLastError on PInvoke methods, instead
8166 of passing them via charset. Fixes #75060.
8168 2005-05-27 Raja R Harinath <rharinath@novell.com>
8170 * parameter.cs (Parameter): Remove TODO comment.
8171 (Parameter.DefineParameter): Remove Location parameter.
8172 (Parameters.LabelParameters): Likewise.
8173 * class.cs (Constructor.Emit): Update to change.
8174 (MethodData.Emit): Likewise.
8175 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
8176 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
8178 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
8181 Removed Parameters.Location and added Parameter.Location instead.
8182 Removed Location parameter from Emit() and GetSignature().
8189 Modified all related calls.
8191 2005-05-26 Raja R Harinath <rharinath@novell.com>
8193 Improve user-defined conversion handling.
8194 * convert.cs (GetConversionOperators): Rewrite. Return only the
8195 applicable operators.
8196 (AddConversionOperators): New. Helper for GetConversionOperators.
8197 (FindMostEncompassedType, FindMostEncompassingType): Verify that
8198 there is only one most encompassed/encompassing type.
8199 (FindMostSpecificSource, FindMostSpecificTarget): Remove
8200 "applicable operator" handling.
8201 (UserConversion): Move cache here from GetConversionOperators.
8202 Directly cache the chosen operator, rather than the whole
8204 (ExplicitNumericConversion): Fix buggy implementation of Decimal
8205 case. Allow conversion of decimal to sbyte and byte too.
8206 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8207 New static methods. Used to avoid allocating EmptyExpressions in
8210 2005-05-24 Duncan Mak <duncan@novell.com>
8212 * ecore.cs (CastFromDecimal): New class for casting a decimal to
8213 another class, used in Convert.ExplicitNumericConversion.
8214 (CastToDecimal): New class, similar to above, but casts to
8215 System.Decimal, used in Convert.ImplicitNumericConversion and also
8216 in explicit convesion from double/float to decimal.
8218 * convert.cs (ImplicitNumericConversion): Handle implicit
8219 conversions to System.Decimal.
8220 (ExplicitNumericConversion): handle explicit conversions to
8225 2005-05-20 Miguel de Icaza <miguel@novell.com>
8227 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
8228 know the type at this stage, just break through. Fixes #75008
8230 2005-05-19 Martin Baulig <martin@ximian.com>
8233 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
8234 to disable error reporting.
8236 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
8237 here since we don't want to report an error; see the new test-336.cs.
8239 2005-05-19 Raja R Harinath <rharinath@novell.com>
8241 * statement.cs (ToplevelBlock.GetParameterReference)
8242 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
8243 Move here from class Block.
8244 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
8245 * expression.cs (ParameterReference.DoResolveBase): Likewise.
8247 2005-05-18 Martin Baulig <martin@ximian.com>
8252 (FlowBranching.Reachability): Add non-static public And() and Or()
8254 (FlowBranchingSwitch): New class; do the `break_origins' thing
8255 like in FlowBranchingLoop.
8256 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
8257 reachability, not just locals and parameters.
8258 (FlowBranching.MergeChild): Remove some of the hacks for loop and
8259 switch; MergeBreakOrigins() now takes care of that.
8261 2005-05-18 Martin Baulig <martin@ximian.com>
8263 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8264 a loop and may leave it, reset the barrier; fixes #74974.
8266 2005-05-17 Marek Safar <marek.safar@seznam.cz>
8268 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
8271 * cs-parser.jay: Catch more lexical errors.
8273 * report.cs: Add one more Error method.
8276 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
8278 2005-05-17 Martin Baulig <martin@ximian.com>
8280 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
8283 2005-05-16 Raja R Harinath <rharinath@novell.com>
8285 Fix test-382.cs. Emit values of decimal constants.
8286 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
8288 (TypeContainer.AddField): ... this.
8289 (TypeContainer.EmitFieldInitializers): Allow the list of fields
8290 with initializers to include 'Const's.
8291 (ClassPart.RegisterFieldForInitialization): Forward to
8293 * const.cs (Const.Const): Pass initializer to base class.
8294 (Const.Define): In case of decimal constants, register them for
8295 initialization in a static constructor.
8297 2005-05-14 Martin Baulig <martin@ximian.com>
8299 * statement.cs (Block.Resolve): Correctly handle unreachable code;
8300 do not call ResolveUnreachable() on unreachable statements in
8301 here, see the comment in the source code.
8303 2005-05-13 Raja R Harinath <rharinath@novell.com>
8306 * expression.cs (BinaryResolveOperator): If one of the operands of
8307 an equality comparison is 'null' and the other is a pointer type,
8308 convert the null to a NullPointer.
8309 * convert.cs (ImplicitReferenceConversion): If the expression is a
8310 NullLiteral and the target type is a pointer type, return a
8311 NullPointer instead.
8312 (ImplicitConversionStandard): Likewise.
8314 2005-05-13 Marek Safar <marek.safar@seznam.cz>
8316 * cs-parser.jay: Set readonly context based on special constructs.
8318 * expression.cs (LocalVariableReference.DoResolveBase): Improved
8319 readonly variable error handling.
8321 * rootcontext.cs (EmitCode): Don't verify members when error
8324 * statement.cs (LocalInfo): Add reaodnly context information.
8325 (SetReadOnlyContext, GetReadOnlyContext): New methods.
8327 2005-05-13 Raja R Harinath <rharinath@novell.com>
8329 * statement.cs (Block.Resolve): Revert change below. Modify fix
8330 for #74041 to initialize 'resolved' to false only for explicit
8331 blocks. Fixes #74873.
8333 2005-05-12 Raja R Harinath <harinath@gmail.com>
8336 * typemanager.cs (unmanaged_enclosing_types): New.
8337 (IsUnmanagedType): Avoid infloops by using
8338 'unmanaged_enclosing_types' to talk with recursive invocations.
8340 2005-05-13 Martin Baulig <martin@ximian.com>
8342 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
8343 instance variable, not a local. Fix #74873.
8344 (Block.ResolveUnreachable): Set it to true here.
8346 2005-05-11 Duncan Mak <duncan@novell.com>
8348 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
8349 continuing to process for 'arg'.
8350 (handle_preprocessing_directive): Check the argument of the #endif
8351 directive and report error CS1025 if there are any trailing
8354 According to the C# spec, having even whitespace after the #endif
8355 directive is illegal; however, because we call arg.TrimEnd ()
8356 beforehand, we have the same behavior as csc, allowing whitespace
8357 after the directive.
8361 2005-05-11 Marek Safar <marek.safar@seznam.cz>
8365 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
8366 (Constructor.GetObsoleteAttribute): Implemented correctly.
8368 2005-05-10 Martin Baulig <martin@ximian.com>
8370 * support.cs (ReflectionParameters.ParameterModifier): Use
8371 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
8372 and `ParameterAttributes.In'. Fixes #74884.
8374 2005-05-10 Marek Safar <marek.safar@seznam.cz>
8376 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
8378 * expression.cs (Argument.GetParameterModifier): Turned to property.
8379 (Invocation.Error_InvalidArguments): Add more descriptive errors.
8381 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
8384 2005-05-09 Raja R Harinath <rharinath@novell.com>
8387 * decl.cs (MemberCache.AddMethods): Register override methods,
8388 rather than non-override methods.
8389 * typemanager.cs (RegisterOverride): New.
8390 (IsOverride): Update.
8392 2005-05-09 Marek Safar <marek.safar@seznam.cz>
8396 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
8397 recursive declaration.
8399 * statement.cs (Block.ResolveMeta): Report any error in resolving.
8401 2005-05-06 Marek Safar <marek.safar@seznam.cz>
8403 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
8405 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
8407 2005-05-05 Raja R Harinath <rharinath@novell.com>
8410 * decl.cs (DeclSpace.FamilyAccessible):
8411 Use TypeManager.IsNestedFamilyAccessible.
8413 Fix reopened #64812.
8414 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
8417 2005-05-04 Raja R Harinath <rharinath@novell.com>
8418 Abin Thomas <projectmonokochi@rediffmail.com>
8419 Anoob V E <projectmonokochi@rediffmail.com>
8420 Harilal P R <projectmonokochi@rediffmail.com>
8423 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
8424 allow access to all static members.
8426 2005-05-04 Martin Baulig <martin@ximian.com>
8428 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
8430 2005-05-04 Martin Baulig <martin@ximian.com>
8434 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
8435 section at the end; make things work if `default' is not the last
8438 2005-05-04 Martin Baulig <martin@ximian.com>
8442 * statement.cs (Switch): Replaced the `got_default' field with a
8443 `default_section' one.
8444 (Switch.CheckSwitch): Set `default_section' here.
8445 (Switch.Resolve): If we're a constant switch and the constant is
8446 not found, use the default section.
8448 2005-05-03 Martin Baulig <martin@ximian.com>
8450 * expression.cs (ArrayAccess.EmitGetLength): New public method.
8452 * statement.cs (Foreach.ArrayForeach): New nested class.
8453 (Foreach.TemporaryVariable): New nested class.
8454 (Foreach.EmitArrayForeach): Removed; this is now in the new
8457 2005-05-03 Raja R Harinath <rharinath@novell.com>
8459 * pending.cs (BaseImplements): Move the #74773 fix here. This is
8461 (VerifyPendingMethods): Revert change below.
8463 * typemanager.cs (IsOverride, RegisterNonOverride): New.
8464 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
8465 that used to trigger warning -28. Remove warning -28.
8466 * expression.cs (Invocation.OverloadResolve): Use
8467 TypeManager.IsOverride to distinguish override methods.
8470 * pending.cs (VerifyPendingMethods): If a base type implements the
8471 requested interface, don't bother checking individual methods of
8472 the base type. As a side-effect, this prevents the creation of
8473 unnecessary proxies.
8475 2005-05-02 Martin Baulig <martin@ximian.com>
8479 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8480 Also `And' the locals if the old vector is null.
8481 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
8482 null; in this case we basically reset all the variables.
8484 2005-05-02 Martin Baulig <martin@ximian.com>
8488 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
8489 Added `FlowBranching branching' argument; always `and' the
8490 variables instead of `or'ing them unless we're an infinite loop.
8492 * statement.cs (While.Resolve): Create a new sibling unless we're
8495 2005-05-02 Martin Baulig <martin@ximian.com>
8499 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
8500 arguments; use it instead of creating a new TopLevelBlock.
8501 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
8502 our ConstructorInitializer.
8505 (TopLevelBlock.TopLevelBranching): New public property.
8506 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
8507 and create our `TopLevelBranching'.
8509 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
8510 anonymous method host, use `block.TopLevelBranching' rather than
8511 creating a new branching.
8513 2005-04-20 Miguel de Icaza <miguel@novell.com>
8515 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
8516 a ScopeInfo, if any of the current children is a child of the new
8517 entry, move those children there.
8519 2005-04-30 Martin Baulig <martin@ximian.com>
8521 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
8522 at the beginning of a SwitchSection. Fix #73335.
8524 2005-04-27 Marek Safar <marek.safar@seznam.cz>
8527 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
8529 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
8530 (FieldExpr.DoResolve): Obsolete members are ignored for field
8533 2005-04-26 Marek Safar <marek.safar@seznam.cz>
8535 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
8536 of arrays detection.
8538 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
8540 (Field.VerifyClsCompliance): Volatile fields are not compliant.
8542 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
8545 2005-04-25 Ben Maurer <bmaurer@ximian.com>
8547 * cs-parser.jay: Use the prefered version of -unsafe in error
8550 2005-04-22 Marek Safar <marek.safar@seznam.cz>
8552 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
8555 2005-04-20 John Luke <john.luke@gmail.com>
8557 * driver.cs: fix typo in error message, --outout to --output
8559 2005-04-20 Marek Safar <marek.safar@seznam.cz>
8561 * codegen.cs (InRefOutArgumentResolving): New field.
8563 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
8564 fields outside contructor.
8566 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
8568 2005-04-19 Miguel de Icaza <miguel@novell.com>
8570 * anonymous.cs (CaptureContext.EmitParameterInstance): The
8571 parameter code was not completed ever, so it was not as up-to-date
8572 as local variables. Must finish it.
8574 The bug fix was to compare the Toplevel of the block, not the
8575 current block. Thanks for Ben for pointing this out.
8577 2005-04-19 Raja R Harinath <rharinath@novell.com>
8579 * decl.cs (AddMethods): Use the declaring type of the problem
8580 method to determine if we want to squash a warning.
8582 2005-04-19 Marek Safar <marek.safar@seznam.cz>
8584 * attribute.cs: Removed debug output.
8586 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
8588 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
8591 2005-04-18 Raja R Harinath <rharinath@novell.com>
8594 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
8595 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
8596 all null comparisons against reference types.
8598 2005-04-18 Marek Safar <marek.safar@seznam.cz>
8601 * class.cs (TypeContainer.CircularDepException) New nested
8603 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
8604 (TypeContainer.DefineType): Removed error, reset InTransit before
8606 (Class.DefineType): Throw exception when is in Transit.
8607 Catch exception and report error.
8608 (Struct.DefineType): Throw exception when is in Transit.
8609 Catch exception and report error.
8610 (Interface.DefineType): Throw exception when is in Transit.
8611 Catch exception and report error.
8613 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
8614 handle nested exception handlers.
8616 * flowanalysis.cs (InTryWithCatch): New method, search for try with
8619 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
8620 InFinally and InCatch storage.
8622 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
8623 (Catch.Resolve): Set and Restore ec.InCatch.
8624 (Try.Resolve): Set and Restore ec.InFinally.
8625 (Try.HasCatch): True when try has catch.
8627 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
8629 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
8630 for the same event member, so exclude such cases from warning 419.
8633 2005-04-16 Miguel de Icaza <miguel@novell.com>
8635 * expression.cs (Binary.ResolveOperator): Apply patch from John
8636 Luke to fix bug 59864: operators &, | and ^ on enumerations
8637 require that the same enum type on both sides.
8639 * driver.cs: Add warnings to old flag usage, this is to assist
8640 people who produce Makefiles and hope that the Makefiles will be
8643 * class.cs (TypeContainer.EmitType): Moved the definition of the
8644 special $PRIVATE$ field from the resolve phase to the Emit phase.
8645 During resolve we do not know if we are a struct with
8646 HasExplicitLayout, we know this only after the attributes for the
8649 Set the FieldOffset to zero on the dummy field that we create for
8650 the class. Fixes 74590.
8652 2005-04-16 Raja R Harinath <rharinath@novell.com>
8655 * ecore.cs (PropertyExpr.resolved): New.
8656 (DoResolve): Use it to handle a case of double resolution here.
8657 Handle a case of identical-name-and-type-name.
8658 * expression.cs (ArrayCreation.CheckIndices): Avoid double
8659 resolution by storing the results of expression resolution back
8660 into the "probes" array.
8662 2005-04-15 Raja R Harinath <rharinath@novell.com>
8664 Fix cs0208-7.cs and cs0208-8.cs.
8665 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
8666 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
8667 error reporting to point out the reason a struct is not unmanaged.
8669 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8671 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
8672 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
8674 2005-04-13 Raja R Harinath <rharinath@novell.com>
8677 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
8678 IdenticalNameAndTypeName here.
8679 (EventExpr.InstanceResolve): Likewise.
8681 2005-04-13 Marek Safar <marek.safar@seznam.cz>
8683 C# 2.0 DefaultCharSetAttribute implementation
8685 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
8686 which allows us to set GlobalNamespace for every resolve.
8687 (Attribute.ResolveArguments): Cut from Resolve.
8688 (Attribute.GetCharSetValue): Returns CharSet named argument.
8689 (Attribute.DefinePInvokeMethod): Gets default charset from
8691 (GlobalAttribute.ResolveAsTypeStep): Override.
8692 (GlobalAttribute.ResolveArguments): Override.
8694 * class.cs (TypeAttr): Is protected.
8696 * codegen.cs (ModuleClass.DefaultCharSet): New member.
8697 (ModuleClass.DefaultCharSetType): New memeber.
8698 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
8700 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
8701 charset from module.
8703 * delegate.cs (TypeAttr): Override.
8704 (Delegate.DefineType): Use this TypeAttr.
8706 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
8707 at very early stage (before types are defined) to resolve model
8708 module attributes. It will probably not work with corlib but it
8711 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
8712 charset from module.
8714 * typemanager.cs (default_charset_type): New type.
8716 2005-04-13 Raja R Harinath <rharinath@novell.com>
8718 * decl.cs (MemberCache.AddMethods): Don't warn if
8719 System.Object.Finalize has buggy MethodAttributes.
8721 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
8724 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8726 * doc.cs : detect ambiguous reference to overloaded members.
8727 Fixed bug #71603. MS 1.1 csc does not detect it.
8729 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8731 * doc.cs : delegates must not be referenced with parameters.
8734 2005-04-12 Miguel de Icaza <miguel@novell.com>
8736 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
8738 2005-04-10 Miguel de Icaza <miguel@novell.com>
8740 * driver.cs (MainDriver): Stop processing if the CLS stage found
8743 (CompilerCallableEntryPoint.InvokeCompiler): Always
8744 reset after execution; Take a TextWriter argument for the
8747 * report.cs: Use the error stream instead of hardcoding stderr.
8749 2005-04-09 Miguel de Icaza <miguel@novell.com>
8751 * class.cs: Reduce code paths to test, too small of an
8752 optimization to make it worth the extra testing. Always perform
8755 2005-04-08 Raja R Harinath <rharinath@novell.com>
8758 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
8759 operators that had errors reported on them.
8761 2005-04-08 Marek Safar <marek.safar@seznam.cz>
8763 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
8765 (Attribute.Resolve): Add named argument type checking.
8767 * class.cs (FixedField.Define): Use IsPrimitiveType
8769 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
8771 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
8772 unsafe parameter types.
8774 * statement.cs (Using.ResolveExpression): Add better error description.
8776 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
8778 2005-04-08 Raja R Harinath <rharinath@novell.com>
8781 * attribute.cs (Attribute.GetAttributeUsage): Resolve
8782 AttributeUsageAttribute in the emitcontext of the attribute class,
8783 not in the emitcontext of the attributable entity it was attached to.
8784 * cs-parser.jay: Use 'current_class', not 'current_container',
8785 when creating a GlobalAttribute.
8787 2005-04-08 Alp Toker <alp@atoker.com>
8789 * pending.cs: The fix to #58413 failed to compile methods implementing
8790 interfaces with/without params modifiers and vice versa, even though
8791 params modifiers aren't part of the signature. Make the modifier check
8792 less strict as in csc.
8794 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
8795 Anoob V E <projectmonokochi@rediffmail.com>
8796 Harilal P R <projectmonokochi@rediffmail.com>
8799 * pending.cs (TypeAndMethods.mods): New. Store the parameter
8800 modifiers of pending methods.
8801 (PendingImplementation.PendingImplementation): Initialize it.
8802 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
8803 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
8804 with ParameterData. Add check for modifiers.
8805 * class.cs (MethodData.Define): Update to changes.
8807 2005-04-07 Raja R Harinath <rharinath@novell.com>
8809 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
8811 2005-04-07 Marek Safar <marek.safar@seznam.cz>
8813 * class.cs (PropertyMethod.Define): Check private accessor in abstract
8816 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
8819 * typemanager.cs: Registered RequiredAttributeAttribute.
8821 2005-04-06 Marek Safar <marek.safar@seznam.cz>
8823 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
8824 Warning CS0169 is back at level 3.
8825 (IMethodData.SetMemberIsUsed): New method.
8827 * decl.cs (IsUsed): New value; moved from FieldBase.Status
8828 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
8830 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
8832 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
8834 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
8837 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
8840 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
8841 to avoid the problems with nested types.
8843 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
8844 Anoob V.E <projectmonokochi@rediffmail.com>
8845 Harilal P.R <projectmonokochi@rediffmail.com>
8846 Raja R Harinath <rharinath@novell.com>
8849 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
8851 * typemanager (GetConstructor): Make public.
8853 2005-04-05 John Luke <john.luke@gmail.com>
8854 Raja R Harinath <rharinath@novell.com>
8857 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
8858 struct too. Return false quicker in a few cases.
8859 (VerifyUnManaged): Use it.
8861 2005-04-05 Raja R Harinath <rharinath@novell.com>
8864 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
8865 not 'unreachable_seen'.
8867 2005-04-04 Marek Safar <marek.safar@seznam.cz>
8869 * attribute.cs (Attribute.GetValue): Removed unused.
8871 * codegen.cs (CodeGen.TrimExt): Removed unused.
8873 * cs-parser.jay (output): Removed unused.
8875 * cs-tokenizer.cs (hex_digits): Removed unused.
8877 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
8879 * expression.cs (Indirection.LoadExprValue): Removed unused.
8880 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
8882 * iterators.cs (Iterator.param_types): Removed unused.
8884 * statement.cs (Goto.block): Removed unused.
8885 (ToplevelBlock.did): Removed unused.
8886 (Switch.ResolveConstantSwitch): Removed unused.
8888 2005-04-01 Ben Maurer <bmaurer@ximian.com>
8890 * rootcontext.cs: Allow mcs to bootstrap with the compilation
8893 2005-04-01 Raja R Harinath <rharinath@novell.com>
8895 Fix #74232 and cs0208-3.cs.
8896 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
8897 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
8898 unmanaged type. Don't use FieldBuilders when 't' is a
8899 TypeBuilder. Use ModFlags and MemberType fields.
8900 * class.cs (MemberBase.member_type): Rename from MemberType.
8901 (MemberBase.MemberType): New property. Determines member_type on
8903 (MemberBase.DoDefine): Don't initialize MemberType here.
8904 (FieldMember.Define): Likewise.
8906 2005-04-01 Marek Safar <marek.safar@seznam.cz>
8909 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
8910 Attributes are emitted there.
8912 2005-04-01 Raja R Harinath <rharinath@novell.com>
8914 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
8915 keyword in 'partial enum' too.
8916 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
8918 Report from Kamil Skalski <nazgul@omega.pl>.
8921 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
8922 have partial containers too.
8924 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
8925 in block' checks to Block.CheckInvariantMeaningInBlock.
8926 * statement.cs (Block.GetKnownVariableInfo): Make private.
8927 (Block.IsVariableUsedInChildBlock): Remove.
8928 (Block.IsVariableUsedInBlock): Likewise.
8929 (Block.CheckInvariantMeaningInBlock): New. Show location of
8930 conflicting declaration.
8931 (Block.AddVariable): Make error messages less long-winded and more
8932 specific. Show location of conflicting declaration.
8933 * parameter.cs (Parameters.Location): New readonly property.
8935 2005-03-31 Raja R Harinath <rharinath@novell.com>
8937 Clean up semantics of invoking ResolveMemberAccess.
8938 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
8939 can have an instance, ensure that we pass in a non-TypeExpression
8940 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
8941 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
8942 argument. Update to changes and simplify.
8943 (FieldExpr.Emitinstance): Remove CS0120 check.
8944 (PropertyExpr.EmitInstance): Likewise.
8945 * expression.cs (Argument.Resolve): Likewise.
8946 (Invocation.DoResolve): Update to changes in semantics of
8949 2005-03-31 Marek Safar <marek.safar@seznam.cz>
8952 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
8955 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
8957 2005-03-31 Raja R Harinath <rharinath@novell.com>
8959 Fix difference in behaviour with commandline invocation.
8960 * driver.cs (Driver.Reset): New.
8961 (CompilerCallableEntryPoint): Call it.
8963 * statement.cs (If.Resolve): Avoid spurious "uninitialized
8964 variable" warnings if the boolean expression failed to resolve.
8966 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
8968 * attribute.cs: Fix the union of several permissions when some of them
8969 are unrestricted (so the result isn't an unrestricted permission set).
8972 2005-03-30 Raja R Harinath <rharinath@novell.com>
8974 * ecore.cs (MemberExpr): New class. Convert from interface
8976 (MemberExpr.ResolveMemberAccess): Refactor and move here from
8977 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
8979 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
8980 (MethodGroupExpr.IsExplicitImpl): Remove.
8981 (Expression.GetFieldFromEvent): Remove.
8982 (SimpleName.MemberStaticCheck): Remove.
8983 (SimpleName.DoSimpleNameResolve): Update to changes.
8984 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
8985 (MemberAccess.IdenticalNameAndTypeName): Remove.
8986 (MemberAccess.error176): Move to MemberExpr.
8987 (MemberAccess.DoResolve): Update to changes.
8988 (BaseAccess.DoResolve): Likewise.
8990 2005-03-30 Marek Safar <marek.safar@seznam.cz>
8992 C# 2.0 Conditional attribute class implementation
8994 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
8995 Analyzes class whether it has attribute which has ConditionalAttribute
8996 and its condition is not defined.
8998 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
8999 (Class.IsExcluded): New method. Search for at least one defined
9000 condition in ConditionalAttribute of attribute class.
9002 2005-03-30 Raja R Harinath <rharinath@novell.com>
9004 * ecore.cs (PropertyExpr): Derive from Expression, not
9005 ExpressionStatement.
9006 (PropertyExpr.EmitStatement): Remove.
9008 2005-03-29 Raja R Harinath <rharinath@novell.com>
9011 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
9012 internal field "value__" of an enum be private. The examples for
9013 "value__" that I found on MSDN all used FieldAttributes.Private.
9015 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
9016 Don't mention IL method attribute names.
9018 Fix #47991. Remove a TODO.
9019 * statement.cs (Block.Toplevel): Make into a field.
9020 (Block.Parameters): Move into ToplevelBlock.
9021 (Block.known_variables): Rename from child_variable_names.
9022 (Block.Block): Remove variants that take Parameters. Initialize
9023 'Toplevel' with the immediately surrounding toplevel block.
9024 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
9025 LocalInfo parameter.
9026 (Block.GetKnownVariableInfo): New.
9027 (Block.IsVariableNameUsedInChildBlock): Update.
9028 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
9029 the block, even though it may not be in scope.
9030 (Block.AddVariable): Remove Parameters parameter. Use
9031 Toplevel.Parameters instead.
9032 (Block.AddConstant): Remove Parameters parameter.
9033 (Block.GetParameterReference): Update to use Toplevel.Parameters.
9034 (Block.IsParamaterReference): Likewise.
9035 (Block.IsLocalParameter): Likewise. Simplify a lot.
9036 (ToplevelBlock.Parameters): New. Moved from Block.
9037 (ToplevelBlock.ToplevelBlock): Update to changes. Always
9038 initialize Parameters to a non-null value.
9039 * cs-parser.jay: Update to changes.
9040 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
9041 simple names that mean different things in the same block. Use
9042 Block.IsVariableNameUsedInBlock.
9044 2005-03-28 Raja R Harinath <rharinath@novell.com>
9046 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
9047 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
9048 GetTypeHandle. It is possible for a reflected type to derive from
9049 a TypeBuilder (e.g., int[] derives from the TypeBuilder
9050 System.Array during mscorlib compilation).
9051 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
9052 contain a method_hash, don't create one either. Don't create a
9053 deep copy of the base cache's method_hash.
9054 (MemberCache.SetupCache): Rename back from DeepCopy.
9055 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
9056 already initialized. If we see an override function, add its
9057 underlying base virtual function to the member_hash too.
9059 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
9061 2005-03-26 Raja R Harinath <harinath@acm.org>
9064 * assign.cs (Assign.DoResolve): When the RHS of an assignment
9065 fails to resolve, ensure that the LHS is still resolved as an
9068 2005-03-25 Raja R Harinath <harinath@acm.org>
9070 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
9072 (Enum.current_ec): Remove.
9073 (Enum.LookupEnumValue): Remove EmitContext argument.
9074 Just uses the one created during DefineType.
9075 (Enum.FindMembers): Update.
9076 * expression.cs (MemberAccess.DoResolve): Update.
9078 2005-03-22 Marek Safar <marek.safar@seznam.cz>
9080 * assign.cs (Assign.DoResolve): Check for CS1717 when
9081 source and target are same (uses Equals).
9083 * expression.cs (LocalVariableReference, ParameterReference,
9084 This): Implemented Equals, GetHashCode.
9086 * statement.cs (Block.GetParameterReference): Removed useless
9089 2005-03-22 Raja R Harinath <rharinath@novell.com>
9092 * statement.cs (Block.AddVariable): Ensure that we skip implicit
9093 blocks before deciding whether the error is cs0136 or cs0128.
9095 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
9096 (using_alias_directive, using_namespace_directive): Pass
9097 MemberName, not an expression to Namespace.UsingAlias and
9099 (MakeName): Use the MemberName of the namespace.
9100 * namespace.cs (Namespace.MemberName): New.
9101 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
9102 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
9104 * decl.cs (MemberName.Name): Make readonly.
9105 (MemberName.FromDotted): New "constructor".
9106 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
9107 (MemberCore.Name): Compute from MemberName on demand.
9108 (MemberCore.SetMemberName): Provide a way to change the
9110 (MemberCore.AddToContainer): Don't take a fullname parameter.
9111 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
9112 fully qualified name of the container to the member name.
9113 (TypeContainer.AddToTypeContainer): Use a fully qualified name
9114 only if the type is a member of the root container.
9115 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
9116 MemberName.Left rather than searching for an embedded ".".
9117 (PartialContainer.CreatePart): Update to changes in RootContext.
9118 (MemberBase.ShortName): Turn into a property. Use
9119 MemberCore.SetMemberName.
9120 (MemberBase.ExplicitInterfaceName): Remove.
9121 (MemberBase.UpdateMemberName): Remove.
9122 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
9123 (PropertyBase.SetMemberName): New override.
9124 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
9125 (Tree.GetDecl): New.
9126 (Tree.AllDecls): Rename from Decls.
9127 * attribute.cs, enum.cs, report.cs: Update to changes.
9128 * driver.cs (MainDriver): Use MemberName.FromDotted on
9129 RootContext.MainClass.
9131 2005-03-21 Marek Safar <marek.safar@seznam.cz>
9133 * class.cs (FixedField.Define): Check for CS1664 and more sanity
9136 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
9138 2005-03-18 Marek Safar <marek.safar@seznam.cz>
9140 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
9141 property accessor modifiers.
9143 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
9144 fixed buffer attribute (CS1716).
9145 (PropertyMethod.HasCustomAccessModifier): When property accessor
9146 has custom modifier.
9148 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
9150 (PropertyExpr.DoResolveLValue): Add CS0272.
9152 2005-03-17 Miguel de Icaza <miguel@novell.com>
9154 * convert.cs: When converting to a pointer, use the proper Conv.U
9155 or Conv.I depending on the source data type.
9157 * cs-tokenizer.cs: Make the size for large decimal constants,
9160 2005-03-17 Martin Baulig <martin@ximian.com>
9162 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
9163 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
9165 2005-03-17 Martin Baulig <martin@ximian.com>
9167 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
9168 to bool so we can return an error condition.
9169 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
9172 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
9174 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
9177 2005-03-16 Raja R Harinath <rharinath@novell.com>
9179 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
9180 Refactor to avoid traversing the list of assemblies, and to avoid
9181 string concatenation.
9182 * typemanager.cs (guid_attr_type): Remove.
9183 (negative_hits, pointers, references): Remove hashes.
9185 (GetConstructedType): New. Uses type_hash to handle constructed
9186 types (arrays, references, pointers).
9187 (GetReferenceType, GetPointerType): Use it.
9188 (GetNestedType): New. Uses type_hash to handle nested types of
9190 (LookupType, LookupTypeDirect): Remove.
9191 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
9192 'types' hash and LookupTypeReflection directly.
9193 (params_string, params_object): Use GetConstructedType.
9194 * namespace.cs (Namespace.cached_types): New. Cache of reflected
9196 (Namespace.Lookup): Use cached_types.
9197 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
9198 provided by old TypeManager.LookupType.
9199 * rootcontext.cs (MakeFQN): Remove.
9200 * decl.cs (DeclSpace.MakeFQN): Likewise.
9201 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
9202 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9203 TypeManager.GetConstructedType.
9204 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
9206 2005-03-15 Marek Safar <marek.safar@seznam.cz>
9208 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
9211 * cs-parser.jay: Reports CS1527 for any namespace element.
9213 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
9216 * expression.cs (ParameterReference.IsAssigned): Changed error to
9218 (Error_WrongNumArguments): Moved CS0245 detection here.
9220 * statement.cs (Return.Resolve): Add CS1622 report.
9222 2005-03-11 Marek Safar <marek.safar@seznam.cz>
9224 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
9226 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
9228 * attribute.cs expression.cs: Get rid of some allocations.
9230 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
9232 * doc.cs : just eliminate the latest change.
9234 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9236 * doc.cs : commented out the latest change. It breaks xml-030.cs
9238 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9240 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
9241 fail. So invoke CreateType() in FindDocumentedType().
9243 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9245 * cs-tokenizer.cs : added IsKeyword().
9246 * doc.cs : Detect keyword incorrectly used as identifier.
9247 Allow identifiers prefixed by @.
9249 2005-03-10 Marek Safar <marek.safar@seznam.cz>
9251 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
9252 It caused exception in namespace resolving (again!).
9254 * class.cs (Class.ctor): Removed exit.
9255 (PropertyMethod.ctor): ditto.
9257 * codegen.cs (Codegen.Reset): Reset static data.
9258 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
9260 * cs-tokenizer.cs (Cleanup): Removed.
9262 * driver.cs (GetSystemDir): Rewrote to one line command.
9263 It caused problem with unloaded dynamic modules.
9264 (UnixParseOption): Removed Exit.
9265 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
9266 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
9267 Now can be mcs used as library.
9269 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
9272 * location.cs (Reset): Reset static data.
9274 * namespace.cs (Reset): Reset static data.
9276 * report.cs (Report.Reset): Reset static data.
9278 * rootcontext.cs (RootContext.Reset): Reset static data.
9280 * tree.cs (RootTypes.ctor): Use Location.Null
9282 * typemanager.cs (TypeManager.Reset): Reset static data.
9283 (CoreLookupType): Removed Exit.
9284 (TypeHandle.Reset): Reset static data.
9286 2005-03-10 Raja R Harinath <rharinath@novell.com>
9289 * typemanager.cs (ComputeNamespaces): Import namespaces from
9290 referenced modules too.
9292 2005-03-09 Raja R Harinath <rharinath@novell.com>
9294 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
9297 2005-03-09 Raja R Harinath <rharinath@novell.com>
9299 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
9300 enclosing DeclSpace. This ensures that a name-lookup populates
9301 more caches and there are fewer 'TypeExpression's. Carve out
9302 nested type lookup into ...
9303 (LookupNestedTypeInHierarchy): ... this.
9305 2005-03-09 Raja R Harinath <rharinath@novell.com>
9307 Clean up a few partial-class semantics.
9308 Fixes test-357.cs and cs1618-2.cs.
9309 * cs-parser.jay (struct_declaration): Use 'current_class' as
9310 parent of newly-created struct. Remove call to Register ().
9311 Use 'pop_current_class' to complete handing the current struct.
9312 (interface_declaration): Likewise.
9313 (class_declaration): Likewise.
9314 (enum_declaration): Use 'current_class' as parent of newly created
9316 (delegate_declaration): Likewise.
9317 (pop_current_class): New function. This is used to handle closing
9318 up the 'current_class' and 'current_container', and pointing them
9319 to the enclosing class/container.
9320 (CSharpParser): Initialize 'current_class' too.
9321 * decl.cs (MemberCore): Add check for invariant: a partial
9322 container is not a parsed entity, and thus does not enclose any
9324 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
9325 (DeclSpace.BaseTypeExpr): Use it.
9326 (DeclSpace.LookupType): Add check for invariant.
9327 * class.cs (TypeContainer): Add check for invariant: a nested
9328 class should have the same NamespaceEntry as its enclosing class.
9329 (TypeContainer.EmitFieldInitializers): Make virtual.
9330 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
9332 (TypeContainer.Register): Remove.
9333 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
9334 null. Use TypeResolveEmitContext for resolving base types and
9335 interfaces. Move initialization of Parts.TypeBuilder here from
9337 (TypeContainer.DefineNestedTypes): ... here.
9338 (PartialContainer): Take a Namespace not a NamespaceEntry.
9339 (PartialContainer.Create): Don't use Register. Call the
9340 appropriate Add... function directly.
9341 (ClassPart): Take both the PartialContainer and the enclosing
9342 class as constructor arguments.
9343 (ClassPart.EmitFieldInitializers): Override.
9344 (ClassPart.PartFindNestedTypes): Remove.
9345 (FieldBase.GetInitializerExpression): Resolve the initializer
9346 expression in the emit context of the enclosing class.
9347 * tree.cs (RootTypes): Remove Register ().
9349 2005-03-08 Marek Safar <marek.safar@seznam.cz>
9351 * cs-parser.jay: Removed CS0134.
9353 * driver.cs: Removed CS1901.
9355 * expression.cs (SizeOf.DoResolve): Don't report CS0233
9356 for predefined types.
9358 2005-03-07 Duncan Mak <duncan@novell.com>
9360 * codegen.cs (Save): Catch UnauthorizedAccessException as
9361 well. Fixes bug #73454.
9363 2005-03-07 Marek Safar <marek.safar@seznam.cz>
9365 * cs-tokenizer.cs (xtoken): Add CS1035.
9367 * class.cs (MethodData.Define): Add CS0683.
9368 (FieldMember.ctor): Add CS0681.
9370 2005-03-07 Raja R Harinath <rharinath@novell.com>
9372 * ecore.cs (SimpleName.DoResolve): Rename from
9373 SimpleName.DoResolveAllowStatic.
9374 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
9375 Pass 'intermediate' flag to MemberStaticCheck.
9376 (SimpleName.MemberStaticCheck): Skip "static check" only in case
9377 of "intermediate" lookups via MemberAccess.
9378 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
9379 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
9381 2005-03-07 Raja R Harinath <rharinath@novell.com>
9384 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
9385 slipped in because of variable names that are identical to a
9386 builtin type's BCL equivalent ('string String;', 'int Int32;').
9387 (PropertyExpr.EmitInstance): Likewise.
9389 2005-03-04 Marek Safar <marek.safar@seznam.cz>
9391 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
9393 * report.cs (warning_ignore_table): Made public.
9395 2005-03-04 Raja R Harinath <rharinath@novell.com>
9398 * class.cs (MethodData.Emit): Pass 'container' to
9399 container.GetObsoleteAttribute instead of 'container.Parent'.
9401 2005-03-03 Marek Safar <marek.safar@seznam.cz>
9403 * cs-parser.jay: Add 1534 error test.
9405 * iterators.cs (Yield.CheckContext): Add error 1629.
9406 (Iterator.ctor): Save unsafe modifier.
9407 (MoveNextMethod.DoEmit): Restore unsafe context.
9409 * namespace.cs (UsingAlias): Better error message.
9411 2005-03-03 Dan Winship <danw@novell.com>
9413 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
9414 the warning message [#73219]
9416 2005-03-03 Raja R Harinath <rharinath@novell.com>
9418 Fix compile with MCS 1.0.0.0.
9419 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
9420 w_restore to not depend on string constant folding.
9422 2005-03-03 Raja R Harinath <rharinath@novell.com>
9424 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
9425 CS0246 check to users who passed 'silent = false'.
9426 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
9428 (SimpleName.SimpleNameResolve): Update.
9429 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
9430 (MemberAccess.IdenticalNameAndTypeName): Update.
9431 * doc.cs (FindDocumentedTypeNonArray): Update.
9433 2005-03-03 Raja R Harinath <rharinath@novell.com>
9435 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
9436 * parameters.cs (ComputeAndDefineParameters): Remove.
9437 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
9438 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
9439 Use GetParameterInfo.
9441 2005-03-02 Marek Safar <marek.safar@seznam.cz>
9443 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
9445 2005-03-02 Raja R Harinath <rharinath@novell.com>
9447 Unify DeclSpace.LookupType and DeclSpace.FindType.
9448 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
9449 is in charge of defining nested types on demand.
9450 (DeclSpace.LookupType): Use it when the current_type is a
9451 TypeBuilder. Use LookupTypeDirect for reflected types.
9452 (DeclSpace.FindType): Remove.
9453 (DeclSpace.LookupInterfaceOrClass): Likewise.
9454 (DeclSpace.DefineTypeAndParents): Likewise.
9455 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
9456 DeclSpace.LookupType.
9457 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
9458 * typemanager.cs (LookupType): Simplify.
9459 (AddUserType): Remove type from negative_hits.
9460 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
9461 * class.cs (TypeContainer.FindMembers): Move handling of nested
9463 (TypeContainer.FindMembers_NestedTypes): ... here.
9464 (TypeContainer.FindNestedType): Implement override.
9465 (ClassPart.FindNestedType): Delegate to PartialContainer.
9466 (ClassPart.PartFindNestedType): Looks up the nested types of the
9469 2005-03-02 Martin Baulig <martin@ximian.com>
9471 * class.cs (TypeContainer.DoDefineMembers): We also need a default
9472 static constructor in static classes.
9474 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
9476 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
9477 sizeParamIndex is not specified.
9479 2005-03-01 Marek Safar <marek.safar@seznam.cz>
9482 * report.cs (WarningMessage.IsEnabled): Missing null check.
9484 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9486 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
9487 in the fields and not in the properties.
9489 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
9491 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
9494 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9496 * attribute.cs: Small refactoring (improved robustness).
9497 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
9498 (ValidateGuid): Removed.
9499 (Resolve): Removed referenced to above mentioned.
9500 (GetAttributeUsage): Made private and changed to work without
9502 (GetIndexerAttributeValue): Don't crash.
9503 (GetConditionalAttributeValue): Ditto.
9504 (GetClsCompliantAttributeValue): Ditto.
9505 (ExtractSecurityPermissionSet): All attributes exceptions are
9507 (GetPropertyValue): New helper.
9508 (GetMethodImplOptions): New method.
9509 (DefinePInvokeMethod): Reuse common code. Implemented handling of
9510 some missing properties.
9512 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
9513 (Method.ApplyAttributeBuilder): Updated.
9515 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
9518 2005-02-28 Raja R Harinath <rharinath@novell.com>
9521 * report.cs (Report.SymbolRelatedToPreviousError): Handle
9522 non-simple types (array, pointer, reference).
9524 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9526 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
9528 * class.cs (MethodCore.IsDuplicateImplementation): Special error
9530 (Method.CheckBase): Catch wrong destructor here.
9531 (MethodData.Define): Add errors 550, 668.
9533 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
9535 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
9537 * pending.cs (VerifyPendingMethods): Add error 551.
9539 * typemanager.cs (CSharpName): Next error report helper.
9541 2005-02-25 Marek Safar <marek.safar@seznam.cz>
9543 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
9544 attributes. Removed useless attribute double check.
9545 It saves almost 2MBs for corlib.
9547 2005-02-25 Raja R Harinath <rharinath@novell.com>
9550 * statement.cs (ExpressionStatement.Resolve): Make robust to being
9551 called twice in case of error.
9553 2005-02-23 Chris Toshok <toshok@ximian.com>
9555 Fix compiler portions of #72827.
9556 * statement.cs (Block.Emit): call Begin/EndScope on the
9557 EmitContext instead of the ILGenerator.
9559 * codegen.cs (EmitContext.BeginScope): new method, call
9560 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
9562 (EmitContext.BeginScope): same, but EndScope and CloseScope
9564 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
9565 offset and call the superclass's OpenScope(int) with it.
9566 (SymbolWriter.CloseScope): get the current il
9567 offset and call superclass's CloseScope(int) with it.
9569 2005-02-23 Marek Safar <marek.safar@seznam.cz>
9571 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
9572 CS1677 for out and ref as well.
9574 * class.cs (Method.Define): Add error CS1599 detection.
9576 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
9578 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
9580 * delegate.cs (Delegate.Define): Add error CS1599 detection.
9582 * support.cs.cs (ModifierDesc): New helper method.
9584 2005-02-23 Raja R Harinath <rharinath@novell.com>
9585 Abin Thomas <projectmonokochi@rediffmail.com>
9586 Anoob V E <projectmonokochi@rediffmail.com>
9587 Harilal P R <projectmonokochi@rediffmail.com>
9590 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
9591 MemberLookup (used for error reporting) actually returns a result.
9592 Fix error report number (122, not 112).
9594 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
9595 Anoob V E <projectmonokochi@rediffmail.com>
9596 Harilal P R <projectmonokochi@rediffmail.com>
9599 * pending.cs (PendingImplementation.GetAbstractMethods):
9600 Find NonPublic members too.
9602 2005-02-22 Marek Safar <marek.safar@seznam.cz>
9604 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
9607 * class.cs (MethodCore.CheckMethodAgainstBase):
9608 Add error 239 report.
9610 2005-02-21 Raja R Harinath <rharinath@novell.com>
9613 * expression.cs (Invocation.IsApplicable): Make public.
9614 (Invocation.IsParamsMethodApplicable): Likewise.
9615 * delegate.cs (Delegate.VerifyApplicability): Don't use
9616 Invocation.VerifyArgumentCompat for parameter applicability
9617 testing. Use Invocation.IsApplicable and
9618 Invocation.IsParamsMethodApplicable.
9620 2005-02-21 Marek Safar <marek.safar@seznam.cz>
9622 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
9624 * class.cs (Operator.Define): Add error 217 report.
9626 2005-02-21 Raja R Harinath <rharinath@novell.com>
9628 * namespace.cs (UsingEntry.Resolve): Undo change below.
9630 2005-02-21 Raja R Harinath <rharinath@novell.com>
9633 * ecore.cs (Expression.MemberLookupFailed): Add argument to
9634 disable the error message when the extended MemberLookup also
9636 (Expression.MemberLookupFinal): Update.
9637 (SimpleName.DoSimpleNameResolve): Update.
9638 * expression.cs (MemberAccess.ResolveNamespaceOrType):
9639 Don't use MemberLookupFinal.
9640 (New.DoResolve): Update.
9641 (BaseAccess.CommonResolve): Update.
9643 2005-02-21 Raja R Harinath <rharinath@novell.com>
9646 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
9647 occured previously, don't resolve again.
9649 2005-02-21 Marek Safar <marek.safar@seznam.cz>
9652 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
9653 argument. Call ResolveAttributeUsage for unresolved.
9654 when types doesn't match ctor arguments.
9656 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
9657 for nested attribute classes.
9658 (Class.attribute_usage): Removed.
9659 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
9660 for attribute class.
9662 * ecore.cs (IsAttribute): Removed.
9664 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
9666 * rootcontext.cs (RegisterAttribute): Removed, attributes are
9668 (attribute_types): Removed.
9669 (EmitCode): Global attributes are emited as the latest.
9671 2005-02-18 Marek Safar <marek.safar@seznam.cz>
9673 * class.cs (EmitFieldInitializers): Don't emit field initializer
9674 for default values when optimilization is on.
9676 * constant.cs (Constant.IsDefaultValue): New property.
9678 * driver.cs: Add /optimize handling.
9682 * literal.cs: Implement new IsDefaultValue property.
9684 * rootcontext.cs (Optimize): New field, holds /optimize option.
9686 2005-02-18 Raja R Harinath <rharinath@novell.com>
9688 Fix crasher in re-opened #72347.
9689 * namespace.cs (Namespace.Lookup): Return null if
9690 DeclSpace.DefineType returns null.
9693 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
9695 2005-02-18 Raja R Harinath <rharinath@novell.com>
9697 Fix remainder of #63202. Change semantics of DoResolveLValue: it
9698 now returns null if it cannot resolve to an lvalue.
9699 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
9700 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
9701 returned null. Remove check for SimpleName.
9702 (EventExpr.DoResolveLValue): New.
9703 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
9704 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
9706 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
9708 (Unary.ResolveOperator): Move CS0211 check ...
9709 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
9711 (Unary.DoResolveLValue): Simplify.
9712 (AddressOf.DoResolveLValue): New.
9713 (ArrayAccess.DoResolveLValue): New.
9715 2005-02-16 Marek Safar <marek.safar@seznam.cz>
9717 * attribute.cs (Attribute.Resolve): Add arguments casting for
9718 when types doesn't match ctor arguments.
9720 2005-02-16 Raja R Harinath <rharinath@novell.com>
9722 Fix parts of #63202.
9723 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
9724 lookup of operator in base type. Ensure that all checks happen
9725 when the operator resolves to an "op_..." method.
9727 2005-02-15 Raja R Harinath <rharinath@novell.com>
9730 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
9731 'ignore_cs0104' parameter. Pass it to ...
9732 (NamespaceEntry.Lookup): ... this.
9733 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
9734 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9735 (TypeLookupExpression.DoResolveAsTypeStep): Update.
9736 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
9737 Update. Request that cs0104 errors be ignored.
9738 (ComposedCast.ResolveAsTypeStep): Update.
9740 2005-02-14 Raja R Harinath <rharinath@novell.com>
9743 * expression.cs (Invocation.BetterFunction): Remove support for
9744 comparing virtual functions and their overrides.
9745 (Invocation.IsOverride): New.
9746 (Invocation.OverloadResolve): Don't consider 'override' functions
9747 during candidate selection. Store them in a lookaside list.
9748 If the selected method is a 'virtual' function, use the list to
9749 find any overrides that are closer to the LHS type.
9751 2005-02-14 Marek Safar <marek.safar@seznam.cz>
9753 * expression.cs (New.DoResolve): Add complex core type reduction.
9754 (New.Constantify): Converts complex core type syntax like 'new int ()'
9757 2005-02-14 Raja R Harinath <rharinath@novell.com>
9759 * decl.cs (EntryType.EntryType): New constructor to create an
9760 updated copy of a cache entry.
9761 (MemberCache.AddMethods): Use it.
9762 (MemberCache.ClearDeclaredOnly): Remove.
9763 (MemberCache.MemberCache): Update.
9765 2005-02-11 Miguel de Icaza <miguel@novell.com>
9767 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
9768 variable. This one is represents the actual low-level declaration
9769 of the method, as opposed to the semantic level `IsStatic'.
9771 An anonymous method which is hosted into a static method might be
9772 actually an instance method. IsStatic would reflect the
9773 container, while MethodIsStatic represents the actual code
9776 * expression.cs (ParameterReference): Use the new MethodIsStatic
9777 instead of IsStatic.
9779 * anonymous.cs (AnonymousMethod.Compatible): Pass the
9780 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
9781 set on the current EmitContext.
9783 * expression.cs (Cast): Overload DoResolveLValue so we can pass
9784 resolve our casted expression as an LValue. This triggers the
9785 proper LValue processing that is later required by Assign.
9789 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
9791 2005-02-11 Marek Safar <marek.safar@seznam.cz>
9793 C# 2.0 Fixed buffer implementation
9795 * anonymous.cs: Update after RegisterHelperClass renaming.
9797 * attribute.cs (AttributeTester.fixed_buffer_cache):
9798 Cache of external fixed buffers.
9799 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
9800 implementation if field is fixed buffer else null.
9803 (TypeContainer.AddField): Accept FieldMember instead of Field.
9804 (FieldBase.IsFieldClsCompliant): Extracted code from
9805 VerifyClsCompliance descendant customization.
9806 (FixedField): New class handles fixed buffer fields.
9807 (FixedFieldExternal): Keeps information about imported fixed
9809 (IFixedField): Make access to internal or external fixed buffer
9812 * cs-parser.jay: Add fixed buffer parsing.
9814 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
9817 * expression.cs (Indirection): Extended implementation to accept
9819 (PointerArithmetic.Emit): Get element from fixed buffer as well.
9820 (ElementAccess.MakePointerAccess): Get type as parameter.
9821 (DoResolve): Add fixed buffer field expression conversion.
9822 (DoResolveLValue): Ditto.
9823 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
9824 (ArrayPtr): Derives from FixedBufferPtr.
9825 (ArrayPtr.Emit): Add extra emit for array elements.
9827 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
9829 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
9830 for compiler generated types.
9831 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
9833 * statement.cs (Fixed): Refactored to be easier add fixed buffer
9834 and consume less memory.
9835 (Fixed.Resolve): Add fixed buffer case.
9837 * typemanager.cs (compiler_generated_attr_ctor,
9838 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
9839 (HasElementType): Add our own implementation to work on every
9842 2005-02-11 Miguel de Icaza <miguel@novell.com>
9844 * anonymous.cs (CaptureContext): Track whether `this' has been
9847 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
9848 only captured `this' if it was implicitly done (instance
9849 methods/variables were used).
9851 * codegen.cs (EmitContext.CaptureThis): New method to flag that
9852 `this' must be captured.
9854 2005-01-30 Miguel de Icaza <miguel@novell.com>
9856 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
9857 is null it means that there has been no need to capture anything,
9858 so we just create a sibling.
9860 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
9862 Just a partial fix. The other half is fairly elusive.
9864 2005-02-10 Raja R Harinath <rharinath@novell.com>
9866 Fix #52586, cs0121-4.cs.
9867 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
9868 and return a hashtable.
9869 (MemberCache.ClearDeclaredOnly): New.
9870 (MemberCache.MemberCache): Update to change. Make a deep copy of
9871 the method_hash of a base type too.
9872 (MemberCache.AddMethods): Adapt to having a deep copy of the base
9873 type methods. Overwrite entries with the same MethodHandle so
9874 that the ReflectedType is correct. The process leaves in base
9875 virtual functions and their overrides as distinct entries.
9876 (CacheEntry): Now a class instead of a struct. It shouldn't alter
9877 matters since it was boxed in a ArrayList before.
9878 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
9880 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
9881 case of a virtual function and its override (choose the overload
9883 (Invocation.OverloadResolve): Avoid 'override' members during
9884 'applicable_type' calculation.
9886 2005-02-09 Raja R Harinath <rharinath@novell.com>
9888 Combine two near-redundant caches.
9889 * typemanager.cs (method_params): Rename from method_internal_params.
9890 (TypeManager.GetParameterData): New. Replace
9891 Invocation.GetParameterData.
9892 (TypeManager.LookupParametersByBuilder): Remove.
9893 * expression.cs (Invocation.method_parameter_cache): Remove.
9894 (Invocation.GetParameterData): Remove.
9896 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
9899 2005-02-08 Raja R Harinath <rharinath@novell.com>
9902 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
9903 TypeManager.multicast_delegate_type is null, resolve it by looking
9904 up "System.MulticastDelegate".
9905 * rootcontext.cs (RootContext.ResolveCore): Simplify.
9907 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
9908 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
9909 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
9912 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
9913 (LabeledStatement.AddReference): New. Set 'referenced'.
9914 (Goto.Resolve): Use it.
9916 2005-02-05 John Luke <john.luke@gmail.com>
9918 * driver.cs: remove duplicate -doc line in Usage ()
9920 2005-02-04 Raja R Harinath <rharinath@novell.com>
9922 * location.cs (Location.AddFile): Fix CS2002 error report.
9924 2005-02-02 Martin Baulig <martin@ximian.com>
9926 * delegate.cs (Delegate.DefineType): Report an internal error if
9927 TypeManager.multicast_delegate_type is null. See bug #72015 for
9930 2005-02-02 Raja R Harinath <rharinath@novell.com>
9932 Fix a crasher in a variant of #31984.
9933 * const.cs (Constant.CheckBase): New override that defers the
9934 new-or-override check in case the base type hasn't been populated
9936 (Constant.Define): Ensure the new-or-override check is performed.
9938 2005-02-01 Duncan Mak <duncan@ximian.com>
9940 * const.cs (LookupConstantValue): Check that `ce' is not null
9941 before calling GetValue ().
9943 2005-02-01 Raja R Harinath <rharinath@novell.com>
9945 Fix test-334.cs (#69519).
9946 * cs-parser.jay (using_alias_directive): Pass in an expression to
9947 NamespaceEntry.UsingAlias.
9948 (using_namespace_directive): Pass in an expression to
9949 NamespaceEntry.Using.
9950 (namespace_name): Don't flatten to a string.
9951 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
9952 (NamespaceEntry.AliasEntry.Resolve): Lookup using
9954 (NamespaceEntry.UsingEntry): Likewise.
9955 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
9957 (NamespaceEntry.LookupForUsing): Remove.
9958 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
9960 (NamespaceEntry.Lookup): Remove support for dotted names.
9962 2005-02-01 Raja R Harinath <rharinath@novell.com>
9964 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
9966 (NamespaceEntry.ImplicitParent): Compute on demand.
9967 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
9968 parallels the current.
9969 (NamespaceEntry.LookupForUsing): Use it.
9970 (NamespaceEntry.Lookup): If the current namespace-entry is
9971 implicit, don't search aliases and using tables.
9973 2005-02-01 Raja R Harinath <rharinath@novell.com>
9976 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
9978 (TypeContainer.BaseCache): Compute on demand.
9979 (TypeContainer.FindMembers): Define constants and types if they're
9980 not already created.
9981 (FieldMember.Define): Move resetting of ec.InUnsafe before error
9983 * const.cs (Constant.Define): Make idempotent.
9985 2005-01-29 Miguel de Icaza <miguel@novell.com>
9987 * pending.cs: Produce better code (no nops produced by using Ldarg
9990 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
9991 i - 1' it should be arg + 1.
9995 2005-01-28 Raja R Harinath <rharinath@novell.com>
9997 * attribute.cs (Attribute.CheckAttributeType): Make private
9999 (Attribute.ResolveType): Make virtual.
10000 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
10001 handling of RootContext.Tree.Types.
10003 2005-01-27 Raja R Harinath <rharinath@novell.com>
10005 Update attribute-handling to use the SimpleName/MemberAccess
10007 * cs-parser.jay (attribute): Pass in an expression to the
10008 constructors of Attribute and GlobalAttribute.
10009 * attribute.cs (Attribute): Take an expression for the name.
10010 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
10011 passed in attribute name expression.
10012 (Attribute.CheckAttributeType): Use it.
10013 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
10014 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
10015 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
10016 argument to prevent error messages if the lookup fails.
10018 2005-01-27 Marek Safar <marek.safar@seznam.cz>
10020 * expression.cs (Indirection): Implemented IVariable interface
10021 to support indirection in AddressOf operator.
10022 (PointerArithmetic.Emit): Add optimalization for case where
10023 result can be precomputed.
10025 2005-01-26 Martin Baulig <martin@ximian.com>
10027 * class.cs (TypeContainer.AttributeTargets): Return the correct
10028 AttributeTargets depending on our `Kind' instead of throwing an
10029 exception; fixes #71632.
10031 2005-01-26 Marek Safar <marek.safar@seznam.cz>
10034 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
10037 2005-01-25 Raja R Harinath <rharinath@novell.com>
10040 * expression.cs (MemberAccess.DoResolve): Don't complain with
10041 cs0572 when the LHS of a member access has identical name and type
10044 2005-01-25 Marek Safar <marek.safar@seznam.cz>
10047 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
10049 Create custom PermissionSet only for PermissionSetAttribute.
10051 2005-01-24 Marek Safar <marek.safar@seznam.cz>
10054 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
10055 delegates in static class.
10057 2005-01-24 Martin Baulig <martin@ximian.com>
10059 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10060 merging an implicit block, just use its reachability.
10062 * statement.cs (Block.Resolve): Make the unreachable code check
10063 work wrt. implicit blocks; see test-337 from #63842.
10065 2005-01-21 Alp Toker <alp@atoker.com>
10067 * cs-parser.jay: destructor_declaration's container is PartialContainer
10068 not Class when partial types are used, so use Kind prop instead of
10071 2005-01-22 Miguel de Icaza <miguel@ximian.com>
10073 * cs-parser.jay: Improve error reporting when an interface
10074 declares new types.
10076 2005-01-20 Dick Porter <dick@ximian.com>
10078 * support.cs: SeekableStreamReader fix from Sandor Dobos
10079 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
10080 chars are read. Fixes bug 70369.
10082 2005-01-20 Raja R Harinath <rharinath@novell.com>
10084 * cs-parser.jay (catch_clause): Simplify current_block handling
10087 2005-01-17 Miguel de Icaza <miguel@ximian.com>
10089 * convert.cs (ImplicitStandardConversionExists): Synchronize the
10090 code with ImplicitStandardConversion to handle the implicit
10091 conversion of method groups into valid delegate invocations.
10093 The problem is that in parameter handling we were using this code
10094 path. Fixes bug #64698
10096 2005-01-19 Raja R Harinath <rharinath@novell.com>
10098 * cs-parser.jay: Fix several infelicities.
10099 - Avoid assigning to the parser value stack. Code like
10100 '$3 = null' is unclean. Synthesize a value for the code block
10102 - Avoid using oob_stack for storing location information. Use ...
10103 (_mark_): ... this. New (empty) rule. Saves the current location
10105 (foreach_statement): Avoid using oob_stack for current_block
10106 handling. Use technique used in for_statement and
10107 using_statement. Synthesize a value for the code block to store
10108 additional intermediate information.
10110 2005-01-13 Miguel de Icaza <miguel@ximian.com>
10112 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
10113 of a different type is only allowed to private fields of a
10114 containing type, not on fields of a base class.
10116 See test-174.cs and error cs0122-9.cs
10118 2005-01-13 Raja R Harinath <rharinath@novell.com>
10120 Fix test-335.cs (bug #58126).
10121 * cs-parser.jay (argument): Split out non-expression parts of the
10122 rule into 'non_simple_argument'.
10123 (invocation_expression): Support parenthesized invocations with
10124 multiple arguments, and with single non-simple arguments.
10126 2005-01-13 Raja R Harinath <rharinath@novell.com>
10128 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
10131 2005-01-12 Raja R Harinath <rharinath@novell.com>
10133 Fix cs0038-1.cs, cs1640-6.cs.
10134 * ecore.cs (Expression.Resolve): Remove special-case for
10135 SimpleName in error-handling.
10136 (Expression.almostMatchedMembers): Relax access permission to
10138 (Expression.MemberLookupFailed): Handle duplicates in
10139 almostMatchedMembers list.
10140 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
10141 * expression.cs (New.DoResolve): Report CS1540 for more cases.
10142 * typemanager.cs (GetFullNameSignature): Use the MethodBase
10143 overload if the passed in MemberInfo is a MethodBase.
10145 2005-01-12 Marek Safar <marek.safar@seznam.cz>
10148 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
10149 for non-CAS & merge permission sets properly.
10151 2005-01-11 Raja R Harinath <rharinath@novell.com>
10153 Improve standard-compliance of simple name and member access
10154 resolution. Fixes bugs #52697, #57200, #67520, #69519.
10155 * ecore.cs (FullNamedExpression): New abstract base class
10156 for Namespaces and TypeExpressions.
10157 (ResolveFlags.SimpleName): Remove.
10158 (SimpleName): Remove support for dotted names.
10159 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
10160 DeclSpace.FindType and DeclSpace.LookupType.
10161 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
10162 (Expression.ExprClassName): Make member function.
10163 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
10164 a namespace. Remove creation of dotted "SimpleName"s.
10165 (MemberAccess.DoResolve): Likewise.
10166 * decl.cs (DeclSpace.Cache): Make private.
10167 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
10168 (DeclSpace.FindType): Update.
10169 (DeclSpace.LookupType): Move here from RootContext. Return a
10170 FullNamedExpression.
10171 * namespace.cs (Namespace): Derive from FullNamedExpression
10172 so that it can be part of expression resolution.
10173 (Namespace.Lookup): Return an FullNamedExpression.
10174 (NamespaceEntry.LookupAlias): Lookup aliases only in current
10176 * rootcontext.cs (NamespaceLookup): Remove.
10177 (LookupType): Move to DeclSpace.
10178 * attribute.cs (CheckAttributeType): Update.
10179 * doc.cs (FindDocumentedType): Remove allowAlias argument.
10180 (FindDocumentedTypeNonArray): Likewise.
10182 2005-01-11 Raja R Harinath <rharinath@novell.com>
10184 Fix cs0509.cs, cs1632.cs.
10185 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
10186 is the same as IsInterface.
10187 (TypeContainer.GetClassBases): Likewise.
10188 * statement.cs (LabeledStatement.ig): New field.
10189 (LabeledStatement.LabelTarget): Save ILGenerator which created the
10191 (LabeledStatement.DoEmit): Check that the label was created with
10192 the same ILGenerator.
10194 2005-01-10 Marek Safar <marek.safar@seznam.cz>
10197 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
10198 accessors to its properties.
10200 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
10201 from accessors to property.
10203 2005-01-10 Marek Safar <marek.safar@seznam.cz>
10206 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
10207 only for overrides.
10209 2005-01-08 Miguel de Icaza <miguel@ximian.com>
10211 * attribute.cs: Check for null and empty strings.
10213 I have lost another battle to Paolo.
10215 2005-01-07 Marek Safar <marek.safar@seznam.cz>
10218 * class.cs (PropertyMethod): Set Parent field in ctors.
10219 (SetMethod.InternalParameters): Add unsafe switch hack.
10220 Override MarkForDuplicationCheck where it is appropriate.
10222 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
10223 It says whether container allows members with the same name.
10224 Base default is no.
10225 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
10226 Removed is_method parameter.
10228 2005-01-06 Duncan Mak <duncan@ximian.com>
10230 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
10231 because the previous change led to incorrect reporting of CS1032
10232 ("Cannot define/undefine preprocessor symbols after first token in
10233 file"). Instead of using `tokens_seen' as the only flag that
10234 triggers CS1040, introduce `comments_seen'. This new flag is used
10235 to signify having seen comments on the current line, so it is
10236 unset after a newline.
10238 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
10240 * doc.cs : When searching for a type, find nested type too.
10241 This fixes bug #71040.
10243 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
10246 - Warn missing member comment on those classes which also does not
10247 have doc comments. Fixed bug #71041.
10248 - Don't warn missing doc comment on default constructor.
10251 2005-01-06 Duncan Mak <duncan@ximian.com>
10253 * cs-tokenizer.cs (xtoken): After handling traditional C-style
10254 comments, set `tokens_seen' to true. This allows us to detect
10255 misplaced preprocessor directives (i.e. not at the beginning of
10256 the a line, nor after whitespaces). In that case, report error
10257 CS1040. This fixes bug #56460.
10259 * cs-parser.jay (interface_member_declaration): Add checks for
10260 IsExplicitImpl, and report CS0541 error if an interface member is
10261 defined as an explicit interface declaration.
10263 2005-01-06 Marek Safar <marek.safar@seznam.cz>
10266 * class.cs (PropertyMethod): Set Parent field in ctors.
10267 (SetMethod.InternalParameters): Add unsafe switch hack.
10269 * decl.cs (MemberCore.Parent): Cannot be readonly.
10271 2005-01-06 Raja R Harinath <rharinath@novell.com>
10273 * decl.cs (DeclSpace.ResolveType): Remove.
10274 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
10275 Merge in code from ...
10276 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
10277 * class.cs, enum.cs: Update to changes.
10279 2005-01-06 Miguel de Icaza <miguel@ximian.com>
10281 * anonymous.cs: Ensure that we init the scope of our parent if it
10282 has not been initialized yet.
10284 2004-12-30 Duncan Mak <duncan@ximian.com>
10286 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
10287 if field.FieldBuilder is null. Fixes #70758.
10289 * convert.cs: Fixed some typos and updated some of the comments.
10290 (ImplicitStandardConversionExists):
10291 (TryImplicitIntConversion): If `target_type' is an interface and
10292 the type of `ic' implements this interface, return true or a new
10293 BoxedCast instead of null. This fixes #70468.
10295 2004-12-29 Duncan Mak <duncan@ximian.com>
10297 * expression.cs (Argument.Emit): Check that Expr is
10298 IMemoryLocation before casting to it, and report CS1510 otherwise.
10302 2004-12-21 Ben Maurer <bmaurer@ximian.com>
10304 * statement.cs (Block.ThisVariable): remove the recursion here, to
10305 make the --profile more sane.
10307 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
10309 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
10310 assembly, by JB Evain.
10312 2004-12-17 Raja R Harinath <rharinath@novell.com>
10314 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
10315 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
10316 "parent" refers to enclosing type/class. "base" refers to superclass.
10318 2004-12-17 Raja R Harinath <rharinath@novell.com>
10320 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10321 Ensure that we only have GlobalAttributes.
10322 * attribute.cs (Attribute.Emit): Make non-virtual.
10323 (GlobalAttribute.Emit): Remove.
10324 (Attribute.Resolve): Make virtual.
10325 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
10326 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
10327 the argument. Don't create one.
10328 (Attribute.GetObsoleteAttribute): Likewise.
10329 (Attribute.GetClsCompliantAttributeValue): Likewise.
10330 * class.cs, decl.cs: Update to changes.
10332 2004-12-17 Marek Safar <marek.safar@seznam.cz>
10334 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
10336 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
10338 * statement.cs (Foreach.Resolve): Add error 186 report.
10340 2004-12-16 Marek Safar <marek.safar@seznam.cz>
10342 * expression.cs (Conditional.DoResolve): Add warning 429.
10344 * statement.cs (If.Resolve): Add warning 665.
10346 2004-12-16 Raja R Harinath <rharinath@novell.com>
10348 New invariant: RootContext.Tree.Types.NamespaceEntry == null
10349 except when in the parser, and in GlobalAttribute.
10350 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
10351 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
10352 RootContext.Tree.Types.NamespaceEntry once work is done.
10353 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
10354 and resets RootContext.Tree.Types.NamespaceEntry.
10356 2004-12-15 Marek Safar <marek.safar@seznam.cz>
10358 * cs-parser.jay: Don't create a block for every variable.
10360 2004-12-14 Miguel de Icaza <miguel@ximian.com>
10362 * location.cs: Provide extra information.
10364 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
10365 variables from the captured environment, it is the ldarg_0.
10367 2004-12-14 Marek Safar <marek.safar@seznam.cz>
10369 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
10372 * class.cs: Changed warning level for 169 to avoid developer
10373 displeasure from warning flooding. It will be changed back when they
10374 fix most of current BCL warnings.
10376 * RootContext.cs: Pushed default WarningLevel to 3.
10378 * statement.cs: Removed unused variable.
10380 2004-12-14 Marek Safar <marek.safar@seznam.cz>
10382 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
10383 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
10384 Add error 502 report.
10385 (StaticClass.DefineType): Add error 441 report.
10386 (Class.AllowedModifiersProp): New virtual property as temporary
10387 extension to AllowedModifiers.
10388 (Class.DefineType): Add error 418 report. Moved ModFlags check here
10389 to share implementation with StaticClass and don't call virtual
10392 * driver.cs (MainDriver): Add error 1558 test.
10394 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
10395 report. Moved error 36 test here.
10397 * statement.cs (Throw.Resolve): Add error 724 report.
10399 * typemanager.cs: Add out_attribute_type core type.
10401 2004-12-13 Marek Safar <marek.safar@seznam.cz>
10403 * class.cs (TypeContainer.VerifyClsCompliance): Add error
10405 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
10407 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
10410 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
10412 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
10413 Add error 3023 report.
10414 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
10416 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
10419 2004-12-12 John Luke <john.luke@gmail.com>
10421 * driver.cs (AddArgs): take -- into account when
10422 adding arguments, fixes bug 65710
10424 2004-12-12 Martin Baulig <martin@ximian.com>
10426 * expression.cs (Unary.TryReduceNegative): Added support for
10427 SByteConstant and ByteConstant.
10428 (Unary.Reduce): Check error values from TryReduceNegative().
10430 2004-12-10 Marek Safar <marek.safar@seznam.cz>
10432 * attributes.cs (Attribute.Resolve): Avoid multiple error report
10433 and report exception as error 182.
10435 2004-12-10 Raja R Harinath <rharinath@novell.com>
10437 * driver.cs (Main): Fix message when there are warnings.
10439 2004-12-09 Miguel de Icaza <miguel@ximian.com>
10441 * delegate.cs: Fixed my fix from yesterday, sorry about that.
10443 2004-12-09 Marek Safar <marek.safar@seznam.cz>
10445 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
10446 Reduced number of warnings.
10448 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
10450 2004-12-08 Miguel de Icaza <miguel@ximian.com>
10452 * driver.cs: Removed message.
10454 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
10456 2004-12-08 <vargaz@freemail.hu>
10458 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
10460 2004-12-08 Martin Baulig <martin@ximian.com>
10462 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
10463 instead of a CS3002 for properties and indexer.
10465 2004-12-08 Martin Baulig <martin@ximian.com>
10467 * decl.cs (MemberName.ToString): Make this work again.
10469 2004-12-08 Marek Safar <marek.safar@seznam.cz>
10471 * attribute.cs (Resolve): Add error 591 detection.
10473 * class.cs (FieldMember.Define): Add error 1547 detection.
10474 (Indexer.Define): Add error 620 detection.
10475 (Operator.Define): Add error 590 detection.
10477 * ecore.cs: Missing argument for error 79.
10479 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
10482 2004-12-07 Marek Safar <marek.safar@seznam.cz>
10485 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
10488 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
10490 * cs-parser.jay : handle doc comments on implicit/explicit operators.
10491 Some operator comments were suppressed.
10492 * doc.cs : Implicit/explicit operator name in doc comments are like
10493 "op_Explicit(type)~returnType", so added suffix handling.
10495 2004-12-07 Martin Baulig <martin@ximian.com>
10498 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
10499 (MemberCore.GetClsCompliantAttributeValue): Likewise.
10500 (DeclSpace.ec): New protected field; store the EmitContext here.
10501 (DeclSpace.EmitContext): New public property; moved here from
10503 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
10506 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
10507 (Enum.Emit): Don't create a new EmitContext.
10509 * delegate.cs (Delegate.DefineType): Always create the
10512 * iterators.cs (Iterators.DefineIterator): Create a new
10513 EmitContext and store it in `ec'.
10515 2004-08-24 Martin Baulig <martin@ximian.com>
10518 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
10519 this for accessibility checks.
10520 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
10521 IsNestedFamilyAccessible.
10522 (TypeManager.IsSubclassOf): New method, do what the name actually
10525 2004-12-06 Raja R Harinath <rharinath@novell.com>
10527 Fix crash on cs0657-17.cs.
10528 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10529 Use RootContext.Tree.Types, not 'new RootTypes ()'.
10530 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
10531 the case where the NamespaceEntry gets overwritten.
10533 2004-12-06 Marek Safar <marek.safar@seznam.cz>
10535 Fixed #69195, #56821
10536 * ecore.cs (ResolveBoolean): Tiny refactoring.
10538 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
10539 of right expression resolving when left is false constant and
10540 operator is LogicalAnd OR true constant and operator is LogicalOr.
10542 * statement.cs (ResolveUnreachable): Always reports warning.
10544 2004-12-05 Miguel de Icaza <miguel@ximian.com>
10546 * class.cs: Distinguish between 1721 and 1722 (just a little help
10547 for the programmer).
10549 2004-12-03 Miguel de Icaza <miguel@ximian.com>
10551 * delegate.cs: Only allow this on new versions of the language.
10553 2004-12-02 Duncan Mak <duncan@ximian.com>
10555 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
10557 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
10558 here as a static method. Take an additional bool out parameter
10559 `must_do_cs1540_check' for signaling to InstanceResolve.
10560 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
10561 member field from PropertyExpr class and made it an argument of
10562 the method instead.
10563 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
10564 check for MarshalByRefObject, and report CS0122 instead of CS1540.
10565 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
10566 and `remove_accessor' as well as InstanceResolve: report CS0122
10571 2004-12-03 Raja R Harinath <rharinath@novell.com>
10573 Fix test-327.cs, test-328.cs, and put in early infrastructure
10574 for eventually fixing #52697.
10575 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
10576 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
10577 from other methods.
10578 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
10579 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
10580 (VerifyUsing, error246): Update.
10581 * rootcontext.cs (RootContext.NamespaceLookup): Just use
10582 'NamespaceEntry.LookupNamespaceOrType'.
10584 2004-12-03 Martin Baulig <martin@ximian.com>
10586 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10587 method as our child, call AnonymousMethod.Compatible() on it.
10589 2004-12-03 Raja R Harinath <rharinath@novell.com>
10591 Disable XML documentation support in 'basic' profile.
10592 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
10593 Redirect XmlElement to System.Object.
10594 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
10595 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
10596 * mcs.exe.sources: Add doc-bootstrap.cs.
10597 * doc-bootstrap.cs: New file. Contains empty stub implementation
10600 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
10602 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
10603 comments are allowed.
10605 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10607 * delegate.cs: Add checks for subtypes in paramaters and return values
10608 in VerifyMethod () to add support for Covariance/Contravariance
10611 2004-12-02 Miguel de Icaza <miguel@ximian.com>
10613 * report.cs: Remove extra closing parenthesis.
10615 * convert.cs (Error_CannotImplicitConversion): If the name of the
10616 types are the same, provide some extra information.
10618 * class.cs (FieldBase): Use an unused bit field from the field to
10619 encode the `has_offset' property from the FieldMember. This saves
10620 a couple of Ks on bootstrap compilation.
10622 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10623 method as our child, return the AnonymousMethod resolved
10626 * expression.cs (New.DoResolve): Allow return values from
10627 NewDelegate to also include AnonymousMethods.
10631 2004-12-02 Marek Safar <marek.safar@seznam.cz>
10634 * attribute.cs (Resolve): Improved implementation of params
10635 attribute arguments.
10637 * support.cs (ParameterData): Add HasParams to be faster.
10639 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
10641 all things are for /doc support:
10643 * doc.cs: new file that supports XML documentation generation.
10644 * mcs.exe.sources: added doc.cs.
10646 Handle /doc command line option.
10647 Report error 2006 instead of 5 for missing file name for /doc.
10648 Generate XML documentation when required, after type resolution.
10650 Added support for picking up documentation (/// and /** ... */),
10651 including a new XmlCommentState enumeration.
10653 Added lines to fill Documentation element for field, constant,
10654 property, indexer, method, constructor, destructor, operator, event
10655 and class, struct, interface, delegate, enum.
10656 Added lines to warn incorrect comment.
10658 Added Documentation field (passed only when /doc was specified).
10660 Added DocComment, DocCommentHeader, GenerateDocComment() and
10661 OnGenerateDocComment() and some supporting private members for
10662 /doc feature to MemberCore.
10664 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
10666 Added overriden DocCommentHeader.
10668 Added overriden DocCommentHeader and GenerateDocComment().
10670 2004-12-01 Miguel de Icaza <miguel@ximian.com>
10672 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
10673 unwrapping the enumeration values, chain to
10674 DoConstantNumericPromotions again, so we can promote things to the
10675 fundamental types (takes care of enums that are bytes, sbytes).
10679 2004-12-01 Raja R Harinath <rharinath@novell.com>
10681 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
10682 Fix long-standing bug in type-lookup. Use FindType instead of
10683 LookupType when ec.ResolvingTypeTree.
10684 (Attribute.ResolveType, Attribute.Resolve)
10685 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
10687 (Attributes.Search): Remove internal version. Update.
10688 (Attributes.SearchMulti): Update.
10689 (Attributes.GetClsCompliantAttribute): Remove.
10690 (Attributes.GetIndexerNameAttribute): Remove.
10691 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
10692 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
10693 * class.cs (Indexer.Define): Likewise.
10695 2004-12-01 Marek Safar <marek.safar@seznam.cz>
10698 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
10699 MarshallByReference members access.
10701 * expression.cs: Use CheckMarshallByRefAccess;
10702 Better error CS0197 message.
10704 * report.cs: Print whole related error message.
10706 2004-11-30 Raja R Harinath <rharinath@novell.com>
10708 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
10709 the current directory to help debugging.
10711 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10713 * class (GetClassBases): Better error 60 report.
10714 (EventProperty): Disabled warning 67 detection.
10716 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10719 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
10721 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
10724 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10727 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
10729 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
10731 2004-11-26 Miguel de Icaza <miguel@ximian.com>
10733 * attribute.cs (Attribute.Resolve): Refine error reporting and
10734 report a cs0117 if the identifier does not exist, to distinguish
10735 from 0617 which is a miss-use of the actual identifier.
10737 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
10738 between cs0070 and cs0079.
10740 * class.cs (MemberBase.DoDefine): When reporting a wrong
10741 accessibility level, we use MethodCore to compare instead of
10742 Method (this was a regression in some refactoring effort).
10744 So now we correctly report cs0056 again.
10746 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
10747 testing the target_type (which was known to be object_type) and
10748 not the source type (which is anonymous_method).
10750 Fixed reporting of error cs1660.
10752 * expression.cs (UserCast.Source): Expose the underlying cast.
10754 * statement.cs (Switch.SwitchGoverningType): Sort the list of
10755 allowed types to find a match to int32 first (most common).
10757 In addition, it ignores any ImplicitUserConversions that did an
10758 internal implicit conversion (as the switch statement allows only
10759 one integral conversion to exist).
10761 * class.cs (PartialContainer.Create): rename `name' to
10762 `member_name' for clarity. Then replace the string calls with a
10763 call to MemberName.GetPartialName, as now using
10764 MemberName.ToString is an error (this is due to the side effects
10765 it had, that were fixed in the past).
10767 This will restore the error reporting on a number of partial class
10768 errors that were missusing this (and getting an exception as a
10769 results, which is now just a plain textual warning, because
10770 yyparse debug output would crash otherwise).
10772 2004-11-26 Raja R Harinath <rharinath@novell.com>
10774 * Makefile (PROGRAM_INSTALL_DIR): Remove.
10776 2004-11-25 Ben Maurer <bmaurer@ximian.com>
10778 * rootcontext.cs (LookupType): Make sure to cache lookups that
10779 don't give us a negative result. This saves about 5% of corlib
10782 2004-11-25 Miguel de Icaza <miguel@ximian.com>
10784 * report.cs (AbstractMessage.Print): messages are sent to stderr
10786 * class.cs (TypeContainer.GetClassBases): It is an error to have a
10787 non-interface in the list of interfaces (at this point, either
10788 parent was properly set, or a base class is being listed in the
10789 interfaces section).
10791 This flags error 1722, and resolves the crash from bug 69259.
10793 2004-11-25 Ben Maurer <bmaurer@ximian.com>
10795 * statement.cs (Using.EmitExpressionFinally): make this work right
10796 for valuetypes. Fixes 69926.
10798 2004-11-25 Miguel de Icaza <miguel@ximian.com>
10800 * const.cs (Const.ChangeType): Cope with the "0 literal can be
10801 converted to an enum" here, before we try to change the underlying
10802 type. This code exists, but it is a different code path than the
10803 one used while encoding constants.
10805 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
10806 old bug: when converting from the null literal to a pointer,
10807 return an EmptyCast, not the NullLiteral.
10809 This fixes #69921, the recent null_type changes probably made this
10810 bug more prominent.
10812 (ImplicitReferenceConversionExists): In addition, resynchronized
10813 the code here, so it matches the same code in
10814 ImplicitReferenceConversionExists for the `from any class-type S
10815 to any interface-type T'.
10818 2004-11-25 Marek Safar <marek.safar@seznam.cz>
10820 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
10822 2004-11-24 Miguel de Icaza <miguel@ximian.com>
10824 * cs-parser.jay: Use verbosity accordingly.
10826 2004-11-24 Marek Safar <marek.safar@seznam.cz>
10828 * expression.cs (Unary.ResolveOperator): Do not report warning;
10829 AddressOf reads from variable.
10831 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
10833 2004-11-24 Marek Safar <marek.safar@seznam.cz>
10837 * attribute.cs (Attributable): Removed CheckTargets.
10838 (Attributes.Emit): Explicit attribute targets are tested here.
10840 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
10841 not enabled for interfaces.
10843 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
10844 (GetAssemblyName): Ouch next bug there.
10846 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10848 * expression.cs: Error 275 added.
10850 2004-11-23 Marek Safar <marek.safar@seznam.cz>
10852 Fix bug #69177 (Implemented decimal constant support)
10854 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
10855 (BinaryFold): Add DecimalConstant.
10857 * const.cs (Define): Decimal constant
10859 (ChangeType): Add decimal type handling.
10860 (LookupConstantValue): Don't set value for decimal type but
10861 emit DecimalConstantAttribute. Needed for constant optimization.
10863 * constant.cs (ToDecimal): New method.
10864 (ConvertToDecimal): New method.
10865 (IntConstant): Implemented ConvertToDecimal.
10866 (DecimalConstant.Emit): Emit optimized version for decimals in
10869 * expression.cs (ResolveOperator): Changed order of constant
10870 reduction to work correctly with native types which have
10871 overloaded operators.
10872 (ResolveMemberAccess): Extract constant value from attribute
10875 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
10877 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
10878 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
10879 (ChangeType): Decimal is special.
10880 (TypeToCoreType): Add decimal type.
10882 2004-11-22 Marek Safar <marek.safar@seznam.cz>
10884 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
10887 2004-11-22 Marek Safar <marek.safar@seznam.cz>
10889 * class.cs (EventField.ApplyAttributeBuilder): Fix error
10892 2004-11-19 Marek Safar <marek.safar@seznam.cz>
10894 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
10896 * pending.cs (PendingImplementation): Grab only interfaces.
10898 2004-11-19 Marek Safar <marek.safar@seznam.cz>
10900 * statement.cs (ForeachHelperMethods): Add location member and
10901 error 202 detection.
10903 2004-11-19 Raja R Harinath <rharinath@novell.com>
10905 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
10906 automatically handled by executable.make.
10907 (PROGRAM): Make profile-specific.
10909 2004-11-18 Marek Safar <marek.safar@seznam.cz>
10911 * expression.cs (DoResolveBase): Fixed wrong warning for out
10914 2004-11-18 Martin Baulig <martin@ximian.com>
10916 Merged latest changes into gmcs. Please keep this comment in
10917 here, it makes it easier for me to see what changed in MCS since
10918 the last time I merged.
10920 2004-11-17 Raja R Harinath <rharinath@novell.com>
10922 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
10923 (TypeHandle.GetMemberCache): New.
10924 (TypeHandle.TypeHandle): Update.
10925 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
10926 (TypeManager.LookupParentInterfacesCache):
10927 Rename from LookupInterfaceCache. Optimize slightly.
10928 (TypeManager.MemberLookup_FindMembers): Update.
10929 * decl.cs (MemberCache.MemberCache): Set Container to null in the
10930 multi-type variant.
10931 (AddCacheContents): Rename from AddHashtable.
10932 * class.cs (TypeContainer.parent_container): Remove.
10933 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
10934 (TypeContainer.DoDefineMembers): Don't initialize it.
10935 Update to name changes.
10937 2004-11-17 Miguel de Icaza <miguel@ximian.com>
10939 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
10940 that factors the code to check access modifiers on override.
10942 (PropertyBase): Use the code here.
10944 Patch from Lluis S'anchez, fixes bug #69361.
10946 2004-11-15 Miguel de Icaza <miguel@ximian.com>
10948 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
10949 routine that is used to report the use of a captured variable
10950 whose address has been taken.
10952 There are two checks: one when variables are being captured and
10953 the other check is when the address of a variable is taken.
10955 (because an anonymous methods might be resolved before *or* after
10956 the address has been taken) and
10958 * expression.cs (Conditional.DoResolve): Remove the special
10959 casing that Martin added to trueExpr and falseExpr being both
10960 NullLiteral. We get the right behavior now just by introducing
10961 the null_type into the compiler.
10963 * convert.cs (ExplicitConversion): Change the code to use
10964 null_type instead of testing `expr is NullLiteral'.
10965 (ImplicitConversionStandard): use null_type too.
10966 (ImplicitReferenceConversionExists): use null_type too.
10967 (ImplicitReferenceConversion): use null_type too.
10969 * literal.cs: The type of `NullLiteral' is now null_type instead
10971 (Resolve): Set the type here.
10973 * typemanager.cs: Introduce null_type.
10975 2004-11-17 Martin Baulig <martin@ximian.com>
10977 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
10978 direction, like FindMembers() does. Fixes #69546, testcase is in
10981 2004-11-16 Martin Baulig <martin@ximian.com>
10983 This is based on a patch from Marek Safar, see bug #69082.
10984 Fixes bugs #63705 and #67130.
10986 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
10987 method; create a MemberCache for an interface type and cache the
10990 * decl.cs (IMemberContainer.ParentContainer): Removed.
10991 (IMemberContainer.ParentCache): New property.
10992 (MemberCache.SetupCacheForInterface): Removed.
10993 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
10994 to create a cache for an interface's "parent".
10996 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
10999 2004-11-16 Martin Baulig <martin@ximian.com>
11001 Merged back from gmcs; these changes already went into gmcs a
11002 couple of weeks ago.
11005 (TypeManager.AddUserType): Removed the `ifaces' argument.
11006 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
11008 (TypeManager.AddUserInterface): Removed.
11009 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
11011 (TypeManager.GetInterfaces): Likewise.
11012 (TypeManager.GetExplicitInterfaces): Likewise.
11014 * ecore.cs (TypeExpr.GetInterfaces): Removed.
11016 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
11017 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
11019 2004-11-14 Ben Maurer <bmaurer@ximian.com>
11021 * statement.cs: Avoid adding bools to a hashtable.
11023 2004-11-07 Miguel de Icaza <miguel@ximian.com>
11025 * expression.cs (Invocation.OverloadResolve): Flag error if we are
11026 calling an unsafe method from a safe location.
11028 2004-11-06 Marek Safar <marek.safar@seznam.cz>
11031 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
11033 2004-11-06 Miguel de Icaza <miguel@ximian.com>
11035 * namespace.cs (VerifyUsing): use GetPartialName instead of
11038 2004-11-05 Miguel de Icaza <miguel@ximian.com>
11040 * statement.cs (Return.Resolve): Fix regression in typo: if
11041 `in_exc', we have to request a NeedReturnLabel, this was a typo
11042 introduced in the anonymous method check-in. Fixes #69131.
11044 * Indexers were using the ShortName when defining themselves,
11045 causing a regression in the compiler bootstrap when applying the
11046 patch from 2004-11-02 (first part), now they use their full name
11047 and the bug is gone.
11049 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
11051 * driver.cs: Strip the path from the names of embedded resources. Fixes
11054 2004-11-04 Raja R Harinath <rharinath@novell.com>
11056 Fix error message regression: cs0104-2.cs.
11057 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
11058 (AliasEntry.Resolve): Update.
11059 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
11061 (RootContext.LookupType): Update.
11063 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
11065 * cs-parser.jay: Add support for handling accessor modifiers
11066 * class: Add support port accessor modifiers and error checking,
11067 define PropertyMethod.Define as virtual (not abstract anymore)
11068 * ecore.cs: Add checking for proeprties access with access modifiers
11069 * iterators.cs: Modify Accessor constructor call based in the modified
11071 2004-11-02 Ben Maurer <bmaurer@ximian.com>
11073 * expression.cs (StringConcat): Handle being called twice,
11074 as when we have a concat in a field init with more than two
11077 2004-11-02 Miguel de Icaza <miguel@ximian.com>
11079 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
11080 special case explicit implementations, we should always produce
11081 the .property or .event declaration.
11083 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
11084 since it will not return correct data if people use this
11085 unresolved in the presence of using statements (see test-313).
11087 * class.cs (MethodData.Define): If we are an explicit interface
11088 implementation, set the method name to the full name of the
11089 interface plus the name of the method.
11091 Notice that using the method.MethodName.GetFullName() does not
11092 work, as it will only contain the name as declared on the source
11093 file (it can be a shorthand in the presence of using statements)
11094 and not the fully qualifed type name, for example:
11098 class D : ICloneable {
11099 object ICloneable.Clone () {
11103 Would produce a method called `ICloneable.Clone' instead of
11104 `System.ICloneable.Clone'.
11106 * namespace.cs (Alias.Resolve): Use GetPartialName.
11108 2004-11-01 Marek Safar <marek.safar@seznam.cz>
11110 * cs-parser.jay: Add error 1055 report.
11112 2004-11-01 Miguel de Icaza <miguel@ximian.com>
11114 * assign.cs (Assign.DoResolve): Only do the transform of
11115 assignment into a New if the types are compatible, if not, fall
11116 through and let the implicit code deal with the errors and with
11117 the necessary conversions.
11119 2004-11-01 Marek Safar <marek.safar@seznam.cz>
11121 * cs-parser.jay: Add error 1031 report.
11123 * cs-tokenizer.cs: Add location for error 1038.
11125 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11127 * cs-parser.jay: Add error 1016 report.
11129 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11131 * cs-parser.jay: Add errors 1575,1611 report.
11133 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11135 * cs-parser.jay: Add error 1001 report.
11137 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11140 * attribute.cs (GetMarshal): Add method argument for
11141 caller identification.
11143 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
11144 agument for GetMarshal and RuntimeMissingSupport.
11146 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11148 * attribute.cs (ExtractSecurityPermissionSet): Removed
11149 TypeManager.code_access_permission_type.
11151 * typemanager.cs: Removed TypeManager.code_access_permission_type.
11153 2004-10-27 Miguel de Icaza <miguel@ximian.com>
11155 * expression.cs (LocalVariableReference.DoResolveLValue): Check
11156 for obsolete use of a variable here. Fixes regression on errors
11157 cs0619-25 and cs0619-26.
11159 2004-10-27 Marek Safar <marek.safar@seznam.cz>
11161 Fix #62358, implemented security attribute encoding.
11163 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
11164 Tests permitted SecurityAction for assembly or other types.
11165 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
11166 data from SecurityPermissionAttribute to PermisionSet class.
11168 * class.cs (ApplyAttributeBuilder): Added special handling
11169 for System.Security.Permissions.SecurityAttribute based types.
11171 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
11172 special handling for System.Security.Permissions.SecurityAttribute
11175 * enum.cs (ApplyAttributeBuilder): Added special handling
11176 for System.Security.Permissions.SecurityAttribute based types.
11178 * parameter.cs (ApplyAttributeBuilder): Added special handling
11179 for System.Security.Permissions.SecurityAttribute based types.
11181 * rootcontext.cs: Next 2 core types.
11183 * typemanager.cs (TypeManager.security_permission_attr_type):
11184 Built in type for the SecurityPermission Attribute.
11185 (code_access_permission_type): Build in type.
11187 2004-10-17 Miguel de Icaza <miguel@ximian.com>
11189 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
11190 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
11191 all of this information into
11192 EmitContext.EmitCapturedVariableInstance.
11194 * codegen.cs (EmitCapturedVariableInstance): move here the
11195 funcionality of emitting an ldarg.0 in the presence of a
11196 remapping. This centralizes the instance emit code.
11198 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
11199 then emit a load of this: it means that we have reached the
11200 topmost ScopeInfo: the one that contains the pointer to the
11201 instance of the class hosting the anonymous method.
11203 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
11204 captures to the topmost CaptureContext.
11206 2004-10-12 Miguel de Icaza <miguel@ximian.com>
11208 * expression.cs (LocalVariableReference): Move the knowledge about
11209 the iterators into codegen's EmitCapturedVariableInstance.
11211 2004-10-11 Miguel de Icaza <miguel@ximian.com>
11213 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
11214 all code paths return a value from an anonymous method (it is the
11215 same as the 161 error, but for anonymous methods).
11217 2004-10-08 Miguel de Icaza <miguel@ximian.com>
11219 The introduction of anonymous methods in the compiler changed
11220 various ways of doing things in the compiler. The most
11221 significant one is the hard split between the resolution phase
11222 and the emission phases of the compiler.
11224 For instance, routines that referenced local variables no
11225 longer can safely create temporary variables during the
11226 resolution phase: they must do so from the emission phase,
11227 since the variable might have been "captured", hence access to
11228 it can not be done with the local-variable operations from the runtime.
11232 (Block.Flags): New flag `IsTopLevel' to indicate that this block
11233 is a toplevel block.
11235 (ToplevelBlock): A new kind of Block, these are the blocks that
11236 are created by the parser for all toplevel method bodies. These
11237 include methods, accessors and anonymous methods.
11239 These contain some extra information not found in regular blocks:
11240 A pointer to an optional CaptureContext (for tracking captured
11241 local variables and parameters). A pointer to the parent
11244 (Return.Resolve): Catch missmatches when returning a value from an
11245 anonymous method (error 1662).
11246 Invoke NeedReturnLabel from the Resolve phase instead of the emit
11249 (Break.Resolve): ditto.
11251 (SwitchLabel): instead of defining the labels during the
11252 resolution phase, we now turned the public ILLabel and ILLabelCode
11253 labels into methods called GetILLabelCode() and GetILLabel() that
11254 only define the label during the Emit phase.
11256 (GotoCase): Track the SwitchLabel instead of the computed label
11257 (its contained therein). Emit the code by using
11258 SwitchLabel.GetILLabelCode ().
11260 (LocalInfo.Flags.Captured): A new flag has been introduce to track
11261 whether the Local has been captured or not.
11263 (LocalInfo.IsCaptured): New property, used to tell whether the
11264 local has been captured.
11266 * anonymous.cs: Vastly updated to contain the anonymous method
11269 The main classes here are: CaptureContext which tracks any
11270 captured information for a toplevel block and ScopeInfo used to
11271 track the activation frames for various local variables.
11273 Each toplevel block has an optional capture context associated
11274 with it. When a method contains an anonymous method both the
11275 toplevel method and the anonymous method will create a capture
11276 context. When variables or parameters are captured, they are
11277 recorded on the CaptureContext that owns them, for example:
11281 MyDelegate d = delegate {
11286 Here `a' will be recorded as captured on the toplevel
11287 CapturedContext, the inner captured context will not have anything
11288 (it will only have data if local variables or parameters from it
11289 are captured in a nested anonymous method.
11291 The ScopeInfo is used to track the activation frames for local
11292 variables, for example:
11294 for (int i = 0; i < 10; i++)
11295 for (int j = 0; j < 10; j++){
11296 MyDelegate d = delegate {
11301 At runtime this captures a single captured variable `i', but it
11302 captures 10 different versions of the variable `j'. The variable
11303 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
11304 recorded on a child.
11306 The toplevel ScopeInfo will also track information like the `this'
11307 pointer if instance variables were referenced (this is necessary
11308 as the anonymous method lives inside a nested class in the host
11309 type of the method).
11311 (AnonymousMethod): Expanded to track the Toplevel, implement
11312 `AnonymousMethod.Compatible' to tell whether an anonymous method
11313 can be converted to a target delegate type.
11315 The routine now also produces the anonymous method content
11317 (AnonymousDelegate): A helper class that derives from
11318 DelegateCreation, this is used to generate the code necessary to
11319 produce the delegate for the anonymous method that was created.
11321 * assign.cs: API adjustments for new changes in
11322 Convert.ImplicitStandardConversionExists.
11324 * class.cs: Adjustments to cope with the fact that now toplevel
11325 blocks are of type `ToplevelBlock'.
11327 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
11328 insteda of standard blocks.
11330 Flag errors if params arguments are passed to anonymous methods.
11332 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
11333 `CurrentAnonymousMethod' which points to the current Anonymous
11334 Method. The variable points to the AnonymousMethod class that
11335 holds the code being compiled. It is set in the new EmitContext
11336 created for the anonymous method.
11338 (EmitContext.Phase): Introduce a variable and an enumeration to
11339 assist in enforcing some rules about when and where we are allowed
11340 to invoke certain methods (EmitContext.NeedsReturnLabel is the
11341 only one that enfonces this right now).
11343 (EmitContext.HaveCaptureInfo): new helper method that returns
11344 whether we have a CapturedContext initialized.
11346 (EmitContext.CaptureVariable): New method used to register that a
11347 LocalInfo must be flagged for capturing.
11349 (EmitContext.CapturedParameter): New method used to register that a
11350 parameters must be flagged for capturing.
11352 (EmitContext.CapturedField): New method used to register that a
11353 field must be flagged for capturing.
11355 (EmitContext.HaveCapturedVariables,
11356 EmitContext.HaveCapturedFields): Return whether there are captured
11357 variables or fields.
11359 (EmitContext.EmitMethodHostInstance): This is used to emit the
11360 instance for the anonymous method. The instance might be null
11361 (static methods), this (for anonymous methods that capture nothing
11362 and happen to live side-by-side with the current method body) or a
11363 more complicated expression if the method has a CaptureContext.
11365 (EmitContext.EmitTopBlock): Routine that drives the emission of
11366 code: it will first resolve the top block, then emit any metadata
11367 and then emit the code. The split is done so that we can extract
11368 any anonymous methods and flag any captured variables/parameters.
11370 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
11371 during this phase, the ILGenerator should not be used as labels
11372 and local variables declared here might not be accessible to any
11373 code that is part of an anonymous method.
11375 Exceptions to this include the temporary variables that are
11376 created by some statements internally for holding temporary
11379 (EmitContext.EmitMeta): New routine, in charge of emitting all the
11382 (EmitContext.TemporaryReturn): This method is typically called
11383 from the Emit phase, and its the only place where we allow the
11384 ReturnLabel to be defined other than the EmitMeta. The reason is
11385 that otherwise we would have to duplicate a lot of logic in the
11386 Resolve phases of various methods that today is on the Emit
11389 (EmitContext.NeedReturnLabel): This no longer creates the label,
11390 as the ILGenerator is not valid during the resolve phase.
11392 (EmitContext.EmitThis): Extended the knowledge in this class to
11393 work in anonymous methods in addition to iterators.
11395 (EmitContext.EmitCapturedVariableInstance): This emits whatever
11396 code is necessary on the stack to access the instance to a local
11397 variable (the variable will be accessed as a field).
11399 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
11400 EmitContext.EmitAddressOfParameter): Routines to support
11401 parameters (not completed at this point).
11403 Removals: Removed RemapLocal and RemapLocalLValue. We probably
11404 will also remove the parameters.
11406 * convert.cs (Convert): Define a `ConstantEC' which points to a
11407 null. This is just to prefity some code that uses
11408 ImplicitStandardConversion code and do not have an EmitContext
11411 The idea is to flag explicitly that at that point in time, it is
11412 known that the conversion will not trigger the delegate checking
11413 code in implicit conversions (which requires a valid
11416 Everywhere: pass new EmitContext parameter since
11417 ImplicitStandardConversionExists now requires it to check for
11418 anonymous method conversions.
11420 (Convert.ImplicitStandardConversionExists): If the type of an
11421 expression is the anonymous_method_type, and the type is a
11422 delegate, we invoke the AnonymousMethod.Compatible method to check
11423 whether an implicit conversion is possible.
11425 (Convert.ImplicitConversionStandard): Only do implicit method
11426 group conversions if the language level is not ISO_1.
11428 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
11429 MethodInfo for the Invoke method. used by Delegate and
11432 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
11433 method conversions if the target type is a delegate.
11435 Removed extra debugging nops.
11437 (LocalVariableReference): Turn the `local_info' into a public
11440 Add `prepared' field, the same hack used for FieldExprs to cope
11441 with composed assignments, as Local variables do not necessarily
11442 operate purely on the stack as they used to: they can be captured
11445 Add `temp' for a temporary result, like fields.
11447 Refactor DoResolve and DoResolveLValue into DoResolveBase.
11449 It now copes with Local variables that are captured and emits the
11450 proper instance variable to load it from a field in the captured
11453 (ParameterReference.DoResolveBase): During the resolve phase,
11454 capture parameters if we are in an anonymous method.
11456 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
11457 anonymous method, use the EmitContext helper routines to emit the
11458 parameter reference.
11460 * iterators.cs: Set RemapToProxy to true/false during the
11463 * parameters.cs (GetParameterByName): New helper method.
11465 * typemanager.cs (anonymous_method_type) a new type that
11466 represents an anonyous method. This is always an internal type,
11467 used as a fencepost to test against the anonymous-methodness of an
11470 2004-10-20 Marek Safar <marek.safar@seznam.cz>
11472 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
11474 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
11476 2004-10-18 Martin Baulig <martin@ximian.com>
11478 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
11479 `Type' directly, but call ResolveType() on it.
11480 (Catch.Resolve): Likewise.
11481 (Foreach.Resolve): Likewise.
11483 2004-10-18 Martin Baulig <martin@ximian.com>
11485 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
11486 `Type' directly, but call ResolveType() on it.
11487 (Probe.DoResolve): Likewise.
11488 (ArrayCreation.LookupType): Likewise.
11489 (TypeOf.DoResolve): Likewise.
11490 (SizeOf.DoResolve): Likewise.
11492 2004-10-18 Martin Baulig <martin@ximian.com>
11494 * expression.cs (Invocation.BetterFunction): Put back
11495 TypeManager.TypeToCoreType().
11497 2004-10-18 Raja R Harinath <rharinath@novell.com>
11499 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
11502 2004-10-18 Martin Baulig <martin@ximian.com>
11504 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
11505 `Type' directly, but call ResolveType() on it.
11507 2004-10-18 Martin Baulig <martin@ximian.com>
11509 * class.cs (FieldMember.Define): Don't access the TypeExpr's
11510 `Type' directly, but call ResolveType() on it.
11511 (MemberBase.DoDefine): Likewise.
11513 * expression.cs (New.DoResolve): Don't access the TypeExpr's
11514 `Type' directly, but call ResolveType() on it.
11515 (ComposedCast.DoResolveAsTypeStep): Likewise.
11517 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
11518 `Type' directly, but call ResolveType() on it.
11520 2004-10-17 John Luke <john.luke@gmail.com>
11522 * class.cs (Operator.GetSignatureForError): use CSharpName
11524 * parameter.cs (Parameter.GetSignatureForError): Returns
11525 correct name even if was not defined.
11527 2004-10-13 Raja R Harinath <rharinath@novell.com>
11530 * class.cs (TypeContainer.EmitContext): New property.
11531 (DefineNestedTypes): Create an emitcontext for each part.
11532 (MethodCore.DoDefineParameters): Use container's emitcontext.
11533 Pass type array to InternalParameters.
11534 (MemberBase.DoDefine): Use container's emitcontext.
11535 (FieldMember.Define): Likewise.
11536 (Event.Define): Likewise.
11537 (SetMethod.GetParameterInfo): Change argument to EmitContext.
11538 Pass type array to InternalParameters.
11539 (SetIndexerMethod.GetParameterInfo): Likewise.
11540 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
11541 * delegate.cs (Define): Pass emitcontext to
11542 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
11543 array to InternalParameters.
11544 * expression.cs (ParameterReference.DoResolveBase): Pass
11545 emitcontext to GetParameterInfo.
11546 (ComposedCast.DoResolveAsTypeStep): Remove check on
11547 ec.ResolvingTypeTree.
11548 * parameter.cs (Parameter.Resolve): Change argument to
11549 EmitContext. Use ResolveAsTypeTerminal.
11550 (Parameter.GetSignature): Change argument to EmitContext.
11551 (Parameters.ComputeSignature): Likewise.
11552 (Parameters.ComputeParameterTypes): Likewise.
11553 (Parameters.GetParameterInfo): Likewise.
11554 (Parameters.ComputeAndDefineParameterTypes): Likewise.
11555 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
11556 * support.cs (InternalParameters..ctor): Remove variant that takes
11558 * typemanager.cs (system_intptr_expr): New.
11559 (InitExpressionTypes): Initialize it.
11561 2004-10-12 Chris Toshok <toshok@ximian.com>
11563 * cs-parser.jay: fix location for try_statement and catch_clause.
11565 2004-10-11 Martin Baulig <martin@ximian.com>
11567 * report.cs: Don't make --fatal abort on warnings, we have
11568 -warnaserror for that.
11570 2004-10-07 Raja R Harinath <rharinath@novell.com>
11572 More DeclSpace.ResolveType avoidance.
11573 * decl.cs (MemberCore.InUnsafe): New property.
11574 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
11575 with newly created EmitContext.
11576 (FieldMember.Define): Likewise.
11577 * delegate.cs (Delegate.Define): Likewise.
11578 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
11579 only if normal name-lookup fails.
11580 (TypeExpr.DoResolve): Enable error-checking.
11581 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
11582 (SizeOf.DoResolve): Likewise.
11583 (ComposedCast.DoResolveAsTypeStep): Likewise.
11584 (StackAlloc.DoResolve): Likewise.
11585 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
11586 (Block.Unsafe): New property.
11587 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
11588 (Unsafe): Set 'unsafe' flag of contained block.
11589 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
11590 (Fixed.Resolve): Likewise.
11591 (Catch.Resolve): Likewise.
11592 (Using.ResolveLocalVariableDecls): Likewise.
11593 (Foreach.Resolve): Likewise.
11595 2004-10-05 John Luke <john.luke@gmail.com>
11597 * cs-parser.jay: add location to error CS0175
11599 2004-10-04 Miguel de Icaza <miguel@ximian.com>
11601 * ecore.cs (Expression.Constantity): Add support for turning null
11604 * const.cs (Const.Define): Allow constants to be reference types
11605 as long as the value is Null.
11607 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
11609 * namespace.cs (NamespaceEntry.Using): No matter which warning
11610 level is set, check if this namespace name has already been added.
11612 2004-10-03 Ben Maurer <bmaurer@ximian.com>
11614 * expression.cs: reftype [!=]= null should always use br[true,false].
11617 2004-10-03 Marek Safar <marek.safar@seznam.cz>
11620 * attribute.cs: Enum conversion moved to
11621 GetAttributeArgumentExpression to be applied to the all
11624 2004-10-01 Raja R Harinath <rharinath@novell.com>
11626 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
11627 * class.c (TypeContainer.DefineType): Flag error if
11628 base types aren't accessible due to access permissions.
11629 * decl.cs (DeclSpace.ResolveType): Move logic to
11630 Expression.ResolveAsTypeTerminal.
11631 (DeclSpace.ResolveTypeExpr): Thin layer over
11632 Expression.ResolveAsTypeTerminal.
11633 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
11634 Refactor code into NestedAccess. Use it.
11635 (DeclSpace.NestedAccess): New.
11636 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
11637 argument to silence errors. Check access permissions.
11638 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
11639 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
11640 (Cast.DoResolve): Likewise.
11641 (New.DoResolve): Likewise.
11642 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
11643 (TypeOf.DoResolve): Likewise.
11645 * expression.cs (Invocation.BetterConversion): Return the Type of
11646 the better conversion. Implement section 14.4.2.3 more faithfully.
11647 (Invocation.BetterFunction): Make boolean. Make correspondence to
11648 section 14.4.2.2 explicit.
11649 (Invocation.OverloadResolve): Update.
11650 (Invocation): Remove is_base field.
11651 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
11652 (Invocation.Emit): Likewise.
11654 2004-09-27 Raja R Harinath <rharinath@novell.com>
11656 * README: Update to changes.
11658 2004-09-24 Marek Safar <marek.safar@seznam.cz>
11660 * cs-parser.jay: Reverted 642 warning fix.
11662 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11665 * decl.cs (FindMemberWithSameName): Indexer can have more than
11668 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11670 * expression.cs (LocalVariableReference.DoResolveLValue):
11671 Do not report warning 219 for out values.
11672 (EmptyExpression.Null): New member to avoid extra allocations.
11674 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11676 * cs-parser.jay: Fix wrong warning 642 report.
11678 * cs-tokenizer.cs (CheckNextToken): New helper;
11679 Inspect next character if is same as expected.
11681 2004-09-23 Martin Baulig <martin@ximian.com>
11683 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
11684 (Convert.ImplicitReferenceConversionExists): Likewise.
11686 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11688 * class.cs (Operator.Define): Add error 448 and 559 report.
11690 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11692 * class.cs (MemberBase.IsTypePermitted): New protected
11693 method for checking error CS0610.
11695 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11697 * class.cs (TypeContainer.HasExplicitLayout): New property
11698 Returns whether container has StructLayout attribute set Explicit.
11699 (FieldMember): New abstract class for consts and fields.
11700 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
11701 (Field): Reuse FieldMember.
11703 * const.cs (Const): Reuse FieldMember.
11705 * rootcontext.cs: EmitConstants call moved to class.
11707 2004-09-22 Martin Baulig <martin@ximian.com>
11709 Thanks to Peter Sestoft for this bug report.
11711 * expression.cs (Conditional): If both the `trueExpr' and the
11712 `falseExpr' is a NullLiteral, return a NullLiteral.
11714 2004-09-22 Martin Baulig <martin@ximian.com>
11716 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
11717 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
11718 for the "get_Current" call.
11720 2004-09-22 Martin Baulig <martin@ximian.com>
11722 Marek and me just fixed one of our oldest bugs: #28562 :-)
11724 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
11726 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
11727 we're an EnumConstant, just return that.
11728 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
11729 an EnumConstant. In this case, we need to use GetValueAsEnumType()
11730 to get the value which'll actually be written into the attribute.
11731 However, we have to use GetValue() to access the attribute's value
11734 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11736 * constant.cs (Constant.IsNegative): New abstract property
11739 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
11740 (StackAlloc.DoResolve): Reused IsNegative.
11742 2004-09-21 Martin Baulig <martin@ximian.com>
11744 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
11745 if we're used in an iterator, we may be called from different
11748 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
11749 we actually have an exception block.
11751 2004-09-20 John Luke <jluke@cfl.rr.com>
11753 * class.cs, cs-parser.jay: Improve the error report for 1520:
11754 report the actual line where the error happens, not where the
11755 class was declared.
11757 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
11758 Pass location information that was available elsewhere.
11760 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
11762 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
11763 runtime to delay sign assemblies.
11765 2004-09-19 Miguel de Icaza <miguel@ximian.com>
11767 * cs-parser.jay: Do not report the stack trace, this is barely
11770 2004-08-22 John Luke <john.luke@gmail.com>
11772 * driver.cs : check that a resource id is not already used
11773 before adding it, report CS1508 if it is, bug #63637
11775 2004-09-19 Miguel de Icaza <miguel@ximian.com>
11777 * ecore.cs: Removed dead code.
11779 2004-09-18 Marek Safar <marek.safar@seznam.cz>
11781 * class.cs: Do not report warning CS0067 on the interfaces.
11783 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11785 * cs-parser.jay: Add error 504 report.
11787 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11789 * rootcontext.cs: WarningLevel is 4 by default now.
11791 * statement.cs (Fixed.Resolve): Do not null
11794 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11797 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
11798 deep search when property is not virtual.
11799 (PropertyExpr.ResolveAccessors): Make one call for both
11802 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11805 * statement.cs: Error 152 report constains also location.
11807 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11810 * const.cs: Explicitly set constant as static.
11812 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11815 * cs-parser.jay: Add error 1017 report.
11817 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11819 Fixed bug #59980, #64224
11820 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
11822 * typemanager.cs (IsSpecialMethod): Simplified
11824 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11826 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
11827 condition with better params.
11829 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11832 * attribute.cs (Resolve): Property has to have both
11835 2004-09-14 Martin Baulig <martin@ximian.com>
11837 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
11839 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11842 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
11843 called and is obsolete then this member suppress message
11844 when call is inside next [Obsolete] method or type.
11846 * expression.cs: Use TestObsoleteMethodUsage member.
11848 2004-09-14 Martin Baulig <martin@ximian.com>
11850 * cs-parser.jay: Sync a bit with the GMCS version.
11852 2004-09-14 Martin Baulig <martin@ximian.com>
11854 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
11855 (CSharpParser.yacc_verbose_flag): New public field.
11857 * genericparser.cs: Removed.
11859 2004-09-14 Raja R Harinath <rharinath@novell.com>
11861 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
11863 2004-09-13 Marek Safar <marek.safar@seznam.cz>
11865 * class.cs (MethodCore.CheckBase): Fix bug #65757.
11867 2004-09-10 Martin Baulig <martin@ximian.com>
11869 Backported my MemberName changes from GMCS into MCS.
11871 - we are now using a special `MemberName' class instead of using
11872 strings; in GMCS, the `MemberName' also contains the type
11875 - changed the grammar rules a bit:
11876 * the old `member_name' is now a `namespace_or_type_name':
11877 The rule is that we use `namespace_or_type_name' everywhere
11878 where we expect either a "member name" (GetEnumerator) or a
11879 "member name" with an explicit interface name
11880 (IEnumerable.GetEnumerator).
11881 In GMCS, the explicit interface name may include type arguments
11882 (IEnumerable<T>.GetEnumerator).
11883 * we use `member_name' instead of just `IDENTIFIER' for
11885 The rule is that we use `member_name' wherever a member may
11886 have type parameters in GMCS.
11888 * decl.cs (MemberName): New public class.
11889 (MemberCore.MemberName): New public readonly field.
11890 (MemberCore.ctor): Take a `MemberName' argument, not a string.
11891 (DeclSpace): Likewise.
11893 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
11894 * enum.cs (Enum.ctor): Likewise.
11896 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
11898 (AliasEntry.ctor): Take a MemberName, not an Expression.
11899 (AliasEntry.UsingAlias): Likewise.
11901 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
11902 (IMethodData.MemberName): Changed type from string to MemberName.
11903 (MemberBase.ExplicitInterfaceName): Likewise.
11904 (AbstractPropertyEventMethod.SetupName): Make this private.
11905 (AbstractPropertyEventMethod.ctor): Added `string prefix'
11906 argument; compute the member name here.
11907 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
11908 on the `member.MemberName' and the `prefix'.
11910 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
11912 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
11913 thus, we get a `MemberName' instead of a `string'. These
11914 declarations may have type parameters in GMCS.
11915 (interface_method_declaration, delegate_declaration): Likewise.
11916 (class_declaration, interface_declaration): Likewise.
11917 (method_header): Use `namespace_or_type_name' instead of
11918 `member_name'. We may be an explicit interface implementation.
11919 (property_declaration, event_declaration): Likewise.
11920 (member_name): This is now just an `IDENTIFIER', not a
11921 `namespace_or_type_name'.
11922 (type_name, interface_type): Removed.
11923 (namespace_or_type_name): Return a MemberName, not an Expression.
11924 (primary_expression): Use `member_name' instead of `IDENTIFIER';
11925 call GetTypeExpression() on the MemberName to get an expression.
11926 (IndexerDeclaration.interface_type): Changed type from string to
11928 (MakeName): Operate on MemberName's instead of string's.
11930 2004-09-13 Raja R Harinath <rharinath@novell.com>
11933 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
11934 (NamespaceEntry.Lookup): Add new argument to flag if we want the
11935 lookup to avoid symbols introduced by 'using'.
11936 * rootcontext.cs (NamespaceLookup): Update.
11938 2004-09-12 Marek Safar <marek.safar@seznam.cz>
11940 * class.cs (TypeContainer.DoDefineMembers): Do not call
11941 DefineDefaultConstructor for static classes.
11943 2004-09-12 Marek Safar <marek.safar@seznam.cz>
11945 * attribute.cs (Attribute.Resolve): Add error 653 report.
11947 * class.cs (Class.ApplyAttributeBuilder): Add error 641
11949 (Method.ApplyAttributeBuilder): Add error 685 report.
11950 (Operator.Define): Add error 564 report.
11952 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
11954 * expression.cs (Invocation.DoResolve): Add error
11955 245 and 250 report.
11957 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
11960 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11962 * class.cs (ConstructorInitializer.Resolve):
11963 Wrong error number (515->516).
11965 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11967 * class.cs (Indexer.Define): Add error 631 report.
11969 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11971 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
11973 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11975 * expression.cs (Probe.DoResolve): Add error CS0241 report.
11977 2004-09-10 Marek Safar <marek.safar@seznam.cz>
11979 * cs-parser.jay: Added error CS0241 report.
11981 2004-09-10 Raja R Harinath <rharinath@novell.com>
11983 * cs-parser.jay (fixed_statement): Introduce a scope for the
11984 declaration in the 'fixed' statement.
11986 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11988 * cs-parser.jay: Added CS0230 error report.
11990 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11992 * cs-parser.jay: Added errors CS0231 and CS0257 report.
11994 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11996 * expression.cs (Argument.Resolve): Added error CS0192 and
11999 2004-09-09 Marek Safar <marek.safar@seznam.cz>
12001 C# 2.0 #pragma warning feature
12003 * cs-tokenizer.cs (PreProcessPragma): New method;
12004 Handles #pragma directive.
12006 * report.cs (WarningRegions): New class; Support
12007 class for #pragma warning directive. It tests whether
12008 warning is enabled for a given line.
12010 2004-09-08 Miguel de Icaza <miguel@ximian.com>
12012 * const.cs: Add more descriptive error report, tahnks to
12015 2004-09-08 Marek Safar <marek.safar@seznam.cz>
12017 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
12019 2004-09-07 Miguel de Icaza <miguel@ximian.com>
12021 * expression.cs: Apply patch from Ben: Remove dead code from
12022 ArrayCreation, and remove the TurnintoConstant call in const.cs,
12023 as that code just threw an exception anwyays.
12025 * const.cs: Remove the call to the turnintoconstant, for details
12028 * literal.cs: The type of the null-literal is the null type; So
12029 we use a placeholder type (literal.cs:System.Null, defined here)
12032 * expression.cs (Conditional.DoResolve): Remove some old code that
12033 is no longer needed, conversions have been fixed.
12035 (ArrayCreationExpression.DoResolve): Return false if we fail to
12036 resolve the inner expression.
12038 2004-09-07 Raja R Harinath <rharinath@novell.com>
12041 * cs-parser.jay (delegate_declaration): Record a delegate
12042 declaration as a type declaration.
12043 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
12045 2004-09-06 Miguel de Icaza <miguel@ximian.com>
12047 * parameter.cs: Do not crash if the type can not be resolved.
12049 * expression.cs: Report errors with unsafe pointers, fixes #64896
12051 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
12053 * expression.cs: Pointer arith always needs to do a conv.i
12054 if the operand is a long. fix 65320
12056 2004-09-04 Marek Safar <marek.safar@seznam.cz>
12058 Fixed cs0619-37.cs, cs0619-38.cs
12060 * enum.cs (GetObsoleteAttribute): Removed.
12062 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
12063 on Enum member is double staged. The first is tested member
12066 2004-09-04 Marek Safar <marek.safar@seznam.cz>
12068 Fixed #56986, #63631, #65231
12070 * class.cs: (TypeContainer.AddToMemberContainer): New method,
12071 adds member to name container.
12072 (TypeContainer.AddToTypeContainer): New method, adds type to
12074 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
12075 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
12076 AddOperator): Simplified by reusing AddToMemberContainer.
12077 (TypeContainer.UserDefinedStaticConstructor): Changed to property
12079 (Method.CheckForDuplications): Fixed implementation to test all
12081 (MemberBase): Detection whether member is explicit interface
12082 implementation is now in constructor.
12083 (MemberBase.UpdateMemberName): Handles IndexerName.
12084 (Accessor): Changed to keep also location information.
12085 (AbstractPropertyEventMethod): Is derived from MemberCore.
12086 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
12087 will be emited or not.
12088 (PropertyBase.AreAccessorsDuplicateImplementation):
12089 Tests whether accessors are not in collision with some method.
12090 (Operator): Is derived from MethodCore to simplify common
12093 * decl.cs (Flags.TestMethodDuplication): Test for duplication
12095 (DeclSpace.AddToContainer): Adds the member to defined_names
12096 table. It tests for duplications and enclosing name conflicts.
12098 * enum.cs (EnumMember): Clean up to reuse the base structures
12100 2004-09-03 Martin Baulig <martin@ximian.com>
12102 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
12103 into TypeContainer, to make partial classes work again.
12105 2004-09-03 Martin Baulig <martin@ximian.com>
12107 * rootcontext.cs (RootContext.V2): Removed.
12109 2004-03-23 Martin Baulig <martin@ximian.com>
12111 * expression.cs (Invocation.OverloadResolve): Added `bool
12112 may_fail' argument and use it instead of the Location.IsNull() hack.
12114 2004-09-03 Martin Baulig <martin@ximian.com>
12116 Merged latest changes into gmcs. Please keep this comment in
12117 here, it makes it easier for me to see what changed in MCS since
12118 the last time I merged.
12120 2004-09-03 Raja R Harinath <rharinath@novell.com>
12123 * expression.cs (BetterConversion): Don't allow either conversion
12124 to be null. Remove redundant implicit conversion test when 'q ==
12125 null' -- when this function is invoked, we already know that the
12126 implicit conversion exists.
12127 (BetterFunction): Assume that 'best' is non-null. Remove
12128 redundant reimplementation of IsApplicable when 'best' is null.
12129 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
12130 number of arguments.
12131 (IsAncestralType): Extract from OverloadResolve.
12132 (OverloadResolve): Make robust to the MethodGroupExpr being
12133 unsorted. Implement all the logic of Section 14.5.5.1, and
12134 support overloading of methods from multiple applicable types.
12135 Clean up logic somewhat. Don't pass null methods to BetterFunction.
12137 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
12138 (RealError, Warning): Append type of report to related symbol.
12140 2004-09-03 Marek Safar <marek.safar@seznam.cz>
12142 * enum.cs: Fixed CLS-Compliance checks for enum members.
12143 Error tests cs3008-8.cs, cs3014-8.cs
12145 2004-09-02 Marek Safar <marek.safar@seznam.cz>
12147 Fixed bug #62342, #63102
12148 * class.cs: ImplementIndexer uses member.IsExplicitImpl
12149 like ImplementMethod.
12151 2004-09-02 Marek Safar <marek.safar@seznam.cz>
12153 * attribute.cs (Attribute.GetAttributeArgumentExpression):
12156 2004-09-02 Martin Baulig <martin@ximian.com>
12158 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
12159 TypeManager.GetArgumentTypes() rather than calling GetParameters()
12162 2004-09-01 Marek Safar <marek.safar@seznam.cz>
12164 C# 2.0 Static classes implemented
12166 * class.cs (TypeContainer): instance_constructors,
12167 initialized_fields, initialized_static_fields,
12168 default_constructor, base_inteface_types are protected to be
12169 accessible from StaticClass.
12170 (TypeContainer.DefineDefaultConstructor): New virtual method
12171 for custom default constructor generating
12172 (StaticClass): New class to handle "Static classes" feature.
12174 * cs-parser.jay: Handle static keyword on class like instance
12177 * driver.cs: Added "/langversion" command line switch with two
12178 options (iso-1, default).
12180 2004-08-31 Marek Safar <marek.safar@seznam.cz>
12182 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
12184 2004-08-31 Miguel de Icaza <miguel@ximian.com>
12186 * delegate.cs: Style.
12188 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
12190 * delegate.cs: Add seperate instance expr field for miguel.
12192 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
12194 * PointerArithmetic (Resolve): make sure we are not doing
12195 pointer arith on void*. Also, make sure we are resolved
12196 by not setting eclass until resolve.
12198 All callers: Make sure that PointerArithmetic gets resolved.
12200 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
12202 * ArrayCreation (LookupType): If the type does not resolve
12203 to an array, give an error.
12205 2004-08-27 Marek Safar <marek.safar@seznam.cz>
12207 * statement.cs (Try.Resolve): Fixed bug #64222
12209 2004-08-27 Martin Baulig <martin@ximian.com>
12212 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
12215 2004-08-26 Marek Safar <marek.safar@seznam.cz>
12217 * ecore.cs (Constantify): Get underlying type via
12218 System.Enum.GetUnderlyingType to avoid StackOverflow on the
12219 Windows in special cases.
12221 2004-08-26 Marek Safar <marek.safar@seznam.cz>
12223 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
12224 for obtaining also private methods.
12225 (GetRemoveMethod): Used GetRemoveMethod (true)
12226 for obtaining also private methods.
12228 2004-08-24 Martin Baulig <martin@ximian.com>
12230 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
12231 MethodAttributes.HideBySig for operators.
12233 2004-08-23 Martin Baulig <martin@ximian.com>
12235 Back to the old error reporting system :-)
12237 * report.cs (Message): Removed.
12238 (Report.MessageData, ErrorData, WarningData): Removed.
12239 (Report.Error, Warning): Back to the old system.
12241 2004-08-23 Martin Baulig <martin@ximian.com>
12243 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
12245 * class.cs (TypeContainer.ParentContainer): New public virtual
12246 method; replaces the explicit interface implementation.
12247 (ClassPart.ParentContainer): Override.
12249 2004-08-23 Martin Baulig <martin@ximian.com>
12251 * statement.cs (Switch): Added support for constant switches; see
12252 #59428 or test-285.cs.
12254 2004-08-22 Marek Safar <marek.safar@seznam.cz>
12257 * statement.cs (GetEnumeratorFilter): Removed useless
12258 logic because C# specs is strict. GetEnumerator must be
12261 2004-08-22 Martin Baulig <martin@ximian.com>
12263 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12264 a switch and may break, reset the barrier. Fixes #59867.
12266 2004-08-22 Marek Safar <marek.safar@seznam.cz>
12268 CLS-Compliance speed up (~5% for corlib)
12270 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
12271 New method. Tests container for CLS-Compliant names
12273 * class.cs (TypeContainer.VerifyClsName): New method.
12274 Checks whether container name is CLS Compliant.
12275 (Constructor): Implements IMethodData.
12277 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
12278 low-case table for CLS Compliance test.
12279 (MemberCache.VerifyClsParameterConflict): New method.
12280 Checks method parameters for CS3006 error.
12282 * enum.cs (EnumMember): Is derived from MemberCore.
12283 (Enum.VerifyClsName): Optimized for better performance.
12285 2004-08-06 Marek Safar <marek.safar@seznam.cz>
12287 * report.cs: Renamed Error_T to Error and changed all
12290 2004-08-06 Marek Safar <marek.safar@seznam.cz>
12292 * class.cs (TypeContainer.IndexerArrayList): New inner class
12293 container for indexers.
12294 (TypeContainer.DefaultIndexerName): New constant for default
12295 indexer name. Replaced all "Item" with this constant.
12296 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
12298 * typemanager.cs (TypeManager.default_member_ctor): Cache here
12299 DefaultMemberAttribute constructor.
12301 2004-08-05 Martin Baulig <martin@ximian.com>
12303 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12306 2004-08-05 Marek Safar <marek.safar@seznam.cz>
12308 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
12309 multi platforms problem.
12311 * compiler.csproj: Included shared files.
12313 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12315 Fix bug 60333, 55971 in the more general way
12316 * attribute.cs (Attribute.GetAttributeArgumentExpression):
12317 Added arg_type argument for constant conversion.
12318 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
12320 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12323 * class.cs (TypeContainer ): New inner classes MethodArrayList,
12324 OperatorArrayList, MethodCoreArrayList for typecontainer
12325 containers. Changed class member types to these new types.
12326 (MethodArrayList.DefineMembers): Added test for CS0659.
12328 2004-08-04 Miguel de Icaza <miguel@ximian.com>
12330 * cfold.cs: Synchronize the folding with the code in expression.cs
12331 Binary.DoNumericPromotions for uint operands.
12333 * attribute.cs: Revert patch from Raja, it introduced a regression
12334 while building Blam-1.2.1 (hard to isolate a test case).
12336 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12340 (TypeContainer.Define): Renamed to DefineContainerMembers because of
12342 (MethodCore.parent_method): New member. The method we're overriding
12343 if this is an override method.
12344 (MethodCore.CheckBase): Moved from Method class and made common.
12345 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
12347 (MethodCore.CheckForDuplications): New abstract method. For custom
12348 member duplication search in a container
12349 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
12350 method and its return type.
12351 (Event.conflict_symbol): New member. Symbol with same name in the
12355 (MemberCache.FindMemberWithSameName): New method. The method
12356 is looking for conflict with inherited symbols.
12358 2004-08-04 Martin Baulig <martin@ximian.com>
12360 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
12362 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
12364 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12366 * report.cs (Message): New enum for better error, warning reference in
12368 (MessageData): New inner abstract class. It generally handles printing of
12369 error and warning messages.
12370 Removed unused Error, Warning, Message methods.
12372 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12374 Fix for cs0592-8.cs test
12376 (Attributable.ValidAttributeTargets): Made public.
12377 (Attribute.ExplicitTarget): New member for explicit target value.
12378 (Attribute.CheckTargets): Now we translate explicit attribute
12379 target to Target here.
12381 2004-08-03 Ben Maurer <bmaurer@ximian.com>
12383 * ecore.cs (MethodGroupExpr): new IsBase property.
12385 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
12387 * delegate.cs (DelegateCreation): store a MethodGroupExpr
12388 rather than an instance expr.
12390 (DelegateCreation.Emit): Use the method group rather than
12391 the instance expression. Also, if you have base.Foo as the
12392 method for a delegate, make sure to emit ldftn, not ldftnvirt.
12394 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
12396 (NewDelegate.DoResolve): Only check for the existance of Invoke
12397 if the method is going to be needed. Use MethodGroupExpr.
12399 (NewDelegate.Emit): Remove, DelegateCreation implements this.
12401 * expression.cs: For pointer arith., make sure to use
12402 the size of the type, not the size of the pointer to
12405 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12408 * class.cs (Class): Added error CS0502 test.
12410 2004-08-03 John Luke <jluke@cfl.rr.com>
12411 Raja R Harinath <rharinath@novell.com>
12414 * attribute.cs (Attribute.complained_before): New flag.
12415 (Attribute.ResolveType, Attribute.Resolve),
12416 (Attribute.DefinePInvokeMethod): Set it.
12417 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
12419 2004-08-03 Martin Baulig <martin@ximian.com>
12421 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
12422 use a user-defined operator; we still need to do numeric
12423 promotions in case one argument is a builtin type and the other
12424 one has an implicit conversion to that type. Fixes #62322.
12426 2004-08-02 Martin Baulig <martin@ximian.com>
12428 * statement.cs (LocalInfo.Flags): Added `IsThis'.
12429 (LocalInfo.IsThis): New public property.
12430 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
12432 2004-08-01 Martin Baulig <martin@ximian.com>
12434 * class.cs (TypeContainer.GetClassBases): Don't set the default
12435 here since we may get called from GetPartialBases().
12436 (TypeContainer.DefineType): If GetClassBases() didn't return a
12437 parent, use the default one.
12439 2004-07-30 Duncan Mak <duncan@ximian.com>
12441 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
12443 2004-07-30 Martin Baulig <martin@ximian.com>
12445 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
12447 * class.cs (SourceMethod): New public class, derive from the
12448 symbol writer's ISourceMethod.
12449 (Method): Use the new symbol writer API.
12451 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
12452 as argument and use the new symbol writer.
12455 (SourceFile): Implement the symbol writer's ISourceFile.
12456 (Location.SymbolDocument): Removed.
12457 (Location.SourceFile): New public property.
12459 * symbolwriter.cs: Use the new symbol writer API.
12461 2004-07-30 Raja R Harinath <rharinath@novell.com>
12463 * Makefile (install-local): Remove. Functionality moved to
12466 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
12468 * Makefile: Install mcs.exe.config file together with mcs.exe.
12469 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
12470 correct runtime version.
12472 2004-07-25 Martin Baulig <martin@ximian.com>
12475 (TypeContainer.RegisterOrder): Removed, this was unused.
12476 (TypeContainer, interface_order): Removed.
12477 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
12478 TypeContainer as argument since we can also be called with a
12479 `PartialContainer' for a partial class/struct/interface.
12480 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
12481 of checking whether we're an `Interface' - we could be a
12482 `PartialContainer'.
12483 (PartialContainer.Register): Override; call
12484 AddClass()/AddStruct()/AddInterface() on our parent.
12486 * cs-parser.jay (interface_member_declaration): Add things to the
12487 `current_container', not the `current_class'.
12489 * rootcontext.cs (RegisterOrder): The overloaded version which
12490 takes an `Interface' was unused, removed.
12492 * typemanager.cs (TypeManager.LookupInterface): Return a
12493 `TypeContainer', not an `Interface'.
12494 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
12495 contain a `PartialContainer' for an interface, so check it's
12496 `Kind' to figure out what it is.
12498 2004-07-25 Martin Baulig <martin@ximian.com>
12500 * class.cs (Class.DefaultTypeAttributes): New public constant.
12501 (Struct.DefaultTypeAttributes): Likewise.
12502 (Interface.DefaultTypeAttributes): Likewise.
12503 (PartialContainer.TypeAttr): Override this and add the
12504 DefaultTypeAttributes.
12506 2004-07-25 Martin Baulig <martin@ximian.com>
12508 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
12509 we can just use the `Parent' field instead.
12511 2004-07-25 Martin Baulig <martin@ximian.com>
12513 * class.cs (TypeContainer.Emit): Renamed to EmitType().
12515 2004-07-25 Martin Baulig <martin@ximian.com>
12517 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
12518 our parts before defining any methods.
12519 (TypeContainer.VerifyImplements): Make this virtual.
12520 (ClassPart.VerifyImplements): Override and call VerifyImplements()
12521 on our PartialContainer.
12523 2004-07-25 Martin Baulig <martin@ximian.com>
12525 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
12527 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
12528 argument, we can just use the `Parent' field instead.
12531 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
12532 (MemberBase.DoDefine): Likewise.
12534 2004-07-24 Martin Baulig <martin@ximian.com>
12536 * decl.cs (MemberCore.Parent): New public field.
12537 (DeclSpace.Parent): Moved to MemberCore.
12539 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
12540 (MemberBase.ctor): Added TypeContainer argument, pass it to our
12542 (FieldBase, Field, Operator): Likewise.
12543 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
12544 (EventField, Event): Likewise.
12546 2004-07-23 Martin Baulig <martin@ximian.com>
12548 * class.cs (PartialContainer): New public class.
12549 (ClassPart): New public class.
12550 (TypeContainer): Added support for partial classes.
12551 (TypeContainer.GetClassBases): Splitted some of the functionality
12552 out into GetNormalBases() and GetPartialBases().
12554 * cs-tokenizer.cs (Token.PARTIAL): New token.
12555 (Tokenizer.consume_identifier): Added some hacks to recognize
12556 `partial', but only if it's immediately followed by `class',
12557 `struct' or `interface'.
12559 * cs-parser.jay: Added support for partial clases.
12561 2004-07-23 Martin Baulig <martin@ximian.com>
12563 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
12564 a `DeclSpace' and also made it readonly.
12565 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
12566 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
12567 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
12569 * cs-parser.jay: Pass the `current_class', not the
12570 `current_container' (at the moment, this is still the same thing)
12571 to a new Method, Property, Event, Indexer or Constructor.
12573 2004-07-23 Martin Baulig <martin@ximian.com>
12575 * cs-parser.jay (CSharpParser): Added a new `current_class' field
12576 and removed the `current_interface' one.
12577 (struct_declaration, class_declaration, interface_declaration):
12578 Set `current_class' to the newly created class/struct/interface;
12579 set their `Bases' and call Register() before parsing their body.
12581 2004-07-23 Martin Baulig <martin@ximian.com>
12583 * class.cs (Kind): New public enum.
12584 (TypeContainer): Made this class abstract.
12585 (TypeContainer.Kind): New public readonly field.
12586 (TypeContainer.CheckDef): New public method; moved here from
12588 (TypeContainer.Register): New public abstract method.
12589 (TypeContainer.GetPendingImplementations): New public abstract
12591 (TypeContainer.GetClassBases): Removed the `is_class' and
12592 `is_iface' parameters.
12593 (TypeContainer.DefineNestedTypes): Formerly known as
12595 (ClassOrStruct): Made this class abstract.
12597 * tree.cs (RootTypes): New public type.
12599 2004-07-20 Martin Baulig <martin@ximian.com>
12601 * tree.cs (Tree.RecordNamespace): Removed.
12602 (Tree.Namespaces): Removed.
12604 * rootcontext.cs (RootContext.IsNamespace): Removed.
12606 * cs-parser.jay (namespace_declaration): Just create a new
12607 NamespaceEntry here.
12609 2004-07-20 Martin Baulig <martin@ximian.com>
12611 * statement.cs (ExceptionStatement): New abstract class. This is
12612 now used as a base class for everyone who's using `finally'.
12613 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
12614 our local variables before using them.
12616 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
12617 virtual method. This is used by Yield.Resolve() to "steal" an
12618 outer block's `finally' clauses.
12619 (FlowBranchingException): The .ctor now takes an ExceptionStatement
12622 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
12623 version which takes an ExceptionStatement. This version must be
12624 used to create exception branchings.
12627 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
12628 (Iterator.EmitMoveNext): Added exception support; protect the
12629 block with a `fault' clause, properly handle 'finally' clauses.
12630 (Iterator.EmitDispose): Run all the `finally' clauses here.
12632 2004-07-20 Martin Baulig <martin@ximian.com>
12634 * iterator.cs: This is the first of a set of changes in the
12635 iterator code. Match the spec more closely: if we're an
12636 IEnumerable, then GetEnumerator() must be called. The first time
12637 GetEnumerator() is called, it returns the current instance; all
12638 subsequent invocations (if any) must create a copy.
12640 2004-07-19 Miguel de Icaza <miguel@ximian.com>
12642 * expression.cs: Resolve the constant expression before returning
12645 2004-07-19 Martin Baulig <martin@ximian.com>
12647 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
12648 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
12649 the return type of the new EmitContext.
12651 2004-07-18 Martin Baulig <martin@ximian.com>
12653 * class.cs (Property.Define): Fix iterators.
12655 * iterators.cs (Iterator.Define): Moved the
12656 `container.AddInterator (this)' call here from the .ctor; only do
12657 it if we resolved successfully.
12659 2004-07-17 Miguel de Icaza <miguel@ximian.com>
12661 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
12662 `true' for preprocessing directives that we parse. The return
12663 value indicates whether we should return to regular tokenizing or
12664 not, not whether it was parsed successfully.
12666 In the past if we were in: #if false ... #line #endif, we would
12667 resume parsing after `#line'. See bug 61604.
12669 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
12670 building: IsEnumType should return true only for enums, not for
12671 enums or System.Enum itself. This fixes #61593.
12673 Likely what happened is that corlib was wrong: mcs depended on
12674 this bug in some places. The bug got fixed, we had to add the
12675 hack, which caused bug 61593.
12677 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
12678 that was a workaround for the older conditions.
12680 2004-07-16 Ben Maurer <bmaurer@ximian.com>
12682 * assign.cs: IAssignMethod has a new interface, as documented
12683 inline. All assignment code now uses this new api.
12685 * ecore.cs, expression.cs: All classes which implement
12686 IAssignMethod now use the new interface.
12688 * expression.cs (Invocation): add a hack to EmitCall so that
12689 IndexerAccess can be the target of a compound assignment without
12690 evaluating its arguments twice.
12692 * statement.cs: Handle changes in Invocation api.
12694 2004-07-16 Martin Baulig <martin@ximian.com>
12696 * iterators.cs: Rewrote this. We're now using one single Proxy
12697 class for both the IEnumerable and the IEnumerator interface and
12698 `Iterator' derives from Class so we can use the high-level API.
12700 * class.cs (TypeContainer.AddIterator): New method.
12701 (TypeContainer.DoDefineType): New protected virtual method, which
12702 is called from DefineType().
12703 (TypeContainer.DoDefineMembers): Call DefineType() and
12704 DefineMembers() on all our iterators.
12705 (TypeContainer.Emit): Call Emit() on all our iterators.
12706 (TypeContainer.CloseType): Call CloseType() on all our iterators.
12708 * codegen.cs (EmitContext.CurrentIterator): New public field.
12710 2004-07-15 Martin Baulig <martin@ximian.com>
12713 (TypeManager.not_supported_exception_type): New type.
12715 2004-07-14 Martin Baulig <martin@ximian.com>
12717 * iterators.cs: Use real error numbers.
12719 2004-07-14 Martin Baulig <martin@ximian.com>
12721 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
12722 requires this to be a System.Collection.IEnumerable and not a
12723 class implementing that interface.
12724 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
12726 2004-07-13 Marek Safar <marek.safar@seznam.cz>
12728 * class.cs: Fixed previous fix, it broke some error tests.
12730 2004-07-12 Martin Baulig <martin@ximian.com>
12732 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
12735 2004-07-09 Miguel de Icaza <miguel@ximian.com>
12737 * assign.cs (LocalTemporary): Add new argument: is_address,If
12738 `is_address' is true, then the value that we store is the address
12739 to the real value, and not the value itself.
12741 * ecore.cs (PropertyExpr): use the new local temporary
12742 stuff to allow us to handle X.Y += z (where X is a struct)
12744 2004-07-08 Martin Baulig <martin@ximian.com>
12746 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
12747 not always return, just like we're doing in Using.Resolve().
12749 2004-07-07 Miguel de Icaza <miguel@ximian.com>
12751 * cs-parser.jay (fixed_statement): flag this as Pinned.
12753 2004-07-06 Miguel de Icaza <miguel@ximian.com>
12755 * typemanager.cs (TypeManager): Removed MakePinned method, this
12756 mechanism is replaced with the .NET 2.x compatible mechanism of
12757 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
12759 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
12760 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
12761 `IsFixed' property which has a different meaning.
12763 2004-07-02 Raja R Harinath <rharinath@novell.com>
12765 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
12766 visible from inside a nested class, not just the names of the
12767 immediately enclosing class.
12768 Fix for bug #60730.
12770 2004-06-24 Raja R Harinath <rharinath@novell.com>
12772 * expression.cs (BetterConversion): Remove buggy special-case
12773 handling of "implicit constant expression conversions". At this
12774 point, we already know that the conversion is possible -- we're
12775 only checking to see which is better.
12777 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12779 * cs-parser.jay: Added error CS0210 test.
12781 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12783 * cs-parser.jay: Added error CS0134 test.
12785 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12788 * cs-parser.jay: Added error CS0145 test.
12790 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12792 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
12794 2004-06-23 Ben Maurer <bmaurer@ximian.com>
12796 * expression.cs (StackAlloc.Resolve): The argument may not
12797 be a constant; deal with this case.
12799 2004-06-23 Marek Safar <marek.safar@seznam.cz>
12801 * attribute.cs (IndexerName_GetIndexerName): Renamed to
12802 GetIndexerAttributeValue.
12803 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
12805 * class.cs (Indexer.Define): Added error tests for CS0415,
12808 2004-06-23 Miguel de Icaza <miguel@ximian.com>
12810 * attribute.cs (Attribute.Resolve): Keep field code in sync with
12813 2004-06-23 Martin Baulig <martin@ximian.com>
12815 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
12816 neither return nor throw, reset the barrier as well. Fixes #60457.
12818 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
12820 * class.cs : EventAttributes is now set to None by default.
12821 This fixes bug #60459.
12823 2004-06-18 Marek Safar <marek.safar@seznam.cz>
12826 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12827 Don't throw exception but return null (it's sufficient now).
12829 2004-06-18 Marek Safar <marek.safar@seznam.cz>
12831 * typemanager.cs (GetArgumentTypes): Faster implementation.
12833 2004-06-18 Martin Baulig <martin@ximian.com>
12835 * attribute.cs (Attribute.Resolve): Check whether we're an
12836 EmptyCast which a Constant child. Fixes #60333.
12838 2004-06-17 Ben Maurer <bmaurer@ximian.com>
12840 * statement.cs (EmitCollectionForeach): Account for the fact that
12841 not all valuetypes are in areas which we can take the address of.
12842 For these variables, we store to a temporary variable. Also, make
12843 sure that we dont emit a `callvirt' on a valuetype method.
12845 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12847 * expression.cs (StackAlloc.DoReSolve): Added test for
12848 negative parameter (CS0247).
12850 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12853 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
12855 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12858 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
12861 2004-06-14 Marek Safar <marek.safar@seznam.cz>
12863 Fix bug #58254 & cs1555.cs, cs1556.cs
12864 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
12866 2004-06-14 Marek Safar <marek.safar@seznam.cz>
12868 * cs-parser.jay: Added error CS1669 test for indexers.
12870 2004-06-11 Martin Baulig <martin@ximian.com>
12872 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
12873 call this twice: for params and varargs methods.
12875 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12878 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
12880 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12882 * attribute.cs (Attribute.GetValidTargets): Made public.
12885 (AbstractPropertyEventMethod): New class for better code sharing.
12886 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
12888 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
12890 2004-06-11 Raja R Harinath <rharinath@novell.com>
12893 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
12894 that the call to Resolve is part of a MemberAccess.
12895 (Expression.Resolve): Use it for SimpleName resolution.
12896 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
12897 Add 'intermediate' boolean argument.
12898 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
12899 error message when the SimpleName can be resolved ambiguously
12900 between an expression and a type.
12901 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
12903 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
12904 call on the left-side.
12906 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12909 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
12911 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12913 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
12915 2004-06-11 Martin Baulig <martin@ximian.com>
12917 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
12918 varargs methods if applicable.
12920 2004-06-11 Martin Baulig <martin@ximian.com>
12922 * expression.cs (Invocation.EmitCall): Don't use
12923 `method.CallingConvention == CallingConventions.VarArgs' since the
12924 method could also have `CallingConventions.HasThis'.
12926 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12928 * class.cs (Event.GetSignatureForError): Implemented.
12929 Fixed crash in error test cs3010.cs
12931 2004-06-10 Miguel de Icaza <miguel@ximian.com>
12933 * cs-tokenizer.cs: Change the way we track __arglist to be
12934 consistent with the other keywords.
12936 2004-06-09 Miguel de Icaza <miguel@ximian.com>
12938 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
12941 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
12943 * codegen.cs: Check that all referenced assemblies have a strongname
12944 before strongnaming the compiled assembly. If not report error CS1577.
12945 Fix bug #56563. Patch by Jackson Harper.
12946 * typemanager.cs: Added a method to return all referenced assemblies.
12947 Fix bug #56563. Patch by Jackson Harper.
12949 2004-06-08 Marek Safar <marek.safar@seznam.cz>
12952 (Method.ApplyAttributeBuilder): Moved and added conditional
12953 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
12956 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
12958 2004-06-08 Marek Safar <marek.safar@seznam.cz>
12961 * class.cs: (EventField.attribute_targets): Changed default target.
12963 2004-06-08 Martin Baulig <martin@ximian.com>
12965 * expression.cs (Invocation.EmitCall): Enable varargs methods.
12967 2004-06-08 Martin Baulig <martin@ximian.com>
12969 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
12971 2004-06-07 Martin Baulig <martin@ximian.com>
12973 Added support for varargs methods.
12975 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
12978 * cs-parser.jay: Added support for `__arglist'.
12980 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
12982 * expression.cs (Argument.AType): Added `ArgList'.
12983 (Invocation): Added support for varargs methods.
12984 (ArglistAccess): New public class.
12985 (Arglist): New public class.
12987 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
12989 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
12990 a method's top-level block if the method has varargs.
12992 * support.cs (ReflectionParameters, InternalParameters): Added
12993 support for varargs methods.
12995 2004-06-07 Miguel de Icaza <miguel@ximian.com>
12997 * class.cs: Provide location in indexer error report.
12999 * driver.cs: Use standard names.
13001 * namespace.cs: Catch the use of using after a namespace has been
13002 declared also on using aliases.
13004 2004-06-03 Raja R Harinath <rharinath@novell.com>
13007 * typemanager.cs (closure_private_ok, closure_invocation_type)
13008 (closure_qualifier_type, closure_invocation_assembly)
13009 (FilterWithClosure): Move to ...
13010 (Closure): New internal nested class.
13011 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
13012 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
13013 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
13014 (MemberLookup, MemberLookupFailed): Use it.
13015 * expression.cs (New.DoResolve): Treat the lookup for the
13016 constructor as being qualified by the 'new'ed type.
13017 (Indexers.GetIndexersForTypeOrInterface): Update.
13019 2004-06-03 Marek Safar <marek.safar@seznam.cz>
13022 (GetConditionalAttributeValue): New method. Returns
13023 condition of ConditionalAttribute.
13024 (SearchMulti): New method. Returns all attributes of type 't'.
13025 Use it when attribute is AllowMultiple = true.
13026 (IsConditionalMethodExcluded): New method.
13029 (Method.IsExcluded): Implemented. Returns true if method has conditional
13030 attribute and the conditions is not defined (method is excluded).
13031 (IMethodData): Extended interface for ConditionalAttribute support.
13032 (PropertyMethod.IsExcluded): Implemented.
13035 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
13038 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
13041 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
13043 * expression.cs (ArrayCreationExpression): Make this just an
13044 `expression'. It can't be a statement, so the code here was
13047 2004-06-02 Marek Safar <marek.safar@seznam.cz>
13050 * typemanager.cs (GetFullNameSignature): New method for
13053 2004-06-02 Marek Safar <marek.safar@seznam.cz>
13056 * class.cs (MemberBase.GetSignatureForError): New virtual method.
13057 Use this method when MethodBuilder is null.
13058 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
13059 Added test for error CS0626 (MONO reports error for this situation).
13060 (IMethodData.GetSignatureForError): Extended interface.
13062 2004-06-01 Marek Safar <marek.safar@seznam.cz>
13065 (AttributeTester.GetObsoleteAttribute): Returns instance of
13066 ObsoleteAttribute when type is obsolete.
13069 (TypeContainer.VerifyObsoleteAttribute): Override.
13070 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
13071 (MethodCode.VerifyObsoleteAttribute): Override.
13072 (MemberBase.VerifyObsoleteAttribute): Override.
13075 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
13076 and report proper error.
13079 Delegate.VerifyObsoleteAttribute): Override.
13082 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
13083 and report proper error.
13084 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
13087 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
13091 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
13092 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
13093 Added test for ObsoleteAttribute.
13096 (Catch): Derived from Statement.
13098 2004-06-01 Marek Safar <marek.safar@seznam.cz>
13100 Fixed bug #59071 & cs0160.cs
13102 * statement.cs (Try.Resolve): Check here whether order of catch
13103 clauses matches their dependencies.
13105 2004-05-31 Miguel de Icaza <miguel@ximian.com>
13107 * Reverted patch to namespace.cs (Use lookuptypedirect). This
13108 caused a regression: #59343. Referencing nested classes from an
13109 assembly stopped working.
13111 2004-05-31 Martin Baulig <martin@ximian.com>
13113 MCS is now frozen for beta 2.
13115 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13117 * convert.cs: add a trivial cache for overload operator resolution.
13119 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13121 * decl.cs: If possible, use lookuptypedirect here. We can only do
13122 this if there is no `.' after the namespace. Avoids using
13123 LookupType, which does lots of slow processing.
13124 (FindNestedType) New method, does what it says :-).
13125 * namespace.cs: use LookupTypeDirect.
13126 * rootcontext.cs: use membercache, if possible.
13127 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
13129 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13132 According to the spec,
13134 In a member access of the form E.I, if E is a single identifier,
13135 and if the meaning of E as a simple-name (§7.5.2) is a constant,
13136 field, property, localvariable, or parameter with the same type as
13137 the meaning of E as a type-name (§3.8), then both possible
13138 meanings of E are permitted.
13140 We did not check that E as a simple-name had the same type as E as
13143 This trivial check gives us 5-7% on bootstrap time.
13145 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13147 * expression.cs (Invocation.OverloadResolve): Avoid the
13148 use of hashtables and boxing here by allocating on demand.
13150 2004-05-30 Martin Baulig <martin@ximian.com>
13152 * rootcontext.cs (RootContext.LookupType): Don't cache things if
13153 we're doing a silent lookup. Don't try to lookup nested types in
13154 TypeManager.object_type (thanks to Ben Maurer).
13156 2004-05-30 Martin Baulig <martin@ximian.com>
13158 Committing a patch from Ben Maurer.
13160 * rootcontext.cs (RootContext.LookupType): Cache negative results.
13162 2004-05-29 Martin Baulig <martin@ximian.com>
13164 * class.cs (IMethodData.ShouldIgnore): New method.
13166 * typemanager.cs (TypeManager.MethodFlags): Don't take a
13167 `Location' argument, we don't need it anywhere. Use
13168 `IMethodData.ShouldIgnore ()' instead of
13169 `MethodData.GetMethodFlags ()'.
13170 (TypeManager.AddMethod): Removed.
13171 (TypeManager.AddMethod2): Renamed to AddMethod.
13173 2004-05-29 Martin Baulig <martin@ximian.com>
13175 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
13177 * convert.cs (Convert.ImplicitReferenceConversion): If we're
13178 converting from a class type S to an interface type and we already
13179 have an object on the stack, don't box it again. Fixes #52578.
13181 2004-05-29 Martin Baulig <martin@ximian.com>
13183 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
13184 Added support for `params' parameters. Fixes #59267.
13186 2004-05-29 Martin Baulig <martin@ximian.com>
13188 * literal.cs (NullPointer): Provide a private .ctor which sets
13189 `type' to TypeManager.object_type. Fixes #59048.
13191 2004-05-29 Martin Baulig <martin@ximian.com>
13193 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
13194 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
13196 * ecore.cs (EventExpr.instance_expr): Make the field private.
13198 2004-05-26 Marek Safar <marek.safar@seznam.cz>
13200 Fixed bug #50080 & cs0214-2.cs
13201 * expression.cs (Cast.DoResolve): Check unsafe context here.
13203 * statement.cs (Resolve.DoResolve): Likewise.
13205 2004-05-26 Martin Baulig <martin@ximian.com>
13207 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
13209 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
13210 (RootContext.LookupType): Pass down the `silent' flag.
13212 2004-05-25 Martin Baulig <martin@ximian.com>
13215 (MethodGroupExpr.IdenticalTypeName): New public property.
13216 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
13217 expression actually refers to a type.
13219 2004-05-25 Martin Baulig <martin@ximian.com>
13221 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
13222 for #56176 and made it actually work.
13224 2004-05-25 Martin Baulig <martin@ximian.com>
13226 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
13227 (FieldExpr, PropertyExpr): Override and implement
13228 CacheTemporaries. Fixes #52279.
13230 2004-05-25 Miguel de Icaza <miguel@ximian.com>
13232 * location.cs: In the new compiler listing a file twice is a
13233 warning, not an error.
13235 2004-05-24 Martin Baulig <martin@ximian.com>
13237 * enum.cs (Enum.DefineType): For the `BaseType' to be a
13238 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
13240 2004-05-24 Martin Baulig <martin@ximian.com>
13242 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
13243 walking the `using' list. Fixes #53921.
13245 2004-05-24 Martin Baulig <martin@ximian.com>
13247 * const.cs (Const.LookupConstantValue): Added support for
13248 EmptyCast's; fixes #55251.
13250 2004-05-24 Martin Baulig <martin@ximian.com>
13252 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
13253 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
13254 which does the CS0135 check. The reason is that we first need to
13255 check whether the variable actually exists.
13257 2004-05-24 Martin Baulig <martin@ximian.com>
13259 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
13260 than RootContext.LookupType() to find the explicit interface
13261 type. Fixes #58584.
13263 2004-05-24 Raja R Harinath <rharinath@novell.com>
13265 * Makefile: Simplify. Use executable.make.
13266 * mcs.exe.sources: New file. List of sources of mcs.exe.
13268 2004-05-24 Anders Carlsson <andersca@gnome.org>
13272 Use the invariant culture when doing String.Compare for CLS case
13275 2004-05-23 Martin Baulig <martin@ximian.com>
13277 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
13278 don't have any dots. Fixes #52622, added cs0246-8.cs.
13280 * namespace.cs (NamespaceEntry.Lookup): Likewise.
13282 2004-05-23 Marek Safar <marek.safar@seznam.cz>
13284 * class.cs (MemberBase.Define): Reuse MemberType member for
13285 resolved type. Other methods can use it too.
13287 2004-05-23 Martin Baulig <martin@ximian.com>
13289 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
13290 the variable also exists in the current block (otherwise, we need
13291 to report a CS0103). Fixes #58670.
13293 2004-05-23 Martin Baulig <martin@ximian.com>
13295 * flowanalysis.cs (Reachability.Reachable): Compute this
13296 on-the-fly rather than storing it as a field.
13298 2004-05-23 Martin Baulig <martin@ximian.com>
13300 * flowanalysis.cs (Reachability.And): Manually compute the
13301 resulting `barrier' from the reachability.
13303 2004-05-23 Marek Safar <marek.safar@seznam.cz>
13306 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
13307 instance of ObsoleteAttribute when symbol is obsolete.
13310 (IMethodData): Extended interface for ObsoleteAttribute support.
13312 2004-05-22 Marek Safar <marek.safar@seznam.cz>
13314 * attribute.cs: Fix bug #55970
13316 2004-05-22 Marek Safar <marek.safar@seznam.cz>
13320 (GetObsoleteAttribute): New method. Creates the instance of
13322 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
13323 ObsoleteAttribute when member is obsolete.
13324 (AttributeTester.Report_ObsoleteMessage): Common method for
13325 Obsolete error/warning reporting.
13328 (TypeContainer.base_classs_type): New member for storing parent type.
13331 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
13332 for this MemberCore.
13334 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13336 * attribute.cs, const.cs: Fix bug #58590
13338 2004-05-21 Martin Baulig <martin@ximian.com>
13340 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
13341 out parameters if the end of the method is unreachable. Fixes
13344 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13346 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
13347 Hari was right, why extra method.
13349 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13351 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
13353 2004-05-20 Martin Baulig <martin@ximian.com>
13355 Merged this back from gmcs to keep the differences to a minumum.
13357 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
13358 instead of a Declspace.
13359 (Attribute.ResolveType): Likewise.
13360 (Attributes.Search): Likewise.
13361 (Attributes.Contains): Likewise.
13362 (Attributes.GetClsCompliantAttribute): Likewise.
13364 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
13366 (MethodData.ApplyAttributes): Take an EmitContext instead of a
13369 2004-05-19 Marek Safar <marek.safar@seznam.cz>
13371 Fix bug #58688 (MCS does not report error when the same attribute
13374 * attribute.cs (Attribute.Emit): Distinction between null and default.
13376 2004-05-19 Raja R Harinath <rharinath@novell.com>
13378 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
13379 of a top-level attribute without an attribute target.
13380 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
13382 (Attribute.Conditional_GetConditionName),
13383 (Attribute.Obsolete_GetObsoleteMessage): Update.
13384 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
13385 part of ScanForIndexerName.
13386 (Attribute.CanIgnoreInvalidAttribute): New function.
13387 (Attribute.ScanForIndexerName): Move to ...
13388 (Attributes.ScanForIndexerName): ... here.
13389 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
13390 (Attributes.Search): New internal variant that can choose not to
13391 complain if types aren't resolved. The original signature now
13393 (Attributes.GetClsCompliantAttribute): Use internal variant, with
13394 complaints suppressed.
13395 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
13396 only if it not useful.
13397 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
13398 top-level for attributes that are shared between the assembly
13399 and a top-level class.
13400 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
13401 * class.cs: Update to reflect changes.
13402 (DefineIndexers): Fuse loops.
13403 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
13404 a couple more variants of attribute names.
13406 2004-05-18 Marek Safar <marek.safar@seznam.cz>
13408 Fix bug #52585 (Implemented explicit attribute declaration)
13411 (Attributable.ValidAttributeTargets): New abstract method. It gets
13412 list of valid attribute targets for explicit target declaration.
13413 (Attribute.Target): It holds target itself.
13414 (AttributeSection): Removed.
13415 (Attribute.CheckTargets): New method. It checks whether attribute
13416 target is valid for the current element.
13419 (EventProperty): New class. For events that are declared like
13420 property (with add and remove accessors).
13421 (EventField): New class. For events that are declared like field.
13424 * cs-parser.jay: Implemented explicit attribute target declaration.
13426 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
13427 Override ValidAttributeTargets.
13430 (ReturnParameter): Class for applying custom attributes on
13432 (ParameterAtribute): New class. Class for applying custom
13433 attributes on the parameter type.
13435 2004-05-17 Miguel de Icaza <miguel@ximian.com>
13437 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
13440 (Method): Allow UNSAFE here.
13442 * modifiers.cs: Support unsafe reporting.
13444 2004-05-17 Marek Safar <marek.safar@seznam.cz>
13446 * decl.cs: Fix bug #58478.
13448 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13450 * statement.cs: When checking for unreachable code on an EmptyStatement,
13451 set the location. Fixes bug #58488.
13453 2004-05-13 Miguel de Icaza <miguel@ximian.com>
13455 * driver.cs: Add -pkg handling.
13457 From Gonzalo: UseShelLExecute=false
13459 2004-05-12 Marek Safar <marek.safar@seznam.cz>
13462 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
13464 (Attribute.IsClsCompliaceRequired): Moved to base for better
13466 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
13467 when attribute is AttributeUsageAttribute.
13468 (Attribute.GetValidTargets): Simplified.
13469 (Attribute.GetAttributeUsage): New method returns AttributeUsage
13470 attribute for this type.
13471 (Attribute.ApplyAttributes): Method renamed to Emit and make
13473 (GlobalAttributeSection): New class for special handling of global
13474 attributes (assembly, module).
13475 (AttributeSection.Emit): New method.
13477 * class.cs: Implemented Attributable abstract methods.
13478 (MethodCore.LabelParameters): Moved to Parameter class.
13479 (Accessor): Is back simple class.
13480 (PropertyMethod): Implemented Attributable abstract class.
13481 (DelegateMethod): Implemented Attributable abstract class.
13482 (Event): New constructor for disctintion between normal Event
13483 and Event with accessors.
13485 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
13487 * codegen.cs, const.cs, decl.cs, delegate.cs:
13488 (CommonAssemblyModulClass): Implemented Attributable abstract class
13491 * enum.cs: Implement IAttributeSupport interface.
13492 (EnumMember): New class for emum members. Implemented Attributable
13496 (ParameterBase): Is abstract.
13497 (ReturnParameter): New class for easier [return:] attribute handling.
13499 * typemanager.cs: Removed builder_to_attr.
13501 2004-05-11 Raja R Harinath <rharinath@novell.com>
13504 * attribute.cs (Attribute.GetPositionalValue): New function.
13505 * class.cs (TypeContainer.VerifyMembers): New function.
13506 (TypeContainer.Emit): Use it.
13507 (ClassOrStruct): New base class for Class and Struct.
13508 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
13509 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
13511 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
13512 then each non-static field should have a FieldOffset attribute.
13513 Otherwise, none of the fields should have a FieldOffset attribute.
13514 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
13515 and FieldOffset attributes.
13516 * typemanager.cs (TypeManager.struct_layout_attribute_type)
13517 (TypeManager.field_offset_attribute_type): New core types.
13518 (TypeManager.InitCoreTypes): Initialize them.
13520 2004-05-11 Michal Moskal <malekith@pld-linux.org>
13522 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
13523 Return correct type.
13526 2004-05-09 Miguel de Icaza <miguel@ximian.com>
13528 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
13529 be implicitly converted to ulong.
13531 * expression.cs: The logic for allowing operator &, | and ^ worked
13532 was wrong, it worked before because we did not report an error in
13533 an else branch. Fixes 57895.
13535 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
13536 allow volatile fields to be reference types.
13538 2004-05-07 Miguel de Icaza <miguel@ximian.com>
13540 * driver.cs: Add support for /debug-
13542 2004-05-07 Raja R Harinath <rharinath@novell.com>
13544 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
13545 Add a 'complain' parameter to silence errors.
13546 (Attribute.Resolve): Update to changes. Put in sanity check to catch
13547 silently overlooked type-resolutions.
13548 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
13549 to reflect changes.
13550 (Attributes.Search): New function.
13551 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
13552 (Attributes.GetAttributeFullName): Remove hack.
13553 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
13554 Update to reflect changes.
13555 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13556 Use Attributes.Search instead of nested loops.
13558 2004-05-07 Marek Safar <marek.safar@seznam.cz>
13561 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
13562 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
13563 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
13565 * report.cs: (Report.Warning): Renamed to Warning_T because of
13566 parameter collision.
13568 2004-05-05 Raja R Harinath <rharinath@novell.com>
13570 * expression.cs (MemberAccess.ResolveMemberAccess):
13571 Exit with non-zero status after Report.Error.
13572 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
13574 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
13576 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
13578 * support.cs: Don't hang when the file is empty.
13580 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
13582 * support.cs: In SeekableStreamReader, compute the preamble size of the
13583 underlying stream. Position changes should take into account that initial
13586 2004-05-03 Todd Berman <tberman@sevenl.net>
13588 * driver.cs: remove unused GetSysVersion function.
13590 2004-05-03 Todd Berman <tberman@sevenl.net>
13592 * driver.cs: Remove the hack from saturday, as well as the hack
13593 from jackson (LoadAssemblyFromGac), also adds the CWD to the
13594 link_paths to get that bit proper.
13596 2004-05-01 Todd Berman <tberman@sevenl.net>
13598 * driver.cs: Try a LoadFrom before a Load, this checks the current
13599 path. This is currently a bug in mono that is be fixed, however, this
13600 provides a workaround for now. This will be removed when the bug
13603 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
13605 * CryptoConvert.cs: Updated to latest version. Fix issue with
13606 incomplete key pairs (#57941).
13608 2004-05-01 Todd Berman <tberman@sevenl.net>
13610 * driver.cs: Remove '.' from path_chars, now System.* loads properly
13613 2004-04-30 Jackson Harper <jackson@ximian.com>
13615 * codegen.cs: Open keys readonly.
13617 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13619 * typemanager.cs: don't report cyclic struct layout when a struct
13620 contains 2 or more fields of the same type. Failed for Pango.AttrShape
13621 which has 2 Pango.Rectangle fields.
13623 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
13625 * expression.cs: Handle IntPtr comparisons with IL code
13626 rather than a method call.
13628 2004-04-29 Martin Baulig <martin@ximian.com>
13630 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
13631 the list of PropertyInfo's in class hierarchy and find the
13632 accessor. Fixes #56013.
13634 2004-04-29 Martin Baulig <martin@ximian.com>
13636 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
13638 2004-04-29 Martin Baulig <martin@ximian.com>
13640 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13642 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
13644 2004-04-29 Martin Baulig <martin@ximian.com>
13646 * class.cs (ConstructorInitializer.Resolve): Check whether the
13647 parent .ctor is accessible. Fixes #52146.
13649 2004-04-29 Martin Baulig <martin@ximian.com>
13651 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13653 * statement.cs (Using.EmitLocalVariableDecls): Use
13654 TypeManager.idisposable_type, not typeof (IDisposable).
13655 (Foreach.EmitCollectionForeach): Added support for valuetypes.
13657 2004-04-29 Martin Baulig <martin@ximian.com>
13659 * class.cs (Event.Define): Don't emit the field and don't set
13660 RTSpecialName and SpecialName for events on interfaces. Fixes
13663 2004-04-29 Raja R Harinath <rharinath@novell.com>
13665 Refactor Attribute.ApplyAttributes.
13666 * attribute.cs (Attributable): New base class for objects that can
13667 have Attributes applied on them.
13668 (Attribute): Make AttributeUsage fields public.
13669 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
13670 (Attribute.IsInternalCall): New property.
13671 (Attribute.UsageAttr): Convert to a public read-only property.
13672 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
13673 (Attribute.ResolveType, Attribute.Resolve)
13674 (Attribute.ScanForIndexerName): Update to reflect changes.
13675 (Attribute.CheckAttributeTarget): Re-format.
13676 (Attribute.ApplyAttributes): Refactor, to various
13677 Attributable.ApplyAttributeBuilder methods.
13678 * decl.cs (MemberCore): Make Attributable.
13679 * class.cs (Accessor): Make Attributable.
13680 (MethodData.ApplyAttributes): Use proper attribute types, not
13682 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
13683 (TypeContainer.ApplyAttributeBuilder)
13684 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
13685 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
13686 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
13687 (Operator.ApplyAttributeBuilder): New factored-out methods.
13688 * const.cs (Const.ApplyAttributeBuilder): Likewise.
13689 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
13690 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
13691 * parameter.cs (ParameterBase): New Attributable base class
13692 that can also represent Return types.
13693 (Parameter): Update to the changes.
13695 2004-04-29 Jackson Harper <jackson@ximian.com>
13697 * driver.cs: Prefer the corlib system version when looking for
13698 assemblies in the GAC. This is still a hack, but its a better hack
13701 2004-04-29 Marek Safar <marek.safar@seznam.cz>
13703 * decl.cs, enum.cs: Improved error 3005 reporting.
13705 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
13706 (related_symbols): New private member for list of symbols
13707 related to reported error/warning.
13709 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
13711 2004-04-29 Martin Baulig <martin@ximian.com>
13713 * ecore.cs (Expression.Constantify): If we're an enum and
13714 TypeManager.TypeToCoreType() doesn't give us another type, use
13715 t.UnderlyingSystemType. Fixes #56178.
13717 2004-04-29 Martin Baulig <martin@ximian.com>
13719 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
13720 interfaces and for each interface, only add members directly
13721 declared in that interface. Fixes #53255.
13723 2004-04-28 Martin Baulig <martin@ximian.com>
13725 * expression.cs (ConditionalLogicalOperator): Use a temporary
13726 variable for `left' to avoid that we evaluate it more than once;
13729 2004-04-28 Martin Baulig <martin@ximian.com>
13731 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
13734 2004-04-28 Martin Baulig <martin@ximian.com>
13736 * statement.cs (LocalInfo.Resolve): Check whether the type is not
13739 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
13740 whether the type is not void (CS1547).
13742 2004-04-28 Martin Baulig <martin@ximian.com>
13744 * expression.cs (Unary.DoResolveLValue): Override this and report
13745 CS0131 for anything but Operator.Indirection.
13747 2004-04-28 Martin Baulig <martin@ximian.com>
13749 Committing a patch from Ben Maurer; see bug #50820.
13751 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13754 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13757 2004-04-28 Martin Baulig <martin@ximian.com>
13759 Committing a patch from Ben Maurer; see bug #50820.
13761 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13764 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13767 2004-04-28 Martin Baulig <martin@ximian.com>
13769 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
13770 (Block.AddLabel): Call DoLookupLabel() to only search in the
13773 2004-04-28 Martin Baulig <martin@ximian.com>
13775 * cfold.cs (ConstantFold.BinaryFold): Added special support for
13776 comparing StringConstants and NullLiterals in Equality and Inequality.
13778 2004-04-28 Jackson Harper <jackson@ximian.com>
13780 * driver.cs: Attempt to load referenced assemblies from the
13781 GAC. This is the quick and dirty version of this method that
13782 doesnt take into account versions and just takes the first
13783 canidate found. Will be good enough for now as we will not have more
13784 then one version installed into the GAC until I update this method.
13786 2004-04-28 Martin Baulig <martin@ximian.com>
13788 * typemanager.cs (TypeManager.CheckStructCycles): New public
13789 static method to check for cycles in the struct layout.
13791 * rootcontext.cs (RootContext.PopulateTypes): Call
13792 TypeManager.CheckStructCycles() for each TypeContainer.
13793 [Note: We only need to visit each type once.]
13795 2004-04-28 Martin Baulig <martin@ximian.com>
13797 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
13799 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
13800 success and added `out object value'. Use a `bool resolved' field
13801 to check whether we've already been called rather than
13802 `ConstantValue != null' since this breaks for NullLiterals.
13804 2004-04-28 Raja R Harinath <rharinath@novell.com>
13806 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
13807 setting of this flag, since the 'set' method may be non-public.
13809 2004-04-28 Raja R Harinath <rharinath@novell.com>
13811 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
13812 check on current_vector.Block.
13814 2004-04-27 Martin Baulig <martin@ximian.com>
13816 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
13817 a field initializer. Fixes #56459.
13819 2004-04-27 Martin Baulig <martin@ximian.com>
13821 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
13822 we're not attempting to use an indexer. Fixes #52154.
13824 2004-04-27 Martin Baulig <martin@ximian.com>
13826 * statement.cs (Return): Don't create a return label if we don't
13827 need it; reverts my change from January 20th. Thanks to Ben
13830 2004-04-27 Martin Baulig <martin@ximian.com>
13832 According to the spec, `goto' can only leave a nested scope, but
13835 * statement.cs (Block.LookupLabel): Only lookup in the current
13836 block, don't recurse into parent or child blocks.
13837 (Block.AddLabel): Check in parent and child blocks, report
13838 CS0140/CS0158 if we find a duplicate.
13839 (Block): Removed this indexer for label lookups.
13840 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
13841 this already does the error reporting for us.
13844 (FlowBranching.UsageVector.Block): New public variable; may be null.
13845 (FlowBranching.CreateSibling): Added `Block' argument.
13846 (FlowBranching.LookupLabel): New public virtual method. Lookup a
13847 label for the target of a `goto' and check whether we're not
13848 leaving a `finally'.
13850 2004-04-27 Martin Baulig <martin@ximian.com>
13852 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13853 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
13856 2004-04-27 Martin Baulig <martin@ximian.com>
13858 * statement.cs (Block.AddLabel): Also check for implicit blocks
13859 and added a CS0158 check.
13861 2004-04-27 Martin Baulig <martin@ximian.com>
13863 * flowanalysis.cs (FlowBranchingLoop): New class.
13864 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
13865 UsageVector's instead of an ArrayList.
13866 (FlowBranching.Label): Likewise.
13867 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
13868 (FlowBranching.AddBreakVector): New method.
13870 2004-04-27 Miguel de Icaza <miguel@ximian.com>
13872 * attribute.cs: Small regression fix: only convert the type if we
13873 the type is different, fixes System.Drawing build.
13875 2004-04-27 Martin Baulig <martin@ximian.com>
13877 * attribute.cs (Attribute.Resolve): If we have a constant value
13878 for a named field or property, implicity convert it to the correct
13881 2004-04-27 Raja R Harinath <rharinath@novell.com>
13883 * statement.cs (Block.Block): Implicit blocks share
13884 'child_variable_names' fields with parent blocks.
13885 (Block.AddChildVariableNames): Remove.
13886 (Block.AddVariable): Mark variable as "used by a child block" in
13887 every surrounding block.
13888 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
13889 been used in a child block, complain about violation of "Invariant
13890 meaning in blocks" rule.
13891 * cs-parser.jay (declare_local_variables): Don't use
13892 AddChildVariableNames.
13893 (foreach_statement): Don't create an implicit block: 'foreach'
13894 introduces a scope.
13896 2004-04-23 Miguel de Icaza <miguel@ximian.com>
13898 * convert.cs (ImplicitNumericConversion): 0 is also positive when
13899 converting from 0L to ulong. Fixes 57522.
13901 2004-04-22 Marek Safar <marek.safar@seznam.cz>
13903 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
13904 derived class hides via 'new' keyword field from base class (test-242.cs).
13905 TODO: Handle this in the more general way.
13907 * class.cs (CheckBase): Ditto.
13909 2004-04-22 Marek Safar <marek.safar@seznam.cz>
13911 * decl.cs (caching_flags): New member for storing cached values
13913 (MemberCore.Flags): New enum where bit flags for caching_flags
13915 (MemberCore.cls_compliance): Moved to caching_flags.
13916 (DeclSpace.Created): Moved to caching_flags.
13918 * class.cs: Use caching_flags instead of DeclSpace.Created
13920 2004-04-21 Miguel de Icaza <miguel@ximian.com>
13922 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
13923 if we are only a derived class, not a nested class.
13925 * typemanager.cs: Same as above, but do this at the MemberLookup
13926 level (used by field and methods, properties are handled in
13927 PropertyExpr). Allow for the qualified access if we are a nested
13930 2004-04-21 Marek Safar <marek.safar@seznam.cz>
13932 * class.cs: Refactoring.
13933 (IMethodData): New inteface; Holds links to parent members
13934 to avoid member duplication (reduced memory allocation).
13935 (Method): Implemented IMethodData interface.
13936 (PropertyBase): New inner classes for get/set methods.
13937 (PropertyBase.PropertyMethod): Implemented IMethodData interface
13938 (Event): New inner classes for add/remove methods.
13939 (Event.DelegateMethod): Implemented IMethodData interface.
13941 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
13942 EmitContext (related to class.cs refactoring).
13944 2004-04-21 Raja R Harinath <rharinath@novell.com>
13946 * delegate.cs (Delegate.VerifyApplicability): If the number of
13947 arguments are the same as the number of parameters, first try to
13948 verify applicability ignoring any 'params' modifier on the last
13952 2004-04-16 Raja R Harinath <rharinath@novell.com>
13954 * class.cs (TypeContainer.AddIndexer): Use
13955 'ExplicitInterfaceName' to determine if interface name was
13956 explicitly specified. 'InterfaceType' is not initialized at this time.
13957 (TypeContainer.DefineIndexers): Remove use of temporary list. The
13958 Indexers array is already in the required order. Initialize
13959 'IndexerName' only if there are normal indexers.
13960 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
13961 (TypeContainer.Emit): Emit DefaultMember attribute only if
13962 IndexerName is initialized.
13965 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
13967 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
13970 2004-04-15 Raja R Harinath <rharinath@novell.com>
13972 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
13976 * attribute.cs (Attribute.Resolve): Check for duplicate named
13980 2004-04-15 Miguel de Icaza <miguel@ximian.com>
13982 * iterators.cs (MarkYield): track whether we are in an exception,
13983 and generate code accordingly. Use a temporary value to store the
13984 result for our state.
13986 I had ignored a bit the interaction of try/catch with iterators
13987 since their behavior was not entirely obvious, but now it is
13988 possible to verify that our behavior is the same as MS .NET 2.0
13992 2004-04-14 Miguel de Icaza <miguel@ximian.com>
13994 * iterators.cs: Avoid creating temporaries if there is no work to
13997 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
13998 Enumerations, use TypeManager.EnumToUnderlying and call
14001 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
14004 (This.Emit): Use EmitContext.EmitThis to emit our
14007 (This.EmitAssign): Ditto.
14009 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
14010 codepaths, we will move all the functionality into
14013 (FieldExpr.EmitAssign): Ditto.
14015 This fixes several hidden bugs that I uncovered while doing a code
14016 review of this today.
14018 * codegen.cs (EmitThis): reworked so the semantics are more clear
14019 and also support value types "this" instances.
14021 * iterators.cs: Changed so that for iterators in value types, we
14022 do not pass the value type as a parameter.
14024 Initialization of the enumerator helpers is now done in the caller
14025 instead of passing the parameters to the constructors and having
14026 the constructor set the fields.
14028 The fields have now `assembly' visibility instead of private.
14030 2004-04-11 Miguel de Icaza <miguel@ximian.com>
14032 * expression.cs (Argument.Resolve): Check if fields passed as ref
14033 or out are contained in a MarshalByRefObject.
14035 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
14036 another compiler type.
14038 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
14040 * class.cs (Indexer.Define): use the new name checking method.
14041 Also, return false on an error.
14042 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
14043 (is_identifier_[start/part]_character): make static.
14045 2004-04-10 Miguel de Icaza <miguel@ximian.com>
14047 * expression.cs (Binary.ResolveOperator): Do no append strings
14048 twice: since we can be invoked more than once (array evaluation)
14049 on the same concatenation, take care of this here. Based on a fix
14050 from Ben (bug #56454)
14052 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
14054 * codegen.cs: Fix another case where CS1548 must be reported (when
14055 delay-sign isn't specified and no private is available #56564). Fix
14056 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
14057 error when MCS is used on the MS runtime and we need to delay-sign
14058 (which seems unsupported by AssemblyBuilder - see #56621).
14060 2004-04-08 Marek Safar <marek.safar@seznam.cz>
14062 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
14063 (TypeManager.ComputeNamespaces): Faster implementation for
14066 * compiler.csproj: Updated AssemblyName to mcs.
14068 2004-04-07 Miguel de Icaza <miguel@ximian.com>
14070 * rootcontext.cs: Add new types to the boot resolution.
14072 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
14073 MulticastDelegate is not allowed.
14075 * typemanager.cs: Add new types to lookup: System.TypedReference
14078 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
14079 check for TypedReference or ArgIterator, they are not allowed.
14081 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
14082 makes us properly catch 1510 in some conditions (see bug 56016 for
14085 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
14087 * CryptoConvert.cs: update from corlib version
14090 2004-04-05 Miguel de Icaza <miguel@ximian.com>
14092 * class.cs (Indexer.Define): Check indexername declaration
14094 2004-04-05 Marek Safar <marek.safar@seznam.cz>
14096 * attribute.cs (IsClsCompliant): Fixed problem with handling
14097 all three states (compliant, not-compliant, undetected).
14099 2004-03-30 Marek Safar <marek.safar@seznam.cz>
14101 * attribute.cs (Attribute): Location is now public.
14102 (Resolve): Store resolved arguments (pos_values) in attribute class.
14103 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
14104 (GetClsCompliantAttributeValue): New method that gets
14105 CLSCompliantAttribute value.
14106 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
14107 if exists else null.
14108 (AttributeTester): New class for CLS-Compliant verification routines.
14110 * class.cs (Emit): Add CLS-Compliant verification.
14111 (Method.GetSignatureForError): Implemented.
14112 (Constructor.GetSignatureForError): Implemented
14113 (Constructor.HasCompliantArgs): Returns if constructor has
14114 CLS-Compliant arguments.
14115 (Constructor.Emit): Override.
14116 (Construcor.IsIdentifierClsCompliant): New method; For constructors
14117 is needed to test only parameters.
14118 (FieldBase.GetSignatureForError): Implemented.
14119 (TypeContainer): New member for storing base interfaces.
14120 (TypeContainer.FindMembers): Search in base interfaces too.
14122 * codegen.cs (GetClsComplianceAttribute): New method that gets
14123 assembly or module CLSCompliantAttribute value.
14124 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
14126 (ModuleClass.Emit): Add error 3012 test.
14128 * const.cs (Emit): Override and call base for CLS-Compliant tests.
14130 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
14131 state for all decl types.
14132 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
14133 if CLS-Compliant tests are required.
14134 (IsClsCompliaceRequired): New method. Analyze whether code
14135 must be CLS-Compliant.
14136 (IsExposedFromAssembly): New method. Returns true when MemberCore
14137 is exposed from assembly.
14138 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
14139 value or gets cached value.
14140 (HasClsCompliantAttribute): New method. Returns true if MemberCore
14141 is explicitly marked with CLSCompliantAttribute.
14142 (IsIdentifierClsCompliant): New abstract method. This method is
14143 used to testing error 3005.
14144 (IsIdentifierAndParamClsCompliant): New method. Common helper method
14145 for identifier and parameters CLS-Compliant testing.
14146 (VerifyClsCompliance): New method. The main virtual method for
14147 CLS-Compliant verifications.
14148 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
14149 null. I don't know why is null (too many public members !).
14150 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
14151 and get value of first CLSCompliantAttribute that found.
14153 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
14154 (VerifyClsCompliance): Override and add extra tests.
14156 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
14157 clscheck- disable CLS-Compliant verification event if assembly is has
14158 CLSCompliantAttribute(true).
14160 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
14161 ApllyAttribute is now called in emit section as in the other cases.
14162 Possible future Emit integration.
14163 (IsIdentifierClsCompliant): New override.
14164 (VerifyClsCompliance): New override.
14165 (GetEnumeratorName): Returns full enum name.
14167 * parameter.cs (GetSignatureForError): Implemented.
14169 * report.cs (WarningData): New struct for Warning message information.
14170 (LocationOfPreviousError): New method.
14171 (Warning): New method. Reports warning based on the warning table.
14172 (Error_T): New method. Reports error based on the error table.
14174 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
14175 verifications are done here.
14177 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
14179 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
14180 CLSCompliantAttribute.
14181 (all_imported_types): New member holds all imported types from other
14183 (LoadAllImportedTypes): New method fills static table with exported types
14184 from all referenced assemblies.
14185 (Modules): New property returns all assembly modules.
14187 2004-03-30 Miguel de Icaza <miguel@ximian.com>
14189 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
14190 throwing a parser error.
14192 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
14193 which removes the hardcoded get_/set_ prefixes for properties, as
14194 IL allows for the properties to be named something else.
14198 * expression.cs: Do not override operand before we know if it is
14199 non-null. Fix 56207
14201 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14203 * typemanager.cs: support for pinned variables.
14205 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14207 * decl.cs, typemanager.cs: Avoid using an arraylist
14208 as a buffer if there is only one result set.
14210 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14212 * expression.cs: Make sure you cant call a static method
14213 with an instance expression, bug #56174.
14215 2004-03-29 Miguel de Icaza <miguel@ximian.com>
14217 * class.cs (IsDuplicateImplementation): Improve error reporting to
14218 flag 663 (method only differs in parameter modifier).
14220 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
14221 in preprocessor directives.
14223 * location.cs (LookupFile): Allow for the empty path.
14225 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
14226 better approach for some of that patch, but its failing with the
14227 CharSet enumeration. For now try/catch will do.
14229 * typemanager.cs: Do not crash if a struct does not have fields.
14232 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14234 * expression.cs: cs0213, cant fix a fixed expression.
14237 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14239 * cs-parser.jay: detect invalid embeded statements gracefully.
14242 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14244 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
14247 the invocation type may not be a subclass of the tye of the item/
14248 The type of the item must be a subclass of the invocation item.
14253 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
14255 * attribute.cs: Added methods to get a string and a bool from an
14256 attribute. Required to information from AssemblyKeyFileAttribute,
14257 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
14258 * codegen.cs: Modified AssemblyName creation to include support for
14259 strongnames. Catch additional exceptions to report them as CS1548.
14260 * compiler.csproj: Updated include CryptoConvert.cs.
14261 * compiler.csproj.user: Removed file - user specific configuration.
14262 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
14263 Mono.Security assembly. The original class is maintained and tested in
14264 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
14265 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
14266 like CSC 8.0 (C# v2) supports.
14267 * Makefile: Added CryptoConvert.cs to mcs sources.
14268 * rootcontext.cs: Added new options for strongnames.
14270 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
14272 * driver.cs: For --expect-error, report error code `2'
14273 if the program compiled with no errors, error code `1' if
14274 it compiled with an error other than the one expected.
14276 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
14278 * compiler.csproj: Updated for Visual Studio .NET 2003.
14279 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
14280 * compiler.sln: Updated for Visual Studio .NET 2003.
14282 2004-03-24 Ravi Pratap M <ravi@ximian.com>
14284 * expression.cs: Fix bug #47234. We basically need to apply the
14285 rule that we prefer the conversion of null to a reference type
14286 when faced with a conversion to 'object' (csc behaviour).
14288 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14290 * statement.cs: Shorter form for foreach, eliminates
14291 a local variable. r=Martin.
14293 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14295 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
14296 checks if we can use brtrue/brfalse to test for 0.
14297 * expression.cs: use the above in the test for using brtrue/brfalse.
14298 cleanup code a bit.
14300 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14302 * expression.cs: Rewrite string concat stuff. Benefits:
14304 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
14305 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
14306 rather than a concat chain.
14308 * typemanager.cs: Add lookups for more concat overloads.
14310 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14312 * expression.cs: Emit shorter il code for array init.
14329 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
14331 * statement.cs: Before, two switch blocks would be merged if the
14332 total size of the blocks (end_item - begin_item + 1) was less than
14333 two times the combined sizes of the blocks.
14335 Now, it will only merge if after the merge at least half of the
14340 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
14342 * class.cs : csc build fix for GetMethods(). See bug #52503.
14344 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
14346 * expression.cs: Make sure fp comparisons work with NaN.
14347 This fixes bug #54303. Mig approved this patch a long
14348 time ago, but we were not able to test b/c the runtime
14351 2004-03-19 Miguel de Icaza <miguel@ximian.com>
14353 * ecore.cs (TypExpr.GetHashCode): implement this overload.
14355 2004-03-19 Martin Baulig <martin@ximian.com>
14357 * class.cs (MemberCore.IsDuplicateImplementation): Report the
14358 error here and not in our caller.
14360 2004-03-19 Martin Baulig <martin@ximian.com>
14362 * interface.cs: Completely killed this file.
14363 (Interface): We're now a TypeContainer and live in class.cs.
14365 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
14366 argument; we're now also called for interfaces.
14367 (TypeContainer.DefineMembers): Allow this method being called
14369 (TypeContainer.GetMethods): New public method; formerly known as
14370 Interface.GetMethod(). This is used by PendingImplementation.
14371 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
14372 it's now private and non-static.
14373 (Interface): Moved this here; it's now implemented similar to
14375 (Method, Property, Event, Indexer): Added `bool is_interface'
14376 argument to their .ctor's.
14377 (MemberBase.IsInterface): New public field.
14379 * cs-parser.jay: Create normal Method, Property, Event, Indexer
14380 instances instead of InterfaceMethod, InterfaceProperty, etc.
14381 (opt_interface_base): Removed; we now use `opt_class_base' instead.
14382 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
14384 2004-03-19 Martin Baulig <martin@ximian.com>
14386 * class.cs (MethodCore.IsDuplicateImplementation): New private
14387 method which does the CS0111 checking.
14388 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
14389 Use IsDuplicateImplementation().
14391 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
14393 * decl.cs (FindMemberToOverride): New method to find the correct
14394 method or property to override in the base class.
14396 - Make Method/Property use the above method to find the
14397 version in the base class.
14398 - Remove the InheritableMemberSignatureCompare as it is now
14401 This patch makes large code bases much faster to compile, as it is
14402 O(n) rather than O(n^2) to do this validation.
14404 Also, it fixes bug 52458 which is that nested classes are not
14405 taken into account when finding the base class member.
14407 Reviewed/Approved by Martin.
14409 2004-03-17 Marek Safar <marek.safar@seznam.cz>
14411 * interface.cs: In all interface classes removed redundant
14412 member initialization.
14414 2004-03-16 Martin Baulig <martin@ximian.com>
14416 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
14418 2004-03-15 Miguel de Icaza <miguel@ximian.com>
14420 * decl.cs (DefineTypeAndParents): New helper method to define a
14421 type's containers before the type itself is defined; This is a
14422 bug exposed by the recent changes to Windows.Forms when an
14423 implemented interface was defined inside a class that had not been
14426 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
14428 (Check): Loop correctly to report errors modifiers
14429 (UNSAFE was not in the loop, since it was the same as TOP).
14431 * interface.cs: Every interface member now takes a ModFlags,
14432 instead of a "is_new" bool, which we set on the base MemberCore.
14434 Every place where we called "UnsafeOk" in the interface, now we
14435 call the proper member (InterfaceMethod.UnsafeOK) instead to get
14436 the unsafe settings from the member declaration instead of the
14437 container interface.
14439 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
14441 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
14442 `set_indexer_name' to the pending bits (one per type).
14444 We fixed a bug today that was picking the wrong method to
14445 override, since for properties the existing InterfaceMethod code
14446 basically ignored the method name. Now we make sure that the
14447 method name is one of the valid indexer names.
14449 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
14451 * support.cs (SeekableStreamReader): Keep track of stream byte
14452 positions and don't mix them with character offsets to the buffer.
14454 Patch from Gustavo Giráldez
14456 2004-03-15 Marek Safar <marek.safar@seznam.cz>
14458 * interface.cs (InterfaceSetGetBase): Removed double member
14459 initialization, base class does it as well.
14461 2004-03-13 Martin Baulig <martin@ximian.com>
14463 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
14464 when compiling corlib.
14466 2004-03-13 Miguel de Icaza <miguel@ximian.com>
14468 * convert.cs (ExplicitConversion): We were reporting an error on
14469 certain conversions (object_type source to a value type, when the
14470 expression was `null') before we had a chance to pass it through
14471 the user defined conversions.
14473 * driver.cs: Replace / and \ in resource specifications to dots.
14476 * class.cs: Add check for duplicate operators. Fixes 52477
14478 2004-03-11 Miguel de Icaza <miguel@ximian.com>
14480 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
14481 that are in the middle of the statements, not only at the end.
14484 * class.cs (TypeContainer.AddField): No longer set the
14485 `HaveStaticConstructor' flag, now we call it
14486 `UserDefineStaticConstructor' to diferentiate the slightly
14487 semantic difference.
14489 The situation is that we were not adding BeforeFieldInit (from
14490 Modifiers.TypeAttr) to classes that could have it.
14491 BeforeFieldInit should be set to classes that have no static
14496 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
14498 And most importantly Zoltan's comment:
14500 http://bugzilla.ximian.com/show_bug.cgi?id=44229
14502 "I think beforefieldinit means 'it's ok to initialize the type sometime
14503 before its static fields are used', i.e. initialization does not need
14504 to be triggered by the first access to the type. Setting this flag
14505 helps the JIT to compile better code, since it can run the static
14506 constructor at JIT time, and does not need to generate code to call it
14507 (possibly lots of times) at runtime. Unfortunately, mcs does not set
14508 this flag for lots of classes like String.
14510 csc sets this flag if the type does not have an explicit static
14511 constructor. The reasoning seems to be that if there are only static
14512 initalizers for a type, and no static constructor, then the programmer
14513 does not care when this initialization happens, so beforefieldinit
14516 This bug prevents the AOT compiler from being usable, since it
14517 generates so many calls to mono_runtime_class_init that the AOT code
14518 is much slower than the JITted code. The JITted code is faster,
14519 because it does not generate these calls if the vtable is type is
14520 already initialized, which is true in the majority of cases. But the
14521 AOT compiler can't do this."
14523 2004-03-10 Miguel de Icaza <miguel@ximian.com>
14525 * class.cs (MethodData.Emit): Refactor the code so symbolic
14526 information is generated for destructors; For some reasons we
14527 were taking a code path that did not generate symbolic information
14530 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
14532 * class.cs: Create a Constructor.CheckBase method that
14533 takes care of all validation type code. The method
14534 contains some code that was moved from Define.
14536 It also includes new code that checks for duplicate ctors.
14537 This fixes bug #55148.
14539 2004-03-09 Joshua Tauberer <tauberer@for.net>
14541 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
14542 a { ... }-style array creation invokes EmitStaticInitializers
14543 which is not good for reference-type arrays. String, decimal
14544 and now null constants (NullCast) are not counted toward
14545 static initializers.
14547 2004-03-05 Martin Baulig <martin@ximian.com>
14549 * location.cs (SourceFile.HasLineDirective): New public field;
14550 specifies whether the file contains or is referenced by a "#line"
14552 (Location.DefineSymbolDocuments): Ignore source files which
14553 either contain or are referenced by a "#line" directive.
14555 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
14557 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
14558 direct access to our parent, so check the method inline there.
14560 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
14562 * expression.cs (Invocation.EmitCall): Miguel's last commit
14563 caused a regression. If you had:
14568 In Foo the implict this would be null.
14570 2004-02-27 Miguel de Icaza <miguel@ximian.com>
14572 * expression.cs (Invocation.EmitCall): If the method is not
14573 virtual, do not emit a CallVirt to it, use Call.
14575 * typemanager.cs (GetFullNameSignature): Improve the method to
14576 cope with ".ctor" and replace it with the type name.
14578 * class.cs (ConstructorInitializer.Resolve): Now the method takes
14579 as an argument the ConstructorBuilder where it is being defined,
14580 to catch the recursive constructor invocations.
14582 2004-02-26 Miguel de Icaza <miguel@ximian.com>
14584 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
14585 routines to check if a type is an enumerable/enumerator allow
14586 classes that implement the IEnumerable or IEnumerator interfaces.
14588 * class.cs (Property, Operator): Implement IIteratorContainer, and
14589 implement SetYields.
14591 (Property.Define): Do the block swapping for get_methods in the
14592 context of iterators. We need to check if Properties also
14593 include indexers or not.
14595 (Operator): Assign the Block before invoking the
14596 OperatorMethod.Define, so we can trigger the Iterator code
14599 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
14600 Property and Operator classes are not created when we parse the
14601 declarator but until we have the block completed, so we use a
14602 singleton SimpleIteratorContainer.Simple to flag whether the
14603 SetYields has been invoked.
14605 We propagate this setting then to the Property or the Operator to
14606 allow the `yield' to function.
14608 2004-02-25 Marek Safar <marek.safar@seznam.cz>
14610 * codegen.cs: Implemented attribute support for modules.
14611 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
14612 Assembly/Module functionality.
14614 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
14615 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
14616 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
14618 2004-02-16 Marek Safar <marek.safar@seznam.cz>
14620 * interface.cs (FindMembers): The operation is performed on all base
14621 interfaces and not only on the first. It is required for future CLS Compliance patch.
14623 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
14625 * statement.cs, codegen.cs:
14626 This patch deals with patterns such as:
14628 public class List : IEnumerable {
14630 public MyEnumerator GetEnumerator () {
14631 return new MyEnumerator(this);
14634 IEnumerator IEnumerable.GetEnumerator () {
14638 public struct MyEnumerator : IEnumerator {
14643 Before, there were a few things we did wrong:
14644 1) we would emit callvirt on a struct, which is illegal
14645 2) we emited ldarg when we needed to emit ldarga
14646 3) we would mistakenly call the interface methods on an enumerator
14647 type that derived from IEnumerator and was in another assembly. For example:
14649 public class MyEnumerator : IEnumerator
14651 Would have the interface methods called, even if there were public impls of the
14652 method. In a struct, this lead to invalid IL code.
14654 2004-02-11 Marek Safar <marek.safar@seznam.cz>
14656 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
14659 * delegate.cs (Define): Fixed crash when delegate type is undefined.
14661 2004-02-11 Miguel de Icaza <miguel@ximian.com>
14663 * cs-parser.jay: Fix small regression: we were not testing V2
14664 compiler features correctly.
14666 * interface.cs: If the emit context is null, then create one
14668 2004-02-09 Marek Safar <marek.safar@seznam.cz>
14670 * decl.cs (GetSignatureForError): New virtual method to get full name
14671 for error messages.
14673 * attribute.cs (IAttributeSupport): New interface for attribute setting.
14674 Now it is possible to rewrite ApplyAttributes method to be less if/else.
14676 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
14677 Duplicated members and code in these classes has been removed.
14678 Better encapsulation in these classes.
14680 2004-02-07 Miguel de Icaza <miguel@ximian.com>
14682 * assign.cs (Assign.DoResolve): When dealing with compound
14683 assignments, there is a new rule in ECMA C# 2.4 (might have been
14684 there before, but it is documented here) that states that in:
14688 If b is of type int, and the `op' is a shift-operator, then the
14689 above is evaluated as:
14693 * expression.cs (Binary.ResolveOperator): Instead of testing for
14694 int/uint/long/ulong, try to implicitly convert to any of those
14695 types and use that in pointer arithmetic.
14697 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
14698 method to print information for from the type, not from the
14699 null-method we were given.
14701 2004-02-01 Duncan Mak <duncan@ximian.com>
14703 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
14704 parsing for cmd, fixes bug #53694.
14706 2004-02-04 Marek Safar <marek.safar@seznam.cz>
14708 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
14709 in the member name duplication tests. Property and operator name duplication
14710 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
14712 2004-02-03 Marek Safar <marek.safar@seznam.cz>
14714 * interface.cs (PopulateMethod): Fixed crash when interface method
14715 returns not existing type (error test cs0246-3.cs).
14717 2004-02-02 Ravi Pratap M <ravi@ximian.com>
14719 * cs-parser.jay (interface_accessors): Re-write actions to also
14720 store attributes attached to get and set methods. Fix spelling
14723 (inteface_property_declaration): Modify accordingly.
14725 (InterfaceAccessorInfo): New helper class to store information to pass
14726 around between rules that use interface_accessors.
14728 * interface.cs (Emit): Apply attributes on the get and set
14729 accessors of properties and indexers too.
14731 * attribute.cs (ApplyAttributes): Modify accordingly to use the
14732 right MethodBuilder when applying attributes to the get and set accessors.
14734 2004-01-31 Miguel de Icaza <miguel@ximian.com>
14736 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
14738 2004-01-26 Miguel de Icaza <miguel@ximian.com>
14740 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
14742 2004-01-25 Miguel de Icaza <miguel@ximian.com>
14744 * cs-parser.jay: Remove YIELD token, instead use the new grammar
14745 changes that treat `yield' specially when present before `break'
14746 or `return' tokens.
14748 * cs-tokenizer.cs: yield is no longer a keyword.
14750 2004-01-23 Marek Safar <marek.safar@seznam.cz>
14752 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
14753 setting for default constructors.
14754 For default constructors are almost every time set wrong Modifier. The
14755 generated IL code has been alright. But inside mcs this values was
14756 wrong and this was reason why several of my CLS Compliance tests
14759 2004-01-22 Martin Baulig <martin@ximian.com>
14761 * cs-parser.jay (namespace_or_type_name): Return an Expression,
14762 not a QualifiedIdentifier. This is what `type_name_expression'
14763 was previously doing.
14764 (type_name_expression): Removed; the code is now in
14765 `namespace_or_type_name'.
14766 (qualified_identifier): Removed, use `namespace_or_type_name'
14768 (QualifiedIdentifier): Removed this class.
14770 2004-01-22 Martin Baulig <martin@ximian.com>
14772 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
14773 not a string as alias name.
14775 2004-01-21 Miguel de Icaza <miguel@ximian.com>
14777 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
14778 #52730 bug, and instead compute correctly the need to use a
14779 temporary variable when requesting an address based on the
14780 static/instace modified of the field and the constructor.
14782 2004-01-21 Martin Baulig <martin@ximian.com>
14784 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
14785 class and namespace before looking up aliases. Fixes #52517.
14787 2004-01-21 Martin Baulig <martin@ximian.com>
14789 * flowanalysis.cs (UsageVector.Merge): Allow variables being
14790 assinged in a 'try'; fixes exception4.cs.
14792 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14793 * class.cs : Implemented parameter-less constructor for TypeContainer
14795 * decl.cs: Attributes are now stored here. New property OptAttributes
14797 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
14799 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
14801 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14803 * typemanager.cs (CSharpSignature): Now reports also inner class name.
14804 (CSharpSignature): New method for indexer and property signature.
14806 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14808 * pending.cs (IsVirtualFilter): Faster implementation.
14810 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14812 * typemanager.cs: Avoid inclusion of same assembly more than once.
14814 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14816 * cs-parser.jay: Fixed problem where the last assembly attribute
14817 has been applied also to following declaration (class, struct, etc.)
14819 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14821 * class.cs: Added error CS0538, CS0539 reporting.
14822 Fixed crash on Microsoft runtime when field type is void.
14824 * cs-parser.jay: Added error CS0537 reporting.
14826 * pending.cs: Added error CS0535 reporting.
14827 Improved error report for errors CS0536, CS0534.
14829 2004-01-20 Miguel de Icaza <miguel@ximian.com>
14831 Merge a few bits from the Anonymous Method MCS tree.
14833 * statement.cs (ToplevelBlock): New class for toplevel methods,
14834 will hold anonymous methods, lifted variables.
14836 * cs-parser.jay: Create toplevel blocks for delegates and for
14837 regular blocks of code.
14839 2004-01-20 Martin Baulig <martin@ximian.com>
14841 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
14842 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
14843 and `NeedExplicitReturn'; added `IsLastStatement'.
14844 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
14845 have a `ReturnLabel' or we're not unreachable.
14847 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
14848 child's reachability; don't just override ours with it. Fixes
14849 #58058 (lluis's example).
14850 (FlowBranching): Added public InTryOrCatch(), InCatch(),
14851 InFinally(), InLoop(), InSwitch() and
14852 BreakCrossesTryCatchBoundary() methods.
14854 * statement.cs (Return): Do all error checking in Resolve().
14855 Unless we are the last statement in a top-level block, always
14856 create a return label and jump to it.
14857 (Break, Continue): Do all error checking in Resolve(); also make
14858 sure we aren't leaving a `finally'.
14859 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
14860 statement in a top-level block.
14861 (Block.Flags): Added `IsDestructor'.
14862 (Block.IsDestructor): New public property.
14864 2004-01-20 Martin Baulig <martin@ximian.com>
14866 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
14868 2004-01-20 Martin Baulig <martin@ximian.com>
14870 * statement.cs (Statement.ResolveUnreachable): New public method.
14871 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
14872 (Block.Resolve): Resolve unreachable statements.
14874 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
14876 * expression.cs: We need to fix the case where we do
14877 not have a temp variable here.
14879 * assign.cs: Only expression compound assignments need
14880 temporary variables.
14882 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
14884 * flowanalysis.cs: Reduce memory allocation in a few ways:
14885 - A block with no variables should not allocate a bit
14887 - A method with no out parameters does not need any tracking
14888 for assignment of the parameters, so we need not allocate
14891 public readonly Type[] VariableTypes;
14892 public readonly string[] VariableNames;
14893 Are redundant. The data is already stored in the variable
14894 map, so we need not allocate another array for it.
14895 - We need to add alot of checks for if (params | locals) == null
14896 due to the first two changes.
14898 2004-01-18 Miguel de Icaza <miguel@ximian.com>
14900 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
14901 implement IMemoryLocation, we store a copy on a local variable and
14902 take the address of it. Patch from Benjamin Jemlich
14904 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
14905 to use a special "type_name_expression" rule which reduces the
14906 number of "QualifiedIdentifier" classes created, and instead
14907 directly creates MemberAccess expressions.
14909 2004-01-17 Miguel de Icaza <miguel@ximian.com>
14911 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
14912 that fixes #52853. Null literal assignment to ValueType
14914 * class.cs (MethodData.Emit): Instead of checking the name of the
14915 method to determine if its a destructor, create a new derived
14916 class from Method called Destructor, and test for that.
14918 * cs-parser.jay: Create a Destructor object instead of a Method.
14920 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
14924 2004-01-16 Miguel de Icaza <miguel@ximian.com>
14926 * expression.cs (Binary.ResolveOperator): Perform an implicit
14927 conversion from MethodGroups to their delegate types on the
14928 Addition operation.
14930 * delegate.cs: Introduce a new class DelegateCreation that is the
14931 base class for `NewDelegate' and `ImplicitDelegateCreation',
14932 factor some code in here.
14934 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
14935 conversion from MethodGroups to compatible delegate types.
14937 * ecore.cs (Expression.Resolve): Do not flag error 654
14938 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
14939 we allow conversions from MethodGroups to delegate types now.
14941 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
14942 assignments in v2 either.
14944 2004-01-10 Miguel de Icaza <miguel@ximian.com>
14946 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
14947 static read-only fields in ctors.
14949 Applied patch from Benjamin Jemlich
14951 * expression.cs (UnaryMutator): Avoid leaking local variables.
14953 2004-01-09 Miguel de Icaza <miguel@ximian.com>
14955 * cs-tokenizer.cs (IsCastToken): Allow the various native types
14956 here to return true, as they can be used like this:
14958 (XXX) int.MEMBER ()
14960 Fixed 49836 and all the other dups
14962 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
14964 * driver.cs: Implement /win32res and /win32icon.
14966 2004-01-08 Miguel de Icaza <miguel@ximian.com>
14968 * cs-parser.jay: Add a rule to improve error handling for the
14969 common mistake of placing modifiers after the type.
14971 2004-01-07 Miguel de Icaza <miguel@ximian.com>
14973 * cs-parser.jay (interface_event_declaration): Catch
14974 initialization of events on interfaces, and report cs0068
14976 * cs-parser.jay (interface_event_declaration): Catch
14977 initialization of events.
14979 * ecore.cs: Better report missing constructors.
14981 * expression.cs (Binary.ResolveOperator): My previous bug fix had
14982 the error reporting done in the wrong place. Fix.
14984 * expression.cs (Binary.ResolveOperator): Catch the
14985 operator + (E x, E y) error earlier, and later allow for implicit
14986 conversions in operator +/- (E e, U x) from U to the underlying
14989 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
14990 52596, if the container class is abstract, the default constructor
14991 is protected otherwise its public (before, we were always public).
14993 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
14996 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
14997 Jemlich that fixes bug #52597, MCS was generating invalid code for
14998 idisposable structs. Thanks to Ben for following up with this
15001 2004-01-06 Miguel de Icaza <miguel@ximian.com>
15003 * driver.cs: Allow assemblies without code to be generated, fixes
15006 2004-01-07 Nick Drochak <ndrochak@gol.com>
15008 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
15010 2004-01-05 Miguel de Icaza <miguel@ximian.com>
15012 * cs-parser.jay: Add rules to improve error reporting if fields or
15013 methods are declared at the namespace level (error 116)
15015 * Add rules to catch event add/remove
15017 2004-01-04 David Sheldon <dave-mono@earth.li>
15019 * expression.cs: Added matching ")" to error message for
15022 2004-01-03 Todd Berman <tberman@gentoo.org>
15024 * ecore.cs, attribute.cs:
15025 Applying fix from #52429.
15027 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
15029 * ecore.cs, expression.cs, statement.cs:
15030 Total rewrite of how we handle branching. We
15031 now handle complex boolean expressions with fewer
15032 jumps. As well if (x == 0) no longer emits a ceq.
15034 if (x is Foo) is much faster now, because we generate
15037 Overall, we get a pretty big improvement on our benchmark
15038 tests. The code we generate is smaller and more readable.
15040 I did a full two-stage bootstrap. The patch was reviewed
15041 by Martin and Miguel.
15043 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
15045 * cs-parser.jay: Make primary_expression not take a QI.
15046 we dont need this because the member_access rule covers
15047 us here. So we replace the rule with just IDENTIFIER.
15049 This has two good effects. First, we remove a s/r conflict.
15050 Second, we allocate many fewer QualifiedIdentifier objects.
15052 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
15054 * attribute.cs: Handle MarshalAs attributes as pseudo, and
15055 set the correct information via SRE. This prevents
15056 hanging on the MS runtime. Fixes #29374.
15058 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
15060 * convert.cs: correctly handle conversions to value types
15061 from Enum and ValueType as unboxing conversions.
15063 Fixes bug #52569. Patch by Benjamin Jemlich.
15065 2004-01-02 Ravi Pratap <ravi@ximian.com>
15067 * expression.cs (BetterConversion): Prefer int -> uint
15068 over int -> ulong (csc's behaviour). This fixed bug #52046.
15070 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
15072 * decl.cs (MemberCache.FindMembers): now returns a
15075 * typemanager.cs: In general, go with with ^^.
15076 (CopyNewMethods): take an IList.
15077 (RealMemberLookup): Only allocate an arraylist
15078 if we copy from two sets of methods.
15080 This change basically does two things:
15081 1) Fewer array lists allocated due to CopyNewMethods.
15082 2) the explicit cast in MemberList costed ALOT.
15084 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
15086 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
15087 a hashtable to avoid needless string allocations when an identifier is
15088 used more than once (the common case).
15090 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
15092 * pending.cs: MS's TypeBuilder.GetInterfaces ()
15093 is broken, it will not return anything. So, we
15094 have to use the information we have in mcs to
15097 * typemanager.cs: Add a cache for GetInterfaces,
15098 since this will now be used more often (due to ^^)
15100 (GetExplicitInterfaces) New method that gets the
15101 declared, not effective, interfaces on a type
15102 builder (eg, if you have interface IFoo, interface
15103 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
15106 This patch makes MCS able to bootstrap itself on
15109 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
15111 * expression.cs: Remove the Nop's that Miguel put
15114 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
15116 * report.cs, codegen.cs: Give the real stack trace to
15117 the error when an exception is thrown.
15119 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
15121 * decl.cs: only allocate hashtables for ifaces if
15124 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
15126 * expression.cs: fix the error from cs0121-2.cs
15127 (a parent interface has two child interfaces that
15128 have a function with the same name and 0 params
15129 and the function is called through the parent).
15131 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
15133 * class.cs, rootcontext.cs, typmanager.cs: do not
15136 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
15138 * codegen.cs: remove stack for the ec flow branching.
15139 It is already a linked list, so no need.
15141 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
15143 * Makefile: Allow custom profiler here.
15145 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
15147 * typemanager.cs (LookupType):
15148 - Use a static char [], because split takes
15149 a param array for args, so it was allocating
15151 - Do not store true in a hashtable, it boxes.
15153 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
15155 * flowanalysis.cs: bytify common enums.
15157 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15159 * modifiers.cs: Add a new set of flags for the
15160 flags allowed on explicit interface impls.
15161 * cs-parser.jay: catch the use of modifiers in
15162 interfaces correctly.
15163 * class.cs: catch private void IFoo.Blah ().
15165 All related to bug #50572.
15167 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15169 * decl.cs: Rewrite the consistant accessability checking.
15170 Accessability is not linear, it must be implemented in
15171 a tableish way. Fixes #49704.
15173 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15175 * expression.cs: Handle negation in a checked context.
15176 We must use subtraction from zero. Fixes #38674.
15178 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
15180 * class.cs: Ignore static void main in DLLs.
15181 * rootcontext.cs: Handle the target type here,
15182 since we are have to access it from class.cs
15183 * driver.cs: account for the above.
15185 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
15187 * report.cs: Give line numbers and files if available.
15189 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
15191 * driver.cs: Implement /addmodule.
15193 * typemanager.cs: Change 'modules' field so it now contains Modules not
15196 2003-12-20 Martin Baulig <martin@ximian.com>
15198 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
15199 (FieldBase.IsAssigned): Removed this field.
15200 (FieldBase.SetAssigned): New public method.
15201 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
15203 2003-12-20 Martin Baulig <martin@ximian.com>
15205 * expression.cs (LocalVariableReference.DoResolve): Don't set
15206 `vi.Used' if we're called from DoResolveLValue().
15208 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
15209 returns the usage vector it just merged into the current one -
15210 pass this one to UsageWarning().
15211 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
15212 of the `EmitContext', don't call this recursively on our children.
15214 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
15216 * driver.cs: Implement /target:module.
15218 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
15220 * support.cs (CharArrayHashtable): New helper class.
15222 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
15223 char arrays, not strings, so we can avoid creating a string in
15224 consume_identifier if the identifier is a keyword.
15226 2003-12-16 Martin Baulig <martin@ximian.com>
15228 * statement.cs (LocalInfo.Assigned): Removed this property.
15229 (LocalInfo.Flags): Removed `Assigned'.
15230 (LocalInfo.IsAssigned): New public method; takes the EmitContext
15231 and uses flow analysis.
15232 (Block.UsageWarning): Made this method private.
15233 (Block.Resolve): Call UsageWarning() if appropriate.
15235 * expression.cs (LocalVariableReference.DoResolve): Always set
15236 LocalInfo.Used here.
15238 2003-12-13 Martin Baulig <martin@ximian.com>
15240 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
15241 any value here; we're now using flow analysis to figure out
15242 whether a statement/block returns a value.
15244 2003-12-13 Martin Baulig <martin@ximian.com>
15246 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
15248 (FlowBranching.MergeFinally): Don't call
15249 `branching.CheckOutParameters()' here, this is called in
15251 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
15252 when adding the `finally' vector.
15254 2003-12-13 Martin Baulig <martin@ximian.com>
15257 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
15258 actually work and also fix #48962.
15260 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
15262 * decl.cs: Do not check System.Object for nested types,
15263 since we know it does not have any. Big bang for buck:
15266 Run 1: 8.35 seconds
15267 Run 2: 8.32 seconds
15268 corlib: 17.99 seconds
15270 Run 1: 8.17 seconds
15271 Run 2: 8.17 seconds
15272 corlib: 17.39 seconds
15274 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
15276 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
15277 time we are returning 0 members, so we save alot here.
15279 2003-12-11 Martin Baulig <martin@ximian.com>
15281 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
15282 `MergeChild()', also just take the `FlowBranching' as argument;
15283 call Merge() on it and return the result.
15284 (FlowBranching.Merge): We don't need to do anything if we just
15287 2003-12-11 Martin Baulig <martin@ximian.com>
15289 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
15290 them in an `ArrayList' to reduce memory usage. Thanks to Ben
15291 Maurer for this idea.
15293 2003-12-11 Martin Baulig <martin@ximian.com>
15295 * flowanalysis.cs (MergeResult): This class is now gone; we now
15296 use the `UsageVector' for this. The reason for this is that if a
15297 branching just has one sibling, we don't need to "merge" them at
15298 all - that's the next step to do.
15299 (FlowBranching.Merge): We now return a `UsageVector' instead of a
15302 2003-12-11 Martin Baulig <martin@ximian.com>
15304 Reworked flow analyis and made it more precise and bug-free. The
15305 most important change is that we're now using a special `Reachability'
15306 class instead of having "magic" meanings of `FlowReturns'. I'll
15307 do some more cleanups and optimizations and also add some more
15308 documentation this week.
15310 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
15311 largely reworked this class.
15312 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
15313 the new `Reachability' class instead of having "magic" values here.
15314 (FlowBranching): We're now using an instance of `Reachability'
15315 instead of having separate `Returns', `Breaks' etc. fields.
15317 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
15318 based on flow analysis; ignore the return value of block.Emit ().
15320 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
15322 * driver.cs typemanager.cs: Find the mono extensions to corlib even
15323 if they are private.
15325 2003-12-09 Martin Baulig <martin@ximian.com>
15327 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
15328 call them directly on the UsageVector.
15330 2003-12-09 Martin Baulig <martin@ximian.com>
15332 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
15333 Changed return type from `FlowReturns' to `Reachability'.
15335 2003-12-09 Martin Baulig <martin@ximian.com>
15337 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
15338 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
15339 `Reachable' fields with a single `Reachability' one.
15341 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15343 * class.cs (FindMembers): Remove foreach's.
15348 Run 1: 8.74 seconds
15349 Run 2: 8.71 seconds
15352 Run 1: 8.64 seconds
15353 Run 2: 8.58 seconds
15356 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15361 This patch does a few things:
15362 1. EmptyStatement is now a singleton, so it is never reallocated.
15363 2. All blah is EmptyStatement constructs have been changed to
15364 blah == EmptyStatement.Value, which is much faster and valid
15365 now that EmptyStatement is a singleton.
15366 3. When resolving a block, rather than allocating a new array for
15367 the non-empty statements, empty statements are replaced with
15368 EmptyStatement.Value
15369 4. Some recursive functions have been made non-recursive.
15370 Mainly the performance impact is from (3), however (1) and (2) are needed for
15371 this to work. (4) does not make a big difference in normal situations, however
15372 it makes the profile look saner.
15377 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15378 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15379 Total memory allocated: 56397 KB
15382 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
15383 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
15384 Total memory allocated: 55666 KB
15386 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15388 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
15389 than the hashtable in a hashtable version
15391 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
15392 we always end up concating a string. This results in a huge perf
15393 loss, because many strings have to be tracked by the GC. In this
15394 patch, we first use a hashtable that works with two keys, so that
15395 the strings do not need to be concat'ed.
15399 Run 1: 8.74 seconds
15400 Run 2: 8.71 seconds
15403 Run 1: 8.65 seconds
15404 Run 2: 8.56 seconds
15406 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15408 * Makefile: Add a new target `do-time' that does a quick and simple
15409 profile, leaving easy to parse output.
15411 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
15413 * codegen.cs (Init): Create the dynamic assembly with
15414 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
15416 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
15418 * support.cs: Make the PtrHashtable use only one
15419 instance of its comparer.
15421 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
15423 * typemanager.cs: Fix lookup of GetNamespaces.
15425 2003-11-29 Miguel de Icaza <miguel@ximian.com>
15427 * expression.cs: Removed redundant line.
15429 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
15430 ArrayLists, use for loops with bounds.
15432 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
15435 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
15436 arraylists, use for loop with bounds.
15438 The above three changes give us a 0.071 second performance
15439 improvement out of 3.294 seconds down to 3.223. On my machine
15440 the above changes reduced the memory usage by 1,387 KB during
15441 compiler bootstrap.
15443 * cs-parser.jay (QualifiedIdentifier): New class used to represent
15444 QualifiedIdentifiers. Before we created a new string through
15445 concatenation, and mostly later on, the result would be
15446 manipulated by DecomposeQI through string manipulation.
15448 This reduced the compiler memory usage for bootstrapping from
15449 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
15450 compile times in 0.05 seconds.
15452 2003-11-28 Dick Porter <dick@ximian.com>
15454 * support.cs: Do string compares with the Invariant culture.
15462 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
15463 the comparison is done with the Invariant culture.
15465 2003-11-27 Miguel de Icaza <miguel@ximian.com>
15467 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
15468 GetEnumerator method.
15470 (ProbeCollectionType): Iterate starting at the most specific type
15471 upwards looking for a GetEnumerator
15473 * expression.cs: Shift count can be up to 31 for int/uint and 63
15476 2003-11-26 Miguel de Icaza <miguel@ximian.com>
15478 * statement.cs (Block.LookupLabel): Also look for the label on the
15479 children blocks. Use a hash table to keep track of visited
15482 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
15483 we actually did transform the other operand, otherwise fall back
15484 to the common codepath that casts to long.
15486 * cs-tokenizer.cs: Use the same code pattern as the int case.
15487 Maybe I should do the parsing myself, and avoid depending on the
15488 Parse routines to get this done.
15490 2003-11-25 Miguel de Icaza <miguel@ximian.com>
15492 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
15493 which fixes bug 51347. This time test it.
15495 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
15496 attributes for example can not tell the difference between these.
15497 The difference was only a syntax feature of the language.
15499 * attribute.cs: Apply attributes to delegates.
15501 * delegate.cs: Call the apply attributes method.
15503 2003-11-24 Miguel de Icaza <miguel@ximian.com>
15505 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
15506 comparing 0 vs Byte.MinValue, not the value
15508 (ImplicitConversionRequired): When reporting a conversion error,
15509 use error 31 to print out the constant error instead of the
15512 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
15513 which fixes bug 51347.
15515 2003-11-22 Miguel de Icaza <miguel@ximian.com>
15517 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
15518 which fixes the -warnaserror command line option.
15520 2003-11-21 Miguel de Icaza <miguel@ximian.com>
15522 * cfold.cs (DoNumericPromotions): During constant folding of
15523 additions on UIntConstant, special case intconstants with
15524 IntConstants like we do on the expression binary operator.
15526 2003-11-12 Miguel de Icaza <miguel@ximian.com>
15528 * convert.cs (ImplicitReferenceConversion): We were missing a case
15529 (System.Enum are not value types or class types, so we need to
15530 classify them separatedly).
15532 * driver.cs: We do not support error 2007.
15534 2003-11-12 Jackson Harper <jackson@ximian.com>
15536 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
15537 system directory. Also use the full file name so users can
15538 libraries names mscorlib-o-tron.dll in a non system dir.
15540 2003-11-10 Martin Baulig <martin@ximian.com>
15542 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
15543 (TypeManager.InitCoreTypes): Initialize them here, but instead of
15544 calling `ResolveType()' on them, directly assign their `Type'.
15546 2003-11-08 Martin Baulig <martin@ximian.com>
15548 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
15549 return value and the `out parent' parameter.
15550 (TypeContainer.DefineType): Moved the CS0644 check into
15551 GetClassBases(). Don't pass the interface types to the
15552 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
15553 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
15555 * ecore.cs (TypeExpr.IsAttribute): New property.
15556 (TypeExpr.GetInterfaces): New method.
15558 * interface.cs (Interface.GetInterfaceTypeByName): Return a
15559 TypeExpr instead of a Type.
15560 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
15561 (Interface.DefineType): Don't pass the interface types to the
15562 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
15563 them later and then call `TypeBulider.AddInterfaceImplementation()'.
15565 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
15566 instead of a `Type[]'.
15567 (TypeManager.RegisterBuilder): Likewise.
15568 (TypeManager.AddUserInterface): Likewise.
15569 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
15570 `Type[]' and also return a `TypeExpr[]'.
15571 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
15573 2003-11-08 Martin Baulig <martin@ximian.com>
15575 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
15578 2003-11-08 Martin Baulig <martin@ximian.com>
15580 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
15581 TypeManager.ResolveExpressionTypes().
15583 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
15584 instead of an Expression.
15585 (TypeExpr): This is now an abstract base class for `TypeExpression'.
15586 (TypeExpression): New public class; formerly known as `TypeExpr'.
15588 * expression.cs (ComposedCast): Derive from TypeExpr.
15590 * typemanager.cs (TypeManager.system_*_expr): These are now
15591 TypExpr's instead of Expression's.
15592 (TypeManager.ResolveExpressionTypes): New public static function;
15593 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
15596 2003-11-06 Miguel de Icaza <miguel@ximian.com>
15598 * expression.cs (New.DoResolve): Do not dereference value that
15599 might be a null return.
15601 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
15602 sure that the constant value has the right type. Fixes an
15603 unreported bug, similar to 50425.
15605 * const.cs (Const.LookupConstantValue): Call
15606 ImplicitStandardConversionExists before doing a conversion to
15607 avoid havng the TypeManager.ChangeType do conversions.
15609 Reduced the number of casts used
15611 (Const.ChangeType): New routine to enable reuse of the constant
15612 type changing code from statement.
15614 * typemanager.cs (ChangeType): Move common initialization to
15615 static global variables.
15619 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
15620 every value type to go through, even if it was void. Fix that.
15622 * cs-tokenizer.cs: Use is_identifier_start_character on the start
15623 character of the define, and the is_identifier_part_character for
15624 the rest of the string.
15626 2003-11-05 Miguel de Icaza <miguel@ximian.com>
15628 * expression.cs (UnaryMutator.EmitCode): When I updated
15629 LocalVariableReference.DoResolve, I overdid it, and dropped an
15630 optimization done on local variable references.
15632 2003-11-04 Miguel de Icaza <miguel@ximian.com>
15634 * ecore.cs: Convert the return from Ldlen into an int.
15636 2003-10-20 Miguel de Icaza <miguel@ximian.com>
15638 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
15639 the accessibility, this is a special case for toplevel non-public
15640 classes (internal for instance).
15642 2003-10-20 Nick Drochak <ndrochak@gol.com>
15644 * ecore.cs: Fix typo and build. Needed another right paren.
15646 2003-10-19 Miguel de Icaza <miguel@ximian.com>
15648 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
15649 `internal' case regular and protected, but not allowing protected
15650 to be evaluated later. Bug 49840
15652 2003-10-15 Miguel de Icaza <miguel@ximian.com>
15654 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
15655 to kb.Nlast, and not the kb.nFirst to isolate the switch
15658 Extract the underlying type, so enumerations of long/ulong are
15659 treated like long/ulong.
15661 2003-10-14 Miguel de Icaza <miguel@ximian.com>
15663 * expression.cs (New): Overload the meaning of RequestedType to
15664 track the possible creation of the NewDelegate type, since
15665 DoResolve is invoked more than once for new constructors on field
15668 See bugs: #48800 and #37014
15670 * cs-parser.jay (declare_local_constants): Take an arraylist
15671 instead of a single constant.
15673 (local_constant_declaration): It should take a
15674 constant_declarators, not a constant_declarator. Fixes 49487
15676 * convert.cs: Fix error report.
15678 2003-10-13 Jackson Harper <jackson@ximian.com>
15680 * typemanager.cs (TypeToCoreType): Add float and double this fixes
15683 2003-10-09 Martin Baulig <martin@ximian.com>
15685 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
15687 (MethodCore.DoDefineParameters): Removed the TypeContainer
15688 argument; use the DeclSpace which was passed to the .ctor instead.
15689 (MethodCore.CheckParameter): Take a DeclSpace instead of a
15690 TypeContainer; we only need a DeclSpace here.
15692 2003-10-09 Martin Baulig <martin@ximian.com>
15694 * class.cs (MethodData): Added additional `DeclSpace ds' argument
15696 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
15697 EmitContext's .ctor.
15699 2003-10-09 Martin Baulig <martin@ximian.com>
15701 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
15702 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
15703 AsAccessible(), moved them as well.
15705 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
15707 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
15709 * cs-parser.jay : Renamed yyName to yyNames related to jay.
15711 2003-10-07 Miguel de Icaza <miguel@ximian.com>
15713 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
15714 generation for >=, as spotted by Paolo, bug 48679.
15715 Patch from David Waite.
15717 * cs-tokenizer.cs: Add handling for #pragma.
15719 * cs-parser.jay: Allow for both yield and yield return in the
15720 syntax. The anti-cobolization of C# fight will go on!
15722 * class.cs (TypeBuilder.DefineType): Catch error condition here
15723 (Parent.DefineType erroring out and returning null).
15725 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15726 coping with enumerations variables, we were mistakenly processing
15727 them as a regular value type instead of built-in types. Fixes the
15730 * typemanager.cs (IsBuiltinOrEnum): New method.
15732 2003-09-30 Miguel de Icaza <miguel@ximian.com>
15734 * cs-parser.jay: Upgrade: yield now needs the return clause.
15736 2003-09-19 Martin Baulig <martin@ximian.com>
15738 * decl.cs (MemberCache.SetupCacheForInterface): Take a
15739 `MemberCache parent' argument. Normally, an interface doesn't
15740 have a parent type except System.Object, but we use this in gmcs
15741 for generic type parameters.
15743 2003-09-18 Martin Baulig <martin@ximian.com>
15745 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
15746 on `type.IsInterface'; don't check whether the type has a parent
15747 to determine whether it's an interface.
15749 2003-09-15 Martin Baulig <martin@ximian.com>
15751 * class.cs (TypeContainer.DefineType): Added an error flag to
15752 avoid reporting duplicate CS0146's ("class definition is
15755 * driver.cs (Driver.MainDriver): Abort if
15756 RootContext.ResolveTree() reported any errors.
15758 2003-09-07 Martin Baulig <martin@ximian.com>
15760 * report.cs (Error, Warning): Added overloaded versions which take
15761 a `params object[] args' and call String.Format().
15763 2003-09-07 Martin Baulig <martin@ximian.com>
15765 * decl.cs (DeclSpace..ctor): Don't call
15766 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
15767 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
15768 (DeclSpace.RecordDecl): New method.
15770 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
15772 2003-09-02 Ravi Pratap <ravi@ximian.com>
15774 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
15775 value attributes to be applied to ParameterBuilders.
15777 * class.cs (MethodCore.LabelParameters): Make static and more
15778 generic so that it can be used from other places - like interface
15779 methods, for instance.
15781 * interface.cs (Interface.Emit): Call LabelParameters before
15782 emitting attributes on the InterfaceMethod.
15784 2003-08-26 Martin Baulig <martin@ximian.com>
15786 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
15787 resolving aliases; fixes #47927.
15789 2003-08-26 Martin Baulig <martin@ximian.com>
15791 * statement.cs (Using.DoResolve): This is internally emitting a
15792 try/finally clause, so we need to set ec.NeedExplicitReturn if we
15793 do not always return. Fixes #47681.
15795 2003-08-26 Martin Baulig <martin@ximian.com>
15797 * decl.cs (MemberCore): Moved WarningNotHiding(),
15798 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
15800 (AdditionResult): Make this nested in DeclSpace.
15801 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
15802 argument; call NamespaceEntry.Define() unless we're nested in a
15805 * namespace.cs (Namespace.DefineName): New public function. This
15806 is called from DeclSpace's .ctor to add
15807 (Namespace.Lookup): Include DeclSpaces in the lookup.
15809 * class.cs (Operator): Derive from MemberBase, not MemberCore.
15811 * const.cs (Const): Derive from MemberBase, not MemberCore.
15813 2003-08-25 Martin Baulig <martin@ximian.com>
15815 * convert.cs (Convert.ExplicitReferenceConversion): When
15816 converting from an interface type to a class, unbox if the target
15817 type is a struct type. Fixes #47822.
15819 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15821 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
15824 2003-08-22 Martin Baulig <martin@ximian.com>
15826 * class.cs (TypeManager.DefineType): When defining a nested type,
15827 call DefineType() on our parent; fixes #47801.
15829 2003-08-22 Martin Baulig <martin@ximian.com>
15831 * class.cs (MethodData.Define): While checking if a method is an
15832 interface implementation, improve the test a bit more to fix #47654.
15834 2003-08-22 Martin Baulig <martin@ximian.com>
15836 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
15837 correctly; fixes #47722.
15839 2003-08-22 Martin Baulig <martin@ximian.com>
15841 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
15842 LocalVariableReference, ensure it's not read-only. Fixes #47536.
15844 * statement.cs (Fixed.DoResolve): Make all variables read-only.
15846 2003-08-22 Martin Baulig <martin@ximian.com>
15848 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
15849 can only be assigned in static constructors. Fixes #47161.
15851 2003-08-22 Martin Baulig <martin@ximian.com>
15853 Rewrote and improved the flow analysis code.
15855 * flowbranching.cs (FlowBranching): Make this class abstract.
15856 (FlowBranching.CreateBranching): New static function to create a
15857 new flow branching.
15858 (FlowBranchingBlock, FlowBranchingException): New classes.
15859 (FlowBranching.UsageVector.Type): New public readonly field.
15860 (FlowBranching.UsageVector.Breaks): Removed the setter.
15861 (FlowBranching.UsageVector.Returns): Removed the setter.
15862 (FlowBranching.UsageVector): Added Break(), Return(),
15863 NeverReachable() and Throw() methods to modify the reachability.
15864 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
15865 done by FlowBranching.Merge().
15866 (FlowBranching.UsageVector.MergeChild): New method; merges the
15867 merge result into the current vector.
15868 (FlowBranching.Merge): New abstract method to merge a branching.
15870 2003-08-12 Martin Baulig <martin@ximian.com>
15872 * expression.cs (Indirection.CacheTemporaries): Create the
15873 LocalTemporary with the pointer type, not its element type.
15875 2003-08-10 Miguel de Icaza <miguel@ximian.com>
15877 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
15878 token was a keyword or not.
15880 Add `error' options where an IDENTIFIER was expected; Provide
15881 CheckToken and CheckIdentifierToken convenience error reporting
15884 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
15886 * decl.cs: Rename `NamespaceEntry Namespace' public field into
15887 NameSpaceEntry NameSpaceEntry.
15889 (LookupInterfaceOrClass): Avoid creating a full qualified name
15890 from namespace and name: avoid doing lookups when we know the
15891 namespace is non-existant. Use new Tree.LookupByNamespace which
15892 looks up DeclSpaces based on their namespace, name pair.
15894 * driver.cs: Provide a new `parser verbose' to display the
15895 exception thrown during parsing. This is turned off by default
15896 now, so the output of a failure from mcs is more graceful.
15898 * namespace.cs: Track all the namespaces defined in a hashtable
15901 (IsNamespace): New method
15903 2003-08-09 Miguel de Icaza <miguel@ximian.com>
15905 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
15906 we know that we need to concatenate (full typename can never be
15911 * statement.cs: Use a bitfield; Do not initialize to null things
15912 which are done by the constructor by default.
15914 * cs-parser.jay: bug fix, parameter was 4, not 3.
15916 * expression.cs: Just use the property;
15918 * statement.cs: No need for GetVariableInfo method.
15920 2003-08-08 Martin Baulig <martin@ximian.com>
15922 * flowanalysis.cs (FlowReturns): This is now nested in the
15923 `FlowBranching' class.
15924 (MyBitVector): Moved this here from statement.cs.
15925 (FlowBranching.SiblingType): New enum type.
15926 (FlowBranching.CreateSibling): Added `SiblingType' argument.
15928 2003-08-07 Martin Baulig <martin@ximian.com>
15930 * flowanalysis.cs (FlowBranchingType): This is now nested in the
15931 `FlowBranching' class and called `BranchingType'.
15933 2003-08-07 Martin Baulig <martin@ximian.com>
15935 * flowanalysis.cs: Moved all the control flow analysis code into
15938 2003-08-07 Martin Baulig <martin@ximian.com>
15940 * assign.cs (Assign.DoResolve): `target' must either be an
15941 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
15944 2003-08-07 Miguel de Icaza <miguel@ximian.com>
15946 * expression.cs (BinaryMethod): This kind of expression is created by the
15947 Binary class if it determines that the operator has to be handled
15950 (BinaryDelegate): This kind of expression is created if we are
15951 dealing with a + or - operator on delegates.
15953 (Binary): remove method, argumetns, and DelegateOperator: when
15954 dealing with methods,
15956 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
15958 * statement.cs (Block): use bitfields for the three extra booleans
15959 we had in use. Remove unused topblock parameter.
15961 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
15963 * assign.cs: Drop extra unneeded tests.
15965 2003-08-06 Miguel de Icaza <miguel@ximian.com>
15967 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
15969 * statement.cs (Foreach): Use VariableStorage instead of
15972 * codegen.cs (VariableStorage): New class used by clients that
15973 require a variable stored: locals or fields for variables that
15974 need to live across yield.
15976 Maybe provide a convenience api for EmitThis+EmitLoad?
15978 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
15981 2003-08-05 Miguel de Icaza <miguel@ximian.com>
15983 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
15984 RemapParameterLValue): New methods that are used to turn a
15985 precomputed FieldInfo into an expression like this:
15989 The idea is to use this instead of making LocalVariableReference
15990 have more than one meaning.
15992 * cs-parser.jay: Add error production to BASE.
15994 * ecore.cs: Deal with TypeManager.GetField returning null, which
15995 is now a valid return value.
15997 (FieldExprNoAddress): New expression for Fields whose address can
16000 * expression.cs (LocalVariableReference): During the resolve
16001 phases, create new expressions if we are in a remapping context.
16002 Remove code that dealt with remapping here.
16004 (ParameterReference): same.
16006 (ProxyInstance): New expression, like the `This' expression, but
16007 it is born fully resolved. We know what we are doing, so remove
16008 the errors that are targeted to user-provided uses of `this'.
16010 * statement.cs (Foreach): our variable is now stored as an
16011 Expression; During resolution, follow the protocol, dont just
16012 assume it will return this.
16014 2003-08-06 Martin Baulig <martin@ximian.com>
16016 * support.cs (SeekableStreamReader.cs): New public class.
16018 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
16019 SeekableStreamReader instead of the normal StreamReader.
16021 2003-08-04 Martin Baulig <martin@ximian.com>
16023 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
16024 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
16025 deambiguate casts and delegate invocations.
16026 (parenthesized_expression): Use the new tokens to ensure this is
16027 not a cast of method invocation.
16029 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
16030 when reading a `)' and Deambiguate_CloseParens () was previously
16033 * expression.cs (ParenthesizedExpression): New class. This is
16034 just used for the CS0075 test.
16035 (Binary.DoResolve): Check for CS0075.
16037 2003-07-29 Ravi Pratap <ravi@ximian.com>
16039 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
16040 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
16041 reference comparison.
16043 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
16044 examine the ReturnType for equality - this is necessary in the
16045 cases of implicit and explicit operators whose signature also
16046 includes the return type.
16048 2003-07-26 Miguel de Icaza <miguel@ximian.com>
16050 * namespace.cs: Cache the result of the namespace computation,
16051 instead of computing it every time.
16053 2003-07-24 Miguel de Icaza <miguel@ximian.com>
16055 * decl.cs: Use a global arraylist that we reuse over invocations
16056 to avoid excesive memory consumption. Reduces memory usage on an
16057 mcs compile by one meg (45 average).
16059 * typemanager.cs (LookupTypeReflection): In .NET pointers are
16060 private, work around that.
16062 2003-07-23 Miguel de Icaza <miguel@ximian.com>
16064 * literal.cs (IntLiteral): Define Zero and One static literals.
16066 * cs-parser.jay (integer_literal): use static literals to reduce
16067 memory usage for the most used literals (0, 1 and -1). 211kb
16068 reduced in memory usage.
16070 Replace all calls to `new ArrayList' with `new
16071 ArrayList(4)' which is a good average number for most allocations,
16072 and also requires only 16 bytes of memory for its buffer by
16075 This reduced MCS memory usage in seven megabytes for the RSS after
16078 2003-07-28 Ravi Pratap <ravi@ximian.com>
16080 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
16081 handle params methods the correct way by forming only one
16082 applicable set with params and normal methods in them. Earlier we
16083 were looking at params methods only if we found no normal methods
16084 which was not the correct thing to do.
16086 (Invocation.BetterFunction): Take separate arguments indicating
16087 when candidate and the best method are params methods in their
16090 This fixes bugs #43367 and #46199.
16092 * attribute.cs: Documentation updates.
16094 (CheckAttribute): Rename to CheckAttributeTarget.
16095 (GetValidPlaces): Rename to GetValidTargets.
16097 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
16098 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
16102 2003-07-28 Martin Baulig <martin@ximian.com>
16104 * class.cs (TypeContainer.DefineMembers): Use the base type's full
16105 name when looking up the base class of a nested class. Fixes #46977.
16107 2003-07-26 Martin Baulig <martin@ximian.com>
16109 * expression.cs (Indexers.Indexer): New nested struct; contains
16110 getter, setter and the indexer's type.
16111 (Indexers.Properties): This is now an ArrayList of
16112 Indexers.Indexer's.
16113 (IndexerAccess.DoResolveLValue): Correctly set the type if the
16114 indexer doesn't have any getters.
16116 * assign.cs (Assign.DoResolve): Also do the implicit conversions
16117 for embedded property and indexer assignments.
16119 2003-07-26 Martin Baulig <martin@ximian.com>
16121 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
16122 preprocessor directive is not the first non-whitespace character
16125 2003-07-26 Martin Baulig <martin@ximian.com>
16127 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
16128 namespace parsing, follow the spec more closely.
16130 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
16131 NamespaceEntry.Lookup().
16133 2003-07-25 Martin Baulig <martin@ximian.com>
16135 * MethodCore.cs (OverridesSomething): New public field; it's set
16136 from TypeContainer.DefineMembers if this method overrides
16137 something (which doesn't need to be a method). Fix #39462.
16139 2003-07-25 Ravi Pratap <ravi@ximian.com>
16141 * typemanager.cs (GetMembers): Ensure that the list of members is
16142 reversed. This keeps things in sync.
16144 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
16145 find an AttributeUsage attribute.
16147 * expression.cs (Invocation.OverloadResolve): Perform the check
16148 which disallows Invoke to be directly called on a Delegate.
16150 (Error_InvokeOnDelegate): Report error cs1533.
16152 2003-07-25 Martin Baulig <martin@ximian.com>
16154 * expression.cs (Indexers.GetIndexersForType): Only look in the
16155 interface hierarchy if the requested type is already an
16156 interface. Fixes #46788 while keeping #46502 fixed.
16158 2003-07-25 Martin Baulig <martin@ximian.com>
16160 * class.cs (TypeContainer.DefineMembers): Check whether all
16161 readonly fields have been assigned and report warning CS0649 if
16164 * statement.cs (LocalInfo.IsFixed): Always return true if this is
16167 2003-07-24 Ravi Pratap <ravi@ximian.com>
16169 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
16170 returned from GetMethods to make things consistent with the
16171 assumptions MCS makes about ordering of methods.
16173 This should comprehensively fix bug #45127 and it does :-)
16175 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
16176 ordering is actually reverse.
16178 * Clean up some debug messages I left lying around.
16180 * interface.cs (Populate*): Get rid of code which emits attributes
16181 since the stage in which we emit attributes is the 'Emit' stage,
16182 not the define stage.
16184 (Emit): Move attribute emission for interface members here.
16186 2003-07-22 Ravi Pratap <ravi@ximian.com>
16188 * expression.cs (Invocation.OverloadResolve): Follow the spec more
16189 closely: we eliminate methods in base types when we have an
16190 applicable method in a top-level type.
16192 Please see section 14.5.5.1 for an exact description of what goes
16195 This fixes bug #45127 and a host of other related to corlib compilation.
16197 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
16198 array is the method corresponding to the top-level type (this is
16199 because of the changes made to icall.c) so we change this
16202 (MethodGroupExpr.Name): This too.
16204 * typemanager.cs (GetElementType): New method which does the right
16205 thing when compiling corlib.
16207 * everywhere: Make use of the above in the relevant places.
16209 2003-07-22 Martin Baulig <martin@ximian.com>
16211 * cs-parser.jay (invocation_expression): Moved
16212 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
16213 `cast_expression', but create a InvocationOrCast which later
16214 resolves to either an Invocation or a Cast.
16216 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
16217 method; call this before EmitStatement() to make sure that this
16218 expression can be used as a statement.
16220 * expression.cs (InvocationOrCast): New class; resolves to either
16221 an Invocation or a Cast.
16223 * statement.cs (StatementExpression): Call ResolveStatement() on
16224 the ExpressionStatement before emitting it.
16226 2003-07-21 Martin Baulig <martin@ximian.com>
16228 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
16229 `ref' and `out' attributes match; fixes #46220.
16230 (MemberAccess.ResolveMemberAccess): You can't reference a type
16231 through an expression; fixes #33180.
16232 (Indexers.GetIndexersForType): Don't return the indexers from
16233 interfaces the class implements; fixes #46502.
16235 2003-07-21 Martin Baulig <martin@ximian.com>
16237 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
16238 CS0661 checks; fixes bug #30442.
16240 2003-07-21 Martin Baulig <martin@ximian.com>
16242 * decl.cs (AdditionResult): Added `Error'.
16244 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
16246 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
16247 makes cs0031.cs actually work.
16249 2003-07-20 Martin Baulig <martin@ximian.com>
16251 * namespace.cs: Fixed that bug which caused a crash when compiling
16252 the debugger's GUI.
16254 2003-07-20 Miguel de Icaza <miguel@ximian.com>
16256 * typemanager.cs (LookupTypeReflection): Never expose types which
16257 are NotPublic, NestedPrivate, NestedAssembly, or
16258 NestedFamANDAssem. We used to return these, and later do a check
16259 that would report a meaningful error, but the problem is that we
16260 would not get the real match, if there was a name override.
16262 2003-07-18 Miguel de Icaza <miguel@ximian.com>
16264 * namespace.cs (Namespace, Name): Do not compute the namespace
16265 name dynamically, compute it in the constructor. This reduced
16266 memory usage by 1697 KB.
16268 * driver.cs: Use --pause to pause at the end.
16270 2003-07-17 Peter Williams <peter@newton.cx>
16272 * Makefile: Change the name of the test target so that it doesn't
16273 conflict with the recursive test target.
16275 2003-07-17 Miguel de Icaza <miguel@ximian.com>
16277 * expression.cs (LocalVariableReference.Emit, EmitAssign,
16278 AddressOf): Do not use EmitThis, that was wrong, use the actual
16281 2003-07-15 Miguel de Icaza <miguel@ximian.com>
16283 * class.cs (MethodData.Define): While checking if a method is an
16284 interface implementation, improve the test: If we are not public
16285 (use new test here: use the computed MethodAttributes directly,
16286 instead of the parsed modifier flags) check if the `implementing'
16287 method comes from an interface or not.
16289 * pending.cs (VerifyPendingMethods): Slightly better error
16292 * makefile: add test target that does the mcs bootstrap.
16294 2003-07-16 Ravi Pratap <ravi@ximian.com>
16296 * interface.cs (Define): Do nothing here since there are no
16297 members to populate etc. Move the attribute emission out of here
16298 since this was just totally the wrong place to put it. Attribute
16299 application happens during the 'Emit' phase, not in the 'Define'
16302 (Emit): Add this method and move the attribute emission here
16304 * rootcontext.cs (EmitCode): Call the Emit method on interface
16307 2003-07-14 Ravi Pratap M <ravi@ximian.com>
16309 * expression.cs (OverloadResolve): Report error only if Location
16310 is not 'Null' which means that there was a probe going on.
16312 2003-07-14 Martin Baulig <martin@ximian.com>
16314 * expression.cs (ConditionalLogicalOperator): New public class to
16315 implement user defined conditional logical operators.
16316 This is section 14.11.2 in the spec and bug #40505.
16318 2003-07-14 Martin Baulig <martin@ximian.com>
16320 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
16322 2003-07-14 Martin Baulig <martin@ximian.com>
16324 * codegen.cs (EmitContext.InFixedInitializer): New public field.
16326 * ecore.cs (IVariable.VerifyFixed): New interface method.
16328 * expression.cs (Unary.ResolveOperator): When resolving the `&'
16329 operator, check whether the variable is actually fixed. Fixes bug
16330 #36055. Set a variable definitely assigned when taking its
16331 address as required by the spec.
16333 * statement.cs (LocalInfo.IsFixed): New field.
16334 (LocalInfo.MakePinned): Set `IsFixed' to true.
16336 2003-07-14 Ravi Pratap M <ravi@ximian.com>
16338 * attribute.cs (Attribute.Resolve): While doing a Member lookup
16339 for .ctors, ensure that we only ask for members declared in the
16340 attribute type (BindingFlags.DeclaredOnly).
16344 * expression.cs (Error_WrongNumArguments): Report error 1501
16345 correctly the way CSC does.
16347 2003-07-13 Martin Baulig <martin@ximian.com>
16349 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
16350 lookup on the fully qualified name, to make things like "X.X" work
16351 where "X.X" is a fully qualified type name, but we also have a
16352 namespace "X" in the using list. Fixes #41975.
16354 2003-07-13 Martin Baulig <martin@ximian.com>
16356 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
16357 function. If we're a CompoundAssign, we need to create an embedded
16358 CompoundAssign, not an embedded Assign.
16359 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
16362 2003-07-13 Martin Baulig <martin@ximian.com>
16364 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
16365 work to fix bug #46088.
16367 2003-07-13 Ravi Pratap <ravi@ximian.com>
16369 * class.cs (Operator.Emit): Do not emit attributes here - it is
16370 taken care of by the Method class that we delegate too. This takes
16371 care of bug #45876.
16373 2003-07-10 Martin Baulig <martin@ximian.com>
16375 * expression.cs (TypeOfVoid): New class.
16376 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
16378 2003-07-10 Martin Baulig <martin@ximian.com>
16380 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
16383 2003-07-10 Martin Baulig <martin@ximian.com>
16385 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
16386 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
16388 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
16390 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
16392 2003-07-10 Martin Baulig <martin@ximian.com>
16394 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
16395 of decimal. Fixes #42850.
16397 NOTE: I also fixed the created byte blob, but this doesn't work on
16398 the MS runtime and csc never produces any byte blobs for decimal
16401 2003-07-10 Martin Baulig <martin@ximian.com>
16403 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
16404 structs; fixes #32068.
16405 (Block.AddChildVariableNames): Fixed #44302.
16407 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16409 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
16411 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16413 * attribute.cs: And this test is onger needed.
16415 2003-07-08 Martin Baulig <martin@ximian.com>
16417 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
16418 inaccessible types. Fixes #36313.
16420 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
16422 * namespace.cs (NamespaceEntry): Create implicit entries for all
16423 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
16424 implicit entries for N1.N2 and N1.
16426 2003-07-08 Martin Baulig <martin@ximian.com>
16428 Rewrote the handling of namespaces to fix a lot of the issues
16429 wrt. `using' aliases etc.
16431 * namespace.cs (Namespace): Splitted this class into a
16432 per-assembly `Namespace' and a per-file `NamespaceEntry'.
16434 * typemanager.cs (TypeManager.IsNamespace): Removed.
16435 (TypeManager.ComputeNamespaces): Only compute namespaces from
16436 loaded assemblies here, not the namespaces from the assembly we're
16437 currently compiling.
16439 2003-07-08 Martin Baulig <martin@ximian.com>
16441 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
16443 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16445 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
16448 I thought about the memory savings here, but LookupTypeReflection
16449 is used under already very constrained scenarios. Compiling
16450 corlib or mcs only exposes one hit, so it would not really reduce
16451 any memory consumption.
16453 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16455 * typemanager.cs: fixes bug #45889 by only adding public types from
16456 other assemblies to the list of known types.
16458 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16460 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
16461 on the type we resolved.
16463 2003-07-05 Martin Baulig <martin@ximian.com>
16465 * pending.cs (PendingImplementation.ParentImplements): Don't
16466 create the proxy if the parent is abstract.
16468 * class.cs (TypeContainer.DefineIndexers): Process explicit
16469 interface implementations first. Fixes #37714.
16471 2003-07-04 Miguel de Icaza <miguel@ximian.com>
16473 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
16474 defined recursively; but since we modify the input parameters
16475 (left is set to `this' temporarily), we reset this value if the
16476 left_is_explicit is false, which gives the original semantics to
16479 * literal.cs (NullPointer): new class used to represent a null
16480 literal in a pointer context.
16482 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
16483 type is a pointer, use a NullPointer object instead of a
16484 NullLiteral. Closes 43687
16486 (ExplicitConversion): Convert pointer values using
16487 the conv opcode to the proper type.
16489 * ecore.cs (New): change ValueTypeVariable property into a method,
16490 that returns whether the valuetype is suitable for being used.
16492 * expression.cs (Binary.DoNumericPromotions): Only return if we
16493 the int constant was a valid uint, and we can return both left and
16494 right as uints. If not, we continue processing, to trigger the
16495 type conversion. This fixes 39018.
16497 * statement.cs (Block.EmitMeta): During constant resolution, set
16498 the CurrentBlock property on the emitcontext, so that we resolve
16499 constants propertly.
16501 2003-07-02 Martin Baulig <martin@ximian.com>
16503 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
16504 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
16506 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
16507 than emitting it here.
16509 * statement.cs: Fixed some more flow analysis bugs.
16511 2003-07-02 Martin Baulig <martin@ximian.com>
16513 * class.cs (MethodData.Define): When implementing interface
16514 methods, set Final unless we're Virtual.
16516 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
16517 check work for interface methods.
16519 2003-07-01 Martin Baulig <martin@ximian.com>
16521 * ecore.cs (EmitContext.This): Replaced this property with a
16522 GetThis() method which takes a Location argument. This ensures
16523 that we get the correct error location for a CS0188.
16525 2003-07-01 Miguel de Icaza <miguel@ximian.com>
16527 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
16528 ImplicitStandardConversion.
16530 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
16532 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
16534 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
16537 2003-06-30 Miguel de Icaza <miguel@ximian.com>
16539 * class.cs (Constructor.Define): Turn off initlocals for unsafe
16542 (MethodData.Define): Turn off initlocals for unsafe methods.
16544 2003-06-29 Miguel de Icaza <miguel@ximian.com>
16546 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
16547 complete; Fixes #37521.
16549 * delegate.cs: Use Modifiers.TypeAttr to compute the
16550 TypeAttributes, instead of rolling our own. This makes the flags
16551 correct for the delegates.
16553 2003-06-28 Miguel de Icaza <miguel@ximian.com>
16555 * class.cs (Constructor.Define): Set the private flag for static
16556 constructors as well.
16558 * cs-parser.jay (statement_expression): Set the return value to
16559 null, to avoid a crash when we catch an error.
16561 2003-06-24 Miguel de Icaza <miguel@ximian.com>
16563 * cs-parser.jay: Applied patch from Jackson that adds support for
16564 extern and unsafe modifiers to destructor declarations.
16566 * expression.cs: Report error 21 if the user is trying to index a
16569 * driver.cs: Add an error message, suggested by the bug report.
16571 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
16572 if we do not have a ": this ()" constructor initializer. Fixes 45149
16574 2003-06-14 Miguel de Icaza <miguel@ximian.com>
16576 * namespace.cs: Add some information to reduce FAQs.
16578 2003-06-13 Miguel de Icaza <miguel@ximian.com>
16580 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
16581 underlying enumeration types. Fixes #43915.
16583 * expression.cs: Treat ushort/short as legal values to be used in
16584 bitwise operations.
16586 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
16588 * delegate.cs: transfer custom attributes for paramenters from
16589 the delegate declaration to Invoke and BeginInvoke.
16591 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
16593 * attribute.cs: handle custom marshalers and emit marshal info
16596 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
16598 * makefile.gnu: Added anonymous.cs to the compiler sources.
16600 2003-05-28 Miguel de Icaza <miguel@ximian.com>
16602 * iterators.cs: Change the name of the proxy class to include two
16605 * cs-parser.jay: Update grammar to include anonymous methods.
16607 * anonymous.cs: new file.
16609 2003-05-27 Miguel de Icaza <miguel@ximian.com>
16611 * class.cs (Field.Define): Add missing test for pointers and
16614 2003-05-27 Ravi Pratap <ravi@ximian.com>
16616 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
16617 we use the stobj opcode.
16619 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
16620 since it wasn't the correct fix.
16622 It still is puzzling that we are required to use stobj for IntPtr
16623 which seems to be a ValueType.
16625 2003-05-26 Miguel de Icaza <miguel@ximian.com>
16627 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
16628 during regular simple name resolution. Now, the trick is that
16629 instead of returning for processing the simplename, we do a
16630 TypeManager.LookupType (ie, a rooted lookup as opposed to a
16631 contextual lookup type). If a match is found, return that, if
16632 not, return for further composition.
16634 This fixes long-standing 30485.
16636 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16637 using the address to initialize an object, do an Stobj instead of
16638 using the regular Stelem.
16640 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
16641 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
16642 Because if we are a BaseIndexerAccess that value will be true.
16645 * statement.cs (GotoCase.Resolve): Return after reporting an
16646 error, do not attempt to continue.
16648 * expression.cs (PointerArithmetic.Emit): If our operand is a
16649 long, convert our constants to match the operand before
16650 multiplying. Convert to I type before adding. Fixes 43670.
16652 2003-05-14 Ravi Pratap <ravi@ximian.com>
16654 * enum.cs (ImplicitConversionExists) : Rename to
16655 ImplicitEnumConversionExists to remove ambiguity.
16657 * ecore.cs (NullCast): New type of cast expression class which
16658 basically is very similar to EmptyCast with the difference being
16659 it still is a constant since it is used only to cast a null to
16661 (eg. (string) null)
16663 * convert.cs (ImplicitReferenceConversion): When casting a null
16664 literal, we return a NullCast.
16666 * literal.cs (NullLiteralTyped): Remove - I don't see why this
16667 should be around anymore.
16669 The renaming (reported was slightly wrong). Corrections:
16671 ConvertImplicitStandard -> ImplicitConversionStandard
16672 ConvertExplicitStandard -> ExplicitConversionStandard
16674 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
16675 before passing them in !
16677 * convert.cs (ImplicitConversionStandard): When comparing for
16678 equal expr and target types, ensure that expr is not a
16681 In general, we must not be checking (expr_type ==
16682 target_type) in the top level conversion methods
16683 (ImplicitConversion, ExplicitConversion etc). This checking is
16684 done in the methods that they delegate to.
16686 2003-05-20 Miguel de Icaza <miguel@ximian.com>
16688 * convert.cs: Move Error_CannotConvertType,
16689 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
16690 ImplicitNumericConversion, ImplicitConversionExists,
16691 ImplicitUserConversionExists, StandardConversionExists,
16692 FindMostEncompassedType, FindMostSpecificSource,
16693 FindMostSpecificTarget, ImplicitUserConversion,
16694 ExplicitUserConversion, GetConversionOperators,
16695 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
16696 TryImplicitIntConversion, Error_CannotConvertImplicit,
16697 ConvertImplicitRequired, ConvertNumericExplicit,
16698 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
16699 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
16702 Perform the following renames:
16704 StandardConversionExists -> ImplicitStandardConversionExists
16705 ConvertImplicit -> ImplicitConversion
16706 ConvertImplicitStandard -> ImplicitStandardConversion
16707 TryImplicitIntConversion -> ImplicitIntConversion
16708 ConvertImplicitRequired -> ImplicitConversionRequired
16709 ConvertNumericExplicit -> ExplicitNumericConversion
16710 ConvertReferenceExplicit -> ExplicitReferenceConversion
16711 ConvertExplicit -> ExplicitConversion
16712 ConvertExplicitStandard -> ExplicitStandardConversion
16714 2003-05-19 Martin Baulig <martin@ximian.com>
16716 * statement.cs (TypeInfo.StructInfo): Made this type protected.
16717 (TypeInfo): Added support for structs having structs as fields.
16719 * ecore.cs (FieldExpr): Implement IVariable.
16720 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
16721 VariableInfo for the field.
16723 2003-05-18 Martin Baulig <martin@ximian.com>
16725 * expression.cs (This.DoResolve): Report a CS0027 if we're
16726 emitting a field initializer.
16728 2003-05-18 Martin Baulig <martin@ximian.com>
16730 * expression.cs (This.ResolveBase): New public function.
16731 (This.DoResolve): Check for CS0188.
16733 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
16736 * ecore.cs (MethodGroupExpr.DoResolve): Set the
16737 `instance_expression' to null if we don't have any non-static
16740 2003-05-18 Martin Baulig <martin@ximian.com>
16742 Reworked the way how local variables and parameters are handled by
16743 the flow analysis code.
16745 * statement.cs (TypeInfo, VariableMap): New public classes.
16746 (VariableInfo): New public class. This is now responsible for
16747 checking whether a variable has been assigned. It is used for
16748 parameters and local variables.
16749 (Block.EmitMeta): Take the InternalParameters as argument; compute
16750 the layout of the flow vectors here.
16751 (Block.LocalMap, Block.ParameterMap): New public properties.
16752 (FlowBranching): The .ctor doesn't get the InternalParameters
16753 anymore since Block.EmitMeta() now computes the layout of the flow
16755 (MyStructInfo): This class is now known as `StructInfo' and nested
16756 in `TypeInfo'; we don't access this directly anymore.
16758 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
16759 property and removed IsAssigned(), IsFieldAssigned(),
16760 SetAssigned() and SetFieldAssigned(); we now call them on the
16761 VariableInfo so we don't need to duplicate this code everywhere.
16763 * expression.cs (ParameterReference): Added `Block block' argument
16765 (LocalVariableReference, ParameterReference, This): The new
16766 VariableInfo class is now responsible for all the definite
16769 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
16770 IsParameterAssigned, SetParameterAssigned): Removed.
16772 2003-05-18 Martin Baulig <martin@ximian.com>
16774 * typemanager.cs (InitCoreTypes): Try calling
16775 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
16776 the 3-args-version. Corlib now also needs our `void_type'.
16777 (GetMethod): Added overloaded version which takes an optional
16778 `bool report_errors' to allow lookups of optional methods.
16780 2003-05-12 Martin Baulig <martin@ximian.com>
16782 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
16783 only used for locals and not for parameters.
16785 2003-05-12 Miguel de Icaza <miguel@ximian.com>
16787 * support.cs (InternalParameters.ParameterType): Return the
16788 ExternalType of the parameter.
16790 * parameter.cs (Parameter.ExternalType): drop the two arguments,
16793 2003-05-11 Miguel de Icaza <miguel@ximian.com>
16795 * class.cs (MethodData.Define): Do not set the `newslot' on
16796 interface members, if they are also flagged as "override".
16798 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
16799 better code for ++i and i++. This only works for static fields
16800 and local variables.
16802 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
16803 want to pull the DeclSpace out of the builder_to_declspace instead
16804 of the TypeBuilder (like in TypeContainer.FindMembers).
16806 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
16807 instead of LookupTypeContainer. Fixes the crash on .NET for
16808 looking up interface members.
16810 * const.cs: Create our own emit context during the Definition
16811 stage, so that constants are evaluated in the proper context, when
16812 a recursive definition happens.
16814 2003-05-11 Martin Baulig <martin@ximian.com>
16816 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
16817 new block for a switch section.
16818 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
16819 the adding/lookup in the switch block. Fixes #39828.
16821 2003-05-09 Miguel de Icaza <miguel@ximian.com>
16823 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
16824 functionality: I needed to convert the data after I had performed
16825 the add/sub operation into the operands type size.
16827 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
16828 pass the type for the box operation, otherwise the resulting
16829 object would have been of type object.
16831 (BoxedCast): Add constructor to specify the type to box as.
16833 2003-05-07 Miguel de Icaza <miguel@ximian.com>
16835 * iterators.cs: I was reusing the `count' variable inadvertently,
16836 take steps to not allow this to happen.
16838 2003-05-06 Miguel de Icaza <miguel@ximian.com>
16840 * attribute.cs (Attribute.Resolve): Params attributes are encoded
16841 by creating an array at the point where the params starts and
16842 putting all those arguments there, then adjusting the size of the
16845 2003-05-05 Miguel de Icaza <miguel@ximian.com>
16847 * expression.cs (New.AddressOf): Implement interface
16848 IMemoryLocation. This is used when the `new' operator is used in
16849 the context of an invocation to a method on a value type.
16851 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
16854 * namespace.cs: Also check the using aliases here.
16856 * driver.cs: Move the test for using validity after the types have
16857 been entered, so we do a single pass that also includes the using
16860 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
16861 in the regular case. CreateSiblingForFinally is doing extra
16864 * attribute.cs (GetAttributeArgumentExpression): Store the result
16865 on an out value, and use the return value to indicate failure
16866 instead of using null (which is a valid return for Constant.GetValue).
16868 * statement.cs: Perform the analysis flow for the increment
16869 portion after the statement, because this will be the real flow of
16870 execution. Fixes #42385
16872 * codegen.cs (EmitContext.EmitArgument,
16873 EmitContext.EmitStoreArgument): New helper functions when the
16874 RemapToProxy flag is set.
16876 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
16879 Add support for remapping parameters.
16881 * iterators.cs: Propagate parameter values; Store parameter
16882 values in the proxy classes.
16884 2003-05-04 Miguel de Icaza <miguel@ximian.com>
16886 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
16887 need a proxy reference; I do not know what I was thinking
16889 * cs-parser.jay (constructor_initializer): catch another error,
16890 and display nice message.
16892 (field_declaration): catch void field declaration
16893 to flag a better error.
16895 * class.cs (MemberBase.CheckBase): Report an error instead of a
16896 warning if a new protected member is declared in a struct.
16897 (Field.Define): catch the error of readonly/volatile.
16899 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
16901 (FieldExpr.AddressOf): ditto. Catch error where the address of a
16902 volatile variable is taken
16904 2003-05-02 Miguel de Icaza <miguel@ximian.com>
16906 * statement.cs (Fixed.Resolve): Report an error if we are not in
16909 2003-05-01 Miguel de Icaza <miguel@ximian.com>
16911 * typemanager.cs: reuse the code that handles type clashes for
16912 delegates and enumerations.
16914 * class.cs (Report28): Always report.
16916 * expression.cs (EncodeAsAttribute): Allow nulls here.
16918 2003-04-28 Miguel de Icaza <miguel@ximian.com>
16920 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
16921 the functionality for testing whether an expression is valid for
16922 an attribute here. Also handle the case of arrays of elements
16925 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
16926 encoding a linear array into an array of objects that are suitable
16927 to be passed to an CustomAttributeBuilder.
16929 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
16931 * ecore.cs: (FieldExpr): Handle field remapping here.
16933 * iteratators.cs: Pass the instance variable (if the method is an
16934 instance method) to the constructors, so we can access the field
16935 variables on the class.
16937 TODO: Test this with structs. I think the THIS variable on
16938 structs might have to be a pointer, and not a refenrece
16940 2003-04-27 Miguel de Icaza <miguel@ximian.com>
16942 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
16943 local variables to fields in a proxy class.
16945 * iterators.cs (PopulateProxy): Rename our internal fields to
16947 Create a <THIS> field if we are an instance method, so we can
16948 reference our parent container variables.
16949 (MapVariable): Called back from the EmitContext code to enter a
16950 new variable to field mapping into the proxy class (we just create
16954 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
16955 for using the remapped locals to fields.
16957 I placed the code here, because that gives the same semantics to
16958 local variables, and only changes the Emit code.
16960 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
16961 statements inside iterators.
16962 (VariableInfo): Add a FieldBuilder for the cases when we are
16963 remapping local variables to fields in a proxy class
16965 * ecore.cs (SimpleNameResolve): Avoid testing two times for
16966 current_block != null.
16968 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
16969 not cope with strings, as it has been moved to the
16970 TableSwitchEmit. Fixed bug in switch generation.
16972 * expression.cs (New.DoResolve): Provide more context for the user
16973 when reporting an error.
16975 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
16978 * expression.cs (MemberAccess.DoResolve): When we get a type back,
16979 check the permissions for it. Note than in a type-resolution
16980 context the check was already present in DeclSpace.ResolveType,
16981 but was missing from the MemberAccess.
16983 (ArrayCreation.CheckIndices): warn if the user has
16984 more nested levels of expressions, but there are no more
16985 dimensions specified. Avoids crash on bug 41906.
16987 2003-04-26 Miguel de Icaza <miguel@ximian.com>
16989 * statement.cs (Block): replace Implicit bool, for a generic
16991 New flag: `Unchecked'. This is used during the EmitMeta phase
16992 (which is out-of-line with the regular Resolve/Emit process for a
16993 statement, as this is done ahead of time, but still gets a chance
16994 to call constant resolve).
16996 (Block.Flags): new enum for adding a new flag.
16998 (Block.EmitMeta): track the state of unchecked.
17000 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
17001 to enable constant resolution to work there as well.
17003 2003-04-22 Miguel de Icaza <miguel@ximian.com>
17005 * typemanager.cs (ienumerable_type): Also look up
17006 System.Collections.IEnumerable.
17008 2003-04-21 Miguel de Icaza <miguel@ximian.com>
17010 TODO: Test more than one conditional per method.
17012 * class.cs (Indexer.Define): Report the location where the user is
17013 referencing the unsupported feature.
17015 (MethodData): Overload the use of `conditionals' to
17016 minimize the creation of needless ArrayLists. This saves roughly
17017 212kb on my machine.
17019 (Method): Implement the new IIteratorContainer interface.
17020 (Method.SetYields): Implement the method by setting the ModFlags
17021 to contain METHOD_YIELDS.
17023 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
17024 which just got set to null.
17026 * iterators.cs: New file.
17028 (Yield, YieldBreak): New statements.
17030 * statement.cs (Return.Resolve): Flag an error if we are used in
17031 an iterator method.
17033 * codegen.cs (InIterator): New flag set if the code is being
17034 compiled in an iterator method.
17036 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
17037 internal modifier, and we just use it to avoid adding extra
17038 fields, as this is seldom used.
17040 * cs-parser.jay: Add yield_statement (yield and yield break).
17042 * driver.cs: New flag -v2 to turn on version 2 features.
17044 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
17045 hashtable when v2 is enabled.
17047 2003-04-20 Miguel de Icaza <miguel@ximian.com>
17049 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
17050 there is already a namespace defined with this name.
17052 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
17053 people upgraded their corlibs.
17055 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
17056 always use fully qualified types, no need to use the compiler
17059 (TypeManager.IsNamespace): Use binarysearch.
17061 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
17062 AddDelegate): I did not quite use the new IsValid API properly: I
17063 have to pass the short-name and the fullname. I was passing only
17064 the basename instead of the fullname sometimes.
17066 (TypeContainer.DefineType): call NamespaceClash.
17068 * interface.cs (Interface.DefineType): use NamespaceClash before
17071 * delegate.cs (Delegate.DefineType): use NamespaceClash before
17074 * enum.cs: (Enum.DefineType): use NamespaceClash before
17077 * typemanager.cs (: 3-line patch that gives us some tasty 11%
17078 speed increase. First, use the negative_hits cache when we get a
17079 negative. Second, add the type with its full original name
17080 instead of the new . and + encoded name (reflection uses + to
17081 separate type from a nested type). Use LookupTypeReflection
17082 directly which bypasses the type->name hashtable (that we already
17083 know does not contain the type.
17085 * decl.cs (DeclSpace.ResolveTypeExpr): track the
17086 location/container type.
17088 * driver.cs: When passing utf8, use directly the UTF8Encoding.
17090 2003-04-19 Miguel de Icaza <miguel@ximian.com>
17092 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
17094 * delegate.cs (NewDelegate.Resolve): Test whether an instance
17095 method is being referenced in the method group from a static
17096 context, and report error 120 if so.
17098 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
17101 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
17102 is created, we create the A namespace).
17104 * cs-parser.jay: A namespace also introduces a DeclarationFound.
17107 2003-04-18 Miguel de Icaza <miguel@ximian.com>
17109 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
17110 invocation to ModuleBuilder.GetType with the same values will
17111 return a new type instance, so we need to cache its return
17114 * expression.cs (Binary.ResolveOperator): Only allow the compare
17115 operators on enums if they are of the same type.
17117 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
17118 types of ValueType on their own case. Before we were giving them
17119 the same treatment as objects.
17121 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
17122 fullname. Short name is used to compare against container name.
17123 Fullname is used to check against defined namespace names.
17125 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
17126 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
17128 (Method.CheckBase): Call parent.
17129 (MemberBase.CheckBase): Check for protected members on sealed
17131 (PropertyBase.CheckBase): Call parent.
17132 (Field.Define): Call parent.
17134 * report.cs: Negative error codes are now mapped to 8000 - code,
17135 so that the display is render more nicely.
17137 * typemanager.cs: Do not use try/catch, instead report a regular
17140 (GetPointerType, GetReferenceType): These methods provide
17141 mechanisms to obtain the T* and T& from a T. We had the code
17142 previously scattered around the code base, and it also used
17143 TypeManager.LookupType that would go through plenty of caches.
17144 This one goes directly to the type source.
17146 In some places we did the Type.GetType followed by
17147 ModuleBuilder.GetType, but not in others, so this unifies the
17148 processing as well.
17150 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
17151 statements now that we have namespace information.
17153 * typemanager.cs (IsNamespace): New method, returns whether the
17154 string presented is a namespace or not.
17156 (ComputeNamespaces): New public entry point, computes the list of
17157 available namespaces, using the GetNamespaces API call in Mono, or
17158 the slower version in MS.NET.
17160 Now before we start the semantic analysis phase, we have a
17161 complete list of namespaces including everything that the user has
17164 Deleted old code to cache namespaces in .nsc files.
17166 2003-04-17 Miguel de Icaza <miguel@ximian.com>
17168 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
17169 class/struct location definition Location for the implicit
17170 constructor location.
17172 (Operator.Define): Use the location of the operator for the
17173 implicit Method definition.
17175 (Constructor.Emit): use the constructor location for the implicit
17176 base initializer constructor.
17178 * ecore.cs: Remove ITypeExpression. This interface is now gone,
17179 and the Expression class now contains two new methods:
17181 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
17182 isolate type lookup from the rest of the resolution process.
17184 Since we use Expressions to hold type definitions due to the way
17185 we parse the input we have historically overloaded Resolve to
17186 perform the Type lookups if a special flag is passed. Now this is
17187 eliminated and two methods take their place.
17189 The differences in the two methods between xStep and xTerminal is
17190 that xStep is involved in our current lookup system that uses
17191 SimpleNames to compose a name, while xTerminal is used just to
17192 catch the case where the simplename lookup failed.
17194 2003-04-16 Miguel de Icaza <miguel@ximian.com>
17196 * expression.cs (ResolveMemberAccess): Remove redundant code.
17197 TypeExpr expressions are always born fully resolved.
17199 * interface.cs (PopulateMethod): Do not lookup the types twice.
17200 We were doing it once during SemanticAnalysis and once during
17203 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
17204 in local variable type definitions, were being returned as a
17205 SimpleName (we decomposed everything into a string), that is
17206 because primary_expression was being used instead of a type in the
17207 grammar (reduce/reduce conflicts).
17209 The part that was wrong is that we converted the expression into a
17210 string (an oversimplification in one hand, compounded with primary
17211 expressions doing string concatenation).
17217 Would return "A.B.C[]" as a SimpleName. This stopped things like
17218 using clauses from working on this particular context. And a type
17219 was being matched directly against "A.B.C[]".
17221 We now use the correct approach, and allow for ComposedCast to be
17222 part of the unary expression. So the "A.B.C []" become a composed
17223 cast of "A.B.C" (as a nested group of MemberAccess with a
17224 SimpleName at the end) plus the rank composition "[]".
17228 2003-04-10 Miguel de Icaza <miguel@ximian.com>
17230 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
17231 for the access level checking.
17233 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
17234 `TypeContainer container', because I kept getting confused when I
17235 was debugging this code.
17237 * expression.cs (Indexers): Instead of tracking getters/setters,
17238 we now track them in parallel. We create one arraylist less, but
17239 most importantly it is possible now for the LValue code to find a
17240 matching get for a set.
17242 (IndexerAccess.DoResolveLValue): Update the code.
17243 GetIndexersForType has been modified already to extract all the
17244 indexers from a type. The code assumed it did not.
17246 Also make the code set the correct return type for the indexer.
17247 This was fixed a long time ago for properties, but was missing for
17248 indexers. It used to be void_type.
17250 (Binary.Emit): Test first for doubles instead of
17251 floats, as they are more common.
17253 (Binary.EmitBranchable): Use the .un version of the branch opcodes
17254 when dealing with floats and the <=, >= operators. This fixes bug
17257 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
17258 to load the array value by emitting a load on the foreach variable
17259 type. This was incorrect.
17261 We now emit the code to load an element using the the array
17262 variable type, and then we emit the conversion operator.
17266 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
17268 * attribute.cs: Avoid allocation of ArrayLists in the common case.
17270 2003-04-09 Miguel de Icaza <miguel@ximian.com>
17272 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
17273 test for protection before we test for signatures.
17275 (MethodSignature.ToString): implement.
17277 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
17278 to the case where we reduced into a LongConstant.
17280 * decl.cs (CheckAccessLevel): If the type is an array, we can not
17281 depend on whether the information is acurrate, because the
17282 Microsoft runtime will always claim that the array type is public,
17283 regardless of the real state.
17285 If the type is a pointer, another problem happens: the type is
17286 reported as non-public in Microsoft.
17288 In both cases we have to call CheckAccessLevel recursively with
17289 the underlying type as the argument to be tested.
17291 2003-04-08 Miguel de Icaza <miguel@ximian.com>
17293 * assign.cs (Assign.Emit): If we are dealing with a compound
17294 assignment expression, we should use the code path that stores the
17295 intermediate result in a temporary value. This fixes #40903.
17297 *expression.cs (Indirection.ToString): Provide ToString method for
17300 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
17302 * class.cs: Null out fields holding references to Block objects so
17303 they can be garbage collected.
17305 * expression.cs (OverloadResolve): Remove unused local.
17307 2003-04-07 Martin Baulig <martin@ximian.com>
17309 * codegen.cs (EmitContext.CurrentFile): New public field.
17310 (EmitContext.Mark): Use the CurrentFile to check whether the
17311 location is in the correct file.
17312 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
17314 2003-04-07 Martin Baulig <martin@ximian.com>
17316 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
17318 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
17319 location. [FIXME: The location argument which gets passed to this
17320 method is sometimes wrong!]
17322 2003-04-07 Nick Drochak <ndrochak@gol.com>
17324 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
17326 2003-04-07 Miguel de Icaza <miguel@ximian.com>
17328 * expression.cs (Indirection.EmitAssign): We were using the
17329 temporary, but returning immediately instead of continuing the
17332 2003-04-06 Martin Baulig <martin@ximian.com>
17334 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
17335 if it's a nested child, but also deriving from the outer class.
17338 * typemanager.cs (IsNestedChildOf): Make this work if it's a
17339 nested child, but also deriving from the outer class. See
17341 (FilterWithClosure): We may access private members of the outer
17342 class if we're a nested child and deriving from the outer class.
17343 (RealMemberLookup): Only set `closure_private_ok' if the
17344 `original_bf' contained BindingFlags.NonPublic.
17346 2003-04-05 Martin Baulig <martin@ximian.com>
17348 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
17350 2003-04-02 Miguel de Icaza <miguel@ximian.com>
17352 * class.cs (Event.Define): Do not allow abstract events to have
17355 2003-04-01 Miguel de Icaza <miguel@ximian.com>
17357 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
17358 block in event declarations.
17360 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
17361 value type, get its address.
17363 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
17364 leaving a class on the stack instead of a boolean value (int
17365 0/1). Change the code so we compare against null, and then the
17366 result against zero.
17368 * class.cs (TypeContainer.GetClassBases): We were checking for the
17369 parent class being sealed too late.
17371 * expression.cs (Binary.Emit): For <= and >= when dealing with
17372 floating point values, use cgt.un and clt.un instead of cgt and
17375 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
17377 * statement.cs: Apply the same optimization as MS: skip the
17378 GetEnumerator returning an IEnumerator, and use the one returning a
17379 CharEnumerator instead. This allows us to avoid the try-finally block
17382 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
17384 * cs-parser.jay: Attributes cannot be applied to
17385 namespaces. Fixes #40473
17387 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17390 (Add*): check if the name is valid using the full name for constants,
17391 fields, properties and events.
17393 2003-03-28 Miguel de Icaza <miguel@ximian.com>
17395 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
17396 char constants to be part of the enumeration.
17398 * expression.cs (Conditional.DoResolve): Add support for operator
17399 true. Implements the missing functionality from 14.12
17401 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
17402 operator true/false as required by the spec.
17404 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
17405 implicit conversion to boolean.
17407 * statement.cs (Statement.ResolveBoolean): A boolean expression is
17408 also one where the type implements `operator true'.
17410 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
17411 get an expression that will invoke operator true based on an
17414 (GetConversionOperators): Removed the hack that called op_True
17417 (Expression.ResolveBoolean): Move this from Statement.
17419 2003-03-17 Miguel de Icaza <miguel@ximian.com>
17421 * ecore.cs (FieldExpr): do not allow initialization of initonly
17422 fields on derived classes
17424 2003-03-13 Martin Baulig <martin@ximian.com>
17426 * statement.cs (Block.Emit): Call ig.BeginScope() and
17427 ig.EndScope() when compiling with debugging info; call
17428 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
17430 2003-03-08 Miguel de Icaza <miguel@ximian.com>
17432 * expression.cs (Indexers): Do not construct immediately, allow
17433 for new members to be appended as we go. Fixes 38143
17435 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17437 * expression.cs: save/restore context when resolving an unchecked
17440 2003-03-05 Miguel de Icaza <miguel@ximian.com>
17442 * cfold.cs: Catch division by zero in modulus operator during
17445 2003-03-03 Miguel de Icaza <miguel@ximian.com>
17447 * interface.cs (Interface.DefineMembers): Avoid defining members
17450 2003-02-27 Miguel de Icaza <miguel@ximian.com>
17452 * driver.cs: handle the +/- options for -noconfig
17454 * statement.cs (Unckeched.Resolve): Also track the state of
17455 unchecked in the Resolve phase.
17457 2003-02-27 Martin Baulig <martin@ximian.com>
17459 * ecore.cs (Expression.MemberLookup): Don't create a
17460 MethodGroupExpr for something which is not a method. Fixes #38291.
17462 2003-02-25 Miguel de Icaza <miguel@ximian.com>
17464 * class.cs (MemberBase.CheckParameters): Also check that the type
17465 is unmanaged if it is a pointer.
17467 * expression.cs (SizeOf.Resolve): Add location information.
17469 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
17470 a managed type is declared.
17472 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
17473 parameter modifiers as well. Fixes bug 38606
17475 * class.cs: Very sad. Am backing out the speed up changes
17476 introduced by the ArrayList -> Array in the TypeContainer, as they
17477 were not actually that much faster, and introduced a bug (no error
17478 reports on duplicated methods).
17480 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
17481 source first, this will guarantee that we have a valid expression
17482 before calling in lower levels functions that will require a
17483 resolved object. Then use this original_source in the
17484 target.ResolveLValue instead of the original source that was
17487 Another change. Use target.Resolve instead of LValueResolve.
17488 Although we are resolving for LValues, we will let the Assign code
17489 take care of that (it will be called again from Resolve). This
17490 basically allows code like this:
17492 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
17493 class Y { void A (X x) { x [0] += o; }
17495 The problem was that the indexer was trying to resolve for
17496 set_Item (idx, object o) and never finding one. The real set_Item
17497 was set_Item (idx, X). By delaying the process we get the right
17502 2003-02-23 Martin Baulig <martin@ximian.com>
17504 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
17505 while calling DoEmit ().
17507 * codegen.cs (EmitContext.Mark): Don't mark locations in other
17508 source files; if you use the #line directive inside a method, the
17509 compiler stops emitting line numbers for the debugger until it
17510 reaches the end of the method or another #line directive which
17511 restores the original file.
17513 2003-02-23 Martin Baulig <martin@ximian.com>
17515 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
17517 2003-02-23 Martin Baulig <martin@ximian.com>
17519 * statement.cs (Block.AddChildVariableNames): We need to call this
17520 recursively, not just for our immediate children.
17522 2003-02-23 Martin Baulig <martin@ximian.com>
17524 * class.cs (Event.Define): Always make the field private, like csc does.
17526 * typemanager.cs (TypeManager.RealMemberLookup): Make events
17527 actually work, fixes bug #37521.
17529 2003-02-23 Miguel de Icaza <miguel@ximian.com>
17531 * delegate.cs: When creating the various temporary "Parameters"
17532 classes, make sure that we call the ComputeAndDefineParameterTypes
17533 on those new parameters (just like we do with the formal ones), to
17534 allow them to be resolved in the context of the DeclSpace.
17536 This fixes the bug that Dick observed in Bugzilla #38530.
17538 2003-02-22 Miguel de Icaza <miguel@ximian.com>
17540 * expression.cs (ResolveMemberAccess): When resolving a constant,
17541 do not attempt to pull a constant if the value was not able to
17542 generate a valid constant.
17544 * const.cs (LookupConstantValue): Do not report more errors than required.
17546 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17548 * expression.cs: fixes bug #38328.
17550 2003-02-18 Miguel de Icaza <miguel@ximian.com>
17552 * class.cs: Changed all the various members that can be part of a
17553 class from being an ArrayList to be an Array of the right type.
17554 During the DefineType type_list, interface_list, delegate_list and
17555 enum_list are turned into types, interfaces, delegates and enums
17558 And during the member population, indexer_list, event_list,
17559 constant_list, field_list, instance_constructor_list, method_list,
17560 operator_list and property_list are turned into their real arrays.
17562 Although we could probably perform this operation earlier, for
17563 good error reporting we need to keep the lists and remove the
17564 lists for longer than required.
17566 This optimization was triggered by Paolo profiling the compiler
17567 speed on the output of `gen-sample-program.pl' perl script.
17569 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
17570 not crash in methods like MemberLookupFailed that use this field.
17572 This problem arises when the compiler fails to resolve a type
17573 during interface type definition for example.
17575 2003-02-18 Miguel de Icaza <miguel@ximian.com>
17577 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
17578 inherit from System.Object, so we have to stop at null, not only
17579 when reaching System.Object.
17581 2003-02-17 Miguel de Icaza <miguel@ximian.com>
17583 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
17584 DeclaredOnly because the parent indexer might have had a different
17585 name, but did not loop until the top of the hierarchy was reached.
17587 The problem this one fixes is 35492: when a class implemented an
17588 indexer from an interface, we were getting the interface method
17589 (which was abstract) and we were flagging an error (can not invoke
17592 This also keeps bug 33089 functioning, and test-148 functioning.
17594 * typemanager.cs (IsSpecialMethod): The correct way of figuring
17595 out if a method is special is to see if it is declared in a
17596 property or event, or whether it is one of the predefined operator
17597 names. This should fix correctly #36804.
17599 2003-02-15 Miguel de Icaza <miguel@ximian.com>
17601 The goal here is to remove the dependency on EmptyCast.Peel ().
17602 Killing it completely.
17604 The problem is that currently in a number of places where
17605 constants are expected, we have to "probe" for an EmptyCast, and
17606 Peel, which is not the correct thing to do, as this will be
17607 repetitive and will likely lead to errors.
17609 The idea is to remove any EmptyCasts that are used in casts that
17610 can be reduced to constants, so we only have to cope with
17613 This bug hunt was triggered by Bug 37363 and the desire to remove
17614 the duplicate pattern where we were "peeling" emptycasts to check
17615 whether they were constants. Now constants will always be
17618 * ecore.cs: Use an enumconstant here instead of wrapping with
17621 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
17622 throwing me off. By handling this we can get rid of a few hacks.
17624 * statement.cs (Switch): Removed Peel() code.
17626 2003-02-14 Miguel de Icaza <miguel@ximian.com>
17628 * class.cs: Location information for error 508
17630 * expression.cs (New.DoResolve): Add a guard against double
17631 resolution of an expression.
17633 The New DoResolve might be called twice when initializing field
17634 expressions (see EmitFieldInitializers, the call to
17635 GetInitializerExpression will perform a resolve on the expression,
17636 and later the assign will trigger another resolution
17638 This leads to bugs (#37014)
17640 * delegate.cs: The signature for EndInvoke should contain any ref
17641 or out parameters as well. We were not doing this in the past.
17643 * class.cs (Field.Define): Do not overwrite the type definition
17644 inside the `volatile' group. Turns out that volatile enumerations
17645 were changing the type here to perform a validity test, which
17648 2003-02-12 Miguel de Icaza <miguel@ximian.com>
17650 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
17651 and structs, we do not want to load the instance variable
17653 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
17654 enum_type has to be handled like an object reference (implicit
17655 conversions exists from this to object), but the regular IsClass
17656 and IsValueType tests will never return true for this one.
17658 Also we use TypeManager.IsValueType instead of type.IsValueType,
17659 just for consistency with the rest of the code (this is only
17660 needed if we ever use the construct exposed by test-180.cs inside
17661 corlib, which we dont today).
17663 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
17665 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
17668 2003-02-09 Martin Baulig <martin@ximian.com>
17670 * namespace.cs (Namespace..ctor): Added SourceFile argument.
17671 (Namespace.DefineNamespaces): New static public method; this is
17672 called when we're compiling with debugging to add all namespaces
17673 to the symbol file.
17675 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
17676 pass it to the Namespace's .ctor.
17678 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
17679 and MethodBase arguments; pass the namespace ID to the symwriter;
17680 pass the MethodBase instead of the token to the symwriter.
17681 (SymbolWriter.DefineNamespace): New method to add a namespace to
17684 2003-02-09 Martin Baulig <martin@ximian.com>
17686 * symbolwriter.cs: New file. This is a wrapper around
17687 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
17688 methods here in near future.
17690 2003-02-09 Martin Baulig <martin@ximian.com>
17692 * codegen.cs (EmitContext.Mark): Just pass the arguments to
17693 ILGenerator.MarkSequencePoint() which are actually used by the
17696 2003-02-09 Martin Baulig <martin@ximian.com>
17698 * location.cs (SourceFile): New public sealed class. This
17699 contains the name and an index which is used in the location's token.
17700 (Location): Reserve an appropriate number of bits in the token for
17701 the source file instead of walking over that list, this gives us a
17702 really huge performance improvement when compiling with debugging.
17704 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
17705 `SourceFile' argument instead of a string.
17706 (Driver.ProcessFile): Add all the files via Location.AddFile(),
17707 but don't parse/tokenize here, we need to generate the list of all
17708 source files before we do that.
17709 (Driver.ProcessFiles): New static function. Parses/tokenizes all
17712 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
17713 instead of a string.
17715 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
17718 2003-02-09 Martin Baulig <martin@ximian.com>
17720 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
17721 filename on `#line default'.
17723 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
17725 * statement.cs: don't clear the pinned var when the fixed statement
17726 returns from the method (fixes bug#37752).
17728 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
17730 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
17733 2003-02-07 Martin Baulig <martin@ximian.com>
17735 * driver.cs: Removed the `--debug-args' command line argument.
17737 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
17738 automatically by the AsssemblyBuilder.
17739 (CodeGen.InitializeSymbolWriter): We don't need to call any
17740 initialization function on the symbol writer anymore. This method
17741 doesn't take any arguments.
17743 2003-02-03 Miguel de Icaza <miguel@ximian.com>
17745 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
17746 from referenced assemblies as well.
17748 2003-02-02 Martin Baulig <martin@ximian.com>
17750 * class.cs (MethodData.Emit): Generate debugging info for external methods.
17752 2003-02-02 Martin Baulig <martin@ximian.com>
17754 * class.cs (Constructor.Emit): Open the symbol writer before
17755 emitting the constructor initializer.
17756 (ConstructorInitializer.Emit): Call ec.Mark() to allow
17757 single-stepping through constructor initializers.
17759 2003-01-30 Miguel de Icaza <miguel@ximian.com>
17761 * class.cs: Handle error 549: do not allow virtual methods in
17764 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
17766 * decl.cs: Check access levels when resolving types
17768 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
17770 * statement.cs: Add parameters and locals set in catch blocks that might
17771 return to set vector
17773 2003-01-29 Miguel de Icaza <miguel@ximian.com>
17775 * class.cs (Operator): Set the SpecialName flags for operators.
17777 * expression.cs (Invocation.DoResolve): Only block calls to
17778 accessors and operators on SpecialName methods.
17780 (Cast.TryReduce): Handle conversions from char constants.
17783 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
17785 * statement.cs: small memory and time optimization in FlowBranching.
17787 2003-01-28 Pedro Mart <yoros@wanadoo.es>
17789 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
17790 problem that the last fix but in the other sid (Set).
17792 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
17793 access when there is no indexer in the hierarchy.
17795 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
17797 * class.cs: Combine some if statements.
17799 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17801 * driver.cs: fixed bug #37187.
17803 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
17805 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
17806 any indexer, it's needed to build a list with all the indexers in the
17807 hierarchy (AllGetters), else we have problems. Fixes #35653.
17809 2003-01-23 Miguel de Icaza <miguel@ximian.com>
17811 * class.cs (MethodData.Define): It is wrong for an interface
17812 implementation to be static in both cases: explicit and implicit.
17813 We were only handling this in one case.
17815 Improve the if situation there to not have negations.
17817 * class.cs (Field.Define): Turns out that we do not need to check
17818 the unsafe bit on field definition, only on usage. Remove the test.
17820 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17822 * driver.cs: use assembly.Location instead of Codebase (the latest
17823 patch made mcs fail when using MS assemblies).
17825 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
17827 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
17828 get the path to *corlib.dll.
17830 2003-01-21 Nick Drochak <ndrochak@gol.com>
17834 * typemanager.cs: Remove compiler warnings
17836 2003-01-20 Duncan Mak <duncan@ximian.com>
17838 * AssemblyInfo.cs: Bump the version number to 0.19.
17840 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17842 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
17844 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
17846 * class.cs (Constructor::Emit): Emit debugging info for constructors.
17848 2003-01-17 Miguel de Icaza <miguel@ximian.com>
17850 * cs-parser.jay: Small fix: we were not comparing the constructor
17851 name correctly. Thanks to Zoltan for the initial pointer.
17853 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
17855 * cs-tokenizer.cs: Set file name when specified with #line
17857 2003-01-15 Miguel de Icaza <miguel@ximian.com>
17859 * cs-parser.jay: Only perform the constructor checks here if we
17860 are named like the class; This will help provider a better
17861 error. The constructor path is taken when a type definition is
17862 not found, but most likely the user forgot to add the type, so
17863 report that rather than the constructor error.
17865 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
17867 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
17870 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17872 * cs-parser.jay: Add cleanup call.
17874 2003-01-13 Duncan Mak <duncan@ximian.com>
17876 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
17877 consistent with other methods.
17879 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17881 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
17883 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
17885 * attribute.cs: only set GuidAttr to true when we have a
17888 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17892 * typemanager.cs: fixes to allow mcs compile corlib with the new
17893 Type.IsSubclassOf fix.
17895 2003-01-08 Miguel de Icaza <miguel@ximian.com>
17897 * expression.cs (LocalVariableReference.DoResolve): Classify a
17898 constant as a value, not as a variable. Also, set the type for
17901 * cs-parser.jay (fixed_statement): take a type instead of a
17902 pointer_type, so we can produce a better error message later.
17904 * statement.cs (Fixed.Resolve): Flag types that are not pointers
17907 (For.DoEmit): Make inifinite loops have a
17908 non-conditional branch back.
17910 (Fixed.DoEmit): First populate the pinned variables, then emit the
17911 statement, then clear the variables. Before I was emitting the
17912 code once for each fixed piece.
17915 2003-01-08 Martin Baulig <martin@ximian.com>
17917 * statement.cs (FlowBranching.MergeChild): A break in a
17918 SWITCH_SECTION does not leave a loop. Fixes #36155.
17920 2003-01-08 Martin Baulig <martin@ximian.com>
17922 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
17923 lives in the same number space than `param_map'. Fixes #36154.
17925 2003-01-07 Miguel de Icaza <miguel@ximian.com>
17927 * cs-parser.jay (constructor_declaration): Set the
17928 Constructor.ModFlags before probing for it. This makes the
17929 compiler report 514, 515 and 132 (the code was there, but got
17932 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
17933 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
17934 (GotoCase.Resolve): Set `Returns' to ALWAYS.
17936 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
17938 * enum.cs: create the enum static fields using the enum type.
17940 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
17942 * class.cs: don't try to create the ParamBuilder for the return
17943 type if it's not needed (and handle it breaking for the ms runtime
17946 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
17948 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
17950 2002-12-29 Miguel de Icaza <miguel@ximian.com>
17952 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
17953 the command. This showed up while compiling the JANET source
17954 code, which used \r as its only newline separator.
17956 2002-12-28 Miguel de Icaza <miguel@ximian.com>
17958 * class.cs (Method.Define): If we are an operator (because it
17959 reuses our code), then set the SpecialName and HideBySig. #36128
17961 2002-12-22 Miguel de Icaza <miguel@ximian.com>
17963 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
17964 exception, report error 120 `object reference required'.
17966 * driver.cs: Add --pause option, used during to measure the size
17967 of the process as it goes with --timestamp.
17969 * expression.cs (Invocation.DoResolve): Do not allow methods with
17970 SpecialName to be invoked.
17972 2002-12-21 Miguel de Icaza <miguel@ximian.com>
17974 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
17975 number before adding it.
17977 2002-12-21 Ravi Pratap <ravi@ximian.com>
17979 * ecore.cs (StandardImplicitConversion): When in an unsafe
17980 context, we allow conversion between void * to any other pointer
17981 type. This fixes bug #35973.
17983 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
17985 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
17986 is not thrown when extensionless outputs are used
17988 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17990 * rootcontext.cs: fixed compilation of corlib.
17992 2002-12-19 Miguel de Icaza <miguel@ximian.com>
17994 * attribute.cs (Attributes.Contains): Add new method.
17996 * class.cs (MethodCore.LabelParameters): if the parameter is an
17997 `out' parameter, check that no attribute `[In]' has been passed.
17999 * enum.cs: Handle the `value__' name in an enumeration.
18001 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
18003 * decl.cs: Added special case to allow overrides on "protected
18006 2002-12-18 Ravi Pratap <ravi@ximian.com>
18008 * attribute.cs (Attributes.AddAttributeSection): Rename to this
18009 since it makes much more sense.
18011 (Attributes.ctor): Don't require a Location parameter.
18013 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
18015 * attribute.cs (ApplyAttributes): Remove extra Location parameters
18016 since we already have that information per attribute.
18018 * everywhere : make appropriate changes.
18020 * class.cs (LabelParameters): Write the code which actually
18021 applies attributes to the return type. We can't do this on the MS
18022 .NET runtime so we flag a warning in the case an exception is
18025 2002-12-18 Miguel de Icaza <miguel@ximian.com>
18027 * const.cs: Handle implicit null conversions here too.
18029 2002-12-17 Ravi Pratap <ravi@ximian.com>
18031 * class.cs (MethodCore.LabelParameters): Remove the extra
18032 Type [] parameter since it is completely unnecessary. Instead
18033 pass in the method's attributes so that we can extract
18034 the "return" attribute.
18036 2002-12-17 Miguel de Icaza <miguel@ximian.com>
18038 * cs-parser.jay (parse): Use Report.Error to flag errors instead
18039 of ignoring it and letting the compile continue.
18041 * typemanager.cs (ChangeType): use an extra argument to return an
18042 error condition instead of throwing an exception.
18044 2002-12-15 Miguel de Icaza <miguel@ximian.com>
18046 * expression.cs (Unary.TryReduce): mimic the code for the regular
18047 code path. Perform an implicit cast in the cases where we can
18048 implicitly convert to one of the integral types, and then reduce
18049 based on that constant. This fixes bug #35483.
18051 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18053 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
18055 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18057 * namespace.cs: fixed bug #35489.
18059 2002-12-12 Miguel de Icaza <miguel@ximian.com>
18061 * class.cs: Remove some dead code.
18063 * cs-parser.jay: Estimate the number of methods needed
18064 (RootContext.MethodCount);
18066 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
18067 numbers instead of StringBuilders.
18069 * support.cs (PtrHashtable): Add constructor with initial size;
18070 We can now reduce reallocations of the method table.
18072 2002-12-10 Ravi Pratap <ravi@ximian.com>
18074 * attribute.cs (ApplyAttributes): Keep track of the emitted
18075 attributes on a per-target basis. This fixes bug #35413.
18077 2002-12-10 Miguel de Icaza <miguel@ximian.com>
18079 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
18080 default to the Windows 1252 encoding.
18082 (UnixParseOption): Support version, thanks to Alp for the missing
18085 * AssemblyInfo.cs: Add nice assembly information.
18087 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
18090 * cs-parser.jay: Allow a trailing comma before the close bracked
18091 in the attribute_section production.
18093 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
18094 address of the instance was being taken, I will take this out,
18095 because we take the address of the object immediately here.
18097 2002-12-09 Ravi Pratap <ravi@ximian.com>
18099 * typemanager.cs (AreMultipleAllowed): Take care of the most
18100 obvious case where attribute type is not in the current assembly -
18103 2002-12-08 Miguel de Icaza <miguel@ximian.com>
18105 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
18106 definitions, instead of doing that afterwards.
18108 Also we use a nice little hack, depending on the constructor, we
18109 know if we are a "composed" name or a simple name. Hence, we
18110 avoid the IndexOf test, and we avoid
18112 * codegen.cs: Add code to assist in a bug reporter to track down
18113 the source of a compiler crash.
18115 2002-12-07 Ravi Pratap <ravi@ximian.com>
18117 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
18118 types have been emitted for a given element and flag an error
18119 if something which does not have AllowMultiple set is used more
18122 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
18123 attribute types and their corresponding AllowMultiple properties
18125 (AreMultipleAllowed): Check the property for a given type.
18127 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
18128 property in the case we have a TypeContainer.
18130 (Attributes.AddAttribute): Detect duplicates and just skip on
18131 adding them. This trivial fix catches a pretty gross error in our
18132 attribute emission - global attributes were being emitted twice!
18134 Bugzilla bug #33187 is now fixed.
18136 2002-12-06 Miguel de Icaza <miguel@ximian.com>
18138 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
18139 instead of pp_and).
18141 * expression.cs (Binary.ResolveOperator): I can only use the
18142 Concat (string, string, string) and Concat (string, string,
18143 string, string) if the child is actually a concatenation of
18146 2002-12-04 Miguel de Icaza <miguel@ximian.com>
18148 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
18149 context where we need a 2-character lookahead.
18151 * pending.cs (PendingImplementation): Rework so we can keep track
18152 of interface types all the time, and flag those which were
18153 implemented by parents as optional.
18155 2002-12-03 Miguel de Icaza <miguel@ximian.com>
18157 * expression.cs (Binary.ResolveOperator): Use
18158 String.Concat(string,string,string) or
18159 String.Concat(string,string,string,string) when possible.
18161 * typemanager: More helper methods.
18164 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
18166 * pending.cs: remove the bogus return from GetMissingInterfaces()
18167 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
18169 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18171 * namespace.cs: avoid duplicated 'using xxx' being added to
18172 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
18173 when we get more than one 'using' statement for the same namespace.
18174 Report a CS0105 warning for it.
18176 2002-11-30 Miguel de Icaza <miguel@ximian.com>
18178 * cs-tokenizer.cs (consume_identifier): use read directly, instead
18179 of calling getChar/putback, uses internal knowledge of it.
18181 (xtoken): Reorder tokenizer so most common patterns are checked
18182 first. This reduces the compilation time in another 5% (from 8.11s
18183 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
18185 The parsing time is 22% of the compilation in mcs, and from that
18186 64% is spent on the tokenization process.
18188 I tried using a binary search for keywords, but this is slower
18189 than the hashtable. Another option would be to do a couple of
18192 * Not use a StringBuilder, instead use an array of chars,
18193 with a set value. Notice that this way we could catch
18194 the 645 error without having to do it *afterwards*.
18196 * We could write a hand-parser to avoid the hashtable
18197 compares altogether.
18199 The identifier consumption process takes 37% of the tokenization
18200 time. Another 15% is spent on is_number. 56% of the time spent
18201 on is_number is spent on Int64.Parse:
18203 * We could probably choose based on the string length to
18204 use Int32.Parse or Int64.Parse and avoid all the 64-bit
18207 Another 3% is spend on wrapping `xtoken' in the `token' function.
18209 Handle 0xa0 as whitespace (#34752)
18211 2002-11-26 Miguel de Icaza <miguel@ximian.com>
18213 * typemanager.cs (IsCLRType): New routine to tell whether a type
18214 is one of the builtin types.
18216 Maybe it needs to use TypeCodes to be faster. Maybe we could use
18217 typecode in more places instead of doing pointer comparissions.
18218 We could leverage some knowledge about the way the typecodes are
18221 New code to cache namespaces in assemblies, it is currently not
18222 invoked, to be used soon.
18224 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
18226 * expression.cs (Binary.ResolveOperator): specially handle
18227 strings, and do not perform user-defined operator overloading for
18230 2002-11-24 Miguel de Icaza <miguel@ximian.com>
18232 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
18233 internalcall as it is a pretty simple operation; Avoid whenever
18234 possible to call Char.IsLetter.
18236 (consume_identifier): Cut by half the number of
18237 hashtable calls by merging the is_keyword and GetKeyword behavior.
18239 Do not short-circuit, because if we do, we
18240 report errors (ie, #if false && true would produce an invalid
18244 2002-11-24 Martin Baulig <martin@ximian.com>
18246 * expression.cs (Cast.TryReduce): If we're in checked syntax,
18247 check constant ranges and report a CS0221. Fixes #33186.
18249 2002-11-24 Martin Baulig <martin@ximian.com>
18251 * cs-parser.jay: Make this work for uninitialized variable
18252 declarations in the `for' initializer. Fixes #32416.
18254 2002-11-24 Martin Baulig <martin@ximian.com>
18256 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
18257 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
18259 2002-11-24 Martin Baulig <martin@ximian.com>
18261 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
18262 argument; if true, we also check for user-defined conversions.
18263 This is only needed if both arguments are of a user-defined type.
18264 Fixes #30443, added test-175.cs.
18265 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
18267 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
18269 2002-11-24 Martin Baulig <martin@ximian.com>
18271 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
18272 function to get the store opcode.
18273 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
18274 only emit the Ldelema if the store opcode is Stobj. You must run
18275 both test-34 and test-167 to test this. Fixes #34529.
18277 2002-11-23 Martin Baulig <martin@ximian.com>
18279 * ecore.cs (Expression.MemberLookup): Added additional
18280 `qualifier_type' argument which is used when we're being called
18281 from MemberAccess.DoResolve() and null if we're called from a
18283 (Expression.MemberLookupFailed): New method to report errors; this
18284 does the CS1540 check and reports the correct error message.
18286 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
18287 argument for the CS1540 check and redone the way how we're dealing
18288 with private members. See the comment in the source code for details.
18289 (FilterWithClosure): Reverted this back to revision 1.197; renamed
18290 `closure_start_type' to `closure_qualifier_type' and check whether
18291 it's not null. It was not this filter being broken, it was just
18292 being called with the wrong arguments.
18294 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
18295 and pass it the correct `qualifier_type'; this also does the error
18298 2002-11-22 Miguel de Icaza <miguel@ximian.com>
18300 * expression.cs (Invocation.EmitParams): If the we are dealing
18301 with a non-built-in value type, load its address as well.
18303 (ArrayCreation): Use a a pretty constant instead
18304 of the hardcoded value 2. Use 6 instead of 2 for the number of
18305 static initializers.
18307 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
18308 because they are not really value types, just glorified integers.
18310 * driver.cs: Do not append .exe, the CSC compiler does not do it.
18312 * ecore.cs: Remove redundant code for enumerations, make them use
18313 the same code path as everything else, fixes the casting issue
18314 with enumerations in Windows.Forms.
18316 * attribute.cs: Do only cast to string if it is a string, the
18317 validation happens later.
18319 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
18320 people upgrade their corlibs.
18322 * ecore.cs: Oops, enumerations were not following the entire code path
18324 2002-11-21 Miguel de Icaza <miguel@ximian.com>
18326 * typemanager.cs (FilterWithClosure): Commented out the test for
18327 1540 in typemanager.cs, as it has problems when accessing
18328 protected methods from a parent class (see test-174.cs).
18330 * attribute.cs (Attribute.ValidateGuid): new method.
18331 (Attribute.Resolve): Use above.
18333 2002-11-19 Miguel de Icaza <miguel@ximian.com>
18335 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
18337 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
18338 handling for enumerations, as we only needed the TypeContainer
18339 functionality to begin with (this is required for the fix below to
18340 work for enums that reference constants in a container class for
18343 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
18345 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
18346 a valid TypeBuilder to perform lookups on.o
18348 * class.cs (InheritableMemberSignatureCompare): Use true in the
18349 call to GetGetMethod and GetSetMethod, because we are comparing
18350 the signature, and we need to get the methods *even* if they are
18353 (PropertyBase.CheckBase): ditto.
18355 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
18356 GotoCase.Resolve): Use Peel on EmpytCasts.
18358 * ecore.cs (EmptyCast): drop child, add Peel method.
18360 2002-11-17 Martin Baulig <martin@ximian.com>
18362 * ecore.cs (EmptyCast.Child): New public property.
18364 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
18365 label resolved to an EmptyCast. Fixes #34162.
18366 (GotoCase.Resolve): Likewise.
18367 (Block.EmitMeta): Likewise.
18369 2002-11-17 Martin Baulig <martin@ximian.com>
18371 * expression.cs (Invocation.BetterConversion): Prefer int over
18372 uint; short over ushort; long over ulong for integer literals.
18373 Use ImplicitConversionExists instead of StandardConversionExists
18374 since we also need to check for user-defined implicit conversions.
18375 Fixes #34165. Added test-173.cs.
18377 2002-11-16 Martin Baulig <martin@ximian.com>
18379 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
18380 with the `true' and `false' literals. Fixes #33151.
18382 2002-11-16 Martin Baulig <martin@ximian.com>
18384 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
18385 October 22nd; don't do the cs1540 check for static members.
18387 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
18388 now using our own filter here and doing the cs1540 check again.
18390 2002-11-16 Martin Baulig <martin@ximian.com>
18392 * support.cs (InternalParameters): Don't crash if we don't have
18393 any fixed parameters. Fixes #33532.
18395 2002-11-16 Martin Baulig <martin@ximian.com>
18397 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
18398 when looking up static methods to make this work on Windows.
18401 2002-11-16 Martin Baulig <martin@ximian.com>
18403 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
18404 a setter rather than using PropertyInfo.CanWrite.
18406 2002-11-15 Nick Drochak <ndrochak@gol.com>
18408 * class.cs: Allow acces to block member by subclasses. Fixes build
18411 2002-11-14 Martin Baulig <martin@ximian.com>
18413 * class.cs (Constructor.Emit): Added the extern/block check.
18416 2002-11-14 Martin Baulig <martin@ximian.com>
18418 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
18419 iteration while looking for indexers, this is needed because the
18420 indexer may have a different name in our base classes. Fixed the
18421 error reporting (no indexers at all, not get accessor, no
18422 overloaded match). Fixes bug #33089.
18423 (IndexerAccess.DoResolveLValue): Likewise.
18425 2002-11-14 Martin Baulig <martin@ximian.com>
18427 * class.cs (PropertyBase.CheckBase): Make this work for multiple
18428 indexers. Fixes the first part of bug #33089.
18429 (MethodSignature.InheritableMemberSignatureCompare): Added support
18432 2002-11-13 Ravi Pratap <ravi@ximian.com>
18434 * attribute.cs (Attribute.Resolve): Catch the
18435 NullReferenceException and report it since it isn't supposed to
18438 2002-11-12 Miguel de Icaza <miguel@ximian.com>
18440 * expression.cs (Binary.EmitBranchable): Also handle the cases for
18441 LogicalOr and LogicalAnd that can benefit from recursively
18442 handling EmitBranchable. The code now should be nice for Paolo.
18444 2002-11-08 Miguel de Icaza <miguel@ximian.com>
18446 * typemanager.cs (LookupType): Added a negative-hit hashtable for
18447 the Type lookups, as we perform quite a number of lookups on
18448 non-Types. This can be removed once we can deterministically tell
18449 whether we have a type or a namespace in advance.
18451 But this might require special hacks from our corlib.
18455 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
18456 and double which avoids a conversion from an integer to a double.
18458 * expression.cs: tiny optimization, avoid calling IsConstant,
18459 because it effectively performs the lookup twice.
18461 2002-11-06 Miguel de Icaza <miguel@ximian.com>
18463 But a bogus return here to keep the semantics of the old code
18464 until the Mono runtime is fixed.
18466 * pending.cs (GetMissingInterfaces): New method used to remove all
18467 the interfaces that are already implemented by our parent
18468 classes from the list of pending methods.
18470 * interface.cs: Add checks for calls after ResolveTypeExpr.
18472 2002-11-05 Miguel de Icaza <miguel@ximian.com>
18474 * class.cs (Class.Emit): Report warning 67: event not used if the
18475 warning level is beyond 3.
18477 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
18478 being a NullLiteral.
18480 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
18483 * class.cs (TypeContainer.GetClassBases): Cover a missing code
18484 path that might fail if a type can not be resolved.
18486 * expression.cs (Binary.Emit): Emit unsigned versions of the
18489 * driver.cs: use error 5.
18491 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
18493 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
18495 2002-11-01 Miguel de Icaza <miguel@ximian.com>
18497 * cs-parser.jay (switch_section): A beautiful patch from Martin
18498 Baulig that fixed 33094.
18500 2002-10-31 Miguel de Icaza <miguel@ximian.com>
18502 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
18503 Check whether the base is abstract and report an error if so.
18505 * expression.cs (IndexerAccess.DoResolveLValue,
18506 IndexerAccess.DoResolve): ditto.
18508 (Invocation.DoResolve): ditto.
18510 (Invocation.FullMethodDesc): Improve the report string.
18512 * statement.cs (Block): Eliminate IsVariableDefined as it is
18513 basically just a wrapper for GetVariableInfo.
18515 * ecore.cs (SimpleName): Use new
18517 * support.cs (ReflectionParamter.ParameterType): We unwrap the
18518 type, as we return the actual parameter ref/unref state on a
18521 2002-10-30 Miguel de Icaza <miguel@ximian.com>
18523 * support.cs: Return proper flags REF/OUT fixing the previous
18526 * expression.cs: Reverted last patch, that was wrong. Is_ref is
18527 not used to mean `ref' but `ref or out' in ParameterReference
18529 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
18530 full type signature instead of calling TypeManger.CSharpName
18533 * support.cs (InternalParameters.ParameterDesc): Do not compare
18534 directly to the modflags, because REF/OUT will actually be bitsets
18537 * delegate.cs (VerifyMethod): Check also the modifiers.
18539 * cs-tokenizer.cs: Fix bug where floating point values with an
18540 exponent where a sign was missing was ignored.
18542 * driver.cs: Allow multiple assemblies to be specified in a single
18545 2002-10-28 Miguel de Icaza <miguel@ximian.com>
18547 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
18548 because identifiers after a parenthesis would end up in this kind
18549 of production, and we needed to desamiguate it for having casts
18552 (UserDefinedType *) xxx
18554 2002-10-24 Miguel de Icaza <miguel@ximian.com>
18556 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
18557 we should set on the Bindingflags.NonPublic, but not turn on
18558 private_ok. private_ok controls whether a Private member is
18559 returned (this is chekced on the filter routine), while the
18560 BindingFlags.NonPublic just controls whether private/protected
18561 will be allowed. This fixes the problem part of the problem of
18562 private properties being allowed to be used in derived classes.
18564 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
18565 so we can call the children DoResolveLValue method (this will
18566 properly signal errors on lvalue assignments to base properties)
18568 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
18569 getter are null, and we have a property info, we know that this
18570 happened because the lookup failed, so we report an error 122 for
18571 protection level violation.
18573 We also silently return if setter and getter are null in the
18574 resolve functions, this condition only happens if we have flagged
18575 the error before. This is the other half of the problem.
18577 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
18578 not have accessibility information, that is why we were returning
18579 true in the filter function in typemanager.cs.
18581 To properly report 122 (property is inaccessible because of its
18582 protection level) correctly, we report this error in ResolveAccess
18583 by failing if both the setter and the getter are lacking (ie, the
18586 DoResolve and DoLResolve have been modified to check for both
18587 setter/getter being null and returning silently, the reason being
18588 that I did not want to put the knowledge about this error in upper
18591 int old = Report.Errors;
18592 x = new PropertyExpr (...);
18593 if (old != Report.Errors)
18598 So the property expr is returned, but it is invalid, so the error
18599 will be flagged during the resolve process.
18601 * class.cs: Remove InheritablePropertySignatureCompare from the
18602 class, as we no longer depend on the property signature to compute
18603 whether it is possible to implement a method or not.
18605 The reason is that calling PropertyInfo.GetGetMethod will return
18606 null (in .NET, in Mono it works, and we should change this), in
18607 cases where the Get Method does not exist in that particular
18612 class X { public virtual int A { get { return 1; } } }
18614 class Z : Y { public override int A { get { return 2; } } }
18616 Would fail in Z because the parent (Y) would not have the property
18617 defined. So we avoid this completely now (because the alternative
18618 fix was ugly and slow), and we now depend exclusively on the
18621 (PropertyBase.CheckBase): Use a method-base mechanism to find our
18622 reference method, instead of using the property.
18624 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
18625 routines are gone now.
18627 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
18628 names, they were incorrectly named.
18630 * cs-tokenizer.cs: Return are more gentle token on failure.
18632 * pending.cs (PendingImplementation.InterfaceMethod): This routine
18633 had an out-of-sync index variable, which caused it to remove from
18634 the list of pending methods the wrong method sometimes.
18636 2002-10-22 Miguel de Icaza <miguel@ximian.com>
18638 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
18639 CanWrite, because those refer to this particular instance of the
18640 property, and do not take into account the fact that we can
18641 override single members of a property.
18643 Constructor requires an EmitContext. The resolution process does
18644 not happen here, but we need to compute the accessors before,
18645 because the resolution does not always happen for properties.
18647 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
18648 subclass, before we did not update this flag, but we did update
18651 (GetAccessors): Drop this routine, as it did not work in the
18652 presence of partially overwritten set/get methods.
18654 Notice that this broke the cs1540 detection, but that will require
18657 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18661 * driver.cs: issue a warning instead of an error if we don't support
18662 debugging for the platform. Also ignore a couple of errors that may
18663 arise when trying to write the symbols. Undo my previous patch.
18665 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18667 * driver.cs: ignore /debug switch except for Unix platforms.
18669 2002-10-23 Nick Drochak <ndrochak@gol.com>
18671 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
18673 2002-10-21 Miguel de Icaza <miguel@ximian.com>
18675 * driver.cs: Do not make mcs-debug conditional, so we do not break
18676 builds that use it.
18678 * statement.cs (UsageVector.MergeChildren): I would like Martin to
18679 review this patch. But basically after all the children variables
18680 have been merged, the value of "Breaks" was not being set to
18681 new_breaks for Switch blocks. I think that it should be set after
18682 it has executed. Currently I set this to the value of new_breaks,
18683 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
18684 conservative, but I do not understand this code very well.
18686 I did not break anything in the build, so that is good ;-)
18688 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
18690 2002-10-20 Mark Crichton <crichton@gimp.org>
18692 * cfold.cs: Fixed compile blocker. Really fixed it this time.
18694 2002-10-20 Nick Drochak <ndrochak@gol.com>
18696 * cfold.cs: Fixed compile blocker.
18698 2002-10-20 Miguel de Icaza <miguel@ximian.com>
18700 * driver.cs: I was chekcing the key, not the file.
18702 2002-10-19 Ravi Pratap <ravi@ximian.com>
18704 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
18705 message that we were generating - we just need to silently return
18708 2002-10-19 Miguel de Icaza <miguel@ximian.com>
18710 * class.cs (Event.Define): Change my previous commit, as this
18711 breaks the debugger. This is a temporary hack, as it seems like
18712 the compiler is generating events incorrectly to begin with.
18714 * expression.cs (Binary.ResolveOperator): Added support for
18715 "U operator - (E x, E y)"
18717 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
18720 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
18721 init-only variables, but this path did not take into account that
18722 there might be also instance readonly variables. Correct this
18725 This fixes bug 32253
18727 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
18730 * driver.cs: Change the extension for modules to `netmodule'
18732 * cs-parser.jay: Improved slightly the location tracking for
18733 the debugger symbols.
18735 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
18736 modifiers that were specified instead of the hardcoded value
18737 (FamAndAssem). This was basically ignoring the static modifier,
18738 and others. Fixes 32429.
18740 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
18741 fixed a bug in the process (32476)
18743 * expression.cs (ArrayAccess.EmitAssign): Patch from
18744 hwang_rob@yahoo.ca that fixes bug 31834.3
18746 2002-10-18 Miguel de Icaza <miguel@ximian.com>
18748 * driver.cs: Make the module extension .netmodule.
18750 2002-10-16 Miguel de Icaza <miguel@ximian.com>
18752 * driver.cs: Report an error if the resource file is not found
18753 instead of crashing.
18755 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
18756 false, like Emit does.
18758 2002-10-16 Nick Drochak <ndrochak@gol.com>
18760 * typemanager.cs: Remove unused private member. Also reported mcs
18761 bug to report this as a warning like csc.
18763 2002-10-15 Martin Baulig <martin@gnome.org>
18765 * statement.cs (Statement.Emit): Made this a virtual method; emits
18766 the line number info and calls DoEmit().
18767 (Statement.DoEmit): New protected abstract method, formerly knows
18768 as Statement.Emit().
18770 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
18772 2002-10-11 Miguel de Icaza <miguel@ximian.com>
18774 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
18775 have fixed a remaining problem: not every AddXXXX was adding a
18776 fully qualified name.
18778 Now everyone registers a fully qualified name in the DeclSpace as
18779 being defined instead of the partial name.
18781 Downsides: we are slower than we need to be due to the excess
18782 copies and the names being registered this way.
18784 The reason for this is that we currently depend (on the corlib
18785 bootstrap for instance) that types are fully qualified, because
18786 we dump all the types in the namespace, and we should really have
18787 types inserted into the proper namespace, so we can only store the
18788 basenames in the defined_names array.
18790 2002-10-10 Martin Baulig <martin@gnome.org>
18792 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
18793 from bug #31834, see the bug report for a testcase which is
18796 2002-10-10 Martin Baulig <martin@gnome.org>
18798 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
18799 flow analysis code for this.
18801 * statement.cs (Do, While, For): Tell the flow analysis code about
18803 (FlowBranching.UsageVector): Added support for infinite loops.
18804 (Block.Resolve): Moved the dead code elimination here and use flow
18807 2002-10-09 Miguel de Icaza <miguel@ximian.com>
18809 * class.cs (Field.Define): Catch cycles on struct type
18812 * typemanager.cs (IsUnmanagedtype): Do not recursively check
18813 fields if the fields are static. We only need to check instance
18816 * expression.cs (As.DoResolve): Test for reference type.
18818 * statement.cs (Using.ResolveExpression): Use
18819 ConvertImplicitRequired, not ConvertImplicit which reports an
18821 (Using.ResolveLocalVariableDecls): ditto.
18823 * expression.cs (Binary.ResolveOperator): Report errors in a few
18824 places where we had to.
18826 * typemanager.cs (IsUnmanagedtype): Finish implementation.
18828 2002-10-08 Miguel de Icaza <miguel@ximian.com>
18830 * expression.cs: Use StoreFromPtr instead of extracting the type
18831 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
18833 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
18834 an enumeration value to a System.Enum, but System.Enum is not a
18835 value type, but an class type, so we need to box.
18837 (Expression.ConvertExplicit): One codepath could return
18838 errors but not flag them. Fix this. Fixes #31853
18840 * parameter.cs (Resolve): Do not allow void as a parameter type.
18842 2002-10-06 Martin Baulig <martin@gnome.org>
18844 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
18845 if it's a class type and not a struct. Fixes #31815.
18847 2002-10-06 Martin Baulig <martin@gnome.org>
18849 * statement.cs: Reworked the flow analysis code a bit to make it
18850 usable for dead code elimination.
18852 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18854 * cs-parser.jay: allow empty source files. Fixes bug #31781.
18856 2002-10-04 Miguel de Icaza <miguel@ximian.com>
18858 * expression.cs (ComposedCast.DoResolveType): A quick workaround
18859 to fix the test 165, will investigate deeper.
18861 2002-10-04 Martin Baulig <martin@gnome.org>
18863 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
18864 finally blocks actually work.
18865 (Try.Resolve): We don't need to create a sibling for `finally' if
18866 there is no finally block.
18868 2002-10-04 Martin Baulig <martin@gnome.org>
18870 * class.cs (Constructor.Define): The default accessibility for a
18871 non-default constructor is private, not public.
18873 2002-10-04 Miguel de Icaza <miguel@ximian.com>
18875 * class.cs (Constructor): Make AllowedModifiers public, add
18878 * cs-parser.jay: Perform the modifiers test here, as the
18879 constructor for the Constructor class usually receives a zero
18880 because of the way we create it (first we create, later we
18881 customize, and we were never checking the modifiers).
18883 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
18884 is a version of LookupTypeReflection that includes the type-name
18885 cache. This can be used as a fast path for functions that know
18886 the fully qualified name and are only calling into *.GetType() to
18887 obtain a composed type.
18889 This is also used by TypeManager.LookupType during its type
18892 (LookupType): We now also track the real type name, as sometimes
18893 we can get a quey for the real type name from things like
18894 ComposedCast. This fixes bug 31422.
18896 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
18897 complete type fullname, it does not have to go through the type
18898 resolution system to obtain the composed version of the type (for
18899 obtaining arrays or pointers).
18901 (Conditional.Emit): Use the EmitBoolExpression to
18902 generate nicer code, as requested by Paolo.
18904 (ArrayCreation.CheckIndices): Use the patch from
18905 hwang_rob@yahoo.ca to validate the array initializers.
18907 2002-10-03 Miguel de Icaza <miguel@ximian.com>
18909 * class.cs (ConstructorInitializer.Emit): simplify code by using
18910 Invocation.EmitCall, and at the same time, fix the bugs in calling
18911 parent constructors that took variable arguments.
18913 * ecore.cs (Expression.ConvertNumericExplicit,
18914 Expression.ImplicitNumericConversion): Remove the code that
18915 manually wrapped decimal (InternalTypeConstructor call is now gone
18918 * expression.cs (Cast.TryReduce): Also handle decimal types when
18919 trying to perform a constant fold on the type.
18921 * typemanager.cs (IsUnmanagedtype): Partially implemented.
18923 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
18924 that only turned off an error report, and did nothing else.
18926 2002-10-02 Miguel de Icaza <miguel@ximian.com>
18928 * driver.cs: Handle and ignore /fullpaths
18930 2002-10-01 Miguel de Icaza <miguel@ximian.com>
18932 * expression.cs (Binary.ResolveOperator): Catch the case where
18933 DoNumericPromotions returns true,
18935 (Binary.DoNumericPromotions): Simplify the code, and the tests.
18937 2002-09-27 Miguel de Icaza <miguel@ximian.com>
18939 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
18942 2002-09-26 Miguel de Icaza <miguel@ximian.com>
18944 * ecore.cs (ConvertNumericExplicit): It is not enough that the
18945 conversion exists, but it is also required that the conversion be
18946 performed. This manifested in "(Type64Enum) 2".
18948 * class.cs (TypeManager.AddMethod): The fix is not to change
18949 AddEnum, because that one was using a fully qualified name (every
18950 DeclSpace derivative does), but to change the AddMethod routine
18951 that was using an un-namespaced name. This now correctly reports
18952 the duplicated name.
18954 Revert patch until I can properly fix it. The issue
18955 is that we have a shared Type space across all namespaces
18956 currently, which is wrong.
18958 Options include making the Namespace a DeclSpace, and merge
18959 current_namespace/current_container in the parser.
18961 2002-09-25 Miguel de Icaza <miguel@ximian.com>
18963 * cs-parser.jay: Improve error reporting when we get a different
18964 kind of expression in local_variable_type and
18965 local_variable_pointer_type.
18967 Propagate this to avoid missleading errors being reported.
18969 * ecore.cs (ImplicitReferenceConversion): treat
18970 TypeManager.value_type as a target just like object_type. As
18975 Is valid, and needs to result in the int 1 being boxed before it
18976 is assigned to the value type v.
18978 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
18979 to validate the enumeration name.
18981 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
18982 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
18983 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
18985 * ecore.cs (TryImplicitIntConversion): When doing an
18986 implicit-enumeration-conversion, check if the type is 64-bits and
18987 perform a conversion before passing to EnumConstant.
18989 2002-09-23 Miguel de Icaza <miguel@ximian.com>
18991 * decl.cs (Error_AmbiguousTypeReference); New routine used to
18992 report ambiguous type references. Unlike the MS version, we
18993 report what the ambiguity is. Innovation at work ;-)
18995 (DeclSpace.FindType): Require a location argument to
18996 display when we display an ambiguous error.
18998 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
19000 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
19002 * expression.cs (EmitDynamicInitializers): Apply patch from
19003 hwang_rob@yahoo.ca that fixes the order in which we emit our
19006 2002-09-21 Martin Baulig <martin@gnome.org>
19008 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
19009 delegate takes no arguments.
19011 2002-09-20 Miguel de Icaza <miguel@ximian.com>
19013 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
19016 * expression.cs: Extract the underlying type.
19018 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
19020 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
19022 2002-09-19 Miguel de Icaza <miguel@ximian.com>
19024 * class.cs (TypeContainer.DefineType): We can not use the nice
19025 PackingSize with the size set to 1 DefineType method, because it
19026 will not allow us to define the interfaces that the struct
19029 This completes the fixing of bug 27287
19031 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
19032 means also structs. This fixes part of the problem.
19033 (Expresion.ImplicitReferenceConversionExists): ditto.
19035 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
19036 error if there were no errors reported during the type lookup
19037 process, to avoid duplicates or redundant errors. Without this
19038 you would get an ambiguous errors plus a type not found. We have
19039 beaten the user enough with the first error.
19041 (DeclSparce.FindType): Emit a warning if we have an ambiguous
19044 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
19045 during the resolution process, stop the lookup, this avoids
19046 repeated error reports (same error twice).
19048 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
19050 * typemanager.cs (LookupType): Redo the type lookup code to match
19051 the needs of System.Reflection.
19053 The issue is that System.Reflection requires references to nested
19054 types to begin with a "+" sign instead of a dot. So toplevel
19055 types look like: "NameSpace.TopLevelClass", and nested ones look
19056 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
19059 2002-09-19 Martin Baulig <martin@gnome.org>
19061 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
19062 says that a method always returns or always throws an exception,
19063 don't report the CS0161.
19065 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
19066 set `Returns = new_returns'.
19068 2002-09-19 Martin Baulig <martin@gnome.org>
19070 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
19071 to an enum constant, check for a CS0176.
19073 2002-09-18 Miguel de Icaza <miguel@ximian.com>
19075 * class.cs (TypeContainer.CheckPairedOperators): Now we check
19076 for operators that must be in pairs and report errors.
19078 * ecore.cs (SimpleName.DoResolveType): During the initial type
19079 resolution process, when we define types recursively, we must
19080 check first for types in our current scope before we perform
19081 lookups in the enclosing scopes.
19083 * expression.cs (MakeByteBlob): Handle Decimal blobs.
19085 (Invocation.VerifyArgumentsCompat): Call
19086 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
19087 I thought we were supposed to always call this, but there are a
19088 few places in the code where we dont do it.
19090 2002-09-17 Miguel de Icaza <miguel@ximian.com>
19092 * driver.cs: Add support in -linkres and -resource to specify the
19093 name of the identifier.
19095 2002-09-16 Miguel de Icaza <miguel@ximian.com>
19097 * ecore.cs (StandardConversionExists): Sync with the conversion
19098 code: allow anything-* to void* conversions.
19100 (FindMostSpecificSource): Use an Expression argument
19101 instead of a Type, because we might be handed over a Literal which
19102 gets a few more implicit conversions that plain types do not. So
19103 this information was being lost.
19105 Also, we drop the temporary type-holder expression when not
19108 2002-09-17 Martin Baulig <martin@gnome.org>
19110 * class.cs (PropertyBase.CheckBase): Don't check the base class if
19111 this is an explicit interface implementation.
19113 2002-09-17 Martin Baulig <martin@gnome.org>
19115 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
19116 different `IndexerName' attributes.
19118 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
19119 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
19120 virtual CommonResolve().
19122 2002-09-16 Miguel de Icaza <miguel@ximian.com>
19124 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
19125 and convert that to the UnderlyingType.
19127 * statement.cs (Foreach.Resolve): Indexers are just like variables
19128 or PropertyAccesses.
19130 * cs-tokenizer.cs (consume_string): Track line numbers and columns
19131 inside quoted strings, we were not doing this before.
19133 2002-09-16 Martin Baulig <martin@gnome.org>
19135 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
19136 resolve it. This is needed for the definite assignment check of the
19137 instance expression, fixes bug #29846.
19138 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
19140 2002-09-16 Nick Drochak <ndrochak@gol.com>
19142 * parameter.cs: Fix compile error. Cannot reference static member
19143 from an instance object. Is this an mcs bug?
19145 2002-09-14 Martin Baulig <martin@gnome.org>
19147 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
19148 multiple times. Fixes bug #30295, added test-166.cs.
19150 2002-09-14 Martin Baulig <martin@gnome.org>
19152 * statement.cs (Block.Emit): Don't emit unreachable code.
19153 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
19154 `break' statements.
19155 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
19157 2002-09-14 Martin Baulig <martin@gnome.org>
19159 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
19162 2002-09-14 Martin Baulig <martin@gnome.org>
19164 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
19165 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
19166 be false on the ms runtime.
19168 2002-09-13 Martin Baulig <martin@gnome.org>
19170 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
19171 the CS0038 error message.
19173 2002-09-12 Miguel de Icaza <miguel@ximian.com>
19175 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
19176 constant inside, return it.
19178 2002-09-12 Martin Baulig <martin@gnome.org>
19180 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
19181 implicit conversion can be done between enum types.
19183 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
19184 check whether an implicit conversion to the current enum's UnderlyingType
19185 exists and report an error if not.
19187 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
19188 without debugging support.
19190 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
19191 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
19193 2002-09-12 Martin Baulig <martin@gnome.org>
19195 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
19197 * ecore.cs (IMemberExpr.DeclaringType): New property.
19198 (SimpleName.SimpleNameResolve): Check whether we're accessing a
19199 nonstatic member of an outer type (CS0038).
19201 2002-09-11 Miguel de Icaza <miguel@ximian.com>
19203 * driver.cs: Activate the using-error detector at warning level
19204 4 (at least for MS-compatible APIs).
19206 * namespace.cs (VerifyUsing): Small buglett fix.
19208 * pending.cs (PendingImplementation): pass the container pointer.
19210 * interface.cs (GetMethods): Allow for recursive definition. Long
19211 term, I would like to move every type to support recursive
19212 definitions, not the current ordering mechanism that we have right
19215 The situation is this: Attributes are handled before interfaces,
19216 so we can apply attributes to interfaces. But some attributes
19217 implement interfaces, we will now handle the simple cases
19218 (recursive definitions will just get an error).
19220 * parameter.cs: Only invalidate types at the end if we fail to
19223 2002-09-09 Martin Baulig <martin@gnome.org>
19225 * ecore.cs (PropertyExpr.Emit): Also check for
19226 TypeManager.system_int_array_get_length so this'll also work when
19227 compiling corlib. Fixes #30003.
19229 2002-09-09 Martin Baulig <martin@gnome.org>
19231 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
19232 and throw an exception if we can't get the type's size. Fixed #30040,
19235 2002-09-09 Martin Baulig <martin@gnome.org>
19237 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
19239 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
19240 context. Fixes bug #30027.
19242 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
19243 virtual functions. Fixes bug #30043, added test-164.cs.
19245 2002-09-08 Ravi Pratap <ravi@ximian.com>
19247 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
19249 2002-09-08 Nick Drochak <ndrochak@gol.com>
19251 * driver.cs: Use an object to get the windows codepage since it's not a
19254 2002-09-08 Miguel de Icaza <miguel@ximian.com>
19256 * statement.cs (For.Emit): for infinite loops (test == null)
19257 return whether there is a break inside, not always "true".
19259 * namespace.cs (UsingEntry): New struct to hold the name of the
19260 using definition, the location where it is defined, and whether it
19261 has been used in a successful type lookup.
19263 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
19268 2002-09-06 Ravi Pratap <ravi@ximian.com>
19270 * attribute.cs : Fix incorrect code which relied on catching
19271 a NullReferenceException to detect a null being passed in
19272 where an object was expected.
19274 2002-09-06 Miguel de Icaza <miguel@ximian.com>
19276 * statement.cs (Try): flag the catch variable as assigned
19278 * expression.cs (Cast): Simplified by using ResolveType instead of
19279 manually resolving.
19281 * statement.cs (Catch): Fix bug by using ResolveType.
19283 2002-09-06 Ravi Pratap <ravi@ximian.com>
19285 * expression.cs (BetterConversion): Special case for when we have
19286 a NullLiteral as the argument and we have to choose between string
19287 and object types - we choose string the way csc does.
19289 * attribute.cs (Attribute.Resolve): Catch the
19290 NullReferenceException and report error #182 since the Mono
19291 runtime no more has the bug and having this exception raised means
19292 we tried to select a constructor which takes an object and is
19295 2002-09-05 Ravi Pratap <ravi@ximian.com>
19297 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
19298 message (1502, 1503) when we can't locate a method after overload
19299 resolution. This is much more informative and closes the bug
19302 * interface.cs (PopulateMethod): Return if there are no argument
19303 types. Fixes a NullReferenceException bug.
19305 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
19306 expressions too. Previously we were checking only in one place for
19307 positional arguments leaving out named arguments.
19309 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
19310 type to the enum type is not allowed. Remove code corresponding to
19313 (ConvertNumericExplicit): Allow explicit conversions from
19314 the underlying type to enum type. This precisely follows the spec
19315 and closes a bug filed by Gonzalo.
19317 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19320 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
19322 2002-09-03 Miguel de Icaza <miguel@ximian.com>
19324 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
19325 it was important that we stored the right value after the
19326 reduction in `converted'.
19328 2002-09-04 Martin Baulig <martin@gnome.org>
19330 * location.cs (Location.SymbolDocument): Use full pathnames for the
19333 2002-08-30 Miguel de Icaza <miguel@ximian.com>
19335 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
19336 of the expression resolve mechanism, because that will catch the
19337 SimpleName error failures.
19339 (Conditional): If we can not resolve the
19340 expression, return, do not crash.
19342 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19345 (location): display token name instead of its number.
19347 2002-08-28 Martin Baulig <martin@gnome.org>
19349 * expression.cs (Binary.ResolveOperator): Don't silently return
19350 but return an error if an operator cannot be applied between two
19353 2002-08-28 Martin Baulig <martin@gnome.org>
19355 * class.cs (Constructor.Define): Set the permission attributes
19356 correctly instead of making all constructors public.
19358 2002-08-28 Martin Baulig <martin@gnome.org>
19360 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
19361 for private members before reporting a CS0103; if we find anything,
19364 2002-08-28 Martin Baulig <martin@gnome.org>
19366 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
19367 to check whether `closure_start_type == closure_invocation_type',
19368 we also need to check whether `m.DeclaringType == closure_invocation_type'
19369 before bypassing the permission checks. We might be accessing
19370 protected/private members from the base class.
19371 (TypeManager.RealMemberLookup): Only set private_ok if private
19372 members were requested via BindingFlags.NonPublic.
19374 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
19376 * expression.cs (MemberAccess.ResolveMemberAccess): Set
19377 MethodGroupExpr.IsExplicitImpl if appropriate.
19378 (Invocation.DoResolve): Don't report the CS0120 for explicit
19379 interface implementations.
19381 2002-08-27 Martin Baulig <martin@gnome.org>
19383 * expression.cs (Invocation.DoResolve): If this is a static
19384 method and we don't have an InstanceExpression, we must report
19387 2002-08-25 Martin Baulig <martin@gnome.org>
19389 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
19390 `==' between a valuetype and an object.
19392 2002-08-25 Miguel de Icaza <miguel@ximian.com>
19394 * ecore.cs (TypeExpr): Provide a ToString method.
19396 2002-08-24 Martin Baulig <martin@gnome.org>
19398 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
19399 now called proggie.dbg and it's a binary file.
19401 2002-08-23 Martin Baulig <martin@gnome.org>
19403 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
19405 2002-08-23 Martin Baulig <martin@gnome.org>
19407 * struct.cs (MyStructInfo.ctor): Make this work with empty
19408 structs; it's not allowed to use foreach() on null.
19410 2002-08-23 Martin Baulig <martin@gnome.org>
19412 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
19413 writer the full pathname of the generated assembly.
19415 2002-08-23 Martin Baulig <martin@gnome.org>
19417 * statements.cs (FlowBranching.UsageVector.MergeChildren):
19418 A `finally' block never returns or breaks; improved handling of
19421 2002-08-23 Martin Baulig <martin@gnome.org>
19423 * statement.cs (Throw.Resolve): Allow `throw null'.
19425 2002-08-23 Martin Baulig <martin@gnome.org>
19427 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
19428 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
19429 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
19430 MemberLookup would return a wrong event if this is an explicit
19431 interface implementation and the class has an event with the same
19434 2002-08-23 Martin Baulig <martin@gnome.org>
19436 * statement.cs (Block.AddChildVariableNames): New public method.
19437 (Block.AddChildVariableName): Likewise.
19438 (Block.IsVariableNameUsedInChildBlock): Likewise.
19439 (Block.AddVariable): Check whether a variable name has already
19440 been used in a child block.
19442 * cs-parser.jay (declare_local_variables): Mark all variable names
19443 from the current block as being used in a child block in the
19446 2002-08-23 Martin Baulig <martin@gnome.org>
19448 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
19449 find the symbol writer.
19451 * driver.cs: csc also allows the arguments to /define being
19452 separated by commas, not only by semicolons.
19454 2002-08-23 Martin Baulig <martin@gnome.org>
19456 * interface.cs (Interface.GetMembers): Added static check for events.
19458 2002-08-15 Martin Baulig <martin@gnome.org>
19460 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
19461 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
19463 * ecore.cs (Expression.MemberLookup): Added documentation and explained
19464 why the MethodData.EmitDestructor() change was necessary.
19466 2002-08-20 Martin Baulig <martin@gnome.org>
19468 * class.cs (TypeContainer.FindMembers): Added static check for events.
19470 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
19472 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
19473 use Type.GetEvents(), not Type.FindMembers().
19475 2002-08-20 Martin Baulig <martin@gnome.org>
19477 * decl.cs (MemberCache): Added a special method cache which will
19478 be used for method-only searched. This ensures that a method
19479 search will return a MethodInfo with the correct ReflectedType for
19482 2002-08-20 Martin Baulig <martin@gnome.org>
19484 * decl.cs (DeclSpace.FindMembers): Made this public.
19486 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19488 * delegate.cs: fixed build on windows.
19489 [FIXME: Filed as bug #29150: MCS must report these errors.]
19491 2002-08-19 Ravi Pratap <ravi@ximian.com>
19493 * ecore.cs (StandardConversionExists): Return a false
19494 if we are trying to convert the void type to anything else
19495 since that is not allowed.
19497 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
19498 we flag error 70 in the event an event is trying to be accessed
19499 directly from outside the declaring type.
19501 2002-08-20 Martin Baulig <martin@gnome.org>
19503 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
19504 MemberCache from typemanager.cs to decl.cs.
19506 2002-08-19 Martin Baulig <martin@gnome.org>
19508 * class.cs (TypeContainer): Implement IMemberContainer.
19509 (TypeContainer.DefineMembers): Create the MemberCache.
19510 (TypeContainer.FindMembers): Do better BindingFlags checking; only
19511 return public members if BindingFlags.Public was given, check
19512 whether members are static.
19514 2002-08-16 Martin Baulig <martin@gnome.org>
19516 * decl.cs (DeclSpace.Define): Splitted this in Define and
19517 DefineMembers. DefineMembers is called first and initializes the
19520 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
19521 DefineMembers() on all our DeclSpaces.
19523 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
19524 but call DefineMembers() on all nested interfaces. We call their
19525 Define() in our new Define() function.
19527 * interface.cs (Interface): Implement IMemberContainer.
19528 (Interface.Define): Moved all code except the attribute stuf to
19530 (Interface.DefineMembers): Initialize the member cache.
19532 * typemanager.cs (IMemberFinder): Removed this interface, we don't
19533 need this anymore since we can use MemberCache.FindMembers directly.
19535 2002-08-19 Martin Baulig <martin@gnome.org>
19537 * typemanager.cs (MemberCache): When creating the cache for an
19538 interface type, add all inherited members.
19539 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
19540 to `out bool used_cache' and documented it.
19541 (TypeManager.MemberLookup): If we already used the cache in the first
19542 iteration, we don't need to do the interfaces check.
19544 2002-08-19 Martin Baulig <martin@gnome.org>
19546 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
19547 here from IMemberFinder and don't implement this interface anymore.
19548 (DeclSpace.MemberCache): Moved here from IMemberFinder.
19550 * typemanager.cs (IMemberFinder): This interface is now only used by
19551 classes which actually support the member cache.
19552 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
19553 since we only put DeclSpaces into this Hashtable.
19554 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
19555 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
19557 2002-08-16 Martin Baulig <martin@gnome.org>
19559 * typemanager.cs (ICachingMemberFinder): Removed.
19560 (IMemberFinder.MemberCache): New property.
19561 (TypeManager.FindMembers): Merged this with RealFindMembers().
19562 This function will never be called from TypeManager.MemberLookup()
19563 so we can't use the cache here, just the IMemberFinder.
19564 (TypeManager.MemberLookup_FindMembers): Check whether the
19565 IMemberFinder has a MemberCache and call the cache's FindMembers
19567 (MemberCache): Rewrote larger parts of this yet another time and
19568 cleaned it up a bit.
19570 2002-08-15 Miguel de Icaza <miguel@ximian.com>
19572 * driver.cs (LoadArgs): Support quoting.
19574 (Usage): Show the CSC-like command line arguments.
19576 Improved a few error messages.
19578 2002-08-15 Martin Baulig <martin@gnome.org>
19580 * typemanager.cs (IMemberContainer.Type): New property.
19581 (IMemberContainer.IsInterface): New property.
19583 The following changes are conditional to BROKEN_RUNTIME, which is
19584 defined at the top of the file.
19586 * typemanager.cs (MemberCache.MemberCache): Don't add the base
19587 class'es members, but add all members from TypeHandle.ObjectType
19588 if we're an interface.
19589 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
19590 is the current type.
19591 (MemberCache.CacheEntry.Container): Removed this field.
19592 (TypeHandle.GetMembers): Include inherited members.
19594 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19596 * typemanager.cs: fixed compilation and added a comment on a field that
19599 2002-08-15 Martin Baulig <martin@gnome.org>
19601 * class.cs (ConstructorInitializer.Resolve): In the
19602 Expression.MemberLookup call, use the queried_type as
19605 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
19606 declared' attribute, it's always true.
19607 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
19608 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
19609 temporary wrapper for FindMembers which tells MemberLookup whether
19610 members from the base classes are included in the return value.
19611 This will go away soon.
19612 (TypeManager.MemberLookup): Use this temporary hack here; once the
19613 new MemberCache is completed, we don't need to do the DeclaredOnly
19614 looping here anymore since the MemberCache will take care of this.
19615 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
19616 (MemberCache): When creating the MemberCache for a class, get
19617 members from the current class and all its base classes.
19618 (MemberCache.CacheEntry.Container): New field. This is a
19619 temporary hack until the Mono runtime is fixed to distinguish
19620 between ReflectedType and DeclaringType. It allows us to use MCS
19621 with both the MS runtime and the unfixed Mono runtime without
19622 problems and without accecting performance.
19623 (MemberCache.SearchMembers): The DeclaredOnly looping from
19624 TypeManager.MemberLookup is now done here.
19626 2002-08-14 Martin Baulig <martin@gnome.org>
19628 * statement.cs (MyStructInfo.MyStructInfo): Don't call
19629 Type.GetFields on dynamic types but get the fields from the
19630 corresponding TypeContainer.
19631 (MyStructInfo.GetStructInfo): Added check for enum types.
19633 * typemanager.cs (MemberList.IsSynchronized): Implemented.
19634 (MemberList.SyncRoot): Implemented.
19635 (TypeManager.FilterWithClosure): No need to check permissions if
19636 closure_start_type == closure_invocation_type, don't crash if
19637 closure_invocation_type is null.
19639 2002-08-13 Martin Baulig <martin@gnome.org>
19641 Rewrote TypeContainer.FindMembers to use a member cache. This
19642 gives us a speed increase of about 35% for the self-hosting MCS
19643 build and of about 15-20% for the class libs (both on GNU/Linux).
19645 * report.cs (Timer): New class to get enhanced profiling. This
19646 whole class is "TIMER" conditional since it remarkably slows down
19649 * class.cs (MemberList): New class. This is an IList wrapper
19650 which we're now using instead of passing MemberInfo[]'s around to
19651 avoid copying this array unnecessarily.
19652 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
19653 (ICachingMemberFinder, IMemberContainer): New interface.
19654 (TypeManager.FilterWithClosure): If `criteria' is null, the name
19655 has already been checked, otherwise use it for the name comparision.
19656 (TypeManager.FindMembers): Renamed to RealMemberFinder and
19657 provided wrapper which tries to use ICachingMemberFinder.FindMembers
19658 if possible. Returns a MemberList, not a MemberInfo [].
19659 (TypeHandle): New class, implements IMemberContainer. We create
19660 one instance of this class per type, it contains a MemberCache
19661 which is used to do the member lookups.
19662 (MemberCache): New class. Each instance of this class contains
19663 all members of a type and a name-based hash table.
19664 (MemberCache.FindMembers): This is our new member lookup
19665 function. First, it looks up all members of the requested name in
19666 the hash table. Then, it walks this list and sorts out all
19667 applicable members and returns them.
19669 2002-08-13 Martin Baulig <martin@gnome.org>
19671 In addition to a nice code cleanup, this gives us a performance
19672 increase of about 1.4% on GNU/Linux - not much, but it's already
19673 half a second for the self-hosting MCS compilation.
19675 * typemanager.cs (IMemberFinder): New interface. It is used by
19676 TypeManager.FindMembers to call FindMembers on a TypeContainer,
19677 Enum, Delegate or Interface.
19678 (TypeManager.finder_to_member_finder): New PtrHashtable.
19679 (TypeManager.finder_to_container): Removed.
19680 (TypeManager.finder_to_delegate): Removed.
19681 (TypeManager.finder_to_interface): Removed.
19682 (TypeManager.finder_to_enum): Removed.
19684 * interface.cs (Interface): Implement IMemberFinder.
19686 * delegate.cs (Delegate): Implement IMemberFinder.
19688 * enum.cs (Enum): Implement IMemberFinder.
19690 * class.cs (TypeContainer): Implement IMemberFinder.
19692 2002-08-12 Martin Baulig <martin@gnome.org>
19694 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
19696 2002-08-12 Martin Baulig <martin@gnome.org>
19698 * ecore.cs (ITypeExpression): New interface for expressions which
19700 (TypeExpression): Renamed to TypeLookupExpression.
19701 (Expression.DoResolve): If we're doing a types-only lookup, the
19702 expression must implement the ITypeExpression interface and we
19703 call DoResolveType() on it.
19704 (SimpleName): Implement the new ITypeExpression interface.
19705 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
19706 hack, the situation that we're only looking up types can't happen
19707 anymore when this method is called. Moved the type lookup code to
19708 DoResolveType() and call it.
19709 (SimpleName.DoResolveType): This ITypeExpression interface method
19710 is now doing the types-only lookup.
19711 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
19712 (ResolveFlags): Added MaskExprClass.
19714 * expression.cs (MemberAccess): Implement the ITypeExpression
19716 (MemberAccess.DoResolve): Added support for a types-only lookup
19717 when we're called via ITypeExpression.DoResolveType().
19718 (ComposedCast): Implement the ITypeExpression interface.
19720 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
19721 Expression.Resolve() with ResolveFlags.Type instead.
19723 2002-08-12 Martin Baulig <martin@gnome.org>
19725 * interface.cs (Interface.Define): Apply attributes.
19727 * attribute.cs (Attribute.ApplyAttributes): Added support for
19728 interface attributes.
19730 2002-08-11 Martin Baulig <martin@gnome.org>
19732 * statement.cs (Block.Emit): Only check the "this" variable if we
19733 do not always throw an exception.
19735 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
19736 whether the property has a set accessor.
19738 2002-08-11 Martin Baulig <martin@gnome.org>
19740 Added control flow analysis support for structs.
19742 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
19743 with control flow analysis turned off.
19744 (IVariable): New interface.
19745 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
19746 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
19747 (FieldExpr.DoResolve): Resolve the instance expression with flow
19748 analysis turned off and do the definite assignment check after the
19749 resolving when we know what the expression will resolve to.
19751 * expression.cs (LocalVariableReference, ParameterReference):
19752 Implement the new IVariable interface, only call the flow analysis
19753 code if ec.DoFlowAnalysis is true.
19754 (This): Added constructor which takes a Block argument. Implement
19755 the new IVariable interface.
19756 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
19757 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
19758 This does the definite assignment checks for struct members.
19760 * class.cs (Constructor.Emit): If this is a non-static `struct'
19761 constructor which doesn't have any initializer, call
19762 Block.AddThisVariable() to tell the flow analysis code that all
19763 struct elements must be initialized before control returns from
19766 * statement.cs (MyStructInfo): New public class.
19767 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
19768 argument to this indexer. If non-zero, check an individual struct
19769 member, not the whole struct.
19770 (FlowBranching.CheckOutParameters): Check struct members.
19771 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
19772 overloaded versions of these methods which take an additional
19773 `int field_idx' argument to check struct members.
19774 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
19775 overloaded versions of these methods which take an additional
19776 `string field_name' argument to check struct member.s
19777 (VariableInfo): Implement the IVariable interface.
19778 (VariableInfo.StructInfo): New public property. Returns the
19779 MyStructInfo instance of the variable if it's a struct or null.
19780 (Block.AddThisVariable): New public method. This is called from
19781 Constructor.Emit() for non-static `struct' constructor which do
19782 not have any initializer. It creates a special variable for the
19783 "this" instance variable which will be checked by the flow
19784 analysis code to ensure that all of the struct's fields are
19785 initialized before control returns from the constructor.
19786 (UsageVector): Added support for struct members. If a
19787 variable/parameter is a struct with N members, we reserve a slot
19788 in the usage vector for each member. A struct is considered fully
19789 initialized if either the struct itself (slot 0) or all its
19790 members are initialized.
19792 2002-08-08 Martin Baulig <martin@gnome.org>
19794 * driver.cs (Driver.MainDriver): Only report an error CS5001
19795 if there were no compilation errors.
19797 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
19798 `UnsafeContext' property to determine whether the parent is in
19799 unsafe context rather than checking the parent's ModFlags:
19800 classes nested in an unsafe class are unsafe as well.
19802 2002-08-08 Martin Baulig <martin@gnome.org>
19804 * statement.cs (UsageVector.MergeChildren): Distinguish between
19805 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
19806 we return. Added test17() and test18() to test-154.cs.
19808 2002-08-08 Martin Baulig <martin@gnome.org>
19810 * typemanager.cs (TypeManager.FilterWithClosure): If we have
19811 Family access, make sure the invoking type isn't a subclass of the
19812 queried type (that'd be a CS1540).
19814 * ecore.cs (Expression.MemberLookup): Added overloaded version of
19815 this method which takes an additional `Type invocation_type'.
19817 * expression.cs (BaseAccess.DoResolve): Use the base type as
19818 invocation and query type.
19819 (MemberAccess.DoResolve): If the lookup failed and we're about to
19820 report a CS0122, try a lookup with the ec.ContainerType - if this
19821 succeeds, we must report a CS1540.
19823 2002-08-08 Martin Baulig <martin@gnome.org>
19825 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
19826 (MethodGroupExpr): Implement the IMemberExpr interface.
19828 * expression (MemberAccess.ResolveMemberAccess): No need to have
19829 any special code for MethodGroupExprs anymore, they're now
19832 2002-08-08 Martin Baulig <martin@gnome.org>
19834 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
19835 Family, FamANDAssem and FamORAssem permissions.
19836 (TypeManager.IsSubclassOrNestedChildOf): New public method.
19838 2002-08-08 Martin Baulig <martin@gnome.org>
19840 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
19841 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
19844 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
19846 * driver.cs: implemented /resource option to embed managed resources.
19848 2002-08-07 Martin Baulig <martin@gnome.org>
19850 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
19851 (FieldBase.HasFieldInitializer): New public property.
19852 (FieldBase.GetInitializerExpression): New public method. Resolves and
19853 returns the field initializer and makes sure it is only resolved once.
19854 (TypeContainer.EmitFieldInitializers): Call
19855 FieldBase.GetInitializerExpression to get the initializer, this ensures
19856 that it isn't resolved multiple times.
19858 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
19859 the resolving process (SimpleName/MemberLookup) that we're currently
19860 emitting a field initializer (which must not access any instance members,
19861 this is an error CS0236).
19863 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
19864 argument, if the `IsFieldInitializer' flag is set, we must report and
19865 error CS0236 and not an error CS0120.
19867 2002-08-07 Martin Baulig <martin@gnome.org>
19869 * ecore.cs (IMemberExpr): New public interface.
19870 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
19871 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
19872 if the expression is an IMemberExpr.
19874 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
19875 to be null, implicitly default to `this' if we're non-static in
19876 this case. Simplified the code a lot by using the new IMemberExpr
19877 interface. Also fixed bug #28176 here.
19879 2002-08-06 Martin Baulig <martin@gnome.org>
19881 * cs-parser.jay (SimpleLookup): Removed. We need to create
19882 ParameterReferences during semantic analysis so that we can do a
19883 type-only search when resolving Cast, TypeOf and SizeOf.
19884 (block): Pass the `current_local_parameters' to the Block's
19887 * class.cs (ConstructorInitializer): Added `Parameters parameters'
19888 argument to the constructor.
19889 (ConstructorInitializer.Resolve): Create a temporary implicit
19890 block with the parameters.
19892 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
19893 references here if we aren't doing a type-only search.
19895 * statement.cs (Block): Added constructor which takes a
19896 `Parameters parameters' argument.
19897 (Block.Parameters): New public property.
19899 * support.cs (InternalParameters.Parameters): Renamed `parameters'
19900 to `Parameters' and made it public readonly.
19902 2002-08-06 Martin Baulig <martin@gnome.org>
19904 * ecore.cs (Expression.Warning): Made this public as well.
19906 * report.cs (Report.Debug): Print the contents of collections.
19908 2002-08-06 Martin Baulig <martin@gnome.org>
19910 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
19911 used to tell Resolve() which kinds of expressions it may return.
19912 (Expression.Resolve): Added overloaded version of this method which
19913 takes a `ResolveFlags flags' argument. This can be used to tell
19914 Resolve() which kinds of expressions it may return. Reports a
19916 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
19917 ResolveFlags.SimpleName.
19918 (Expression.Error118): Added overloaded version of this method which
19919 takes a `ResolveFlags flags' argument. It uses the flags to determine
19920 which kinds of expressions are allowed.
19922 * expression.cs (Argument.ResolveMethodGroup): New public method.
19923 Resolves an argument, but allows a MethodGroup to be returned.
19924 This is used when invoking a delegate.
19926 * TODO: Updated a bit.
19928 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19930 Fixed compilation with csc.
19932 * ecore.cs: Expression.Error made public. Is this correct? Should
19933 Warning be made public too?
19935 * expression.cs: use ea.Location instead of ea.loc.
19936 [FIXME: Filed as bug #28607: MCS must report these errors.]
19938 2002-08-06 Martin Baulig <martin@gnome.org>
19940 * ecore.cs (Expression.loc): Moved the location here instead of
19941 duplicating it in all derived classes.
19942 (Expression.Location): New public property.
19943 (Expression.Error, Expression.Warning): Made them non-static and
19944 removed the location argument.
19945 (Expression.Warning): Added overloaded version which takes an
19946 `int level' argument.
19947 (Expression.Error118): Make this non-static and removed the
19948 expression and location arguments.
19949 (TypeExpr): Added location argument to the constructor.
19951 * expression.cs (StaticCallExpr): Added location argument to
19953 (Indirection, PointerArithmetic): Likewise.
19954 (CheckedExpr, UnCheckedExpr): Likewise.
19955 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
19956 (StringPtr): Likewise.
19959 2002-08-05 Martin Baulig <martin@gnome.org>
19961 * expression.cs (BaseAccess.DoResolve): Actually report errors.
19963 * assign.cs (Assign.DoResolve): Check whether the source
19964 expression is a value or variable.
19966 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
19967 while resolving the corresponding blocks.
19969 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
19970 an error, don't silently return null.
19972 * statement.cs (Block.AddVariable): Do the error reporting here
19973 and distinguish between CS0128 and CS0136.
19974 (Block.DoResolve): Report all unused labels (warning CS0164).
19975 (LabeledStatement): Pass the location to the constructor.
19976 (LabeledStatement.HasBeenReferenced): New property.
19977 (LabeledStatement.Resolve): Set it to true here.
19979 * statement.cs (Return.Emit): Return success even after reporting
19980 a type mismatch error (CS0126 or CS0127), this is what csc does and
19981 it avoids confusing the users with any consecutive errors.
19983 2002-08-05 Martin Baulig <martin@gnome.org>
19985 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
19987 * const.cs (Const.LookupConstantValue): Catch circular definitions.
19989 * expression.cs (MemberAccess.DoResolve): Silently return if an
19990 error has already been reported.
19992 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
19993 error has already been reported.
19995 2002-08-05 Martin Baulig <martin@gnome.org>
19997 * statement.cs (UsageVector): Only initialize the `parameters'
19998 vector if we actually have any "out" parameters.
20000 2002-08-05 Martin Baulig <martin@gnome.org>
20002 * expression.cs (Binary.ResolveOperator): When combining delegates,
20003 they must have the same type.
20005 2002-08-05 Martin Baulig <martin@gnome.org>
20007 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
20008 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
20009 work with the ms runtime and we also don't need it: if we're a
20010 PropertyBuilder and not in the `indexer_arguments' hash, then we
20011 are a property and not an indexer.
20013 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
20014 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
20015 since the latter one doesn't work with the ms runtime.
20017 2002-08-03 Martin Baulig <martin@gnome.org>
20019 Fixed bugs #27998 and #22735.
20021 * class.cs (Method.IsOperator): New public field.
20022 (Method.CheckBase): Report CS0111 if there's already a method
20023 with the same parameters in the current class. Report CS0508 when
20024 attempting to change the return type of an inherited method.
20025 (MethodData.Emit): Report CS0179 if a method doesn't have a body
20026 and it's not marked abstract or extern.
20027 (PropertyBase): New abstract base class for Property and Indexer.
20028 (PropertyBase.CheckBase): Moved here from Property and made it work
20030 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
20031 the same so we can reuse it there.
20032 (Property, Indexer): Derive from PropertyBase.
20033 (MethodSignature.inheritable_property_signature_filter): New delegate
20034 to find properties and indexers.
20036 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
20037 argument and improved error reporting.
20039 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
20040 EmptyReadOnlyParameters and made it a property.
20042 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
20043 version of this method which takes a `PropertyInfo indexer'.
20044 (TypeManager.RegisterIndexer): New method.
20046 * class.cs: Added myself as author of this file :-)
20048 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20050 * class.cs: fixed compilation on windoze.
20052 2002-08-03 Martin Baulig <martin@gnome.org>
20054 * interface.cs (Interface.GetInterfaceBases): Check whether all
20055 base interfaces are at least as accessible than the current one.
20057 * class.cs (TypeContainer.GetClassBases): Check whether base types
20058 are at least as accessible than the current type.
20059 (TypeContainer.AsAccessible): Implemented and made non-static.
20060 (MemberBase.CheckParameters): Report errors if the accessibility
20063 * delegate.cs (Delegate.Delegate): The default visibility is
20064 internal for top-level types and private for nested types.
20065 (Delegate.Define): Report errors if the accessibility checks fail.
20067 * enum.cs (Enum.Enum): The default visibility is internal for
20068 top-level types and private for nested types.
20069 (Enum.DefineType): Compute the correct visibility.
20071 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
20072 function which takes a `bool is_toplevel' instead of a TypeContainer.
20074 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
20077 2002-08-02 Martin Baulig <martin@gnome.org>
20079 * expression.cs (LocalVariableReferenc): Added constructor which
20080 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
20081 (LocalVariableReference.IsReadOnly): New property.
20082 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
20083 variable is readonly, use our own readonly flag to do this; you can
20084 use the new constructor to get a writable reference to a read-only
20087 * cs-parser.jay (foreach_statement, using_statement): Get a writable
20088 reference to the local variable.
20090 2002-08-01 Miguel de Icaza <miguel@ximian.com>
20092 * rootcontext.cs (ResolveCore): Also include System.Exception
20094 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
20095 we reach an EmptyStatement.
20097 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
20100 * expression.cs (Binary.ResolveOperator): Check error result in
20103 use brtrue/brfalse directly and avoid compares to null.
20105 2002-08-02 Martin Baulig <martin@gnome.org>
20107 * class.cs (TypeContainer.Define): Define all nested interfaces here.
20108 Fixes bug #28407, added test-155.cs.
20110 2002-08-01 Martin Baulig <martin@gnome.org>
20112 * class.cs (Event.EmitDefaultMethod): Make this work with static
20113 events. Fixes #28311, added verify-3.cs.
20115 2002-08-01 Martin Baulig <martin@gnome.org>
20117 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
20118 `is_disposable' fields.
20119 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
20120 `hm.is_disposable' if we're using the collection pattern.
20121 (Foreach.EmitCollectionForeach): Use the correct type for the
20122 enumerator's local variable, only emit the try/finally block if
20123 necessary (fixes #27713).
20125 2002-08-01 Martin Baulig <martin@gnome.org>
20127 * ecore.cs (Expression.report118): Renamed to Error118 and made
20130 * statement.cs (Throw.Resolve): Check whether the expression is of
20131 the correct type (CS0118) and whether the type derives from
20132 System.Exception (CS0155).
20133 (Catch.Resolve): New method. Do the type lookup here and check
20134 whether it derives from System.Exception (CS0155).
20135 (Catch.CatchType, Catch.IsGeneral): New public properties.
20137 * typemanager.cs (TypeManager.exception_type): Added.
20139 2002-07-31 Miguel de Icaza <miguel@ximian.com>
20141 * driver.cs: Updated About function.
20143 2002-07-31 Martin Baulig <martin@gnome.org>
20145 Implemented Control Flow Analysis.
20147 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
20148 (EmitContext.CurrentBranching): Added.
20149 (EmitContext.StartFlowBranching): Added.
20150 (EmitContext.EndFlowBranching): Added.
20151 (EmitContext.KillFlowBranching): Added.
20152 (EmitContext.IsVariableAssigned): Added.
20153 (EmitContext.SetVariableAssigned): Added.
20154 (EmitContext.IsParameterAssigned): Added.
20155 (EmitContext.SetParameterAssigned): Added.
20156 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
20157 Added control flow analysis stuff here.
20159 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
20160 resolve the expression as lvalue.
20161 (LocalVariableReference.DoResolve): Check whether the variable has
20162 already been assigned.
20163 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
20164 the parameter as assigned here.
20165 (ParameterReference.DoResolve): Check whether the parameter has already
20167 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
20168 expression as lvalue.
20170 * statement.cs (FlowBranching): New class for the flow analysis code.
20171 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
20172 (LabeledStatement.IsDefined): New public property.
20173 (LabeledStatement.AddUsageVector): New public method to tell flow
20174 analyis that the label may be reached via a forward jump.
20175 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
20177 (VariableInfo.Number): New public field. This is used by flow analysis
20178 to number all locals of a block.
20179 (Block.CountVariables): New public property. This is the number of
20180 local variables in this block (including the locals from all parent
20182 (Block.EmitMeta): Number all the variables.
20184 * statement.cs: Added flow analysis support to all classes.
20186 2002-07-31 Martin Baulig <martin@gnome.org>
20188 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
20189 To get debugging messages, compile mcs with /define:MCS_DEBUG and
20190 then use this argument.
20192 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
20194 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
20195 use this to specify /define options.
20197 2002-07-29 Martin Baulig <martin@gnome.org>
20199 * statement.cs (Fixed): Moved all code that does variable lookups
20200 and resolvings from Emit to Resolve.
20202 * statement.cs (For): Moved all code that does variable lookups
20203 and resolvings from Emit to Resolve.
20205 * statement.cs (Using): Moved all code that does variable lookups
20206 and resolvings from Emit to Resolve.
20208 2002-07-29 Martin Baulig <martin@gnome.org>
20210 * attribute.cs (Attribute.Resolve): Explicitly catch a
20211 System.NullReferenceException when creating the
20212 CustromAttributeBuilder and report a different warning message.
20214 2002-07-29 Martin Baulig <martin@gnome.org>
20216 * support.cs (ParameterData.ParameterName): Added method to
20217 get the name of a parameter.
20219 * typemanager.cs (TypeManager.IsValueType): New public method.
20221 2002-07-29 Martin Baulig <martin@gnome.org>
20223 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
20224 is a flag which specifies that it's either ref or out.
20225 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
20226 the out parameter to `out Parameter.Modifier mod', also set the
20227 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
20229 * support.cs (InternalParameters.ParameterModifier): Distinguish
20230 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20231 Parameter.Modifier.ISBYREF flag if it's either ref or out.
20233 * expression.cs (Argument.GetParameterModifier): Distinguish
20234 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20235 Parameter.Modifier.ISBYREF flag if it's either ref or out.
20237 2002-07-29 Martin Baulig <martin@gnome.org>
20239 * expression.cs (ParameterReference.ParameterReference): Added
20240 `Location loc' argument to the constructor.
20242 * cs-parser.jay: Pass location to ParameterReference.
20244 2002-07-28 Miguel de Icaza <miguel@ximian.com>
20246 * statement.cs (Try): Initialize the location.
20248 * cs-parser.jay: pass location to Try.
20250 * expression.cs (Unary.Reduce): Change the prototype to return
20251 whether a constant fold could be performed or not. The result is
20252 returned in an out parameters. In the case of Indirection and
20253 AddressOf, we want to perform the full tests.
20255 2002-07-26 Miguel de Icaza <miguel@ximian.com>
20257 * statement.cs (Statement.Emit): Flag dead code.
20259 2002-07-27 Andrew Birkett <andy@nobugs.org>
20261 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
20263 2002-07-27 Martin Baulig <martin@gnome.org>
20265 * class.cs (MethodData.Define): Put back call to
20266 TypeManager.AddMethod(), accidentally commented this out.
20268 * report.cs (Debug): New public method to print debugging information,
20269 this is `[Conditional ("DEBUG")]'.
20271 2002-07-26 Martin Baulig <martin@gnome.org>
20273 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
20274 (switch_statement): Push the current_block to the switch_stack and
20275 pop it again when we're done with the switch.
20276 (switch_section): The new block is a child of the current_block.
20277 Fixes bug #24007, added test-152.cs.
20279 2002-07-27 Martin Baulig <martin@gnome.org>
20281 * expression.cs (Invocation.EmitArguments): When calling a varargs
20282 function with only its fixed arguments, we need to pass an empty
20285 2002-07-27 Martin Baulig <martin@gnome.org>
20287 Mono 0.13 has been released.
20289 2002-07-25 Miguel de Icaza <miguel@ximian.com>
20291 * driver.cs: Rename --resource to --linkres, because that is what
20292 we do currently, we dont support --resource yet.
20294 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
20296 2002-07-25 Martin Baulig <martin@gnome.org>
20298 * class.cs (MethodData): New public class. This is a `method builder'
20299 class for a method or one accessor of a Property/Indexer/Event.
20300 (MethodData.GetMethodFlags): Moved here from MemberBase.
20301 (MethodData.ApplyAttributes): Likewise.
20302 (MethodData.ApplyObsoleteAttribute): Likewise.
20303 (MethodData.ApplyConditionalAttribute): Likewise.
20304 (MethodData.ApplyDllImportAttribute): Likewise.
20305 (MethodData.CheckAbstractAndExternal): Likewise.
20306 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
20307 (MethodData.Emit): Formerly known as Method.Emit().
20308 (MemberBase): Moved everything which was specific to a single
20309 accessor/method to MethodData.
20310 (Method): Create a new MethodData and call Define() and Emit() on it.
20311 (Property, Indexer, Event): Create a new MethodData objects for each
20312 accessor and call Define() and Emit() on them.
20314 2002-07-25 Martin Baulig <martin@gnome.org>
20316 Made MethodCore derive from MemberBase to reuse the code from there.
20317 MemberBase now also checks for attributes.
20319 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
20320 (MemberBase.GetMethodFlags): Moved here from class Method and marked
20322 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
20323 `CallingConventions cc' and `Attributes opt_attrs' arguments.
20324 (MemberBase.ApplyAttributes): New virtual method; applies the
20325 attributes to a method or accessor.
20326 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
20327 (MemberBase.ApplyConditionalAttribute): Likewise.
20328 (MemberBase.ApplyDllImportAttribute): Likewise.
20329 (MemberBase.CheckAbstractAndExternal): Likewise.
20330 (MethodCore.ParameterTypes): This is now a property instead of a
20331 method, it's initialized from DoDefineParameters().
20332 (MethodCore.ParameterInfo): Removed the set accessor.
20333 (MethodCore.DoDefineParameters): New protected virtual method to
20334 initialize ParameterTypes and ParameterInfo.
20335 (Method.GetReturnType): We can now simply return the MemberType.
20336 (Method.GetMethodFlags): Override the MemberBase version and add
20337 the conditional flags.
20338 (Method.CheckBase): Moved some code from Define() here, call
20339 DoDefineParameters() here.
20340 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
20341 here to avoid some larger code duplication.
20342 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
20343 ensure that abstract and external accessors don't declare a body.
20345 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
20346 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
20347 lookup in the attribute's parent classes, so we need to abort as soon
20348 as we found the first match.
20349 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
20350 the attribute has no arguments.
20352 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
20355 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20357 * cs-parser.jay: reverted previous patch.
20359 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20361 * cs-parser.jay: fixed bug #22119.
20363 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20365 * attribute.cs: fixed compilation. The error was:
20366 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
20367 be assigned to before control leaves the current method."
20368 [FIXME: Filed as bug #28186: MCS must report this error.]
20370 2002-07-25 Martin Baulig <martin@gnome.org>
20372 * attribute.cs (Attribute.Conditional_GetConditionName): New static
20373 method to pull the condition name ouf of a Conditional attribute.
20374 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
20375 the obsolete message and error flag out of an Obsolete attribute.
20377 * class.cs (Method.GetMethodFlags): New public method to get the
20378 TypeManager.MethodFlags for this method.
20379 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
20381 (Method.Define): Get and apply the Obsolete and Conditional attributes;
20382 if we're overriding a virtual function, set the new private variable
20383 `parent_method'; call the new TypeManager.AddMethod().
20385 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
20386 the MethodBuilder and the Method in a PtrHashtable.
20387 (TypeManager.builder_to_method): Added for this purpose.
20388 (TypeManager.MethodFlags): Added IsObsoleteError.
20389 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
20390 Obsolete and Conditional arguments in MethodBuilders. If we discover
20391 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
20392 the message from the attribute.
20394 2002-07-24 Martin Baulig <martin@gnome.org>
20396 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
20397 preprocessor directives, ensure that the argument to #define/#undef is
20398 exactly one identifier and that it's actually an identifier.
20400 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
20403 2002-07-24 Martin Baulig <martin@gnome.org>
20405 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
20406 initialize it to TypeManager.object_type in the constructor.
20407 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
20408 of the `hm.get_current' method if we're using the collection pattern.
20409 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
20410 for the explicit conversion to make it work when we're using the collection
20411 pattern and the `Current' property has a different return type than `object'.
20414 2002-07-24 Martin Baulig <martin@gnome.org>
20416 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
20417 does not match, but don't report any errors. This method is called in
20418 order for all methods in a MethodGroupExpr until a matching method is
20419 found, so we don't want to bail out if the first method doesn't match.
20420 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
20421 matches, report the 123. Fixes #28070.
20423 2002-07-24 Martin Baulig <martin@gnome.org>
20425 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
20426 TypeManager.TypeToCoreType() to the top of the method so the
20427 following equality checks will work. Fixes #28107.
20429 2002-07-24 Martin Baulig <martin@gnome.org>
20431 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
20432 operand is of type uint, and the other operand is of type sbyte,
20433 short or int, the operands are converted to type long." -
20434 Actually do what this comment already told us. Fixes bug #28106,
20437 2002-07-24 Martin Baulig <martin@gnome.org>
20439 * class.cs (MethodBase): New abstract class. This is now a base
20440 class for Property, Indexer and Event to avoid some code duplication
20441 in their Define() and DefineMethods() methods.
20442 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
20443 generic methods for Define() and DefineMethods().
20444 (FieldBase): Derive from MemberBase, not MemberCore.
20445 (Property): Derive from MemberBase, not MemberCore.
20446 (Property.DefineMethod): Moved all the code from this method to the
20447 new MethodBase.DefineAccessor(), just call it with appropriate
20449 (Property.Define): Call the new Property.DoDefine(), this does some
20450 sanity checks and we don't need to duplicate the code everywhere.
20451 (Event): Derive from MemberBase, not MemberCore.
20452 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
20453 accessors, this will also make them work with interface events.
20454 (Indexer): Derive from MemberBase, not MemberCore.
20455 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
20456 (Indexer.Define): Use the new MethodBase functions.
20458 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
20459 argument to the constructor.
20460 (Interface.FindMembers): Added support for interface events.
20461 (Interface.PopluateEvent): Implemented.
20463 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
20465 2002-07-22 Miguel de Icaza <miguel@ximian.com>
20467 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
20468 but this is required to check for a method name being the same as
20469 the containing class.
20473 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20475 * interface.cs: initialize variable.
20477 2002-07-23 Martin Baulig <martin@gnome.org>
20479 Implemented the IndexerName attribute in interfaces.
20481 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
20482 name if this is an explicit interface implementation.
20483 (Indexer.InterfaceIndexerName): New public variable. If we're
20484 implementing an interface indexer, this is the IndexerName in that
20485 interface. Otherwise, it's the IndexerName.
20486 (Indexer.DefineMethod): If we're implementing interface indexer,
20487 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
20488 and Pending.ImplementIndexer methods.
20489 (Indexer.Define): Also define the PropertyBuilder if we're
20490 implementing an interface indexer and this is neither an explicit
20491 interface implementation nor do the IndexerName match the one in
20494 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
20495 If a method is defined here, then we always need to create a proxy
20496 for it. This is used when implementing interface indexers.
20497 (Pending.IsInterfaceIndexer): New public method.
20498 (Pending.ImplementIndexer): New public method.
20499 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
20500 This is used when implementing interface indexers to define a proxy
20502 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
20503 define a proxy if necessary.
20505 * interface.cs (Interface.IndexerName): New public variable.
20506 (Interface.PopulateIndexer): Set the IndexerName.
20507 (Interface.DefineIndexers): New private method. Populate all the
20508 indexers and make sure their IndexerNames match.
20510 * typemanager.cs (IndexerPropertyName): Added support for interface
20513 2002-07-22 Martin Baulig <martin@gnome.org>
20515 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
20516 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
20517 ret if HasReturnLabel.
20518 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
20521 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
20522 and set the ec.LoopBeginTryCatchLevel.
20523 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
20524 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
20525 the current ec.TryCatchLevel, the branch goes out of an exception
20526 block. In this case, we need to use Leave and not Br.
20528 2002-07-22 Martin Baulig <martin@gnome.org>
20530 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
20531 block unless the block does not always return or it is contained in
20532 another try { ... } catch { ... } block. Fixes bug #26506.
20533 Added verify-1.cs to the test suite.
20535 2002-07-22 Martin Baulig <martin@gnome.org>
20537 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
20538 then we do not always return. Fixes bug #24985.
20540 2002-07-22 Martin Baulig <martin@gnome.org>
20542 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
20543 lookup on a per-class level; ie. walk up the class hierarchy until we
20544 found at least one applicable method, then choose the best among them.
20545 Fixes bug #24463 and test-29.cs.
20547 2002-07-22 Martin Baulig <martin@gnome.org>
20549 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
20550 return types of the methods. The return type is not part of the
20551 signature and we must not check it to make the `new' modifier work.
20552 Fixes bug #27999, also added test-147.cs.
20553 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
20555 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
20556 on the method's return type.
20558 2002-07-21 Martin Baulig <martin@gnome.org>
20560 * assign.cs: Make this work if the rightmost source is a constant and
20561 we need to do an implicit type conversion. Also adding a few more tests
20562 to test-38.cs which should have caught this.
20564 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
20565 target in the makefile for this. The makefile.gnu is primarily intended
20566 for end-users who don't want to debug the compiler.
20568 2002-07-21 Martin Baulig <martin@gnome.org>
20570 * assign.cs: Improved the Assign class so it can now handle embedded
20571 assignments (X = Y = Z = something). As a side-effect this'll now also
20572 consume less local variables. test-38.cs now passes with MCS, added
20573 a few new test cases to that test.
20575 2002-07-20 Martin Baulig <martin@gnome.org>
20577 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
20578 instructions. Fixes bug #27977, also added test-146.cs.
20580 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20582 * cs-tokenizer.cs: fixed getHex ().
20584 2002-07-19 Martin Baulig <martin@gnome.org>
20586 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
20587 not Type.GetType() to lookup the array type. This is needed when
20588 we're constructing an array of a user-defined type.
20589 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
20590 single-dimensional arrays, but also for single-dimensial arrays of
20593 2002-07-19 Martin Baulig <martin@gnome.org>
20595 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
20596 this function is called, it's not allowed to share LocalBuilders
20597 among ILGenerators.
20599 2002-07-19 Martin Baulig <martin@gnome.org>
20601 * expression.cs (Argument.Resolve): Report an error 118 when trying
20602 to pass a type as argument.
20604 2002-07-18 Martin Baulig <martin@gnome.org>
20606 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
20607 Conv_R_Un for the signed `long' type.
20609 2002-07-15 Miguel de Icaza <miguel@ximian.com>
20611 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
20612 `expr' for the temporary result, as that will fail if we do
20613 multiple resolves on the same expression.
20615 2002-07-05 Miguel de Icaza <miguel@ximian.com>
20617 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
20618 ec.TypeContainer for looking up aliases.
20620 * class.cs (TypeContainer): Remove LookupAlias from here.
20622 * decl.cs (DeclSpace); Move here.
20624 2002-07-01 Miguel de Icaza <miguel@ximian.com>
20626 * class.cs (FindMembers): Only call filter if the constructor
20627 bulider is not null.
20629 Also handle delegates in `NestedTypes' now. Now we will perform
20630 type lookups using the standard resolution process. This also
20633 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
20634 This uses Expressions (the limited kind that can be parsed by the
20635 tree) instead of strings.
20637 * expression.cs (ComposedCast.ToString): Implement, used to flag
20638 errors since now we have to render expressions.
20640 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
20643 * ecore.cs (SimpleName.ToString): ditto.
20645 * cs-parser.jay: Instead of using strings to assemble types, use
20646 Expressions to assemble the type (using SimpleName, ComposedCast,
20647 MemberAccess). This should fix the type lookups in declarations,
20648 because we were using a different code path for this.
20650 * statement.cs (Block.Resolve): Continue processing statements
20651 even when there is an error.
20653 2002-07-17 Miguel de Icaza <miguel@ximian.com>
20655 * class.cs (Event.Define): Also remove the `remove' method from
20656 the list of pending items.
20658 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
20659 generate more compact code.
20661 2002-07-17 Martin Baulig <martin@gnome.org>
20663 * const.cs (Const.LookupConstantValue): Add support for constant
20664 `unchecked' and `checked' expressions.
20665 Also adding test case test-140.cs for this.
20667 2002-07-17 Martin Baulig <martin@gnome.org>
20669 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
20670 check whether mi.ReturnType implements the IEnumerator interface; the
20671 `==' and the IsAssignableFrom() will fail in this situation.
20673 2002-07-16 Ravi Pratap <ravi@ximian.com>
20675 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
20678 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20680 * expression.cs: fixed bug #27811.
20682 2002-07-14 Miguel de Icaza <miguel@ximian.com>
20684 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
20685 Molaro: when we are a ref, the value already contains a pointer
20686 value, do not take the address of it.
20688 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20689 * removed mb-parser.jay and mb-tokenizer.cs
20691 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20693 * expression.cs: check against the building corlib void type.
20695 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
20697 * ecore.cs: fix for valuetype static readonly fields: when
20698 initializing them, we need their address, not the address of a copy.
20700 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
20702 * typemanager.cs: register also enum_type in corlib.
20704 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20706 * class.cs: allow calling this (but not base) initializers in structs.
20708 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
20710 * ecore.cs: make sure we compare against the building base types
20713 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
20715 * typemanager.cs: fix TypeToCoreType() to handle void and object
20716 (corlib gets no more typerefs after this change).
20718 2002-07-12 Miguel de Icaza <miguel@ximian.com>
20720 * expression.cs (ArrayCreation.EmitArrayArguments): use
20721 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
20723 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
20724 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
20725 array indexes, the runtime actually forbids them.
20727 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
20728 for array arguments here.
20730 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
20731 instead of the default for ValueTypes.
20733 (New.DoEmit): Use IsValueType instead of
20734 IsSubclassOf (value_type)
20735 (New.DoResolve): ditto.
20736 (Invocation.EmitCall): ditto.
20738 * assign.cs (Assign): ditto.
20740 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
20741 Statements *are* currently doing part of their resolution during
20744 Expressions do always resolve during resolve, but statements are
20745 only required to propagate resolution to their children.
20747 2002-07-11 Miguel de Icaza <miguel@ximian.com>
20749 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
20751 (LoadAssembly): Do not add the dll if it is already specified
20753 (MainDriver): Add the System directory to the link path at the end,
20754 after all the other -L arguments.
20756 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
20757 wrong opcode for loading bytes and bools (ldelem.i1 instead of
20758 ldelem.u1) and using the opposite for sbytes.
20760 This fixes Digger, and we can finally run it.
20762 * driver.cs (UnixParseOption): Move the option parsing here.
20763 (CSCParseOption): Implement CSC-like parsing of options.
20765 We now support both modes of operation, the old Unix way, and the
20766 new CSC-like way. This should help those who wanted to make cross
20767 platform makefiles.
20769 The only thing broken is that /r:, /reference: and /lib: are not
20770 implemented, because I want to make those have the same semantics
20771 as the CSC compiler has, and kill once and for all the confussion
20772 around this. Will be doing this tomorrow.
20774 * statement.cs (Unsafe.Resolve): The state is checked during
20775 resolve, not emit, so we have to set the flags for IsUnsfe here.
20777 2002-07-10 Miguel de Icaza <miguel@ximian.com>
20779 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
20780 not catch the Error_ObjectRefRequired in SimpleName (as it is
20781 possible to have a class/instance variable name that later gets
20782 deambiguated), we have to check this here.
20784 2002-07-10 Ravi Pratap <ravi@ximian.com>
20786 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
20787 make static and put into Expression.
20789 (Event.Define): Register the private field of the event with the
20790 TypeManager so that GetFieldFromEvent can get at it.
20792 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
20793 keep track of the private field associated with an event which
20796 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
20799 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
20801 2002-07-10 Miguel de Icaza <miguel@ximian.com>
20803 * expression.cs (Binary.EmitBranchable): this routine emits the
20804 Binary expression in a branchable context. This basically means:
20805 we need to branch somewhere, not just get the value on the stack.
20807 This works together with Statement.EmitBoolExpression.
20809 * statement.cs (Statement.EmitBoolExpression): Use
20812 2002-07-09 Miguel de Icaza <miguel@ximian.com>
20814 * statement.cs (For): Reduce the number of jumps in loops.
20816 (For): Implement loop inversion for the For statement.
20818 (Break): We can be breaking out of a Try/Catch controlled section
20819 (foreach might have an implicit try/catch clause), so we need to
20820 use Leave instead of Br.
20822 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
20823 now). If the instace expression supports IMemoryLocation, we use
20824 the AddressOf method from the IMemoryLocation to extract the
20825 address instead of emitting the instance.
20827 This showed up with `This', as we were emitting the instance
20828 always (Emit) instead of the Address of This. Particularly
20829 interesting when This is a value type, as we dont want the Emit
20830 effect (which was to load the object).
20832 2002-07-08 Miguel de Icaza <miguel@ximian.com>
20834 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
20836 * statement.cs (Checked): Set the CheckedState during the resolve
20837 process too, as the ConvCast operations track the checked state on
20838 the resolve process, and not emit.
20840 * cs-parser.jay (namespace_member_declaration): Flag that we have
20841 found a declaration when we do. This is used to flag error 1529
20843 * driver.cs: Report ok when we display the help only.
20845 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
20847 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
20849 2002-07-04 Miguel de Icaza <miguel@ximian.com>
20851 * cs-tokenizer.cs (define): We also have to track locally the
20852 defines. AllDefines is just used for the Conditional Attribute,
20853 but we also need the local defines for the current source code.
20855 2002-07-03 Miguel de Icaza <miguel@ximian.com>
20857 * statement.cs (While, For, Do): These loops can exit through a
20858 Break statement, use this information to tell whether the
20859 statement is the last piece of code.
20861 (Break): Flag that we break.
20863 * codegen.cs (EmitContexts): New `Breaks' state variable.
20865 2002-07-03 Martin Baulig <martin@gnome.org>
20867 * class.cs (TypeContainer.MethodModifiersValid): Allow override
20868 modifiers in method declarations in structs. Otherwise, you won't
20869 be able to override things like Object.Equals().
20871 2002-07-02 Miguel de Icaza <miguel@ximian.com>
20873 * class.cs (Method, Property, Indexer): Do not allow the public
20874 modifier to be used in explicit interface implementations.
20876 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
20877 override modifiers in method declarations in structs
20879 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
20881 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
20882 integer or real overflow, report an error
20884 2002-07-02 Martin Baulig <martin@gnome.org>
20886 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
20887 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
20888 to tell the runtime about our newly created System.Object and
20889 System.ValueType types.
20891 2002-07-02 Miguel de Icaza <miguel@ximian.com>
20893 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
20894 struct instead of Ldarg/Starg.
20896 2002-07-02 Martin Baulig <martin@gnome.org>
20898 * expression.cs (Indirection.Indirection): Call
20899 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
20901 2002-07-02 Martin Baulig <martin@gnome.org>
20903 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
20904 ValueType, call TypeManager.TypeToCoreType() on it.
20905 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
20906 the OpCodes.Newarr argument.
20908 2002-07-02 Martin Baulig <martin@gnome.org>
20910 * expression.cs (Invocation.EmitCall): When compiling corlib,
20911 replace all calls to the system's System.Array type to calls to
20912 the newly created one.
20914 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
20915 System.Array methods.
20916 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
20917 from the system's System.Array type which must be replaced.
20919 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
20921 * typemanager.cs: load unverifiable_code_ctor so we can build
20922 corlib using the correct type. Avoid using GetTypeCode() with
20924 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
20925 TypeManager.object_type to allow building corlib.
20927 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
20929 * ecore.cs: handle System.Enum separately in LoadFromPtr().
20931 2002-07-01 Martin Baulig <martin@gnome.org>
20933 * class.cs: Make the last change actually work, we need to check
20934 whether `ifaces != null' to avoid a crash.
20936 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20938 * class.cs: when we build structs without fields that implement
20939 interfaces, we need to add the interfaces separately, since there is
20940 no API to both set the size and add the interfaces at type creation
20943 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20945 * expression.cs: the dimension arguments to the array constructors
20946 need to be converted if they are a long.
20948 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
20950 * class.cs: don't emit ldarg.0 if there is no parent constructor
20951 (fixes showstopper for corlib).
20953 2002-06-29 Martin Baulig <martin@gnome.org>
20955 MCS now compiles corlib on GNU/Linux :-)
20957 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
20958 ie. check for MethodImplOptions.InternalCall.
20960 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
20961 and TypeManager.attribute_type are null, so we must explicitly check
20962 whether parent is not null to find out whether it's an attribute type.
20963 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
20964 and SetBuilder, not only if the property is neither abstract nor external.
20965 This is necessary to set the MethodImplOptions on the accessor methods.
20966 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
20967 SetBuilder, see Property.Emit().
20969 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
20970 populate "System.Object", "System.ValueType" and "System.Attribute" since
20971 they've already been populated from BootCorlib_PopulateCoreTypes().
20973 2002-06-29 Martin Baulig <martin@gnome.org>
20975 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
20976 is the NullLiteral, we also need to make sure that target_type is not
20979 2002-06-29 Martin Baulig <martin@gnome.org>
20981 * rootcontext.cs (RootContext.ResolveCore): We must initialize
20982 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
20983 before calling BootstrapCorlib_ResolveDelegate ().
20985 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20987 * statement.cs: fixed build-breaker. All tests passed ok.
20989 2002-06-27 Martin Baulig <martin@gnome.org>
20991 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
20992 for System.Decimal when compiling corlib.
20994 2002-06-27 Martin Baulig <martin@gnome.org>
20996 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
20997 switch blocks which contain nothing but a default clause.
20999 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
21001 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
21003 2002-06-27 Martin Baulig <martin@gnome.org>
21005 * ecore.cs (PropertyExpr.PropertyExpr): Call
21006 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
21008 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
21009 is already a TypeBuilder.
21011 2002-06-27 Martin Baulig <martin@gnome.org>
21013 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
21014 `target_type == TypeManager.array_type', not IsAssignableFrom() in
21015 the "from an array-type to System.Array" case. This makes it work
21016 when compiling corlib.
21018 2002-06-27 Martin Baulig <martin@gnome.org>
21020 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
21021 non-static PropertyExpr, set its InstanceExpression. This makes
21022 the `ICollection.Count' property work in System/Array.cs.
21024 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
21026 * driver.cs: Made error handling more consistent. Errors now
21027 tracked by Report class, so many methods which used to return int
21028 now return void. Main() now prints success/failure and
21029 errors/warnings message.
21031 Renamed '--probe' compiler argument to '--expect-error'. Removed
21032 the magic number return values (123 and 124). Now, if the
21033 expected error occurs, the compiler exits with success (exit value
21034 0). If the compilation completes without seeing that particular
21035 error, the compiler exits with failure (exit value 1). The
21036 makefile in mcs/errors has been changed to handle the new behaviour.
21038 * report.cs: Made 'expected error' number a property and renamed
21039 it from 'Probe' to 'ExpectedError'.
21041 * genericparser.cs: Removed error handling support, since it is
21042 now all done by Report class.
21044 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
21045 class, so parse() no longer returns an int.
21047 * namespace.cs: Use Report.Error instead of GenericParser.error
21049 2002-06-22 Miguel de Icaza <miguel@ximian.com>
21051 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
21052 TypeContainer.AddOperator): At the front of the list put the
21053 explicit implementations, so they get resolved/defined first.
21055 2002-06-21 Miguel de Icaza <miguel@ximian.com>
21057 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
21058 interface type is implemented by this TypeContainer. Used during
21059 explicit interface implementation.
21061 (Property.Define, Indexer.Define, Method.Define): Validate that
21062 the given interface in the explicit implementation is one of the
21063 base classes for the containing type.
21065 Also if we are explicitly implementing an interface, but there is
21066 no match in the pending implementation table, report an error.
21068 (Property.Define): Only define the property if we are
21069 not explicitly implementing a property from an interface. Use the
21070 correct name also for those properties (the same CSC uses,
21071 although that is really not needed).
21073 (Property.Emit): Do not emit attributes for explicitly implemented
21074 properties, as there is no TypeBuilder.
21076 (Indexer.Emit): ditto.
21078 Hiding then means that we do not really *implement* a pending
21079 implementation, which makes code fail.
21081 2002-06-22 Martin Baulig <martin@gnome.org>
21083 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
21084 the return value of Object.GetType(). [FIXME: we need to do this whenever
21085 we get a type back from the reflection library].
21087 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
21089 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
21091 2002-06-20 Miguel de Icaza <miguel@ximian.com>
21093 * attribute.cs: Return null if we can not look up the type.
21095 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
21096 the interface types found.
21098 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
21099 interface types found.
21101 * typemanager.cs (GetInterfaces): Make this routine returns alll
21102 the interfaces and work around the lame differences between
21103 System.Type and System.Reflection.Emit.TypeBuilder in the results
21104 result for GetInterfaces.
21106 (ExpandInterfaces): Given an array of interface types, expand and
21107 eliminate repeated ocurrences of an interface. This expands in
21108 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
21111 2002-06-21 Martin Baulig <martin@gnome.org>
21113 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
21116 2002-06-21 Martin Baulig <martin@gnome.org>
21118 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
21119 and called with one of the core types, return the corresponding typebuilder for
21122 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
21125 2002-06-21 Martin Baulig <martin@gnome.org>
21127 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
21128 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
21129 (Expression.ConvertReferenceExplicit): Likewise.
21131 * expression.cs (ElementAccess.DoResolve): Likewise.
21132 (ElementAccess.DoResolveLValue): Likewise.
21134 2002-06-10 Martin Baulig <martin@gnome.org>
21136 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
21137 add the "value" parameter to the parameter list.
21139 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
21142 2002-06-19 Miguel de Icaza <miguel@ximian.com>
21144 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
21145 the argument to an int, uint, long or ulong, per the spec. Also
21146 catch negative constants in array creation.
21148 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
21150 * class.cs: do not allow the same interface to appear twice in
21151 the definition list.
21153 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
21155 * ecore.cs: don't use ldlen with System.Array.
21157 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
21159 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
21161 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
21163 * modifiers.cs: produce correct field attributes for protected
21164 internal. Easy fix so miguel can work on ther harder stuff:-)
21166 2002-06-18 Miguel de Icaza <miguel@ximian.com>
21168 * pending.cs: New file. Move the code from class.cs here.
21169 Support clearning the pending flag for all methods (when not doing
21170 explicit interface implementation).
21172 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
21174 * rootcontext.cs: added a couple more types needed to bootstrap.
21176 2002-06-17 Miguel de Icaza <miguel@ximian.com>
21178 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
21179 constructor in the type, instead of any constructor in the type
21180 hierarchy. Thanks to Paolo for finding this bug (it showed up as
21181 a bug in the Mono runtime when applying the params attribute).
21183 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
21184 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
21186 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
21188 * expression.cs (Unary.ResolveOperator): Use TypeManager
21189 to resolve the type.
21191 2002-06-13 Ravi Pratap <ravi@ximian.com>
21193 * cs-parser.jay (enum_member_declaration): Pass in the attributes
21196 * enum.cs (AddEnumMember): Add support to store the attributes associated
21197 with each member too.
21199 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
21200 field builders too - this takes care of the enum member case.
21202 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
21204 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
21205 address-of operator on both value types and pointers.
21207 2002-06-10 Martin Baulig <martin@gnome.org>
21209 * interface.cs (Interface.PopulateIndexer): Add the indexer's
21210 PropertyBuilder to the `property_builders' list.
21212 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
21213 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
21214 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
21215 find any indexers which are inherited from an interface.
21217 2002-06-09 Martin Baulig <martin@gnome.org>
21219 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
21220 the same type as the constant if necessary. There's also a test-130.cs
21223 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
21225 * typemanager.cs (TypeManager.ChangeType): Previously known as
21226 Enum.ChangeEnumType().
21228 2002-06-09 Martin Baulig <martin@gnome.org>
21230 * expression.cs (Cast.TryReduce): Added support for consts.
21232 2002-06-08 Ravi Pratap <ravi@ximian.com>
21234 * class.cs (Accessor): Hold attributes information so we can pass
21237 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
21238 Modify to pass in attributes attached to the methods.
21240 (add_accessor_declaration, remove_accessor_declaration): Ditto.
21242 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
21243 to handle the Accessor kind :-)
21245 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
21247 2002-06-08 Martin Baulig <martin@gnome.org>
21249 * expression.cs (Unary.TryReduceNegative): Added support for
21252 2002-06-08 Martin Baulig <martin@gnome.org>
21254 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
21255 name can't be found in the `defined_names' - the caller will do a
21256 MemberLookup in this case and thus find methods in System.Enum
21257 such as Enum.IsDefined().
21259 2002-06-08 Martin Baulig <martin@gnome.org>
21261 * enum.cs (Enum.ChangeEnumType): This is a custom version of
21262 Convert.ChangeType() which works with TypeBuilder created types.
21263 (Enum.LookupEnumValue, Enum.Define): Use it here.
21265 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
21266 `TypeBuilder.BaseType != null' check.
21267 (TypeContainer.FindMembers): Only lookup parent members if we
21268 actually have a parent.
21269 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
21270 (ConstructorInitializer.Resolve): Likewise.
21272 * interface.cs (Interface.FindMembers): Added
21273 `TypeBuilder.BaseType != null' check.
21275 * rootcontext.cs (RootContext.ResolveCore): Added
21276 "System.Runtime.CompilerServices.IndexerNameAttribute" to
21277 classes_second_stage.
21279 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
21280 debug_type and trace_type when compiling with --nostdlib.
21282 2002-06-07 Martin Baulig <martin@gnome.org>
21284 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
21285 (AddField): Set it to true when adding a non-static field.
21286 (DefineType): Use `have_nonstatic_fields' to find out whether we
21287 have non-static fields, not `Fields != null'.
21289 2002-06-02 Miguel de Icaza <miguel@ximian.com>
21291 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
21292 dereferencing a null on the static-field code path)
21294 2002-05-30 Martin Baulig <martin@gnome.org>
21296 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
21297 to take command line arguments. Use reflection to call the new
21298 custom `Initialize' function on the symbol writer and pass it the
21299 command line arguments.
21301 * driver.cs (--debug-args): New command line argument to pass command
21302 line arguments to the symbol writer.
21304 2002-05-28 Miguel de Icaza <miguel@ximian.com>
21306 * assign.cs (DoResolve): Forgot to do the implicit conversion to
21307 the target type for indexers and properties. Thanks to Joe for
21310 2002-05-27 Miguel de Icaza <miguel@ximian.com>
21312 * typemanager.cs (MethodFlags): returns the method flags
21313 (Obsolete/ShouldIgnore) that control warning emission and whether
21314 the invocation should be made, or ignored.
21316 * expression.cs (Invocation.Emit): Remove previous hack, we should
21317 not do this on matching a base type, we should do this based on an attribute
21319 Only emit calls to System.Diagnostics.Debug and
21320 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
21321 on the command line.
21323 * rootcontext.cs: Global settings for tracing and debugging.
21325 * cs-tokenizer.cs (define): New utility function to track
21326 defines. Set the global settings for TRACE and DEBUG if found.
21328 2002-05-25 Ravi Pratap <ravi@ximian.com>
21330 * interface.cs (Populate*): Pass in the TypeContainer as well as
21331 the DeclSpace as parameters so that we can create EmitContexts and
21332 then use that to apply attributes etc.
21334 (PopulateMethod, PopulateEvent, PopulateProperty)
21335 (PopulateIndexer): Apply attributes everywhere.
21337 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
21340 (ApplyAttributes): Update accordingly.
21342 We now apply interface attributes for all members too.
21344 2002-05-26 Miguel de Icaza <miguel@ximian.com>
21346 * class.cs (Indexer.Define); Correctly check if we are explicit
21347 implementation (instead of checking the Name for a ".", we
21348 directly look up if the InterfaceType was specified).
21350 Delay the creation of the PropertyBuilder.
21352 Only create the PropertyBuilder if we are not an explicit
21353 interface implementation. This means that explicit interface
21354 implementation members do not participate in regular function
21355 lookups, and hence fixes another major ambiguity problem in
21356 overload resolution (that was the visible effect).
21358 (DefineMethod): Return whether we are doing an interface
21361 * typemanager.cs: Temporary hack until we get attributes in
21362 interfaces (Ravi is working on that) and we get IndexerName
21363 support in interfaces.
21365 * interface.cs: Register the indexers as properties.
21367 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
21368 warning, I have verified that this is a bug in the .NET runtime
21369 (JavaScript suffers of the same problem).
21371 * typemanager.cs (MemberLookup): When looking up members for
21372 interfaces, the parent of an interface is the implicit
21373 System.Object (so we succeed in searches of Object methods in an
21374 interface method invocation. Example: IEnumerable x; x.ToString
21377 2002-05-25 Miguel de Icaza <miguel@ximian.com>
21379 * class.cs (Event): Events should also register if they do
21380 implement the methods that an interface requires.
21382 * typemanager.cs (MemberLookup); use the new GetInterfaces
21385 (GetInterfaces): The code used to lookup interfaces for a type is
21386 used in more than one place, factor it here.
21388 * driver.cs: Track the errors at the bottom of the file, we kept
21391 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
21392 instance if the method we are calling is static!
21394 2002-05-24 Miguel de Icaza <miguel@ximian.com>
21396 * attribute.cs (ApplyAttributes): Make this function filter out
21397 the IndexerName attribute (as that attribute in reality is never
21398 applied) and return the string constant for the IndexerName
21401 * class.cs (TypeContainer.Emit): Validate that all the indexers
21402 have the same IndexerName attribute, and if so, set the
21403 DefaultName attribute on the class.
21405 * typemanager.cs: The return value might contain other stuff (not
21406 only methods). For instance, consider a method with an "Item"
21407 property and an Item method.
21409 * class.cs: If there is a problem with the parameter types,
21412 2002-05-24 Ravi Pratap <ravi@ximian.com>
21414 * ecore.cs (ImplicitConversionExists): Wrapper function which also
21415 looks at user defined conversion after making a call to
21416 StandardConversionExists - we need this for overload resolution.
21418 * expression.cs : Update accordingly the various method calls.
21420 This fixes 2 bugs filed against implicit user defined conversions
21422 2002-05-22 Miguel de Icaza <miguel@ximian.com>
21424 * statement.cs: Track the result of the assignment.
21426 2002-05-21 Miguel de Icaza <miguel@ximian.com>
21428 * expression.cs (MemberAccess): Improved error reporting for
21429 inaccessible members.
21431 2002-05-22 Martin Baulig <martin@gnome.org>
21433 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
21434 itself with debugging support.
21436 2002-05-22 Martin Baulig <martin@gnome.org>
21438 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
21439 Removed, this isn't needed anymore.
21441 2002-05-20 Martin Baulig <martin@gnome.org>
21443 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
21444 be underlying type for an enum.
21446 2002-05-20 Miguel de Icaza <miguel@ximian.com>
21448 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
21449 that splits out the loading of just the core types.
21451 * rootcontext.cs (ResolveCore): Split the struct resolution in
21452 two, so we can load the enumeration underlying types before any
21455 * expression.cs (Is): Bandaid until we fix properly Switch (see
21456 bug #24985 for details).
21458 * typemanager.cs (ImplementsInterface): The hashtable will contain
21459 a null if there are no interfaces implemented.
21461 2002-05-18 Miguel de Icaza <miguel@ximian.com>
21463 * cs-parser.jay (indexer_declarator): It is fine to have array
21466 2002-05-17 Miguel de Icaza <miguel@ximian.com>
21468 * typemanager.cs: (RegisterBuilder): New function used to register
21469 TypeBuilders that implement interfaces. Since
21470 TypeBuilder.GetInterfaces (as usual) does not work with lame
21472 (AddUserType): register interfaces.
21474 (ImplementsInterface): Use the builder_to_ifaces hash if we are
21475 dealing with TypeBuilder. Also, arrays are showing up as
21476 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
21477 methods can not be invoked on them!
21479 * ecore.cs (ExplicitReferenceConversionExists): Made public.
21480 (ImplicitReferenceConversionExists): Split out from
21481 StandardConversionExists.
21483 * expression.cs (As): We were only implementing one of the three
21484 cases for the as operator. We now implement them all.
21485 (Is): Implement the various other cases for Is as well.
21487 * typemanager.cs (CACHE): New define used to control if we want or
21488 not the FindMembers cache. Seems to have a negative impact on
21489 performance currently
21491 (MemberLookup): Nested types have full acess to
21492 enclosing type members
21494 Remove code that coped with instance/static returns for events, we
21495 now catch this in RealFindMembers.
21497 (RealFindMembers): only perform static lookup if the instance
21498 lookup did not return a type or an event.
21500 2002-05-17 Miguel de Icaza <miguel@ximian.com>
21502 * assign.cs (CompoundAssign): We pass more semantic information
21503 now to Compound Assignments than we did before: now we have all
21504 the information at hand, and now we resolve the target *before* we
21505 do the expression expansion, which allows the "CacheValue" method
21506 to have the effect we intended (before, a [x] += 1 would generate
21507 two differen ArrayAccess expressions from the ElementAccess,
21508 during the resolution process).
21510 (CompoundAssign.DoResolve): Resolve target and original_source here.
21512 2002-05-16 Miguel de Icaza <miguel@ximian.com>
21514 * expression.cs (ArrayAccess): dropped debugging information.
21516 * typemanager.cs: Small bug fix: I was always returning i_members,
21517 instead of one of i_members or s_members (depending on which had
21520 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
21521 method is invoked before any code generation takes place, and it
21522 is a mechanism to inform that the expression will be invoked more
21523 than once, and that the method should use temporary values to
21524 avoid having side effects
21526 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
21528 * ecore.cs (Expression.CacheTemporaries): Provide empty default
21531 * expression.cs (Indirection, ArrayAccess): Add support for
21532 CacheTemporaries in these two bad boys.
21534 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
21535 ldobj or ldind_ref.
21536 (StoreFromPtr): Handle stobj as well.
21538 * expression.cs (UnaryMutator): Share more code.
21540 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
21541 down: I was not tracking the Filter function as well, which
21542 was affecting the results of the cache.
21544 2002-05-15 Miguel de Icaza <miguel@ximian.com>
21546 * attribute.cs: Remove the hack to handle the CharSet property on
21549 2002-05-14 Miguel de Icaza <miguel@ximian.com>
21551 * attribute.cs (DoResolve): More uglyness, we now only try to
21552 resolve the attribute partially, to extract the CharSet
21553 information (only if we are a StructLayout attribute). Otherwise
21555 (GetExtraTypeInfo): Add some code to conditionally kill in the
21556 future this. I am more and more convinced that the .NET
21557 framework has special code to handle the attribute setting on
21560 * expression.cs (IsParamsMethodApplicable): Revert my previous
21561 foreach change here, it was wrong.
21563 2002-05-13 Miguel de Icaza <miguel@ximian.com>
21565 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
21566 (pp_expr): do not abort on unknown input, just return.
21567 (eval): abort if there are pending chars.
21569 * attribute.cs (Attribute.Resolve): Positional parameters are
21570 optional. Deal with that case.
21572 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
21573 the Ansi/Unicode/Auto information for the type.
21575 (TypeContainer.DefineType): instantiate the EmitContext here, as
21576 we will be using it during the type definition (to resolve
21577 attributes) and during the emit phase.
21579 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
21580 to pull type information out of the attributes
21582 (Attribute.Resolve): track the constructor builder, and allow for
21583 multiple invocations (structs and classes will use this).
21585 * ecore.cs (MemberLookupFinal): new version with all the
21586 parameters customizable.
21588 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
21589 constructors. Return if the result value is null (as the error
21590 would have been flagged already by MemberLookupFinal)
21592 Do not allow instances of abstract classes or interfaces to be
21595 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
21596 We have to compare the assembly property here when dealing with
21597 FamANDAssem and Assembly access modifiers, because we might be
21598 creating an assembly from *modules* (that means that we are not
21599 getting TypeBuilders for types defined in other modules that are
21600 part of this assembly).
21602 (Method.Emit): If the method is marked abstract and has a body,
21605 (TypeContainer.DefineMembers): If both the defined member and the
21606 parent name match are methods, then do not emit any warnings: let
21607 the Method.Define routine take care of flagging warnings. But if
21608 there is a mismatch (method overrides something else, or method is
21609 overriwritten by something, then emit warning).
21611 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
21612 set to null, this means `do not check for the return type on the
21615 (Method.Define): set the return type for the method signature to
21616 null, so that we get methods with the same name and parameters and
21617 different return types. This is used to flag warning 114 (you are
21618 hiding a method, and you probably want to use the new/override
21621 * typemanager.cs (MemberLookup): Implemented proper access
21622 control, closing a long standing set of bug reports. The problem
21623 was that the Framework only has two bits: Public and NonPublic,
21624 and NonPublic includes private and protected methods, but we need
21625 to enforce the FamANDAssem, FamOrAssem and Family.
21627 2002-05-11 Miguel de Icaza <miguel@ximian.com>
21629 * statement.cs (GotoCase): Return true: Ammounts to giving up
21630 knowledge on whether we return or not, and letting the other case
21631 be responsible for it.
21633 2002-05-10 Miguel de Icaza <miguel@ximian.com>
21635 * driver.cs: Do not load directories for each file processed, only
21636 do it if there is a pattern.
21638 * ecore.cs: Report readonly assigns here as well, as we might have
21639 been resolved only by MemberAccess.
21641 (SimpleName.SimpleNameResolve): Also be useful for LValue
21642 resolution. We need this to propagate assign to local readonly variables
21644 * typemanager.cs: Use a ptrhashtable for the criteria, because we
21645 do not want to reuse potential criteria memory.
21647 * class.cs (MyEventBuilder): Set reflected_type;
21649 * ecore.cs (Constantify): Added support for constifying bools.
21651 (RootContext.LookupType): Added a cache for values looked up in
21652 the declaration space.
21654 * typemanager.cs (FindMembers): Now is a front-end to
21655 RealFindMembers, and provides a two-level hashtable-based cache to
21658 15% performance improvement: from 22.5 to 19.2 seconds.
21660 * expression.cs (IsParamsMethodApplicable): use foreach.
21661 (Invocation.DoResolve): ditto.
21662 (New.DoResolve): ditto.
21663 (ArrayCreation.DoResolve): ditto.
21665 * ecore.cs (FindMostEncompassingType): use foreach.
21667 * delegate.cs (NewDelegate.DoResolve): Use foreach
21669 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
21670 (RemoveMethods): use foreach.
21672 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
21673 nested foreach statements instead of for, and also break out of
21674 the inner loop once a match is found.
21676 (Invocation.OverloadResolve): Use foreach, simplify the code.
21678 2002-05-08 Miguel de Icaza <miguel@ximian.com>
21680 * cfold.cs (BinaryFold): During an enumeration evaluation context,
21681 we actually unwrap the expression to allow for extra information
21684 * expression.cs: Use Shr_Un on unsigned operations.
21686 2002-05-08 Ravi Pratap <ravi@ximian.com>
21688 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
21689 applicable operators was not being considered correctly. This closes
21690 the bug Miguel reported.
21692 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
21694 * attribute.cs: check that the type derives from System.Attribute
21695 and report the correct error in that case (moved the duplicate code to
21696 its own method, too).
21698 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
21700 * attribute.cs: lookup attribute type name as the spec says: first the
21701 bare attribute name and then name + "Attribute" (nant compiles with
21702 mcs after this fix).
21704 2002-05-07 Miguel de Icaza <miguel@ximian.com>
21706 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
21707 Because of the way we parse things, we should try to see if a
21708 UIntConstant can fit in an integer.
21710 2002-05-07 Ravi Pratap <ravi@ximian.com>
21712 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
21713 when we are in an explicit context.
21715 (ConvertReferenceExplicit): When converting from Iface type S to Class
21716 T make sure the rules are implemented as an OR.
21718 * parameter.cs (ParameterType): Make it a property for now although the
21719 purpose really isn't anything immediate.
21721 * expression.cs (Is*Applicable): Do better checking on the parameter type
21722 of a ref/out parameter. The ones from the system assemblies are already
21723 marked with the correct type so we don't need to do any correction.
21725 * ecore.cs (StandardConversionExists): Conversion from Interface types to
21726 the object type is standard too so include that.
21728 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21730 * ecore.cs (StandardConversionExists): Augment with missing code:
21731 deal with IntConstant, LongConstants and Enumerations.
21733 * assign.cs: Report the error, instead of failing silently
21735 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
21736 typecontainer that they are declared, because the
21737 typecontainer/namespace will have the list of using clauses that
21738 need to be applied.
21740 Assembly Attributes were escaping the normal registration
21743 (EmitCode): Apply attributes within an EmitContext that represents
21744 the container they were declared on.
21746 * cs-parser.jay: Track bases for structs. How did I get this wrong?
21748 2002-05-06 Ravi Pratap <ravi@ximian.com>
21750 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
21751 Revamp completely - make much cleaner as we now operate only
21754 (FindMostSpecificSource, FindMostSpecificTarget): New methods
21755 to implement the logic detailed in the spec more correctly.
21757 (UserDefinedConversion): Update accordingly.
21759 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21761 * statement.cs: Return flow analysis information up.
21763 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
21766 (token): Do not consume an extra character before calling
21769 2002-05-06 Piers Haken <piersh@friskit.com>
21771 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
21773 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21775 * class.cs (Constructor.Emit): Set the IsStatic flag in the
21776 EmitContext during the instance constructor initializer
21777 resolution, to stop access to instance variables.
21779 This is mandated by the spec, last paragraph of the `constructor
21780 initializers' section.
21782 2002-05-05 Miguel de Icaza <miguel@ximian.com>
21784 * cs-parser.jay, class.cs (Accessor): new class used to represent
21785 an accessor (get or set). In the past we used `null' to represent
21786 a missing accessor. But this is ambiguous because there was no
21787 way to tell in abstract indexers/properties if one of them was
21790 Now there is a way of addressing that.
21792 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
21793 instead of FindMembers.
21795 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
21796 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
21798 * attribute.cs: Treat indexers and properties as the same in terms
21799 of applying attributes
21801 * ecore.cs (FindMostEncompassedType): Use statically initialized
21802 EmptyExpressions()s like we do elsewhere to avoid creating useless
21803 objects (and we take this out of the tight loop).
21805 (GetConversionOperators): Move the code to extract the actual
21806 operators to a separate routine to clean things up.
21808 2002-05-04 Miguel de Icaza <miguel@ximian.com>
21810 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
21811 events are always registered FieldBuilders.
21813 * class.cs (FieldBase): New class shared by Fields
21815 * delegate.cs: If we are a toplevel delegate, use our full name.
21816 If we are a nested delegate, then only use our tail name.
21818 2002-05-02 Ravi Pratap <ravi@ximian.com>
21820 * expression.cs (IsApplicable): Ensure that we add the "&" to
21821 ref/out types before comparing it with the type of the argument.
21823 (IsParamsMethodApplicable): Ditto.
21825 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
21828 * delegate.cs : Handle the case when we have more than one applicable
21829 method. Flag an error only when we finish checking all.
21831 2002-05-02 Miguel de Icaza <miguel@ximian.com>
21833 * expression.cs: Add support for boolean static initializers.
21835 2002-05-01 Miguel de Icaza <miguel@ximian.com>
21837 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
21839 * parameter.cs (ComputeParameterTypes,
21840 ComputeAndDefineParameterTypes): Better error handling: now we
21841 clear the `types' cache if we fail during any of the type lookups.
21842 We also return the status code correctly to our caller
21844 * delegate.cs: If we fail to define a delegate, abort the extra
21847 * expression.cs (Binary.ResolveOperator): for
21848 operator==(object,object) and operator !=(object, object) we also
21849 have to verify that there is an implicit conversion from one to
21852 (ArrayAccess.DoResolve): Array Access can operate on
21855 2002-04-30 Miguel de Icaza <miguel@ximian.com>
21857 * assign.cs (CompoundAssign): A new class used as a "flag" that
21858 the assignment actually is happening as part of a compound
21859 assignment operator.
21861 During compound assignment, a few new rules exist to enable things
21868 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
21869 to the type of x) if y is implicitly convertible to the type of x,
21870 and the operator is a builtin operator and the return type of the
21871 operator is explicitly convertible to the type of x.
21873 * rootcontext.cs: Reset warning level to 2. 4 catches various
21874 "interesting" features in mcs, we must clean this up at some
21875 point, but currently am trying to kill other bugs ;-)
21877 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
21878 in container classes as well.
21880 * expression.cs (Binary.ResolveOperator): Handle string case
21881 before anything else (as operator overloading does emit an error
21882 before doing anything else).
21884 This code could go away when we move to a table driven model, but
21885 i could not come up with a good plan last night.
21887 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
21889 * typemanager.cs (CSharpName): reimplementation using regex.
21890 * class.cs: added null check for fields in Emit
21891 * rootcontext.cs: set warninglevel to 4
21893 2002-04-29 Miguel de Icaza <miguel@ximian.com>
21895 * typemanager.cs (CSharpName): reimplemented with Lupus
21898 2002-04-28 Miguel de Icaza <miguel@ximian.com>
21900 * statement.cs (If): correclty implement Resolve, because we were
21901 not catching sem errors in there. The same process is needed
21903 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
21906 (Statement.Warning_DeadCodeFound): Factorize code.
21907 (While): Report dead code here too.
21909 (Statement): Added Resolve virtual method to allow
21910 for resolution split from the emit code.
21912 2002-04-26 Miguel de Icaza <miguel@ximian.com>
21914 * statement.cs (EmitBoolExpression): No longer try to resolve the
21916 (MakeBoolean): New utility function that resolve, implicitly
21917 converts to boolean and tags the expression.
21920 (If, Do): Implement dead code elimination.
21921 (While): Implement loop inversion
21923 (Do, While, For, If): Resolve the expression prior to calling our
21926 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
21929 - added method Report28 (warning: program has more than one entry point)
21930 - added method IsEntryPoint, implements paragraph 10.1 of the spec
21931 - modified method Method.Define, the part at the end of the method
21933 * rootcontext.cs: added static public Location EntryPointLocation;
21935 * ../errors/cs0028.cs : Add test case for the above warning.
21938 - modified method CSharpName to allow arrays of primitive type to
21939 be printed nicely (e.g. instead of System.Int32[][] it now prints
21941 - added method CSharpSignature: returns the signature of a method
21942 in string format to be used in reporting errors, warnings, etc.
21944 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
21947 2002-04-26 Ravi Pratap <ravi@ximian.com>
21949 * delegate.cs (Define): Fix extremely silly bug where I was
21950 setting the type of the 'object' parameter of the BeginInvoke
21951 method to System.IAsyncResult instead of System.Object ;-)
21953 2002-04-26 Miguel de Icaza <miguel@ximian.com>
21955 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
21958 (Constructor.Emit): return if we fail to initialize the
21959 constructor. Another door closed!
21961 * expression.cs (New.DoResolve): Improve error message (from -6 to
21962 1501). Use DeclaredOnly lookup to find the exact constructor.
21964 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
21965 loop. This is useful.
21967 * cs-parser.jay: Adjust the default parameters so that destructors
21968 have the proper signature.
21970 2002-04-26 Martin Baulig <martin@gnome.org>
21972 * driver.cs (LoadAssembly): If `assembly' contains any characters
21973 which are only valid in path names and not in assembly names
21974 (currently slash, backslash and point), use Assembly.LoadFrom ()
21975 instead of Assembly.Load () on the `assembly' (before iteration
21976 over the link_paths).
21978 2002-04-26 Martin Baulig <martin@gnome.org>
21980 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
21982 2002-04-25 Miguel de Icaza <miguel@ximian.com>
21984 * class.cs (Property): use the new typemanager.MemberLookup
21986 (TypeContainer.MemberLookup): Implement using the
21987 TypeManager.MemberLookup now.
21989 * typemanager.cs: Make MemberLookup a function of the TypeManager,
21990 and return MemberInfos, so that these can be used without an
21991 EmitContext (what we had before).
21993 2002-04-24 Miguel de Icaza <miguel@ximian.com>
21995 * expression.cs: Fix the case where the argument to params if the
21996 type of the params. I omitted handling this before. Fixed
21998 2002-04-22 Miguel de Icaza <miguel@ximian.com>
22000 * driver.cs: Call BootCorlib_PopulateCoreType
22002 * class.cs (Property.CheckBase): Check for properties only, not
22005 * interface.cs: Temporary hack: try/catch around the
22006 CustomAttributeBuilder, because I am getting an exception that I
22009 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
22010 types whose definitions are required to be there (attributes are
22011 defined before standard types).
22013 Compute definitions as we boot the various types, as they are used
22014 immediately (value_type class will need object_type, but if we do
22015 not initialize object_type, we will pass a null, which will let
22016 the runtime pick the System.Object from the existing corlib, which
22017 is not what we want).
22019 2002-04-22 Patrik Torstensson <totte@labs2.com>
22021 * cs-tokenizer.cs: fixed a number of trim() issues.
22023 2002-04-22 Ravi Pratap <ravi@ximian.com>
22025 * expression.cs (Argument.Type): Ensure that we return the correct
22026 type when we have out or ref parameters [in which case we
22029 2002-04-22 Miguel de Icaza <miguel@ximian.com>
22031 * class.cs (Property, Indexer): Allow extern modifier in there.
22033 * typemanager.cs (InitBaseTypes): Initializes object_type and
22034 value_type, since those will be used early on during the bootstrap
22035 process to compile corlib.
22037 (InitCoreTypes): Move code from here to InitBaseTypes.
22039 2002-04-21 Miguel de Icaza <miguel@ximian.com>
22041 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
22042 single-dimension arrays as using the ldlen opcode.
22044 Daniel Lewis discovered this optimization.
22046 * typemanager.cs: Add signature for System.Array::get_Length
22048 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22050 * statement.cs: report the error when the foreach does not apply to an
22051 array nor a collection.
22053 2002-04-19 Miguel de Icaza <miguel@ximian.com>
22055 * expression.cs: Add implicit conversions to the operator ~.
22057 * constant.cs (DecimalConstant.Emit): Emit decimal value.
22059 * typemanager.cs: Locate the decimal constructor.
22061 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22063 * attribute.cs: use the new property of TypeOf.
22064 * expression.cs: added 'get' property around typearg.
22066 These changes fix a build breaker reported by NickD. Is this the
22067 correct way to fix? If not, please, revert my changes and make it
22070 2002-04-17 Miguel de Icaza <miguel@ximian.com>
22072 * attribute.cs: Add support for typeof in attribute invocations.
22073 I am not sure that this is right though.
22075 2002-04-14 Duncan Mak <duncan@ximian.com>
22077 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
22078 Binary.Operator.Division case.
22080 2002-04-13 Ravi Pratap <ravi@ximian.com>
22082 * class.cs (DefineType): Ensure that we do a proper check on
22083 attribute types and also register it with the TypeManager.
22085 (TypeContainer.Targets): The default for attribute types is
22086 AttributeTargets.All.
22088 * attribute.cs (ApplyAttributes): Registering the attribute type
22089 is done elsewhere, not when we discover we have a Usage attribute.
22091 2002-04-12 Ravi Pratap <ravi@ximian.com>
22093 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
22094 and get rid of is_delegate parameter.
22096 * everywhere : update.
22098 2002-04-12 Ravi Pratap <ravi@ximian.com>
22100 * cs-parser.jay (compilation_unit): Revamp completely to use
22101 some new ideas that I got from Rhys' grammar to solve the problems
22102 with assembly level attributes.
22104 (outer_declaration): New grammar production.
22106 (attribute_sections): Add.
22108 (opt_attributes): Base on attribute_sections
22110 (namespace_declaration): Allow opt_attributes to tackle the case
22111 when we have assembly level attributes - we are clever in this
22114 * attribute.cs (ApplyAttributes): Do not worry about assembly
22115 attributes in the non-global context.
22117 * rootcontext.cs (AddGlobalAttributes): Go back to using this
22118 instead of SetGlobalAttributes.
22120 * class.cs, rootcontext.cs : Ensure we define and generate
22121 attribute types before anything else.
22123 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
22124 and flag the new error -20 for the case when the attribute type
22125 does not have valid targets specified. csc does not catch this.
22127 * ../errors/errors.txt : update for error # -20
22129 2002-04-11 Ravi Pratap <ravi@ximian.com>
22131 * support.cs (InternalParameters.ParameterModifier): Do some null
22132 checking and return sane values.
22134 * class.cs (Method.Define): If we are a PInvoke method, ensure
22135 that we are static and extern. Report error # 601
22137 * ../errors/cs0601.cs : Add test case for the above error.
22139 2002-04-07 Ravi Pratap <ravi@ximian.com>
22141 * rootcontext.cs (attribute_types): We need to keep type of
22142 all attribute types separately and emit code for them first.
22144 (RegisterAttribute) : Implement.
22146 * class.cs (DefineType): Check if the current Type is a custom
22147 attribute type and register it accordingly.
22149 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
22150 adding the first attribute twice and rename to
22152 (SetGlobalAttributes): this.
22154 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
22157 * attribute.cs (ApplyAttributes): Take an additional argument telling us
22158 if we are processing global arguments. Hmm, I am unsure of this.
22160 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22162 * expression.cs: added static array of strings to avoid calling
22163 Enum.ToString () for Operator in Binary. Significant recover of
22166 2002-04-10 Miguel de Icaza <miguel@ximian.com>
22168 * class.cs (FindMembers): Allow the Builders of the various
22169 members to be null. If they are skip them. This only happens
22170 during the PInvoke declaration.
22172 2002-04-09 Miguel de Icaza <miguel@ximian.com>
22174 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
22175 failure, so we do not keep going afterwards.
22177 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
22178 wanted to pass `false' as the `is_delegate' argument. If this is
22179 the case, why not use delegate_type == null to mean `is_delegate =
22180 false' and anything else as is_delegate = true.
22182 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
22184 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
22185 code for the section, not the beginning of the tests.
22187 2002-04-08 Miguel de Icaza <miguel@ximian.com>
22189 * cfold.cs: Handle operator + (Enum x, Underlying x)
22191 * expression.cs (Binary): same. Warn about errors where we have
22192 Enum/Enum in operator + as well.
22194 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
22197 - added support for switch(bool)
22198 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
22199 - add TableSwitchEmit() to handle table-based switch statements
22201 2002-04-05 Ravi Pratap <ravi@ximian.com>
22203 * expression.cs (Invocation.OverloadResolve): Factor out code which
22204 does parameter compatibility checking with arguments so that we can
22205 re-use the code even from Delegate.VerifyApplicability
22207 (VerifyArgumentsCompat): Move above code here.
22209 * delegate.cs (VerifyApplicability): Get rid of duplicate code
22210 and instead make a call to the above method.
22212 2002-03-31 Ravi Pratap <ravi@ximian.com>
22214 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
22215 We use it to keep track of classes which are attribute types.
22217 2002-04-02 Miguel de Icaza <miguel@ximian.com>
22219 * delegate.cs (Delegate.Define): Correctly define the types in the
22220 presence of fixed and array parameters.
22222 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
22225 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
22226 include NonPublic after the first iteration.
22228 * class.cs (Indexer.CheckBase): Only check if both parents are
22231 * cs-parser.jay (accessor_body): If empty, set to null.
22233 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
22234 same code path here to resolve constants names that we did have in
22235 MemberAccess.DoResolve. There is too much code duplicated here.
22237 2002-04-01 Miguel de Icaza <miguel@ximian.com>
22239 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
22241 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
22244 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
22245 tokens, numbers and strings.
22247 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
22250 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
22251 asyncronous parameters and the regular parameters.
22253 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
22254 specify the target directory.
22256 * expression.cs: (This.DoResolve): Simplify
22257 (As.Emit): Optimize, do not generate IsInst if the expression is
22258 always of the given type.
22260 (Is.DoResolve): Bug fix, we were reporting both always/never for
22263 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
22264 creating too many unnecessary arrays.
22266 2002-03-31 Miguel de Icaza <miguel@ximian.com>
22268 * class.cs (EmitFieldInitializer): Use Assign expression to assign
22269 fields instead of rolling our own initializer. Takes care of all
22270 implicit conversions, and drops unnecessary static checks/argument.
22272 2002-03-31 Dick Porter <dick@ximian.com>
22274 * driver.cs: use the GetDirectories() return values properly, and
22275 use "/" as path separator.
22277 2002-03-30 Miguel de Icaza <miguel@ximian.com>
22279 * expression.cs (Unary): Optimize - - expr into expr.
22280 (Binary): Optimize a + (-b) into a -b.
22282 * codegen.cs (CodeGen): Made all methods static.
22284 2002-03-29 Miguel de Icaza <miguel@ximian.com>
22288 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
22289 TypeBuilder property.
22291 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
22294 * tree.cs: Removed the various RecordXXXX, and replaced with a
22295 single RecordDecl. Removed all the accessor methods, and just
22296 left a single access point Type
22298 * enum.cs: Rename DefineEnum to DefineType.
22300 * decl.cs: New abstract method `DefineType' used to unify the
22301 Defines for Enumerations, Interfaces, TypeContainers and
22304 (FindType): Moved LookupInterfaceOrClass here. Moved the
22305 LookupBaseClasses method that used to live in class.cs and
22306 interface.cs here, and renamed to FindType.
22308 * delegate.cs: Implement DefineType. Take advantage of the
22309 refactored pattern for locating the parent builder without taking
22310 the parent_builder argument (which we know does not work if we are
22311 nested, and triggering a toplevel definition).
22313 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22315 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
22316 accessibility of a member has changed during override and report
22319 * class.cs (Method.Define, Property.Define): Only complain on
22320 overrides if the method is private, any other accessibility is
22321 fine (and since we just checked the permission is the same, we are
22324 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
22325 and elif are processed always. The other pre-processing
22326 directives are only processed if we are "taking" the path
22328 2002-03-29 Martin Baulig <martin@gnome.org>
22330 * class.cs (Method.Emit): Only emit symbolic debugging info if the
22331 current location is not Null.
22333 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
22334 a separate method so we can profile it.
22336 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
22337 `span.Seconds' are just seconds, but no minutes or hours.
22338 (MainDriver): Profile the CodeGen.SaveSymbols calls.
22340 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22342 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
22343 Remove the gratuitous set of Final:
22345 // If an interface implementation, then we can set Final.
22346 if (((flags & MethodAttributes.Abstract) == 0) &&
22347 implementing.DeclaringType.IsInterface)
22348 flags |= MethodAttributes.Final;
22350 I do not know what I was smoking when I used that.
22353 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
22354 step into fixing the name resolution issues for delegates and
22355 unifying the toplevel name resolution.
22357 2002-03-28 Martin Baulig <martin@gnome.org>
22359 * class.cs (Method.Emit): If we have a symbol writer, call its
22360 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
22361 tell it about the current method.
22363 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
22364 writer that we're going to emit the first byte of IL code for a new
22365 statement (a new source line).
22366 (EmitContext.EmitTopBlock): If we have a symbol writer, call
22367 EmitContext.Mark() before emitting any code.
22369 * location.cs (SymbolDocument): Return null when we're Null.
22371 * statement.cs (Statement): Moved the `Location loc' variable here.
22372 (Statement.EmitBoolExpression): If we have a symbol writer, call
22373 ec.Mark() before emitting any code to tell it that we're at the
22374 beginning of a new statement.
22375 (StatementExpression): Added `Location' argument to the constructor.
22376 (Block): Added public readonly variable `StartLocation' and public
22377 variable `EndLocation'. The latter is to be set using SetEndLocation().
22378 (Block): Added constructor which takes a start and end location.
22379 (Block.SetEndLocation): New method. This sets the end location.
22380 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
22381 local variables we create.
22382 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
22383 each statement and do also mark the begin and end of the block.
22385 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
22386 tell it the current lexer.Location, use Location.Null for the end of the
22388 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
22389 current block, set its end location using SetEndLocation().
22390 (statement_expression): StatementExpression constructor now takes the
22391 lexer.Location as additional argument.
22392 (for_statement, declare_local_variables): Likewise.
22393 (declare_local_variables): When creating a new implicit block, use the
22394 new Block constructor and pass it the lexer.Location.
22396 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22398 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
22399 members also on the parent interfaces recursively.
22401 2002-03-27 Miguel de Icaza <miguel@ximian.com>
22403 * report.cs: Use new formats, since Gonzalo finished the missing
22406 * expression.cs (Binary.ResolveOperator): added missing operator|
22407 operator& and operator^ for bool/bool.
22409 * cs-parser.jay: CheckDef now takes a Location argument that is
22410 used to report errors more precisly (instead of reporting the end
22411 of a definition, we try to track something which is a lot closer
22412 to the source of the problem).
22414 * cs-tokenizer.cs: Track global token use, so we can properly flag
22415 the use of #define/#undef after the first token has been seen.
22417 Also, rename the reportXXXX to Error_DescriptiveName
22419 * decl.cs (DeclSpace.IsTopLevel): Move property here from
22420 TypeContainer, so that Enum and Interface can use this too.
22422 * class.cs (TypeContainer.LookupInterfaceOrClass,
22423 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
22424 `builder' argument. Typically this was used to pass the parent
22425 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
22428 The problem is that a nested class could trigger the definition of
22429 a toplevel class, and the builder would be obviously wrong in that
22432 So we drop this argument, and we compute dynamically the
22433 TypeBuilder/ModuleBuilder (the correct information was available
22434 to us anyways from DeclSpace.Parent)
22436 * interface.cs (Interface.DefineInterface): Drop builder
22437 parameter cleanup like class.cs
22439 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
22442 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
22445 (Try.Emit): Propagate the returns value from the statement.
22447 (Return.Emit): Even if we are leavning
22449 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
22451 * modifiers.cs: Fix the computation of MethodAttributes flags.
22453 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
22455 * driver.cs: allow compilation of files that start with '/'.
22456 Add a default case when checking the argument of --target.
22458 2002-03-25 Miguel de Icaza <miguel@ximian.com>
22460 * interface.cs: Implement the same search algorithm for types in
22461 the interface code.
22463 * delegate.cs: Do not allow multiple definition.
22465 * Recovered ChangeLog that got accidentally amputated
22467 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
22469 * rootcontext.cs: Load manually enum to allow core classes to
22470 contain enumerations.
22472 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
22473 Update to new static methods in TypeManager.
22475 * typemanager.cs (GetMethod, GetConstructor): Use our
22476 implementation of FindMembers to find the members, since during
22477 corlib compilation, the types are TypeBuilders and GetMethod and
22478 GetConstructor do not work.
22480 Make all methods in TypeManager static.
22482 (InitCodeHelpers): Split the functionality from
22483 the InitCodeTypes function.
22485 * driver.cs: Call InitCodeHelpers after we have populated the
22488 * cs-parser.jay (delegate_declaration): we did not used to compute
22489 the delegate name correctly for void delegates.
22491 2002-03-24 Miguel de Icaza <miguel@ximian.com>
22493 * rootcontext.cs (RootContext): Init the interface_resolve_order
22494 and type_container_resolve_order always.
22496 (ResolveCore, BootstrapCorlib_ResolveClass,
22497 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
22498 compiler when compiling with --nostdlib
22500 * class.cs (TypeContainer.DefineType): Check that our parent is
22501 not null. This test is most important when we are bootstraping
22504 * codegen.cs: Split out the symbol writing code.
22506 2002-03-25 Martin Baulig <martin@gnome.org>
22508 * driver.cs (-g): Made -g an alias for --debug.
22510 2002-03-24 Martin Baulig <martin@gnome.org>
22512 * codegen.cs (SymbolWriter): New public variable. Returns the
22513 current symbol writer.
22514 (CodeGen): Added `bool want_debugging_support' argument to the
22515 constructor. If true, tell the ModuleBuild that we want debugging
22516 support and ask it for the ISymbolWriter.
22517 (Save): If we have a symbol writer, call it's Close() method after
22518 saving the assembly.
22520 * driver.c (--debug): New command line argument to create a
22521 debugger information file.
22523 * location.cs (SymbolDocument): New public property. Returns an
22524 ISymbolDocumentWriter object for the current source file or null
22525 if we don't have a symbol writer.
22527 2002-03-21 Miguel de Icaza <miguel@ximian.com>
22529 * driver.cs (LoadAssembly): Correctly return when all the paths
22530 have been tried and not before.
22532 * statement.cs (Switch.Emit): return the actual coverage for this
22533 statement (returns/not-returns)
22535 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
22536 switch of the statement if we are the last switch section. That
22537 kills two problems: try/catch problems (we used to emit an empty
22538 nop at the end) and switch statements where all branches would
22541 2002-03-19 Miguel de Icaza <miguel@ximian.com>
22543 * driver.cs: Add default assemblies (the equivalent to the
22544 Microsoft CSC.RSP file)
22546 * cs-tokenizer.cs: When updating `cols and setting it to zero,
22547 also update tokens_seen and set it to false.
22549 * driver.cs: Implement --recurse for Mike.
22551 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
22552 correctly splitting out the paths.
22554 2002-03-18 Miguel de Icaza <miguel@ximian.com>
22556 * interface.cs (Interface.PopulateProperty): Instead of using
22557 `parent' as the declaration space for the set parameters, use
22560 * support.cs (InternalParameters): InternalParameters constructor
22561 takes a DeclSpace instead of a TypeContainer.
22563 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
22564 types are being initialized, load the address of it before calling
22567 (New): Provide a mechanism to disable the generation of local
22568 value type temporaries when the caller will be providing us with
22569 an address to store it.
22571 (ArrayCreation.EmitDynamicInitializers): Use it.
22573 2002-03-17 Miguel de Icaza <miguel@ximian.com>
22575 * expression.cs (Invocation.EmitArguments): Only probe for array
22576 property if there is more than one argument. Sorry about that.
22578 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
22579 empty param arrays.
22581 * class.cs (Method.LabelParameters): Fix incorrect code path that
22582 prevented the `ParamArrayAttribute' from being applied to the
22585 2002-03-16 Miguel de Icaza <miguel@ximian.com>
22587 * support.cs (ReflectionParameters): Correctly compute whether the
22588 last argument is a params array. Fixes the problem with
22591 * typemanager.cs: Make the assemblies array always be non-null
22592 (empty, but non-null)
22594 * tree.cs (RecordDecl): New function that abstracts the recording
22595 of names. This reports error 101, and provides a pointer to the
22596 previous declaration. Fixes a crash in the compiler.
22598 * cs-parser.jay (constructor_declaration): Update to new grammar,
22599 and provide a constructor_body that can be empty.
22601 2002-03-15 Miguel de Icaza <miguel@ximian.com>
22603 * driver.cs: Add support for --resources.
22605 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
22606 Make all types for the various array helper methods be integer.
22608 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
22609 CheckState to ConvCast.
22611 (ConvCast): Now it takes a `checked' state argument, to avoid
22612 depending on the emit context for the conversion, and just using
22613 the resolve time setting.
22615 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
22616 instead of Invocation.EmitArguments. We do not emit the original
22617 arguments, instead we emit those which have been converted to
22618 unsigned int expressions.
22620 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
22622 * codegen.cs: ditto.
22624 * expression.cs (LocalVariableReference): Drop the use of the
22625 Store function that depended on the variable index.
22627 * statement.cs (VariableInfo): Drop the `Idx' property from this
22628 class, as this is not taking into account the indexes for
22629 temporaries tat we generate during the execution, getting the
22632 * class.cs: First emit class initializers, then call the parent
22635 * expression.cs (Binary): Fix opcode emision.
22636 (UnaryMutator.EmitCode): Support checked code generation
22638 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
22639 matches for events for both the Static and Instance scans,
22640 pointing to the same element. Fix that.
22642 2002-03-14 Miguel de Icaza <miguel@ximian.com>
22644 * rootcontext.cs (ResolveTree): Always set the
22645 interface_resolve_order, because nested interfaces will be calling
22648 * class.cs (GetInterfaceOrClass): Track the same resolution
22649 process used by TypeManager.LookupType. This fixes the nested
22650 type lookups in class declarations (separate path from
22653 (TypeContainer.DefineType): Also define nested interfaces.
22654 (TypeContainer.RegisterOrder): New public function used to
22655 register the order in which child interfaces need to be closed.
22657 Nested interfaces need to be closed after their parents have been
22660 * interface.cs (InterfaceAttr): Put all the logic for computing
22661 the interface attribute here.
22663 (DefineInterface): Register our interface order with the
22664 RootContext or with the TypeContainer depending on the case.
22666 2002-03-12 Miguel de Icaza <miguel@ximian.com>
22668 * cs-parser.jay: rework foreach statement to work with the new
22669 changes to the policy on SimpleNames.
22671 * report.cs: support Stacktrace on warnings as well.
22673 * makefile: drop --unsafe and /unsafe from the compile.
22675 2002-03-13 Ravi Pratap <ravi@ximian.com>
22677 * ecore.cs (StandardConversionExists): Modify to take an Expression
22678 as the first parameter. Ensure we do null -> reference type conversion
22681 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
22682 temporary Expression objects.
22684 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
22686 * interface.cs: workaround bug in method overloading resolution
22687 (there is already a bugzilla bug for it).
22689 2002-03-12 Miguel de Icaza <miguel@ximian.com>
22691 We could also solve this problem by having a separate path for
22692 performing type lookups, instead of DoResolve, we could have a
22693 ResolveType entry point, and only participating pieces of the
22694 production (simplename, deref, array) would implement this.
22696 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
22697 signal SimpleName to only resolve type names and not attempt to
22698 resolve anything else.
22700 * expression.cs (Cast): Set the flag.
22702 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
22704 * class.cs: Only report 108 if there is no `new' modifier.
22706 * cs-parser.jay: rework foreach statement to work with the new
22707 changes to the policy on SimpleNames.
22709 * report.cs: support Stacktrace on warnings as well.
22711 * makefile: drop --unsafe and /unsafe from the compile.
22713 2002-03-11 Miguel de Icaza <miguel@ximian.com>
22715 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22716 lookups here, instead of doing that at parse time. This means
22717 that our grammar will not introduce `LocalVariableReferences' as
22718 expressions at this point. That solves the problem of code like
22722 static void Main ()
22726 This is only half the fix. The full fix requires parameters to
22727 also be handled in this way.
22729 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
22730 makes the use more obvious of the DeclSpace. The
22731 ec.TypeContainer.TypeBuilder is now only used to pull the
22732 TypeBuilder for it.
22734 My theory is that I can get rid of the TypeBuilder completely from
22735 the EmitContext, and have typecasts where it is used (from
22736 DeclSpace to where it matters).
22738 The only pending problem is that the code that implements Aliases
22739 is on TypeContainer, and probably should go in DeclSpace.
22741 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22742 lookups here, instead of doing that at parse time. This means
22743 that our grammar will not introduce `LocalVariableReferences' as
22744 expressions at this point. That solves the problem of code like
22748 static void Main ()
22752 This is only half the fix. The full fix requires parameters to
22753 also be handled in this way.
22755 * class.cs (Property.DefineMethod): When implementing an interface
22756 method, set newslot, when implementing an abstract method, do not
22757 set the flag (before we tried never setting it, or always setting
22758 it, which is the difference).
22759 (Indexer.DefineMethod): same.
22760 (Method.DefineMethod): same.
22762 * ecore.cs: Only set the status used flag if we get back a Field.
22764 * attribute.cs: Temporary hack, so Paolo can keep working.
22766 2002-03-08 Ravi Pratap <ravi@ximian.com>
22768 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
22769 the unmanaged type in the case we have a MarshalAs attribute.
22771 (Resolve): Handle the case when we are parsing the special MarshalAs
22772 attribute [we need to store the unmanaged type to use later]
22774 * typemanager.cs (marshal_as_attr_type): Built in type for the
22775 MarshalAs Attribute.
22777 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
22778 on parameters and accordingly set the marshalling info.
22780 2002-03-09 Miguel de Icaza <miguel@ximian.com>
22782 * class.cs: Optimizing slightly by removing redundant code after
22783 we switched to the `NoTypes' return value.
22784 (Property.DefineMethod): use NoTypes here too.
22786 This fixes the bug I introduced in my last batch of changes.
22788 2002-03-05 Ravi Pratap <ravi@ximian.com>
22790 * tree.cs (RecordEnum): Add. We now keep track of enums too.
22792 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
22793 Enums since those are types too.
22795 * cs-parser.jay (enum_declaration): Record enums as we parse them.
22797 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
22798 thanks to a call during the lookup process.
22800 2002-03-07 Miguel de Icaza <miguel@ximian.com>
22802 * statement.cs (Foreach): Lots of work to accomodate a particular
22803 kind of foreach statement that I had not kept in mind. It is
22804 possible to have foreachs on classes that provide a GetEnumerator
22805 method that return objects that implement the "pattern" for using
22806 a foreach, there is no need to support GetEnumerator
22809 This is needed to compile nant.
22811 * decl.cs: Only report 114 if the member is not `Finalize' and if
22812 the warning level is at least 2.
22814 * class.cs: Moved the compare function from Method to
22817 (MethodSignature.InheritableMemberSignatureCompare): Add new
22818 filter function that is used to extract inheritable methods from a
22821 (Method.Define): Use the new `inheritable_method_signature_filter'
22824 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
22827 2002-03-06 Miguel de Icaza <miguel@ximian.com>
22829 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
22831 * cs-parser.jay: Add opt_semicolon to the interface declaration.
22833 * expression.cs: Pass location information to
22834 ConvertImplicitStandard.
22836 * class.cs: Added debugging code to track return values from
22839 2002-03-05 Miguel de Icaza <miguel@ximian.com>
22841 * expression.cs (Is.DoResolve): If either side of the `is' is an
22842 interface, do not flag the warning.
22844 * ecore.cs (ImplicitReferenceConversion): We need a separate test
22847 * report.cs: Allow for --fatal to be used with --probe.
22849 * typemanager.cs (NoTypes): Move the definition for the empty Type
22852 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
22854 (TypeContainer.DefineProxy): New function used to proxy to parent
22855 implementations when implementing interfaces.
22856 (TypeContainer.ParentImplements): used to lookup if our parent
22857 implements a public function that is required by an interface.
22858 (TypeContainer.VerifyPendingMethods): Hook this up.
22860 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
22861 `modules' and `assemblies' arraylists into arrays. We only grow
22862 these are the very early start up of the program, so this improves
22863 the speedof LookupType (nicely measured).
22865 * expression.cs (MakeByteBlob): Replaced unsafe code with
22866 BitConverter, as suggested by Paolo.
22868 * cfold.cs (ConstantFold.Binary): Special case: perform constant
22869 folding of string concatenation, but if either side is a string,
22870 and the other is not, then return null, and let the runtime use
22871 the concatenation on the string plus the object (using
22872 `Object.ToString').
22874 2002-03-04 Miguel de Icaza <miguel@ximian.com>
22876 Constant Folding has been implemented now.
22878 * expression.cs (Unary.Reduce): Do not throw an exception, catch
22879 the error instead on types that are not supported in one's
22882 * constant.cs (Constant and all children): New set of functions to
22883 perform implict and explicit conversions.
22885 * ecore.cs (EnumConstant): Implement the new functions to perform
22886 conversion by proxying to the child expression.
22888 * codegen.cs: (ConstantCheckState): Constant evaluation has its
22889 own separate setting that can not be turned off from the command
22890 line using --unchecked or --checked and is only controlled using
22891 the checked/unchecked statements and expressions. This setting is
22892 used by the constant folder to flag errors.
22894 * expression.cs (CheckedExpr, UncheckedExpr): Set the
22895 ConstantCheckState as well.
22897 During Resolve, they also have to flag the state, because the
22898 constant folder runs completely in the Resolve phase.
22900 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
22903 2002-03-01 Miguel de Icaza <miguel@ximian.com>
22905 * cfold.cs: New file, this file contains the constant folder.
22907 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
22908 argument to track whether we are using the resulting address to
22909 load or store a value and provide better error messages.
22911 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
22912 new AddressOf arguments.
22914 * statement.cs (Foreach.EmitCollectionForeach): Update
22916 * expression.cs (Argument.Emit): Call AddressOf with proper
22917 arguments to track usage.
22919 (New.DoEmit): Call AddressOf with new arguments.
22921 (Unary.Emit): Adjust AddressOf call.
22923 2002-03-01 Ravi Pratap <ravi@ximian.com>
22925 * cs-parser.jay (member_access): Change the case for pre-defined types
22926 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
22929 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
22932 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
22933 essentially like methods and apply attributes like MethodImplOptions to them too.
22935 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
22938 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
22939 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
22942 * Update code everywhere accordingly.
22944 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
22946 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
22948 2002-02-28 Ravi Pratap <ravi@ximian.com>
22950 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
22951 try performing lookups against those instead of jumping straight into using
22952 the 'using' clauses.
22954 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
22956 (LookupType): Perform lookups in implicit parents too.
22958 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
22959 sequence as RootContext.LookupType.
22961 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
22962 the various cases of namespace lookups into this method.
22964 2002-03-01 Miguel de Icaza <miguel@ximian.com>
22966 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
22967 in positional arguments)
22969 * class.cs (Operator): Update the AllowedModifiers to contain
22972 * cs-parser.jay: Update operator declaration to allow for the
22973 operator body to be empty.
22975 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
22978 2002-02-27 Miguel de Icaza <miguel@ximian.com>
22980 * class.cs (Method.Emit): Label parameters.
22982 * driver.cs: Return 1 or 0 as the program exit code.
22984 2002-02-26 Miguel de Icaza <miguel@ximian.com>
22986 * expression.cs: Special case the `null' object when trying to
22987 auto-compute the type, as anything can be explicitly converted to
22990 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
22991 spotting this Paolo.
22993 (Expression.ImplicitNumericConversion): Perform comparissions of
22994 the type using the underlying type in the case of an enumeration
22995 rather than using the enumeration type for the compare.
22997 Cope with the underlying == type case, which is not possible to
23000 (Expression.ConvertNumericExplicit): Perform comparissions of
23001 the type using the underlying type in the case of an enumeration
23002 rather than using the enumeration type for the compare.
23004 * driver.cs: If the user does not supply an extension, assume .exe
23006 * cs-parser.jay (if_statement): Rewrote so that we can track the
23007 location for the if statement.
23009 * expression.cs (Binary.ConstantFold): Only concat strings when
23010 the operation is "+", not everything ;-)
23012 * statement.cs (Statement.EmitBoolExpression): Take a location
23014 (If, While, Do): Track location.
23016 * expression.cs (Binary.ResolveOperator): In the object + string
23017 case, I was missing a call to ConvertImplicit
23019 2002-02-25 Ravi Pratap <ravi@ximian.com>
23021 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
23022 Location arguments. Ensure we use RootContext.LookupType to do our work
23023 and not try to do a direct Type.GetType and ModuleBuilder.GetType
23025 * interface.cs (PopulateMethod): Handle the type of the parameter being
23028 * expression.cs (Invocation.BetterFunction): Handle the case when we
23029 have a params method with no fixed arguments and a call is made with no
23032 2002-02-25 Miguel de Icaza <miguel@ximian.com>
23034 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
23035 the verbatim-string-literal
23037 * support.cs (InternalParameters.ParameterModifier): handle null
23039 (InternalParameters.ParameterType): ditto.
23041 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
23042 duplicating the name of the variable parameter.
23043 (GetParameterByName): Fix bug where we were not looking up array
23044 paramters if they were the only present (thanks Paolo!).
23045 (GetParameterInfo): We only have an empty set of types if both
23046 fixed and array are set to null.
23047 (GetParameterInfo-idx): Handle FixedParameter == null
23049 * cs-parser.jay: Handle the case where there is no catch
23050 statements (missing null test).
23052 2002-02-22 Miguel de Icaza <miguel@ximian.com>
23054 * driver.cs (MainDriver): Be conservative on our command line
23057 Catch DirectoryNotFoundException when calling GetFiles.
23059 (SplitPathAndPattern): Used to split the input specification into
23060 a path and a pattern that we can feed to Directory.GetFiles.
23062 2002-02-21 Miguel de Icaza <miguel@ximian.com>
23064 * statement.cs (Fixed): Implement the last case of the Fixed
23065 statement (string handling).
23067 * expression.cs (StringPtr): New class used to return a char * to
23068 a string; Used by the Fixed statement.
23070 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
23072 * expression.cs (Binary.ResolveOperator): Remove redundant
23073 MemberLookup pn parent type.
23074 Optimize union call, we do not need a union if the types are the same.
23075 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
23078 Specialize the use of MemberLookup everywhere, instead of using
23079 the default settings.
23081 (StackAlloc): Implement stackalloc keyword.
23083 * cs-parser.jay: Add rule to parse stackalloc.
23085 * driver.cs: Handle /h, /help, /?
23087 * expression.cs (MakeByteBlob): Removed the hacks we had in place
23088 before we supported unsafe code.
23090 * makefile: add --unsafe to the self compilation of mcs.
23092 2002-02-20 Miguel de Icaza <miguel@ximian.com>
23094 * expression.cs (PointerArithmetic): New class that is used to
23095 perform pointer arithmetic.
23096 (Binary.Resolve): Handle pointer arithmetic
23097 Handle pointer comparission.
23098 (ArrayPtr): Utility expression class that is used to take the
23099 address of an array.
23101 (ElementAccess): Implement array access for pointers
23103 * statement.cs (Fixed): Implement fixed statement for arrays, we
23104 are missing one more case before we are done.
23106 * expression.cs (Indirection): Implement EmitAssign and set the
23107 ExprClass to Variable. This allows pointer dereferences to be
23108 treated as variables, and to have values assigned to them.
23110 * ecore.cs (Expression.StoreFromPtr): New utility function to
23111 store values dereferencing.
23113 2002-02-20 Ravi Pratap <ravi@ximian.com>
23115 * expression.cs (Binary.ResolveOperator): Ensure that we are
23116 not trying to operate on a void type - this fixes the reported
23119 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
23120 the parent implementation is sealed.
23122 * ../errors/cs0239.cs : Add.
23124 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
23126 * typemanager.cs (unverifiable_code_type): Corresponds to
23127 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
23128 which have unsafe code in them.
23130 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
23133 2002-02-19 Miguel de Icaza <miguel@ximian.com>
23135 * cs-tokenizer.cs: Add support for @"litreal strings"
23137 Make tokenizer accept pre-processor directives
23138 on any column (remove the old C-like limitation).
23140 * rootcontext.cs (EmitCode): Emit any global attributes.
23141 (AddGlobalAttributes): Used to keep track of assembly attributes.
23143 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
23145 * cs-parser.jay: Add support for global attributes.
23147 2002-02-17 Miguel de Icaza <miguel@ximian.com>
23149 * expression.cs (Indirection): New helper class. Unary will
23150 create Indirection classes to be able to implement the
23151 IMemoryLocation interface on it.
23153 2002-02-16 Miguel de Icaza <miguel@ximian.com>
23155 * cs-parser.jay (fixed_statement): reference the right statement.
23157 * statement.cs (Fixed.Emit): Finish implementing the fixed
23158 statement for the &x case.
23160 2002-02-14 Miguel de Icaza <miguel@ximian.com>
23162 * class.cs (Property.Define, Method.Define): Remove newslot when
23165 * modifiers.cs: My use of NewSlot when `Abstract' was set was
23166 wrong. NewSlot should only be used if the `new' keyword is present.
23168 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
23169 locating our system dir. Sorry about this.
23171 2002-02-13 Miguel de Icaza <miguel@ximian.com>
23173 * driver.cs (GetSystemDir): Compute correctly the location of our
23174 system assemblies. I was using the compiler directory instead of
23175 the library directory.
23177 2002-02-13 Ravi Pratap <ravi@ximian.com>
23179 * expression.cs (BetterFunction): Put back in what Miguel commented out
23180 since it is the correct fix. The problem is elsewhere ;-)
23182 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
23183 parameters of the parms method are themselves compatible or not !
23185 (StandardConversionExists): Fix very dangerous bug where we were forgetting
23186 to check that a class implements an interface before saying that an implicit
23187 conversion was allowed. Use ImplementsInterface to do the checking.
23189 2002-02-13 Miguel de Icaza <miguel@ximian.com>
23191 * class.cs (Method.Define): Track whether we are an explicit
23192 implementation or not. And only call DefineMethodOverride if we
23193 are an explicit implementation.
23195 (Property.DefineMethod): Ditto.
23197 2002-02-11 Ravi Pratap <ravi@ximian.com>
23199 * expression.cs (BetterFunction): Catch hideous bug which was
23200 preventing us from detecting ambiguous calls due to implicit casts i.e
23203 2002-01-29 Miguel de Icaza <miguel@ximian.com>
23205 * support.cs (Pair): Remove un-needed method. I figured why I was
23206 getting the error in cs-parser.jay, the variable in a foreach loop
23207 is readonly, and the compiler does not really treat this as a variable.
23209 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
23210 instead of EQUALS in grammar.
23212 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
23214 * expression.cs (Unary.DoResolve): Check whether the argument is
23217 2002-01-28 Miguel de Icaza <miguel@ximian.com>
23219 * support.cs: Api for Pair to set a value. Despite the fact that
23220 the variables are public the MS C# compiler refuses to compile
23221 code that accesses the field if the variable is part of a foreach
23224 * statement.cs (Fixed): Begin implementation of the fixed
23227 (Block.AddVariable): Return the VariableInfo on success and null
23228 on failure instead of true/false.
23230 * cs-parser.jay (foreach): Catch errors on variables already
23231 defined (we were ignoring this value before) and properly unwind
23232 the block hierarchy
23234 (fixed_statement): grammar for the fixed statement.
23236 2002-01-25 Miguel de Icaza <miguel@ximian.com>
23238 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
23239 pointer types to be incretemented.
23241 (SizeOf): Implement.
23243 * cs-parser.jay (pointer_member_access): Implement
23244 expr->IDENTIFIER production.
23246 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
23247 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
23250 (Unary): Implement indirection.
23252 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
23253 use in non-unsafe context).
23255 (SimpleName.DoResolve): Check for pointers in field access on safe
23258 (Expression.LoadFromPtr): Factor the load-indirect code in this
23259 function. This was duplicated in UnboxCast and ParameterReference
23261 2002-01-24 Miguel de Icaza <miguel@ximian.com>
23263 * expression.cs (ComposedCast): report an error if a pointer cast
23264 is used in a safe region.
23266 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
23267 pointer type casts in unsafe context.
23269 * codegen.cs (EmitContext): Set up IsUnsafe.
23271 * cs-parser.jay (non_expression_type): Add productions for pointer
23274 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
23275 code. We should not use force into static mode if the method is
23276 not virtual. Fixes bug in MIS
23278 * statement.cs (Do.Emit, While.Emit, For.Emit,
23279 Statement.EmitBoolExpression): Add support to Do and While to
23280 propagate infinite loop as `I do return' semantics.
23282 Improve the For case to also test for boolean constants.
23284 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
23285 to the list of attributes we can add.
23287 Remove `EmitContext' argument.
23289 * class.cs (Method.Define): Apply parameter attributes.
23290 (Constructor.Define): Apply parameter attributes.
23291 (MethodCore.LabelParameters): Move here the core of labeling
23294 * support.cs (ReflectionParameters.ParameterModifier,
23295 InternalParameters.ParameterModifier): Use IsByRef on the type and
23296 only return the OUT bit for these parameters instead of in/out/ref
23299 This is because I miss-understood things. The ParameterInfo.IsIn
23300 and IsOut represent whether the parameter has the [In] and [Out]
23303 2002-01-22 Miguel de Icaza <miguel@ximian.com>
23305 * ecore.cs (FieldExpr.Emit): Release temporaries.
23307 * assign.cs (LocalTemporary.Release): new function.
23309 * codegen.cs (EmitContext.GetTemporaryStorage,
23310 EmitContext.FreeTemporaryStorage): Rework the way we deal with
23311 temporary storage. Now we can "put back" localbuilders when we
23314 2002-01-21 Miguel de Icaza <miguel@ximian.com>
23316 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
23317 need to make a copy of the variable to generate verifiable code.
23319 2002-01-19 Miguel de Icaza <miguel@ximian.com>
23321 * driver.cs: Compute dynamically the system directory.
23323 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
23324 Slower, but more generally useful. Used by the abstract
23325 registering implementation.
23327 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
23328 the rules for the special rule on Type/instances. First check if
23329 we have the same name, and if so, try that special static path
23330 rather than the instance path.
23332 2002-01-18 Miguel de Icaza <miguel@ximian.com>
23334 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
23337 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
23338 Enum, ValueType, Delegate or Array for non-corlib compiles.
23340 * cs-tokenizer.cs: Catch long identifiers (645)
23342 * typemanager.cs (IndexerPropetyName): Ravi never tested this
23345 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
23346 fix, we were returning too early, so we were not registering
23347 pending methods from abstract classes.
23349 Do not register pending methods if the class is abstract.
23351 * expression.cs (Conditional.DoResolve): Report circular implicit
23352 conversions when we neecd to compute it for conditional
23355 (Is.DoResolve): If the expression is always of the provided type,
23356 flag warning 183. If the expression can not ever be of the
23357 provided type flag warning 184.
23359 * class.cs: Catch 169 as well.
23361 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
23364 2002-01-18 Nick Drochak <ndrochak@gol.com>
23366 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
23368 2002-01-17 Miguel de Icaza <miguel@ximian.com>
23370 * interface.cs: (PopulateMethod): Check for pointers being defined
23371 only if the unsafe context is active.
23372 (PopulateProperty): ditto.
23373 (PopulateIndexer): ditto.
23375 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
23376 specified. If pointers are present, make sure that they are
23377 present in an unsafe context.
23378 (Constructor, Constructor.Define): ditto.
23379 (Field, Field.Define): ditto.
23380 (Property, Property.Define): ditto.
23381 (Event, Event.Define): ditto.
23383 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
23384 hashtable if there are classes or structs defined.
23386 * expression.cs (LocalVariableReference.DoResolve): Simplify this
23387 code, as the constant resolution moved.
23389 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
23390 the metadata, so we can flag error 133.
23392 * decl.cs (MemberCore.UnsafeOK): New function to test that a
23393 pointer is being declared in an unsafe context.
23395 2002-01-16 Miguel de Icaza <miguel@ximian.com>
23397 * modifiers.cs (Modifiers.Check): Require a Location argument.
23398 Report error 227 for Unsafe use.
23400 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
23402 * statement.cs (For.Emit): If the test is null, then report that
23403 we do `return', as we wont reach anything afterwards.
23405 (Switch.SwitchGoverningType): Track the expression that matched
23408 * driver.cs: Allow negative numbers as an error code to flag.
23410 * cs-parser.jay: Handle 1551.
23412 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
23414 2002-01-15 Miguel de Icaza <miguel@ximian.com>
23416 * cs-parser.jay: Report 1518 (type declaration can only contain
23417 class, struct, interface, enum or delegate)
23419 (switch_label): Report 1523 (keywords `case' or `default' must
23422 (opt_switch_sections): Report 1522 (empty switch)
23424 * driver.cs: Report 1515 (response file specified multiple times)
23425 Report 1516 (Source file specified multiple times).
23427 * expression.cs (Argument.Resolve): Signal 1510
23429 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
23430 access not allowed in static code)
23432 2002-01-11 Ravi Pratap <ravi@ximian.com>
23434 * typemanager.cs (IsPointerType): Utility method which we are going
23437 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
23438 the object type, so we take care of that.
23440 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
23442 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
23443 added to non-params parameters :-)
23445 * typemanager.cs (CSharpName): Include 'void' type too.
23447 (void_ptr_type): Include in the set of core types.
23449 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
23452 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
23455 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
23456 completely forgotten about it.
23458 2002-01-10 Ravi Pratap <ravi@ximian.com>
23460 * cs-parser.jay (pointer_type): Add. This begins our implementation
23461 of parsing rules for unsafe code.
23463 (unsafe_statement): Implement.
23465 (embedded_statement): Modify to include the above.
23467 * statement.cs (Unsafe): Implement new class for unsafe blocks.
23469 * codegen.cs (EmitContext.InUnsafe): Add. This determines
23470 if the current context is an unsafe one.
23472 * cs-parser.jay (local_variable_pointer_type): Since local variable types
23473 are handled differently, we need separate rules for them.
23475 (local_variable_declaration): Update to use local_variable_pointer_type
23476 to allow variable declarations of unmanaged pointer types.
23478 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
23479 in unsafe contexts.
23481 * ../errors/cs0214.cs : Add.
23483 2002-01-16 Nick Drochak <ndrochak@gol.com>
23485 * makefile: remove 'response' file when cleaning.
23487 2002-01-15 Miguel de Icaza <miguel@ximian.com>
23489 * cs-parser.jay: Report 1524.
23491 2002-01-14 Miguel de Icaza <miguel@ximian.com>
23493 * typemanager.cs (RegisterMethod): drop checking if we have
23494 registered this from here
23496 2002-01-12 Miguel de Icaza <miguel@ximian.com>
23498 * class.cs (Method.EmitDestructor): Implement calling our base
23501 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
23502 value of InFinally.
23504 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
23505 this routine and will wrap the call in a try/catch block. Deal
23508 2002-01-11 Miguel de Icaza <miguel@ximian.com>
23510 * ecore.cs (Expression.MemberLookup): instead of taking a
23511 parameter `same_type' that was used to tell whether we could
23512 access private members we compute our containing type from the
23515 (FieldExpr): Added partial support for volatile fields. This does
23516 not work for volatile fields exposed from assemblies, as I can not
23517 figure out how to extract the modreq from it.
23519 Updated all the source files to use this.
23521 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
23522 because it is referenced by MemberLookup very often.
23524 2002-01-09 Ravi Pratap <ravi@ximian.com>
23526 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
23527 TypeBuilder.GetCustomAttributes to retrieve what we need.
23529 Get rid of redundant default_member_attr_type as this is the same as
23530 default_member_type which already exists.
23532 * interface.cs, attribute.cs : Update accordingly.
23534 2002-01-08 Miguel de Icaza <miguel@ximian.com>
23536 * typemanager.cs: Enable IndexerPropertyName again. It does not
23537 work for TYpeBuilders though. Ravi, can you please fix this?
23539 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
23541 * expression.cs (Argument.Emit): Handle the case of ref objects
23542 being passed to ref functions;
23544 (ParameterReference.EmitLoad): Loads the content of the pointer
23545 without dereferencing.
23547 2002-01-07 Miguel de Icaza <miguel@ximian.com>
23549 * cs-tokenizer.cs: Implemented the pre-processing expressions.
23551 2002-01-08 Ravi Pratap <ravi@ximian.com>
23553 * class.cs (Indexer.DefineMethod): Incorporate the interface
23554 type in the name of the method if we are doing explicit interface
23557 * expression.cs (ConversionExists): Remove as it is completely obsolete.
23559 (BetterConversion): Fix extremely trivial bug where we were referring to
23560 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
23563 * ../errors/bug16.cs : Add although we have fixed it.
23565 2002-01-07 Miguel de Icaza <miguel@ximian.com>
23567 * expression.cs (BaseIndexer): Begin implementation.
23569 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
23571 * cs-parser.jay (indexer_declarator): Use qualified_identifier
23572 production directly to remove a shift/reduce, and implement
23573 explicit interface implementation.
23575 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
23576 after a floating point suffix.
23578 * expression.cs (DoNumericPromotions): Improved the conversion for
23579 uint/uint. If we have a constant, we avoid doing a typecast to a
23582 * class.cs (Indexer): Implement explicit interface implementation
23585 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
23587 * class.cs: make the default instance constructor public and hidebysig.
23589 2001-01-03 Ravi Pratap <ravi@ximian.com>
23591 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
23592 so we can call it from elsewhere.
23594 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
23595 we emit it internally if the class has a defined indexer; otherwise the user
23596 emits it by decorating the class definition with the DefaultMemberAttribute.
23598 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
23599 attribute is not used on a type which defines an indexer.
23601 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
23602 character when we skip whitespace.
23604 * ../errors/cs0646.cs : Add.
23606 2002-01-03 Miguel de Icaza <miguel@ximian.com>
23608 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
23611 * makefile: Add practical target `mcs3.exe' which builds the third
23612 generation compiler.
23614 * expression.cs (New): Fix structures constructor calling.
23616 * class.cs (Property, Method, Indexer): Emit Final flag on the
23617 method if we are an interface implementation and we are not
23620 * ecore.cs (PropertyExpr): New public field `IsBase', tells
23621 whether this property is referencing a `base' method.
23623 * expression.cs (Invocation.EmitCall): take an extra argument:
23624 is_base, this is used to determine whether the `call' or
23625 `callvirt' opcode should be used.
23628 * delegate.cs: update EmitCall.
23630 * class.cs (Method.Define): Set NewSlot for the cases where we are
23631 not implementing an interface method.
23633 (Property.Define): ditto.
23635 2002-01-02 Miguel de Icaza <miguel@ximian.com>
23637 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
23638 'r'. Allows mcs to parse itself fully.
23640 2002-01-02 Ravi Pratap <ravi@ximian.com>
23642 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
23643 of the number of initializers that require the InitializeArray method.
23645 (CheckIndices): Store the Expression in all cases - not the plain value. Also
23646 update the above field where necessary.
23648 (MakeByteBlob): Update accordingly.
23650 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
23653 (EmitDynamicInitializers): Update in accordance with the new optimization.
23655 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
23656 same OpCode applies.
23658 * cs-parser.jay : Fix some glaring errors I introduced.
23660 2002-01-01 Ravi Pratap <ravi@ximian.com>
23662 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
23663 so that we can check for name clashes there too.
23665 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
23666 for interface indexers.
23668 * interfaces.cs (Define): Emit the default member attribute.
23670 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
23671 variable was being referred to while setting the value ;-)
23673 2002-01-01 Miguel de Icaza <miguel@ximian.com>
23675 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
23676 byte-by-byte information when we know the data is zero.
23678 Make the block always a multiple of 4, because
23679 DefineInitializedData has a bug.
23681 * assign.cs: Fix, we should assign from the temporary, not from
23684 * expression.cs (MakeByteBlob): Fix my incorrect code.
23686 2001-12-31 Miguel de Icaza <miguel@ximian.com>
23688 * typemanager.cs (EnumToUnderlying): This function is used to get
23689 the underlying type from an enumeration, because it does not
23692 * constant.cs: Use the I4_S form for values between -128 and 127.
23694 * statement.cs (Block.LookupLabel): Looks up a label.
23695 (Block): Drop support for labeled blocks.
23697 (LabeledStatement): New kind of statement that represents a label
23700 (Goto): Finally implement this bad boy.
23702 * cs-parser.jay: Update to reflect new mechanism to implement
23705 2001-12-30 Miguel de Icaza <miguel@ximian.com>
23707 * codegen.cs (EmitContext.This): a codegen property that keeps the
23708 a single instance of this instead of creating many different this
23711 * delegate.cs (Delegate.DoResolve): Update to use the property;
23713 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
23715 * expression.cs (BaseAccess.DoResolve): Ditto.
23717 2001-12-29 Ravi Pratap <ravi@ximian.com>
23719 * typemanager.cs (methodimpl_attr_type): Add to hold the type
23720 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
23722 (InitCoreTypes): Update accordingly.
23724 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
23725 so we can quickly store the state.
23727 (ApplyAttributes): Set the correct implementation flags
23728 for InternalCall methods.
23730 2001-12-29 Miguel de Icaza <miguel@ximian.com>
23732 * expression.cs (EmitCall): if a method is not virtual, then do
23733 not use callvirt on it.
23735 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
23736 user defined stuff) requires the use of stobj, which takes an
23737 address on the stack instead of an array and an index. So emit
23738 the Ldelema operation for it.
23740 (EmitStoreOpcode): Use stobj for valuetypes.
23742 (UnaryMutator.EmitCode): Use the right 1 value depending on
23743 whether we are dealing with int64/uint64, float or doubles.
23745 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
23746 constructors that I implemented last night.
23748 (Constructor.IsDefault): Fix to work properly for static
23751 * cs-parser.jay (CheckDef): report method signature errors.
23752 Update error number 103 to be 132.
23754 * decl.cs: New AdditionResult enumeration value: MethodExists.
23755 Although we do this check for methods later on in the semantic
23756 analysis, catching repeated default constructors is so easy that
23757 we catch these here.
23759 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
23762 (ParameterReference.EmitAssign, Emit): handle
23765 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
23766 (ArrayAccess.EmitStoreOpcode): ditto.
23768 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
23770 * expression.cs (MakeByteBlob): Complete all the missing types
23771 (uint, short, ushort, byte, sbyte)
23773 * class.cs: Only init instance field initializers on instance
23776 Rename `constructors' to instance_constructors.
23778 (TypeContainer.AddConstructor): Only add constructors to the list
23779 if it is not static.
23781 Make sure that we handle default_static_constructor independently
23782 everywhere where we handle instance_constructors
23784 2001-12-28 Miguel de Icaza <miguel@ximian.com>
23786 * class.cs: Do not lookup or create a base initializer for a
23787 static constructor.
23789 (ConstructorInitializer.Resolve): use the proper type to lookup
23792 * cs-parser.jay: Report error 1585 (modifiers between type and name).
23794 * enum.cs, interface.cs: Remove CloseType, this is taken care by
23797 * decl.cs: CloseType is now an virtual method, the default
23798 implementation just closes this type.
23800 2001-12-28 Ravi Pratap <ravi@ximian.com>
23802 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
23803 to PreserveSig by default. Also emit HideBySig on such methods.
23805 Basically, set the defaults to standard values.
23807 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
23808 argument, if candidate is better, it can't be worse than the best !
23810 (Invocation): Re-write bits to differentiate between methods being
23811 applicable in their expanded form and their normal form - for params
23814 Get rid of use_standard everywhere as only standard conversions are allowed
23815 in overload resolution.
23817 More spec conformance.
23819 2001-12-27 Miguel de Icaza <miguel@ximian.com>
23821 * driver.cs: Add --timestamp, to see where the compiler spends
23824 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
23825 `this' in static code.
23827 (SimpleName.DoResolve): Implement in terms of a helper function
23828 that allows static-references to be passed upstream to
23831 (Expression.ResolveWithSimpleName): Resolve specially simple
23832 names when called by MemberAccess to implement the special
23835 (Expression.ImplicitReferenceConversion): Handle conversions from
23836 Null to reference types before others, as Null's type is
23839 * expression.cs (Invocation.EmitCall): Handle the special case of
23840 calling methods declared on a reference type from a ValueType
23841 (Base classes System.Object and System.Enum)
23843 (MemberAccess.Resolve): Only perform lookups on Enumerations if
23844 the left hand side is a TypeExpr, not on every enumeration.
23846 (Binary.Resolve): If types are reference types, then do a cast to
23847 object on operators != and == of both arguments.
23849 * typemanager.cs (FindMembers): Extract instance and static
23850 members if requested.
23852 * interface.cs (PopulateProperty): Use void_type instead of null
23853 as the return type for the setter method.
23855 (PopulateIndexer): ditto.
23857 2001-12-27 Ravi Pratap <ravi@ximian.com>
23859 * support.cs (ReflectionParameters): Fix minor bug where we
23860 were examining the wrong parameter for the ParamArray attribute.
23862 Cope with requests for the type of the parameter at position
23863 greater than the params parameter's. We now return the element
23864 type of the params array as that makes more sense.
23866 * expression.cs (Invocation.IsParamsMethodApplicable): Update
23867 accordingly as we no longer have to extract the element type
23870 (Invocation.OverloadResolve): Update.
23872 2001-12-27 Miguel de Icaza <miguel@ximian.com>
23874 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
23875 against IEnumerator, test whether the return value is a descendant
23876 of the IEnumerator interface.
23878 * class.cs (Indexer.Define): Use an auxiliary method to implement
23879 the other bits of the method definition. Begin support for
23880 explicit interface implementation.
23882 (Property.DefineMethod): Use TypeManager.void_type instead of null
23883 for an empty return value.
23885 2001-12-26 Miguel de Icaza <miguel@ximian.com>
23887 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
23888 dealing with a FieldExpr which is composed of a FieldBuilder, in
23889 the code path we did extract the constant, but we should have
23890 obtained the underlying value to be able to cast it (otherwise we
23891 end up in an infinite loop, this is what Ravi was running into).
23893 (ArrayCreation.UpdateIndices): Arrays might be empty.
23895 (MemberAccess.ResolveMemberAccess): Add support for section
23896 14.5.4.1 that deals with the special case of E.I when E is a type
23897 and something else, that I can be a reference to a static member.
23899 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
23900 handle a particular array type to create byte blobs, it is just
23901 something we dont generate byteblobs for.
23903 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
23906 * location.cs (Push): remove the key from the hashtable that we
23907 are about to add. This happens for empty files.
23909 * driver.cs: Dispose files after we have parsed them.
23911 (tokenize): new function that only runs the tokenizer on its
23912 input, for speed testing.
23914 2001-12-26 Ravi Pratap <ravi@ximian.com>
23916 * class.cs (Event.Define): Define the private field only if there
23917 are no accessors defined.
23919 * expression.cs (ResolveMemberAccess): If there is no associated
23920 field with the event, that means we have an event defined with its
23921 own accessors and we should flag error cs0070 since transforming
23922 ourselves into a field is not valid in that case.
23924 * ecore.cs (SimpleName.DoResolve): Same as above.
23926 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
23927 and charset to sane values.
23929 2001-12-25 Ravi Pratap <ravi@ximian.com>
23931 * assign.cs (DoResolve): Perform check on events only if they
23932 are being accessed outside the declaring type.
23934 * cs-parser.jay (event_declarations): Update rules to correctly
23935 set the type of the implicit parameter etc.
23937 (add_accessor, remove_accessor): Set current local parameters.
23939 * expression.cs (Binary): For delegate addition and subtraction,
23940 cast the return value from the method into the appropriate delegate
23943 2001-12-24 Ravi Pratap <ravi@ximian.com>
23945 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
23946 of these as the workaround is unnecessary.
23948 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
23949 delegate data - none of that is needed at all.
23951 Re-write bits to extract the instance expression and the delegate method
23954 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
23957 * attribute.cs (ApplyAttributes): New method to take care of common tasks
23958 of attaching attributes instead of duplicating code everywhere.
23960 * everywhere : Update code to do attribute emission using the above method.
23962 2001-12-23 Miguel de Icaza <miguel@ximian.com>
23964 * expression.cs (IsParamsMethodApplicable): if there are not
23965 parameters, return immediately.
23967 * ecore.cs: The 0 literal can be implicity converted to an enum
23970 (SimpleName.DoResolve): First lookup the type, then lookup the
23973 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
23974 want to get its address. If the InstanceExpression is not
23975 addressable, store the result in a temporary variable, then get
23978 * codegen.cs: Only display 219 errors on warning level or above.
23980 * expression.cs (ArrayAccess): Make it implement the
23981 IMemoryLocation interface.
23983 (Binary.DoResolve): handle the operator == (object a, object b)
23984 and operator != (object a, object b) without incurring into a
23985 BoxedCast (because 5 != o should never be performed).
23987 Handle binary enumerator operators.
23989 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
23990 value type, otherwise use Ldelem_ref.
23992 Use precomputed names;
23994 (AddressOf): Implement address of
23996 * cs-parser.jay (labeled_statement): Fix recursive block
23997 addition by reworking the production.
23999 * expression.cs (New.DoEmit): New has a special case:
24001 If we are dealing with a ValueType, we have a few
24002 situations to deal with:
24004 * The target of New is a ValueType variable, that is
24005 easy, we just pass this as the variable reference
24007 * The target of New is being passed as an argument,
24008 to a boxing operation or a function that takes a
24011 In this case, we need to create a temporary variable
24012 that is the argument of New.
24015 2001-12-23 Ravi Pratap <ravi@ximian.com>
24017 * rootcontext.cs (LookupType): Check that current_type is not null before
24018 going about looking at nested types.
24020 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
24021 not implement the IAssignMethod interface any more.
24023 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
24024 where we tranform them into FieldExprs if they are being resolved from within
24025 the declaring type.
24027 * ecore.cs (SimpleName.DoResolve): Do the same here.
24029 * assign.cs (DoResolve, Emit): Clean up code considerably.
24031 * ../errors/bug10.cs : Add.
24033 * ../errors/cs0070.cs : Add.
24035 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
24037 * assign.cs : Get rid of EventIsLocal everywhere.
24039 2001-12-23 Miguel de Icaza <miguel@ximian.com>
24041 * ecore.cs (ConvertIntLiteral): finished the implementation.
24043 * statement.cs (SwitchLabel): Convert the value we are using as a
24044 key before looking up the table.
24046 2001-12-22 Miguel de Icaza <miguel@ximian.com>
24048 * codegen.cs (EmitTopBlock): Require a Location argument now.
24050 * cs-parser.jay (constructor_declarator): We need to setup
24051 current_local_parameters before we parse the
24052 opt_constructor_initializer, to allow the variables to be bound
24053 to the constructor arguments.
24055 * rootcontext.cs (LookupType): First lookup nested classes in our
24056 class and our parents before we go looking outside our class.
24058 * expression.cs (ConstantFold): Extract/debox the values at the
24061 * rootcontext.cs (EmitCode): Resolve the constants first before we
24062 resolve the types. This is not really needed, but it helps debugging.
24064 * statement.cs: report location.
24066 * cs-parser.jay: pass location to throw statement.
24068 * driver.cs: Small bug fix.
24070 * report.cs: Updated format to be 4-zero filled digits.
24072 2001-12-22 Ravi Pratap <ravi@ximian.com>
24074 * expression.cs (CheckIndices): Fix minor bug where the wrong
24075 variable was being referred to ;-)
24077 (DoEmit): Do not call EmitStaticInitializers when the
24078 underlying type is System.Object.
24080 2001-12-21 Ravi Pratap <ravi@ximian.com>
24082 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
24083 and do the usual workaround for SRE.
24085 * class.cs (MyEventBuilder.EventType): New member to get at the type
24086 of the event, quickly.
24088 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
24090 * assign.cs (Assign.DoResolve): Handle the case when the target
24091 is an EventExpr and perform the necessary checks.
24093 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
24096 (SimpleName.MemberStaticCheck): Include check for EventExpr.
24098 (EventExpr): Set the type in the constructor itself since we
24099 are meant to be born fully resolved.
24101 (EventExpr.Define): Revert code I wrote earlier.
24103 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
24104 instance expression is null. The instance expression is a This in that case
24105 or a null, depending on whether it is a static method or not.
24107 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
24108 refers to more than one method.
24110 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
24111 and accordingly flag errors.
24113 2001-12-21 Miguel de Icaza <miguel@ximian.com>
24115 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
24117 2001-12-22 Miguel de Icaza <miguel@ximian.com>
24119 * location.cs (ToString): Provide useful rutine.
24121 2001-12-21 Miguel de Icaza <miguel@ximian.com>
24123 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
24124 objects, return the actual integral boxed.
24126 * statement.cs (SwitchLabel): define an ILLabel for each
24129 (Switch.CheckSwitch): If the value is a Literal, extract
24130 the underlying literal.
24132 Also in the unused hashtable we had, add the SwitchLabel so we can
24133 quickly look this value up.
24135 * constant.cs: Implement a bunch of new constants. Rewrite
24136 Literal based on this. Made changes everywhere to adapt to this.
24138 * expression.cs (Expression.MakeByteBlob): Optimize routine by
24139 dereferencing array only once, and also copes with enumrations.
24141 bytes are two bytes wide, not one.
24143 (Cast): Perform constant conversions.
24145 * ecore.cs (TryImplicitIntConversion): Return literals instead of
24146 wrappers to the literals here.
24148 * expression.cs (DoNumericPromotions): long literals can converted
24149 to ulong implicity (this is taken care of elsewhere, but I was
24150 missing this spot).
24152 * ecore.cs (Expression.Literalize): Make the return type Literal,
24153 to improve type checking.
24155 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
24157 2001-12-20 Miguel de Icaza <miguel@ximian.com>
24159 * literal.cs: Revert code from ravi that checked the bounds. The
24160 bounds are sane by the definition of the type itself.
24162 * typemanager.cs: Fix implementation of ImplementsInterface. We
24163 need to actually look up in our parent hierarchy for interfaces
24166 * const.cs: Use the underlying type for enumerations
24168 * delegate.cs: Compute the basename for the delegate creation,
24169 that should fix the delegate test case, and restore the correct
24170 Type Lookup semantics in rootcontext
24172 * rootcontext.cs: Revert Ravi's last patch. The correct way of
24173 referencing a nested type with the Reflection API is using the "+"
24176 * cs-parser.jay: Do not require EOF token at the end.
24178 2001-12-20 Ravi Pratap <ravi@ximian.com>
24180 * rootcontext.cs (LookupType): Concatenate type names with
24181 a '.' instead of a '+' The test suite passes again.
24183 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
24184 field of the enumeration.
24186 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
24187 the case when the member is an EventExpr.
24189 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
24190 static has an associated instance expression.
24192 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
24194 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
24196 * class.cs (Event.Define): Register event and perform appropriate checks
24199 We define the Add and Remove methods even if the use provides none because
24200 in that case, we provide default implementations ourselves.
24202 Define a private field of the type of the event. This is done by the CSC compiler
24203 and we should be doing it too ;-)
24205 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
24206 More methods we use in code we generate.
24208 (multicast_delegate_type, delegate_type): Two separate types since the distinction
24211 (InitCoreTypes): Update accordingly for the above.
24213 * class.cs (Event.Emit): Generate code for default accessors that we provide
24215 (EmitDefaultMethod): Do the job in the above.
24217 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
24220 2001-12-20 Miguel de Icaza <miguel@ximian.com>
24222 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
24223 builders even if we were missing one.
24225 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
24226 pass the Basename as our class name instead of the Name. The
24227 basename will be correctly composed for us.
24229 * parameter.cs (Paramters): Now takes a Location argument.
24231 * decl.cs (DeclSpace.LookupType): Removed convenience function and
24232 make all the code call directly LookupType in RootContext and take
24233 this chance to pass the Location information everywhere.
24235 * Everywhere: pass Location information.
24237 2001-12-19 Miguel de Icaza <miguel@ximian.com>
24239 * class.cs (Constructor.Define): Updated way of detecting the
24240 length of the parameters.
24242 (TypeContainer.DefineType): Use basename as the type name for
24245 (TypeContainer.Define): Do not recursively define types here, as
24246 definition is taken care in order by the RootContext.
24248 * tree.cs: Keep track of namespaces in a per-file basis.
24250 * parameter.cs (Parameter.ComputeSignature): Update to use
24253 (Parameters.GetSignature): ditto.
24255 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
24256 instead of a TypeContainer.
24258 (Interface.SemanticAnalysis): Use `this' instead of our parent to
24259 resolve names. Because we need to be resolve in our context, not
24262 * driver.cs: Implement response files.
24264 * class.cs (TypeContainer.DefineType): If we are defined, do not
24265 redefine ourselves.
24267 (Event.Emit): Emit the code for add/remove handlers.
24268 (Event.Define): Save the MethodBuilders for add/remove.
24270 * typemanager.cs: Use pair here too.
24272 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
24273 DictionaryEntry requires the first argument to be non-null.
24275 (enum_declaration): Compute full name for registering the
24278 (delegate_declaration): Instead of using
24279 formal_parameter_list, use opt_formal_parameter_list as the list
24282 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
24283 (EventParsing): New property that controls whether `add' and
24284 `remove' are returned as tokens or identifiers (for events);
24286 2001-12-19 Ravi Pratap <ravi@ximian.com>
24288 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
24289 use MyEventBuilder only and let it wrap the real builder for us.
24291 (MyEventBuilder): Revamp constructor etc.
24293 Implement all operations that we perform on EventBuilder in precisely the same
24296 (FindMembers): Update to use the EventBuilder member.
24298 (Event.Emit): Update accordingly.
24300 2001-12-18 Ravi Pratap <ravi@ximian.com>
24302 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
24303 by calling the appropriate methods.
24305 (GetCustomAttributes): Make stubs as they cannot possibly do anything
24308 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
24310 2001-12-17 Ravi Pratap <ravi@ximian.com>
24312 * delegate.cs (Delegate.Populate): Check that the return type
24313 and various parameters types are indeed accessible.
24315 * class.cs (Constructor.Define): Same here.
24317 (Field.Define): Ditto.
24319 (Event.Define): Ditto.
24321 (Operator.Define): Check that the underlying Method defined itself
24322 correctly - so it's MethodBuilder should not be null.
24324 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
24325 expression happens to be null.
24327 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
24328 members but as of now we don't seem to be able to do anything really useful with it.
24330 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
24331 not the EventBuilder.
24333 2001-12-18 Miguel de Icaza <miguel@ximian.com>
24335 * cs-tokenizer.cs: Add support for defines.
24336 Add support for #if, #elif, #else, #endif
24338 (eval_var): evaluates a variable.
24339 (eval): stubbed for evaluating functions.
24341 * cs-parser.jay: Pass the defines information
24343 * driver.cs: Add --define command line option.
24345 * decl.cs: Move MemberCore here.
24347 Make it the base class for DeclSpace. This allows us to catch and
24348 report 108 and 109 for everything now.
24350 * class.cs (TypeContainer.Define): Extract all the members
24351 before populating and emit the warning 108 (new keyword required
24352 to override) instead of having each member implement this.
24354 (MemberCore.Define): New abstract method, we will be using this in
24355 the warning reporting engine in Populate.
24357 (Operator.Define): Adjust to new MemberCore protocol.
24359 * const.cs (Const): This does not derive from Expression, it is a
24360 temporary object we use to create fields, it is a MemberCore.
24362 * class.cs (Method.Define): Allow the entry point to be in a
24365 * driver.cs: Rewrite the argument handler to clean it up a bit.
24367 * rootcontext.cs: Made it just an auxiliary namespace feature by
24368 making everything static.
24370 * driver.cs: Adapt code to use RootContext type name instead of
24373 * delegate.cs: Remove RootContext argument.
24375 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
24378 * class.cs (Event.Define): The lookup can fail.
24380 * cs-tokenizer.cs: Begin implementation of pre-procesor.
24382 * expression.cs: Resolve the this instance before invoking the code.
24384 2001-12-17 Miguel de Icaza <miguel@ximian.com>
24386 * cs-parser.jay: Add a production in element_access that allows
24387 the thing to become a "type" reference. This way we can parse
24388 things like "(string [])" as a type.
24390 Note that this still does not handle the more complex rules of
24394 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
24396 * ecore.cs: (CopyNewMethods): new utility function used to
24397 assemble the list of methods from running FindMembers.
24399 (MemberLookup): Rework FindMembers so that
24401 2001-12-16 Miguel de Icaza <miguel@ximian.com>
24403 * class.cs (TypeContainer): Remove Delegates who fail to be
24406 * delegate.cs (Populate): Verify that we dont get null return
24407 values. TODO: Check for AsAccessible.
24409 * cs-parser.jay: Use basename to emit error 574 (destructor should
24410 have the same name as container class), not the full name.
24412 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
24413 possible representation.
24415 Also implements integer type suffixes U and L.
24417 2001-12-15 Miguel de Icaza <miguel@ximian.com>
24419 * expression.cs (ArrayCreation.DoResolve): We need to do the
24420 argument resolution *always*.
24422 * decl.cs: Make this hold the namespace. Hold the root context as
24424 (LookupType): Move here.
24426 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
24428 * location.cs (Row, Name): Fixed the code, it was always returning
24429 references to the first file.
24431 * interface.cs: Register properties defined through interfaces.
24433 * driver.cs: Add support for globbing on the command line
24435 * class.cs (Field): Make it derive from MemberCore as well.
24438 2001-12-15 Ravi Pratap <ravi@ximian.com>
24440 * class.cs (Event::Define): Check that the type of the event is a delegate
24441 type else flag error #66.
24443 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
24446 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
24447 values of EntryPoint, CharSet etc etc.
24449 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
24451 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
24452 be null and we should ignore this. I am not sure if this is really clean. Apparently,
24453 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
24454 which needs this to do its work.
24456 * ../errors/cs0066.cs : Add.
24458 2001-12-14 Miguel de Icaza <miguel@ximian.com>
24460 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
24463 * class.cs: (MethodSignature.MethodSignature): Removed hack that
24464 clears out the parameters field.
24465 (MemberSignatureCompare): Cleanup
24467 (MemberCore): New base class used to share code between MethodCore
24470 (RegisterRequiredImplementations) BindingFlags.Public requires
24471 either BindingFlags.Instace or Static. Use instance here.
24473 (Property): Refactored code to cope better with the full spec.
24475 * parameter.cs (GetParameterInfo): Return an empty array instead
24478 * class.cs (Property): Abstract or extern properties have no bodies.
24480 * parameter.cs (GetParameterInfo): return a zero-sized array.
24482 * class.cs (TypeContainer.MethodModifiersValid): Move all the
24483 method modifier validation to the typecontainer so we can reuse
24484 this on properties.
24486 (MethodCore.ParameterTypes): return an empty sized array of types.
24488 (Property.Define): Test property modifier validity.
24490 Add tests for sealed/override too.
24492 (Method.Emit): abstract or extern methods have no bodies.
24494 2001-12-14 Ravi Pratap <ravi@ximian.com>
24496 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
24499 (Method::Define, ::Emit): Modify accordingly.
24501 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
24503 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
24505 * makefile: Pass in /unsafe.
24507 2001-12-13 Miguel de Icaza <miguel@ximian.com>
24509 * class.cs (MakeKey): Kill routine.
24511 * class.cs (TypeContainer.Define): Correctly define explicit
24512 method implementations (they require the full interface name plus
24515 * typemanager.cs: Deply the PtrHashtable here and stop using the
24516 lame keys. Things work so much better.
24518 This of course broke everyone who depended on `RegisterMethod' to
24519 do the `test for existance' test. This has to be done elsewhere.
24521 * support.cs (PtrHashtable): A hashtable that avoid comparing with
24522 the object stupid Equals method (because, that like fails all over
24523 the place). We still do not use it.
24525 * class.cs (TypeContainer.SetRequiredInterface,
24526 TypeContainer.RequireMethods): Killed these two routines and moved
24527 all the functionality to RegisterRequiredImplementations.
24529 (TypeContainer.RegisterRequiredImplementations): This routine now
24530 registers all the implementations required in an array for the
24531 interfaces and abstract methods. We use an array of structures
24532 which can be computed ahead of time to reduce memory usage and we
24533 also assume that lookups are cheap as most classes will not
24534 implement too many interfaces.
24536 We also avoid creating too many MethodSignatures.
24538 (TypeContainer.IsInterfaceMethod): Update and optionally does not
24539 clear the "pending" bit if we find that there are problems with
24542 (TypeContainer.VerifyPendingMethods): Update to report errors of
24543 methods that look like implementations but are not.
24545 (TypeContainer.Define): Add support for explicit interface method
24548 2001-12-12 Miguel de Icaza <miguel@ximian.com>
24550 * typemanager.cs: Keep track of the parameters here instead of
24551 being a feature of the TypeContainer.
24553 * class.cs: Drop the registration of parameters here, as
24554 InterfaceMethods are also interface declarations.
24556 * delegate.cs: Register methods with the TypeManager not only with
24557 the TypeContainer. This code was buggy.
24559 * interface.cs: Full registation here.
24561 2001-12-11 Miguel de Icaza <miguel@ximian.com>
24563 * expression.cs: Remove reducer for binary expressions, it can not
24566 * const.cs: Put here the code that used to go into constant.cs
24568 * constant.cs: Put here the code for constants, this is a new base
24569 class for Literals.
24571 * literal.cs: Make Literal derive from Constant.
24573 2001-12-09 Miguel de Icaza <miguel@ximian.com>
24575 * statement.cs (Return.Emit): Report error 157 if the user
24576 attempts to return from a finally block.
24578 (Return.Emit): Instead of emitting a return, jump to the end of
24581 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
24582 LocalBuilder to store the result of the function. ReturnLabel is
24583 the target where we jump.
24586 2001-12-09 Radek Doulik <rodo@ximian.com>
24588 * cs-parser.jay: remember alias in current namespace
24590 * ecore.cs (SimpleName::DoResolve): use aliases for types or
24593 * class.cs (LookupAlias): lookup alias in my_namespace
24595 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
24597 (LookupAlias): lookup alias in this and if needed in parent
24600 2001-12-08 Miguel de Icaza <miguel@ximian.com>
24604 * rootcontext.cs: (ModuleBuilder) Made static, first step into
24605 making things static. I need this to avoid passing the
24606 TypeContainer when calling ParameterType.
24608 * support.cs (InternalParameters.ParameterType): Remove ugly hack
24609 that did string manipulation to compute the type and then call
24610 GetType. Use Parameter.ParameterType instead.
24612 * cs-tokenizer.cs: Consume the suffix for floating values.
24614 * expression.cs (ParameterReference): figure out whether this is a
24615 reference parameter or not. Kill an extra variable by computing
24616 the arg_idx during emission.
24618 * parameter.cs (Parameters.GetParameterInfo): New overloaded
24619 function that returns whether a parameter is an out/ref value or not.
24621 (Parameter.ParameterType): The type of the parameter (base,
24622 without ref/out applied).
24624 (Parameter.Resolve): Perform resolution here.
24625 (Parameter.ExternalType): The full type (with ref/out applied).
24627 * statement.cs (Using.Emit, Using.EmitExpression): Implement
24628 support for expressions on the using statement.
24630 2001-12-07 Miguel de Icaza <miguel@ximian.com>
24632 * statement.cs (Using.EmitLocalVariableDecls): Split the
24633 localvariable handling of the using statement.
24635 (Block.EmitMeta): Keep track of variable count across blocks. We
24636 were reusing slots on separate branches of blocks.
24638 (Try.Emit): Emit the general code block, we were not emitting it.
24640 Check the type of the declaration to be an IDisposable or
24641 something that can be implicity converted to it.
24643 Emit conversions if required.
24645 * ecore.cs (EmptyExpression): New utility class.
24646 (Expression.ImplicitConversionExists): New utility function.
24648 2001-12-06 Miguel de Icaza <miguel@ximian.com>
24650 * statement.cs (Using): Implement.
24652 * expression.cs (LocalVariableReference): Support read only variables.
24654 * statement.cs: Remove the explicit emit for the Leave opcode.
24655 (VariableInfo): Add a readonly field.
24657 2001-12-05 Miguel de Icaza <miguel@ximian.com>
24659 * ecore.cs (ConvCast): new class used to encapsulate the various
24660 explicit integer conversions that works in both checked and
24661 unchecked contexts.
24663 (Expression.ConvertNumericExplicit): Use new ConvCast class to
24664 properly generate the overflow opcodes.
24666 2001-12-04 Miguel de Icaza <miguel@ximian.com>
24668 * statement.cs: The correct type for the EmptyExpression is the
24669 element_type, not the variable type. Ravi pointed this out.
24671 2001-12-04 Ravi Pratap <ravi@ximian.com>
24673 * class.cs (Method::Define): Handle PInvoke methods specially
24674 by using DefinePInvokeMethod instead of the usual one.
24676 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
24677 above to do the task of extracting information and defining the method.
24679 2001-12-04 Ravi Pratap <ravi@ximian.com>
24681 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
24682 of the condition for string type.
24684 (Emit): Move that here.
24686 (ArrayCreation::CheckIndices): Keep string literals in their expression
24689 (EmitDynamicInitializers): Handle strings appropriately.
24691 2001-12-04 Miguel de Icaza <miguel@ximian.com>
24693 * codegen.cs (EmitContext): Replace multiple variables with a
24694 single pointer to the current Switch statement.
24696 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
24699 2001-12-03 Miguel de Icaza <miguel@ximian.com>
24703 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
24706 (Foreach.Emit): Foreach on arrays was not setting
24707 up the loop variables (for break/continue).
24709 (GotoCase): Semi-implented.
24711 2001-12-03 Ravi Pratap <ravi@ximian.com>
24713 * attribute.cs (CheckAttribute): Handle system attributes by using
24714 Attribute.GetAttributes to examine information we need.
24716 (GetValidPlaces): Same here.
24718 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
24720 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
24722 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
24724 (Method::Define): Set appropriate flags if we have a DllImport attribute.
24726 (Method::Emit): Handle the case when we are a PInvoke method.
24728 2001-12-03 Miguel de Icaza <miguel@ximian.com>
24730 * expression.cs: Use ResolveWithSimpleName on compound names.
24732 2001-12-02 Ravi Pratap <ravi@ximian.com>
24734 * constant.cs (EmitConstant): Make sure we resolve the associated expression
24735 before trying to reduce it.
24737 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
24739 * constant.cs (LookupConstantValue): Implement.
24741 (EmitConstant): Use the above in emitting the constant.
24743 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
24744 that are user-defined by doing a LookupConstantValue on them.
24746 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
24749 2001-11-29 Miguel de Icaza <miguel@ximian.com>
24751 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
24753 (BaseAccess.DoResolve): Implement.
24755 (MemberAccess.DoResolve): Split this routine into a
24756 ResolveMemberAccess routine that can be used independently
24758 2001-11-28 Miguel de Icaza <miguel@ximian.com>
24760 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
24761 As that share bits of the implementation. Is returns a boolean,
24762 while As returns the Type that is being probed.
24764 2001-12-01 Ravi Pratap <ravi@ximian.com>
24766 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
24767 instead of a Literal - much easier.
24769 (EnumInTransit): Remove - utterly useless :-)
24771 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
24773 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
24775 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
24776 chain when we have no associated expression.
24778 2001-11-30 Ravi Pratap <ravi@ximian.com>
24780 * constant.cs (Define): Use Location while reporting the errror.
24782 Also emit a warning when 'new' is used and there is no inherited
24785 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
24788 (LookupEnumValue): Implement to lookup an enum member's value and define it
24791 (Populate): Re-write accordingly to use the above routine.
24793 2001-11-27 Miguel de Icaza <miguel@ximian.com>
24795 * expression.cs (This): Fix prototype for DoResolveLValue to
24796 override the base class DoResolveLValue.
24798 * cs-parser.cs: Report errors cs574 and cs575 (destructor
24801 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
24802 (we need to load the address of the field here). This fixes
24805 (FieldExpr.DoResolveLValue): Call the DoResolve
24806 function to initialize the Instance expression.
24808 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
24809 correctly the GetEnumerator operation on a value type.
24811 * cs-parser.jay: Add more simple parsing error catches.
24813 * statement.cs (Switch): Add support for string switches.
24814 Handle null specially.
24816 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
24818 2001-11-28 Ravi Pratap <ravi@ximian.com>
24820 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
24822 (declare_local_constant): New helper function.
24824 * statement.cs (AddConstant): Keep a separate record of constants
24826 (IsConstant): Implement to determine if a variable is a constant.
24828 (GetConstantExpression): Implement.
24830 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
24832 * statement.cs (IsVariableDefined): Re-write.
24834 2001-11-27 Ravi Pratap <ravi@ximian.com>
24836 * class.cs (TypeContainer::FindMembers): Look for constants
24837 in the case when we are looking for MemberTypes.Field
24839 * expression.cs (MemberAccess::DoResolve): Check that in the
24840 case we are a FieldExpr and a Literal, we are not being accessed
24841 by an instance reference.
24843 * cs-parser.jay (local_constant_declaration): Implement.
24845 (declaration_statement): Implement for constant declarations.
24847 2001-11-26 Miguel de Icaza <miguel@ximian.com>
24849 * statement.cs (Switch): Catch double defaults.
24851 (Switch): More work on the switch() statement
24852 implementation. It works for integral values now, need to finish
24856 2001-11-24 Miguel de Icaza <miguel@ximian.com>
24858 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
24859 integer literals into other integer literals. To be used by
24862 2001-11-24 Ravi Pratap <ravi@ximian.com>
24864 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
24867 (EmitDynamicInitializers): Cope with the above since we extract data
24868 directly from ArrayData now.
24870 (ExpectInitializers): Keep track of whether initializers are mandatory
24873 (Bounds): Make it a hashtable to prevent the same dimension being
24874 recorded for every element in that dimension.
24876 (EmitDynamicInitializers): Fix bug which prevented the Set array method
24879 Also fix bug which was causing the indices to be emitted in the reverse
24882 2001-11-24 Miguel de Icaza <miguel@ximian.com>
24884 * expression.cs (ArrayCreation): Implement the bits that Ravi left
24885 unfinished. They do not work, because the underlying code is
24888 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24890 * cs-parser.jay: Remove bogus fixme.
24892 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
24893 on Switch statement.
24895 2001-11-23 Ravi Pratap <ravi@ximian.com>
24897 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
24900 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
24901 parameter. Apparently, any expression is allowed.
24903 (ValidateInitializers): Update accordingly.
24905 (CheckIndices): Fix some tricky bugs thanks to recursion.
24907 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
24908 I was being completely brain-dead.
24910 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
24911 and re-write acordingly.
24913 (DelegateInvocation): Re-write accordingly.
24915 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
24917 (MakeByteBlob): Handle types more correctly.
24919 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
24920 initialization from expressions but it is incomplete because I am a complete
24923 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24925 * statement.cs (If.Emit): Fix a bug that generated incorrect code
24926 on If. Basically, we have to return `true' (ie, we do return to
24927 our caller) only if both branches of the if return.
24929 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
24930 short-circuit operators, handle them as short circuit operators.
24932 (Cast.DoResolve): Resolve type.
24933 (Cast.Cast): Take an expression as the target type.
24935 * cs-parser.jay (cast_expression): Remove old hack that only
24936 allowed a limited set of types to be handled. Now we take a
24937 unary_expression and we resolve to a type during semantic
24940 Use the grammar productions from Rhys to handle casts (this is
24941 not complete like Rhys syntax yet, we fail to handle that corner
24942 case that C# has regarding (-x), but we will get there.
24944 2001-11-22 Ravi Pratap <ravi@ximian.com>
24946 * class.cs (EmitFieldInitializer): Take care of the case when we have a
24947 field which is an array type.
24949 * cs-parser.jay (declare_local_variables): Support array initialization too.
24951 * typemanager.cs (MakeKey): Implement.
24953 (everywhere): Use the above appropriately.
24955 * cs-parser.jay (for_statement): Update for array initialization while
24956 declaring variables.
24958 * ecore.cs : The error message was correct, it's the variable's names that
24959 were misleading ;-) Make the code more readable.
24961 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
24962 the correct type etc.
24964 (ConvertExplicit): Handle Enum types by examining the underlying type.
24966 2001-11-21 Ravi Pratap <ravi@ximian.com>
24968 * parameter.cs (GetCallingConvention): Always return
24969 CallingConventions.Standard for now.
24971 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24973 * expression.cs (Binary.ResolveOperator): Update the values of `l'
24974 and `r' after calling DoNumericPromotions.
24976 * ecore.cs: Fix error message (the types were in the wrong order).
24978 * statement.cs (Foreach.ProbeCollectionType): Need to pass
24979 BindingFlags.Instance as well
24981 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
24982 implicit int literal conversion in an empty cast so that we
24983 propagate the right type upstream.
24985 (UnboxCast): new class used to unbox value types.
24986 (Expression.ConvertExplicit): Add explicit type conversions done
24989 (Expression.ImplicitNumericConversion): Oops, forgot to test for
24990 the target type before applying the implicit LongLiterals to ULong
24993 2001-11-21 Miguel de Icaza <miguel@ximian.com>
24995 * cs-parser.jay (for_statement): Reworked the way For works: now
24996 we declare manually any variables that are introduced in
24997 for_initializer to solve the problem of having out-of-band code
24998 emition (that is what got for broken).
25000 (declaration_statement): Perform the actual variable declaration
25001 that used to be done in local_variable_declaration here.
25003 (local_variable_declaration): Do not declare anything, just pass
25004 the information on a DictionaryEntry
25006 2001-11-20 Ravi Pratap <ravi@ximian.com>
25008 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
25009 re-write of the logic to now make it recursive.
25011 (UpdateIndices): Re-write accordingly.
25013 Store element data in a separate ArrayData list in the above methods.
25015 (MakeByteBlob): Implement to dump the array data into a byte array.
25017 2001-11-19 Ravi Pratap <ravi@ximian.com>
25019 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
25022 * constant.cs (Define): Implement.
25024 (EmitConstant): Re-write fully.
25026 Pass in location info.
25028 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
25031 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
25032 DictionaryEntry since we need location info too.
25034 (constant_declaration): Update accordingly.
25036 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
25037 code into another method : UpdateIndices.
25039 2001-11-18 Ravi Pratap <ravi@ximian.com>
25041 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
25042 some type checking etc.
25044 2001-11-17 Ravi Pratap <ravi@ximian.com>
25046 * expression.cs (ArrayCreation::ValidateInitializers): Implement
25047 bits to provide dimension info if the user skips doing that.
25049 Update second constructor to store the rank correctly.
25051 2001-11-16 Ravi Pratap <ravi@ximian.com>
25053 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
25054 and try to implement.
25056 * ../errors/cs0150.cs : Add.
25058 * ../errors/cs0178.cs : Add.
25060 2001-11-16 Miguel de Icaza <miguel@ximian.com>
25062 * statement.cs: Implement foreach on multi-dimensional arrays.
25064 * parameter.cs (Parameters.GetParameterByName): Also lookup the
25065 name of the params argument.
25067 * expression.cs: Use EmitStoreOpcode to get the right opcode while
25068 initializing the array.
25070 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
25071 we can use this elsewhere.
25073 * statement.cs: Finish implementation of foreach for single
25076 * cs-parser.jay: Use an out-of-band stack to pass information
25077 around, I wonder why I need this.
25079 foreach_block: Make the new foreach_block the current_block.
25081 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
25082 function used to return a static Parameters structure. Used for
25083 empty parameters, as those are created very frequently.
25085 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
25087 2001-11-15 Ravi Pratap <ravi@ximian.com>
25089 * interface.cs : Default modifier is private, not public. The
25090 make verify test passes again.
25092 2001-11-15 Ravi Pratap <ravi@ximian.com>
25094 * support.cs (ReflectionParameters): Fix logic to determine
25095 whether the last parameter is a params one. Test 9 passes again.
25097 * delegate.cs (Populate): Register the builders we define with
25098 RegisterParameterForBuilder. Test 19 passes again.
25100 * cs-parser.jay (property_declaration): Reference $6 instead
25101 of $$ to get at the location.
25103 (indexer_declaration): Similar stuff.
25105 (attribute): Ditto.
25107 * class.cs (Property): Register parameters for the Get and Set methods
25108 if they exist. Test 23 passes again.
25110 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
25111 call to EmitArguments as we are sure there aren't any params arguments.
25112 Test 32 passes again.
25114 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
25115 IndexOutOfRangeException.
25117 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
25118 Test 33 now passes again.
25120 2001-11-15 Miguel de Icaza <miguel@ximian.com>
25122 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
25123 broke a bunch of things. Will have to come up with a better way
25124 of tracking locations.
25126 * statement.cs: Implemented foreach for single dimension arrays.
25128 2001-11-09 Miguel de Icaza <miguel@ximian.com>
25130 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
25131 an error. This removes the lookup from the critical path.
25133 * cs-parser.jay: Removed use of temporary_loc, which is completely
25136 2001-11-14 Miguel de Icaza <miguel@ximian.com>
25138 * support.cs (ReflectionParameters.ParameterModifier): Report
25139 whether the argument is a PARAMS argument or not.
25141 * class.cs: Set the attribute `ParamArrayAttribute' on the
25142 parameter argument.
25144 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
25145 and cons_param_array_attribute (ConstructorInfo for
25146 ParamArrayAttribute).,
25148 * codegen.cs: Emit the return using the `Return' statement, that
25149 way we can report the error correctly for missing return values.
25151 * class.cs (Method.Emit): Clean up.
25153 * expression.cs (Argument.Resolve): Take another argument: the
25154 location where this argument is used. Notice that this is not
25155 part of the "Argument" class as to reduce the size of the
25156 structure (we know the approximate location anyways).
25158 Test if the argument is a variable-reference, if not, then
25159 complain with a 206.
25161 (Argument.Emit): Emit addresses of variables.
25163 (Argument.FullDesc): Simplify.
25165 (Invocation.DoResolve): Update for Argument.Resolve.
25167 (ElementAccess.DoResolve): ditto.
25169 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
25170 method should be virtual, as this method is always virtual.
25172 (NewDelegate.DoResolve): Update for Argument.Resolve.
25174 * class.cs (ConstructorInitializer.DoResolve): ditto.
25176 * attribute.cs (Attribute.Resolve): ditto.
25178 2001-11-13 Miguel de Icaza <miguel@ximian.com>
25180 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
25182 * expression.cs (ParameterReference): Drop IStackStorage and implement
25183 IAssignMethod instead.
25185 (LocalVariableReference): ditto.
25187 * ecore.cs (FieldExpr): Drop IStackStorage and implement
25188 IAssignMethod instead.
25190 2001-11-13 Miguel de Icaza <miguel@ximian.com>
25192 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
25193 enumerations that are used in heavily used structures derive from
25194 byte in a laughable and pathetic attempt to reduce memory usage.
25195 This is the kind of pre-optimzations that you should not do at
25196 home without adult supervision.
25198 * expression.cs (UnaryMutator): New class, used to handle ++ and
25199 -- separatedly from the other unary operators. Cleans up the
25200 code, and kills the ExpressionStatement dependency in Unary.
25202 (Unary): Removed `method' and `Arguments' from this class, making
25203 it smaller, and moving it all to SimpleCall, so I can reuse this
25204 code in other locations and avoid creating a lot of transient data
25205 strucutres when not required.
25207 * cs-parser.jay: Adjust for new changes.
25209 2001-11-11 Miguel de Icaza <miguel@ximian.com>
25211 * enum.cs (Enum.Populate): If there is a failure during
25214 * cs-parser.jay (opt_enum_base): we used to catch type errors
25215 here, but this is really incorrect. The type error should be
25216 catched during semantic analysis.
25218 2001-12-11 Ravi Pratap <ravi@ximian.com>
25220 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
25221 current_local_parameters as expected since I, in my stupidity, had forgotten
25224 * attribute.cs (GetValidPlaces): Fix stupid bug.
25226 * class.cs (Method::Emit): Perform check on applicability of attributes.
25228 (Constructor::Emit): Ditto.
25230 (Field::Emit): Ditto.
25232 (Field.Location): Store location information.
25234 (Property, Event, Indexer, Operator): Ditto.
25236 * cs-parser.jay (field_declaration): Pass in location for each field.
25238 * ../errors/cs0592.cs : Add.
25240 2001-11-12 Ravi Pratap <ravi@ximian.com>
25242 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
25244 (InitCoreTypes): Update accordingly.
25246 (RegisterAttrType, LookupAttr): Implement.
25248 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
25249 info about the same.
25251 (Resolve): Update to populate the above as necessary.
25253 (Error592): Helper.
25255 (GetValidPlaces): Helper to the above.
25257 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
25259 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
25261 2001-11-12 Ravi Pratap <ravi@ximian.com>
25263 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
25265 * ../errors/cs0617.cs : Add.
25267 2001-11-11 Ravi Pratap <ravi@ximian.com>
25269 * enum.cs (Emit): Rename to Populate to be more consistent with what
25270 we expect it to do and when exactly it is called.
25272 * class.cs, rootcontext.cs : Update accordingly.
25274 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
25275 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
25277 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
25279 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
25280 of a fieldinfo using the above, when dealing with a FieldBuilder.
25282 2001-11-10 Ravi Pratap <ravi@ximian.com>
25284 * ../errors/cs0031.cs : Add.
25286 * ../errors/cs1008.cs : Add.
25288 * ../errrors/cs0543.cs : Add.
25290 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
25293 (FindMembers): Implement.
25295 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
25296 enums and delegates too.
25298 (enum_types): Rename to builder_to_enum.
25300 (delegate_types): Rename to builder_to_delegate.
25302 * delegate.cs (FindMembers): Implement.
25304 2001-11-09 Ravi Pratap <ravi@ximian.com>
25306 * typemanager.cs (IsEnumType): Implement.
25308 * enum.cs (Emit): Re-write parts to account for the underlying type
25309 better and perform checking etc.
25311 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
25312 of the underlying type.
25314 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
25317 * enum.cs (error31): Helper to report error #31.
25319 * cs-parser.jay (enum_declaration): Store location of each member too.
25321 * enum.cs (member_to_location): New hashtable.
25323 (AddEnumMember): Update location hashtable.
25325 (Emit): Use the location of each member while reporting errors.
25327 2001-11-09 Miguel de Icaza <miguel@ximian.com>
25329 * cs-parser.jay: A for_initializer if is a
25330 local_variable_declaration really ammount to have an implicit
25331 block with the variable declaration and no initializer for for.
25333 * statement.cs (For.Emit): Cope with null initializers.
25335 This fixes the infinite loop on for initializers.
25337 2001-11-08 Miguel de Icaza <miguel@ximian.com>
25339 * enum.cs: More cleanup.
25341 * ecore.cs: Remove dead code.
25343 * class.cs (Property.Emit): More simplification.
25344 (Event.Emit): ditto.
25346 Reworked to have less levels of indentation.
25348 2001-11-08 Ravi Pratap <ravi@ximian.com>
25350 * class.cs (Property): Emit attributes.
25360 * enum.cs (Emit): Ditto.
25362 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
25365 * class.cs (Field, Event, etc.): Move attribute generation into the
25366 Emit method everywhere.
25368 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
25369 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
25370 as we had no way of defining nested enums !
25372 * rootcontext.cs : Adjust code accordingly.
25374 * typemanager.cs (AddEnumType): To keep track of enum types separately.
25376 2001-11-07 Ravi Pratap <ravi@ximian.com>
25378 * expression.cs (EvalConstantExpression): Move into ecore.cs
25380 * enum.cs (Enum): Rename some members and make them public and readonly
25381 according to our convention.
25383 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
25386 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
25388 (Enum::Emit): Write a simple version for now which doesn't try to compute
25389 expressions. I shall modify this to be more robust in just a while.
25391 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
25393 (TypeContainer::CloseType): Create the Enum types too.
25395 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
25397 * expression.cs (EvalConstantExpression): Get rid of completely.
25399 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
25400 user-defined values and other cases.
25402 (IsValidEnumLiteral): Helper function.
25404 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
25405 out there in the case we had a literal FieldExpr.
25407 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
25409 (Literalize): Revamp a bit to take two arguments.
25411 (EnumLiteral): New class which derives from Literal to wrap enum literals.
25413 2001-11-06 Ravi Pratap <ravi@ximian.com>
25415 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
25417 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
25419 (Resolve): Use the above to ensure we have proper initializers.
25421 2001-11-05 Ravi Pratap <ravi@ximian.com>
25423 * expression.cs (Expression::EvalConstantExpression): New method to
25424 evaluate constant expressions.
25426 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
25428 2001-11-07 Miguel de Icaza <miguel@ximian.com>
25430 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
25433 (Binary.ResolveOperator): Handle operator != (object a, object b)
25434 and operator == (object a, object b);
25436 (Binary.DoNumericPromotions): Indicate whether the numeric
25437 promotion was possible.
25439 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
25442 Made the ArrayAccess implement interface IAssignMethod instead of
25443 IStackStore as the order in which arguments are passed reflects
25446 * assign.cs: Instead of using expr.ExprClass to select the way of
25447 assinging, probe for the IStackStore/IAssignMethod interfaces.
25449 * typemanager.cs: Load InitializeArray definition.
25451 * rootcontext.cs (RootContext.MakeStaticData): Used to define
25452 static data that can be used to initialize arrays.
25454 2001-11-05 Miguel de Icaza <miguel@ximian.com>
25456 * expression.cs: Handle operator== and operator!= for booleans.
25458 (Conditioal.Reduce): Implement reducer for the ?: operator.
25460 (Conditional.Resolve): Implement dead code elimination.
25462 (Binary.Resolve): Catch string literals and return a new
25463 concatenated string.
25465 (Unary.Reduce): Implement reduction of unary expressions.
25467 * ecore.cs: Split out the expression core handling here.
25469 (Expression.Reduce): New method used to perform constant folding
25470 and CSE. This is needed to support constant-expressions.
25472 * statement.cs (Statement.EmitBoolExpression): Pass true and false
25473 targets, and optimize for !x.
25475 2001-11-04 Ravi Pratap <ravi@ximian.com>
25477 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
25478 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
25479 set custom atttributes.
25481 * literal.cs (Literal::GetValue): New abstract method to return the actual
25482 value of the literal, cast as an object.
25484 (*Literal): Implement GetValue method.
25486 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
25487 expressions to the arraylist but objects of type Argument.
25489 * class.cs (TypeContainer::Emit): Emit our attributes too.
25491 (Method::Emit, Constructor::Emit): Ditto.
25493 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
25494 to be ignoring earlier.
25496 2001-11-03 Ravi Pratap <ravi@ximian.com>
25498 * attribute.cs (AttributeSection::Define): Implement to do the business
25499 of constructing a CustomAttributeBuilder.
25501 (Attribute): New trivial class. Increases readability of code.
25503 * cs-parser.jay : Update accordingly.
25505 (positional_argument_list, named_argument_list, named_argument): New rules
25507 (attribute_arguments): Use the above so that we are more correct.
25509 2001-11-02 Ravi Pratap <ravi@ximian.com>
25511 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
25512 to perform all checks for a method with a params parameter.
25514 (Invocation::OverloadResolve): Update to use the above method and therefore
25515 cope correctly with params method invocations.
25517 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
25520 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
25521 constructors in our parent too because we can't afford to miss out on
25524 * attribute.cs (AttributeSection): New name for the class Attribute
25526 Other trivial changes to improve readability.
25528 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
25529 use the new class names.
25531 2001-11-01 Ravi Pratap <ravi@ximian.com>
25533 * class.cs (Method::Define): Complete definition for params types too
25535 (Indexer::Define): Ditto.
25537 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
25538 Cope everywhere with a request for info about the array parameter.
25540 2001-11-01 Ravi Pratap <ravi@ximian.com>
25542 * tree.cs (RecordNamespace): Fix up to check for the correct key.
25544 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
25545 local_variable_type to extract the string corresponding to the type.
25547 (local_variable_type): Fixup the action to use the new helper method.
25549 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
25552 * expression.cs : Clean out code which uses the above.
25554 2001-10-31 Ravi Pratap <ravi@ximian.com>
25556 * typemanager.cs (RegisterMethod): Check if we already have an existing key
25557 and bale out if necessary by returning a false.
25559 (RegisterProperty): Ditto.
25561 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
25562 and print out appropriate error messages.
25564 * interface.cs (everywhere): Ditto.
25566 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
25567 location to constructor.
25569 * class.cs (Property, Event, Indexer): Update accordingly.
25571 * ../errors/cs111.cs : Added.
25573 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
25574 of a method, as laid down by the spec.
25576 (Invocation::OverloadResolve): Use the above method.
25578 2001-10-31 Ravi Pratap <ravi@ximian.com>
25580 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
25581 now take a TypeContainer and a Parameters object.
25583 (ParameterData): Modify return type of ParameterModifier method to be
25584 Parameter.Modifier and not a string.
25586 (ReflectionParameters, InternalParameters): Update accordingly.
25588 * expression.cs (Argument::GetParameterModifier): Same here.
25590 * support.cs (InternalParameters::ParameterType): Find a better way of determining
25591 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
25592 symbol in it at all so maybe this is only for now.
25594 2001-10-30 Ravi Pratap <ravi@ximian.com>
25596 * support.cs (InternalParameters): Constructor now takes an extra argument
25597 which is the actual Parameters class.
25599 (ParameterDesc): Update to provide info on ref/out modifiers.
25601 * class.cs (everywhere): Update call to InternalParameters to pass in
25602 the second argument too.
25604 * support.cs (ParameterData): Add ParameterModifier, which is a method
25605 to return the modifier info [ref/out etc]
25607 (InternalParameters, ReflectionParameters): Implement the above.
25609 * expression.cs (Argument::ParameterModifier): Similar function to return
25610 info about the argument's modifiers.
25612 (Invocation::OverloadResolve): Update to take into account matching modifiers
25615 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
25616 a new SetFormalParameters object which we pass to InternalParameters.
25618 2001-10-30 Ravi Pratap <ravi@ximian.com>
25620 * expression.cs (NewArray): Merge into the ArrayCreation class.
25622 2001-10-29 Ravi Pratap <ravi@ximian.com>
25624 * expression.cs (NewArray): Merge classes NewBuiltinArray and
25625 NewUserdefinedArray into one as there wasn't much of a use in having
25628 * expression.cs (Argument): Change field's name to ArgType from Type.
25630 (Type): New readonly property which returns the proper type, taking into
25631 account ref/out modifiers.
25633 (everywhere): Adjust code accordingly for the above.
25635 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
25636 whether we are emitting for a ref or out parameter.
25638 * expression.cs (Argument::Emit): Use the above field to set the state.
25640 (LocalVariableReference::Emit): Update to honour the flag and emit the
25643 * parameter.cs (Attributes): Set the correct flags for ref parameters.
25645 * expression.cs (Argument::FullDesc): New function to provide a full desc.
25647 * support.cs (ParameterData): Add method ParameterDesc to the interface.
25649 (ReflectionParameters, InternalParameters): Implement the above method.
25651 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
25654 (Invocation::FullMethodDesc): Ditto.
25656 2001-10-29 Miguel de Icaza <miguel@ximian.com>
25658 * cs-parser.jay: Add extra production for the second form of array
25661 * expression.cs (ArrayCreation): Update to reflect the above
25664 * Small changes to prepare for Array initialization.
25666 2001-10-28 Miguel de Icaza <miguel@ximian.com>
25668 * typemanager.cs (ImplementsInterface): interface might be null;
25669 Deal with this problem;
25671 Also, we do store negative hits on the cache (null values), so use
25672 this instead of calling t.GetInterfaces on the type everytime.
25674 2001-10-28 Ravi Pratap <ravi@ximian.com>
25676 * typemanager.cs (IsBuiltinType): New method to help determine the same.
25678 * expression.cs (New::DoResolve): Get rid of array creation code and instead
25679 split functionality out into different classes.
25681 (New::FormArrayType): Move into NewBuiltinArray.
25683 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
25686 (NewBuiltinArray): New class to handle creation of built-in arrays.
25688 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
25689 account creation of one-dimensional arrays.
25691 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
25693 (NewUserdefinedArray::DoResolve): Implement.
25695 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
25697 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
25698 we maintain inside the TypeManager. This is necessary to perform lookups on the
25701 (LookupType): Update to perform GetType on the module builders too.
25703 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
25705 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
25707 2001-10-23 Ravi Pratap <ravi@ximian.com>
25709 * expression.cs (New::DoResolve): Implement guts of array creation.
25711 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
25713 2001-10-27 Miguel de Icaza <miguel@ximian.com>
25715 * expression.cs: Fix bug I introduced lsat night that broke
25718 (Expression.Resolve): Report a 246 error (can not resolve name)
25719 if we find a SimpleName in the stream.
25721 (Expression.ResolveLValue): Ditto.
25723 (Expression.ResolveWithSimpleName): This function is a variant of
25724 ResolveName, this one allows SimpleNames to be returned without a
25725 warning. The only consumer of SimpleNames is MemberAccess
25727 2001-10-26 Miguel de Icaza <miguel@ximian.com>
25729 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
25730 might arrive here. I have my doubts that this is correct.
25732 * statement.cs (Lock): Implement lock statement.
25734 * cs-parser.jay: Small fixes to support `lock' and `using'
25736 * cs-tokenizer.cs: Remove extra space
25738 * driver.cs: New flag --checked, allows to turn on integer math
25741 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
25742 Threading.Monitor.Exit
25744 2001-10-23 Miguel de Icaza <miguel@ximian.com>
25746 * expression.cs (IndexerAccess::DoResolveLValue): Set the
25747 Expression Class to be IndexerAccess.
25749 Notice that Indexer::DoResolve sets the eclass to Value.
25751 2001-10-22 Miguel de Icaza <miguel@ximian.com>
25753 * class.cs (TypeContainer::Emit): Emit code for indexers.
25755 * assign.cs (IAssignMethod): New interface implemented by Indexers
25756 and Properties for handling assignment.
25758 (Assign::Emit): Simplify and reuse code.
25760 * expression.cs (IndexerAccess, PropertyExpr): Implement
25761 IAssignMethod, clean up old code.
25763 2001-10-22 Ravi Pratap <ravi@ximian.com>
25765 * typemanager.cs (ImplementsInterface): New method to determine if a type
25766 implements a given interface. Provides a nice cache too.
25768 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
25771 (ConvertReferenceExplicit): Ditto.
25773 * delegate.cs (Delegate::Populate): Update to define the parameters on the
25774 various methods, with correct names etc.
25776 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
25777 Operator.UnaryNegation.
25779 * cs-parser.jay (operator_declarator): Be a little clever in the case where
25780 we have a unary plus or minus operator.
25782 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
25785 * everywhere : update accordingly.
25787 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
25790 * class.cs (Method::Define): For the case where we are implementing a method
25791 inherited from an interface, we need to set the MethodAttributes.Final flag too.
25792 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
25794 2001-10-21 Ravi Pratap <ravi@ximian.com>
25796 * interface.cs (FindMembers): Implement to work around S.R.E
25799 * typemanager.cs (IsInterfaceType): Implement.
25801 (FindMembers): Update to handle interface types too.
25803 * expression.cs (ImplicitReferenceConversion): Re-write bits which
25804 use IsAssignableFrom as that is not correct - it doesn't work.
25806 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
25807 and accordingly override EmitStatement.
25809 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
25810 using the correct logic :-)
25812 2001-10-19 Ravi Pratap <ravi@ximian.com>
25814 * ../errors/cs-11.cs : Add to demonstrate error -11
25816 2001-10-17 Miguel de Icaza <miguel@ximian.com>
25818 * assign.cs (Assign::Resolve): Resolve right hand side first, and
25819 then pass this as a hint to ResolveLValue.
25821 * expression.cs (FieldExpr): Add Location information
25823 (FieldExpr::LValueResolve): Report assignment to readonly
25826 (Expression::ExprClassFromMemberInfo): Pass location information.
25828 (Expression::ResolveLValue): Add new method that resolves an
25831 (Expression::DoResolveLValue): Default invocation calls
25834 (Indexers): New class used to keep track of indexers in a given
25837 (IStackStore): Renamed from LValue, as it did not really describe
25838 what this did. Also ResolveLValue is gone from this interface and
25839 now is part of Expression.
25841 (ElementAccess): Depending on the element access type
25843 * typemanager.cs: Add `indexer_name_type' as a Core type
25844 (System.Runtime.CompilerServices.IndexerNameAttribute)
25846 * statement.cs (Goto): Take a location.
25848 2001-10-18 Ravi Pratap <ravi@ximian.com>
25850 * delegate.cs (Delegate::VerifyDelegate): New method to verify
25851 if two delegates are compatible.
25853 (NewDelegate::DoResolve): Update to take care of the case when
25854 we instantiate a delegate from another delegate.
25856 * typemanager.cs (FindMembers): Don't even try to look up members
25857 of Delegate types for now.
25859 2001-10-18 Ravi Pratap <ravi@ximian.com>
25861 * delegate.cs (NewDelegate): New class to take care of delegate
25864 * expression.cs (New): Split the delegate related code out into
25865 the NewDelegate class.
25867 * delegate.cs (DelegateInvocation): New class to handle delegate
25870 * expression.cs (Invocation): Split out delegate related code into
25871 the DelegateInvocation class.
25873 2001-10-17 Ravi Pratap <ravi@ximian.com>
25875 * expression.cs (New::DoResolve): Implement delegate creation fully
25876 and according to the spec.
25878 (New::DoEmit): Update to handle delegates differently.
25880 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
25881 because of which we were printing out arguments in reverse order !
25883 * delegate.cs (VerifyMethod): Implement to check if the given method
25884 matches the delegate.
25886 (FullDelegateDesc): Implement.
25888 (VerifyApplicability): Implement.
25890 * expression.cs (Invocation::DoResolve): Update to accordingly handle
25891 delegate invocations too.
25893 (Invocation::Emit): Ditto.
25895 * ../errors/cs1593.cs : Added.
25897 * ../errors/cs1594.cs : Added.
25899 * delegate.cs (InstanceExpression, TargetMethod): New properties.
25901 2001-10-16 Ravi Pratap <ravi@ximian.com>
25903 * typemanager.cs (intptr_type): Core type for System.IntPtr
25905 (InitCoreTypes): Update for the same.
25907 (iasyncresult_type, asynccallback_type): Ditto.
25909 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
25912 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
25915 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
25916 the builders for the 4 members of a delegate type :-)
25918 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
25921 * expression.cs (New::DoResolve): Implement guts for delegate creation.
25923 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
25925 2001-10-15 Miguel de Icaza <miguel@ximian.com>
25927 * statement.cs (Break::Emit): Implement.
25928 (Continue::Emit): Implement.
25930 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
25931 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
25932 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
25933 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
25936 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
25937 properties that track the label for the current loop (begin of the
25938 loop and end of the loop).
25940 2001-10-15 Ravi Pratap <ravi@ximian.com>
25942 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
25943 use of emitting anything at all.
25945 * class.cs, rootcontext.cs : Get rid of calls to the same.
25947 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
25949 (Populate): Define the constructor correctly and set the implementation
25952 * typemanager.cs (delegate_types): New hashtable to hold delegates that
25955 (AddDelegateType): Implement.
25957 (IsDelegateType): Implement helper method.
25959 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
25961 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
25962 and accordingly handle it.
25964 * delegate.cs (Populate): Take TypeContainer argument.
25965 Implement bits to define the Invoke method. However, I still haven't figured out
25966 how to take care of the native int bit :-(
25968 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
25969 Qualify the name of the delegate, not its return type !
25971 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
25974 (StandardConversionExists): Checking for array types turns out to be recursive.
25976 (ConvertReferenceExplicit): Implement array conversion.
25978 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
25980 2001-10-12 Ravi Pratap <ravi@ximian.com>
25982 * cs-parser.jay (delegate_declaration): Store the fully qualified
25983 name as it is a type declaration.
25985 * delegate.cs (ReturnType, Name): Rename members to these. Make them
25988 (DefineDelegate): Renamed from Define. Does the same thing essentially,
25989 as TypeContainer::DefineType.
25991 (Populate): Method in which all the definition of the various methods (Invoke)
25994 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
25997 (CloseDelegate): Finally creates the delegate.
25999 * class.cs (TypeContainer::DefineType): Update to define delegates.
26000 (Populate, Emit and CloseType): Do the same thing here too.
26002 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
26003 delegates in all these operations.
26005 2001-10-14 Miguel de Icaza <miguel@ximian.com>
26007 * expression.cs: LocalTemporary: a new expression used to
26008 reference a temporary that has been created.
26010 * assign.cs: Handle PropertyAccess back here, so that we can
26011 provide the proper semantic access to properties.
26013 * expression.cs (Expression::ConvertReferenceExplicit): Implement
26014 a few more explicit conversions.
26016 * modifiers.cs: `NEW' modifier maps to HideBySig.
26018 * expression.cs (PropertyExpr): Make this into an
26019 ExpressionStatement, and support the EmitStatement code path.
26021 Perform get/set error checking, clean up the interface.
26023 * assign.cs: recognize PropertyExprs as targets, and if so, turn
26024 them into toplevel access objects.
26026 2001-10-12 Miguel de Icaza <miguel@ximian.com>
26028 * expression.cs: PropertyExpr::PropertyExpr: use work around the
26031 * typemanager.cs: Keep track here of our PropertyBuilders again to
26032 work around lameness in SRE.
26034 2001-10-11 Miguel de Icaza <miguel@ximian.com>
26036 * expression.cs (LValue::LValueResolve): New method in the
26037 interface, used to perform a second resolution pass for LValues.
26039 (This::DoResolve): Catch the use of this in static methods.
26041 (This::LValueResolve): Implement.
26043 (This::Store): Remove warning, assigning to `this' in structures
26046 (Invocation::Emit): Deal with invocation of
26047 methods on value types. We need to pass the address to structure
26048 methods rather than the object itself. (The equivalent code to
26049 emit "this" for structures leaves the entire structure on the
26050 stack instead of a pointer to it).
26052 (ParameterReference::DoResolve): Compute the real index for the
26053 argument based on whether the method takes or not a `this' pointer
26054 (ie, the method is static).
26056 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
26057 value types returned from functions when we need to invoke a
26058 method on the sturcture.
26061 2001-10-11 Ravi Pratap <ravi@ximian.com>
26063 * class.cs (TypeContainer::DefineType): Method to actually do the business of
26064 defining the type in the Modulebuilder or Typebuilder. This is to take
26065 care of nested types which need to be defined on the TypeBuilder using
26066 DefineNestedMethod.
26068 (TypeContainer::GetClassBases): Implement. Essentially the code from the
26069 methods in RootContext, only ported to be part of TypeContainer.
26071 (TypeContainer::GetInterfaceOrClass): Ditto.
26073 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
26075 * interface.cs (Interface::DefineInterface): New method. Does exactly
26076 what RootContext.CreateInterface did earlier, only it takes care of nested types
26079 (Interface::GetInterfaces): Move from RootContext here and port.
26081 (Interface::GetInterfaceByName): Same here.
26083 * rootcontext.cs (ResolveTree): Re-write.
26085 (PopulateTypes): Re-write.
26087 * class.cs (TypeContainer::Populate): Populate nested types too.
26088 (TypeContainer::Emit): Emit nested members too.
26090 * typemanager.cs (AddUserType): Do not make use of the FullName property,
26091 instead just use the name argument passed in as it is already fully
26094 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
26095 to TypeContainer mapping to see if a type is user-defined.
26097 * class.cs (TypeContainer::CloseType): Implement.
26099 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
26100 the default constructor.
26102 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
26105 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
26107 * interface.cs (CloseType): Create the type here.
26109 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
26112 Remove all the methods which are now in TypeContainer.
26114 2001-10-10 Ravi Pratap <ravi@ximian.com>
26116 * delegate.cs (Define): Re-write bits to define the delegate
26119 2001-10-10 Miguel de Icaza <miguel@ximian.com>
26121 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
26123 * expression.cs (ImplicitReferenceConversion): handle null as well
26124 as a source to convert to any reference type.
26126 * statement.cs (Return): Perform any implicit conversions to
26127 expected return type.
26129 Validate use of return statement.
26131 * codegen.cs (EmitContext): Pass the expected return type here.
26133 * class.cs (Method, Constructor, Property): Pass expected return
26134 type to EmitContext.
26136 2001-10-09 Miguel de Icaza <miguel@ximian.com>
26138 * expression.cs: Make DoResolve take an EmitContext instead of a
26141 Replaced `l' and `location' for `loc', for consistency.
26143 (Error, Warning): Remove unneeded Tc argument.
26145 * assign.cs, literal.cs, constant.cs: Update to new calling
26148 * codegen.cs: EmitContext now contains a flag indicating whether
26149 code is being generated in a static method or not.
26151 * cs-parser.jay: DecomposeQI, new function that replaces the old
26152 QualifiedIdentifier. Now we always decompose the assembled
26153 strings from qualified_identifier productions into a group of
26156 2001-10-08 Miguel de Icaza <miguel@ximian.com>
26158 * rootcontext.cs: Deal with field-less struct types correctly now
26159 by passing the size option to Define Type.
26161 * class.cs: Removed hack that created one static field.
26163 2001-10-07 Miguel de Icaza <miguel@ximian.com>
26165 * statement.cs: Moved most of the code generation here.
26167 2001-10-09 Ravi Pratap <ravi@ximian.com>
26169 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
26172 (ElementAccess): Remove useless bits for now - keep checks as the spec
26175 2001-10-08 Ravi Pratap <ravi@ximian.com>
26177 * expression.cs (ElementAccess::DoResolve): Remove my crap code
26178 and start performing checks according to the spec.
26180 2001-10-07 Ravi Pratap <ravi@ximian.com>
26182 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
26183 rank_specifiers instead.
26185 (rank_specifiers): Change the order in which the rank specifiers are stored
26187 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
26189 * expression.cs (ElementAccess): Implement the LValue interface too.
26191 2001-10-06 Ravi Pratap <ravi@ximian.com>
26193 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
26194 except that user defined conversions are not included.
26196 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
26197 perform the conversion of the return type, if necessary.
26199 (New::DoResolve): Check whether we are creating an array or an object
26200 and accordingly do the needful.
26202 (New::Emit): Same here.
26204 (New::DoResolve): Implement guts of array creation.
26206 (New::FormLookupType): Helper function.
26208 2001-10-07 Miguel de Icaza <miguel@ximian.com>
26210 * codegen.cs: Removed most of the code generation here, and move the
26211 corresponding code generation bits to the statement classes.
26213 Added support for try/catch/finalize and throw.
26215 * cs-parser.jay: Added support for try/catch/finalize.
26217 * class.cs: Catch static methods having the flags override,
26218 virtual or abstract.
26220 * expression.cs (UserCast): This user cast was not really doing
26221 what it was supposed to do. Which is to be born in fully resolved
26222 state. Parts of the resolution were being performed at Emit time!
26226 2001-10-05 Miguel de Icaza <miguel@ximian.com>
26228 * expression.cs: Implicity convert the result from UserCast.
26230 2001-10-05 Ravi Pratap <ravi@ximian.com>
26232 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
26233 prevented it from working correctly.
26235 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
26236 merely ConvertImplicit.
26238 2001-10-05 Miguel de Icaza <miguel@ximian.com>
26240 * typemanager.cs: Make the LookupTypeContainer function static,
26241 and not per-instance.
26243 * class.cs: Make static FindMembers (the one that takes a Type
26246 * codegen.cs: Add EmitForeach here.
26248 * cs-parser.jay: Make foreach a toplevel object instead of the
26249 inline expansion, as we need to perform semantic analysis on it.
26251 2001-10-05 Ravi Pratap <ravi@ximian.com>
26253 * expression.cs (Expression::ImplicitUserConversion): Rename to
26254 UserDefinedConversion.
26256 (Expression::UserDefinedConversion): Take an extra argument specifying
26257 whether we look for explicit user conversions too.
26259 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
26261 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
26263 (ExplicitUserConversion): Make it a call to UserDefinedConversion
26264 with the appropriate arguments.
26266 * cs-parser.jay (cast_expression): Record location too.
26268 * expression.cs (Cast): Record location info.
26270 (Expression::ConvertExplicit): Take location argument.
26272 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
26273 to determine if we are doing explicit conversions.
26275 (UserCast::Emit): Update accordingly.
26277 (Expression::ConvertExplicit): Report an error if everything fails.
26279 * ../errors/cs0030.cs : Add.
26281 2001-10-04 Miguel de Icaza <miguel@ximian.com>
26283 * modifiers.cs: If the ABSTRACT keyword is present, also set the
26284 virtual and newslot bits.
26286 * class.cs (TypeContainer::RegisterRequiredImplementations):
26287 Record methods we need.
26289 (TypeContainer::MakeKey): Helper function to make keys for
26290 MethodBases, since the Methodbase key is useless.
26292 (TypeContainer::Populate): Call RegisterRequiredImplementations
26293 before defining the methods.
26295 Create a mapping for method_builders_to_methods ahead of time
26296 instead of inside a tight loop.
26298 (::RequireMethods): Accept an object as the data to set into the
26299 hashtable so we can report interface vs abstract method mismatch.
26301 2001-10-03 Miguel de Icaza <miguel@ximian.com>
26303 * report.cs: Make all of it static.
26305 * rootcontext.cs: Drop object_type and value_type computations, as
26306 we have those in the TypeManager anyways.
26308 Drop report instance variable too, now it is a global.
26310 * driver.cs: Use try/catch on command line handling.
26312 Add --probe option to debug the error reporting system with a test
26315 * report.cs: Add support for exiting program when a probe
26316 condition is reached.
26318 2001-10-03 Ravi Pratap <ravi@ximian.com>
26320 * expression.cs (Binary::DoNumericPromotions): Fix the case when
26321 we do a forcible conversion regardless of type, to check if
26322 ForceConversion returns a null.
26324 (Binary::error19): Use location to report error.
26326 (Unary::error23): Use location here too.
26328 * ../errors/cs0019.cs : Check in.
26330 * ../errors/cs0023.cs : Check in.
26332 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
26333 case of a non-null MethodInfo object with a length of 0 !
26335 (Binary::ResolveOperator): Flag error if overload resolution fails to find
26336 an applicable member - according to the spec :-)
26337 Also fix logic to find members in base types.
26339 (Unary::ResolveOperator): Same here.
26341 (Unary::report23): Change name to error23 and make first argument a TypeContainer
26342 as I was getting thoroughly confused between this and error19 :-)
26344 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
26345 (::FindMostEncompassedType): Implement.
26346 (::FindMostEncompassingType): Implement.
26347 (::StandardConversionExists): Implement.
26349 (UserImplicitCast): Re-vamp. We now need info about most specific
26350 source and target types so that we can do the necessary conversions.
26352 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
26353 mathematical union with no duplicates.
26355 2001-10-03 Miguel de Icaza <miguel@ximian.com>
26357 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
26358 in order from base classes to child classes, so that we can in
26359 child classes look up in our parent for method names and
26360 attributes (required for handling abstract, virtual, new, override
26361 constructs: we need to instrospect our base class, and if we dont
26362 populate the classes in order, the introspection might be
26363 incorrect. For example, a method could query its parent before
26364 the parent has any methods and would determine that the parent has
26365 no abstract methods (while it could have had them)).
26367 (RootContext::CreateType): Record the order in which we define the
26370 2001-10-02 Miguel de Icaza <miguel@ximian.com>
26372 * class.cs (TypeContainer::Populate): Also method definitions can
26373 fail now, keep track of this.
26375 (TypeContainer::FindMembers): Implement support for
26376 DeclaredOnly/noDeclaredOnly flag.
26378 (Constructor::Emit) Return the ConstructorBuilder.
26380 (Method::Emit) Return the MethodBuilder.
26381 Check for abstract or virtual methods to be public.
26383 * rootcontext.cs (RootContext::CreateType): Register all the
26384 abstract methods required for the class to be complete and the
26385 interface methods that must be implemented.
26387 * cs-parser.jay: Report error 501 (method requires body if it is
26388 not marked abstract or extern).
26390 * expression.cs (TypeOf::Emit): Implement.
26392 * typemanager.cs: runtime_handle_type, new global type.
26394 * class.cs (Property::Emit): Generate code for properties.
26396 2001-10-02 Ravi Pratap <ravi@ximian.com>
26398 * expression.cs (Unary::ResolveOperator): Find operators on base type
26399 too - we now conform exactly to the spec.
26401 (Binary::ResolveOperator): Same here.
26403 * class.cs (Operator::Define): Fix minor quirk in the tests.
26405 * ../errors/cs0215.cs : Added.
26407 * ../errors/cs0556.cs : Added.
26409 * ../errors/cs0555.cs : Added.
26411 2001-10-01 Miguel de Icaza <miguel@ximian.com>
26413 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
26414 single integer which is really efficient
26416 2001-10-01 Ravi Pratap <ravi@ximian.com>
26418 * expression.cs (Expression::ImplicitUserConversion): Use location
26419 even in the case when we are examining True operators.
26421 * class.cs (Operator::Define): Perform extensive checks to conform
26422 with the rules for operator overloading in the spec.
26424 * expression.cs (Expression::ImplicitReferenceConversion): Implement
26425 some of the other conversions mentioned in the spec.
26427 * typemanager.cs (array_type): New static member for the System.Array built-in
26430 (cloneable_interface): For System.ICloneable interface.
26432 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
26433 we start resolving the tree and populating types.
26435 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
26437 2001-10-01 Miguel de Icaza <miguel@ximian.com>
26439 * expression.cs (Expression::ExprClassFromMemberInfo,
26440 Expression::Literalize): Create literal expressions from
26441 FieldInfos which are literals.
26443 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
26444 type casts, because they were wrong. The test suite in tests
26447 (ImplicitNumericConversion): ushort to ulong requires a widening
26450 Int32 constant to long requires widening cast as well.
26452 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
26453 for integers because the type on the stack is not i4.
26455 2001-09-30 Miguel de Icaza <miguel@ximian.com>
26457 * expression.cs (report118): require location argument.
26459 * parameter.cs: Do not dereference potential null value.
26461 * class.cs: Catch methods that lack the `new' keyword when
26462 overriding a name. Report warnings when `new' is used without
26463 anything being there to override.
26465 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
26467 * class.cs: Only add constructor to hashtable if it is non-null
26468 (as now constructors can fail on define).
26470 (TypeManager, Class, Struct): Take location arguments.
26472 Catch field instance initialization in structs as errors.
26474 accepting_filter: a new filter for FindMembers that is static so
26475 that we dont create an instance per invocation.
26477 (Constructor::Define): Catch errors where a struct constructor is
26480 * cs-parser.jay: Pass location information for various new
26483 * delegate.cs (Delegate): take a location argument.
26485 * driver.cs: Do not call EmitCode if there were problesm in the
26486 Definition of the types, as many Builders wont be there.
26488 * decl.cs (Decl::Decl): Require a location argument.
26490 * cs-tokenizer.cs: Handle properly hex constants that can not fit
26491 into integers, and find the most appropiate integer for it.
26493 * literal.cs: Implement ULongLiteral.
26495 * rootcontext.cs: Provide better information about the location of
26496 failure when CreateType fails.
26498 2001-09-29 Miguel de Icaza <miguel@ximian.com>
26500 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
26503 * expression.cs (Binary::CheckShiftArguments): Add missing type
26505 (Binary::ResolveOperator): Add type to the logical and and logical
26506 or, Bitwise And/Or and Exclusive Or code paths, it was missing
26509 (Binary::DoNumericPromotions): In the case where either argument
26510 is ulong (and most signed types combined with ulong cause an
26511 error) perform implicit integer constant conversions as well.
26513 2001-09-28 Miguel de Icaza <miguel@ximian.com>
26515 * expression.cs (UserImplicitCast): Method should always be
26517 (Invocation::BetterConversion): Simplified test for IntLiteral.
26519 (Expression::ImplicitNumericConversion): Split this routine out.
26520 Put the code that performs implicit constant integer conversions
26523 (Expression::Resolve): Become a wrapper around DoResolve so we can
26524 check eclass and type being set after resolve.
26526 (Invocation::Badness): Remove this dead function
26528 (Binary::ResolveOperator): Do not compute the expensive argumnets
26529 unless we have a union for it.
26531 (Probe::Emit): Is needs to do an isinst and then
26532 compare against null.
26534 (::CanConvert): Added Location argument. If the Location argument
26535 is null (Location.Null), then we do not report errors. This is
26536 used by the `probe' mechanism of the Explicit conversion. We do
26537 not want to generate an error for something that the user
26538 explicitly requested to be casted. But the pipeline for an
26539 explicit cast first tests for potential implicit casts.
26541 So for now, if the Location is null, it means `Probe only' to
26542 avoid adding another argument. Might have to revise this
26545 (ClassCast): New class used to type cast objects into arbitrary
26546 classes (used in Explicit Reference Conversions).
26548 Implement `as' as well.
26550 Reverted all the patches from Ravi below: they were broken:
26552 * The use of `level' as a mechanism to stop recursive
26553 invocations is wrong. That was there just to catch the
26554 bug with a strack trace but not as a way of addressing
26557 To fix the problem we have to *understand* what is going
26558 on and the interactions and come up with a plan, not
26559 just get things going.
26561 * The use of the type conversion cache that I proposed
26562 last night had an open topic: How does this work across
26563 protection domains. A user defined conversion might not
26564 be public in the location where we are applying the
26565 conversion, a different conversion might be selected
26566 (ie, private A->B (better) but public B->A (worse),
26567 inside A, A->B applies, but outside it, B->A will
26570 * On top of that (ie, even if the above is solved),
26571 conversions in a cache need to be abstract. Ie, `To
26572 convert from an Int to a Short use an OpcodeCast', not
26573 `To convert from an Int to a Short use the OpcodeCast on
26574 the variable 5' (which is what this patch was doing).
26576 2001-09-28 Ravi Pratap <ravi@ximian.com>
26578 * expression.cs (Invocation::ConversionExists): Re-write to use
26579 the conversion cache
26581 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
26582 cache all conversions done, not just user-defined ones.
26584 (Invocation::BetterConversion): The real culprit. Use ConversionExists
26585 to determine if a conversion exists instead of acutually trying to
26586 perform the conversion. It's faster too.
26588 (Expression::ConvertExplicit): Modify to use ConversionExists to check
26589 and only then attempt the implicit conversion.
26591 2001-09-28 Ravi Pratap <ravi@ximian.com>
26593 * expression.cs (ConvertImplicit): Use a cache for conversions
26594 already found. Check level of recursion and bail out if necessary.
26596 2001-09-28 Miguel de Icaza <miguel@ximian.com>
26598 * typemanager.cs (string_concat_string_string, string_concat_object_object):
26599 Export standard methods that we expect for string operations.
26601 * statement.cs (Block::UsageWarning): Track usage of variables and
26602 report the errors for not used variables.
26604 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
26607 2001-09-27 Miguel de Icaza <miguel@ximian.com>
26609 * codegen.cs: remove unnneded code
26611 * expression.cs: Removed BuiltinTypeAccess class
26613 Fix the order in which implicit conversions are
26616 The previous fixed dropped support for boxed conversions (adding a
26617 test to the test suite now)
26619 (UserImplicitCast::CanConvert): Remove test for source being null,
26620 that code is broken. We should not feed a null to begin with, if
26621 we do, then we should track the bug where the problem originates
26622 and not try to cover it up here.
26624 Return a resolved expression of type UserImplicitCast on success
26625 rather than true/false. Ravi: this is what I was talking about,
26626 the pattern is to use a static method as a "constructor" for
26629 Also, do not create arguments until the very last minute,
26630 otherwise we always create the arguments even for lookups that
26631 will never be performed.
26633 (UserImplicitCast::Resolve): Eliminate, objects of type
26634 UserImplicitCast are born in a fully resolved state.
26636 * typemanager.cs (InitCoreTypes): Init also value_type
26637 (System.ValueType).
26639 * expression.cs (Cast::Resolve): First resolve the child expression.
26641 (LValue): Add new method AddressOf to be used by
26644 Change the argument of Store to take an EmitContext instead of an
26645 ILGenerator, because things like FieldExpr need to be able to call
26646 their children expression to generate the instance code.
26648 (Expression::Error, Expression::Warning): Sugar functions for
26651 (Expression::MemberLookup): Accept a TypeContainer instead of a
26652 Report as the first argument.
26654 (Expression::ResolvePrimary): Killed. I still want to improve
26655 this as currently the code is just not right.
26657 (Expression::ResolveMemberAccess): Simplify, but it is still
26660 (Unary::Resolve): Catch errors in AddressOf operators.
26662 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
26663 index to a byte for the short-version, or the compiler will choose
26664 the wrong Emit call, which generates the wrong data.
26666 (ParameterReference::Emit, ::Store): same.
26668 (FieldExpr::AddressOf): Implement.
26670 * typemanager.cs: TypeManager: made public variable instead of
26673 * driver.cs: document --fatal.
26675 * report.cs (ErrorMessage, WarningMessage): new names for the old
26676 Error and Warning classes.
26678 * cs-parser.jay (member_access): Turn built-in access to types
26679 into a normal simplename
26681 2001-09-27 Ravi Pratap <ravi@ximian.com>
26683 * expression.cs (Invocation::BetterConversion): Fix to cope
26684 with q being null, since this was introducing a bug.
26686 * expression.cs (ConvertImplicit): Do built-in conversions first.
26688 2001-09-27 Ravi Pratap <ravi@ximian.com>
26690 * expression.cs (UserImplicitCast::Resolve): Fix bug.
26692 2001-09-27 Ravi Pratap <ravi@ximian.com>
26694 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
26695 I had introduced long ago (what's new ?).
26697 * expression.cs (UserImplicitCast::CanConvert): Static method to do
26698 the work of all the checking.
26699 (ConvertImplicit): Call CanConvert and only then create object if necessary.
26700 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
26702 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
26703 that is the right way.
26705 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
26706 overloading resolution. Use everywhere instead of cutting and pasting code.
26708 (Binary::ResolveOperator): Use MakeUnionSet.
26710 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
26711 we have to convert to bool types. Not complete yet.
26713 2001-09-27 Miguel de Icaza <miguel@ximian.com>
26715 * typemanager.cs (TypeManager::CSharpName): support ushort.
26717 * expression.cs (Expression::TryImplicitIntConversion): Attempts
26718 to provide an expression that performsn an implicit constant int
26719 conversion (section 6.1.6).
26720 (Expression::ConvertImplicitRequired): Reworked to include
26721 implicit constant expression conversions.
26723 (Expression::ConvertNumericExplicit): Finished.
26725 (Invocation::Emit): If InstanceExpression is null, then it means
26726 that we perform a call on this.
26728 2001-09-26 Miguel de Icaza <miguel@ximian.com>
26730 * expression.cs (Unary::Emit): Remove some dead code.
26731 (Probe): Implement Resolve and Emit for `is'.
26732 (Expression::ConvertImplicitRequired): Attempt to do constant
26733 expression conversions here. Maybe should be moved to
26734 ConvertImplicit, but I am not sure.
26735 (Expression::ImplicitLongConstantConversionPossible,
26736 Expression::ImplicitIntConstantConversionPossible): New functions
26737 that tell whether is it possible to apply an implicit constant
26738 expression conversion.
26740 (ConvertNumericExplicit): Started work on explicit numeric
26743 * cs-parser.jay: Update operator constants.
26745 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
26746 (Parameters::GetSignature): Hook up VerifyArgs here.
26747 (Parameters::VerifyArgs): Verifies that no two arguments have the
26750 * class.cs (Operator): Update the operator names to reflect the
26751 ones that the spec expects (as we are just stringizing the
26754 * expression.cs (Unary::ResolveOperator): Fix bug: Use
26755 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
26756 previous usage did only work for our methods.
26757 (Expression::ConvertImplicit): Handle decimal implicit numeric
26758 conversions as well.
26759 (Expression::InternalTypeConstructor): Used to invoke constructors
26760 on internal types for default promotions.
26762 (Unary::Emit): Implement special handling for the pre/post
26763 increment/decrement for overloaded operators, as they need to have
26764 the same semantics as the other operators.
26766 (Binary::ResolveOperator): ditto.
26767 (Invocation::ConversionExists): ditto.
26768 (UserImplicitCast::Resolve): ditto.
26770 2001-09-26 Ravi Pratap <ravi@ximian.com>
26772 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
26773 operator, return after emitting body. Regression tests pass again !
26775 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
26776 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
26777 (Invocation::OverloadResolve): Ditto.
26778 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
26780 * everywhere : update calls to the above methods accordingly.
26782 2001-09-26 Miguel de Icaza <miguel@ximian.com>
26784 * assign.cs (Assign): Make it inherit from ExpressionStatement.
26786 * expression.cs (ExpressionStatement): New base class used for
26787 expressions that can appear in statements, so that we can provide
26788 an alternate path to generate expression that do not leave a value
26791 (Expression::Emit, and all the derivatives): We no longer return
26792 whether a value is left on the stack or not. Every expression
26793 after being emitted leaves a single value on the stack.
26795 * codegen.cs (EmitContext::EmitStatementExpression): Use the
26796 facilties of ExpressionStatement if possible.
26798 * cs-parser.jay: Update statement_expression.
26800 2001-09-25 Miguel de Icaza <miguel@ximian.com>
26802 * driver.cs: Change the wording of message
26804 2001-09-25 Ravi Pratap <ravi@ximian.com>
26806 * expression.cs (Binary::ResolveOperator): Had forgottten to set
26807 the type of the expression to the return type of the method if
26808 we have an overloaded operator match ! The regression tests pass again !
26809 (Unary::ResolveOperator): Ditto.
26811 * expression.cs (Invocation::ConversionExists): Correct the member lookup
26812 to find "op_Implicit", not "implicit" ;-)
26813 (UserImplicitCast): New class to take care of user-defined implicit conversions.
26814 (ConvertImplicit, ForceConversion): Take TypeContainer argument
26816 * everywhere : Correct calls to the above accordingly.
26818 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
26819 (ConvertImplicit): Do user-defined conversion if it exists.
26821 2001-09-24 Miguel de Icaza <miguel@ximian.com>
26823 * assign.cs: track location.
26824 (Resolve): Use implicit conversions on assignment.
26826 * literal.cs: Oops. Not good, Emit of short access values should
26827 pass (Bytes) or the wrong argument will be selected.
26829 * expression.cs (Unary::Emit): Emit code for -expr.
26831 (Unary::ResolveOperator): Handle `Substract' for non-constants
26832 (substract from zero from the non-constants).
26833 Deal with Doubles as well.
26835 (Expression::ConvertImplicitRequired): New routine that reports an
26836 error if no implicit conversion exists.
26838 (Invocation::OverloadResolve): Store the converted implicit
26839 expressions if we make them
26841 2001-09-24 Ravi Pratap <ravi@ximian.com>
26843 * class.cs (ConstructorInitializer): Take a Location argument.
26844 (ConstructorBaseInitializer): Same here.
26845 (ConstructorThisInitializer): Same here.
26847 * cs-parser.jay : Update all calls accordingly.
26849 * expression.cs (Unary, Binary, New): Take location argument.
26850 Update accordingly everywhere.
26852 * cs-parser.jay : Update all calls to the above to take a location
26855 * class.cs : Ditto.
26857 2001-09-24 Ravi Pratap <ravi@ximian.com>
26859 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
26860 (Invocation::BetterConversion): Same here
26861 (Invocation::ConversionExists): Ditto.
26863 (Invocation::ConversionExists): Implement.
26865 2001-09-22 Ravi Pratap <ravi@ximian.com>
26867 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
26868 Also take an additional TypeContainer argument.
26870 * All over : Pass in TypeContainer as argument to OverloadResolve.
26872 * typemanager.cs (CSharpName): Update to check for the string type and return
26875 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
26878 2001-09-21 Ravi Pratap <ravi@ximian.com>
26880 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
26881 (Invocation::BetterFunction): Implement.
26882 (Invocation::BetterConversion): Implement.
26883 (Invocation::ConversionExists): Skeleton, no implementation yet.
26885 Okay, things work fine !
26887 2001-09-21 Miguel de Icaza <miguel@ximian.com>
26889 * typemanager.cs: declare and load enum_type, delegate_type and
26892 * expression.cs (Expression::Emit): Now emit returns a value that
26893 tells whether a value is left on the stack or not. This strategy
26894 might be reveted tomorrow with a mechanism that would address
26895 multiple assignments.
26896 (Expression::report118): Utility routine to report mismatches on
26899 (Unary::Report23): Report impossible type/operator combination
26902 (Unary::IsIncrementableNumber): Whether the type can be
26903 incremented or decremented with add.
26904 (Unary::ResolveOperator): Also allow enumerations to be bitwise
26906 (Unary::ResolveOperator): Implement ++, !, ~,
26908 (Invocation::Emit): Deal with new Emit convetion.
26910 * All Expression derivatives: Updated their Emit method to return
26911 whether they leave values on the stack or not.
26913 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
26914 stack for expressions that are statements.
26916 2001-09-20 Miguel de Icaza <miguel@ximian.com>
26918 * expression.cs (LValue): New interface. Must be implemented by
26920 (LocalVariableReference, ParameterReference, FieldExpr): Implement
26923 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
26924 interface for generating code, simplifies the code.
26926 2001-09-20 Ravi Pratap <ravi@ximian.com>
26928 * expression.cs (everywhere): Comment out return statements in ::Resolve
26929 methods to avoid the warnings.
26931 2001-09-20 Miguel de Icaza <miguel@ximian.com>
26933 * driver.cs (parse): Report error 2001 if we can not open the
26936 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
26939 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
26942 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
26943 otherwise nested blocks end up with the same index.
26945 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
26947 * expression.cs: Instead of having FIXMEs in the Resolve
26948 functions, throw exceptions so it is obvious that we are facing a
26951 * cs-parser.jay (invocation_expression): Pass Location information.
26953 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
26954 Use a basename for those routines because .NET does not like paths
26957 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
26960 2001-09-19 Miguel de Icaza <miguel@ximian.com>
26962 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
26963 are loading the correct data types (throws an exception if not).
26964 (TypeManager::InitCoreTypes): Use CoreLookupType
26966 * expression.cs (Unary::ResolveOperator): return the child
26967 expression for expressions which are just +expr.
26968 (Unary::ResolveOperator): Return negative literals for -LITERAL
26969 expressions (otherwise they are Unary {Literal}).
26970 (Invocation::Badness): Take into account `Implicit constant
26971 expression conversions'.
26973 * literal.cs (LongLiteral): Implement long literal class.
26974 (IntLiteral): export the `Value' of the intliteral.
26976 2001-09-19 Ravi Pratap <ravi@ximian.com>
26978 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
26980 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
26981 instead of 'Operator'
26983 * expression.cs (Binary::ResolveOperator): Update accordingly.
26984 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
26987 * cs-parser.jay (unary_expression): Update to use the new names.
26989 * gen-treedump.cs (GetUnary): Same here.
26991 * expression.cs (Unary::Resolve): Implement.
26992 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
26993 operators are found instead of making noise ;-)
26994 (Unary::ResolveOperator): New method to do precisely the same thing which
26995 Binary::ResolveOperator does for Binary expressions.
26996 (Unary.method, .Arguments): Add.
26997 (Unary::OperName): Implement.
26998 (Unary::ForceConversion): Copy and Paste !
27000 * class.cs (Operator::Define): Fix a small bug for the case when we have
27003 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
27004 for the inbuilt operators. Only overloading works for now ;-)
27006 2001-09-18 Miguel de Icaza <miguel@ximian.com>
27008 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
27009 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
27011 * expression.cs (This::Emit): Implement.
27012 (This::Resolve): Implement.
27013 (TypeOf:Resolve): Implement.
27014 (Expression::ResolveSimpleName): Add an implicit this to instance
27016 (MemberAccess::Resolve): Deal with Parameters and Fields.
27017 Bind instance variable to Field expressions.
27018 (FieldExpr::Instance): New field used to track the expression that
27019 represents the object instance.
27020 (FieldExpr::Resolve): Track potential errors from MemberLookup not
27022 (FieldExpr::Emit): Implement.
27024 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
27025 the last instruction contains a return opcode to avoid generating
27026 the last `ret' instruction (this generates correct code, and it is
27027 nice to pass the peverify output).
27029 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
27030 initializer for static and instance variables.
27031 (Constructor::Emit): Allow initializer to be null in the case of
27032 static constructors. Only emit initializer for instance
27035 (TypeContainer::FindMembers): Return a null array if there are no
27038 Also fix the code for the MemberTypes.Method branch, as it was not
27039 scanning that for operators (or tried to access null variables before).
27041 * assign.cs (Assign::Emit): Handle instance and static fields.
27045 * driver.cs: Stop compilation if there are parse errors.
27047 * cs-parser.jay (constructor_declaration): Provide default base
27048 initializer for non-static constructors.
27049 (constructor_declarator): Do not provide a default base
27050 initializers if none was specified.
27051 Catch the fact that constructors should not have parameters.
27053 * class.cs: Do not emit parent class initializers for static
27054 constructors, that should be flagged as an error.
27056 2001-09-18 Ravi Pratap <ravi@ximian.com>
27058 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
27059 Move back code into TypeContainer::Populate.
27061 2001-09-18 Ravi Pratap <ravi@ximian.com>
27063 * class.cs (TypeContainer::AddConstructor): Fix the check to
27064 compare against Name, not Basename.
27065 (Operator::OpType): Change Plus and Minus to Add and Subtract.
27067 * cs-parser.jay : Update accordingly.
27069 * class.cs (TypeContainer::FindMembers): For the case where we are searching
27070 for methods, don't forget to look into the operators too.
27071 (RegisterMethodBuilder): Helper method to take care of this for
27072 methods, constructors and operators.
27073 (Operator::Define): Completely revamp.
27074 (Operator.OperatorMethod, MethodName): New fields.
27075 (TypeContainer::Populate): Move the registering of builders into
27076 RegisterMethodBuilder.
27077 (Operator::Emit): Re-write.
27079 * expression.cs (Binary::Emit): Comment out code path to emit method
27080 invocation stuff for the case when we have a user defined operator. I am
27081 just not able to get it right !
27083 2001-09-17 Miguel de Icaza <miguel@ximian.com>
27085 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
27088 (Expression::MemberLookup): Provide a version that allows to
27089 specify the MemberTypes and BindingFlags.
27091 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
27092 so it was not fetching variable information from outer blocks.
27094 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
27095 Beforefieldinit as it was buggy.
27097 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
27098 that Ravi put here.
27100 * class.cs (Constructor::Emit): Only emit if block is not null.
27101 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
27102 deal with this by semantically definining it as if the user had
27105 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
27106 constructors as we now "emit" them at a higher level.
27108 (TypeContainer::DefineDefaultConstructor): Used to define the
27109 default constructors if none was provided.
27111 (ConstructorInitializer): Add methods Resolve and Emit.
27113 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
27115 2001-09-17 Ravi Pratap <ravi@ximian.com>
27117 * class.cs (TypeContainer::EmitDefaultConstructor): Register
27118 the default constructor builder with our hashtable for methodbuilders
27121 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
27122 and argument_count is 0 in which case we have a match.
27123 (Binary::ResolveOperator): More null checking and miscellaneous coding
27126 2001-09-17 Ravi Pratap <ravi@ximian.com>
27128 * rootcontext.cs (IsNameSpace): Compare against null.
27130 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
27132 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
27133 and Unary::Operator.
27135 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
27138 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
27139 we have overloaded operators.
27140 (Binary::ResolveOperator): Implement the part which does the operator overload
27143 * class.cs (Operator::Emit): Implement.
27144 (TypeContainer::Emit): Emit the operators we have too.
27146 * expression.cs (Binary::Emit): Update to emit the appropriate code for
27147 the case when we have a user-defined operator.
27149 2001-09-17 Miguel de Icaza <miguel@ximian.com>
27151 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
27153 2001-09-16 Ravi Pratap <ravi@ximian.com>
27155 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
27156 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
27157 (Constructor::Emit): Implement.
27158 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
27159 if we have no work to do.
27160 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
27163 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
27164 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
27166 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
27169 2001-09-15 Ravi Pratap <ravi@ximian.com>
27171 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
27173 (Tree::RecordNamespace): Method to do what the name says ;-)
27174 (Tree::Namespaces): Property to get at the namespaces hashtable.
27176 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
27179 * rootcontext.cs (IsNamespace): Fixed it :-)
27181 2001-09-14 Miguel de Icaza <miguel@ximian.com>
27183 * class.cs (TypeContainer::FindMembers): Add support for
27185 (MethodCore): New class that encapsulates both the shared aspects
27186 of a Constructor and a Method.
27187 (Method, Constructor): Factored pieces into MethodCore.
27189 * driver.cs: Added --fatal which makes errors throw exceptions.
27190 Load System assembly as well as part of the standard library.
27192 * report.cs: Allow throwing exceptions on errors for debugging.
27194 * modifiers.cs: Do not use `parent', instead use the real type
27195 container to evaluate permission settings.
27197 * class.cs: Put Ravi's patch back in. He is right, and we will
27198 have to cope with the
27200 2001-09-14 Ravi Pratap <ravi@ximian.com>
27202 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
27203 FamORAssem, not FamANDAssem.
27205 2001-09-14 Miguel de Icaza <miguel@ximian.com>
27207 * driver.cs: Added --parse option that only parses its input files
27210 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
27211 incorrect. IsTopLevel is not used to tell whether an object is
27212 root_types or not (that can be achieved by testing this ==
27213 root_types). But to see if this is a top-level *class* (not
27214 necessarly our "toplevel" container).
27216 2001-09-14 Ravi Pratap <ravi@ximian.com>
27218 * enum.cs (Enum::Define): Modify to call the Lookup method on the
27219 parent instead of a direct call to GetType.
27221 2001-09-14 Ravi Pratap <ravi@ximian.com>
27223 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
27224 Modifiers.TypeAttr. This should just be a call to that method.
27226 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
27227 object so that we can determine if we are top-level or not.
27229 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
27232 * enum.cs (Enum::Define): Ditto.
27234 * modifiers.cs (FieldAttr): Re-write.
27236 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
27237 (TypeContainer::HaveStaticConstructor): New property to provide access
27238 to precisely that info.
27240 * modifiers.cs (MethodAttr): Re-write.
27241 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
27243 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
27244 of top-level types as claimed.
27246 2001-09-13 Miguel de Icaza <miguel@ximian.com>
27248 * expression.cs (MemberLookup): Fruitless attempt to lookup
27249 constructors. Maybe I need to emit default constructors? That
27250 might be it (currently .NET emits this for me automatically).
27251 (Invocation::OverloadResolve): Cope with Arguments == null.
27252 (Invocation::EmitArguments): new function, shared by the new
27253 constructor and us.
27254 (Invocation::Emit): Handle static and instance methods. Emit
27255 proper call instruction for virtual or non-virtual invocations.
27256 (New::Emit): Implement.
27257 (New::Resolve): Implement.
27258 (MemberAccess:Resolve): Implement.
27259 (MethodGroupExpr::InstanceExpression): used conforming to the spec
27260 to track instances.
27261 (FieldExpr::Resolve): Set type.
27263 * support.cs: Handle empty arguments.
27265 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
27266 SimpleLookup): Auxiliary routines to help parse a qualifier
27269 Update qualifier_identifier rule.
27271 * codegen.cs: Removed debugging messages.
27273 * class.cs: Make this a global thing, this acts just as a "key" to
27274 objects that we might have around.
27276 (Populate): Only initialize method_builders_to_methods once.
27278 * expression.cs (PropertyExpr): Initialize type from the
27281 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
27282 Resolve pattern. Attempt to implicitly convert value to boolean.
27285 * expression.cs: Set the type for the int32/int32 argument case.
27286 (Binary::ResolveOperator): Set the return type to boolean for
27287 comparission operators
27289 * typemanager.cs: Remove debugging print code.
27291 (Invocation::Resolve): resolve type.
27293 * class.cs: Allocate a MemberInfo of the correct size, as the code
27294 elsewhere depends on the test to reflect the correct contents.
27296 (Method::) Keep track of parameters, due to System.Reflection holes
27298 (TypeContainer::Populate): Keep track of MethodBuilders to Method
27301 (TypeContainer::FindMembers): Use ArrayList and then copy an array
27302 of the exact size and return that.
27304 (Class::LookupMethodByBuilder): New function that maps
27305 MethodBuilders to its methods. Required to locate the information
27306 on methods because System.Reflection bit us again.
27308 * support.cs: New file, contains an interface ParameterData and
27309 two implementations: ReflectionParameters and InternalParameters
27310 used to access Parameter information. We will need to grow this
27313 * expression.cs (Invocation::GetParameterData): implement a cache
27314 and a wrapper around the ParameterData creation for methods.
27315 (Invocation::OverloadResolve): Use new code.
27317 2001-09-13 Ravi Pratap <ravi@ximian.com>
27319 * class.cs (TypeContainer::EmitField): Remove and move into
27320 (Field::Define): here and modify accordingly.
27321 (Field.FieldBuilder): New member.
27322 (TypeContainer::Populate): Update accordingly.
27323 (TypeContainer::FindMembers): Implement.
27325 2001-09-13 Miguel de Icaza <miguel@ximian.com>
27327 * statement.cs: (VariableInfo::VariableType): New field to be
27328 initialized with the full type once it is resolved.
27330 2001-09-12 Miguel de Icaza <miguel@ximian.com>
27332 * parameter.cs (GetParameterInfo): Use a type cache to compute
27333 things only once, and to reuse this information
27335 * expression.cs (LocalVariableReference::Emit): Implement.
27336 (OpcodeCast::Emit): fix.
27338 (ParameterReference::Resolve): Implement.
27339 (ParameterReference::Emit): Implement.
27341 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
27342 that are expressions need to stay as Expressions.
27344 * typemanager.cs (CSharpName): Returns the C# name of a type if
27347 * expression.cs (Expression::ConvertImplicit): New function that
27348 implements implicit type conversions.
27350 (Expression::ImplicitReferenceConversion): Implements implicit
27351 reference conversions.
27353 (EmptyCast): New type for transparent casts.
27355 (OpcodeCast): New type for casts of types that are performed with
27356 a sequence of bytecodes.
27358 (BoxedCast): New type used for casting value types into reference
27359 types. Emits a box opcode.
27361 (Binary::DoNumericPromotions): Implements numeric promotions of
27362 and computation of the Binary::Type.
27364 (Binary::EmitBranchable): Optimization.
27366 (Binary::Emit): Implement code emission for expressions.
27368 * typemanager.cs (TypeManager): Added two new core types: sbyte
27371 2001-09-12 Ravi Pratap <ravi@ximian.com>
27373 * class.cs (TypeContainer::FindMembers): Method which does exactly
27374 what Type.FindMembers does, only we don't have to use reflection. No
27375 implementation yet.
27377 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
27378 typecontainer objects as we need to get at them.
27379 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
27381 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
27382 typecontainer object.
27384 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
27385 of just a Report object.
27387 2001-09-11 Ravi Pratap <ravi@ximian.com>
27389 * class.cs (Event::Define): Go back to using the prefixes "add_" and
27391 (TypeContainer::Populate): Now define the delegates of the type too.
27392 (TypeContainer.Delegates): Property to access the list of delegates defined
27395 * delegates.cs (Delegate::Define): Implement partially.
27397 * modifiers.cs (TypeAttr): Handle more flags.
27399 2001-09-11 Ravi Pratap <ravi@ximian.com>
27401 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
27403 (Operator::Define): Re-write logic to get types by using the LookupType method
27404 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
27405 (Indexer::Define): Ditto.
27406 (Event::Define): Ditto.
27407 (Property::Define): Ditto.
27409 2001-09-10 Ravi Pratap <ravi@ximian.com>
27411 * class.cs (TypeContainer::Populate): Now define operators too.
27412 (TypeContainer.Operators): New property to access the list of operators
27414 (Operator.OperatorMethodBuilder): New member to hold the method builder
27415 for the operator we are defining.
27416 (Operator::Define): Implement.
27418 2001-09-10 Ravi Pratap <ravi@ximian.com>
27420 * class.cs (Event::Define): Make the prefixes of the accessor methods
27421 addOn_ and removeOn_
27423 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
27424 of the location being passed in too. Ideally, this should go later since all
27425 error reporting should be done through the Report object.
27427 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
27428 (Populate): Iterate thru the indexers we have and define them too.
27429 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
27430 for the get and set accessors.
27431 (Indexer::Define): Implement.
27433 2001-09-09 Miguel de Icaza <miguel@ximian.com>
27435 * expression.cs (Binary::Resolve): Beginning of it. I scratched
27436 my previous implementation, did not work.
27438 * typemanager.cs: Add a couple of missing types (the longs).
27440 * literal.cs: Use TypeManager.bool_type instead of getting it.
27442 * expression.cs (EventExpr): New kind of expressions.
27443 (Expressio::ExprClassFromMemberInfo): finish
27445 2001-09-08 Miguel de Icaza <miguel@ximian.com>
27447 * assign.cs: Emit stores to static fields differently.
27449 2001-09-08 Ravi Pratap <ravi@ximian.com>
27451 * Merge in changes and adjust code to tackle conflicts. Backed out my
27452 code in Assign::Resolve ;-)
27454 2001-09-08 Ravi Pratap <ravi@ximian.com>
27456 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
27457 instead Report.Error and also pass in the location.
27458 (CSharpParser::Lexer): New readonly property to return the reference
27459 to the Tokenizer object.
27460 (declare_local_variables): Use Report.Error with location instead of plain
27464 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
27465 (Operator.CheckBinaryOperator): Ditto.
27467 * cs-parser.jay (operator_declarator): Update accordingly.
27469 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
27470 (CheckBinaryOperator): Same here.
27472 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
27473 on the name without any prefixes of namespace names etc. This is because we
27474 already might have something already fully qualified like
27475 'System.Console.WriteLine'
27477 * assign.cs (Resolve): Begin implementation. Stuck ;-)
27479 2001-09-07 Ravi Pratap <ravi@ximian.com>
27481 * cs-tokenizer.cs (location): Return a string which also contains
27484 * expression.cs (ElementAccess): New class for expressions of the
27485 type 'element access.'
27486 (BaseAccess): New class for expressions of the type 'base access.'
27487 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
27490 * cs-parser.jay (element_access): Implement action.
27491 (base_access): Implement actions.
27492 (checked_expression, unchecked_expression): Implement.
27494 * cs-parser.jay (local_variable_type): Correct and implement.
27495 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
27497 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
27499 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
27500 name and the specifiers.
27502 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
27504 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
27505 making them all public ;-)
27507 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
27510 2001-09-07 Miguel de Icaza <miguel@ximian.com>
27512 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
27514 (FieldExpr, PropertyExprs): New resolved expressions.
27515 (SimpleName::MemberStaticCheck): Perform static checks for access
27516 to non-static fields on static methods. Maybe this should be
27517 generalized for MemberAccesses.
27518 (SimpleName::ResolveSimpleName): More work on simple name
27521 * cs-parser.jay (primary_expression/qualified_identifier): track
27522 the parameter index.
27524 * codegen.cs (CodeGen::Save): Catch save exception, report error.
27525 (EmitContext::EmitBoolExpression): Chain to expression generation
27526 instead of temporary hack.
27527 (::EmitStatementExpression): Put generic expression code generation.
27529 * assign.cs (Assign::Emit): Implement variable assignments to
27530 local variables, parameters and fields.
27532 2001-09-06 Miguel de Icaza <miguel@ximian.com>
27534 * statement.cs (Block::GetVariableInfo): New method, returns the
27535 VariableInfo for a variable name in a block.
27536 (Block::GetVariableType): Implement in terms of GetVariableInfo
27538 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
27539 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
27541 2001-09-06 Ravi Pratap <ravi@ximian.com>
27543 * cs-parser.jay (operator_declaration): Continue on my quest : update
27544 to take attributes argument.
27545 (event_declaration): Ditto.
27546 (enum_declaration): Ditto.
27547 (indexer_declaration): Ditto.
27549 * class.cs (Operator::Operator): Update constructor accordingly.
27550 (Event::Event): Ditto.
27552 * delegate.cs (Delegate::Delegate): Same here.
27554 * enum.cs (Enum::Enum): Same here.
27556 2001-09-05 Ravi Pratap <ravi@ximian.com>
27558 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
27560 * ../tests/cs0658.cs : New file to demonstrate error 0658.
27562 * attribute.cs (Attributes): New class to encapsulate all attributes which were
27563 being passed around as an arraylist.
27564 (Attributes::AddAttribute): Method to add attribute sections.
27566 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
27567 (struct_declaration): Update accordingly.
27568 (constant_declaration): Update.
27569 (field_declaration): Update.
27570 (method_header): Update.
27571 (fixed_parameter): Update.
27572 (parameter_array): Ditto.
27573 (property_declaration): Ditto.
27574 (destructor_declaration): Ditto.
27576 * class.cs (Struct::Struct): Update constructors accordingly.
27577 (Class::Class): Ditto.
27578 (Field::Field): Ditto.
27579 (Method::Method): Ditto.
27580 (Property::Property): Ditto.
27581 (TypeContainer::OptAttribute): update property's return type.
27583 * interface.cs (Interface.opt_attributes): New member.
27584 (Interface::Interface): Update to take the extra Attributes argument.
27586 * parameter.cs (Parameter::Parameter): Ditto.
27588 * constant.cs (Constant::Constant): Ditto.
27590 * interface.cs (InterfaceMemberBase): New OptAttributes field.
27591 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
27592 the attributes as a parameter.
27593 (InterfaceProperty): Update constructor call.
27594 (InterfaceEvent): Ditto.
27595 (InterfaceMethod): Ditto.
27596 (InterfaceIndexer): Ditto.
27598 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
27599 pass the attributes too.
27600 (interface_event_declaration): Ditto.
27601 (interface_property_declaration): Ditto.
27602 (interface_method_declaration): Ditto.
27603 (interface_declaration): Ditto.
27605 2001-09-05 Miguel de Icaza <miguel@ximian.com>
27607 * class.cs (Method::Define): Track the "static Main" definition to
27608 create an entry point.
27610 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
27611 EntryPoint if we find it.
27613 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
27614 (EmitContext::ig): Make this variable public.
27616 * driver.cs: Make the default output file be the first file name
27617 with the .exe extension.
27619 Detect empty compilations
27621 Handle various kinds of output targets. Handle --target and
27622 rename -t to --dumper.
27624 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
27625 methods inherited from Expression return now an Expression. This
27626 will is used during the tree rewriting as we resolve them during
27629 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
27630 the spec. Missing entirely is the information about
27631 accessability of elements of it.
27633 (Expression::ExprClassFromMemberInfo): New constructor for
27634 Expressions that creates a fully initialized Expression based on
27635 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
27638 (Invocation::Resolve): Begin implementing resolution of invocations.
27640 * literal.cs (StringLiteral): Implement Emit.
27642 2001-09-05 Ravi Pratap <ravi@ximian.com>
27644 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
27647 2001-09-04 Ravi Pratap <ravi@ximian.com>
27649 * cs-parser.jay (attribute_arguments): Implement actions.
27650 (attribute): Fix bug in production. Implement action.
27651 (attribute_list): Implement.
27652 (attribute_target): Implement.
27653 (attribute_target_specifier, opt_target_specifier): Implement
27654 (CheckAttributeTarget): New method to check if the attribute target
27656 (attribute_section): Implement.
27657 (opt_attributes): Implement.
27659 * attribute.cs : New file to handle attributes.
27660 (Attribute): Class to hold attribute info.
27662 * cs-parser.jay (opt_attribute_target_specifier): Remove production
27663 (attribute_section): Modify production to use 2 different rules to
27664 achieve the same thing. 1 s/r conflict down !
27665 Clean out commented, useless, non-reducing dimension_separator rules.
27667 * class.cs (TypeContainer.attributes): New member to hold list
27668 of attributes for a type.
27669 (Struct::Struct): Modify to take one more argument, the attribute list.
27670 (Class::Class): Ditto.
27671 (Field::Field): Ditto.
27672 (Method::Method): Ditto.
27673 (Property::Property): Ditto.
27675 * cs-parser.jay (struct_declaration): Update constructor call to
27676 pass in the attributes too.
27677 (class_declaration): Ditto.
27678 (constant_declaration): Ditto.
27679 (field_declaration): Ditto.
27680 (method_header): Ditto.
27681 (fixed_parameter): Ditto.
27682 (parameter_array): Ditto.
27683 (property_declaration): Ditto.
27685 * constant.cs (Constant::Constant): Update constructor similarly.
27686 Use System.Collections.
27688 * parameter.cs (Parameter::Parameter): Update as above.
27690 2001-09-02 Ravi Pratap <ravi@ximian.com>
27692 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
27693 (TypeContainer.delegates): New member to hold list of delegates.
27695 * cs-parser.jay (delegate_declaration): Implement the action correctly
27696 this time as I seem to be on crack ;-)
27698 2001-09-02 Miguel de Icaza <miguel@ximian.com>
27700 * rootcontext.cs (RootContext::IsNamespace): new function, used to
27701 tell whether an identifier represents a namespace.
27703 * expression.cs (NamespaceExpr): A namespace expression, used only
27704 temporarly during expression resolution.
27705 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
27706 utility functions to resolve names on expressions.
27708 2001-09-01 Miguel de Icaza <miguel@ximian.com>
27710 * codegen.cs: Add hook for StatementExpressions.
27712 * class.cs: Fix inverted test for static flag in methods.
27714 2001-09-02 Ravi Pratap <ravi@ximian.com>
27716 * class.cs (Operator::CheckUnaryOperator): Correct error number used
27717 to make it coincide with MS' number.
27718 (Operator::CheckBinaryOperator): Ditto.
27720 * ../errors/errors.txt : Remove error numbers added earlier.
27722 * ../errors/cs1019.cs : Test case for error # 1019
27724 * ../errros/cs1020.cs : Test case for error # 1020
27726 * cs-parser.jay : Clean out commented cruft.
27727 (dimension_separators, dimension_separator): Comment out. Ostensibly not
27728 used anywhere - non-reducing rule.
27729 (namespace_declarations): Non-reducing rule - comment out.
27731 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
27732 with TypeContainer::AddEnum.
27734 * delegate.cs : New file for delegate handling classes.
27735 (Delegate): Class for declaring delegates.
27737 * makefile : Update.
27739 * cs-parser.jay (delegate_declaration): Implement.
27741 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
27743 * class.cs (Event::Define): Implement.
27744 (Event.EventBuilder): New member.
27746 * class.cs (TypeContainer::Populate): Update to define all enums and events
27748 (Events): New property for the events arraylist we hold. Shouldn't we move to using
27749 readonly fields for all these cases ?
27751 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
27753 * class.cs (Property): Revamp to use the convention of making fields readonly.
27754 Accordingly modify code elsewhere.
27756 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
27757 the Define method of the Property class.
27759 * class.cs : Clean up applied patch and update references to variables etc. Fix
27761 (TypeContainer::Populate): Update to define all the properties we have. Also
27762 define all enumerations.
27764 * enum.cs (Define): Implement.
27766 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
27768 * cs-parser.jay (overloadable_operator): The semantic value is an
27769 enum of the Operator class.
27770 (operator_declarator): Implement actions.
27771 (operator_declaration): Implement.
27773 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
27774 validity of definitions.
27775 (Operator::CheckBinaryOperator): Static method to check for binary operators
27776 (TypeContainer::AddOperator): New method to add an operator to a type.
27778 * cs-parser.jay (indexer_declaration): Added line to actually call the
27779 AddIndexer method so it gets added ;-)
27781 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
27782 already taken care of by the MS compiler ?
27784 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
27786 * class.cs (Operator): New class for operator declarations.
27787 (Operator::OpType): Enum for the various operators.
27789 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
27791 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
27792 ostensibly handle this in semantic analysis.
27794 * cs-parser.jay (general_catch_clause): Comment out
27795 (specific_catch_clauses, specific_catch_clause): Ditto.
27796 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
27797 (catch_args, opt_catch_args): New productions.
27798 (catch_clause): Rewrite to use the new productions above
27799 (catch_clauses): Modify accordingly.
27800 (opt_catch_clauses): New production to use in try_statement
27801 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
27802 and re-write the code in the actions to extract the specific and
27803 general catch clauses by being a little smart ;-)
27805 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
27806 Hooray, try and catch statements parse fine !
27808 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27810 * statement.cs (Block::GetVariableType): Fix logic to extract the type
27811 string from the hashtable of variables.
27813 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
27814 I end up making that mistake ;-)
27815 (catch_clauses): Fixed gross error which made Key and Value of the
27816 DictionaryEntry the same : $1 !!
27818 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27820 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
27822 * cs-parser.jay (event_declaration): Correct to remove the semicolon
27823 when the add and remove accessors are specified.
27825 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27827 * cs-parser.jay (IndexerDeclaration): New helper class to hold
27828 information about indexer_declarator.
27829 (indexer_declarator): Implement actions.
27830 (parsing_indexer): New local boolean used to keep track of whether
27831 we are parsing indexers or properties. This is necessary because
27832 implicit_parameters come into picture even for the get accessor in the
27833 case of an indexer.
27834 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
27836 * class.cs (Indexer): New class for indexer declarations.
27837 (TypeContainer::AddIndexer): New method to add an indexer to a type.
27838 (TypeContainer::indexers): New member to hold list of indexers for the
27841 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
27843 * cs-parser.jay (add_accessor_declaration): Implement action.
27844 (remove_accessor_declaration): Implement action.
27845 (event_accessors_declaration): Implement
27846 (variable_declarators): swap statements for first rule - trivial.
27848 * class.cs (Event): New class to hold information about event
27850 (TypeContainer::AddEvent): New method to add an event to a type
27851 (TypeContainer::events): New member to hold list of events.
27853 * cs-parser.jay (event_declaration): Implement actions.
27855 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
27857 * cs-parser.jay (dim_separators): Implement. Make it a string
27858 concatenating all the commas together, just as they appear.
27859 (opt_dim_separators): Modify accordingly
27860 (rank_specifiers): Update accordingly. Basically do the same
27861 thing - instead, collect the brackets here.
27862 (opt_rank_sepcifiers): Modify accordingly.
27863 (array_type): Modify to actually return the complete type string
27864 instead of ignoring the rank_specifiers.
27865 (expression_list): Implement to collect the expressions
27866 (variable_initializer): Implement. We make it a list of expressions
27867 essentially so that we can handle the array_initializer case neatly too.
27868 (variable_initializer_list): Implement.
27869 (array_initializer): Make it a list of variable_initializers
27870 (opt_array_initializer): Modify accordingly.
27872 * expression.cs (New::NType): Add enumeration to help us
27873 keep track of whether we have an object/delegate creation
27874 or an array creation.
27875 (New:NewType, New::Rank, New::Indices, New::Initializers): New
27876 members to hold data about array creation.
27877 (New:New): Modify to update NewType
27878 (New:New): New Overloaded contructor for the array creation
27881 * cs-parser.jay (array_creation_expression): Implement to call
27882 the overloaded New constructor.
27884 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
27886 * class.cs (TypeContainer::Constructors): Return member
27887 constructors instead of returning null.
27889 2001-08-26 Miguel de Icaza <miguel@ximian.com>
27891 * typemanager.cs (InitCoreTypes): Initialize the various core
27892 types after we have populated the type manager with the user
27893 defined types (this distinction will be important later while
27894 compiling corlib.dll)
27896 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
27897 on Expression Classification. Now all expressions have a method
27898 `Resolve' and a method `Emit'.
27900 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
27901 generation from working. Also add some temporary debugging
27904 2001-08-24 Miguel de Icaza <miguel@ximian.com>
27906 * codegen.cs: Lots of code generation pieces. This is only the
27907 beginning, will continue tomorrow with more touches of polish. We
27908 handle the fundamentals of if, while, do, for, return. Others are
27909 trickier and I need to start working on invocations soon.
27911 * gen-treedump.cs: Bug fix, use s.Increment here instead of
27914 * codegen.cs (EmitContext): New struct, used during code
27915 emission to keep a context. Most of the code generation will be
27918 * cs-parser.jay: Add embedded blocks to the list of statements of
27919 this block. So code generation proceeds in a top down fashion.
27921 2001-08-23 Miguel de Icaza <miguel@ximian.com>
27923 * statement.cs: Add support for multiple child blocks.
27925 2001-08-22 Miguel de Icaza <miguel@ximian.com>
27927 * codegen.cs (EmitCode): New function, will emit the code for a
27928 Block of code given a TypeContainer and its ILGenerator.
27930 * statement.cs (Block): Standard public readonly optimization.
27931 (Block::Block constructors): Link children.
27932 (Block::Child): Child Linker.
27933 (Block::EmitVariables): Emits IL variable declarations.
27935 * class.cs: Drop support for MethodGroups here, delay until
27937 (Method::): Applied the same simplification that I did before, and
27938 move from Properties to public readonly fields.
27939 (Method::ParameterTypes): Returns the parameter types for the
27940 function, and implements a cache that will be useful later when I
27941 do error checking and the semantic analysis on the methods is
27943 (Constructor::GetCallingConvention): Renamed from CallingConvetion
27944 and made a method, optional argument tells whether this is a class
27945 or a structure to apply the `has-this' bit.
27946 (Method::GetCallingConvention): Implement, returns the calling
27948 (Method::Define): Defines the type, a second pass is performed
27949 later to populate the methods.
27951 (Constructor::ParameterTypes): implement a cache similar to the
27952 one on Method::ParameterTypes, useful later when we do semantic
27955 (TypeContainer::EmitMethod): New method. Emits methods.
27957 * expression.cs: Removed MethodGroup class from here.
27959 * parameter.cs (Parameters::GetCallingConvention): new method.
27961 2001-08-21 Miguel de Icaza <miguel@ximian.com>
27963 * class.cs (TypeContainer::Populate): Drop RootContext from the
27966 (Constructor::CallingConvention): Returns the calling convention.
27967 (Constructor::ParameterTypes): Returns the constructor parameter
27970 (TypeContainer::AddConstructor): Keep track of default constructor
27971 and the default static constructor.
27973 (Constructor::) Another class that starts using `public readonly'
27974 instead of properties.
27976 (Constructor::IsDefault): Whether this is a default constructor.
27978 (Field::) use readonly public fields instead of properties also.
27980 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
27981 track of static constructors; If none is used, turn on
27982 BeforeFieldInit in the TypeAttributes.
27984 * cs-parser.jay (opt_argument_list): now the return can be null
27985 for the cases where there are no arguments.
27987 (constructor_declarator): If there is no implicit `base' or
27988 `this', then invoke the default parent constructor.
27990 * modifiers.cs (MethodAttr): New static function maps a set of
27991 modifiers flags into a MethodAttributes enum
27992 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
27993 MethodAttr, TypeAttr to represent the various mappings where the
27994 modifiers are used.
27995 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
27997 2001-08-19 Miguel de Icaza <miguel@ximian.com>
27999 * parameter.cs (GetParameterInfo): Fix bug where there would be no
28002 * interface.cs (PopulateIndexer): Implemented the code generator
28003 for interface indexers.
28005 2001-08-17 Miguel de Icaza <miguel@ximian.com>
28007 * interface.cs (InterfaceMemberBase): Now we track the new status
28010 (PopulateProperty): Implement property population. Woohoo! Got
28011 Methods and Properties going today.
28013 Removed all the properties for interfaces, and replaced them with
28014 `public readonly' fields.
28016 2001-08-16 Miguel de Icaza <miguel@ximian.com>
28018 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
28019 initialize their hashtables/arraylists only when they are needed
28020 instead of doing this always.
28022 * parameter.cs: Handle refs and out parameters.
28024 * cs-parser.jay: Use an ArrayList to construct the arguments
28025 instead of the ParameterCollection, and then cast that to a
28028 * parameter.cs: Drop the use of ParameterCollection and use
28029 instead arrays of Parameters.
28031 (GetParameterInfo): Use the Type, not the Name when resolving
28034 2001-08-13 Miguel de Icaza <miguel@ximian.com>
28036 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
28037 and instead use public readonly fields.
28039 * class.cs: Put back walking code for type containers.
28041 2001-08-11 Miguel de Icaza <miguel@ximian.com>
28043 * class.cs (MakeConstant): Code to define constants.
28045 * rootcontext.cs (LookupType): New function. Used to locate types
28048 2001-08-08 Miguel de Icaza <miguel@ximian.com>
28050 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
28051 this System.Reflection code is. Kudos to Microsoft
28053 * typemanager.cs: Implement a type cache and avoid loading all
28054 types at boot time. Wrap in LookupType the internals. This made
28055 the compiler so much faster. Wow. I rule!
28057 * driver.cs: Make sure we always load mscorlib first (for
28058 debugging purposes, nothing really important).
28060 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
28061 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
28063 * rootcontext.cs: Lookup types on their namespace; Lookup types
28064 on namespaces that have been imported using the `using' keyword.
28066 * class.cs (TypeContainer::TypeAttr): Virtualize.
28067 (Class::TypeAttr): Return attributes suitable for this bad boy.
28068 (Struct::TypeAttr): ditto.
28069 Handle nested classes.
28070 (TypeContainer::) Remove all the type visiting code, it is now
28071 replaced with the rootcontext.cs code
28073 * rootcontext.cs (GetClassBases): Added support for structs.
28075 2001-08-06 Miguel de Icaza <miguel@ximian.com>
28077 * interface.cs, statement.cs, class.cs, parameter.cs,
28078 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
28079 Drop use of TypeRefs, and use strings instead.
28081 2001-08-04 Miguel de Icaza <miguel@ximian.com>
28085 * class.cs (Struct::Struct): set the SEALED flags after
28086 checking the modifiers.
28087 (TypeContainer::TypeAttr): new property, returns the
28088 TypeAttributes for a class.
28090 * cs-parser.jay (type_list): Oops, list production was creating a
28091 new list of base types.
28093 * rootcontext.cs (StdLib): New property.
28094 (GetInterfaceTypeByName): returns an interface by type name, and
28095 encapsulates error handling here.
28096 (GetInterfaces): simplified.
28097 (ResolveTree): Encapsulated all the tree resolution here.
28098 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
28101 * driver.cs: Add support for --nostdlib, to avoid loading the
28102 default assemblies.
28103 (Main): Do not put tree resolution here.
28105 * rootcontext.cs: Beginning of the class resolution.
28107 2001-08-03 Miguel de Icaza <miguel@ximian.com>
28109 * rootcontext.cs: Provide better error reporting.
28111 * cs-parser.jay (interface_base): set our $$ to be interfaces.
28113 * rootcontext.cs (CreateInterface): Handle the case where there
28114 are no parent interfaces.
28116 (CloseTypes): Routine to flush types at the end.
28117 (CreateInterface): Track types.
28118 (GetInterfaces): Returns an array of Types from the list of
28119 defined interfaces.
28121 * typemanager.c (AddUserType): Mechanism to track user types (puts
28122 the type on the global type hash, and allows us to close it at the
28125 2001-08-02 Miguel de Icaza <miguel@ximian.com>
28127 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
28128 RecordInterface instead.
28130 * cs-parser.jay: Updated to reflect changes above.
28132 * decl.cs (Definition): Keep track of the TypeBuilder type that
28133 represents this type here. Not sure we will use it in the long
28134 run, but wont hurt for now.
28136 * driver.cs: Smaller changes to accomodate the new code.
28138 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
28141 * rootcontext.cs (CreateInterface): New method, used to create
28142 the System.TypeBuilder type for interfaces.
28143 (ResolveInterfaces): new entry point to resolve the interface
28145 (CodeGen): Property, used to keep track of the code generator.
28147 2001-07-26 Miguel de Icaza <miguel@ximian.com>
28149 * cs-parser.jay: Add a second production for delegate_declaration
28152 (enum_body): Put an opt_comma here instead of putting it on
28153 enum_body or enum_member_declarations so we can handle trailing
28154 commas on enumeration members. Gets rid of a shift/reduce.
28156 (type_list): Need a COMMA in the middle.
28158 (indexer_declaration): Tell tokenizer to recognize get/set
28160 * Remove old targets.
28162 * Re-add the parser target.
28164 2001-07-13 Simon Cozens <simon@simon-cozens.org>
28166 * cs-parser.jay: Add precendence rules for a number of operators
28167 ot reduce the number of shift/reduce conflicts in the grammar.
28169 2001-07-17 Miguel de Icaza <miguel@ximian.com>
28171 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
28174 Get rid of old crufty code.
28176 * rootcontext.cs: Use this to keep track of the parsed
28177 representation and the defined types available to the program.
28179 * gen-treedump.cs: adjust for new convention.
28181 * type.cs: Split out the type manager, and the assembly builder
28184 * typemanager.cs: the type manager will live here now.
28186 * cil-codegen.cs: And the code generator here.
28188 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
28190 * makefile: Fixed up for easy making.
28192 2001-07-13 Simon Cozens <simon@simon-cozens.org>
28194 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
28197 (unary_expression): Expand pre_increment_expression and
28198 post_decrement_expression to reduce a shift/reduce.
28200 2001-07-11 Simon Cozens
28202 * cs-tokenizer.cs: Hex numbers should begin with a 0.
28204 Improve allow_keyword_as_indent name.
28206 2001-06-19 Miguel de Icaza <miguel@ximian.com>
28208 * Adjustments for Beta2.
28210 2001-06-13 Miguel de Icaza <miguel@ximian.com>
28212 * decl.cs: Added `Define' abstract method.
28213 (InTransit): new property, used to catch recursive definitions.
28215 * interface.cs: Implement `Define'.
28217 * modifiers.cs: Map Modifiers.constants to
28218 System.Reflection.TypeAttribute flags.
28220 * class.cs: Keep track of types and user-defined types.
28221 (BuilderInit): New method for creating an assembly
28222 (ResolveType): New function to launch the resolution process, only
28223 used by interfaces for now.
28225 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
28226 that are inserted into the name space.
28228 2001-06-08 Miguel de Icaza <miguel@ximian.com>
28230 * ARGH. I have screwed up my tree so many times due to the use of
28231 rsync rather than using CVS. Going to fix this at once.
28233 * driver.cs: Objetify driver. Load assemblies, use assemblies to
28236 2001-06-07 Miguel de Icaza <miguel@ximian.com>
28238 * Experiment successful: Use System.Type rather that our own
28241 2001-05-25 Miguel de Icaza <miguel@ximian.com>
28243 * cs-parser.jay: Removed nsAliases from here.
28245 Use new namespaces, handle `using XXX;'
28247 * namespace.cs: Reimplemented namespace handling, use a recursive
28248 definition of the class. Now we can keep track of using clauses
28249 and catch invalid using clauses.
28251 2001-05-24 Miguel de Icaza <miguel@ximian.com>
28253 * gen-treedump.cs: Adapted for all the renaming.
28255 * expression.cs (Expression): this class now has a Type property
28256 which returns an expression Type.
28258 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
28259 `Type', as this has a different meaning now in the base
28261 2001-05-22 Miguel de Icaza <miguel@ximian.com>
28263 * interface.cs, class.cs: Removed from all the sources the
28264 references to signature computation, as we can not do method
28265 signature computation during the parsing time, as we are not
28266 trying to solve at that point distinguishing:
28270 void a (NS.Blah x) {}
28273 Which depending on the context might be valid or not, as we do not
28274 know if Blah is the same thing as NS.Blah at that point.
28276 * Redid everything so the code uses TypeRefs now instead of
28277 Types. TypeRefs are just temporary type placeholders, that need
28278 to be resolved. They initially have a pointer to a string and the
28279 current scope in which they are used. This is used later by the
28280 compiler to resolve the reference to an actual Type.
28282 * DeclSpace is no longer a CIR.Type, and neither are
28283 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
28284 are all DeclSpaces, but no Types.
28286 * type.cs (TypeRefManager): This implements the TypeRef manager,
28287 which keeps track of all the types that need to be resolved after
28288 the parsing has finished.
28290 2001-05-13 Miguel de Icaza <miguel@ximian.com>
28292 * ARGH. We are going to have to store `foreach' as a class rather
28293 than resolving it, as we need to verify error 1579 after name
28294 resolution. *OR* we could keep a flag that says `This request to
28295 IEnumerator comes from a foreach statement' which we can then use
28296 to generate the error.
28298 2001-05-10 Miguel de Icaza <miguel@ximian.com>
28300 * class.cs (TypeContainer.AddMethod): we now add methods to the
28301 MethodGroup instead of the method hashtable.
28303 * expression.cs: Add MethodGroup abstraction, which gets us one
28304 step closer to the specification in the way we handle method
28307 * cs-parser.jay (primary_expression): qualified_identifier now
28308 tried to match up an identifier to a local variable reference or
28309 to a parameter reference.
28311 current_local_parameters is now a parser global variable that
28312 points to the current parameters for the block, used during name
28315 (property_declaration): Now creates an implicit `value' argument to
28318 2001-05-09 Miguel de Icaza <miguel@ximian.com>
28320 * parameter.cs: Do not use `param' arguments as part of the
28321 signature, per the spec.
28323 2001-05-08 Miguel de Icaza <miguel@ximian.com>
28325 * decl.cs: Base class for classes, structs and interfaces. This
28326 is the "Declaration Space"
28328 * cs-parser.jay: Use CheckDef for checking declaration errors
28329 instead of having one on each function.
28331 * class.cs: Factor out some code for handling error handling in
28332 accordance to the "Declarations" section in the "Basic Concepts"
28333 chapter in the ECMA C# spec.
28335 * interface.cs: Make all interface member classes derive from
28336 InterfaceMemberBase.
28338 2001-05-07 Miguel de Icaza <miguel@ximian.com>
28340 * Many things: all interfaces are parsed and generated in
28341 gen-treedump. Support for member variables, constructors,
28342 destructors, properties, constants is there.
28344 Beginning of the IL backend, but very little done, just there for
28347 2001-04-29 Miguel de Icaza <miguel@ximian.com>
28349 * cs-parser.jay: Fix labeled statement.
28351 * cs-tokenizer.cs (escape): Escape " and ' always.
28352 ref_line, ref_name: keep track of the line/filename as instructed
28353 by #line by the compiler.
28356 2001-04-27 Miguel de Icaza <miguel@ximian.com>
28358 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
28359 to match the values in System.CodeDOM.
28361 Divid renamed to Divide.
28363 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
28365 (Statements.set): remove.
28367 * System.CodeDOM/CodeCatchClause.cs: always have a valid
28370 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
28371 falseStatements always have valid values.
28373 * cs-parser.jay: Use System.CodeDOM now.