1 2009-02-09 Marek Safar <marek.safar@gmail.com>
3 * expression.cs: Initializer of reference argument use temporary
4 variable to be verifiable.
6 * parameter.cs: Share EmitLdArg.
8 2009-02-09 Marek Safar <marek.safar@gmail.com>
11 * class.cs: Fixed: Not reporting error about nested class with the
14 2009-02-06 Scott Peterson <lunchtimemama@gmail.com>
16 Contributed under the MIT/X11 license.
18 * generic.cs: Added VerifyVariantTypeParameters which performs new
19 variance verification logic. The old logic, based on the spec, was
20 wrong because the spec is full of LIES!
22 * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
24 *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
27 * ecore.cs: Added calls to the new variance verification logic.
30 * delegate.cs: Removed calls to the old variance verification logic.
32 2009-02-06 Marek Safar <marek.safar@gmail.com>
34 * delegate.cs: Use cached Invoke method directly.
36 2009-02-06 Marek Safar <marek.safar@gmail.com>
38 * expression.cs: Emit expression tree for hoisted variable access.
40 2009-02-04 Marek Safar <marek.safar@gmail.com>
42 * namespace.cs: Add better extension class check.
44 2009-02-05 Scott Peterson <lunchtimemama@gmail.com>
46 * generic.cs: Fixed typeo (TypeParameter.Variacne).
48 2009-02-04 Scott Peterson <lunchtimemama@gmail.com>
50 This patch adds initial generic variance support to the compiler.
51 It is contributed under the MIT/X11 license.
53 * typemanager.cs: Modified ImplementsInterface to check variance.
54 Added VerifyVariantTypeParameters which checks the specified type to see
55 if it uses a variant type parameter as a type argument (which is not
56 allowed). Added IsVariantOf which determins if the first type is a
57 variant of the second. NOTE: This only supports reference types at
58 the moment to conform with the current level of VM support. When the
59 VM supports value types, this will follow step.
61 * generic.cs: Added the Variance enum. Added a Variance property to
62 TypeParameter and added variance support to definition phase. Added a
63 Variance property to TypeParameterName. Also check to make sure that
64 no variant types appear in generic method parameters.
66 * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
67 keywords if the langversion supports it.
69 * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
70 that variant types are only used in legal positions. Also added
71 ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
74 * decl.cs: Construct TypeParameter with the variance information.
76 * convert.cs: Checks variance in ImplicitReferenceConversionExists
77 and ImplicitConversionStandard.
79 * rootcontext.cs: Added new "Future" language version.
81 * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
82 type parameters are not used as type arguments in interface inheritance.
83 In MemberBase.DoMemberDependentChecks, ensure that contravariant type
84 parameters are not used as method return types. In MemberBase.
85 ResolveMemberType, ensure that variant type parameters are not used
86 as type arguments. Also call VerifyNoVariantTypeParameters on every
87 set of parameters which are resolved.
89 * delegate.cs: Modified Delegate.Define to ensure that variant
90 parameters are not used as type arguments and that a contravariant
91 parameter is not used as the return type. Also call
92 VerifyNoVariantTypeParameters on the delegate parameters.
94 * cs-parser.jay: Modified grammar to support "in" and "out" keywords
95 to specify generic variance.
97 * driver.cs: Added support for LanguageVersion.Future in the form of
98 "-langversion:future".
100 * generic-mcs.cs: Stubbed out new members in generic.cs.
102 2009-02-03 Marek Safar <marek.safar@gmail.com>
104 * class.cs, generic.cs: Emit type parameter constraints for nested
107 2009-02-02 Marek Safar <marek.safar@gmail.com>
109 A fix for bug #471213
110 * class.cs: Avoid emitting backing field for abstract event fields.
112 2009-02-01 Marek Safar <marek.safar@gmail.com>
114 A fix for bug #359731
115 * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
118 2009-01-30 Marek Safar <marek.safar@gmail.com>
120 A fix for bug #470767
121 * statement.cs: Introduced BlockScopeExpression, needed when
122 expression tree conversion has to emit scope variables.
124 2009-01-29 Marek Safar <marek.safar@gmail.com>
126 * class.cs: Remove duplicate CallingConvention.
128 2009-01-29 Marek Safar <marek.safar@gmail.com>
130 *.cs: Rename Parameters to ParametersCompiled and ParametersImported
131 when I finally found the right naming convention.
133 2009-01-29 Marek Safar <marek.safar@gmail.com>
135 * cs-tokenizer.cs: Put back different open parens optimization.
137 2009-01-28 Marek Safar <marek.safar@gmail.com>
139 A fix for bug #470227
140 * cs-tokenizer.cs: Remove too agressive parser optimization.
142 2009-01-28 Marek Safar <marek.safar@gmail.com>
144 A fix for bug #324319
145 * class.cs: Remove too early base type resolve.
147 2009-01-27 Marek Safar <marek.safar@gmail.com>
149 A fix for bug #324319
150 * ecore.cs: Explicitly type null when assigning to type argument to
151 make pass verifier check.
153 2009-01-27 Marek Safar <marek.safar@gmail.com>
155 * anonymous.cs: Fixed recent regression when initializing captured
158 2009-01-26 Marek Safar <marek.safar@gmail.com>
160 A fix for bug #469019
161 * anonymous.cs: Use all parent type parameters when instantiating
162 nested generic storey.
164 2009-01-26 Marek Safar <marek.safar@gmail.com>
166 * expression.cs: Check for null instance methodgroup expression.
168 2009-01-26 Marek Safar <marek.safar@gmail.com>
170 A fix for bug #469244
171 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
172 instance inside a conditional expression.
174 2009-01-23 Marek Safar <marek.safar@gmail.com>
176 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
177 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
178 GetElementType and HasElementType. IsValueType clean up.
180 2009-01-23 Marek Safar <marek.safar@gmail.com>
182 * nullable.cs: Use common EmitCall.
184 * expression.cs: Emit constraint. for virtual calls only.
186 2009-01-23 Marek Safar <marek.safar@gmail.com>
188 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
189 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
190 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
193 2009-01-22 Jb Evain <jbevain@novell.com>
195 * anonymous.cs: make anonymous types' ToString implementation
196 match what csc outputs.
198 2009-01-21 Marek Safar <marek.safar@gmail.com>
200 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
203 2009-01-17 Marek Safar <marek.safar@gmail.com>
205 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
208 2009-01-16 Marek Safar <marek.safar@gmail.com>
210 * nullable.cs (LiftedBinaryOperator): Check for all possible null
213 2009-01-15 Marek Safar <marek.safar@gmail.com>
215 A fix for bug #466634
216 * statement.cs: Add reference for nested storey when only this
219 2009-01-15 Marek Safar <marek.safar@gmail.com>
221 A fix for bug #466474
222 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
225 2009-01-15 Marek Safar <marek.safar@gmail.com>
227 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
228 Fixed nested stories parent referencing process. Also fixes #463985.
230 2009-01-06 Marek Safar <marek.safar@gmail.com>
232 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
233 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
234 implementation. Also fixes #463108.
236 2009-01-05 Marek Safar <marek.safar@gmail.com>
238 A fix for bug #416109
239 * decl.cs: Issue correct CLSAttribute warning location.
241 2009-01-05 Marek Safar <marek.safar@gmail.com>
243 A fix for bug #456775
244 * attribute.cs: Use attribute owner scope when resolving attribute
247 2009-01-05 Marek Safar <marek.safar@gmail.com>
249 A fix for bug #457257
250 * decl.cs: Fixed incorrect member declaring type comparison.
252 2009-01-05 Marek Safar <marek.safar@gmail.com>
254 A fix for bug #460896
255 * driver.cs: Handle /RES resources as embeddable.
257 2009-01-05 Marek Safar <marek.safar@gmail.com>
259 A fix for bug #462515
260 * ecore.cs: Report inacessible members upwards.
262 2009-01-05 Marek Safar <marek.safar@gmail.com>
264 A fix for bug #463190, #463192
265 * decl.cs, namespace.cs: Also import internal extension classes.
267 2009-01-04 Marek Safar <marek.safar@gmail.com>
269 A fix for bug #463415
270 * generic.cs: Use right index for RemoveDependentTypes.
272 2009-01-02 Marek Safar <marek.safar@gmail.com>
274 A fix for bug #463196
275 * expression.cs: Fixed enum to null comparison.
277 2009-01-02 Marek Safar <marek.safar@gmail.com>
279 A fix for bug #463121
280 * nullable.cs: Fixed nullable user equality operator comparison.
282 2009-01-02 Marek Safar <marek.safar@gmail.com>
284 A fix for bug #462950
285 * class.cs, decl.cs: Use full explicit name when defining automatic
286 property backing field.
288 2009-01-02 Marek Safar <marek.safar@gmail.com>
290 A fix for bug #462592
291 * pending.cs: Emit type arguments for generic proxy method.
293 2008-12-30 Marek Safar <marek.safar@gmail.com>
295 * expression.cs (As): Mutate all type arguments.
297 2008-12-29 Marek Safar <marek.safar@gmail.com>
299 A fix for bug #462622
300 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
303 2008-12-29 Marek Safar <marek.safar@gmail.com>
305 A fix for bug #450782
306 * ecore.cs: Consider more variables of form V.I to be fixed.
308 2008-12-29 Marek Safar <marek.safar@gmail.com>
310 A fix for bug #460712
311 * typemanager.cs: Core types could be imported.
313 2008-12-28 Marek Safar <marek.safar@gmail.com>
315 A fix for bugs #460847, #460772, #458049, #457339, #447807
316 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
317 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
318 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
319 user lambdas used inside query clauses.
321 2008-12-18 Marek Safar <marek.safar@gmail.com>
323 A fix for bug #460229
324 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
326 2008-12-18 Marek Safar <marek.safar@gmail.com>
328 A fix for bug #459952
329 * decl.cs, namespace.cs: Use common CheckAccessLevel.
331 2008-12-18 Marek Safar <marek.safar@gmail.com>
333 A fix for bug #459630
334 * convert.cs: Enum to valuetype conversion is not allowed.
336 2008-12-18 Marek Safar <marek.safar@gmail.com>
338 A fix for bug #457087
339 * generic.cs: Don't crash when constraint comes from type
342 2008-12-16 Marek Safar <marek.safar@gmail.com>
344 A fix for bug #459221
345 * anonymous.cs, statement.cs: Delay only captured this
348 2008-12-12 Marek Safar <marek.safar@gmail.com>
350 A fix for bug #457489
351 * anonymous.cs, statement.cs: Split anonymous storey instantiation
352 and initialization to capture scope initializers correctly.
354 2008-12-11 Marek Safar <marek.safar@gmail.com>
356 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
357 ParameterReference refactoring.
359 2008-12-03 Marek Safar <marek.safar@gmail.com>
361 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
362 to be imported from any assembly.
364 2008-12-03 Marek Safar <marek.safar@gmail.com>
366 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
367 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
368 from anonymous method and lambda expression.
370 2008-12-01 Marek Safar <marek.safar@gmail.com>
372 A fix for bug #448560
373 * expression.cs (As): Box any generic type arguments to be
376 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
378 Add tripwire for implicit conversion bugs
379 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
381 (MethodGroupExpr.OverloadResolve): Add sanity check between
382 IsApplicable and VerifyArgumentsCompat.
383 (VerifyArgumentsCompat): Report CS1501 where appropriate.
385 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
387 Fix build break in System.Data_test
388 * convert.cs (ImplicitConversionExists): Move NullLiteral
390 (ImplicitStandardConversionExists): ... here.
392 2008-11-28 Marek Safar <marek.safar@gmail.com>
394 * literal.cs: Emit correctly explicit null to nullable cast.
396 2008-11-28 Marek Safar <marek.safar@gmail.com>
398 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
401 2008-11-28 Marek Safar <marek.safar@gmail.com>
403 A fix for bug #449005
404 * convert.cs, nullable.cs: Use only one implicit nullable
407 2008-11-27 Marek Safar <marek.safar@gmail.com>
409 * convert.cs, literal.cs: More Convert cleanup is needed.
411 2008-11-27 Marek Safar <marek.safar@gmail.com>
413 * decl.cs, class.cs: Fixed misleading error message.
415 2008-11-26 Marek Safar <marek.safar@gmail.com>
417 A fix for bug #449005
418 * nullable.cs (EmitEquality): Disable optimization for user operator
421 2008-11-25 Marek Safar <marek.safar@gmail.com>
423 A fix for bug #447027
424 * anonymous.cs (HoistedVariable): Cache also outer access to deal
425 with context variables stored as expression instances.
427 2008-11-25 Marek Safar <marek.safar@gmail.com>
429 A fix for bug #447027
430 * delegate.cs: Fixed delegate VerifyMethod logic.
432 2008-11-24 Marek Safar <marek.safar@gmail.com>
434 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
437 2008-11-21 Marek Safar <marek.safar@gmail.com>
439 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
440 member type resolve to follow normal flow, instead of random
443 2008-11-21 Marek Safar <marek.safar@gmail.com>
445 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
448 2008-11-21 Marek Safar <marek.safar@gmail.com>
450 * const.cs: Emit decimal array constant as literal.
452 2008-11-20 Marek Safar <marek.safar@gmail.com>
454 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
456 2008-11-19 Marek Safar <marek.safar@gmail.com>
458 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
459 into real property (saves 8 MB for corlib compilation).
461 2008-11-19 Marek Safar <marek.safar@gmail.com>
463 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
464 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
465 generic-mcs.cs: Small cleanup of TypeArguments.
467 2008-11-18 Marek Safar <marek.safar@gmail.com>
469 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
470 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
471 of ConstructedType expression, renamed to GenericTypeExpr.
473 2008-11-17 Marek Safar <marek.safar@gmail.com>
475 A fix for bug #445303
476 * location.cs (IsConditionalDefined): Handle undefined global
479 2008-11-17 Marek Safar <marek.safar@gmail.com>
481 A fix for bug #444678
482 * expression.cs (TryReduceConstant): Always create new constant
485 2008-11-17 Marek Safar <marek.safar@gmail.com>
487 A fix for bug #444673
488 * ecore.cs: Ignore open generic types when used as generic type
491 2008-11-17 Marek Safar <marek.safar@gmail.com>
493 A fix for bug #445458
494 * expression.cs, cs-parser.jay: Don't crash when an expression
497 2008-11-17 Marek Safar <marek.safar@gmail.com>
499 A fix for bug #445464
500 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
503 2008-11-14 Jb Evain <jbevain@novell.com>
505 * driver.cs: ignore empty -nowarn argument such as
506 the one in -nowarn:12,13,,.
508 2008-11-13 Marek Safar <marek.safar@gmail.com>
510 A fix for bug #444271
511 * anonymous.cs: Rescan parent storeys when best candidate was
514 2008-11-13 Marek Safar <marek.safar@gmail.com>
516 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
517 useless UnboundTypeExpression.
519 * attribute.cs: Do check obsolete attribute on generic types.
521 2008-11-12 Marek Safar <marek.safar@gmail.com>
523 A fix for bugs #425680, #400139
524 * ecore.cs, expression.cs: Trying to do some almost_matched_members
527 2008-11-11 Marek Safar <marek.safar@gmail.com>
529 A fix for bug #435747
530 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
531 compound value types assignment. Few micro optimizations added.
533 2008-11-10 Marek Safar <marek.safar@gmail.com>
535 A fix for bug #442610
536 * anonymous.cs (MutateConstructor): More SRE hacking.
538 2008-11-10 Marek Safar <marek.safar@gmail.com>
540 A fix for bug #442579
541 * ecore.cs: Also initialize expanded form of a method with 1 params
544 2008-11-06 Marek Safar <marek.safar@gmail.com>
546 * expression.cs (UnaryMutator): Do early l-side check.
548 2008-11-05 Miguel de Icaza <miguel@novell.com>
550 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
551 Init, otherwise we would crash later on when checking for friend
554 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
555 Otherwise we never get any meaningful information as to what
558 2008-11-05 Marek Safar <marek.safar@gmail.com>
560 A fix for bug #436318
561 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
563 2008-11-05 Miguel de Icaza <miguel@novell.com>
565 * namespace.cs: Turns out that it was a really bad idea to hide
566 the errors for namespaces not found here in eval mode.
568 * eval.cs: When we process using clauses, only enter those into
569 the list of valid using clauses after they have been validated.
571 The above change gives the proper semantics: it does not
572 senselessly report the same errors with broken using statements by
573 never storing them in the first place when they are invalid.
575 2008-11-05 Marek Safar <marek.safar@gmail.com>
577 A fix for bug #421839
578 * cs-parser.jay: Remove expression from coalesce rule to force lower
579 priority than the assignment operator.
581 2008-11-05 Marek Safar <marek.safar@gmail.com>
583 A fix for bug #437875
584 * nullable.cs: Compile correctly method group operand used with null
587 2008-11-04 Marek Safar <marek.safar@gmail.com>
589 A fix for bug #434589
590 * expression.cs (Binary): Ignore lifted conversions when at least
591 one operand is of reference type.
593 2008-11-04 Marek Safar <marek.safar@gmail.com>
595 * cs-parser.jay: Better syntax error report.
597 2008-11-03 Marek Safar <marek.safar@gmail.com>
599 A fix for bug #436792
600 * cs-parser.jay: Use GetLocation to access location.
602 2008-11-03 Marek Safar <marek.safar@gmail.com>
604 A fix for bug #440774
605 * cs-parser.jay: Also set current_array_type when parsing local
608 2008-11-03 Marek Safar <marek.safar@gmail.com>
610 A fix for bug #440785
611 * expression.cs (As): Don't resolve self modifing expression
614 2008-11-03 Marek Safar <marek.safar@gmail.com>
616 A fix for bug #439447
617 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
619 2008-11-03 Marek Safar <marek.safar@gmail.com>
621 A fix for bug #437571
622 * cs-parser.jay: Fixes internal error for invalid expression
625 2008-10-17 Marek Safar <marek.safar@gmail.com>
627 * ecore.cs: Resolve correctly ambiguous params delegate methods.
629 2008-10-17 Marek Safar <marek.safar@gmail.com>
631 * generic.cs, anonymous.cs: Simplified GetDeclarations.
633 2008-10-17 Marek Safar <marek.safar@gmail.com>
635 * cs-tokenizer.cs: More precise cast parsing.
637 2008-10-16 Martin Baulig <martin@ximian.com>
639 * anonymous.cs (AnonymousMethodStorey): Put back the
640 `hoisted_locals' hashtable and use it in EmitType().
642 2008-10-15 Marek Safar <marek.safar@gmail.com>
644 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
645 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
648 2008-10-14 Marek Safar <marek.safar@gmail.com>
650 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
652 2008-10-14 Marek Safar <marek.safar@gmail.com>
654 * statement.cs: Mutate scope initializers.
656 2008-10-14 Marek Safar <marek.safar@gmail.com>
658 * expression.cs: Use typeless value for This constant.
660 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
662 2008-10-14 Marek Safar <marek.safar@gmail.com>
664 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
667 2008-10-13 Marek Safar <marek.safar@gmail.com>
669 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
672 2008-10-13 Marek Safar <marek.safar@gmail.com>
674 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
675 parser and tokenizer. Fixes many ambiguities including #433258.
677 2008-10-10 Marek Safar <marek.safar@gmail.com>
679 * cs-parser.jay: Fixed missing accessor recovery.
681 2008-10-10 Marek Safar <marek.safar@gmail.com>
683 A fix for bug #433701
684 * expression.cs: Better error message.
686 2008-10-10 Marek Safar <marek.safar@gmail.com>
688 * cs-parser.jay, expression.cs: Start reporting real parser errors.
690 * Makefile: Disabled unused debug symbols.
692 Also fixes: #320556, #321097, #321656, #321876, #351316
694 2008-10-09 Miguel de Icaza <miguel@novell.com>
696 * eval.cs: rename "<interactive>" to "{interactive}", to work
697 around a requirement in the compiler that this be a valid
698 filename, and in Windows it is not (433886).
700 2008-10-09 Marek Safar <marek.safar@gmail.com>
702 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
704 2008-10-08 Marek Safar <marek.safar@gmail.com>
706 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
707 cs-parser.jay: Generic type declaration and type arguments cleanup.
709 2008-10-05 Marek Safar <marek.safar@gmail.com>
711 * cs-parser.jay: Allow parsing weird array creation construct.
713 2008-10-05 Marek Safar <marek.safar@gmail.com>
715 * cs-parser.jay: Conflicts reduction.
717 2008-10-04 Marek Safar <marek.safar@gmail.com>
719 * cs-parser.jay: Conflicts reduction.
721 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
724 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
725 property. Add a 'count' hint about the use of the shared vector.
726 Ensure that we don't leak out dirty bits.
727 (UsageVector.MergeChild): Throw away information about variables
729 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
731 2008-10-03 Marek Safar <marek.safar@gmail.com>
733 A fix for bug #431746
734 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
735 parameters when iterator is created.
737 2008-10-03 Marek Safar <marek.safar@gmail.com>
739 A fix for bug #431827
740 * expression.cs: Fixed right based pointer arithmetic operations
743 2008-10-03 Marek Safar <marek.safar@gmail.com>
745 A fix for bug #353779
746 * assign.cs, expression.cs: Fixed compound assignment conversions.
748 2008-10-02 Marek Safar <marek.safar@gmail.com>
750 A fix for bug #375262
751 * statement.cs: Refactor ArrayForeach to be usable with string
752 indexer. Optimized single dimentional arrays foreach.
754 2008-10-02 Marek Safar <marek.safar@gmail.com>
756 A fix for bug #431255
757 * anonymous.cs, expression.cs: Removed broken optimization.
759 2008-10-01 Marek Safar <marek.safar@gmail.com>
761 * anonymous.cs: Use full type parameters of parent generic
762 containers. Removed unnecessary AddParentStoreyReference call.
764 2008-10-01 Marek Safar <marek.safar@gmail.com>
766 A fix for bug #324702
767 * class.cs: Use better shorter names for explicit interface member
770 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
772 2008-10-01 Marek Safar <marek.safar@gmail.com>
774 * expression.cs: Use new interface to check fixed expression.
776 2008-10-01 Marek Safar <marek.safar@gmail.com>
778 A fix for bug #421101
779 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
780 interface to check for fixed fixed-buffers.
782 2008-10-01 Marek Safar <marek.safar@gmail.com>
784 A fix for bug #429264
785 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
787 * delegate.cs: Removed unnecessary casts.
789 2008-09-30 Marek Safar <marek.safar@gmail.com>
791 A fix for bug #352151
792 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
793 class.cs: Fixed already defined explicit interface members check.
795 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
797 cs-tokenizer.cs: Fix typo.
799 2008-09-28 Miguel de Icaza <miguel@novell.com>
801 * eval.cs (InteractiveBase): The quit command now just sets a
802 flag, instead of calling Environment.Exit(), it is milder on
805 CompiledMethod is now in Mono.CSharp, not nested inside
806 the Evaluator, it was inconvenient to use.
808 2008-09-27 Miguel de Icaza <miguel@novell.com>
810 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
811 code to be invoked without having to reparse.
813 2008-09-27 Miguel de Icaza <miguel@novell.com>
815 * ecore.cs: The recent changes to FieldExpr broke this as well.
816 Fixes LINQ queries in the interactive shell.
818 * Multiple files: indentation fixing for the Mono coding
819 guidelines for the switch statement.
821 * eval.cs: Make the Evaluator API thread safe.
823 2008-09-26 Marek Safar <marek.safar@gmail.com>
825 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
828 2008-09-26 Marek Safar <marek.safar@gmail.com>
830 A fix for bug #325326
831 * statement.cs: Check possible mistaken empty statement using
832 explicit blocks only.
834 2008-09-25 Miguel de Icaza <miguel@novell.com>
836 * eval.cs (LoadAssembly, ReferenceAssembly): Call
837 RootNamespace.ComputeNamespaces to update the internal list of
838 namespaces, this is no longer done for us.
840 (InteractiveBase): Use the Evaluator APIs instead of calling into
843 2008-09-25 Marek Safar <marek.safar@gmail.com>
845 A fix for bug #429264
846 * expression.cs: Missing mutator for access to multidimensional
849 2008-09-25 Marek Safar <marek.safar@gmail.com>
851 * class.cs, statement: Emit DebuggerHidden attribute for iterator
854 * driver.cs: Missing input argument check.
856 2008-09-25 Marek Safar <marek.safar@gmail.com>
858 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
859 expression.cs, statement.cs, rootcontext.cs, class.cs,
860 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
863 2008-09-24 Miguel de Icaza <miguel@novell.com>
865 * ecore.cs (FieldExpr): Only initialize eclass when we return a
866 fully constructed FieldExpr, fixes the regression introduced in
869 * ecore.cs, expression.cs: Plug back the eclass initialization as
870 otherwise it regresses `csharp'.
872 2008-09-24 Marek Safar <marek.safar@gmail.com>
874 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
875 ecore.cs, attribute.cs: Moved obsolete method checks from emit
876 phase to resolve phase. It resolves problems with expression trees
877 and fixes bugs #323796, #325156.
879 2008-09-23 Marek Safar <marek.safar@gmail.com>
881 * codegen.cs: Report better error when symbol writer is missing.
883 2008-09-23 Marek Safar <marek.safar@gmail.com>
885 * codegen.cs: Set .NET symbol writer.
887 * decl.cs: Guard against null generic arguments.
889 * report.cs: Don't report exactly same additional details.
891 2008-09-22 Marek Safar <marek.safar@gmail.com>
893 A fix for bug #324917
894 * cs-parser.jay: Add missing multidimensional non-expression type
897 2008-09-22 Marek Safar <marek.safar@gmail.com>
899 A fix for bug #428191
900 * anonymous.cs: Create an outer generic fields also for non-storey
903 2008-09-22 Marek Safar <marek.safar@gmail.com>
905 A fix for bug #378294
906 * class.cs: Make fixed size buffers gmcs feature only.
908 2008-09-22 Marek Safar <marek.safar@gmail.com>
910 A fix for bug #355622, #324993
911 * assign.cs, const.cs, class.cs: Create new EmitContext for each
914 2008-09-19 Marek Safar <marek.safar@gmail.com>
916 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
919 2008-09-19 Marek Safar <marek.safar@gmail.com>
921 A fix for bug #416110
922 * generic.cs: Struct constraint results in default ctor and
923 ValueType base type constraint to be set.
925 2008-09-19 Marek Safar <marek.safar@gmail.com>
927 A fix for bug #423791
928 * generic.cs: Fixed params output type type-inference.
930 2008-09-19 Marek Safar <marek.safar@gmail.com>
932 * cs-parser.jay, expression.cs: Fixed few expression crashes.
934 2008-09-19 Marek Safar <marek.safar@gmail.com>
936 * cs-tokenizer.cs: Don't break on extra partial modifier.
938 2008-09-19 Marek Safar <marek.safar@gmail.com>
940 A fix for bug #427592
941 * generic.cs: Use common parameter resolve method.
943 2008-09-18 Marek Safar <marek.safar@gmail.com>
945 A fix for bug #414758
946 * expression.cs, ecore.cs: Fixed crash when accessing non-static
949 2008-09-18 Marek Safar <marek.safar@gmail.com>
951 * driver.cs, namespace.cs: Read types and namespaces after all
952 requested assemblies are loaded, fixes issues with System.Core
953 auto-reference, and #419888.
955 2008-09-18 Marek Safar <marek.safar@gmail.com>
957 A fix for bug #417705
958 * cs-parser.jay: Fixed as/is operator expression split.
960 2008-09-18 Marek Safar <marek.safar@gmail.com>
962 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
963 Fixed expression tree representation of empty new expression and
964 new initializer expression.
966 2008-09-18 Miguel de Icaza <miguel@novell.com>
968 * eval.cs: Remove warning, keep reference to driver around.
970 * Hide fields that do not need to be public.
972 2008-09-17 Marek Safar <marek.safar@gmail.com>
974 A fix for bug #426385
975 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
976 conversion for array elements.
978 2008-09-17 Marek Safar <marek.safar@gmail.com>
980 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
981 void parsing conflicts.
983 2008-09-15 Marek Safar <marek.safar@gmail.com>
985 A fix for bug #425601
986 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
987 System.Core only when there is no custom ExtensionAttribute
990 2008-09-15 Miguel de Icaza <miguel@novell.com>
992 * namespace.cs: Do not report CS0246 (name
994 2008-09-12 Marek Safar <marek.safar@gmail.com>
996 A fix for bug #425669
997 * generic.cs: Don't cache generic static anonymous method
1000 2008-09-12 Marek Safar <marek.safar@gmail.com>
1002 * generic.cs, class.cs, delegate.cs: Check recursive inherited
1003 conflicting constraints.
1005 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
1007 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
1010 2008-09-12 Marek Safar <marek.safar@gmail.com>
1012 * literal.cs, convert.cs, expression.cs, statement.cs: More null
1013 to null pointer conversion fixes.
1015 2008-09-11 Marek Safar <marek.safar@gmail.com>
1017 * cs-parser.jay, expression.cs: An implicitly typed local variable
1018 declarator cannot use an array initializer.
1020 2008-09-11 Marek Safar <marek.safar@gmail.com>
1022 * cs-parser.jay: Reduced number of printed tokens, add sorting.
1024 2008-09-11 Marek Safar <marek.safar@gmail.com>
1026 * generic.cs (InflatedConstraints): Don't crash when constraints
1029 * cs-parser.jay: const_declarator is a block.
1031 * constant.cs: Check for not allowed NaN conversions.
1033 2008-09-10 Miguel de Icaza <miguel@novell.com>
1035 * driver.cs: Drop --shell argument, the compiler is no longer a
1038 * eval.cs: Move most of the code that deals with evaluation into
1039 this file and document the public API from repl.cs
1041 * repl.cs: Remove from here.
1043 2008-09-10 Marek Safar <marek.safar@gmail.com>
1045 A fix for bug #424684
1046 * generic.cs: Generic class constraints must come first.
1048 2008-09-09 Miguel de Icaza <miguel@novell.com>
1050 * cs-parser.jay: Improve error reporting for syntax errors in
1051 statements and expressions, we now report the expected tokens
1052 instead of reporting the useless "; expected".
1054 Drop the strings from the token declaration, it turns out that
1055 they did not do what I thought they did. Instead they were adding
1056 two sets of tokens to the tables.
1058 2008-09-09 Marek Safar <marek.safar@gmail.com>
1060 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
1061 delegate.cs: Share special type check.
1063 2008-09-09 Marek Safar <marek.safar@gmail.com>
1065 A fix for bug #423981
1066 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
1068 2008-09-09 Marek Safar <marek.safar@gmail.com>
1070 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
1073 2008-09-09 Marek Safar <marek.safar@gmail.com>
1075 A fix for bugs: #324750, #335946
1076 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
1077 lookup rule to determine ?-based tokens.
1079 2008-09-08 Miguel de Icaza <miguel@novell.com>
1081 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
1082 expressions (like event adding or removing) end up here, so we
1083 need to treat those as statements.
1085 Add LoadAssembly method.
1087 2008-09-04 Miguel de Icaza <miguel@novell.com>
1089 * repl.cs: Add Time method.
1091 2008-09-05 Marek Safar <marek.safar@gmail.com>
1093 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
1095 2008-09-05 Miguel de Icaza <miguel@novell.com>
1097 * repl.cs: Add workaround for old compilers.
1099 2008-09-04 Jb Evain <jbevain@novell.com>
1101 * repl.cs (PrettyPrint): pretty print everything that
1102 implements IDictionary, as well as IEnumerables. Also,
1103 add a quit helper property.
1105 2008-09-04 Marek Safar <marek.safar@gmail.com>
1107 * constant.cs: Better error reporting for decimal literals.
1109 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
1112 2008-09-04 Marek Safar <marek.safar@gmail.com>
1113 Miguel de Icaza <miguel@novell.com>
1115 A fix for bug #422951
1116 * assign.cs (Assign.DoResolve): Perform the type conversions
1117 checks before we attempt to initialize `New' initializers.
1119 2008-09-04 Marek Safar <marek.safar@gmail.com>
1121 A fix for bug #422853
1122 * delegate.cs (DelegateCreation): Add special handling for
1123 EmptyExpression.Null instance expression which is just another
1124 hack for undecided member instance exression.
1126 2008-09-04 Marek Safar <marek.safar@gmail.com>
1128 * expression.cs, ecore.cs: Emit full expression tree for reduced
1131 2008-09-04 Marek Safar <marek.safar@gmail.com>
1133 * expression.cs (This): Guard against multi-resolving.
1135 * ecore.cs, statement.cs (Throw): Simplified.
1137 * flowanalysis.cs: Also verify event fields.
1139 2008-09-04 Miguel de Icaza <miguel@novell.com>
1141 * assign.cs (Assign.DoResolve): Perform the type conversions
1142 checks before we attempt to initialize `New' initializers.
1144 * repl.cs (PrettyPrint): Add Hashtable prettyprint
1146 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
1149 * repl.cs: Update help.
1151 2008-09-03 Miguel de Icaza <miguel@novell.com>
1153 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
1154 handling of the default config handling, including the special
1155 treatment of System.Core assembly.
1157 Fixes the REPL processing for LINQ.
1159 2008-09-03 Marek Safar <marek.safar@gmail.com>
1161 A fix for bug #422507
1162 * expression.cs (UnboxCast): Add missing child expression mutator.
1164 2008-09-03 Marek Safar <marek.safar@gmail.com>
1166 * driver.cs: Don't self reference System.Core assembly.
1168 2008-09-03 Marek Safar <marek.safar@gmail.com>
1170 A fix for bug #422507
1171 * expression.cs (StringConcat): Add missing type mutator.
1173 2008-09-03 Marek Safar <marek.safar@gmail.com>
1175 * generic.cs (TypeInferenceContext): Follow equality rule for
1176 constructed type lower bound type inference.
1178 2008-09-02 Miguel de Icaza <miguel@novell.com>
1180 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
1181 <dblank@cs.brynmawr.edu> which updates the cursor position on
1184 2008-09-02 Marek Safar <marek.safar@gmail.com>
1186 A fix for bug #367145
1187 * driver.cs: Fixed import of extension methods when using -noconfig
1190 2008-09-02 Marek Safar <marek.safar@gmail.com>
1192 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
1193 version from non-generic implementation instead.
1195 2008-09-01 Marek Safar <marek.safar@gmail.com>
1197 A fix for bug #418908
1198 * class.cs: Use AddScopeStatement for field initializers.
1200 2008-09-01 Marek Safar <marek.safar@gmail.com>
1202 A fix for bug #415385
1203 * ecore.cs, convert.cs: Do method group conversion for equal group types.
1205 2008-09-01 Marek Safar <marek.safar@gmail.com>
1207 A fix for bug #421736
1208 * iterators.cs: Don't crash on unreachable iterators.
1210 2008-09-01 Marek Safar <marek.safar@gmail.com>
1212 A fix for bug #421628
1213 * parameter.cs, attribute.cs: Clone also parameter attributes.
1215 2008-08-30 Miguel de Icaza <miguel@novell.com>
1217 * namespace.cs (LookupType): In EvalMode, try to replace
1218 the TypeBuilder from our cache with a Type as Reflection.Emit does
1219 not like to mix code from older assemblies emitted and new
1222 This sounds like a serious Mono bug that prevents multiple
1223 assemblies to be generated and consumed at the same time.
1225 * cs-parser.jay (push_current_class): Do not make interactive
1226 classes internal or private, make them public as we currently
1227 generate each new class in a new assembly.
1229 2008-08-29 Miguel de Icaza <miguel@novell.com>
1231 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
1232 remove types that are entered into the global namespace during
1233 parsing so that we can remove them on failure.
1235 * cs-parser.jay: Parsing: we now keep track of types that are
1236 entered into global variables and queue those in case the parsing
1239 This happens in a few situations: during partial-input, we invoke
1240 the parser repeatedly for example with the string "class X", this
1241 would cause X to be registed, and we need to remove this
1242 registration so that another parse attempt later with say "class X {"
1243 would actually work.
1245 Additionally, if there is an error in the resolution phase, for
1246 example: "class X : NonExistant {}" th
1248 * cs-parser.jay: Be more precise with the errors being raised,
1249 instead of flagging all exceptions during parsing to be attributed
1250 to the parsing process, distinguish those from errors happening in
1251 the actions and hint that using -v would produce the actual
1254 * repl.cs: Do not load all compiler references on each reset,
1255 doing the partial reset takes care of this.
1257 2008-08-28 Miguel de Icaza <miguel@novell.com>
1259 * repl.cs: Add support for loading all the files from
1260 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
1263 Introduce a micro-parser that is able to deambiguate on its input
1264 whether we are dealing with a compilation unit (namespace, class,
1265 interface, struct, delegate) declaration or a statement. This
1266 allows both declarations and statements to be entered.
1268 Set history size by default to 300 lines.
1270 Instead of distinguishing based on the parser.InteractiveResult,
1271 have only two cases: statements were parsed, or a compilation unit
1272 was. Always pull the Using statement additions from the
1273 compilation unit parse.
1275 * cs-tokenizer.cs: Rename tokens to better describe their intent
1276 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
1278 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
1279 EvalMode is used to trigger the lookup of global variables while
1280 StatementMode is used turn variable declarations into static
1283 * getline.cs: Allow history size to be set.
1285 2008-08-29 Marek Safar <marek.safar@gmail.com>
1287 A fix for bug #360755
1288 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
1290 2008-08-29 Marek Safar <marek.safar@gmail.com>
1292 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
1294 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
1295 member name, it is too confusing
1297 * decl.cs, class.cs: Don't report unused fields with attached attribute.
1299 * rootcontext.cs: Finally default to warning level 4.
1301 2008-08-28 Marek Safar <marek.safar@gmail.com>
1303 * class.cs (CheckBase): Ignore overloaded operators.
1305 2008-08-28 Marek Safar <marek.safar@gmail.com>
1307 A fix for bug #420830
1308 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
1310 2008-08-28 Marek Safar <marek.safar@gmail.com>
1312 A fix for bug #420832
1313 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
1315 2008-08-28 Marek Safar <marek.safar@gmail.com>
1317 A fix for bug #420386
1318 * nullables.cs: Fixed logic of nullable user comparison operators involving
1321 2008-08-28 Marek Safar <marek.safar@gmail.com>
1323 * attribute (IsClsCompliant): Use FALSE value for pointer types.
1325 2008-08-27 Miguel de Icaza <miguel@novell.com>
1327 * repl.cs: Add support for aborting the running code with C-c.
1329 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
1331 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
1333 2008-08-27 Miguel de Icaza <miguel@novell.com>
1335 * cs-parser.jay (interactive_statement_list): A new set of rules
1336 for hosting statements that uses the "interactive_" prefix.
1338 * repl.cs: Add support for parsing `using' as a statement or as a
1339 directive. Deambiguating before passing this to the parser.
1341 We need to distinguish statement_expressions that occur at the
1342 toplevel vs those that occur embedded into expressions.
1344 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
1345 that fixes the cursor key handling, and a history bug.
1347 2008-08-26 Miguel de Icaza <miguel@novell.com>
1349 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
1350 limitations in Console, instead the 2.0 bootstrap libraries now
1351 include the Console bits.
1353 Also, remove the use of Nullables from getline.cs
1357 Interactive support for the C# compiler. Use gmcs --shell to
1358 enter a read-eval-print loop shell.
1360 Docs: http://www.mono-project.com/CsharpRepl
1362 * sources: include repl.cs here and getline.cs for gmcs.exe,
1363 everything else is getline.cs impaired.
1365 * Makefile: when bootstrapping pass a special flag
1366 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
1367 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
1368 This distinguishes those two cases.
1370 * repl.cs: Support for a read-eval-print loop. Will be soon
1371 refactored into eval support and then REPL on top of it.
1373 * ecore.cs: If a simplename lookup fails, before erroring out,
1374 if we are in EvalMode to resolve the name to a declaration in the
1377 This means that variable declarations that happened in previous
1378 classes (as repl puts every statement in a separate class) are
1379 made visible in this way.
1381 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
1382 triggered an error due to the end of file being reached. This is
1383 used to do multi-line input, and notify the caller that the user
1384 needs to provide more text before a successful parse.
1386 Add new grammar rules after the INTERACTIVE_PARSER token is seen
1387 to drive the evaluation with a custom wrapper.
1389 * driver.cs: Add support for --shell, and refactor some code to be
1392 * namespace.cs: Add support for serializing the contents of the
1393 namespaces and reloading them.
1395 * getline.cs: A managed implementation of ReadLine under
1396 X11/Apache2 license terms. Easy to embed in other applications as
1399 * namespace.cs: Add some functions to save and restore the
1402 * rootcontext.cs: New public field.
1404 * cs-tokenizer.cs: Add support for one of the possible characters
1405 we introduce into the token stream.
1407 This patch does not affect the regular tokenization process, the
1408 only performance hit would happen if there is an invalid character
1409 on the input string.
1411 * support.cs: Move isatty helper routine here.
1413 * codegen.cs: Small cleanup, and add a mechanism to initialize the
1414 code generator for in-memory assemblies.
1416 2008-08-26 Marek Safar <marek.safar@gmail.com>
1418 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
1419 parameter cannot be always used as a type.
1421 2008-08-21 Marek Safar <marek.safar@gmail.com>
1423 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
1425 2008-08-21 Marek Safar <marek.safar@gmail.com>
1427 * convert.cs: Implement explicit array to IList<T> conversion.
1429 2008-08-20 Marek Safar <marek.safar@gmail.com>
1431 A fix for bug #362740
1432 * cs-tokenizer.cs: Handle UTF-16 surrogates.
1434 2008-08-20 Marek Safar <marek.safar@gmail.com>
1436 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
1437 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
1438 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
1439 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
1440 handling to use just one type of infrastructure and deal with generics
1443 2008-07-23 Martin Baulig <martin@ximian.com>
1445 *** Merged this from trunk revision 108527 ***
1448 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
1449 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
1452 2008-08-15 Marek Safar <marek.safar@gmail.com>
1454 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
1457 2008-08-15 Marek Safar <marek.safar@gmail.com>
1459 * delegate.cs: Fixed compiler crash when creating delegate using partial
1462 * typemanager.cs: MulticastDelegate is not a delegate.
1464 2008-08-14 Marek Safar <marek.safar@gmail.com>
1466 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
1469 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
1471 * cs-parser.jay (type): Allow 'var' in mcs too.
1472 (local_variable_type): Likewise.
1474 2008-08-14 Marek Safar <marek.safar@gmail.com>
1476 * driver.cs: Removed broken -noconfig variants.
1478 2008-08-14 Marek Safar <marek.safar@gmail.com>
1480 A fix for bug #417078
1481 * expression.cs: Emit correctly left side pointer operators.
1483 2008-08-13 Marek Safar <marek.safar@gmail.com>
1485 * generic.cs, lambda.cs: Inflate method generic arguments only.
1487 2008-08-12 Marek Safar <marek.safar@gmail.com>
1489 * class.cs: Fixed struct layout check regression.
1491 2008-08-12 Marek Safar <marek.safar@gmail.com>
1493 * cs-parser.jay, enum.cs: Simplified enum parsing.
1495 * decl.cs: Check all type parameters conflicts.
1497 * expression.cs, statement.cs, attribute.cs: More expression checks.
1499 2008-08-11 Marek Safar <marek.safar@gmail.com>
1501 * generic.cs: Add type inference types restriction.
1503 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
1504 anonymous.cs, expression.cs: Allocate less accessor parameters.
1506 2008-08-08 Marek Safar <marek.safar@gmail.com>
1508 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
1511 2008-08-08 Marek Safar <marek.safar@gmail.com>
1513 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
1515 2008-08-07 Marek Safar <marek.safar@gmail.com>
1517 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
1518 Also fixes #362146 and #381592.
1520 2008-08-07 Marek Safar <marek.safar@gmail.com>
1522 * ecore.cs: Reduced constant cannot be used as an attribute value.
1524 * cs-parser.jay: Base expression has to be a type.
1526 * expression.cs (Conditional): Uses ReducedExpression.
1528 2008-08-06 Marek Safar <marek.safar@gmail.com>
1530 A fix for bug #376826
1531 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
1532 address of hoisted local variable or parameter cannot be taken.
1534 2008-08-05 Marek Safar <marek.safar@gmail.com>
1536 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
1537 anonymous method inside checked/unchecked expression.
1539 2008-08-05 Marek Safar <marek.safar@gmail.com>
1541 * typemanager.cs (IsEqual): Guard against null.
1543 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
1544 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
1545 routine. Fixed few misleading conversion errors.
1547 2008-08-04 Marek Safar <marek.safar@gmail.com>
1549 * class.cs: Consider generics when checking cycles in struct layout.
1551 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
1553 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
1555 2008-08-04 Marek Safar <marek.safar@gmail.com>
1557 A fix for bug #414165
1558 * anonymous.cs: Use same anonymous implementation method for all anonymous
1561 2008-08-04 Marek Safar <marek.safar@gmail.com>
1563 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
1566 2008-08-04 Marek Safar <marek.safar@gmail.com>
1568 * cs-parser.jay: Typeof argument has to be a type expression.
1570 * namespace.cs: Check alias and namespace definitions collisions.
1572 * class.cs, pending.cs: Moved explicit interface accessor implementation
1575 * delegate.cs, expression.cs: Verify special name invocations.
1577 2008-08-01 Marek Safar <marek.safar@gmail.com>
1579 * cs-parser.jay: Don't choke on empty generic type arguments.
1581 * cs-tokenizer.cs: Handle escaped preprocessor directives.
1583 * expression.cs, ecore.cs: Minor expressions bugs.
1585 2008-08-01 Marek Safar <marek.safar@gmail.com>
1587 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
1588 and added more error handling.
1590 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
1592 * modifiers.cs, enum.cs: Fixed.
1594 2008-07-31 Jb Evain <jbevain@novell.com>
1596 * driver.cs: remove -pkg ability of smcs.
1598 2008-07-30 Marek Safar <marek.safar@gmail.com>
1600 * statement.cs (Switch): Correctly set empty default target for single
1603 2008-07-30 Marek Safar <marek.safar@gmail.com>
1605 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
1606 string switch statement implementation to use string dictionary which
1607 significantly (2-8x) improves performance of generated code.
1609 2008-07-29 Marek Safar <marek.safar@gmail.com>
1611 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
1612 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
1614 2008-07-29 Marek Safar <marek.safar@gmail.com>
1616 A fix for bug #412595
1617 * typemanager.cs, convert.cs, expression.cs: Some types are never
1618 convertible to each other.
1620 2008-07-29 Marek Safar <marek.safar@gmail.com>
1622 * nullable.cs (CreateNullConstant): An error messages update.
1624 2008-07-29 Marek Safar <marek.safar@gmail.com>
1626 A fix for bug #412595
1627 * cfold.cs: Don't cast undefined bool constant.
1629 2008-07-29 Martin Baulig <martin@ximian.com>
1632 (SymbolWriter.Reset): New public static method.
1635 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
1637 2008-07-28 Marek Safar <marek.safar@gmail.com>
1639 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
1641 * expression.cs (ElementAccess): Exact size allocation.
1643 2008-07-26 Marek Safar <marek.safar@gmail.com>
1645 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
1647 2008-07-25 Marek Safar <marek.safar@gmail.com>
1649 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
1651 * class.cs: Removed $PRIVATE$ field hack which caused problems during
1654 2008-07-25 Marek Safar <marek.safar@gmail.com>
1656 A fix for bug #412217
1657 * assign.cs: Mutate also assignment type.
1659 2008-07-25 Marek Safar <marek.safar@gmail.com>
1661 A fix for bug #323644
1662 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
1665 2008-07-25 Marek Safar <marek.safar@gmail.com>
1667 A fix for bug #412134
1668 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
1669 non-enumerable operands when overloading equality or bitwise operators.
1671 2008-07-25 Marek Safar <marek.safar@gmail.com>
1673 * anonymous.cs: Cache closed generic anonymous method delegates.
1675 2008-07-24 Marek Safar <marek.safar@gmail.com>
1677 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
1678 anonymous.cs, statement.cs: Always emit anonymous method as static method
1679 when is instance free. Use nesting for nested anynomous methods blocks.
1681 2008-07-23 Marek Safar <marek.safar@gmail.com>
1683 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
1686 2008-07-23 Marek Safar <marek.safar@gmail.com>
1688 * expression.cs: Removed MakeSimpleCall.
1690 2008-07-23 Marek Safar <marek.safar@gmail.com>
1692 A fix for bug #323012
1693 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
1694 Base method implementing interface has to be public.
1696 2008-07-23 Marek Safar <marek.safar@gmail.com>
1698 * cs-parser.jay: Don't break on missing argument.
1700 2008-07-22 Marek Safar <marek.safar@gmail.com>
1702 A fix for bug #320993
1703 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
1704 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
1706 2008-07-22 Marek Safar <marek.safar@gmail.com>
1708 A fix for bug #320748
1709 * convert.cs: Implicit user operators cannot convert to interfaces
1711 2008-07-22 Marek Safar <marek.safar@gmail.com>
1713 A fix for bug #312686
1714 * driver.cs: Ignore empty assembly references.
1716 2008-07-22 Marek Safar <marek.safar@gmail.com>
1718 A fix for bug #387040
1719 * ecore.cs: Skip constrains check for an explicit implementation.
1721 2008-07-21 Marek Safar <marek.safar@gmail.com>
1723 A fix for bug #409045
1724 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
1725 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
1726 identifiers are file specific unless passed as input arguments.
1728 2008-07-21 Marek Safar <marek.safar@gmail.com>
1730 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
1731 to emit UnmanagedMarshal data under 2.0 profile.
1733 2008-07-21 Marek Safar <marek.safar@gmail.com>
1735 A fix for bug #410369
1736 * parameter.cs: Clone correctly ParamsParameter.
1738 2008-07-21 Marek Safar <marek.safar@gmail.com>
1740 * expression.cs (Argument): Always report type for type based expressions
1743 2008-07-18 Marek Safar <marek.safar@gmail.com>
1745 A fix for bug #410666
1746 * anonymous.cs: Correctly initialize generic storey reference.
1748 2008-07-18 Marek Safar <marek.safar@gmail.com>
1750 * convert.cs: Don't box same type arguments.
1752 2008-07-18 Marek Safar <marek.safar@gmail.com>
1754 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
1755 Finished missing generic type mutators.
1757 2008-07-18 Marek Safar <marek.safar@gmail.com>
1759 * iterators.cs, statement.cs: Finished statements CloneTo.
1761 2008-07-18 Marek Safar <marek.safar@gmail.com>
1763 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
1765 * expression.cs: Emit optimized default value expressions in expression tree
1768 2008-07-18 Marek Safar <marek.safar@gmail.com>
1770 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
1772 2008-07-17 Marek Safar <marek.safar@gmail.com>
1774 A fix for bug #367536
1775 * cs-parser.jay: Check static constructor of generic types for an access
1778 2008-07-17 Marek Safar <marek.safar@gmail.com>
1780 A fix for bug #353800
1781 * lambda.cs: Emit ret for contextual statements.
1783 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
1784 up emitting redundant ret for all anonymous methods with return.
1786 2008-07-17 Marek Safar <marek.safar@gmail.com>
1788 A fix for bug #365188
1789 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
1790 create anonymous method storey in unreachable block.
1792 2008-07-17 Marek Safar <marek.safar@gmail.com>
1794 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
1795 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
1796 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
1797 statement.cs: Fixed relevant defects found by Gendarme.
1799 2008-07-17 Marek Safar <marek.safar@gmail.com>
1801 A fix for bug #325291
1802 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
1803 statement.cs: Replaced IAnonymousHost with top level block flag.
1805 2008-07-17 Marek Safar <marek.safar@gmail.com>
1807 * cs-parser.jay: Clean up unused open_parens.
1809 2008-07-17 Marek Safar <marek.safar@gmail.com>
1811 * ecore.cs: Custom error message for a range variable assignment.
1813 2008-07-16 Marek Safar <marek.safar@gmail.com>
1815 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
1818 2008-07-16 Marek Safar <marek.safar@gmail.com>
1820 * literal.cs: Null literal is of object type.
1822 2008-07-16 Marek Safar <marek.safar@gmail.com>
1824 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
1825 expression of nullable equality comparison.
1827 2008-07-15 Marek Safar <marek.safar@gmail.com>
1829 * expression.cs(PointerArithmetic): Removed redundant assignment.
1831 2008-07-15 Marek Safar <marek.safar@gmail.com>
1833 * decl.cs (GetSignatureForError): Report full namespace name for containers.
1835 2008-07-14 Marek Safar <marek.safar@gmail.com>
1837 A fix for bug #408361
1838 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
1839 they are replaced by GetMethod.
1841 2008-07-14 Marek Safar <marek.safar@gmail.com>
1843 A fix for bug #408721 by jeremie.laval@gmail.com
1844 * expression.cs (Indirection): Implemented CloneTo.
1846 2008-07-14 Marek Safar <marek.safar@gmail.com>
1848 * statement.cs (AssignableSlots): Temporary disabled variable initialization
1851 2008-07-14 Marek Safar <marek.safar@gmail.com>
1853 * report.cs (EnableReporting): Don't reinitialize 0-based values.
1855 2008-07-11 Marek Safar <marek.safar@gmail.com>
1857 * linq.cs: Reset tranparent parameter counter in probing mode.
1859 2008-07-11 Marek Safar <marek.safar@gmail.com>
1861 * anonymous.cs: Mutate anonymous method type.
1863 2008-07-11 Marek Safar <marek.safar@gmail.com>
1865 * ecore.cs, anonymous.cs: Mutate field expressions.
1867 2008-07-10 Marek Safar <marek.safar@gmail.com>
1869 A fix for bug #369670
1870 * linq.cs, statement.cs: Use explicit block for query expressions variables.
1872 2008-07-10 Marek Safar <marek.safar@gmail.com>
1874 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
1876 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
1879 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
1880 only one '>', and finds a '>>', abort the generic lookahead.
1882 2008-07-10 Marek Safar <marek.safar@gmail.com>
1884 A fix for bug #319902
1885 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
1887 2008-07-10 Marek Safar <marek.safar@gmail.com>
1889 A fix for bug #406371
1890 * statement.cs: Moved EmitSymbolInfo to Block.
1892 2008-07-09 Marek Safar <marek.safar@gmail.com>
1894 * ecore.cs: Report better error for extension method overload failures.
1896 2008-07-09 Marek Safar <marek.safar@gmail.com>
1898 * expression.cs (Is): No need to box reference values.
1900 2008-07-09 Marek Safar <marek.safar@gmail.com>
1902 * class.cs: Use event resolve context when initializing CreateEmitContext.
1904 2008-07-09 Marek Safar <marek.safar@gmail.com>
1906 A fix for bug #394436
1907 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
1908 method used inside expression trees. Added more LINQ to expression tree
1911 2008-07-08 Marek Safar <marek.safar@gmail.com>
1913 A fix for bug #378189, #370577
1914 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
1917 2008-07-08 Marek Safar <marek.safar@gmail.com>
1919 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
1922 2008-07-08 Marek Safar <marek.safar@gmail.com>
1924 A fix for bug #406702
1925 * anonymous.cs: Always park anonymous method in the nearest parent storey.
1927 2008-07-07 Marek Safar <marek.safar@gmail.com>
1929 A fix for bug #406648
1930 * cs-parser.jay: Report nullable use in mcs for some cases.
1932 2008-07-07 Marek Safar <marek.safar@gmail.com>
1934 * ecore.cs: Improved argument mismatch error messages.
1936 2008-07-07 Marek Safar <marek.safar@gmail.com>
1938 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
1940 2008-07-07 Marek Safar <marek.safar@gmail.com>
1942 * expression.cs (TypeOf): Mutate type argument.
1944 2008-07-04 Marek Safar <marek.safar@gmail.com>
1946 * class.cs: Report missing partial modifier for correct type.
1948 2008-07-04 Marek Safar <marek.safar@gmail.com>
1950 * ecore.cs, expression.cs (VariableReference): Variable property is
1953 2008-07-04 Marek Safar <marek.safar@gmail.com>
1955 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
1957 2008-07-04 Marek Safar <marek.safar@gmail.com>
1959 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
1962 2008-07-04 Marek Safar <marek.safar@gmail.com>
1964 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
1965 anonymous method storey to an instance method when only "this" is hoisted.
1967 2008-07-03 Marek Safar <marek.safar@gmail.com>
1969 A fix for bug #321615
1970 * expression.cs: Pointer comparisons use unsigned operator.
1972 2008-07-03 Marek Safar <marek.safar@gmail.com>
1974 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
1976 2008-07-02 Marek Safar <marek.safar@gmail.com>
1978 A fix for bug #404905
1979 * class.cs: Always initialize local unsafe variables.
1981 2008-06-30 Marek Safar <marek.safar@gmail.com>
1983 A fix for bug #396987
1984 * expression.cs (NewInitialize): Clear local temporary variable for next run
1986 2008-06-27 Marek Safar <marek.safar@gmail.com>
1988 A fix for bug #401020
1989 * ecore.cs: Both types and modifiers have to match for ref and out arguments
1991 2008-06-27 Marek Safar <marek.safar@gmail.com>
1993 A fix for bug #398319
1994 * cs-parser.jay: Implemented undocumented base access expression inside
1997 2008-06-26 Marek Safar <marek.safar@gmail.com>
1999 A fix for bug #404227
2000 * cs-parser.jay: Parse namespace declaration using qualified identifier.
2002 2008-06-26 Marek Safar <marek.safar@gmail.com>
2004 A fix for bug #404227
2005 * convert.cs: Fixed explicit array to interface cast.
2007 2008-06-26 Marek Safar <marek.safar@gmail.com>
2009 A fix for bug #403894
2010 * delegate.cs: Mutate DelegateInvocation type.
2012 2008-06-26 Marek Safar <marek.safar@gmail.com>
2014 A fix for bug #379348
2015 * delegate.cs: Box a load of generic parameters.
2017 2008-06-26 Marek Safar <marek.safar@gmail.com>
2019 * expression.cs: Add an array creation arguments mutate.
2021 2008-06-26 Marek Safar <marek.safar@gmail.com>
2023 A fix for bug #386068
2024 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
2027 2008-06-25 Marek Safar <marek.safar@gmail.com>
2029 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
2032 2008-06-25 Marek Safar <marek.safar@gmail.com>
2034 A fix for bug #403518
2035 * delegate.cs: Type correctly anonymous method new invocation.
2037 2008-06-24 Marek Safar <marek.safar@gmail.com>
2039 A fix for bug #394826
2040 * anonymous.cs: Fully qualify members when resolving anonymous type internal
2043 2008-06-24 Marek Safar <marek.safar@gmail.com>
2045 A fix for bug #394826
2046 * anonymous.cs, iterators.cs: Construct generic storey only when is really
2049 2008-06-24 Marek Safar <marek.safar@gmail.com>
2051 * class.cs: Clone indexer parameters for localized capturing.
2053 2008-06-24 Marek Safar <marek.safar@gmail.com>
2055 A fix for bug #402379
2056 * expression.cs: Don't crash when an object initializer resolve fails.
2058 2008-06-24 Marek Safar <marek.safar@gmail.com>
2060 A fix for bug #402888
2061 * expression.cs: Mutate conditional expression.
2063 2008-06-24 Marek Safar <marek.safar@gmail.com>
2065 A fix for bug #401012
2066 * class.cs: Keep StructLayout in shared container.
2068 2008-06-24 Marek Safar <marek.safar@gmail.com>
2070 A fix for bug #400438
2071 * decl.cs, class.cs: Only properties can be automatically implemented.
2073 2008-06-24 Marek Safar <marek.safar@gmail.com>
2075 * statement.cs (ChangeToIterator): Copy also labels.
2077 2008-06-23 Marek Safar <marek.safar@gmail.com>
2079 * ecore.cs: Pass type argument details to parent extension method.
2081 2008-06-23 Marek Safar <marek.safar@gmail.com>
2083 A fix for bug #375966
2084 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
2086 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
2088 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
2090 2008-06-22 Marek Safar <marek.safar@gmail.com>
2092 A fix for bug #394347
2093 * anonymous.cs: Cache compatible delegates as compatibility check produces
2094 a new method every time.
2096 2008-06-20 Marek Safar <marek.safar@gmail.com>
2098 * anonymous.cs: Propagate storey reference for single references.
2100 2008-06-20 Marek Safar <marek.safar@gmail.com>
2102 A fix for bug #387615
2103 * assign.cs, expression.cs: Correctly clone compound assignment.
2105 2008-06-19 Marek Safar <marek.safar@gmail.com>
2107 A fix for bug #359611, #359604
2108 * anonymous.cs: Mutate all types of hoisted parameters.
2110 2008-06-19 Marek Safar <marek.safar@gmail.com>
2112 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
2113 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
2114 expression.cs, codegen.cs, statement.cs
2116 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
2117 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
2119 ** Anonymous methods, lambda expressions rewrite **
2121 Anonymous expressions are now resolved when an explicit block is resolved
2122 and they don't require any registration procedure anymore. Further,
2123 anonymous methods are defined when explicit block is emitted which allows
2124 better control of whole process and opens possibilities for more
2125 optimizations as well as alternative to reverse whole process.
2127 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
2128 process consistent and to correctly emit hoisted generic methods when they
2129 have at least 1 hoisted variable.
2131 2008-06-17 Martin Baulig <martin@ximian.com>
2133 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
2135 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
2136 virtual property; check it in Emit().
2137 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
2139 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
2141 (Indexer.Define): Likewise.
2143 2008-06-17 Marek Safar <marek.safar@gmail.com>
2145 * convert.cs: Don't use IsInterface on type arguments.
2147 * delegate.cs: DelegateInvocation uses MethodInfo.
2149 * parameter.cs: Removed IsTypeParameter.
2151 * generic-mcs.cs: More missing stuff.
2153 2008-06-16 Martin Baulig <martin@ximian.com>
2156 (Modifiers.DEBUGGER_HIDDEN): New public const.
2159 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
2162 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
2163 (AbstractPropertyEventMethod): Likewise.
2164 (Constructor.Emit): Likewise.
2165 (SourceMethod.SetCompilerGenerated): Removed.
2167 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
2171 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
2172 if we're an `IteratorHost'.
2173 (AnonymousMethodMethod..ctor): Don't set
2174 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
2177 2008-06-16 Marek Safar <marek.safar@gmail.com>
2179 * statement.cs: Clean-up foreach statements.
2181 2008-06-12 Marek Safar <marek.safar@gmail.com>
2183 * class.cs: Stop using public method which should not exist
2184 (MethodBuilder.SetGenericMethodSignature).
2186 2008-06-11 Martin Baulig <martin@ximian.com>
2189 (Location.LookupFile): Add `CompilationUnit' argument; when given
2190 a relative file name, make it relative to the directory the .cs
2191 file is located in instead of using the current directory.
2193 2008-06-11 Martin Baulig <martin@ximian.com>
2196 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
2197 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
2198 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
2199 (SourceMethod.SetCompilerGenerated): Likewise.
2201 2008-06-11 Marek Safar <marek.safar@gmail.com>
2203 * codegen.cs, driver: Only write symbol file when it's asked for.
2205 2008-06-11 Marek Safar <marek.safar@gmail.com>
2207 * codegen.cs: Don't use assembly writer error handling for symbol writer.
2209 2008-06-10 Martin Baulig <martin@ximian.com>
2211 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
2213 2008-06-09 Marek Safar <marek.safar@gmail.com>
2215 A fix for bug #316290
2216 * expression.cs: Include decimal operators in predefined table.
2218 * parameters.cs: More readonlyness.
2220 2008-06-09 Marek Safar <marek.safar@gmail.com>
2222 A fix for bug #397213
2223 * cs-parser.jay: One more missing current_local_parameters reset.
2225 2008-06-09 Marek Safar <marek.safar@gmail.com>
2227 A fix for bug #396633
2228 * class.cs: Host backing field in partial container.
2230 2008-06-09 Marek Safar <marek.safar@gmail.com>
2232 A fix for bug #397068
2233 * expression.cs: Check both operand types when predefined operator is used.
2235 2008-06-05 Martin Baulig <martin@ximian.com>
2237 Merged the `debugger-kahalo' branch.
2240 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
2241 we're an iterator method.
2242 (SourceMethod): Reflect latest symbol writer changes;
2243 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
2244 now `start_row' and `end_row'.
2245 (Constructor.Emit): Fix the logic whether to emit symbol information.
2247 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
2251 (CompilationUnit): New public class; derives from `SourceFile'.
2252 (SourceFileEntry.DefineSymbolInfo): New public method.
2253 (SourceFileEntry.SetChecksum): New public method.
2254 (Location): Encode hidden line numbers by using `column == 255';
2255 the .ctor now accepts `column == -1' to mark a hidden line number.
2256 (Location.Hidden): New public property.
2257 (Location.CheckPoint): Add `CompilationUnit'.
2258 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
2259 (Location.Push): Add `CompilationUnit compile_unit' argument.
2260 (Location.CompilationUnit): New public property.
2263 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
2265 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
2267 * driver.cs: `SourceFile' -> `CompilationUnit'.
2269 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
2271 * namespace.cs: `SourceFile' -> `CompilationUnit'.
2273 * cs-tokenizer.cs: Add support for `#pragma checksum' and
2277 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
2278 new symbol writer API to also pass the file.
2280 2008-06-05 Marek Safar <marek.safar@gmail.com>
2282 * statement.cs: Emit catch variable assignment using variable expression.
2284 2008-06-05 Marek Safar <marek.safar@gmail.com>
2286 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
2287 with other variable types.
2289 2008-06-04 Marek Safar <marek.safar@gmail.com>
2291 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
2292 GetLength method emit, it breaks resolve rules.
2294 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
2295 Marek Safar <marek.safar@gmail.com>
2297 A fix for bug #395542
2298 * cs-parser.jay: The trailing comma is allowed in anonymous type member
2301 2008-06-02 Marek Safar <marek.safar@gmail.com>
2303 A fix for bug #395287
2304 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
2306 2008-05-31 Marek Safar <marek.safar@gmail.com>
2308 A fix for bug #395845
2309 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
2310 non-nullable parameter type.
2312 2008-05-31 Marek Safar <marek.safar@gmail.com>
2314 * class.cs: Handle contructor initializer as a statement in top-level block.
2316 2008-05-30 Marek Safar <marek.safar@gmail.com>
2318 * attribute.cs: Don't mix old and new corlib types when emitting corlib
2319 security attributes.
2321 2008-05-24 Marek Safar <marek.safar@gmail.com>
2323 * ecore.cs, expression.cs: Small IVariable refactoring.
2325 2008-05-22 Marek Safar <marek.safar@gmail.com>
2327 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
2329 2008-05-21 Marek Safar <marek.safar@gmail.com>
2331 * cs-parser.jay: Removed redundant catch type check.
2333 2008-05-21 Marek Safar <marek.safar@gmail.com>
2335 A fix for bug #390372
2336 * nullable.cs: Set correct return type.
2338 2008-05-21 Marek Safar <marek.safar@gmail.com>
2340 A fix for bug #391062
2341 * typemanager.cs: Fixed crash when comparing null types.
2343 2008-05-21 Marek Safar <marek.safar@gmail.com>
2345 A fix for bug #391871
2346 * cs-parser.jay: Better error handling for invalid catch type.
2348 2008-05-20 Marek Safar <marek.safar@gmail.com>
2350 A fix for bug #392155
2351 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
2353 2008-05-15 Marek Safar <marek.safar@gmail.com>
2355 A fix for bug #390666
2356 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
2359 2008-05-15 Marek Safar <marek.safar@gmail.com>
2361 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
2364 2008-05-13 Marek Safar <marek.safar@gmail.com>
2366 A fix for bug #389625
2367 * delegate.cs, generic.cs: Some progress on method group return type
2370 2008-05-13 Marek Safar <marek.safar@gmail.com>
2372 A fix for bug #378419
2373 * namespace.cs: Inspect also parent namespaces not only namespace entries.
2375 2008-05-12 Marek Safar <marek.safar@gmail.com>
2377 * class.cs (Constructor): Added IsCompilerGenerated.
2379 2008-05-12 Marek Safar <marek.safar@gmail.com>
2381 * expression.cs: Enum binary operators can accept non-enum operand only when
2382 is implicitly convertible to underlying type.
2384 2008-05-12 Marek Safar <marek.safar@gmail.com>
2386 A fix for bug #389272
2387 * support.cs: Workaround System.InvalidOperationException for enums.
2389 2008-05-12 Marek Safar <marek.safar@gmail.com>
2391 A fix for bug #389073
2392 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
2394 2008-05-10 Marek Safar <marek.safar@gmail.com>
2396 * driver.cs: Split Parse.
2398 * location.cs (LookupFile): Uses string.Empty.
2400 2008-05-07 Marek Safar <marek.safar@gmail.com>
2402 * expression.cs, parameter.cs: Small ParameterReference clean up.
2404 2008-05-07 Marek Safar <marek.safar@gmail.com>
2406 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
2407 hack. Fixes #387502.
2409 2008-05-06 Martin Baulig <martin@ximian.com>
2411 * class.cs (Constructor.Emit): Fix the logic whether to emit
2414 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
2417 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
2418 InvalidOperationException when the iterator is before the start or
2421 2008-05-06 Marek Safar <marek.safar@gmail.com>
2423 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
2424 when left is nullable type.
2426 2008-05-06 Marek Safar <marek.safar@gmail.com>
2428 A fix for bug #386628
2429 * expression.cs (LocalVariableReference): Continue in resolving when
2430 variable is not assigned.
2432 2008-05-05 Marek Safar <marek.safar@gmail.com>
2434 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
2435 nullable operations.
2437 2008-05-04 Marek Safar <marek.safar@gmail.com>
2439 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
2440 it saves many redundant temporary variables for nullable operations.
2442 2008-05-03 Marek Safar <marek.safar@gmail.com>
2444 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
2446 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
2449 * nullable.cs: Constant coalescing operator optimizations.
2451 2008-05-03 Marek Safar <marek.safar@gmail.com>
2453 * constant.cs: Use unsigned conversion for values which are unsigned only.
2455 2008-05-03 Marek Safar <marek.safar@gmail.com>
2457 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
2458 coalescing operator as it should be.
2460 2008-05-02 Marek Safar <marek.safar@gmail.com>
2462 A fix for bug #371016
2463 * expression.cs: All predefined delegate operators require implicit method
2466 2008-05-02 Marek Safar <marek.safar@gmail.com>
2468 * constant.cs: Emit long constant as uint when fits the range.
2470 * convert.cs, expression.cs: Fixed few unsafe conversions.
2472 2008-05-02 Marek Safar <marek.safar@gmail.com>
2474 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
2476 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
2479 * convert.cs (ImplicitNumericConversion): Don't modify the type of
2481 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
2483 2008-05-01 Marek Safar <marek.safar@gmail.com>
2485 * constant.cs, literal.cs: IsLiteral property for error reporting.
2487 * ecore.cs, expression.cs: Implemented Property expression.
2489 2008-05-01 Marek Safar <marek.safar@gmail.com>
2491 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
2493 * nullable.cs: Implemented nullable coalescing null operator.
2495 * ecore.cs, expression.cs: Expression trees work.
2497 2008-05-01 Marek Safar <marek.safar@gmail.com>
2499 * ecore.cs: CreateExpressionTree is finally abstract.
2501 * expression.cs, linq.cs: Updated.
2503 2008-05-01 Marek Safar <marek.safar@gmail.com>
2505 * expression.cs, ecore.cs: Block base access expression inside expression
2508 2008-05-01 Marek Safar <marek.safar@gmail.com>
2510 A fix for bug #385058
2511 * expression.cs: User-defined operator implementations always take
2512 precedence over predefined operator implementations.
2514 2008-04-30 Marek Safar <marek.safar@gmail.com>
2516 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
2517 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
2518 expression tree conversions.
2520 2008-04-30 Marek Safar <marek.safar@gmail.com>
2522 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
2523 operators method details to Operator class.
2525 2008-04-30 Marek Safar <marek.safar@gmail.com>
2527 * anonymous.cs: Pass unsafe flags to anonymous container.
2529 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
2530 inside expression tree.
2532 2008-04-29 Martin Baulig <martin@ximian.com>
2534 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
2535 (Tokenizer.PopPosition): Also restore the `line'.
2537 2008-04-29 Marek Safar <marek.safar@gmail.com>
2539 * delegate.cs: Implemented Invoke expression.
2541 2008-04-29 Marek Safar <marek.safar@gmail.com>
2543 * expression.cs: Fixed equality reference comparison regression.
2545 2008-04-29 Marek Safar <marek.safar@gmail.com>
2547 * ecore.cs: Clean up EmptyCast hack.
2549 * expression.cs, nullable.cs: Implemented enum binary and unary operations
2550 using correct conversion rules. Also fixes #383993.
2552 2008-04-28 Martin Baulig <martin@ximian.com>
2554 * class.cs (Constructor.Emit): Don't emit debugging information
2555 for generated default .ctor's.
2557 2008-04-28 Marek Safar <marek.safar@gmail.com>
2559 * convert.cs: Empty-cast ushort to int conversion.
2561 2008-04-28 Marek Safar <marek.safar@gmail.com>
2563 A fix for bug #384191
2564 * ecore.cs, expression.cs: Fixed expression cloning.
2566 2008-04-28 Marek Safar <marek.safar@gmail.com>
2568 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
2570 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
2572 Fix #381559, test-638.cs, test-639.cs
2573 * assign.cs (CompoundAssign.Helper): New wrapper.
2574 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
2576 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
2577 Pass unconverted expressions to the params array creation expression.
2578 (FieldExpr.EmitAssign): Don't special-case StringConcat.
2579 (PropertyExpr.EmitAssign): Likewise.
2580 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
2581 element if it is of kind CompoundAssign.Helper.
2582 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
2583 first before anything else.
2584 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
2585 (ArrayAccess.LoadArrayAndArguments): Simplify.
2587 2008-04-27 Marek Safar <marek.safar@gmail.com>
2589 * expression.cs: Fixed cloning of typeof(void).
2591 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
2593 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
2594 (Assign.Emit): Likewise. Move it to ...
2595 (CompoundAssign.DoResolve): ... here and ...
2596 (CompoundAssign.Emit): ... here.
2597 (EventAddOrRemove): New helper to handle += and -= on events, and
2598 avoid the use of BinaryDelegates.
2599 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
2600 (EventExpr.EmitAddOrRemove): Improve.
2601 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
2603 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
2604 create VarExprs for 'foo.bar.var'.
2605 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
2606 is a highly inappropriate name for its functionality.
2608 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
2610 Simplify handling of multiple assignments
2611 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
2613 (SimpleAssign): New. Class to be used for normal assignments.
2614 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
2615 * expression.cs, parameter.cs, statement.cs: Likewise.
2617 2008-04-25 Marek Safar <marek.safar@gmail.com>
2619 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
2620 for incompatible underlying types, more to come, uff.
2622 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
2625 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
2626 Handle 'leave_copy'.
2628 2008-04-25 Marek Safar <marek.safar@gmail.com>
2630 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
2632 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
2634 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
2635 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
2636 * statement.cs (While, Do, For): Allow test to have side effects.
2637 (For.DoEmit): Always emit InitStatement.
2640 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
2641 Always create SideEffectConstant.
2642 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
2643 of type EnumConstant.
2645 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2646 Handle 'right' being SideEffectConstant of type 'bool'.
2648 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2649 Use left.EmitBranchable instead of open coding it, so as to
2650 improve optimization opportunities.
2652 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
2654 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
2656 (Expression.EmitSideEffect): Document.
2658 2008-04-23 Marek Safar <marek.safar@gmail.com>
2660 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
2662 2008-04-23 Marek Safar <marek.safar@gmail.com>
2664 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
2666 2008-04-23 Marek Safar <marek.safar@gmail.com>
2668 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
2669 conversion to expression tree.
2671 2008-04-23 Marek Safar <marek.safar@gmail.com>
2673 * ecore.cs: Removed unused expression.
2675 2008-04-22 Marek Safar <marek.safar@gmail.com>
2677 * expression.cs: Implemented NegateChecked and New expressions.
2679 2008-04-22 Marek Safar <marek.safar@gmail.com>
2681 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
2683 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
2686 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
2687 needing final 'ret' instruction.
2689 2008-04-22 Marek Safar <marek.safar@gmail.com>
2691 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
2693 2008-04-21 Marek Safar <marek.safar@gmail.com>
2695 * expression.cs: Emit ldnull and not null expression as an instance argument
2696 of static method expression calls.
2698 2008-04-21 Marek Safar <marek.safar@gmail.com>
2700 A fix for bug #378200
2701 * expression.cs: Fixed crash when creating parameterless expression tree
2704 2008-04-21 Marek Safar <marek.safar@gmail.com>
2706 A fix for bug #375297
2707 * anonymous.cs: Fixed crash when inferring from null argument anonymous
2710 2008-04-21 Marek Safar <marek.safar@gmail.com>
2712 A fix for bug #377596
2713 * decl.cs, class.cs: Emit delegate type argument attributes.
2715 2008-04-21 Marek Safar <marek.safar@gmail.com>
2717 A fix for bug #365314
2718 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
2720 2008-04-21 Marek Safar <marek.safar@gmail.com>
2722 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
2725 2008-04-21 Marek Safar <marek.safar@gmail.com>
2727 * generic.cs (TypeParameter): Removed redundant location.
2729 2008-04-19 Marek Safar <marek.safar@gmail.com>
2731 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
2732 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
2733 FullNamedExpression in all declaration type expression, statements will come
2736 2008-04-18 Marek Safar <marek.safar@gmail.com>
2738 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
2739 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
2741 2008-04-18 Marek Safar <marek.safar@gmail.com>
2743 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
2746 2008-04-17 Marek Safar <marek.safar@gmail.com>
2748 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
2751 2008-04-17 Marek Safar <marek.safar@gmail.com>
2753 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
2757 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
2759 Hook up 'EmitSideEffect'
2760 * constant.cs (Constant.EmitSideEffect): New.
2761 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
2762 (SideEffectConstant.EmitSideEffect): New.
2763 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
2764 unconditional branch in EmitBranchable.
2765 (FieldExpr.EmitBranchable): New.
2766 * expression.cs (Unary.EmitSideEffect): New.
2767 (Binary.EmitSideEffect): New.
2768 (VariableReference.EmitSideEffect): New. Do nothing.
2770 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
2772 Introduce 'EmitSideEffect'
2773 * ecore.cs (Expression.EmitSideEffect): New.
2774 (TypeCast): Rename from EmptyCast.
2776 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
2777 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
2778 * convert.cs, nullable.cs: Update to changes.
2780 2008-04-16 Marek Safar <marek.safar@gmail.com>
2782 * class.cs, cs-parser.jay: Early check for base types expression.
2784 2008-04-16 Marek Safar <marek.safar@gmail.com>
2786 * decl.cs (MemberName): Declare PrettyName as obsolete.
2788 2008-04-16 Marek Safar <marek.safar@gmail.com>
2790 * namespace.cs: Use MemberName comparison.
2792 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
2795 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
2797 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
2798 (MemberName.FullyQualifiedName): New. Provides the functionality
2799 that users assume FullName would have.
2800 * ecore.cs, namespace.cs: Update to changes.
2802 * statement.cs (Using.assign): Make into ExpressionStatement.
2803 (Using.EmitPreTryBody): Simplify.
2805 2008-04-16 Marek Safar <marek.safar@gmail.com>
2807 * report.cs: ColorFormat is protected.
2809 * rootcontext.cs: Unused fields clean-up.
2811 * namespace.cs: Made UsingEntry name private.
2813 2008-04-16 Marek Safar <marek.safar@gmail.com>
2815 * cs-tokenizer.cs, location.cs: Removed unused field.
2817 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
2818 Raja R Harinath <harinath@hurrynot.org>
2821 * constant.cs (SideEffectConstant.value): Rename from 'left'.
2822 (SideEffectConstant.side_effect): Rename from 'right'.
2823 (SideEffectConstant..ctor): Normalize 'side_effect'.
2824 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
2825 value of this constant.
2826 * cfold.cs: Update to changes.
2828 2008-04-15 Marek Safar <marek.safar@gmail.com>
2830 * cs-paser.jay: Removed unused variable.
2832 * driver.cs: Made Compile instance method.
2834 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
2836 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
2838 2008-04-15 Marek Safar <marek.safar@gmail.com>
2840 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
2842 2008-04-13 Jb Evain <jbevain@novell.com>
2844 * namespace.cs: update the System.Core fullname for 2.1
2845 * driver.cs: update the list of required assemblies for 2.1.
2846 Merged from the Moonlight 2 branch.
2848 2008-04-11 Marek Safar <marek.safar@gmail.com>
2850 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
2851 types and user defined operators. User operators arguments has to be checked
2852 for null value before invocation, which also means no operator is called
2853 when any argument is not convertible to unwrapped nullable type.
2855 2008-04-09 Marek Safar <marek.safar@gmail.com>
2857 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
2858 of Unary expressions to follow operator overloading rules precisely.
2859 Also fixes #321794, #323794
2861 2008-04-08 Marek Safar <marek.safar@gmail.com>
2863 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
2866 2008-04-08 Marek Safar <marek.safar@gmail.com>
2868 * expression.cs, ecore.cs: Implemented MemberInit expression.
2870 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
2872 Fix mono/tests/exception4.cs
2873 * statement.cs (ExceptionStatement, TryCatch): Revert to using
2874 ec.NeedReturnLabel () rather emitting a 'nop'.
2876 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
2878 (TryCatch.SomeCodeFollows): Likewise.
2879 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
2880 for 'break', 'continue' and 'return' statements inside a try.
2881 We're fairly sure that the generated IL stream will have more
2882 instructions textually following the try.
2883 (FlowBranchingTryCatch): Likewise.
2885 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
2886 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
2889 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
2890 wrapper -- forward everything to CollectionForeach.
2891 (CollectionForeach.NonDisposableWrapper): New.
2892 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
2893 instead of a pop + branch to end.
2895 2008-04-07 Marek Safar <marek.safar@gmail.com>
2897 A fix for bug #377485
2898 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
2899 Propagate location for extension method groups. Report conversion failure at
2902 2008-04-07 Marek Safar <marek.safar@gmail.com>
2904 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
2905 ListInit and Field expressions.
2907 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
2909 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
2910 Since $PC is always -1 inside the body of MoveNext, the fault
2912 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
2913 * statement.cs (ExceptionStatement.emit_finally): Likewise.
2914 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
2916 The denouement! Fix #324708
2917 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
2918 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
2919 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
2920 'finally' inside the finally clause.
2922 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
2923 inside an iterator. Don't emit the body of the 'finally' inside
2924 the finally clause yet.
2926 Use the ResumableStatement infrastructure for MoveNext ()
2927 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
2928 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
2929 'old_resume_points'. Move dispatcher upfront.
2930 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
2931 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
2932 in an enumerator. This encodes the main fix in this patch series
2933 -- we can only jump into the first instruction of a try from the
2934 outside, but we want to emit try/finally regions in iterators and
2935 resume in the middle of them.
2937 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
2939 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
2940 of NeedReturnLabel here.
2942 Introduce a common point for emitting try/finally to IL
2943 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
2944 features of the various subclasses, which are now driven by ...
2945 (ExceptionStatement.EmitPreTryBody): ... this and ...
2946 (ExceptionStatement.EmitTryBody): ... this and the original
2948 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
2949 Remove DoEmit and update to follow above protocol.
2951 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
2952 of the dispatcher are the same, skip emitting the 'switch'.
2953 * iterator.cs (Iterator.EmitDispose): Update to changes.
2955 Clean up handling of 'using' statement
2956 * statement.cs (UsingTemporary): New. Carved out of ...
2957 (Using): ... this. Simplify drastically. Handle exactly
2959 * cs-parser.jay (using_statement): Split. Create UsingTemporary
2960 or Using as appropriate. If there are multiple variable declared,
2961 create nested Using statements.
2962 (resource_acquisition): Kill.
2964 * statement.cs (ExceptionStatement.EmitForDispose): Use
2965 EmitFinallyBody, not EmitFinally.
2967 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
2968 * iterator.cs: Update to changes.
2970 Start using the ResumableStatement infrastructure
2971 * statement.cs (ResumeableStatement.PrepareForDispose): New.
2972 (ResumableStatement.EmitForDispose): New.
2973 (ExceptionStatement): Override them.
2974 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
2975 EmitForDispose to create the body of the Dispose method. Don't
2978 * iterator.cs (Iterator.AddResumePoint): Move here from ...
2979 * statement.cs (Toplevel.AddResumePoint): ... here.
2980 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
2981 * flowanalysis.cs (FlowBranchingIterator): New.
2982 * codegen.cs (EmitContext): Update to changes.
2984 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
2985 (Iterator.old_resume_points): Rename from 'resume_points'.
2986 (Iterator.MoveNextStatement): Remove unused class.
2988 New infrastructure for try/finally in iterators (still unused)
2989 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
2990 (FlowBranchingToplevel.AddResumePoint): Hook into
2991 ToplevelBlock.AddResumePoint.
2992 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
2993 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
2994 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
2995 resume points and assign program-counter values.
2996 (ExceptionBlock.AddResumePoint): Collect resume points for
2997 de-muxer at the top of try block.
2998 * iterators.cs (Yield.CheckContext): Simplify.
2999 (Yield.Resolve): Use FlowBranching.AddResumePoint.
3001 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
3003 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
3004 argument to an ExitStatement.
3005 (FlowBranchingException): Refactor saved origins code.
3006 * statement.cs (ExitStatement): Update to cahges.
3007 * iterator.cs (YieldBreak): Likewise.
3009 * statement.cs (ResumableStatement): New. Common base class for
3010 YieldReturn and ExceptionStatement.
3011 (ExitStatement): New. Common base class for Return and YieldBreak.
3012 (Return): Update to changes.
3013 * iterator.cs (YieldBreak): Likewise.
3014 * lambda.cs (ContextualReturn): Likewise.
3017 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
3018 emit a meaningful error message.
3020 Fix #324765, #319508
3021 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
3022 (VariableInfo.SetAssigned): Set it.
3023 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
3024 determine if CS0219 or CS0168 is appropriate. Don't use
3025 flow-analysis information.
3026 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
3027 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
3028 (EmitContext.EndFlowBranching): ... this.
3030 2008-04-03 Marek Safar <marek.safar@gmail.com>
3032 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
3034 2008-04-03 Marek Safar <marek.safar@gmail.com>
3036 A fix for bug #376508
3037 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
3038 ImplicitConversionExists.
3040 2008-04-03 Marek Safar <marek.safar@gmail.com>
3042 * expression.cs (Binary): Added remaining binary operators to expression
3045 * nullable.cs: Optimize shift with null argument.
3047 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
3049 Fix minor IL regression
3050 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
3051 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
3052 * cs-parser.jay (try_statement): Update to changes.
3054 * statement.cs (TryFinally.need_exc_block): Delete.
3055 (TryFinally): Update to changes.
3057 Now all ExceptionStatements are unconditional
3058 * statement.cs (CollectionForeach.DisposableWrapper): New.
3059 Extract out the try/finally code into a new wrapper.
3060 (CollectionForeach.Resolve): Use it to simplify the code.
3062 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
3064 Start at simplifying ExceptionStatement semantics a bit
3065 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
3066 * cs-parser.jay (try_statement): Update to changes.
3067 (opt_catch_clauses): Remove.
3068 * flowanalysis.cs: Update to changes.
3069 (FlowBranching.BranchingType.TryCatch): New.
3070 (FlowBranchingTryCatch): New.
3072 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
3073 (FlowBranching.CreateBranching): Update to changes.
3074 (FlowBranchingBlock.AddSibling): Add sanity check.
3075 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
3078 * iterators.cs (Iterator.MarkFinally): Remove.
3079 * statement.cs (ExceptionStatement): Update to changes.
3081 Add support for skipping over finally blocks at runtime. First
3082 in a series to fix #324708
3083 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
3084 (Iterator.EmitMoveNext): Initialize it.
3085 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
3086 branch over the body of the 'finally' clause.
3088 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
3090 Avoid lopsided use of Foo/DoFoo names
3091 * statement.cs (ExpressionStatement.EmitFinallyBody):
3092 Rename from EmitFinally.
3093 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
3094 * iterator.cs: Update to changes.
3096 2008-04-02 Marek Safar <marek.safar@gmail.com>
3098 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
3099 based on UserOperatorCall. More binary nullable operators clean up.
3101 2008-04-02 Martin Baulig <martin@ximian.com>
3103 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
3105 2008-04-02 Marek Safar <marek.safar@gmail.com>
3107 * nullable.cs: Merge user and empty conversions when lifting expression
3110 * expression.cs (StringConcat): Implemented expression tree representation.
3112 2008-04-01 Marek Safar <marek.safar@gmail.com>
3114 * nullable.cs: When lifting null literal and a user operator exists, no call
3117 2008-04-01 Marek Safar <marek.safar@gmail.com>
3119 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
3122 2008-04-01 Marek Safar <marek.safar@gmail.com>
3124 * nullable.cs, expression.cs: Use namespace instead heavily nested
3125 monster abstract class.
3127 2008-04-01 Marek Safar <marek.safar@gmail.com>
3129 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
3130 lifting of null literal and user operators. Clean up of some temporary
3133 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
3135 Fix #368224, test-629.cs
3136 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
3137 if it crossed an unwind-protect boundary.
3138 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
3139 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
3140 inside an unwind-protected region.
3141 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
3142 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
3143 'leave' instead of a 'br' if unwind-protected.
3144 (Iterator.EmitYieldBreak): Likewise.
3146 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
3148 * driver.cs: Only define versioninfo resources if no win32 resource
3151 2008-03-28 Marek Safar <marek.safar@gmail.com>
3153 A fix for bug #372375
3154 * convert.cs: Fixed boxing of nullable types.
3156 2008-03-28 Marek Safar <marek.safar@gmail.com>
3158 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
3161 2008-03-28 Marek Safar <marek.safar@gmail.com>
3163 A fix for bug #374619
3164 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
3166 2008-03-27 Marek Safar <marek.safar@gmail.com>
3168 * lambda.cs: Check return type only for invocation.
3170 2008-03-27 Marek Safar <marek.safar@gmail.com>
3172 A fix for bug #374214
3173 * ecore.cs: Correctly report argument type mismatch.
3175 2008-03-27 Marek Safar <marek.safar@gmail.com>
3177 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
3178 and not rely on broken IsEnum.
3180 2008-03-27 Marek Safar <marek.safar@gmail.com>
3182 * nullable.cs: New file, extracted from generic.cs.
3184 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
3186 2008-03-27 Marek Safar <marek.safar@gmail.com>
3188 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
3189 predefined comparison operators and null literals.
3191 * report.cs: New warning ID.
3193 2008-03-25 Marek Safar <marek.safar@gmail.com>
3195 A fix for bug #370577
3196 * lambda.cs: Check return type too.
3198 2008-03-25 Marek Safar <marek.safar@gmail.com>
3200 A fix for bug #372846
3201 * class.cs: Automatic properties can be declared as unsafe.
3203 2008-03-20 Marek Safar <marek.safar@gmail.com>
3205 * location.cs: Use string based concatenation.
3207 * expression.cs: LiftedBinaryOperator is gmcs only.
3209 2008-03-20 Marek Safar <marek.safar@gmail.com>
3211 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
3212 conversions rules and expression trees.
3214 2008-03-19 Marek Safar <marek.safar@gmail.com>
3216 * delegate.cs: Use extension method source as delegate target.
3218 2008-03-19 Marek Safar <marek.safar@gmail.com>
3220 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
3221 binary operations to be purely based on binary operations and optimized
3222 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
3223 and other ET refactoring.
3225 * typemanager.cs: Fixed warning.
3227 2008-03-17 Marek Safar <marek.safar@gmail.com>
3229 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
3231 * symbolwriter.cs: Fixed.
3233 2008-03-17 Marek Safar <marek.safar@gmail.com>
3235 * anonymous.cs, driver.cs: Reset anonymous types counters.
3237 2008-03-17 Marek Safar <marek.safar@gmail.com>
3239 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
3241 * class.cs: Use fullname for all type member definitions.
3243 2008-02-19 Martin Baulig <martin@ximian.com>
3246 (IMethodData.EmitExtraSymbolInfo): New interface method.
3247 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
3248 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
3249 interface method here as an empty public virtual method.
3252 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
3253 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
3254 CodeGen.SymbolWriter.SetRealMethodName().
3256 2008-02-18 Martin Baulig <martin@ximian.com>
3259 (ScopeInfo.EmitType): Override this and emit debugging
3260 information for captured variables.
3261 (RootScopeInfo.EmitType): Override this and emit symbol
3262 information for a captured `this'.
3264 2008-02-15 Martin Baulig <martin@ximian.com>
3266 * iterators.cs: Emit debugging info.
3269 (EmitContext.Flags): Add `OmitDebuggingInfo'.
3270 (EmitContext.OmitDebuggingInfo): New public property.
3273 (While): Override Emit() and don't emit symbol info there; do it
3274 inside DoEmit() instead.
3275 (Block.Emit): Omit symbol information while emitting the scope
3276 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
3278 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
3279 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
3280 .ctor to make `IsIterator' work.
3282 2008-03-14 Martin Baulig <martin@ximian.com>
3284 * symbolwriter.cs: Added the new symbol writer function from the
3285 debugger's `terrania' branch; temporarily enclose them inside
3286 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
3289 2008-03-14 Martin Baulig <martin@ximian.com>
3292 (SymbolWriter): Make this a public static class.
3295 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
3296 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
3298 2008-03-14 Marek Safar <marek.safar@gmail.com>
3300 A fix for bug #370577
3301 * statement.cs, lambda.cs: Added extra limitations when dealing with void
3304 2008-03-14 Marek Safar <marek.safar@gmail.com>
3306 * typemanager.cs (CSharpName): Made 250 times faster.
3308 2008-03-13 Marek Safar <marek.safar@gmail.com>
3310 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
3312 2008-03-12 Marek Safar <marek.safar@gmail.com>
3314 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
3315 crash when predefined field does not exist.
3317 2008-03-12 Marek Safar <marek.safar@gmail.com>
3319 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
3321 2008-03-12 Marek Safar <marek.safar@gmail.com>
3323 * class.cs (FixedField): Don't crash when contructors are missing.
3325 2008-03-11 Marek Safar <marek.safar@gmail.com>
3327 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
3328 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
3329 check internal types accessibility for internal and external types.
3330 Replaced EnumToUnderlying by GetEnumUnderlyingType.
3332 2008-03-11 Marek Safar <marek.safar@gmail.com>
3334 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
3335 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
3336 attribute.cs, statement: Use corect instance of predefined types (work
3337 related to #364674).
3339 2008-03-07 Marek Safar <marek.safar@gmail.com>
3341 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
3343 2008-03-07 Marek Safar <marek.safar@gmail.com>
3345 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
3346 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
3347 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
3348 predefined types clean up, delayed predefined types members initialization
3349 (work related to #364674).
3351 2008-03-05 Marek Safar <marek.safar@gmail.com>
3353 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
3355 2008-03-05 Marek Safar <marek.safar@gmail.com>
3357 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
3358 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
3359 predefined types clean up (work related to #364674).
3361 2008-03-04 Marek Safar <marek.safar@gmail.com>
3363 * ecore.cs: Print an error message instead of throwing exception.
3365 2008-03-04 Marek Safar <marek.safar@gmail.com>
3367 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
3368 expression.cs, statement.cs: Unififed null literal representation.
3370 2008-03-03 Marek Safar <marek.safar@gmail.com>
3372 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
3373 expression.cs: Refactored binary operators resolve phase and improved speed.
3374 The nullable code is still missing and won't work correctly, more fixes
3377 It also fixes #323726, #324312, #324248, and many other unreported issues.
3379 2008-02-29 Zoltan Varga <vargaz@gmail.com>
3381 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
3384 2008-02-27 Marek Safar <marek.safar@gmail.com>
3386 * ecore.cs: Clean-up and split BetterConversion.
3388 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
3391 * enum.cs (EnumMember.Value): Only access 'value' if
3392 ResolveValue says it's ok.
3393 (EnumMember.DoResolveValue): Don't set prev_member.value.
3394 (Enum.GetDefinition): Reverse arguments of Equals --
3395 EnumMember.Value can return 'null'.
3397 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
3399 2008-02-22 Marek Safar <marek.safar@gmail.com>
3401 * generic.cs, expression.cs: More ongoing work on expression trees.
3403 2008-02-21 Marek Safar <marek.safar@gmail.com>
3405 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
3406 handle missing matches when mutiple operators exist.
3408 2008-02-20 Marek Safar <marek.safar@gmail.com>
3410 A fix for bug #363218
3411 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
3414 2008-02-20 Marek Safar <marek.safar@gmail.com>
3416 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
3417 update. This time to deal correctly with SideEffectConstant expression used
3418 as an argument for another constant folding.
3420 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
3422 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
3425 2008-02-19 Marek Safar <marek.safar@gmail.com>
3427 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
3429 2008-02-19 Marek Safar <marek.safar@gmail.com>
3431 A fix for bug #328136
3432 * expression.cs: Do not fold immediately LogicalAnd operators when the left
3433 side is a false constant, because we still need to evaluate the right-hand
3436 * statement.cs (If): Emit two types of boolean constants (simple constant,
3437 side-effect constant).
3439 2008-02-19 Marek Safar <marek.safar@gmail.com>
3441 * constant.cs (SideEffectConstant): Don't emit boolean constant.
3443 * expression.cs: Fold immediately LogicalAnd operators when both sides are
3446 2008-02-18 Marek Safar <marek.safar@gmail.com>
3448 A fix for bug #361457
3449 * ecore.cs (IsApplicable): Params methods have lower priority.
3451 * support.cs: Return correct parameter modifier for params types.
3453 2008-02-18 Marek Safar <marek.safar@gmail.com>
3455 * generic.cs (TypeParameter): Cache attribute target name.
3457 * support.cs: Removed unused variable.
3459 * typemanager.cs: Removed debugging leftover.
3461 * ecore.cs: Use local type instead of a property;
3463 * class.cs (VerifyMembers): Consider also parent to test whether type member
3466 * expression.cs (FullMethodDesc): Removed.
3468 * attribute.cs (IsValidArgumentType): Made static.
3470 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
3472 Cleanup to be more readable.
3473 * Makefile (GMCS_PROFILE): Remove.
3474 (COMPILER_NAME): New helper.
3476 2008-02-15 Miguel de Icaza <miguel@novell.com>
3478 * cs-tokenizer.cs: if a conditional expression happens inside a
3479 (...) this also means that we do not need to de-ambiguate between
3480 an parenthesized expression and a cast.
3484 * constant.cs (SideEffectConstant): a constant value that happens
3485 to have a side effect.
3487 Fixes the build regressions introduced by the fix for #359789
3489 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
3491 * expression.cs (Conditional.Emit): when emitting the ternary
3492 operator, use local variables to generate code verifiable code.
3494 The verifier cannot infer that the type on stack before the
3495 stloc.0 is executed is of type ParentB. This happens because the
3496 stack merge algorithm uses only parent types when deciding which
3497 is the common type. This is described in Part III 1.8.1.3 of ECMA
3500 This code compiled with mcs is not verifiable under MS. The MS
3501 verifier picks the first common interface of Foo and Bar, which is
3502 wrong, but doesn't use a full join type of the 2 interfaces.
3504 CSC uses a clever hack to compile such code in a verifiable
3505 way. It stores the intermediate values in a local variable with
3510 2008-02-14 Miguel de Icaza <miguel@novell.com>
3512 * expression.cs: Do not fold BitwiseAnd operators when the left
3513 side is a false constant, because we still need to evaluate the
3518 * support.cs: Instead of throwing an InternalErrorException when
3519 the position of the stream is outside the boundary of our buffer,
3520 reset the state of the reader, and restart the reading from the
3521 beginning of the file.
3523 2008-02-14 Marek Safar <marek.safar@gmail.com>
3525 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
3527 2008-02-14 Marek Safar <marek.safar@gmail.com>
3529 A fix for bug #361686
3530 * decl.cs: A protected types used inside a private class which parents
3531 derives from the protected class are accessible.
3533 2008-02-13 Marek Safar <marek.safar@gmail.com>
3535 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
3536 the parameterless constructor.
3538 2008-02-13 Marek Safar <marek.safar@gmail.com>
3540 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
3541 lookup methods to use standard member cache when doing member lookup.
3543 2008-02-12 Marek Safar <marek.safar@gmail.com>
3545 * driver.cs: Don't report full path for referenced module as assembly error.
3547 2008-02-12 Marek Safar <marek.safar@gmail.com>
3549 * Makefile: Fixed `qh' target to work on all machines.
3551 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
3552 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
3553 and HasElementType with TypeManager implementation.
3555 2008-02-08 Marek Safar <marek.safar@gmail.com>
3557 A fix for bugs #325134, #359749
3558 * expression.cs, ecore.cs: Try to resolve an extension method even if the
3559 first binds point to non-method member expression.
3561 2008-02-08 Marek Safar <marek.safar@gmail.com>
3563 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
3565 2008-02-08 Marek Safar <marek.safar@gmail.com>
3567 A fix for bugs #321394, #323028
3568 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
3569 Reworked naive IsAccessibleAs implementation to handle nested types.
3571 2008-02-05 Jb Evain <jbevain@novell.com>
3573 * class.cs: use generic type comparison for parameters
3576 2008-02-05 Marek Safar <marek.safar@gmail.com>
3578 A fix for bug #325372
3579 * class.cs: Use generic type comparison when testing method signatures.
3581 2008-02-05 Marek Safar <marek.safar@gmail.com>
3583 A fix for bug #357047
3584 * ecore.cs: Applied C# 3.0 changes to better conversion.
3586 2008-02-05 Marek Safar <marek.safar@gmail.com>
3588 A fix for bug #358374
3589 * cs-parser.jay: Correctly set modifiers for all constructor types.
3591 2008-02-04 Marek Safar <marek.safar@gmail.com>
3593 A fix for bug #355251
3594 * generic.cs: Added base class constraint based type inference.
3596 2008-02-01 Marek Safar <marek.safar@gmail.com>
3598 A fix for bug #357255
3599 * decl.cs: One more missing visibility check.
3601 2008-02-01 Marek Safar <marek.safar@gmail.com>
3603 * support.cs: Fixed broken return.
3605 2008-01-25 Marek Safar <marek.safar@gmail.com>
3607 * report.cs: Correctly reset warnings count after probing.
3609 2008-01-25 Martin Baulig <martin@ximian.com>
3612 (NamespaceEntry.SymbolFileID): Make this work again after
3613 MemberName.ToString() is gone.
3615 2008-01-25 Marek Safar <marek.safar@gmail.com>
3617 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
3620 2008-01-25 Marek Safar <marek.safar@gmail.com>
3622 * generic.cs: Use full implicit conversion for type inference fixing.
3624 2008-01-24 Marek Safar <marek.safar@gmail.com>
3626 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
3627 Fixed user operator conversions.
3629 2008-01-24 Marek Safar <marek.safar@gmail.com>
3631 * generic.cs: Do nullable type to null comparison optimization during
3634 2008-01-24 Marek Safar <marek.safar@gmail.com>
3636 A fix for bug #355163
3637 * generic.cs: Enabled l-value resolve on nullable expressions.
3639 2008-01-24 Marek Safar <marek.safar@gmail.com>
3641 A fix for bug #353986
3642 * class.cs: Ingore static ctors with parameters for any further checks.
3644 2008-01-24 Marek Safar <marek.safar@gmail.com>
3646 A fix for bug #354310
3647 * namespace.cs: Removed redundant check.
3649 2008-01-24 Marek Safar <marek.safar@gmail.com>
3651 A fix for bug #354928
3652 * expression.cs: ElementInitializers can be resolved only once.
3654 2008-01-24 Marek Safar <marek.safar@gmail.com>
3656 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
3657 Condition expressions.
3659 2008-01-23 Marek Safar <marek.safar@gmail.com>
3661 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
3663 2008-01-22 Marek Safar <marek.safar@gmail.com>
3665 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
3668 * generic.cs: Implemented coalesce expression.
3670 2008-01-22 Marek Safar <marek.safar@gmail.com>
3672 A fix for bug #355145
3673 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
3674 expression tree type inference.
3676 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
3679 * expression.cs (Binary.IsUnsignedType): Fix typo.
3681 2008-01-22 Marek Safar <marek.safar@gmail.com>
3683 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
3685 2008-01-22 Marek Safar <marek.safar@gmail.com>
3687 A fix for bug #355161
3688 * ecore.cs, expression.cs: Wider range of extension method supported
3691 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
3693 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
3694 AssemblyBuilder to operate in compiler context. Fixes mcs part of
3697 2008-01-22 Marek Safar <marek.safar@gmail.com>
3699 A fix for bug #355148
3700 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
3702 2008-01-22 Miguel de Icaza <miguel@novell.com>
3704 * expression.cs (CreateExpressionTree): Add support for or and
3705 logical or, and indent following the coding conventions.
3707 * typemanager.cs (LinqExpression): renamed from
3708 ExpressionTreeManager, for a shorter name.
3710 Use TypeManager.CoreLookupType to lookup types from our core
3711 assemblies and turn those into "Type" variables.
3713 Consumers that previously used "Namespace" and "Type" from this
3714 class should instead use the TypeExpression which is a type that
3715 is fully resolved (without involving the regular C# resolution
3718 This typically looks like this:
3720 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
3721 new MemberAccess (texpr, name, type_arguments, loc)
3723 This avoids the problem in: #355178
3725 2008-01-21 Marek Safar <marek.safar@gmail.com>
3727 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
3728 feature in parser only as we do in other cases.
3730 2008-01-21 Marek Safar <marek.safar@gmail.com>
3732 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
3733 typemanager.cs: A refactoring of params arguments to reuse existing
3734 expressions (params -> array initializer) to emit params argument instead
3735 of specialized handling.
3736 It was required by expression tree implementation and it has other benefits
3737 as well, we now apply same optimization for params arguments as we do for
3740 2008-01-18 Marek Safar <marek.safar@gmail.com>
3742 A fix for bug #353526
3743 * generic.cs: A type inference of params arguments may not required any
3744 temporary array creation.
3746 2008-01-18 Marek Safar <marek.safar@gmail.com>
3748 A fix for bug #353534
3749 * generic.cs, ecore.cs, expression.cs: A method group type inference is
3750 supported for delegates only.
3752 2008-01-18 Marek Safar <marek.safar@gmail.com>
3754 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
3755 type for more than 1 candidates.
3757 2008-01-18 Marek Safar <marek.safar@gmail.com>
3759 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
3762 2008-01-16 Marek Safar <marek.safar@gmail.com>
3764 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
3765 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
3766 operator) expressions.
3768 2008-01-16 Zoltan Varga <vargaz@gmail.com>
3770 * statement.cs: Avoid declaring an IL variable for this_variable since it is
3771 not accessed from the generated IL.
3773 2008-01-14 Marek Safar <marek.safar@gmail.com>
3775 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
3776 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
3777 statement.cs: The first expression tree implementation drop, mostly
3778 infrastructure work.
3780 2008-01-14 Marek Safar <marek.safar@gmail.com>
3782 * ecore.cs (IsNestedChild): Refactored.
3784 2008-01-11 Marek Safar <marek.safar@gmail.com>
3786 * lambda.cs: Don't use a cast on unknown expression statement.
3788 2008-01-10 Geoff Norton <gnorton@novell.com>
3790 * cs-tokenizer.cs: One more token to distinguish between method and lambda
3793 2008-01-09 Marek Safar <marek.safar@gmail.com>
3795 * doc.cs: Report better /doc crash details.
3797 2008-01-09 Marek Safar <marek.safar@gmail.com>
3799 A fix for bug #352536
3800 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
3802 2008-01-08 Marek Safar <marek.safar@gmail.com>
3804 A fix for bug #352287
3805 * ecore.cs, expression.cs: Do `this' access checking in all member access
3808 2008-01-08 Marek Safar <marek.safar@gmail.com>
3810 * rootcontext.cs, driver.cs: Switch to linq mode by default.
3812 * report.cs: Reset message stacks.
3814 2008-01-08 Marek Safar <marek.safar@gmail.com>
3816 * generic.cs (InferInPhases): Correctly calculate params position.
3818 2008-01-08 Marek Safar <marek.safar@gmail.com>
3820 * cs-tokenizer.cs: No need to parse full string when parsing lambda
3823 2008-01-07 Marek Safar <marek.safar@gmail.com>
3825 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
3827 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
3829 * driver.cs: Updated --help option.
3831 2008-01-07 Marek Safar <marek.safar@gmail.com>
3833 * generic.cs (InferParamsTypeArguments): Removed.
3834 (InferInPhases): Add params type inference.
3835 (LowerBoundInference): Fixed scoring mechanism.
3837 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
3839 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
3841 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
3842 byte array for unsigned "baked" assemblies.
3844 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
3846 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
3847 array for assemblies that are not strongnamed.
3849 2008-01-04 Marek Safar <marek.safar@gmail.com>
3851 A fix for bug #351481
3852 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
3853 declaring type for nested generic types.
3855 2008-01-04 Marek Safar <marek.safar@gmail.com>
3857 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
3858 instead of ToString.
3860 2008-01-03 Marek Safar <marek.safar@gmail.com>
3862 A fix for bug #351047
3863 * expression.cs (Binary.ResolveOperator): Allow equality operators between
3864 null and structs only when equality and inequality operators are defined
3865 either as an user-operators or predefined operators.
3867 2008-01-03 Marek Safar <marek.safar@gmail.com>
3869 A fix for bug #351047
3870 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
3872 2008-01-03 Marek Safar <marek.safar@gmail.com>
3874 A fix for bug #351257
3875 * cs-tokenizer.cs: Advance line number for '\r' correctly.
3877 2008-01-03 Marek Safar <marek.safar@gmail.com>
3879 A fix for bug #351157
3880 * class.cs (Using): Fixed yet another broken cloning.
3882 (Block): Put back more sensible default value for statements.
3884 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
3886 * codegen.cs: Allow AssemblyVersion with only major version component.
3889 2007-12-29 Marek Safar <marek.safar@gmail.com>
3891 A fix for bug #324654
3892 * class.cs: Use FullName property as member name.
3894 2007-12-28 Marek Safar <marek.safar@gmail.com>
3896 A fix for bug #342117
3897 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
3898 constructor constraint.
3900 2007-12-28 Marek Safar <marek.safar@gmail.com>
3902 A fix for bug #338273
3903 * class.cs (ProbertyBase): Access modifier checks are required for overrides
3906 2007-12-28 Marek Safar <marek.safar@gmail.com>
3908 A fix for bug #350839
3909 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
3911 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
3913 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3916 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
3918 * statement.cs: Changed some Hashtables to use HybridDictionaries
3919 instead. It was observed that some HashTables only contained a few
3920 items in the vast majority of cases. Since HybridDictionary is
3921 more efficient on small sets (<10 elements), "known_variables"
3922 from class ExplicitBlock as well as "labels" and "constants " from
3923 class Block were changed to HybridDictionaries.
3925 Atsai results: (56216kb->54987kb)
3927 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
3930 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
3932 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3935 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
3937 * expression.cs: foreach loop to for loop, saved on allocation of
3938 enumerator (59333kb->59141kb)
3940 * statement.cs. Changed foreach loops to for loops, saved on
3941 allocation of enumerator (59141kb->59006kb)
3943 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
3944 when constructed with no specified capacity. This was causing a
3945 few ArrayLists to allocate more memory than they would potentially
3946 need in the Block class and MemberCache class. Setting the
3947 ArrayLists to construct with a capacity of 1 saves some
3948 memory. (56216kb->55585kb)
3950 2007-12-27 Marek Safar <marek.safar@gmail.com>
3952 A fix for bug #347189 (2nd issue)
3953 * expression.cs (MemberAccess): Nested type can be found in base non-generic
3956 2007-12-27 Miguel de Icaza <miguel@novell.com>
3958 * report.cs: Do not use colors if stdout and stderr are not a
3961 2007-12-27 Marek Safar <marek.safar@gmail.com>
3963 A fix for bug #346998
3964 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
3967 2007-12-27 Marek Safar <marek.safar@gmail.com>
3969 A fix for bug #343465
3970 * class.cs: Explicit method name for nested types uses dots only.
3972 2007-12-27 Marek Safar <marek.safar@gmail.com>
3974 A fix for bug #343707
3975 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
3977 2007-12-27 Marek Safar <marek.safar@gmail.com>
3979 * ecore.cs: Report type inference errors only when arguments count matches
3982 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
3984 * expression.cs, report.cs: New warning.
3986 * typemanager.cs: Catch anonymous method type too.
3988 2007-12-23 Marek Safar <marek.safar@gmail.com>
3990 A fix for bug #346379
3991 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
3993 2007-12-23 Marek Safar <marek.safar@gmail.com>
3995 A fix for bug #347359
3996 * expression.cs (Invocation): Don't resolve already resolved expression.
3998 2007-12-23 Marek Safar <marek.safar@gmail.com>
4000 A fix for bug #347189
4001 * class.cs (FixedField): Use non-dependent code only in the define phase.
4003 2007-12-23 Marek Safar <marek.safar@gmail.com>
4005 A fix for bug #348076
4006 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
4008 2007-12-22 Marek Safar <marek.safar@gmail.com>
4010 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
4011 discovered extension methods.
4013 2007-12-22 Marek Safar <marek.safar@gmail.com>
4015 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
4018 2007-12-21 Miguel de Icaza <miguel@novell.com>
4020 * report.cs (ErrorMessage): Add support for using colors on
4021 terminals that support it.
4023 2007-12-21 Marek Safar <marek.safar@gmail.com>
4025 * ecore.cs: Use information about expanded params for error reporting.
4027 2007-12-21 Marek Safar <marek.safar@gmail.com>
4029 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
4030 and logic for params overloads.
4032 2007-12-15 Miguel de Icaza <miguel@novell.com>
4034 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
4035 as this is also created from the parser. Fixes #349034
4037 2007-12-12 Miguel de Icaza <miguel@novell.com>
4039 * statement.cs (Throw.CloneTo): it is valid to have empty
4040 expressions for throw.
4042 2007-12-03 Marek Safar <marek.safar@gmail.com>
4044 * cs-parser.jay: Set delegate constraint parsing region correctly.
4046 2007-12-03 Marek Safar <marek.safar@gmail.com>
4048 A fix for bug #345467
4049 * typemanager.cs (IsEqual): Compare generic parameters position only.
4051 2007-11-28 Marek Safar <marek.safar@gmail.com>
4053 * expression.cs (BaseAccess): Type arguments can be null.
4055 2007-11-27 Raja R Harinath <harinath@gmail.com>
4057 * statement.cs (Block.Resolve): Ensure flow-branching tree is
4058 consistent even when an error has occured.
4059 (Switch.Resolve): Likewise.
4061 2007-11-22 Marek Safar <marek.safar@gmail.com>
4063 A fix for bug #334505
4064 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
4067 2007-11-22 Marek Safar <marek.safar@gmail.com>
4069 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
4070 refactorings required to resolve extension methods correctly when mixing
4071 generics and non-generics members.
4073 2007-11-20 Marek Safar <marek.safar@gmail.com>
4075 A fix for bug #342584
4076 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
4079 2007-11-19 Marek Safar <marek.safar@gmail.com>
4081 A fix for bug #342512
4082 * delegate.cs: Use delegate argument expression when is available. Don't
4083 emit virtual call when class is sealed.
4085 2007-11-16 Marek Safar <marek.safar@gmail.com>
4087 A fix for bug #325423
4088 * assign.cs (FieldInitializer): Use resolved expression for emit.
4090 * class.cs: Print less confusing error message.
4092 2007-11-16 Marek Safar <marek.safar@gmail.com>
4094 * cs-tokenizer.cs: Removed GMCS ifdefs.
4096 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
4099 * cs-parser.jay: Disabled nullable check.
4101 * generic-mcs: Copied more generic stuff.
4103 2007-11-16 Marek Safar <marek.safar@gmail.com>
4105 * gcs-parser.jay: Merged to cs-parser.jay.
4107 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
4108 * *.csproj, *.sources: Updated to use only jay parser file.
4110 2007-11-16 Marek Safar <marek.safar@gmail.com>
4112 * gcs-parser.jay: Added nullable and default expression feature checks.
4114 2007-11-16 Marek Safar <marek.safar@gmail.com>
4116 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
4117 it fixes many TODOs and hidden bugs.
4119 * expression: Removed duplicate error check.
4121 2007-11-15 Marek Safar <marek.safar@gmail.com>
4123 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
4124 implicitly type local variable only when it is used in a declaration.
4126 2007-11-15 Marek Safar <marek.safar@gmail.com>
4128 * attribute.cs: Use CS0612 for empty strings.
4130 2007-11-14 Marek Safar <marek.safar@gmail.com>
4132 * lambda.cs, statement.cs: Contextual return may act as a statement.
4134 2007-11-14 Marek Safar <marek.safar@gmail.com>
4136 A fix for a regression cause by #324222
4137 * class.cs: Don't report unused even when it implements an interface.
4139 2007-11-13 Marek Safar <marek.safar@gmail.com>
4141 A fix for bug #341205
4142 * ecore.cs, expression.cs: Method group expression cannot do static
4143 method access with an instance reference check before overloading takes
4146 2007-11-13 Marek Safar <marek.safar@gmail.com>
4148 A fix for bug #325359
4149 * class.cs: Use predictable name for automatically generated property.
4151 2007-11-12 Marek Safar <marek.safar@gmail.com>
4153 A fix for bug #324996
4154 * expression.cs (Is): Handle case where D is nullable and T is not
4157 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
4159 2007-11-12 Marek Safar <marek.safar@gmail.com>
4161 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
4162 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
4163 Flush small error reporting changes.
4165 2007-11-09 Marek Safar <marek.safar@gmail.com>
4167 A fix for bug #324996
4168 * expression.cs: Rewrote Is expression implementation to work with
4169 generics, nullable types, anonymous method. A const result expression
4170 uses existing infrastructure instead of custom not fully-featured one.
4172 2007-11-08 Marek Safar <marek.safar@gmail.com>
4174 A fix for bug #340202
4175 * class.cs: Consider generics for volatile field.
4177 2007-11-08 Marek Safar <marek.safar@gmail.com>
4179 A fix for bug #335594
4180 * expression.cs: Use conversion rules when handling string addition.
4182 2007-11-07 Marek Safar <marek.safar@gmail.com>
4184 A fix for bug #336651
4185 * expression.cs: Fixed a crash when probing is on.
4187 2007-11-07 Marek Safar <marek.safar@gmail.com>
4189 A fix for bug #324242
4190 * covert.cs: Added a conversion from any nullable-type with an
4191 underlying enum-type to the type System.Enum.
4193 2007-11-07 Marek Safar <marek.safar@gmail.com>
4195 A fix for bug #324222
4196 * class.cs: Report all non-used event fields.
4198 2007-11-07 Marek Safar <marek.safar@gmail.com>
4200 A fix for bug #325161
4201 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
4202 qualifier for generic types.
4204 2007-11-07 Marek Safar <marek.safar@gmail.com>
4206 A fix for bug #322971
4207 * expression.cs, ecore.cs: Added intermediate result value check for
4210 2007-11-07 Marek Safar <marek.safar@gmail.com>
4212 A fix for bug #324754
4213 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
4214 when it was requested.
4216 2007-11-07 Marek Safar <marek.safar@gmail.com>
4218 A fix for bug #325101
4219 * expression.cs: Do type not value comparison for `is' expression.
4221 2007-11-07 Marek Safar <marek.safar@gmail.com>
4223 A fix for bug #320236
4224 * convert.cs: Don't apply user conversion on underlying target type.
4226 2007-11-06 Marek Safar <marek.safar@gmail.com>
4228 * expression.cs: Don't use unresolved expression for error reporting.
4230 2007-11-06 Marek Safar <marek.safar@gmail.com>
4232 A fix for bugs #337712, #324490
4233 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
4234 overloading resolution too.
4236 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
4237 the process consistent and more robust.
4239 * expression.cs, linq.cs, report.cs: Update.
4241 2007-11-02 Marek Safar <marek.safar@gmail.com>
4243 A fix for bug #332909
4244 * attribute.cs: Resolve attributes in correct context using error
4247 * rootcontext.cs: Define Obsolete attribute members as core members.
4249 2007-11-02 Marek Safar <marek.safar@gmail.com>
4251 * statement.cs: Removed unused methods.
4253 2007-10-31 Wade Berrier <wberrier@novell.com>
4255 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
4256 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
4259 2007-10-31 Marek Safar <marek.safar@gmail.com>
4261 A fix for bug #338102
4262 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
4263 methods registered as non-generics.
4265 2007-10-31 Marek Safar <marek.safar@gmail.com>
4267 A fix for bugs #337712, #324490
4268 * delegate.cs: Delegate covariance and contravariance is not allowed for
4271 2007-10-31 Marek Safar <marek.safar@gmail.com>
4273 A fix for bug #337719
4274 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
4277 2007-10-30 Marek Safar <marek.safar@gmail.com>
4279 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
4281 2007-10-29 Marek Safar <marek.safar@gmail.com>
4283 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
4286 2007-10-29 Raja R Harinath <rharinath@novell.com>
4288 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
4290 2007-10-29 Marek Safar <marek.safar@gmail.com>
4292 A fix for bug #334652
4293 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
4294 extension methods when we have not found the best candidate in normal
4297 2007-10-27 Marek Safar <marek.safar@gmail.com>
4299 * AssemblyInfo.cs: Keep up-to-date.
4301 2007-10-27 Marek Safar <marek.safar@gmail.com>
4303 * Makefile: Fixed generics compiler name.
4305 2007-10-27 Marek Safar <marek.safar@gmail.com>
4307 * lambda.test: removed, lambda parsing is done differently.
4309 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
4311 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
4313 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
4315 2007-10-27 Marek Safar <marek.safar@gmail.com>
4317 * Makefile, *.sources : All C# compilers are in mcs folder.
4319 * *.cs: Use existing 2_1 define for smcs.
4321 2007-10-26 Marek Safar <marek.safar@gmail.com>
4323 A fix for bug #335847
4324 * assign.cs, expression.cs: Couple of changes to avoid creating a
4325 temporary variable for each object initializer assignment statement. It
4326 simplifies struct initialization too, otherwise two temporary variables
4328 Implemented optimization of redundant default element initializers.
4330 2007-10-25 Marek Safar <marek.safar@gmail.com>
4332 A fix for bug #336766
4333 * expression.cs (Class.CheckBase): Use generic name when method is
4336 2007-10-25 Marek Safar <marek.safar@gmail.com>
4338 A fix for bug #334737
4339 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
4340 variable and not variable argument for prepared copies.
4342 2007-10-24 Marek Safar <marek.safar@gmail.com>
4344 A fix for bug #325110
4345 * class.cs, expression.cs, attribute.cs: Use open generic method when
4346 checking conditional attribute.
4348 2007-10-24 Marek Safar <marek.safar@gmail.com>
4350 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
4351 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
4352 FeatureIsNotAvailable.
4354 2007-10-24 Marek Safar <marek.safar@gmail.com>
4356 ** C# 3.0 Partial methods
4358 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
4359 methods support. Because of member cache issue with generics only
4360 non-generics partial methods are fully supported.
4362 2007-10-23 Marek Safar <marek.safar@gmail.com>
4364 * class.cs, decl.cs: Rewrote member overloads check to cope with
4365 generics and to use member cache for member checking. It also improves
4366 performance and fixes remaining overloads issues.
4368 2007-10-20 Marek Safar <marek.safar@gmail.com>
4370 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
4371 roottypes.cs, typemanager.cs:
4373 A member cache creation logic changed to add members immediately and
4374 not rely on fallback. The member cache is now only prefered way
4375 how to access and find type declaration members. It saves 5 MB of memory
4376 during MWF compilation and makes code ready for more optimizations and
4377 clean-ups, it's also a pre-requirement for partial methods.
4379 2007-10-18 Raja R Harinath <harinath@gmail.com>
4381 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
4382 handling for generic parameters.
4384 2007-10-15 Marek Safar <marek.safar@gmail.com>
4386 * class.cs (FixedField): Removed redundant volatile check.
4388 2007-10-15 Marek Safar <marek.safar@gmail.com>
4390 * class.cs, decl.cs: Fixed overload members verification to do only one
4391 check per possible collision.
4393 2007-10-13 Marek Safar <marek.safar@gmail.com>
4395 A fix for bug #325478
4396 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
4397 and create only one disposable flags container.
4399 2007-10-12 Marek Safar <marek.safar@gmail.com>
4401 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
4402 * statement.cs (Fixed): Fixed variables cloning.
4404 2007-10-12 Marek Safar <marek.safar@gmail.com>
4406 A fix for bug #333342
4407 * class.cs (EventField): Don't mark value type event as synchronized.
4409 2007-10-12 Marek Safar <marek.safar@gmail.com>
4411 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
4412 inference to identify best candidate method correctly.
4413 (ProperyExpr): A range variable is read only and cannot be modified.
4415 2007-10-11 Marek Safar <marek.safar@gmail.com>
4417 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
4418 logic to identify best candidate method correctly.
4420 2007-10-11 Marek Safar <marek.safar@gmail.com>
4422 * location.cs (Equals, GetHashCode): Removed.
4424 2007-10-11 Marek Safar <marek.safar@gmail.com>
4426 * report.cs: Implemented message recorder. It is used mainly for lambda
4427 expressions to capture otherwise swallowed error messages.
4429 * anonymous.cs, lambda.cs.cs: Do full parameters check.
4431 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
4433 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
4435 * expression.cs (MemberAccess): Always report lookup failure.
4437 * location.cs: Implemented Equals, GetHashCode.
4439 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
4441 2007-10-10 Jb Evain <jbevain@novell.com>
4443 * codegen.cs: re-enable assembly version check.
4445 2007-10-09 Marek Safar <marek.safar@gmail.com>
4447 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
4450 * namespace.cs (UsingAlias): Do correct version check.
4452 2007-10-08 Marek Safar <marek.safar@gmail.com>
4454 * expresison.cs, ecore.cs: Issue extension method error message when
4457 * rootcontext.cs: Added ISO_2 compiler mode option.
4459 2007-10-08 Marek Safar <marek.safar@gmail.com>
4461 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
4464 2007-10-08 Marek Safar <marek.safar@gmail.com>
4466 * attribute.cs (GetString, GetBoolean): Work with both literal and
4469 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
4470 Moved method overload specific methods to MethodGroupExpr.
4472 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
4473 it should be less memory consuming.
4475 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
4477 * codegen.cs: remove the assembly version check until the buildbot is
4480 2007-10-07 Jb Evain <jbevain@novell.com>
4482 * attribute.cs (Attribute.GetString): if the value
4483 expression is a StringConstant, return its string value.
4485 2007-10-07 Jb Evain <jbevain@novell.com>
4487 * typemanager.cs: add `assembly_version_attribute_type`.
4488 * codegen.cs: on attribute emission, check that the
4489 AssemblyVersionAttribute doesn't overflow.
4491 2007-10-05 Marek Safar <marek.safar@gmail.com>
4493 A fix for bug #324677
4494 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
4495 parent container of a scope container with currently resolved one.
4497 2007-10-05 Marek Safar <marek.safar@gmail.com>
4499 A fix for bug #325534
4500 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
4503 2007-10-05 Marek Safar <marek.safar@gmail.com>
4505 A fix for bug #327504
4506 * class.cs (Operator.Define): Refactored implicit and explicit user
4507 operator conversion rules.
4509 2007-10-05 Marek Safar <marek.safar@gmail.com>
4511 A fix for bug #327520
4512 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
4514 2007-10-04 Marek Safar <marek.safar@gmail.com>
4516 A fix for bug #328022
4517 * class.cs (MethodData.Define): Use correct method to check whether
4518 a method implementents an accessor.
4520 2007-10-04 Marek Safar <marek.safar@gmail.com>
4522 A fix for bug #330069
4523 * statement.cs (Fixed.Resolve): Read the first array element only when
4524 an array is instantiated.
4526 2007-10-04 Marek Safar <marek.safar@gmail.com>
4528 * expression.cs, assign.cs, generics.cs: Print correct operator when
4529 compound assignment is used.
4531 2007-10-04 Marek Safar <marek.safar@gmail.com>
4533 A fix for bug #325841
4534 * expression.cs (ArrayAccess): Use full argument cloning only for
4535 string compound concatenation.
4537 2007-10-03 Marek Safar <marek.safar@gmail.com>
4539 A fix for bug #328774
4540 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
4542 (PropertyExpr.EmitAssign): Fixed string concatenation compound
4545 2007-10-03 Raja R Harinath <rharinath@novell.com>
4548 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
4549 Event accessibility checks here. Remove some bogus code that
4550 accidently made GenericMethods work.
4551 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
4553 2007-09-25 Marek Safar <marek.safar@gmail.com>
4555 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
4557 * statement.cs (Block): Refactored AddVariable to allow error handling
4560 * generic.cs: New stub.
4562 2007-09-23 Marek Safar <marek.safar@gmail.com>
4564 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
4567 2007-09-17 Marek Safar <marek.safar@gmail.com>
4569 * class.cs: Use partial container to record whether any partial part
4570 contains static field initializer and therefore default contructor has
4573 2007-09-14 Marek Safar <marek.safar@gmail.com>
4575 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
4576 mono-list when only one of two partial parts has defined accessibility
4579 2007-09-14 Marek Safar <marek.safar@gmail.com>
4581 A fix for bug #82845
4583 * class.cs (TypeContainer): Set correct resolve context for all field
4586 2007-09-13 Marek Safar <marek.safar@gmail.com>
4588 * assign.cs: Fixed a crash when field is resolved twice with an error.
4590 * codegen.cs: Changed InFieldInitializer to be flag.
4592 * anonymous.cs, ecore.cs, expression.cs: Update after
4593 IsInFieldInitializer rename.
4595 * const.cs: Removed unused parameter.
4597 * class.cs: Changed the way how we resolve and emit field initializers.
4598 The field initilizers have to have access to contructor block to emit
4599 compiler generated code.
4601 2007-09-13 Marek Safar <marek.safar@gmail.com>
4603 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
4604 generics use TypeContainer instead.
4606 2007-09-12 Marek Safar <marek.safar@gmail.com>
4608 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
4610 * lambda.cs (ResolveParameters): Use more powerful
4611 InflateGenericArgument.
4613 * parameters.cs: Better exception message.
4615 2007-09-10 Marek Safar <marek.safar@gmail.com>
4617 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
4618 correct expression block type.
4620 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
4622 * expression.cs (Invocation): Extracted method group resolve to
4625 2007-09-07 Marek Safar <marek.safar@gmail.com>
4627 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
4628 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
4630 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
4631 generic extension methods.
4633 2007-09-06 Marek Safar <marek.safar@gmail.com>
4635 A fix for bug #82676 (Do I get it right now?)
4636 * convert.cs (Binary.ResolveOperator): An interface is converted to the
4637 object before a standard conversion is applied.
4639 2007-09-06 Marek Safar <marek.safar@gmail.com>
4641 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
4644 2007-09-05 Marek Safar <marek.safar@gmail.com>
4646 A fix for bug #82676
4647 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
4648 non-generic interface types.
4650 2007-09-05 Marek Safar <marek.safar@gmail.com>
4652 A fix for bug #82690
4653 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
4655 2007-09-05 Marek Safar <marek.safar@gmail.com>
4657 A fix for bug #82571
4658 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
4659 modifier for container based methods.
4661 2007-09-05 Marek Safar <marek.safar@gmail.com>
4663 A fix for bug #82676
4664 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
4665 any interface-type T means to any of interface type T.
4667 2007-09-04 Marek Safar <marek.safar@gmail.com>
4669 * namespace.cs: We have 2 versions of System.Core assembly.
4671 2007-09-04 Marek Safar <marek.safar@gmail.com>
4673 A fix for bug #82652
4674 * class.cs (Class.GetClassBases): Compare types and not expressions.
4676 2007-09-04 Marek Safar <marek.safar@gmail.com>
4678 A fix for bug #82620
4679 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
4680 actually never worked before.
4681 (IndexerAccess): Emit prepared arguments before they are modified.
4683 2007-09-04 Marek Safar <marek.safar@gmail.com>
4685 A fix for bug #82563
4686 * assign.cs: Revert wrong fix.
4688 * expression.cs (VariableReference.EmitAssign): Handle ref reference
4690 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
4691 Instead of ldelema/stdind we have to use temporary variables to handle
4692 cases like String.Concat (params string[]).
4694 2007-08-31 Marek Safar <marek.safar@gmail.com>
4696 * class.cs: EmitAttributes to Emit rename.
4698 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
4700 (MemberCore.HasClsCompliantAttribute): Don't depend on
4701 GetClsCompliantAttributeValue execution.
4703 2007-08-31 Marek Safar <marek.safar@gmail.com>
4705 * anonymous.cs: Use shorter type prefix.
4707 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
4710 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
4711 variables when probing is on.
4713 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
4714 unresolved variables.
4715 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
4716 handle transparent identifiers.
4718 2007-08-26 Marek Safar <marek.safar@gmail.com>
4720 * attribute.cs (IsClsCompliant): Add nullable types test.
4722 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
4724 * doc.cs : catch other types of exception than XmlException to
4725 report CS1570. Fixed bug #82565.
4727 2007-08-23 Marek Safar <marek.safar@gmail.com>
4729 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
4730 The number of delegate parameters has to match.
4731 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
4734 2007-08-21 Marek Safar <marek.safar@gmail.com>
4736 * anonymous.cs (AnonymousMethod): Generate private anonymous method
4737 to fix problem with private arguments.
4739 2007-08-20 Marek Safar <marek.safar@gmail.com>
4741 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
4743 * decl.cs (MemberName): Ignore generic type with no generic arguments.
4745 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
4746 empty. Add cloning suport.
4748 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
4750 2007-08-20 Marek Safar <marek.safar@gmail.com>
4752 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
4753 to create EmptyCast. It handles EmptyConstantCast specialization for
4756 2007-08-18 Marek Safar <marek.safar@gmail.com>
4758 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
4759 (EmitArrayArgument): One routine for array arguments.
4760 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
4762 2007-08-17 Marek Safar <marek.safar@gmail.com>
4764 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
4766 2007-08-17 Marek Safar <marek.safar@gmail.com>
4768 * anonymous.cs: MemberLookupFinal update.
4770 * class.cs (ConstructorInitializer): Is expression based.
4772 * delegate.cs: MethodGroupExpr update.
4774 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
4776 (Error_MemberLookupFailed): Customizable error override.
4777 (MethodGroupExpr): Keep queried type for later usage.
4778 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
4781 * expression.cs: Error_MemberLookupFailed refactoring.
4782 (New.DoResolve): Resolve as much as possible.
4783 (ElementInitializer.Error_MemberLookupFailed): Object initializer
4784 customization for invalid member types.
4786 * statement.cs: MethodGroupExpr update.
4788 2007-08-16 Marek Safar <marek.safar@gmail.com>
4790 * modifier.cs (Check): Check all modifiers and not only accessibility
4793 2007-08-16 Marek Safar <marek.safar@gmail.com>
4795 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
4796 type and not an expression.
4798 2007-08-16 Marek Safar <marek.safar@gmail.com>
4800 * statement.cs (Catch.Clone): Type and variable can be null.
4802 2007-08-16 Marek Safar <marek.safar@gmail.com>
4804 A fix for bug #81979
4805 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
4806 I am really not sure whether this is the best fix.
4808 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
4811 2007-08-14 Marek Safar <marek.safar@gmail.com>
4813 ** C# 3.0 Object and collection initializers (major re-write)
4815 * assign.cs (DoResolve): Initializers are not assign related.
4817 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
4818 used during collection or object initialization.
4820 * expression.cs (Error_InvalidArguments): Add initializers specific
4821 messages. More will come later because it requires some general
4823 (New.DoResolve): Better error handling for unsafe types.
4824 (EmptyExpressionStatement): New class.
4825 (ElementInitializer): An object initializer expression.
4826 (CollectionElementInitializer): A collection initializer expression.
4827 (CollectionOrObjectInitializers): A block of object or collection
4829 (NewInitialize): New expression with element/object initializers.
4831 * statement.cs: Reverted object/collection initializer hacks.
4833 * typemanager.cs (CSharpName): Filter __arglist type.
4835 2007-08-09 Marek Safar <marek.safar@gmail.com>
4837 ** C# 3.0 Anonymous Types (update to the latest standard)
4839 * expression.cs (Binary.ResolveOperator): Threat all null based types
4841 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
4842 (AnonymousTypeParameter): Updated.
4844 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
4845 (AnonymousTypeClass): New anonymous type container.
4847 * class.cs (AddField): Return operation result.
4849 * generic.cs: Another empty TypeArguments overload.
4851 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
4852 are stored at top of normal hierarchy.
4854 * typemanager.cs (CSharpName): Filter anonymous types.
4856 2007-08-09 Marek Safar <marek.safar@gmail.com>
4858 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
4859 as single Concat call. How could we miss that :-(
4861 2007-08-08 Marek Safar <marek.safar@gmail.com>
4863 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
4865 2007-08-07 Miguel de Icaza <miguel@novell.com>
4867 * expression.cs: Fix the previous commit, the creation of the
4868 arguments array list needs also to be conditional on the arguments
4871 * class.cs: Add a little bit of help to help narrow down problems.
4873 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
4874 not try to copy in that case.
4876 * driver.cs: When building SMCS, include a new different set of
4877 default assemblies here. Do this here so we can control whether
4878 to include the default assemblies with /noconfig.
4880 2007-08-03 Marek Safar <marek.safar@gmail.com>
4882 A fix for bug #81979
4883 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
4886 2007-08-03 Marek Safar <marek.safar@gmail.com>
4888 A fix for bug #82300
4890 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
4891 we are in probing scope.
4893 2007-08-03 Marek Safar <marek.safar@gmail.com>
4895 A fix for bug #82301
4897 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
4898 (Statement.CloneTo): Clone and not map children blocks.
4900 2007-08-03 Marek Safar <marek.safar@gmail.com>
4902 A fix for bug #82299
4904 * expression.cs (LocalVariableReference.CloneTo): Remap local info
4907 * statement.cs (Statement.CloneTo): Clone variables before statements
4908 to allow remaping of local variables.
4910 2007-08-03 Marek Safar <marek.safar@gmail.com>
4912 A fix for bug #82296
4915 * report.cs: Log crash details for future clone problems.
4917 * statement.cs (Return.Clone): Don't clone non-existent expression.
4919 2007-08-03 Raja R Harinath <harinath@gmail.com>
4921 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
4922 (Class.AddBasesForPart): Move CS0537 check here from ...
4923 * cs-parser.jay (class_declaration): ... here. Move calling of
4924 'AddBasesForPart' to ...
4925 (class_bases): ... here.
4926 (struct_declaration, interface_declaration): Update to changes.
4928 2007-08-02 Marek Safar <marek.safar@gmail.com>
4930 A fix for bug #81923
4932 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
4933 conversion is allowed.
4935 2007-08-02 Marek Safar <marek.safar@gmail.com>
4937 A fix for bug #81564
4939 * ecore.cs (EventExpr): Add IsBase handling.
4941 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
4944 2007-08-02 Raja R Harinath <harinath@gmail.com>
4946 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
4947 * cs-parser.jay: Some whitespace cleanups.
4948 (current_delegate): New.
4950 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
4951 a dummy code block, and use 'type_name' instead of 'member_name'.
4952 (interface_declaration, class_declaration): Likewise.
4953 (delegate_declaration): Likewise. Rearrange slightly and use
4955 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
4956 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
4958 2007-08-02 Marek Safar <marek.safar@gmail.com>
4960 A fix for bug #82039
4962 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
4965 * typemanager.cs (CSharpName): Split to string overload.
4967 2007-08-02 Marek Safar <marek.safar@gmail.com>
4970 * report.cs: Updated warning CS0472.
4972 2007-08-01 Marek Safar <marek.safar@gmail.com>
4974 A fix for bug #82181
4976 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
4978 2007-08-01 Marek Safar <marek.safar@gmail.com>
4980 A fix for bug #82277
4981 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
4983 2007-08-01 Marek Safar <marek.safar@gmail.com>
4985 ** C# 3.0 Type Inference (major bits are working)
4987 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
4988 (.ImplicitStandardConversionExists): Uses compatible.
4989 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
4990 (.InferReturnType): New method.
4991 (.Compatible): Refactored.
4992 (.ResolveParameters): Uses factory to create resolved parameters.
4993 (.CompatibleMethod): Add probing mode support.
4994 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
4995 clearly distinguish between 2 different operations.
4996 (LambdaMethod): Moved to lambda.cs.
4997 (AnonymousMethod): Removed unused fields and methods.
4998 (AnonymousDelegate): Simplified.
5000 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
5002 * convert. cs (ImplicitConversionStandard): Compatible works differently.
5004 * delegate.cs (Delegate): New mehods to reduce code duplication.
5005 (.GetConstructor): New method.
5006 (.GetInvokeMethod): New method.
5007 (DelegateCreation): Updated.
5009 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
5011 (OverloadResolve): Made probing little bit faster.
5013 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
5016 * generic.cs (TypeInferenceContext): Dummy implementation.
5018 * iterators.cs: Updated after Resolve/Define rename.
5020 * lambda.cs (LambdaExpression)
5021 (.ResolveParameters): Handles both type of arguments and type inference too.
5023 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
5024 (InflateTypes): Updated.
5026 * support.cs (InflateTypes): Changed signature and updated.
5028 * typemanager.cs (LookupMemberCache): Better dynamic type check.
5029 (MemberLookup_FindMembers): More MS tricks.
5030 (GetParameterData): Ditto.
5031 (GetDelegateParameters): Uses quick path for dynamic types.
5033 2007-08-01 Marek Safar <marek.safar@gmail.com>
5035 * class.cs (MethodData.Define): EmitContext is required for generic stuff
5038 2007-07-31 Marek Safar <marek.safar@gmail.com>
5040 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
5043 2007-07-26 Jb Evain <jbevain@novell.com>
5045 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
5046 which takes a boolean 'report_errors', similar to the GetMethod.
5047 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
5048 in .net 2.1, do not report errors here.
5050 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
5051 System.Runtime.CompilerServices.RequiredAttributeAttribute and
5052 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
5055 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
5056 of the type InternalsVisibleToAttribute before the first call
5057 to CoreLookupType which is allowed to fail (third boolean parameter
5058 to true). Because, during the resolution for a type that is not
5059 immediately found, we try to check if the type is not defined in
5060 a friend assembly, and to do so, we need the
5061 InternalVisibleToAttribute.
5063 2007-07-23 Miguel de Icaza <miguel@novell.com>
5065 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
5066 feature that allows structs to be compared against null and inline
5067 the result as true or false.
5069 Notice that the same code is not permitted inside a generic block
5070 of code that would do:
5072 class Foo<T> where T : struct {
5079 It is only allowed if the type of T is not bound (no where
5080 clause). In my opinion, this CSC 2 behavior is broken but people
5081 seem to be using it (IronRuby does, a few bug reports on bugzilla
5082 have it and some people have complained about it).
5084 All of the users that depend on this behavior have code that is
5087 * report.cs (Warning, Error): make these take object arguments,
5088 not strings, as that allows us to take advantage of Format.
5090 2007-07-20 William Holmes <billholmes54@gmail.com>
5092 * decl.cs: Changed MemberName.CountTypeArguments to also check the
5093 Left member variable for the Count.
5094 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
5095 MemberName.CountTypeArguments to avoid a NRE.
5097 This code is contributed under the MIT X11 license
5099 2007-07-18 Marek Safar <marek.safar@gmail.com>
5101 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
5103 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
5105 * doc.cs : generic method arguments are written as ``x while generic
5106 type arguments are `x. Combined with the previous change, fixed bug
5109 2007-07-18 Raja R Harinath <rharinath@novell.com>
5112 * expression.cs (Binary.ResolveOperator): When converting
5113 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
5115 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
5117 * doc.cs : when T: or whatever x: is specified, it does not really
5118 check the doc comment's syntax correctness. Fixed bug #82006.
5120 2007-07-18 Marek Safar <marek.safar@gmail.com>
5122 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
5123 LambdaExpression better.
5125 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
5127 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
5129 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
5130 as it can be generated.
5132 * expression.cs (Invocation.Error_InvalidArguments): Show correct
5135 * lambda.cs (LambdaExpression): Refactored to share same code with
5136 AnonymousMethodExpression.
5138 2007-07-17 Marek Safar <marek.safar@gmail.com>
5140 * anonymous.cs (MakeName): Include host name for easier debugging.
5141 (LambdaMethod): New class for lambda spcecific stuff.
5143 * attribute.cs: Set EmitContext return type.
5145 * class.cs: Set EmitContext return type.
5147 * codegen.cs (EmitContext): Return type cannot be null to stop messing
5148 with null/void meaning.
5150 * iterators.cs (ContainerType): Implemented.
5152 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
5154 * statement.cs (Return): Updated to lambda expressions.
5155 (Block.CloneTo): Parent can be null.
5157 2007-07-13 Marek Safar <marek.safar@gmail.com>
5159 A fix for bug #81917
5160 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
5162 * class.cs (FixedField): Check whether field is in unsafe scope.
5164 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
5165 (FieldExpr.Emit): Fixed buffers cannot be volatile.
5167 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
5170 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
5172 2007-07-13 Marek Safar <marek.safar@gmail.com>
5174 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
5175 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
5178 2007-07-13 Marek Safar <marek.safar@gmail.com>
5180 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
5182 2007-07-13 Marek Safar <marek.safar@gmail.com>
5184 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
5185 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
5187 * codegen.cs(EmitContext): Add ProbingMode flag.
5189 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
5191 * driver.cs: For now set both warning values.
5193 * ecore.cs (SimpleName): Name is readonly.
5194 (MethodGroup.OverloadResolve): One quick path for probing.
5196 * expression.cs (Unary): Set Oper r/o.
5197 (Binary): Set Oper r/o.
5198 (ParameterReference): Set few instance variables as r/o.
5199 (ParameterReference.DoResolveBase): Don't capture aruments when
5201 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
5202 (Arglist): arguments are private.
5203 (SizeOf): type is private and r/o.
5204 (MemberAccess): arguments are private.
5206 * report.cs: Enhanced reporting on/off capabilities.
5208 * lambda.cs: Uses ec.IsInProbingMode.
5209 (ContextualReturn): Derives from return.
5211 * rootcontext.cs: For now set both warning values.
5213 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
5215 (Return.Resolve): Don't die immediately.
5216 (Block.Resolve): Speed-up probing.
5217 (Block.CloneTo): Clone only child blocks.
5219 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
5221 * iterators.cs: reverted Miguel's latest change (r81925) as it
5222 breaks the build in System.
5224 2007-07-13 Miguel de Icaza <miguel@novell.com>
5226 * iterators.cs (Yield.CheckContext): Check for the iterator type
5227 also here as we can call into Yield even in codepaths that are not
5229 (MethodOrOperator is the only path that was checked).
5231 In addition to the standard check, use a more specific check for
5232 constructors to report a more verbose error.
5234 2007-07-12 Miguel de Icaza <miguel@novell.com>
5236 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
5237 report the warning and continue
5239 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
5240 values on the stack on the call to Emit. Use EmitStatement if
5241 possible, or using Emit + Pop if not possible. Fixes #82064
5243 2007-07-12 Raja R Harinath <rharinath@novell.com>
5245 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
5246 avoid try...finally in some cases.
5248 2007-07-10 Marek Safar <marek.safar@gmail.com>
5250 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
5252 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
5253 instead of method. Re-use standard error handling.
5254 (ConstructorInitializer.Emit): Simplified.
5256 * delegate.cs: Updated after Invocation.EmitCall change.
5258 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
5259 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
5260 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
5261 method and don't permanently changing input arguments.
5262 (MethodGroupExpr): Introduced resolved best_candidate, when method group
5263 is resolved it has one of the candidates is the best one which is later
5264 used to emit. Removed a few unused method.
5265 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
5267 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
5268 (Binary.ResolveOperator): Ditto.
5269 (ConditionalLogicalOperator.DoResolve): Ditto.
5270 (Invocation): Uses method group.
5271 (Invocation.DoResolve): Simplified.
5272 (Invocation.EmitCall): Removed useless is_static.
5273 (Invocation.Emit): Delegate to method group.
5274 (Invocation.EmitStatement): Simplified.
5275 (New): Uses method group.
5276 (MemberAccess.DoResolve): Don't destroy original expression.
5278 * statement.cs (ForEach.Resolve): Use null for no method arguments.
5280 2007-07-04 Marek Safar <marek.safar@gmail.com>
5282 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
5285 * lambda.cs: Add custom error message type.
5287 2007-07-03 Marek Safar <marek.safar@gmail.com>
5289 * lambda.cs: Simplified little bit.
5291 * parameter.cs: Introduced ImplicitLambdaParameter.
5292 (Parameters.CreateFullyResolved): New factory instead of ctor.
5296 * delegate.cs: Updated parameter creation.
5298 2007-07-03 Marek Safar <marek.safar@gmail.com>
5300 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
5303 * generic.cs: Synchronized with gmcs.
5305 2007-07-03 Marek Safar <marek.safar@gmail.com>
5307 * class.cs (Indexer): Check return type as soon as possible.
5309 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
5312 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
5314 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
5316 * parameter.cs (Parameter): Use expression type when it is available.
5318 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
5319 method modifier for the first parameter only.
5321 2007-06-24 Marek Safar <marek.safar@gmail.com>
5323 A fix for bug #81938
5324 * typemanager.cs (ChangeType): Fixed couple of char conversions.
5326 * constant.cs: Tide up an exception message.
5328 2007-06-22 Marek Safar <marek.safar@gmail.com>
5330 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
5331 an uninitialized variable is used.
5333 * expression.cs (LocalVariableReference.DoResolve): Ditto.
5335 2007-06-22 Marek Safar <marek.safar@gmail.com>
5337 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
5338 not found error handling.
5340 * expression.cs (ArrayCreation): Removed redundant fields and little bit
5342 (ArrayCreation.ResolveArrayElement): To be ready to customization.
5343 (ArrayCreation.DoResolve): Simplified.
5344 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
5345 its own resolve process.
5346 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
5348 2007-06-20 Marek Safar <marek.safar@gmail.com>
5350 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
5353 2007-06-20 Marek Safar <marek.safar@gmail.com>
5355 * cs-tokenizer.cs: Removed var related stuff.
5357 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
5358 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
5359 a type and a keyword at same time.
5361 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
5364 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
5365 implicitly typed arrays, more changes will follow.
5367 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
5369 2007-06-19 Marek Safar <marek.safar@gmail.com>
5371 * ecore.cs (VarExpr): Removed Handled field.
5373 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
5374 build-in assign functionality.
5375 (ForEach.Resolve): Removed all implicitly typed local variable code and
5377 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
5378 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
5380 2007-06-18 Marek Safar <marek.safar@gmail.com>
5382 * assign.cs: Removed implicitly typed local variable check.
5384 * expression.cs (LocalVariableReference.DoResolve): Add check for self
5385 referencing implicitly typed local variable.
5386 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
5389 * statement.cs (Fixed): Removed unsupported implicitly typed local
5392 2007-06-15 Marek Safar <marek.safar@gmail.com>
5394 * decl.cs (MemberName): Moved all Unbound stuff to parser.
5396 2007-06-14 Marek Safar <marek.safar@gmail.com>
5398 A fix for bugs #81855 and #76274
5399 * attribute.cs (AttachTo): Always set owner for global attributes to
5402 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
5405 * cs-parser.jay: Assembly and module attributes must precede all other
5406 elements except using clauses and extern alias declarations.
5408 2007-06-13 Marek Safar <marek.safar@gmail.com>
5410 A fix for bug #81748
5412 * expression.cs: More checks for non ISO-1 features.
5414 2007-06-12 Marek Safar <marek.safar@gmail.com>
5416 A fix for bug #81807
5417 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
5418 present inside switch statement and it is required by nullable check.
5420 2007-06-12 Marek Safar <marek.safar@gmail.com>
5422 A fix for bug #81840
5423 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
5424 when type matching fails.
5426 * namespace.cs: Tiny error message change.
5428 2007-06-12 Marek Safar <marek.safar@gmail.com>
5430 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
5431 reporting. Added automatic property check.
5433 * class.cs: Updated after CheckAbstractAndExtern relocation.
5434 (AEventPropertyAccessor.GetSignatureForError): Customized.
5436 2007-06-11 Marek Safar <marek.safar@gmail.com>
5438 * class.cs (DefineBaseTypes): Base type can be undefined.
5440 * ecore.cs (TypeLookup): Minor refactoring.
5441 (DoResolveAsTypeStep): Removed redundant check.
5443 * namespace.cs (Lookup): Removed redundant check.
5445 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
5446 ResolveAsTypeTerminal step.
5447 (BootstrapCorlib_*): Simplified.
5448 (PopulateCoreType): Core types can be now external.
5450 2007-06-07 Marek Safar <marek.safar@gmail.com>
5452 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
5454 (InferTypeArguments): Infers anonymous expression type arguments.
5455 (Compatible): Split to Compatible and InferTypeArguments.
5457 * lambda.cs: Updated.
5459 2007-06-08 Marek Safar <marek.safar@gmail.com>
5461 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
5463 2007-06-07 Raja R Harinath <harinath@gmail.com>
5465 Fix #80477, cs0135-2.cs, cs0135-3.cs
5466 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
5467 names to the "known" variables list.
5468 (Block.CheckInvariantMeaningInBlock): Handle the fact the
5469 parameter names are also "known".
5470 (Block.CheckError136): Remove.
5471 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
5474 2007-06-07 Marek Safar <marek.safar@gmail.com>
5476 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
5478 2007-06-06 Marek Safar <marek.safar@gmail.com>
5480 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
5481 internal error not an user error.
5483 * expression.cs (IsApplicable): Refactored to make debugging easier.
5485 * support.cs: More tricks for non-mono runtimes.
5487 * typemanager.cs (CoreLookupType): Made public.
5488 (InitSystemCore): All linq specific stuff moved to linq.cs
5490 2007-06-05 Marek Safar <marek.safar@gmail.com>
5492 * typemanager.cs (CSharpSignature): One more missing build-in types
5494 More tricks for non-mono runtime.
5496 2007-06-05 Raja R Harinath <harinath@gmail.com>
5498 * statement.cs (Block.CheckError136_InParents): Remove.
5499 (Block.AddVariable): Use GetParameterInfo instead.
5500 (ToplevelBlock.ProcessArguments): Likewise.
5502 2007-06-04 Raja R Harinath <rharinath@novell.com>
5504 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
5506 (ToplevelBlock.GetParameterInfo): Split out of ...
5507 (ToplevelBlock.GetParameterRefernce): ... this.
5508 (ToplevelBlock.ParameterMap): Remove.
5509 * expression.cs (ParameterReference): Update to use
5510 ToplevelParameterInfo.
5512 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
5515 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
5516 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
5518 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
5519 (ToplevelBlock.ProcessParameters) ... here.
5520 (ToplevelBlock..ctor): Invoke it.
5522 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
5525 * statement.cs (IKnownVariable): New interface.
5526 (LocalInfo): Implement it.
5527 (ToplevelParameterInfo): New class.
5528 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
5529 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
5530 GetKnownVariableInfo.
5532 2007-06-03 Raja R Harinath <harinath@gmail.com>
5534 Partly speed up CS0136 error checks.
5535 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
5536 'recurse' parameter.
5537 (Block.DoCheckError136): Only check errors in parameters. Move
5538 local variable checks ...
5539 (Block.AddVariable): ... here, and ...
5540 (ToplevelBlock.ResolveMeta): ... here.
5542 2007-06-02 Raja R Harinath <harinath@gmail.com>
5544 * statement.cs (Block.IsChildOf): Remove.
5546 * statement.cs (Statement.Clone): Move special case code ...
5547 (Block.CloneTo): ... here.
5549 2007-05-29 Raja R Harinath <rharinath@novell.com>
5551 * statement.cs (ToplevelBlock.container): Remove field. It's
5552 redundant with 'Parent'.
5553 (ToplevelBlock.ContainerBlock): Remove accessor.
5554 (ToplevelBlock..ctor): Update to changes. Register anonymous
5555 child with parent here, ...
5556 * cs-parser.jay (end_anonymous): ... not here. Don't modify
5558 (start_anonymous): Don't save current_block.
5559 (top_current_block): Remove.
5561 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
5562 (Block.Resolve): Update to changes.
5563 (Block..ctor): Move setting of "correct" 'Toplevel'
5564 and 'Explicit' fields to ...
5565 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
5567 2007-05-27 Raja R Harinath <harinath@gmail.com>
5570 * statement.cs (Block.Implicit): Remove.
5571 (Block): Update to changes.
5572 * flowanalysis.cs: Likewise.
5574 Mildly speed up CheckInvariantMeaningInBlock
5575 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
5576 Recursively call AddKnownVariable to all enclosing blocks.
5577 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
5578 Remove recursive calls.
5579 (Block): Update to changes.
5581 New ExplicitBlock invariants
5582 * statement.cs (Block.Explicit): New field. It points to the
5583 immediately enclosing non-implicit block.
5584 (Block..ctor): Maintain the invariant.
5585 * cs-parser.jay: Take advantage of invariant.
5587 Introduce ExplicitBlock
5588 * statement.cs (ExplicitBlock): New.
5589 (ToplevelBlock): Derive from it.
5590 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
5592 (Block.Implicit): Update to changes.
5593 * cs-parser.jay: Update to changes.
5596 * codegen.cs (EmitContext.IsLastStatement): Remove.
5597 * statement.cs (Block.DoEmit): Update to changes.
5599 2007-05-25 Raja R Harinath <rharinath@novell.com>
5601 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
5602 modifying current_block directly.
5604 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
5606 * class.cs: Implemented automatic properties (C# 3.0)
5607 Thanks to Marek for the help.
5609 2007-05-23 Raja R Harinath <rharinath@novell.com>
5611 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
5612 variable as assigned, note also that all its components are
5614 (MyBitVector.SetRange): New. Function to set multiple bits to true.
5616 2007-05-19 Marek Safar <marek.safar@gmail.com>
5618 * anonymous.cs, class.cs: Emit Compiler generated attribute when
5619 member is marked as compiler generated.
5621 * decl.cs (MemberCore): Refactored ModFlags into property.
5623 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
5624 (Check): Check only accessibility modifiers.
5626 2007-05-18 Raja R Harinath <rharinath@novell.com>
5628 Track all assignable slots in one bit array
5629 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
5630 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
5631 logic from VariableMap constructor here. Use the same 'offset'
5632 variable that's later used for computing offsets of local
5634 * flowanalysis.cs (UsageVector.parameters): Remove.
5635 (UsageVector): Update to changes.
5636 (VariableMap): Remove.
5638 Avoid creating ParameterMap in every block
5639 * statement.cs (Block.ParameterMap): Move ...
5640 (ToplevelBlock.ParameterMap): ... here.
5641 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
5643 * flowanalysis.cs (FlowBranching.param_map): Remove.
5644 (FlowBranching.UsageVector): Update to changes.
5645 (FlowBranchingToplevel.CheckOutParameters): Likewise.
5647 * statement.cs (Block.CloneTo): Clone Toplevel field too.
5649 * expression.cs (ParameterReference): Distinguish between block
5650 where parameter was referenced and declared.
5652 2007-05-18 Marek Safar <marek.safar@gmail.com>
5654 * flowanalysis.cs, statement.cs: Put back improved error handling.
5656 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
5660 Imporved object and collection initialization (C# 3.0).
5662 2007-05-15 Marek Safar <marek.safar@gmail.com>
5664 A fix for bug #81380
5665 * expression.cs (Is.DoResolve): Only value types have constant `is'
5668 2007-05-15 Raja R Harinath <rharinath@novell.com>
5670 * statement.cs (ToplevelBlock.child): Remove.
5672 2007-05-15 Raja R Harinath <harinath@gmail.com>
5674 Rationalize ResolveMeta: refactoring
5675 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
5676 out constant handling code into ...
5677 (Block.DoResolveConstants): ... this.
5679 Rationalize ResolveMeta: kill local_map
5680 * statement.cs (Block.local_map, Block.LocalMap): Remove.
5681 (Block.AssignableSlots): New.
5682 (Block.ResolveMeta): Make protected. Don't create a VariableMap
5683 for locals -- move code from VariableMap here. Avoid unnecessary
5685 * flowanalysis.cs (FlowBranching.local_map): Remove.
5686 (FlowBranching..ctor): Use Block.AssignableSlots.
5687 (VariableMap): Remove unused constructors.
5689 2007-05-11 Raja R Harinath <rharinath@novell.com>
5691 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
5693 2007-05-11 Marek Safar <marek.safar@gmail.com>
5695 * typemanager.cs (IsFriendAssembly): Should not be called for building
5698 2007-05-09 Marek Safar <marek.safar@gmail.com>
5700 * literal.cs (NullConstant): Print null in all cases.
5702 * expression.cs (Binary.ResolveOperator): Implemented delegate
5703 comparison based on C# 2.0 changes.
5705 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
5707 This code is contributed under the MIT X11 license
5709 The following enables support for several C# 3.0 language features:
5711 * cs-tokenizer.cs: Added support for the "var" keyword.
5713 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
5714 Added VarExpr class to facilitate type inferencing.
5716 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
5717 to support anonymous types.
5719 * assign.cs: Added support for type inferencing and initialization.
5721 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
5723 * expression.cs: Added implicit array support to ArrayCreation.
5724 Added 5 types and 1 interface:
5726 IInitializable Implementing classes can inject initializing
5727 statements after object instantiation.
5729 Initializer Stores data for object initialization.
5731 AnonymousType An expression for anonymous types.
5733 AnonymousTypeParameter Stores data about an anonymous type's field.
5735 NewInitialize An expression for object initialization.
5737 CollectionInitialize An expression for collection initialization.
5739 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
5742 2007-05-06 Marek Safar <marek.safar@gmail.com>
5744 A fix for bug #81500
5745 * cs-tokenizer.cs: Add special handling for coalescing operator.
5747 2007-05-06 Marek Safar <marek.safar@gmail.com>
5749 A fix for bug #81529
5750 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
5751 its value from base class until it is redefined.
5753 2007-05-02 Raja R Harinath <rharinath@novell.com>
5755 Fix regression in cs0631-3.cs
5756 * cs-parser.jay (operator_declarator): Add opt_attributes to error
5757 fallback. Make error fallback catch more cases.
5759 2007-05-01 Miguel de Icaza <miguel@novell.com>
5761 * cs-parser.jay: Allow parameters in operator declarations to have
5764 2007-04-27 Miguel de Icaza <miguel@novell.com>
5766 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
5769 * lambda.cs (ContextualReturn.Resolve): An expression is valid
5770 inside the ContextualReturn, it does not have to be an
5771 ExpressionStatement.
5773 2007-04-24 Miguel de Icaza <miguel@novell.com>
5775 * lambda.cs (ContextualReturn.Resolve): if the return type is not
5778 2007-04-23 Miguel de Icaza <miguel@novell.com>
5780 * anonymous.cs (AnonymousContainer): split the virtual Resolve
5781 method in two methods: ResolveNoDefine and Resolve.
5783 ResolveNoDefine will stop just after ResolveTopBlock has been
5786 Resolve will then continue by creating a method and issuing the
5787 call to method.Define ().
5789 (AnonymousMethod): Split and implement the new Resolve and
5790 ResolveNoDefine as well.
5792 * lambda.cs (LambdaExpression): Split the anonymous method
5793 resolution code into a separate routine (CoreCompatibilityTest)
5794 from DoCompatibleTest.
5796 (LambdaExpression.TryBuild): New method, this method tries to
5797 build the LambdaExpression with the given set of types to be used
5798 as the types for the various parameters of the lambda expression.
5800 If the compilation succeed with the given types, the infered type
5801 of the Anonymous method is returned, otherwise null is returned.
5803 2007-04-23 Marek Safar <marek.safar@gmail.com>
5805 A fix for bug #81414
5806 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
5808 2007-04-22 Miguel de Icaza <miguel@novell.com>
5810 * cs-tokenizer.cs: Change various identifiers here from the
5811 camelCasing to the recommended Linux-like style for instance
5812 variables from the Coding Guidelines.
5814 2007-04-19 Martin Baulig <martin@ximian.com>
5817 (Convert.ImplicitReferenceConversionCore): Allow conversions from
5818 System.Enum to System.ValueType.
5820 2007-04-13 Martin Baulig <martin@ximian.com>
5822 Rewrote implicit reference conversions. We need to distinguish
5823 between implicit reference conversions (13.1.4) and implicit
5824 boxing conversions (13.1.5).
5826 According to the spec, there's an an implicit conversion
5827 "From a one-dimensional array-type S[] to IList<T> and base
5828 interfaces of this interface, provided there is an implicit
5829 reference conversion from S to T." Note that this does not
5830 include boxing conversions.
5833 (Convert.ImplicitTypeParameterBoxingConversion): New method.
5834 (Convert.ImplicitReferenceConversion): Split into
5835 ImplicitReferenceConversionCore() and
5836 ImplicitBoxingConversionExist().
5837 (Convert.ImplicitReferenceConversionExists): Use the new
5838 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
5840 2007-04-12 Martin Baulig <martin@ximian.com>
5842 * convert.cs (Convert.ImplicitReferenceConversion): Move the
5843 `TypeManager.null_type' checks up to the top of the method.
5845 2007-04-11 Marek Safar <marek.safar@gmail.com>
5847 A fix for bug #81350
5848 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
5851 2007-04-11 Martin Baulig <martin@ximian.com>
5853 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
5854 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
5855 to make this work for generic classes; fixes #79561.
5857 2007-04-11 Martin Baulig <martin@ximian.com>
5859 * expression.cs (As): Add support for nullable types; fixes #79371.
5861 2007-04-11 Martin Baulig <martin@ximian.com>
5863 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
5864 `type.FullName' is null; fixes #80243.
5866 2007-04-11 Martin Baulig <martin@ximian.com>
5868 * expression.cs (Invocation.IsApplicable): Don't modify the method
5869 if type inference succeeded, but the method was not applicable.
5872 2007-04-10 Marek Safar <marek.safar@gmail.com>
5874 A fix for bug #81324
5875 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
5876 internal and external namespaces containers.
5878 2007-04-10 Martin Baulig <martin@ximian.com>
5880 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
5881 TypeManager.DropGenericMethodArguments() so we also call
5882 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
5884 2007-04-10 Martin Baulig <martin@ximian.com>
5886 * iterators.cs (Iterator.CreateIterator): Don't crash if
5887 `method.ReturnType' is null. This happens if something went wrong
5888 while resolving that typ (we already reported an error in this case).
5890 2007-04-10 Martin Baulig <martin@ximian.com>
5892 * expression.cs (New.DoResolve): Don't call CheckComImport() on
5893 generic interfaces; report the CS0144 directly.
5895 2007-04-10 Martin Baulig <martin@ximian.com>
5897 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
5898 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
5900 2007-04-10 Martin Baulig <martin@ximian.com>
5902 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
5904 2007-04-09 Raja R Harinath <rharinath@novell.com>
5907 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
5908 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
5911 * statement.cs (For.Resolve): If resolution fails, use
5914 2007-04-08 Marek Safar <marek.safar@gmail.com>
5916 * anonymous.cs (MakeName): Make faster and zero-based.
5917 (VerifyExplicitParameterCompatibility): Back to mode where generic
5918 parameter is ignored.
5919 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
5921 * class.cs (EmitType): Method can emit another new method.
5923 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
5925 * driver.cs: Updated.
5927 * lambda.cs: Reuse predefined empty parameters.
5929 * parameter.cs: Updated
5931 * support.cs: Implemented InflateTypes.
5933 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
5934 (InitSystemCore): Introduced to isolate 3.0 dependencies.
5936 2007-04-03 Martin Baulig <martin@ximian.com>
5940 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
5941 version of TypeManager.IsOverride() which also works with generic
5944 2007-04-03 Martin Baulig <martin@ximian.com>
5949 (Convert.ExplicitReferenceConversion): We need to cast when
5950 converting from IList<T> to S[].
5952 2007-04-01 Marek Safar <marek.safar@gmail.com>
5954 * decl.cs (FindExtensionMethods): Consider all candidates with same name
5957 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
5959 2007-03-31 Marek Safar <marek.safar@gmail.com>
5961 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
5962 argument and return type inferring.
5964 * codegen.cs (InferReturnType): Flag whether return can be inferred.
5965 (ReturnType): Turned to property.
5967 * statement.cs (Return): Implemented return type inferring.
5969 * support.cs (ReflectionParameters): Use local types if possible.
5971 2007-03-30 Raja R Harinath <rharinath@novell.com>
5973 * flowanalysis.cs (FlowBranching.Reachability): Remove.
5974 (FlowBranching.UsageVector): Update to changes.
5976 Prepare to kill 'Reachability'
5977 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
5978 argument of constructor.
5980 2007-03-29 Raja R Harinath <rharinath@novell.com>
5982 Prepare to kill 'Reachability'
5983 * flowanalysis.cs (UsageVector.is_unreachable): New.
5984 (UsageVector): Update to maintain 'is_unreachable' in parallel to
5985 'reachability', and verify they're consistent.
5988 * expression.cs (New.EmitStatement): Handle type parameters here too.
5990 2007-03-29 Martin Baulig <martin@ximian.com>
5995 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
5996 CompilerGeneratedClass.
5997 (ScopeInfo.EmitScopeInstance): Make this protected.
5998 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
5999 `ec.CurrentAnonymousMethod.Scope == Scope'.
6001 * statement.cs (Block.ScopeInfo): Make this a property.
6003 2007-03-27 Raja R Harinath <harinath@gmail.com>
6005 Prepare to kill 'Reachability'
6006 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
6007 (FlowBranching.UsageVector.Reachability): Remove property.
6008 (FlowBranching.UsageVector.IsUnreachable): New property.
6009 (FlowBranching.UsageVector.ResetBarrier): New.
6010 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
6011 * codegen.cs, statement.cs: Update to changes.
6013 2007-03-27 Martin Baulig <martin@ximian.com>
6018 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
6021 2007-03-26 Raja R Harinath <rharinath@novell.com>
6023 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
6024 instead of TriState. Remove all mention of TriState.
6026 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
6027 replaced by a boolean. Add boolean 'is_unreachable' field, check
6028 and maintain invariants.
6030 2007-03-25 Marek Safar <marek.safar@gmail.com>
6032 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
6034 2007-03-25 Marek Safar <marek.safar@gmail.com>
6036 * expression.cs: Stop using obsolete 2.0 opcodes.
6038 2007-03-25 Marek Safar <marek.safar@gmail.com>
6040 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
6041 one of the latests Martin's fixes.
6043 2007-03-23 Miguel de Icaza <miguel@novell.com>
6045 * expression.cs: On BigEndian systems, swap the bytes, temporary
6046 solution until we get a new bitconverter class.
6048 2007-03-23 Martin Baulig <martin@ximian.com>
6052 * decl.cs (MemberCache.AddMembers): Add generic methods both as
6053 "Method" and "Method`1". Normally, a cache lookup is done on the
6054 "Method" form (ie. without the generic arity), but this one makes
6055 lookups on the full form work as well.
6057 2007-03-22 Raja R Harinath <rharinath@novell.com>
6059 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
6062 2007-03-20 Bill Holmes <billholmes54@gmail.com>
6064 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
6065 ordered_member_list, to TypeBuilder to store members to be defined
6066 in the order they were parsed in.
6067 - ordered_explicit_member_list contains all properties indexers
6068 and methods that are defined as explicit implementation of an
6069 interface or base class.
6070 - ordered_member_list contains all properties indexers and methods
6071 that are not defined as explicit implementation of an interface
6074 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
6075 functionality in these removed classes has been replaced with
6076 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
6077 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
6079 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
6080 to CheckForDuplications inside GetMethod and SetMethod Define Method
6081 to handle method property and indexer name conflicts.
6085 All code is contributed under the MIT/X11 license.
6087 2007-03-20 Martin Baulig <martin@ximian.com>
6089 * class.cs (TypeContainer.Interfaces): Removed; they're now
6090 included in `TypeContainer.Types'.
6092 2007-03-20 Martin Baulig <martin@ximian.com>
6094 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
6096 * class.cs (TypeContainer.CreateType): New public method. This is
6097 now called before DefineType() to create the TypeBuilders.
6098 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
6099 has already been created by CreateType().
6100 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
6101 don't resolve our base classes here; this has been moved into
6102 DefineBaseTypes(). We're now called from CreateType().
6103 (TypeContainer.DefineBaseTypes): New private method; resolve our
6104 base classes here. We're now called from DefineType().
6107 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
6108 our types first to create all the TypeBuilders. After that, call
6109 TypeContainer.DefineType() on all the types which'll resolve their
6110 base classes and setup the resolve order.
6112 2007-03-20 Martin Baulig <martin@ximian.com>
6114 * class.cs (TypeContainer.Enums): Removed; they're now included in
6115 `TypeContainer.Types'.
6117 2007-03-20 Martin Baulig <martin@ximian.com>
6120 (TypeContainer.DefineType): Don't call ResolveMembers() here.
6121 (TypeContainer.DoResolveMembers): Call DefineType() on our
6122 `compiler_generated' classes; moved here from DefineNestedTypes().
6125 (RootContext.ResolveTree): Call ResolveMembers() on all
6126 TypeContainer's in the `type_container_resolve_order'.
6128 2007-03-19 Marek Safar <marek.safar@gmail.com>
6130 * class.cs: Use corlib to handle InternalMethodImplAttribute.
6132 2007-03-17 Marek Safar <marek.safar@gmail.com>
6134 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
6135 implementation flags.
6137 2007-03-17 Marek Safar <marek.safar@gmail.com>
6139 * class.cs: More optimizations for type parameters.
6141 2007-03-15 Marek Safar <marek.safar@gmail.com>
6143 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
6145 * ecore.cs, parameter.cs: More common code for both corlibs.
6147 * typemanager.cs (IsGenericMethod): Simplified.
6149 2007-03-15 Raja R Harinath <rharinath@novell.com>
6151 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6153 * statement.cs, iterators.cs, lambda.cs: Update to changes.
6155 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
6156 unconditionally. Simplify explanation.
6157 (Try.Resolve, Using.Resolve): Likewise.
6159 2007-03-15 Martin Baulig <martin@ximian.com>
6163 * decl.cs (DeclSpace): If we're a partial class, use our
6164 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
6166 2007-03-15 Raja R Harinath <rharinath@novell.com>
6168 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6170 (FlowBranching.UsageVector): Update to changes.
6171 (FlowBranching.MergeSiblings): Likewise.
6172 * statement.cs: Likewise.
6174 2007-03-15 Martin Baulig <martin@ximian.com>
6179 (MemberCache): Added a special .ctor for type parameters.
6182 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
6185 2007-03-09 Martin Baulig <martin@ximian.com>
6187 * enum.cs (Enum): Make this a TypeContainer.
6188 (EnumMember): Derive from `Const'.
6191 (Const.DoResolveValue): New protected virtual method; move most of
6192 the functionality of ResolveValue() here so we can override it in
6194 (Const.CreateConstantReference): Make this virtual.
6196 * class.cs (Kind): Add `Kind.Enum'.
6197 (TypeContainer.Emit): Don't emit the enums here; they're already
6198 in the `RootContext.typecontainer_resolve_order'.
6200 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
6201 here; they're already in the `typecontainer_resolve_order'.
6203 * ecore.cs (EnumConstant.ConvertImplicitly): Add
6204 TypeManager.DropGenericTypeArguments().
6207 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
6208 (TypeManager.IsEnumType): Likewise.
6209 (TypeManager.EnumToUnderlying): Likewise.
6210 (TypeManager.IsEqual): Add support for enums.
6212 2007-03-12 Raja R Harinath <rharinath@novell.com>
6214 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
6215 DefaultParameterValueAttribute to be undefined, say if System.dll
6218 2007-03-11 Marek Safar <marek.safar@gmail.com>
6220 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
6223 2007-03-10 Marek Safar <marek.safar@gmail.com>
6225 * class.cs, parameter.cs: Unified parameters verification.
6227 2007-03-08 Martin Baulig <martin@ximian.com>
6229 * cs-parser.jay (constructor_header): Pass the location to the
6230 newly created TopLevelBlock.
6232 2007-03-07 Martin Baulig <martin@ximian.com>
6234 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
6236 2007-03-06 Miguel de Icaza <miguel@novell.com>
6238 * convert.cs (ExplicitReferenceConversionExists): Sync this method
6239 with the changes from David, fixes the build.
6241 2007-03-05 David Mitchell <dmitchell@logos.com>
6243 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
6244 and its base interfaces to a one-dimensional array type S[],
6245 provided there is an implicit or explicit reference conversion
6248 2007-03-03 Marek Safar <marek.safar@gmail.com>
6250 * cs-tokenizer.cs: Implemented basic linq grammar.
6252 * driver.cs: Set linq lang version on demand.
6254 2007-02-26 Marek Safar <marek.safar@gmail.com>
6256 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
6258 2007-02-25 Marek Safar <marek.safar@gmail.com>
6260 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
6263 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
6265 Check property and event extern attributes.
6267 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
6270 2007-02-24 Marek Safar <marek.safar@gmail.com>
6272 A fix for bug #80407
6273 * ecore.cs: Don't report ambiguity error when methods have same parent.
6275 2007-02-23 Marek Safar <marek.safar@gmail.com>
6277 A fix for bug #80878
6278 * class.cs, cs-parser.jay: Event property can host anonymous methods.
6280 2007-02-22 Marek Safar <marek.safar@gmail.com>
6282 * attribute.cs: Enable ExtensionAttribute presence test.
6284 2007-02-22 Marek Safar <marek.safar@gmail.com>
6286 * class.cs: Warn about missing GetHashCode only when Equals is override.
6288 * decl.cs: Check accessibility of type arguments.
6290 * typemanager.cs: Correctly report nullable array.
6292 2007-02-20 Marek Safar <marek.safar@gmail.com>
6294 * class.cs, report.cs: Capture more details when things go wrong.
6296 2007-02-20 Marek Safar <marek.safar@gmail.com>
6298 A fix for bug #80650
6299 * cs-parser.jay: Anonymous container starts at constructor declaration
6300 and not at block beginning because it has to be usable in constructor
6303 * statement.cs: Use context location and not block one for error reporting.
6305 2007-02-18 Marek Safar <marek.safar@gmail.com>
6307 A fix for bug #78712
6308 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
6311 2007-02-18 Marek Safar <marek.safar@gmail.com>
6313 A fix for bug #80493 by Atsushi Enomoto
6314 * cs-parser.jay: Ignore invalid attribute target.
6316 2007-02-18 Marek Safar <marek.safar@gmail.com>
6318 * cs-tokenizer.cs: Ignore '\0' as white space character.
6320 2007-02-17 Miguel de Icaza <miguel@novell.com>
6322 * cs-parser.jay: Add support for lambda expressions to the mcs
6325 * lambda.cs: Only clone when we are probing, not on the final call
6326 (Compatible is the final call).
6328 * statement.cs (CloneContext): Introduce class to provide block
6329 remapping during clone.
6331 All statements Clone themselves now.
6333 (Clone): special handling for blocks, when we clone a block, we
6334 register the block inside this routine, as children of the block
6335 might trigger a lookup.
6337 * expression.cs: Add support for CloneContext in all expressions.
6339 2007-02-17 Marek Safar <marek.safar@gmail.com>
6341 A fix for bug #80493
6342 * statement.cs: Report ambiguous warning when interfaces are not related.
6344 2007-02-15 Marek Safar <marek.safar@gmail.com>
6346 C# 3.0 extension methods.
6348 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
6349 cannot be used directly.
6351 * class.cs (Class.Emit): Emit extension attribute if any class method
6352 is extension method.
6353 (Method.Define): Add basic extension method validation conditions.
6354 (Method.Emit): Emit extension attribute for method.
6356 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
6357 extension method exists. Currently we follow same approach as Microsoft
6358 does, emit even if a method or a class are private but this can change
6361 * cs-parser.jay: Add handling of `this' keyword in method parameters
6364 * decl.cs (DeclSpace.IsStaticClass): New property.
6365 (MemberCache.FindExtensionMethods): Looks for extension methods with
6366 defined name and extension type.
6368 * doc.cs: Updated after OverloadResolve changes.
6370 * driver.cs: Add new soft reference to System.Core.dll.
6372 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
6373 (ExtensionMethodGroupExpr): Represents group of extension methods.
6375 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
6376 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
6377 to MethodGroupExpr and made non-static for easier customization.
6378 (Invocation.DoResolve): Add extension method lookup when no standard
6380 (MemberAccess.DoResolve): Try extension methods if no member exists.
6382 * modifiers.cs: Add METHOD_EXTENSION modifier.
6384 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
6385 as well as candidate extension type.
6386 (ComputeNamespaces): When assembly constains extension methods registers
6388 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
6389 extension method lookup.
6390 (Namespace.LookupExtensionMethod): Looks for extension method in this
6392 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
6393 find a method which matches name and extensionType.
6395 * parameter.cs (Parameter): Add This modifer.
6396 (HasExtensionMethodModifier): New property.
6397 (Resolve): Add extension parameter check.
6398 (ModFlags): turned to property to exclude this modifier as it is not real
6400 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
6402 * support.cs (ParameterData): Add ExtensionMethodType.
6403 (ReflectionParameters): Implemented ExtensionMethodType interface property.
6405 * typemanager.cs: Add type and ctor extension attribute type.
6407 2007-02-15 Miguel de Icaza <miguel@novell.com>
6409 * report.cs (DisableErrors, EnableErrors): used to prevent error
6410 output when we are "trying" to compile various methods with
6413 * ecore.cs (Expression): Add Clone method that calls the virtual
6414 CloneTo method. The current CloneTo method in Expression throws
6415 an exception so we can track down all the places where this must
6416 be implemented (not using abstract, because that would be a lot of
6417 up-front-work before we can start testing the implementation
6420 Important: we only need Clone capabilities for expressions created
6421 by the parser, as the expressions we will be cloning are
6422 expressions in the pre-resolved state. This vastly simplifies
6425 (SimpleName): Add CloneTo that does nothing.
6426 (EmptyCast): Add CloneTo.
6428 * expression.cs (Binary): Implement CloneTo.
6429 (Invocation.IsApplicable): Store the current ec in
6430 EmitContext.TempEc and restore it on return. This is used so we
6431 do not have to sprinkle hundres of methods with an extra
6432 EmitContext, we know that the only user is the lambda expression
6433 ImplicitConversionExists code.
6435 (Argument): Add Cloning capabilities.
6436 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
6437 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
6438 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
6439 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
6440 IndexerAccess): Add Clone capability.
6442 (LocalVariableReference, This): TODO: needs cloned Block mapping.
6444 (Argument): Add cloning capability.
6446 * assign.cs (Assign): Implement CloneTo.
6448 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
6450 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
6451 version by calling Convert with the EmitContext (that we are
6452 currently storing in ec, this is not great, but will do for now,
6453 to avoid passing EmitContext parameters to hundreds of functions
6454 that do not need them now).
6456 (SetExpression): Remove, it is not needed.
6458 (ContextualReturn): Implement CloneTo.
6460 * statement.cs (Statement): Implement cloning infrastructure,
6461 similar to expressions.
6463 (Block): Partial implementation of Clone for statements.
6465 (Return): Implement clone.
6467 * constant.cs (Constant.CloneTo): New method, does nothing.
6469 * codegen.cs (TempEc): Add a static EmitContext as a temporary
6470 solution, until we decide how to exactly do this.
6472 2007-02-14 Marek Safar <marek.safar@gmail.com>
6474 A fix for bug #80493
6475 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
6476 a property is override we need to use second accessor.
6478 2007-02-13 Marek Safar <marek.safar@gmail.com>
6480 A fix for bug #80418
6481 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
6484 2007-02-13 Marek Safar <marek.safar@gmail.com>
6486 Another fix for bug #80749
6487 * pending.cs: Abstract class has priority over interfaces.
6489 2007-02-13 Marek Safar <marek.safar@gmail.com>
6491 Another fix for bug #80749
6492 * pending.cs: Abstract class has priority over interfaces.
6494 2007-02-13 Marek Safar <marek.safar@gmail.com>
6496 Another fix for bug #80749
6497 * pending.cs: Abstract class has priority over interfaces.
6499 2007-02-13 Marek Safar <marek.safar@gmail.com>
6501 Another fix for bug #80749
6502 * pending.cs: Abstract class has priority over interfaces.
6504 2007-02-13 Marek Safar <marek.safar@gmail.com>
6506 * class.cs Better error message.
6508 * driver.cs: Add shorter versions of -optimize option.
6510 2007-02-13 Martin Baulig <martin@ximian.com>
6512 * class.cs (Constructor.Emit): Check the return value of
6513 ec.ResolveTopBlock() and return on error.
6515 2007-02-13 Raja R Harinath <rharinath@novell.com>
6517 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
6518 message to fix error message regression.
6520 2007-02-12 Marek Safar <marek.safar@gmail.com>
6522 * delegate.cs: Delegate creation expression cannot be of Nullable type.
6524 2007-02-12 Marek Safar <marek.safar@gmail.com>
6526 A fix for bug #80749
6527 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
6528 its parent container.
6530 * class.cs (DefineFieldInitializers): Each initializer can has different
6533 * const.cs: Updated.
6535 2007-02-11 Miguel de Icaza <miguel@novell.com>
6537 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
6538 now all the heavy lifting to check that embedded statements or
6539 expressions have the right form is done in the ContextualReturn.
6541 (ContextualReturn): New class.
6543 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
6544 method that can be invoked to report 201, so we do not replicate
6547 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
6549 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
6550 treating tabs as spaces.
6552 2007-02-09 Marek Safar <marek.safar@gmail.com>
6554 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
6555 * assign.cs: Use full implicit conversion for right side check.
6557 2007-02-09 Marek Safar <marek.safar@gmail.com>
6559 * statement.cs (Switch): Switch over boolean type is not standardized.
6561 2007-02-08 Marek Safar <marek.safar@gmail.com>
6563 A fix for bug #80755
6564 * decl.cs (FindBaseEvent): Don't use method cache for events.
6566 2007-02-07 Marek Safar <marek.safar@gmail.com>
6568 * cs-parser.jay: Better syntax error handling.
6570 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
6571 instead of underlying type value.
6573 2007-02-06 Marek Safar <marek.safar@gmail.com>
6575 * driver.cs: Check define identifier before is registered.
6577 * namespace.cs: Use existing error message.
6579 * report.cs: New warning.
6581 2007-02-06 Marek Safar <marek.safar@gmail.com>
6583 A fix for bug #80742
6584 * expression.cs: Delegate Invoke method can be called directly.
6586 2007-02-06 Marek Safar <marek.safar@gmail.com>
6588 A fix for bug #80676
6589 * class.cs (IsEntryPoint): The Main method can have params modifier.
6591 2007-02-04 Miguel de Icaza <miguel@novell.com>
6593 * parameter.cs (Parameter, Parameters): Add Clone method.
6595 * anonymous.cs (Compatible): Turn method into virtual method, so
6596 LambdaExpression can implement a different behavior.
6598 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
6599 out the basic checking here, so it can be used by
6602 * lambda.cs: Introduce "Compatible" function that will do the
6605 2007-02-02 Marek Safar <marek.safar@gmail.com>
6607 * attribute.cs: Unified one error message.
6609 * class.cs (Class): Use type attributes and not properties to test static
6611 (IsEntryPoint): Don's pass local variable.
6613 * convert.cs: Removed duplicate check.
6615 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
6617 * driver.cs: Don't crash when soft reference does not exist.
6619 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
6620 (UsingEntry): Removed redundant allocation.
6622 * parameter.cs: Add fast path for type parameters.
6624 * support.cs: Don't allocate attribute when it's not used.
6626 2007-01-30 Miguel de Icaza <miguel@novell.com>
6629 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
6630 this into a virtual method, so we can override it in LambdaExpression.
6632 * driver.cs: Improve diagnostics in case of failure.
6634 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
6635 write a function that is slightly more complex and that parses:
6637 type identifier [, type identifier]* )
6639 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
6642 (canEmpty ? i >= 0 : i > 0)
6644 2007-01-30 Raja R Harinath <rharinath@novell.com>
6646 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
6647 exception on possibly valid code.
6649 2007-01-29 Raja R Harinath <rharinath@novell.com>
6651 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
6653 (parse_opt_type_arguments): Remove. It's almost the same as
6655 (parse_namespace_or_typename): Use parse_less_than.
6657 2007-01-28 Miguel de Icaza <miguel@novell.com>
6659 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
6660 this bug took a few hours to find, because the state saved and
6661 restored by PushPosition and PopPosition was ignoring the state of
6662 parse_generic_less_than.
6664 I can also now remove the handling of OP_LT and OP_GT, this solves
6667 * cs-tokenizer.cs: store the location for the ARROW token, we use
6670 (PushPosition, PopPosition): save/restore also `current_token',
6671 restore `parse_generic_less_than' (was missing).
6673 (parse_opt_type_arguments): use parse_type, not
6674 parse_namespace_or_typename to parse types.
6676 * lambda.cs: Empty new file, will eventually have the lambda
6677 expression implementation.
6679 * lambda.test: used to test the internal tokenizer.
6681 * report.cs (FeatureIsNotISO1): Rename from
6682 FeatureIsNotStandardized, because it was about the language level
6683 (1 vs 2) it was not about standarization.
6685 (FeatureRequiresLINQ): New.
6687 * support.cs (SeekableStreamReader): Only require that the reader
6688 is a TextReader, not a StreamReader, so we can plug StringReader.
6690 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
6691 given position in the input stream the following tokens can be
6692 parsed as a type followed by an identifier.
6694 (is_punct): after a '(' if parse_type_and_parameter returns true,
6695 then return a special token OPEN_PARENS_LAMBDA which is used to
6696 avoid reduce/reduce errors in the grammar for the
6697 lambda_expression rules.
6699 (parse_type): implement a type parser inside the
6700 tokenizer, the parser only returns true or false depending on
6701 whether the input at a given position can be parsed as a type.
6703 (peek_token): new method used during type parsing.
6705 2007-01-28 Raja R Harinath <rharinath@novell.com>
6708 * anonymous.cs (ScopeInfo.InflateParameters): New.
6709 (AnonymousContainer.Resolve): Use it to redirect types of
6710 delegate parameters.
6712 2007-01-27 Raja R Harinath <rharinath@novell.com>
6715 * expression.cs (Error_InvalidArguments): Don't use two different
6716 messages for CS1503. Use ExtraInformation and
6717 SymbolRelatedToPreviousError instead.
6720 * decl.cs (DeclSpace.initialize_type_params): Don't access
6721 'type_params' of a partial class directly.
6723 2007-01-26 Miguel de Icaza <miguel@novell.com>
6725 * constant.cs: Removed a handful of out-of-range checks that were
6728 2007-01-25 Marek Safar <marek.safar@gmail.com>
6730 * expression.cs (CheckUselessComparison): Add additional check for char
6733 * namespace.cs: Fixed typo.
6735 2007-01-23 Miguel de Icaza <miguel@novell.com>
6737 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
6738 gone, instead we inline the test, preventing the needless casts to
6739 longs, ulongs and doubles for the parameters, avoiding calls to
6740 methods that overchecked stuff, and instead inlined things
6743 2007-01-20 Marek Safar <marek.safar@gmail.com>
6745 * cs-parser.jay: Better parameter error handling.
6747 2007-01-17 Marek Safar <marek.safar@gmail.com>
6749 A fix for bug #80368, #80522
6750 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
6751 whether array initializer contains constants only.
6752 (ArrayCreation.Emit): Use better formula to decide when
6753 are array initializers for static initialization.
6754 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
6755 have to emit even constants otherwise they are pre-initialized.
6757 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
6758 Raja R Harinath <rharinath@novell.com>
6760 Fix emit order of 'get' vs. 'set'.
6761 * support.cs (Accessors): New.
6762 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
6763 Note the order in which accessors are declared in the source.
6764 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
6765 Refactored from Property.Define and Indexer.Define.
6766 (PropertyBase.DefineAccessors): New helper that calls the above in
6767 appropriate order as noted by the parser.
6768 (Property.Define, Indexer.Define): Update to changes.
6769 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
6771 2007-01-17 Raja R Harinath <rharinath@novell.com>
6773 Fix cs0029-6.cs and gcs0029-2.cs (regression)
6774 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
6775 there's an implicit conversion from the current type to the target
6776 type before converting the underlying constant.
6778 2007-01-16 Marek Safar <marek.safar@gmail.com>
6780 * const.cs (ResolveValue): Updated after constant conversion was made more
6783 * constant.cs (GetAttributableValue): constant to object conversion is
6784 used for attributes only.
6785 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
6786 constant conversions.
6787 (LongConstant.ConvertImplicitly): Ditto.
6789 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
6790 (ImplicitConversionStandard): Handle constant conversion as extra step.
6791 It solves the issue when constant conversion was called indirectly like
6792 inside array initializer and constant folding was skipped.
6794 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
6797 * statement.cs(ImplicitConversionStandard): Updated after constant
6798 conversion was made more generic.
6800 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
6802 * expression.cs (As.DoResolve): Use GenericConstraints instead of
6803 Constraints, solves the problem where the compiler incorrectly
6804 reported that a type parameter was not constrained to a class (Bug
6807 2007-01-14 Marek Habersack <grendello@gmail.com>
6809 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
6811 2007-01-14 Marek Safar <marek.safar@gmail.com>
6813 A fix for bug #80368
6814 * assign.cs (FieldInitializer): New class implements field
6815 initializer statement.
6817 * attribute.cs: Update after FieldMember rename.
6819 * class.cs (PropertyBasedMember): New common class for property based
6821 (InterfaceMemberBase): New base class for all members which can be used as
6822 an interface members.
6823 (MethodCore): Moved really common code to InterfaceMemberBase.
6824 (Method.Define): Equal and GetHasCode detection is relevant for methods
6826 (MethodData.Define): Don't assume that public event implements an
6827 interface automatically.
6828 (MethodData.DefineMethodBuilder): Issue an error even if only extern
6830 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
6831 (FieldMember): Merged with FieldBase.
6832 (EventProperty.AEventPropertyAccessor): New specialization to check whether
6833 event extern modifier can be used.
6834 (EventField.EventFieldAccessor): Moved event field specific code here.
6835 (Event.AllowedModifiers): Even event can be extern.
6836 (Event.FindOutBaseMethod): New override specific to events.
6837 (Indexer.parameters): Reintroduce parameters because base class holds
6838 only properties common data.
6839 (Indexer.CheckForDuplications): Indexers are threated as methods so we
6840 need do extra parameters check.
6842 * const.cs: Update after FieldMember rename.
6844 * decl.cs (MemberCache.FindBaseEvent): New method.
6846 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
6847 to reflect that indexer is now derived from PropertyBased.
6849 * ecore.cs (GetMemberType): Made public.
6850 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
6853 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
6855 * typemanager.cs (CSharpSignature): Correctly print event accessors.
6856 (RegisterEvent): Removed.
6857 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
6858 (GetPrivateFieldOfEvent): Renamed to GetEventField.
6860 2007-01-11 Raja R Harinath <rharinath@novell.com>
6863 * statement.cs (CollectionForeach.TryType): Prefer generic
6864 GetEnumerator over non-generic variant. Fix code to follow comments.
6866 2007-01-09 Raja R Harinath <rharinath@novell.com>
6869 * support.cs (ReflectionParameter): Don't use an invalid index on
6870 the generic parameter data.
6872 2007-01-08 Miguel de Icaza <miguel@novell.com>
6874 * driver.cs: Just add a tiny bit of infrastructure.
6876 2007-01-02 Marek Safar <marek.safar@gmail.com>
6878 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
6879 where field type is struct from current assembly.
6881 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
6884 2007-01-02 Marek Safar <marek.safar@gmail.com>
6886 A fix for bug #80381
6887 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
6890 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
6892 (Namespace.LookupType): Always use core types from corlib when speficied.
6894 * report.cs: A new warning.
6896 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
6897 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
6898 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
6900 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
6901 (InitCoreTypes): Set expression type of object_type and value_type
6902 immediately after lookup.
6904 2007-01-01 Miguel de Icaza <miguel@novell.com>
6906 * cs-tokenizer.cs: Accept Pc class characters (Connector
6907 Punctuation) as valid identifiers. Fixes #78259
6909 * expression.cs (Invocation.DoResolve): Moved the check for the
6910 use of `this' for doing method calls to the Invocation resolution
6911 step, after overload resolution has taken place instead of doing
6912 the check at the low-level `This.DoResolve' level.
6914 The `This.DoResolve'(appens before overload resolution, so it has
6915 no way of knowing if the method that will be called will be
6916 instace or static, triggering an erroneous report for cs0188 (Bug
6919 We now do the check for instance method invocations after we know
6920 what method will be called.
6922 (This.CheckThisUsage): Move the actual use of this structure
6923 checking into its own method and expose it.
6925 * Everywhere that called Error_ValueCannotBeConverted: pass a new
6928 Exceptions: Null.ConvertImplicitly,
6929 Constant.ImplicitConversionRequired as there are too many call
6930 sites for passing the ec.
6932 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
6933 EmitContext, if the value is null, then we do not try to provide
6934 the extra information from the error (If a userdefined conversion
6935 exists, as UserDefinedConversion requires a non null-EmitContext).
6939 2006-12-30 Raja R Harinath <rharinath@novell.com>
6941 * flowanalysis.cs (MyBitVector): Document some invariants.
6942 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
6943 introduced below, and add a couple of others,
6945 2006-12-30 Marek Safar <marek.safar@gmail.com>
6947 * attribute.cs (GetMethodObsoleteAttribute): Uses new
6948 GetPropertyFromAccessor and GetEventFromAccessor.
6950 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
6951 overrides non-obsolete one.
6952 (Indexer.Define): Error message has been moved to the parser.
6954 * cs-parser.jay: Better syntax errors handling.
6956 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
6957 when an invocation has no arguments.
6959 * ecore.cs: Removed not used caching.
6961 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
6964 * report.cs: Add a new warning.
6966 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
6968 * typemanager.cs (enumeration_type): Removed.
6969 (CSharpSignature): Reuses IsSpecialMethod.
6970 (IsEqual): Hack for MS BCL.
6971 (GetPropertyFromAccessor): New method.
6972 (GetEventFromAccessor): New method.
6973 (IsSpecialMethod): Fixed to handle more cases.
6975 2006-12-30 Marek Safar <marek.safar@gmail.com>
6977 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
6978 Made white spaces array static.
6980 * ecore.cs (RemoveGenericArity): Optimized.
6982 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
6984 (MyBitVector.initialize_vector): Simplified.
6986 2006-12-22 Miguel de Icaza <miguel@novell.com>
6988 * ecore.cs: Am not entirely happy with this hack, but it seems to
6989 address the issue in 80257 (a small test case for
6992 I set the MethodGroupExpr.Type to an internal compiler type
6993 (itself in this case) to force the resolution to take place. Why
6994 it does not take place with a null is beyond me.
6996 2006-12-20 Marek Safar <marek.safar@gmail.com>
6998 A fix for bug #80288
6999 * expression.cs (ResolveOperator): Consider user defined conversion for
7000 logical and operator too.
7001 (EmitBranchable): Optimization for logical and when full constant folding
7002 could not be applied but one operand is constant.
7004 2006-12-19 Marek Safar <marek.safar@gmail.com>
7006 * class.cs (GetClassBases): Write 5 times every day, will never use
7007 FullName for error reporting.
7009 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
7011 2006-12-19 Martin Baulig <martin@ximian.com>
7013 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
7014 the symbol file info here.
7016 2006-12-18 Marek Safar <marek.safar@gmail.com>
7018 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
7019 of `elseif' is taking then following sections are not taking.
7020 Fixes an issue reported on mono mailing list.
7022 2006-12-18 Marek Safar <marek.safar@gmail.com>
7024 A fix for bug #80300
7025 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
7026 a caller is not taking.
7028 2006-12-18 Raja R Harinath <rharinath@novell.com>
7030 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
7031 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
7032 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
7033 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
7034 * class.cs: Update to changes.
7036 2006-12-17 Marek Safar <marek.safar@gmail.com>
7038 A fix for bug #79934
7039 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
7042 * class.cs (ResolveMembers): Register an iterator in current container and
7045 2006-12-16 Raja R Harinath <rharinath@novell.com>
7048 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
7049 satisfy a params annotated parameter.
7051 2006-12-16 Marek Safar <marek.safar@gmail.com>
7053 A fix for bug #77014
7054 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
7055 paramters correctly and not rely on hacks in Parameters class.
7056 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
7058 (Invocation.VerifyArgumentsCompat): Ditto.
7059 (Invocation.EmitArguments): Changed to correctly emit params arguments at
7062 * parameter.cs (HasParams): Don't assume that params is the last one.
7064 * support.cs (ReflectionParameters.ctor): Look for params attribute
7066 (ReflectionParameters.ParameterType): Removed hack when we returned last
7067 parameter for out of range parameters.
7068 (ParameterName, ParameterModifier): Ditto.
7070 2006-12-14 Marek Safar <marek.safar@gmail.com>
7072 A fix for bug #79987
7073 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
7074 when assembly is not CLS compliant but type is. I have no idea why is this
7077 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
7079 2006-12-13 Miguel de Icaza <miguel@novell.com>
7081 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
7082 in struct constructors, they are basically no-ops.
7084 2006-12-12 Marek Safar <marek.safar@gmail.com>
7086 * cs-tokenizer.cs (Position): Save preprocessor status too.
7088 2006-12-12 Marek Safar <marek.safar@gmail.com>
7090 A fix for bug #77794
7091 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
7093 2006-12-12 Marek Safar <marek.safar@gmail.com>
7095 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
7097 (pp_expr): Report error for an invalid expression.
7098 (handle_preprocessing_directive): Simplified; add more error checking.
7100 2006-12-11 Marek Safar <marek.safar@gmail.com>
7102 A fix for bug #74939
7103 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
7104 directives handling.
7106 2006-12-10 Marek Safar <marek.safar@gmail.com>
7108 A fix for bugs #80093, and #75984
7109 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
7110 logic, it seems to me as it worked before "by coincidence".
7111 (xtoken): Simplified to use reworked handle_preprocessing_directive.
7112 (cleanup): Enabled endif check.
7114 2006-12-09 Marek Safar <marek.safar@gmail.com>
7116 A fix for bug #80162
7117 * statement.cs (CollectionForeach.TryType): Generics and non-generics
7118 enumerators are never ambiguous.
7120 2006-12-08 Raja R Harinath <rharinath@novell.com>
7123 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
7125 2006-12-06 Marek Safar <marek.safar@gmail.com>
7127 A fix for bug #80144
7128 * class.cs (EventProperty.Define): Explicit implementation means
7129 that an even is used.
7131 2006-12-06 Marek Safar <marek.safar@gmail.com>
7133 Fixes the operators implementation (part II)
7135 * cfold.cs (DoConstantNumericPromotions): Renamed to
7136 DoBinaryNumericPromotions and simplified.
7137 (BinaryFold): Couple of conversion fixes; simplified.
7139 * constant.cs, ecore.cs, literal.cs
7140 (ToType): Renamed to ConvertImplicitly.
7141 (Reduce): Renamed to ConvertExplicitly.
7143 * class.cs, convert.cs: Updated.
7145 * expression.cs: TryReduce doesn't throw an exception.
7147 2006-12-01 Marek Safar <marek.safar@gmail.com>
7149 A fix for bug #80108
7150 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
7153 2006-11-30 Marek Safar <marek.safar@gmail.com>
7155 Fixes unary operators implementation (part I)
7158 * cfold.cs (Error_CompileTimeOverflow): Made internal
7160 * const.cs (IConstant): Changed to use reference to constant and
7161 not constant itself.
7162 Updated IConstant implementations.
7164 * constant.cs (CreateConstant): New factory method.
7165 Updated IConstant implementation.
7167 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
7169 * ecore.cs: Updated to use CreateConstantReference.
7171 * enum.cs: Reflects IConstant changes.
7173 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
7175 * literal.cs (NullConstant): Change to be independently usable.
7177 2006-11-29 Martin Baulig <martin@ximian.com>
7179 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
7180 we need to emit the scope initializer before calling the base .ctor.
7182 * anonymous.cs: Merged back from the new anonymous methods branch.
7183 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
7185 * expression.cs (ParameterReference.DoResolveBase): Create a
7186 "normal" ScopeInfo when capturing parameters rather than using the
7187 root scope; this makes things work with anonymous methods having
7191 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
7193 2006-11-22 Marek Safar <marek.safar@gmail.com>
7195 A fix for bug #79987
7196 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
7197 check to a base class.
7198 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
7199 only when assembly has missing attribute.
7200 * report.cs: Update.
7202 2006-11-21 Marek Safar <marek.safar@gmail.com>
7204 * cs-tokenizer.cs: Merged with gmcs version.
7206 2006-11-20 Marek Safar <marek.safar@gmail.com>
7209 * cs-parser.jay: Better error message when partial keyword is misplaced.
7211 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
7213 A fix for bug #79810
7214 report.cs: CS1058 only applies to 2.0 profile (gmcs).
7215 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
7216 a RuntimeWrappedException by default.
7218 2006-11-18 Marek Safar <marek.safar@gmail.com>
7220 A fix for bug #79843
7221 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
7223 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
7225 2006-11-18 Marek Safar <marek.safar@gmail.com>
7227 * driver.cs, namespace.cs: Uses faster IndexOf version.
7229 2006-11-17 Marek Safar <marek.safar@gmail.com>
7231 A fix for bug #79941
7232 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
7234 (Operator.Define): Implicit/Explicit operator of same type is duplicate
7235 even if internal name is different.
7236 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
7237 (UserDefinedConversion): Simplified as the operators cannot be internal.
7238 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
7240 (MethodLookup): Replaced EmitContext with parentType.
7241 * expression.cs: Updated.
7243 2006-11-09 Raja R Harinath <rharinath@novell.com>
7245 * driver.cs (BadAssembly): Handle all the ugliness of
7246 DefineDynamicAssembly.
7248 2006-11-08 Raja R Harinath <rharinath@novell.com>
7250 Address parts of #58244 -- most of what's left is in the runtime
7251 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
7252 CS1509 error checks, and handle them for all assembly loads, not
7253 just the first invocation.
7254 (LoadModule): Likewise. Move handling of 'adder_method' ...
7255 * codegen.cs (AssemblyClass.AddModule): ... here.
7257 2006-11-02 Marek Safar <marek.safar@gmail.com>
7259 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
7260 IEnumerable<T> is ambiguous.
7262 2006-10-31 Marek Safar <marek.safar@gmail.com>
7264 A fix for bug #67689
7265 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
7266 GetEnumerator is ambiguous.
7268 * report.cs: Add new warning.
7270 2006-10-29 Marek Safar <marek.safar@gmail.com>
7272 A fix for bug #78602
7273 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7274 to protected member can be nested type.
7276 2006-10-28 Marek Safar <marek.safar@gmail.com>
7278 A fix for bug #78965
7279 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7280 to protected member must derive from current type.
7282 2006-10-27 Marek Safar <marek.safar@gmail.com>
7284 assign.cs: Reuses error method.
7286 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
7287 instead of type for constants.
7288 (Expression.Error_ValueAssignment): Common error method.
7290 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
7293 2006-10-27 Marek Safar <marek.safar@gmail.com>
7295 A fix for bug #79081
7296 * expression.cs (MemberAccess.DoResolve): Check nested type
7299 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
7301 * doc.cs : nested delegates were not handled. Fixed bug #79754.
7303 2006-10-26 Marek Safar <marek.safar@gmail.com>
7305 A fix for bug #76591
7306 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
7308 2006-10-26 Marek Safar <marek.safar@gmail.com>
7310 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
7311 type forwarder of the same type multiple times.
7313 2006-10-26 Raja R Harinath <rharinath@novell.com>
7316 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
7317 instance as an rvalue, even when we later resolve as an lvalue.
7319 2006-10-25 Martin Baulig <martin@ximian.com>
7321 * anonymous.cs: Fix #79673.
7323 2006-10-24 Marek Safar <marek.safar@seznam.cz>
7325 A fix for bug #79666
7326 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
7327 ignored when is optimized (= default value) as its value is already set.
7329 2006-10-23 Marek Safar <marek.safar@seznam.cz>
7331 A fix for bug #79724
7332 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
7333 TypeContainer for type lookup.
7335 2006-10-23 Marek Safar <marek.safar@seznam.cz>
7337 A fix for bug #79231
7338 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
7339 * expression.cs (OverloadResolve): Always convert type name for
7341 (ResolveNamespaceOrType): Don't confuse a nested type with any
7344 2006-10-18 Martin Baulig <martin@ximian.com>
7346 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
7348 2006-10-17 Miguel de Icaza <miguel@novell.com>
7350 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
7351 an int32, but requesting an int64 from the conversion
7353 2006-10-12 Martin Baulig <martin@ximian.com>
7356 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
7358 2006-10-12 Martin Baulig <martin@ximian.com>
7361 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
7363 2006-10-11 Miguel de Icaza <miguel@novell.com>
7365 * convert.cs: Remove broken code: I was doing the "Existance"
7366 tests for Implicit conversions.
7368 2006-10-10 Miguel de Icaza <miguel@novell.com>
7370 * convert.cs: Added one missing case in
7371 ImplicitStandardConversionExists uint64 to intptr.
7375 * typemanager.cs (uintptr_type): another core known type.
7377 * ecore.cs (OperatorCast): routine used to do cast operations that
7378 depend on op_Explicit. We could change some of the Decimal
7379 conversions to use this.
7381 This one has a probe mechanism that checks both types for an op_
7382 which it coudl be used to eliminate two classes: CastToDecimal
7383 and CastFromDecimal.
7385 * convert.cs: Implement the conversions documented in #59800
7387 2006-10-10 Martin Baulig <martin@ximian.com>
7389 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
7390 before RootScope.ResolveMembers().
7392 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
7393 `CurrentType' if appropriate.
7395 2006-10-09 Marek Safar <marek.safar@seznam.cz>
7397 A fix for bug #78568
7398 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
7399 when contains binary operators.
7400 * cs-parser.jay: Updated.
7402 2006-10-09 Martin Baulig <martin@ximian.com>
7405 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
7406 moved that into Define() and also do the other type parameter
7407 checks there. Fixes #79094. Added gtest-292.cs.
7410 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
7411 since that doesn't include type parameters; don't use `Ldelema'
7412 for type parameters. Fixes #78980. Added gtest-293.cs.
7414 2006-10-08 Marek Safar <marek.safar@seznam.cz>
7417 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
7418 conversion is allowed.
7420 2006-10-06 Marek Safar <marek.safar@seznam.cz>
7422 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
7423 error reporting when no error occurs.
7425 2006-10-06 Marek Safar <marek.safar@seznam.cz>
7427 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
7430 2006-10-06 Raja R Harinath <rharinath@novell.com>
7433 * class.cs (DefineTypeBuilder): Check circular dependencies before
7434 setting the parent of the TypeBuilder.
7435 (CheckRecursiveDefinition): Don't use 'BaseType', since
7436 it may not be valid until after DefineTypeBuilder. Use
7437 'base_type' instead.
7439 2006-10-04 Martin Baulig <martin@ximian.com>
7441 Merged the Anonymous Methods patch.
7443 * anonymous.cs, iterators.cs: The new anonymous methods code.
7445 * statement.cs (Variable): New public abstract class.
7446 (LocalInfo.Variable): New public property.
7447 (LocalInfo.ResolveVariable): New public method.
7448 (Block.Flags): Add `IsIterator'.
7449 (Block.AddVariable): Improved the CS0136 check.
7450 (Block.AnonymousChildren): New public property.
7451 (Block.AddAnonymousChild): New public method.
7452 (ToplevelBlock): Update to use the new anonymous method framework.
7453 (ToplevelBlock.ctor): `container' is now a `Block' and not a
7454 `ToplevelBlock'; this is required to correctly implement the
7456 (Fixed, Using): Use `TemporaryVariable' instead of directly
7457 creating the `LocalBuilder'.
7459 * parameter.cs (Parameter.ResolveVariable): New public method.
7460 (Parameters.ResolveVariable): Likewise.
7462 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
7464 * class.cs (TypeContainer): Replaced the `iterators' list and
7465 corresponding methods with a list of `CompilerGeneratedClass'es.
7466 (TypeContainer.ResolveMembers): New public method.
7467 (Method): `IIteratorContainer' has been replaced by
7470 * expression.cs (VariableReference): New public abstract base
7471 class for `LocalVariableReference', `ParameterReference' and
7474 * codegen.cs (EmitContext): Removed `capture_context',
7475 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
7476 (EmitContext.EmitThis): Removed.
7478 * cs-parser.jay: Replace `iterator_container' with
7481 2006-10-04 Martin Baulig <martin@ximian.com>
7483 * generic.cs (GenericMethod): Don't make this abstract.
7484 (Constraints.Clone): Added dummy implementation.
7486 2006-10-04 Raja R Harinath <harinath@gmail.com>
7489 * namespace.cs (LookForAnyGenericType): Avoid nullref on
7490 'declspaces'. Avoid allocating arrays willy-nilly.
7493 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
7494 cases out of the switch.
7496 2006-09-28 Marek Safar <marek.safar@seznam.cz>
7498 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
7499 message when non-generic type is used with the type arguments.
7500 * expression.cs: Updated.
7502 2006-09-28 Raja R Harinath <rharinath@novell.com>
7505 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
7506 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7507 Change semantics slightly. Don't insist on having only one
7508 temporary EmptyExpression -- just throttle the creation of new ones.
7511 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
7512 non-interfaces too. If no methods are found, don't try to create
7515 2006-09-28 Marek Safar <marek.safar@seznam.cz>
7517 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
7520 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
7521 us produce better error message.
7523 2006-09-27 Marek Safar <marek.safar@seznam.cz>
7525 * expression.cs (Binary.ResolveOperator): Warn about a side effect
7526 of the `|' operator.
7528 * report.cs: A new warning added.
7530 2006-09-27 Martin Baulig <martin@ximian.com>
7532 * generic.cs (GenericMethod): Don't make this abstract.
7534 2006-09-27 Martin Baulig <martin@ximian.com>
7537 (InternalErrorException): Added overloaded ctor taking a params array.
7539 2006-09-26 Marek Safar <marek.safar@seznam.cz>
7541 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
7542 Fixed the cases when same error was reported twice.
7544 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
7545 now report symbol information.
7547 2006-09-25 Martin Baulig <martin@ximian.com>
7549 * class.cs: Completely unified with the gmcs version.
7551 2006-09-25 Martin Baulig <martin@ximian.com>
7553 * typemanager.cs (TypeManager.IsNullableType): New public function.
7554 (TypeManager.IsNullableTypeOf): Likewise.
7555 (TypeManager.IsNullableValueType): Likewise.
7557 * class.cs (MethodCore): Added the `GenericMethod' argument from
7558 gmcs and also unified all classes derived from `MethodCore' with gmcs.
7560 2006-09-24 Raja R Harinath <harinath@gmail.com>
7562 * convert.cs: Unify with gmcs version.
7564 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7566 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
7567 verify them as well.
7569 * report.cs: New warning.
7571 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7573 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
7574 for anonymous block with out argument.
7576 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7578 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
7579 not used private events only.
7581 2006-09-23 Marek Safar <marek.safar@seznam.cz>
7583 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
7585 * const.cs (Const.Define): Check for constant type.
7586 (Const.IsConstantTypeValid): Looks for valid constant types.
7588 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
7590 * ecore.cs (EmptyConstantCast): New common class for all constant based
7593 * expression.cs (Is.DoResolve): Handle null constant especially.
7594 (New.DoResolve): Check for new void().
7595 (MemberAccess.DoResolve): Cope with all kind of nulls.
7597 * literal.cs (NullConstant): Uses EmptyConstantCast.
7598 (NullDefault): Based on EmptyConstantCast.
7599 (NullLiteral): Uses EmptyConstantCast.
7601 * statement.cs (Block.ResolveMeta): Check for constant type.
7603 2006-09-22 Martin Baulig <martin@ximian.com>
7605 * delegate.cs, attribute.cs: Merged with the gmcs versions.
7607 2006-09-22 Raja R Harinath <rharinath@novell.com>
7609 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
7613 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
7614 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
7617 2006-09-22 Martin Baulig <martin@ximian.com>
7619 * ecore.cs: Merged with the gmcs version.
7621 * generic.cs (ConstructedType): New dummy class.
7622 (TypeArguments): Don't make this abstract.
7625 (TypeManager.IsGenericTypeDefinition): New method.
7626 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
7628 2006-09-22 Raja R Harinath <rharinath@novell.com>
7630 * expression.cs (ComposedCast): Check for arrays of TypedReference
7631 before creating the type, not after.
7633 2006-09-21 Marek Safar <marek.safar@seznam.cz>
7635 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
7636 after ToType change.
7638 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
7639 when constant must be implicitly convertible.
7641 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
7643 * ecore.cs (NullCast): Derives from NullConstant.
7645 * expression.cs (Is.DoResolve): Removed useless variables.
7646 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
7647 (New.Constantify): Add enum support.
7648 (MemberAccess.DoResolve): Add warning when accessing null constant or
7651 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
7654 * literal.cs (NullConstant): New abstract class with common
7655 functionality for all null specializations.
7656 (NullDefault): Represents default(X) when result can be
7658 (NullLiteral): Updated.
7660 * report.cs: Add new warning.
7662 2006-09-21 Martin Baulig <martin@ximian.com>
7664 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
7666 2006-09-21 Martin Baulig <martin@ximian.com>
7668 * generic.cs (GenericConstraints): New dummy class.
7669 (Constraints): Likewise.
7670 (TypeParameter): Likewise.
7671 (TypeParameterName): Likewise.
7672 (GenericMethod): Likewise.
7674 * typemanager.cs (TypeManager.GetGenericArguments): New method.
7676 * decl.cs: Merged with the gmcs version.
7678 2006-09-21 Raja R Harinath <rharinath@novell.com>
7680 * generic.cs (TypeParameter): Implement IMemberContainer.
7681 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
7683 * rootcontext.cs: Unify with gmcs version.
7685 * report.cs: Unify with gmcs version.
7686 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
7687 from gmcs/generics.cs.
7688 * generics.cs (TypeParameter): New dummy class.
7690 * support.cs: Unify with gmcs version.
7692 2006-09-20 Raja R Harinath <rharinath@novell.com>
7694 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
7695 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
7697 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
7698 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
7699 * mcs.exe.sources: Add generic.cs.
7701 * codegen.cs: Unify with gmcs version.
7703 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
7704 (EmitContext): Add GenericDeclContainer implementation.
7705 * decl.cs (MemberCore, DeclSpace): Likewise.
7706 * namespace.cs: Remove #ifdef GMCS_SOURCE.
7708 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
7709 MCS TypeManager has a corresponding dummy method.
7711 2006-09-19 Martin Baulig <martin@ximian.com>
7713 * expression.cs: Completely merged with the gmcs version.
7715 2006-09-19 Martin Baulig <martin@ximian.com>
7717 * expression.cs (Invocation): Merged with the gmcs version.
7718 (ArrayAccess.GetStoreOpcode): Likewise.
7720 2006-09-19 Martin Baulig <martin@ximian.com>
7723 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
7724 (TypeManager.IsGenericMethodDefinition): Likewise.
7726 2006-09-19 Martin Baulig <martin@ximian.com>
7729 (TypeManager.IsEqual): Moved the gmcs implementation here.
7730 (TypeManager.DropGenericTypeArguments): Likewise.
7731 (TypeManager.DropGenericMethodArguments): Likewise.
7732 (TypeManager.GetTypeArguments): Moved here from gmcs.
7733 (TypeManager.HasGenericArguments): Likewise.
7735 2006-09-19 Martin Baulig <martin@ximian.com>
7737 * expression.cs (Binary): Merged with the gmcs version.
7739 2006-09-19 Martin Baulig <martin@ximian.com>
7741 * expression.cs (Probe, As, Is): Merged with the gmcs version.
7743 2006-09-19 Martin Baulig <martin@ximian.com>
7745 * typemanager.cs: Merged with the gmcs version.
7747 2006-09-16 Raja R Harinath <rharinath@novell.com>
7749 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
7750 * driver.cs: Likewise.
7752 2006-09-16 Marek Safar <marek.safar@seznam.cz>
7755 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
7756 only if parent type is class.
7757 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
7760 2006-09-15 Marek Safar <marek.safar@seznam.cz>
7763 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
7765 * typemanager.cs(CSharpName): Converts NullType to null.
7767 2006-09-15 Martin Baulig <martin@ximian.com>
7770 (TypeManager.GetMethodName): Added mcs implementation.
7771 (TypeManager.IsEqual): Likewise.
7774 (SimpleName.RemoveGenericArity): Added dummy implementation.
7776 * pending.cs: Merged with the gmcs version.
7778 2006-09-15 Martin Baulig <martin@ximian.com>
7780 * statement.cs: Merge with the gmcs version.
7782 2006-09-15 Martin Baulig <martin@ximian.com>
7784 * statement.cs (Switch): Merge with the gmcs implementation
7785 (without nullables), which is newer.
7787 2006-09-15 Martin Baulig <martin@ximian.com>
7789 * statement.cs (Block.Variables): Make this public.
7790 (ToplevelBlock.Parameters): Make this a property.
7791 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
7793 2006-09-15 Martin Baulig <martin@ximian.com>
7795 * namespace.cs: Merge with the gmcs version.
7797 2006-09-15 Martin Baulig <martin@ximian.com>
7799 * decl.cs (MemberName): Minor code cleanups.
7801 2006-09-15 Martin Baulig <martin@ximian.com>
7803 * parameter.cs: Merge with the gmcs version.
7805 2006-09-15 Martin Baulig <martin@ximian.com>
7807 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
7808 and an error in mcs.
7810 2006-09-15 Martin Baulig <martin@ximian.com>
7812 * flowanalysis.cs: Merged from GMCS; added the generics code into
7813 a `GMCS_SOURCE' conditional so we can share this file.
7815 2006-09-08 Martin Baulig <martin@ximian.com>
7817 * typemanager.cs (TypeManager.interlocked_type): New public field.
7818 (TypeManager.int_interlocked_compare-exchange): New public field.
7819 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
7820 enumerator types here and call InitGenericCoreTypes().
7821 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
7822 after calling InitEnumUnderlyingTypes().
7825 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
7826 `classes_second_stage'.
7828 2006-09-14 Marek Safar <marek.safar@seznam.cz>
7830 * assign.cs, ecore.cs, expression.cs: Share error message text.
7831 * class.cs (FieldMember.Define): Check for varible of static type.
7832 * driver.cs (LoadAssembly): Uses error output for errors.
7833 * statement.cs: Updated.
7835 2006-09-08 Marek Safar <marek.safar@seznam.cz>
7837 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
7840 2006-09-07 Martin Baulig <martin@ximian.com>
7843 (MainDriver): Revert r62663 from Marek; see #70506 for details.
7845 2006-08-29 Miguel de Icaza <miguel@novell.com>
7847 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
7849 2006-08-17 Miguel de Icaza <miguel@novell.com>
7851 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
7852 #52019 and #79064, the use of the \uXXXX sequence in source code
7853 to represent unicode characters.
7855 2006-08-15 Marek Safar <marek.safar@seznam.cz>
7857 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
7859 * class.cs, ecore.cs, statement.cs: Merged to one error message.
7861 2006-08-13 Miguel de Icaza <miguel@novell.com>
7863 * assign.cs: Catch attempts to assign to a method groups in += and
7866 2006-08-13 Marek Safar <marek.safar@seznam.cz>
7869 * cs-parser.jay: Don't destroy current array type by typeof of array's.
7871 2006-08-12 Marek Safar <marek.safar@seznam.cz>
7873 * class.cs (Method.Define): Issue a warning when generic method looks like
7875 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
7878 2006-08-09 Marek Safar <marek.safar@seznam.cz>
7880 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
7882 * decl.cs (MemberCache.FindMembers): When container is interface we need to
7883 search all base interfaces as a member can be ambiguous.
7884 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
7885 Constructor member type filter.
7886 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
7887 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
7888 reporting for returned memberinfos.
7889 * report.cs: Updated.
7890 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
7891 version to work on all runtimes.
7892 (TypeManager.RealMemberLookup): Removed members filtering.
7894 2006-08-08 Raja R Harinath <rharinath@novell.com>
7896 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
7897 (PropertyExpr.EmitAssign): Likewise.
7898 * expression.cs (Indirection.EmitAssign): Likewise.
7899 (LocalVariableReference.EmitAssign): Likewise.
7900 (ParameterReference.EmitAssign): Likewise.
7901 (Invocation.EmitArguments): Likewise.
7902 (ArrayAccess.EmitAssign): Likewise.
7903 (IndexerAccess.EmitAssign): Likewise.
7904 (This.EmitAssign): Likewise.
7905 (ConditionalLogicalOperator.Emit): Likewise.
7908 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
7909 instead of ArrayList. If the hashtable has a LocalBuilder, don't
7910 leave it in after returning it.
7911 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
7913 2006-08-06 Marek Safar <marek.safar@seznam.cz>
7915 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
7918 2006-08-03 Raja R Harinath <rharinath@novell.com>
7920 Fix cs0146-3.cs and cs0146-4.cs.
7921 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
7922 enclosing types don't depend on the current type.
7924 2006-08-02 Raja R Harinath <rharinath@novell.com>
7927 * class.cs (TypeContainer.DoDefineMembers): Use
7928 FindBaseMemberWithSameName on Parent, since we're interested in
7929 whether we hide inherited members or not.
7930 (FindBaseMemberWithSameName): Make slightly more robust.
7932 Fix the non-generic testcase from #77396
7933 * decl.cs (DeclSpace.DeclContainer): Remove override.
7935 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
7936 declspaces for doppelgangers too.
7937 (UsingEntry): Implement IResolveContext.
7938 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
7939 'this' as the resolve context.
7940 (LocalAliasEntry): Likewise.
7942 Implement parts of #77403
7943 * roottypes.cs (RootDeclSpace): New. Used to represent the
7944 toplevel declaration space. Each namespace declaration introduces
7945 a "partial" root declaretion space.
7946 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
7947 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
7948 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
7949 from 'current_namespace.SlaveDeclSpace'.
7950 (namespace_declaration): Likewise.
7951 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
7952 check. It can't happen now.
7953 * decl.cs (DeclSpace.LookupType): Likewise.
7954 * driver.cs (MainDriver): Sanity check.
7956 2006-08-01 Raja R Harinath <rharinath@novell.com>
7958 * decl.cs (DeclSpace.FindNestedType): Remove.
7959 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
7960 LookupTypeContainer to get the container of the nested type.
7961 * class.cs (TypeContainer.FindNestedType): Make non-override.
7963 2006-07-31 Raja R Harinath <rharinath@novell.com>
7965 * decl.cs (DeclSpace.PartialContainer): Move field from ...
7966 * class.cs (TypeContainer.PartialContainer): ... here.
7967 (TypeContainer.AddBasesForPart): New helper.
7968 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
7970 * cs-parser.jay (current_class): Convert to DeclSpace.
7971 (struct_declaration, interface_declaration, class_declaration):
7972 Use AddBasesForPart instead of .Bases directly.
7973 * const.cs, iterators.cs: Update to changes.
7975 2006-07-28 Raja R Harinath <rharinath@novell.com>
7977 * class.cs (TypeContainer.AddMemberType): Rename from
7979 (TypeContainer.AddMember): Rename from AddToMemberContainer.
7980 (AddTypeContainer): New. Combine AddClassOrStruct and
7982 (AddPartial): Update. Add 'is_partial' argument.
7983 * roottypes.cs: Update to changes.
7984 * cs-parser.jay (push_current_class): New helper for handling
7985 current_container and current_class.
7986 (struct_declaration, interface_declaration, class_declaration):
7989 2006-07-26 Raja R Harinath <rharinath@novell.com>
7991 * roottypes.cs: Rename from tree.cs.
7993 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
7994 * tree.cs (Tree, ITreeDump): Remove types.
7995 * rootcontext.cs (tree, Tree): Remove fields.
7996 (root, ToplevelTypes): New.
7997 * *.cs: Update to rename.
7999 * tree.cs (Tree.RecordDecl): Remove.
8000 (RootTypes.AddToTypeContainer): Record the toplevel type in its
8002 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
8004 2006-07-23 Raja R Harinath <harinath@gmail.com>
8006 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
8007 DoFlowAnalysis and OmitStructFlowAnalysis here.
8008 (ec.With): Rename from WithUnsafe and generalize.
8009 (ec.WithCheckState): Remove. All users can be handled by 'With'.
8010 (ec.WithFlowAnalyis): New.
8011 * ecore.cs, expression.cs, statement.cs: Update.
8013 2006-07-22 Raja R Harinath <harinath@gmail.com>
8015 * statement.cs (Block.ResolveMeta): Simplify slightly.
8017 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
8018 multiple boolean fields. Convert InUnsafe, constant_check_state,
8019 check_state to flags.
8020 (CheckState, ConstantCheckState): Update.
8021 (InUnsafe): New read-only property.
8022 (FlagsHandle): Rename from CheckStateHandle and convert to handle
8024 (WithUnsafe): New helper similar to WithCheckState.
8025 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
8026 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
8028 2006-07-21 Raja R Harinath <rharinath@novell.com>
8030 Make comparisons use the same IL irrespective of whether they're
8031 in a 'checked' or 'unchecked' context: one of the issues in #78899
8032 * codegen.cs (EmitContext.CheckState): Make read-only property.
8033 (EmitContext.ConstantCheckState): Likewise.
8034 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
8035 helper that implement a save/restore stack for CheckState
8036 values. This is the only way to change check-state.
8037 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
8038 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
8039 (CheckedExpr.EmitBranchable): New forwarding method.
8040 (UnCheckedExpr): Likewise.
8041 * statement.cs (Block.ResolveMeta): Use WithCheckState.
8042 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
8043 (Checked.Resolve, checked.DoEmit): Likewise.
8045 2006-07-20 Miguel de Icaza <miguel@novell.com>
8047 * anonymous.cs: Cache the resolved anonymous delegate, and return
8048 this so that the ResolveTopBlock is only triggered once, not
8051 Currently we trigger ResolvetopBlock twice due to a first pass of
8052 argument check compatibility, and a second pass that does the
8055 2006-07-15 Marek Safar <marek.safar@seznam.cz>
8057 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
8059 * rootcontext.cs (Reset): Add helper_classes.
8061 2006-07-15 Marek Safar <marek.safar@seznam.cz>
8064 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
8067 2006-07-13 Miguel de Icaza <miguel@novell.com>
8069 * statement.cs (Lock): Handle expressions of type
8070 TypeManager.null_type specially. Fixes #78770
8072 2006-07-08 Marek Safar <marek.safar@seznam.cz>
8074 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
8077 2006-07-08 Marek Safar <marek.safar@seznam.cz>
8079 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
8080 for accessors as well.
8081 * ecore.cs (EventExpr): Add AccessorTable.
8083 2006-07-01 Marek Safar <marek.safar@seznam.cz>
8086 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
8087 for CS0122 where appropriate.
8088 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
8090 (Filter): Assembly can be null in the case of top level attributes.
8092 2006-06-25 Marek Safar <marek.safar@seznam.cz>
8096 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
8097 is done at global level.
8099 2006-06-24 Marek Safar <marek.safar@seznam.cz>
8101 A fix for #77002, Implemented TypeForwarder support.
8103 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
8104 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
8105 * typemanager.cs (): Add type_forwarder_attr_type.
8107 2006-06-24 Marek Safar <marek.safar@seznam.cz>
8109 * report.cs: Add CS0469 warning.
8111 2006-06-21 Martin Baulig <martin@ximian.com>
8113 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
8114 the `try'-block, so we also report CS0016 etc. there.
8116 2006-06-21 Martin Baulig <martin@ximian.com>
8119 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
8121 2006-06-21 Martin Baulig <martin@ximian.com>
8123 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
8124 also report CS1686 for parameters.
8126 2006-06-21 Martin Baulig <martin@ximian.com>
8128 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
8129 instead of an error if the value is not implicitly convertible to
8130 the switch types; fixes #77964.
8132 2006-06-21 Raja R Harinath <rharinath@novell.com>
8135 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
8136 FieldBuilder is null.
8139 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
8140 'left' and 'right' before error-checking.
8142 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
8144 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
8146 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
8147 (FieldExpr.DoResolve): likewise.
8148 (PropertyExpr.InstanceResolve): likewise.
8149 (EventExpr.InstanceResolve): likewise.
8151 2006-06-04 Marek Safar <marek.safar@seznam.cz>
8153 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
8154 attribute applicable tests for attribute argument.
8156 2006-06-02 Raja R Harinath <rharinath@novell.com>
8159 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
8160 (Binary.OverloadResolve_PredefinedIntegral): New.
8161 (Binary.OverloadResolve_PredefinedFloating): New.
8162 (Binary.OverloadResolve_PredefinedString): New.
8163 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
8164 Follow the standard more closely, and treat numeric promotions in
8165 terms of overload resolution.
8166 (Binary.CheckShiftArguments): Simplify.
8168 2006-06-01 Raja R Harinath <rharinath@novell.com>
8170 * flowanalysis.cs (MyBitVector): Simplify representation.
8171 (MyBitVector.Clone): Avoid allocating BitArray.
8172 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
8173 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
8174 (*): Update. Change all references to MyBitVector.And and
8175 MyBitVector.Or to &= and |=.
8177 2006-05-29 Raja R Harinath <rharinath@novell.com>
8180 * cs-parser.jay (formal_parameter_list): Extend the pattern below
8181 to param arguments too.
8183 2006-05-26 Miguel de Icaza <miguel@novell.com>
8185 * cs-parser.jay: Catch another parsing form for arglist being
8186 followed by other arguments. Fixes #78313.
8188 2006-05-24 Raja R Harinath <rharinath@novell.com>
8190 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
8191 checking of out parameters to ...
8192 (FlowBranchingToplevel.Merge): ... here.
8193 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
8194 set, propagate the origin upward, and only complain if there was
8196 (FlowBranchingException.AddContinueOrigin): Likewise.
8197 (FlowBranchingException.AddReturnOrigin): Likewise.
8198 (FlowBranchingException.AddGotoOrigin): Likewise.
8200 2006-05-23 Raja R Harinath <rharinath@novell.com>
8202 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
8203 unreachable, skip it.
8204 (FlowBranchingException.Merge): Always propagate jumps, even if
8205 the finally block renders subsequent code unreachable.
8207 2006-05-18 Raja R Harinath <rharinath@novell.com>
8210 * statement.cs (Goto.Resolve): Move responsibility for resolving
8211 'goto' to FlowBranching.AddGotoOrigin.
8212 (Goto.SetResolvedTarget): New. Callback to set the
8213 LabeledStatement that's the target of the goto.
8214 (Goto.DoEmit): Use Leave instead of Br when crossing an
8215 unwind-protect boundary.
8216 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
8217 LookupLabel and adjust to new semantics.
8218 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
8219 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
8220 Goto.SetResolvedTarget to update target.
8221 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
8222 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
8223 AddBreakOrigin & co. Delay propagation until ...
8224 (FlowBranchingException.Merge): ... this.
8226 * statement.cs (Block.Resolve): Always depend on flow-branching to
8227 determine unreachability. Kill workaround that originally emitted
8228 only one statement after an "unreachable" label (see infloop in
8231 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
8232 This is still "wrong", but anything better would probably need a
8233 multi-pass algorithm.
8234 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
8235 usage vector. Force current usage vector to be reachable, to
8236 optimistically signify backward jumps.
8237 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
8239 (FlowBranchingLabeled.Merge): New. If no backward jump was
8240 detected, return the original salted-away usage vector instead,
8241 updated with appropriate changes. Print unreachable warning if
8243 * statement.cs (Block.Resolve): Don't print unreachable warning on
8244 a labeled statement.
8246 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
8248 * driver.cs: Pass filename without path to AssemblyBuilder's
8249 AddResourceFile. Fixes bug #78407.
8251 2006-05-17 Raja R Harinath <rharinath@novell.com>
8253 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
8254 * flowanalysis.cs (FlowBranchingLabeled): ... here.
8255 (FlowBranching.MergeChild): Overwrite
8256 reachability information from Labeled branchings too.
8258 2006-05-16 Raja R Harinath <rharinath@novell.com>
8260 * statement.cs (Goto.Resolve): Merge jump origins here ...
8261 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
8263 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
8264 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
8265 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
8266 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
8268 * statement.cs (Goto.Resolve): ... not here.
8269 (Goto.Emit): Remove CS1632 check.
8271 2006-05-14 Marek Safar <marek.safar@seznam.cz>
8273 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
8276 2006-05-11 Raja R Harinath <rharinath@novell.com>
8278 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
8279 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
8280 (FlowBranchingException.Label): Likewise.
8282 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
8284 (MyBitVector.Or): Use it to avoid losing information (Count).
8285 (FlowBranching.MergeOrigins): Likewise.
8287 * flowanalysis.cs (UsageVector.IsDirty): Remove.
8288 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
8289 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
8290 (UsageVector.ToString): Simplify.
8291 (UsageVector.MergeSiblings): Move here from ...
8292 (FlowBranching.Merge): ... here.
8293 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
8296 2006-05-10 Raja R Harinath <rharinath@novell.com>
8298 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
8299 null bitvector is treated as all-true.
8301 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
8302 (MyBitVector): Rationalize invariants. 'vector != null' implies
8303 that we have our own copy of the bitvector. Otherwise,
8304 'InheritsFrom == null' implies all inherited bits are true.
8306 2006-05-09 Marek Safar <marek.safar@seznam.cz>
8308 * statement.cs (LocalInfo): Add IsConstant.
8309 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
8310 local variable for constants.
8312 2006-05-09 Raja R Harinath <rharinath@novell.com>
8314 * flowanalysis.cs (MyBitVector.Empty): New.
8315 (MyBitVector): Don't allow InheritedFrom to be null.
8316 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
8317 (UsageVector, FlowBranching): Update to changes.
8319 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
8320 recursion. The 'Parent == null' condition isn't sufficient for
8322 (FlowBranching.AddBreakOrigin): Likewise.
8323 (FlowBranching.AddContinueOrigin): Likewise.
8324 (FlowBranching.AddReturnOrigin): Likewise.
8325 (FlowBranching.StealFinallyClauses): Likewise.
8326 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
8327 (FlowBranching.CheckOutParameters): Likewise.
8328 (FlowBranchingToplevel): Terminate all the above recursions here.
8329 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
8330 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
8332 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
8334 (FlowBranchingToplevel): New. Empty for now.
8335 (FlowBranching.MergeTopBlock): Update.
8336 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
8337 branching for the anonymous delegate.
8338 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
8340 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
8341 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
8342 information at the start of the merge. Reorganize.
8344 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8346 * class.cs (MethodData.Define): Method cannot implement interface accessor.
8348 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8350 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
8351 to newly introduced ctor.
8353 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
8354 message to one place.
8355 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
8358 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8360 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
8362 * ecore.cs (Expression.ResolveAsConstant): Updated.
8364 * statement.cs (ResolveMeta): Updated.
8366 2006-05-06 Marek Safar <marek.safar@seznam.cz>
8368 * cs-parser.jay: __arglist cannot be used in initializer.
8370 2006-05-06 Marek Safar <marek.safar@seznam.cz>
8373 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
8376 2006-05-05 Raja R Harinath <rharinath@novell.com>
8378 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
8379 (LabeledStatement): Add 'name' parameter.
8380 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
8381 (Block.AddLabel): Update to changes.
8382 * cs-parser.jay (labeled_statement): Likewise.
8384 * flowanalysis.cs (BranchingType.Labeled): New.
8385 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
8386 (FlowBranchingLabeled): New. Does nothing for now, but will
8387 eventually handle 'goto' flows.
8388 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8389 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
8390 that's terminated ...
8391 (Block.Resolve): ... here.
8393 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
8394 (UsageVector.MergeFinallyOrigins): Likewise.
8395 (FlowBranching.InTryOrCatch): Likewise.
8396 (FlowBranching.AddFinallyVector): Likewise.
8397 (FlowBranchingException): Update to changes.
8400 * statement.cs (Return.Resolve): Move error checking to ...
8401 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
8402 (FlowBranchingException): Handle return origins like break and
8404 (FlowBranching.UsageVector.CheckOutParameters): Remove.
8406 2006-05-04 Marek Safar <marek.safar@seznam.cz>
8409 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
8412 2006-05-04 Marek Safar <marek.safar@seznam.cz>
8415 * class.cs (MethodData.Define): Do public accessor check only when method
8416 implements an interface.
8418 2006-05-04 Raja R Harinath <rharinath@novell.com>
8420 Remove special handling of 'break'
8421 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
8422 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
8423 (UsageVector.Break): Remove.
8424 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
8426 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
8428 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
8429 UsageVector.Breaks (). Don't set NeedsReturnLabel.
8431 2006-05-03 Marek Safar <marek.safar@seznam.cz>
8434 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
8435 be the interface member.
8437 2006-05-03 Marek Safar <marek.safar@seznam.cz>
8440 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
8441 for emitting small (int) values.
8443 2006-05-03 Raja R Harinath <rharinath@novell.com>
8446 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
8447 control-flow passes through the 'finally' after merging-in all the
8448 control-flows from 'try' and the 'catch' clauses.
8450 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
8451 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
8452 always true at the only non-recursive entry point.
8453 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
8454 FlowBranchingBreakable.
8455 (FlowBranchingLoop): Remove.
8456 * statement.cs (Return.DoResolve): Update to changes.
8459 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
8460 (FlowBranching.CreateBranching): Handle it: create a
8461 FlowBranchingContinuable.
8462 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
8463 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
8464 except that it handles the 'continue' command.
8465 (FlowBranching.UsageVector.MergeOrigins): Rename from
8467 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
8468 except that it overrides AddContinueOrigin.
8469 (FlowBranchingException): Override AddContinueOrigin, similar to
8471 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
8472 Create a new branching around the embedded statement.
8473 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
8474 control flow after the embedded statement.
8475 (Continue.Resolve): Move all error checking to AddContinueOrigin.
8477 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
8478 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
8479 FlowBranchingBreakable.
8480 (FlowBranchingSwitch): Remove.
8483 * statement.cs (Break.Resolve): Simplify. Move responsibility for
8484 error reporting to ...
8485 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
8486 Rename from 'AddBreakVector'. Add new location argument. Return
8487 a bool indicating whether the 'break' crosses an unwind-protect.
8488 (FlowBranchingException.AddBreakOrigin): Add.
8489 (FlowBranchingException.Merge): Propagate 'break's to surrounding
8490 flowbranching after updating with the effects of the 'finally'
8492 (FlowBranchingBreakable): New common base class for
8493 FlowBranchingLoop and FlowBranchingSwitch.
8495 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
8497 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
8499 2006-05-02 Raja R Harinath <rharinath@novell.com>
8501 * statement.cs (Do.Resolve): If the loop is infinite, set the
8503 (While.Resolve, For.Resolve): Set a barrier after the embedded
8504 statement. There's no direct control flow that goes from the end
8505 of the embedded statement to the end of the loop.
8506 * flowanalysis.cs (FlowBranching.Infinite): Remove.
8507 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
8508 above ensure that the reachability is correctly computed.
8510 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
8511 (UsageVector.MergeBreakOrigins): If the current path is
8512 unreachable, treat it as if all parameters/locals are initialized.
8513 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
8514 infinite loops before merging-in break origins.
8516 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
8517 (Reachability.Reachable): Split part into ...
8518 (Reachability.Unreachable): ... this. Simplify.
8519 (Reachability.IsUnreachable): Use 'Unreachable' instead.
8521 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
8522 (Reachability.SetThrowsSometimes): Likewise.
8523 (FlowBranchingBlock.MergeTopBlock): Don't compare against
8524 TriState.Always, use corresponding property.
8525 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
8526 (Block.Resolve): Likewise. Remove some redundant checks.
8528 2006-05-02 Raja R Harinath <harinath@gmail.com>
8530 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
8531 (Reachability.Meet): Don't bother checking AlwaysThrows --
8532 barrier is always set.
8533 (FlowBranchingBlock.Merge): Likewise.
8535 2006-05-01 Raja R Harinath <harinath@gmail.com>
8537 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
8538 checks for unreachable.
8540 2006-05-01 Marek Safar <marek.safar@seznam.cz>
8543 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
8545 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
8546 whether field is really assigned.
8548 2006-04-30 Raja R Harinath <harinath@gmail.com>
8550 * flowanalysis.cs (Reachability): Make 4-argument constructor
8552 (Reachability.Meet): Rename from 'And'. Remove static variant.
8553 (Reachability.Always): Rename from the highly misleading
8554 'Reachability.Never'.
8555 (FlowBranching.Merge): Update to changes. Mark an impossible
8556 situation with a 'throw'.
8557 (*): Update to changes.
8559 2006-04-29 Raja R Harinath <harinath@gmail.com>
8561 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
8563 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
8564 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
8565 (*): Update to changes.
8566 * statement.cs: Update to changes.
8568 2006-04-28 Marek Safar <marek.safar@seznam.cz>
8571 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
8573 2006-04-28 Raja R Harinath <harinath@gmail.com>
8575 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
8578 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
8579 argument to two arguments: an usage-vector and a bool. Move call
8580 to FlowBranching.Merge () ...
8581 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
8583 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
8584 handling of loop and switch reachability to ...
8585 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
8587 2006-04-27 Raja R Harinath <harinath@gmail.com>
8589 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
8590 handling to FlowBranchingLoop.InLoop.
8591 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
8593 2006-04-26 Marek Safar <marek.safar@seznam.cz>
8596 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
8597 anonymous method is allowed from AnonymousContainer here.
8599 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
8601 2006-04-24 Raja R Harinath <rharinath@novell.com>
8604 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
8606 2006-04-23 Marek Safar <marek.safar@seznam.cz>
8609 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
8610 (DoubleConstant.Reduce): Ditto.
8612 2006-04-23 Raja R Harinath <rharinath@novell.com>
8614 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
8615 Remove 'lvalue_right_side' argument. Move parts to ...
8616 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
8617 (LocalVariable.DoResolveLValue): ... these.
8619 2006-04-21 Raja R Harinath <rharinath@novell.com>
8622 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
8623 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
8624 (LocalVariableReference.DoResolveBase): Use it to implement new
8626 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
8627 (Argument.Resolve): Simplify. Move CS1510 check ...
8628 * ecore.cs (Expression.ResolveLValue): ... here.
8629 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
8630 (PropertyExpr.DoResolveLValue): Likewise.
8631 (FieldExpr.Report_AssignToReadonly): Likewise.
8632 (FieldExpr.DoResolve): Add 'out_access' argument. Use
8633 LValueMemberAccess or LValueMemberOutAccess on instance depending
8635 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
8636 DoResolve as appropriate.
8638 2006-04-20 Raja R Harinath <rharinath@novell.com>
8641 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
8642 implicit conversions on 'out' and 'ref' arguments.
8644 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
8645 improve clarity. Remove dead code.
8648 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
8649 (Catch.Resolve): Resolve VarBlock if it exists.
8651 2006-04-19 Miguel de Icaza <miguel@novell.com>
8653 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
8654 twice, this was some residual code, the enumerator was emitted
8655 properly in the two branche of if later.
8657 2006-04-19 Raja R Harinath <rharinath@novell.com>
8659 * expression.cs (Cast.ResolveLValue): Remove. The result of a
8660 cast is never an lvalue.
8661 (Cast.DoResolve, Cast.ResolveRest): Combine.
8662 (Argument.Emit): Simplify slightly. Move 'Expr is
8663 IMemoryLocation' check ...
8664 (Argument.Resolve): ... here.
8665 (Argument.Error_LValueRequired): Remove. Inline into only user.
8667 Simplifications. Fix cs0191-2.cs
8668 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
8669 CS1649 and CS1651 to ...
8670 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
8671 the actual selection of the error code and message to a lookup
8672 table. Add a dummy return value to simplify callsites.
8673 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
8674 readonly fields of other instances of the same type. Move CS0197
8676 * expression.cs (Argument.Resolve): ... here. Simplify code.
8677 Ensure that ec.InRefOutArgumentResolving is only set during LValue
8678 resolution of an out or ref argument. The code simplification
8679 above uses this invariant.
8681 2006-04-18 Raja R Harinath <rharinath@novell.com>
8683 Possibly fix #77752. Fix cs1690-[4-7].cs.
8684 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
8685 CheckMarshallByRefAccess. Drop parameter.
8686 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
8688 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
8690 * report.cs (AllWarnings): Add CS1690.
8691 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
8693 (LocalVariableReference.DoResolveBase): Update.
8695 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8697 * class.cs (MethodOrOperator): Moved common parts from method class.
8698 detect obsolete attributes.
8699 (Method.Define): Simplified as it reuses code from base.
8700 (Constructor.ValidAttributeTargets): Fixed issue found during
8702 (Destructor.ValidAttributeTargets): Fixed issue found during
8704 (Operator): Finished refactoring set off by #78020. Operator class is now
8705 ordinary method class.
8707 * anonymous.cs: Updated.
8709 * decl.cs (DeclSpace): Add IsGeneric
8711 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8713 * class.cs (Constructor.Emit): Don't emit the attributes twice.
8715 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8717 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
8718 detect obsolete attributes.
8719 (Method.CreateEmitContext): Moved to MethodOrOperator.
8721 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8724 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
8725 customized exception to make crash detection easier.
8726 (MethodOrOperator): Started to work on new base class for methods and
8728 (Method): Derives from MethodOrOperator.
8729 (Constructor.Emit): Emits its own attributes.
8730 (AbstractPropertyEventMethod.Emit): Ditto.
8731 (Operator): Derives from MethodOrOperator, will refactor fully in extra
8733 (Operator.Emit): It's temporary more tricky than should be.
8735 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
8737 * report.cs (InternalErrorException): Add ctor with inner exception.
8739 2006-04-08 Marek Safar <marek.safar@seznam.cz>
8742 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
8745 2006-04-07 Marek Safar <marek.safar@seznam.cz>
8748 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
8751 2006-04-06 Marek Safar <marek.safar@seznam.cz>
8753 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
8754 attribute is present and Guid not.
8755 (Interface.ApplyAttributeBuilder): Ditto.
8757 * attribute.cs: Add error message.
8759 2006-04-06 Marek Safar <marek.safar@seznam.cz>
8763 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
8764 sources (it's composite) so hold them in extra array as they are used in
8765 Emit phase only. It worked in the previous versions by mistake.
8766 (Attribute.Emit): Emit attribute for more owners when exist.
8768 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
8769 it has now different behaviour.
8771 2006-04-04 Marek Safar <marek.safar@seznam.cz>
8773 * constant.cs (Constant.IsDefaultInitializer): New method.
8775 * class.cs: Updated.
8777 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
8778 re-initialize default values. It saves KBs almost for every assembly.
8779 Thanks Zoltan for the idea.
8780 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
8781 (ArrayCreation.DoResolve): Resolve only once.
8782 (ArrayCreation.Emit): Emit static initializer only when it is faster.
8783 (ArrayCreation.GetAttributableValue): Cope with optimized values.
8785 2006-04-03 Zoltan Varga <vargaz@gmail.com>
8787 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
8790 2006-04-01 Marek Safar <marek.safar@seznam.cz>
8792 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
8793 in an embedded statement too.
8795 2006-04-01 Raja R Harinath <rharinath@novell.com>
8798 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
8800 2006-04-01 Marek Safar <marek.safar@seznam.cz>
8804 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
8807 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
8809 2006-03-31 Marek Safar <marek.safar@seznam.cz>
8811 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
8814 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
8815 LocalTemporary change.
8817 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
8819 (ClassOrStruct.DefineFieldInitializers): Implemented static field
8820 initializers optimization.
8821 (ClassOrStruct.TypeAttr): Moved from modifiers.
8822 (Constructor.CheckBase): Don't crash when static ctor has parameters.
8823 (FieldBase.ResolveInitializer): Resolves initializer.
8824 (FieldBase.HasDefaultInitializer): New property.
8826 * cs-parser.jay: Removed message.
8828 * expression.cs (CompilerGeneratedThis): New specialization.
8830 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
8832 2006-03-28 Marek Safar <marek.safar@seznam.cz>
8834 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
8836 2006-03-27 Marek Safar <marek.safar@seznam.cz>
8838 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
8839 be now EnumConstants only.
8841 2006-03-27 Marek Safar <marek.safar@seznam.cz>
8843 * attribute.cs, driver.cs: Reset more caches.
8845 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8847 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
8849 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8851 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
8852 for easier reuse. Updated all overrides.
8853 (IntegralConstant): New base class for all integral constants.
8854 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
8855 of the constant range, report custom error.
8856 (UIntConstant.Reduce): Fixed uint conversion.
8858 * ecore.cs, literal.cs: Reduce updates.
8860 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8864 * class.cs (Constructor.Define): Removed extra if for default ctors.
8865 A patch from Atsushi Enomoto.
8867 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8869 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
8870 GetAttributableValue.
8872 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
8875 * convert.cs (ImplicitConversionRequired): Error message moved to
8878 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
8879 automatic implicit conversion of an output value.
8880 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
8882 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
8884 (TypeOf.GetAttributableValue): Add extra handling for object type.
8886 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
8887 special error message.
8889 2006-03-25 Marek Safar <marek.safar@seznam.cz>
8891 * class.cs (Constructor.Emit): Don't crash when struct ctor is
8893 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
8894 compatible with MS runtime.
8896 2006-03-23 Marek Safar <marek.safar@seznam.cz>
8898 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
8899 attribute arguments here.
8901 * class.cs (Indexer.Define): The check was moved to attribute class.
8903 2006-03-22 Marek Safar <marek.safar@seznam.cz>
8905 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
8906 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
8909 2006-03-22 Raja R Harinath <rharinath@novell.com>
8911 Support ParameterDefaultValueAttribute in gmcs. Also applied to
8912 mcs to keep code differences small.
8913 * attribute.cs (Attribute.GetParameterDefaultValue): New.
8914 * typemanager.cs (parameter_default_value_attribute_type): New.
8915 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
8918 2006-03-21 Marek Safar <marek.safar@seznam.cz>
8920 * expression.cs (StringConcat.Append): Reverted back to no warning state.
8922 2006-03-21 Marek Safar <marek.safar@seznam.cz>
8924 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
8926 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
8929 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
8931 * doc-bootstrap.cs : fix build.
8933 2006-03-20 Marek Safar <marek.safar@seznam.cz>
8935 * expression.cs (StringConcat.Append): Issue a warning when empty string
8938 2006-03-20 Marek Safar <marek.safar@seznam.cz>
8940 * assign.cs (CompoundAssign.ResolveSource): Removed.
8942 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
8945 * class.cs (TypeContainer.FindMethods): Removed.
8946 (TypeContainer.CheckMemberUsage): Made static.
8948 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
8950 * constant.cs (CheckRange): Removed unused type argument.
8951 (CheckUnsigned): Removed unused type argument.
8953 * cs-parser.jay: Updated after MemberAccess clean up.
8954 Uses Length for empty string test.
8956 * cs-tokenizer.cs: Uses Length for empty string test.
8957 (IsCastToken): Made static.
8958 (is_hex): Made static.
8959 (real_type_suffix): Made static.
8961 * decl.cs (SetupCache): Made static.
8962 (OnGenerateDocComment): Removed unused ds argument.
8964 * delegate.cs (VerifyDelegate): Removed unused argument.
8966 * doc.cs: Uses Length for empty string test.
8968 * driver.cs: Uses Length for empty string test.
8970 * enum.cs (IsValidEnumType): Made static
8972 * expression.cs (EnumLiftUp): Removed unused argument.
8973 (ResolveMethodGroup): Ditto.
8974 (BetterConversion): Ditto.
8975 (GetVarargsTypes): Ditto.
8976 (UpdateIndices): Ditto.
8977 (ValidateInitializers): Ditto.
8978 (MemberAccess.ctor): Ditto.
8979 (GetIndexersForType): Ditto.
8981 * flowanalysis.cs: (MergeFinally): Removed unused argument.
8983 * iterators.cs: Updated after MemberAccess clean up.
8985 * location.cs: Uses Length for empty string test.
8987 * namespace.cs: Uses Length for empty string test.
8989 * report.cs (CheckWarningCode): Made static.
8991 * statement.cs (LabeledStatement): Removed unused argument.
8993 * typemanager.cs (FilterNone): Removed.
8995 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8997 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
9000 * class.cs: Updated.
9002 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9004 * cs-parser.jay.cs: __arglist is not allowed for delegates.
9006 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9010 * expression.cs (VerifyArgumentsCompat): Reverted to double error
9011 reporting, it's more tricky than I thought.
9013 2006-03-18 Marek Safar <marek.safar@seznam.cz>
9017 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
9019 (AnonymousMethod.ImplicitStandardConversionExists): New method.
9020 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
9021 Add more error reporting; Fixed issue with params.
9023 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
9025 * cs-parser.jay: AnonymousMethod requires host container.
9027 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
9029 2006-03-18 Raja R Harinath <harinath@gmail.com>
9031 * class.cs: Change 'TypeContainer ds' constructor argument to
9032 'DeclSpace parent'. Some classes were missed below due to
9033 different naming convention.
9035 * class.cs (MemberCore.Parent): Delete. This makes the
9036 ParentContainer changes below enforceable by the compiler.
9038 Treat pointers to enclosing declaration space as 'DeclSpace', not
9040 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
9041 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
9043 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
9045 (Block.AddThisVariable): Likewise.
9046 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
9047 (AbstractPropertyEventMethod.Emit): Likewise.
9048 (AbstractPropertyEventMethod.EmitMethod): Likewise.
9049 (GetMethod.Define, SetMethod.Define): Likewise.
9050 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
9051 (DelegateMethod.EmitMethod): Likewise.
9053 Fix regression test-partial-13.cs.
9054 Rationalize use of PartialContainer. Ensure that the partial
9055 class semantics can be tied to type-correctness, i.e., any
9056 violation will cause a compile error.
9057 * class.cs, const.cs: Access all fields that belong to class
9058 TypeContainer via ParentContainer. Arguments of EmitContexts and
9059 Resolve()-like functions still use 'Parent'.
9061 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
9062 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
9063 (PropertyMethod.CheckModifiers): Remove unused argument.
9064 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
9067 2006-03-17 Raja R Harinath <harinath@gmail.com>
9069 Make semantics of PartialContainer simpler.
9070 * decl.cs (DeclSpace.IsPartial): Remove.
9071 * class.cs (TypeContainer.IsPartial): Likewise.
9072 (TypeContainer..ctor): Set PartialContainer to point to self.
9073 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
9074 (TypeContainer.FindNestedType): Likewise.
9075 (MemberCore.ParentContainer): Simplify. Remove deprecation.
9077 2006-03-17 Marek Safar <marek.safar@seznam.cz>
9079 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
9081 2006-03-15 Marek Safar <marek.safar@seznam.cz>
9083 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
9086 2006-03-15 Marek Safar <marek.safar@seznam.cz>
9088 * class.cs (Operator.Define): An error for base conversion was not
9091 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
9093 * iterator.cs : yield break is allowed in try statement which has
9094 catch clauses. Fixed bug #77767.
9096 2006-03-13 Marek Safar <marek.safar@seznam.cz>
9098 A fix for #77593, #77574.
9100 * class.cs (MethodCore.CheckBase): Another if for operator.
9102 2006-03-09 Marek Safar <marek.safar@seznam.cz>
9104 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
9107 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
9108 (DelegateCreation.ImplicitStandardConversionExists): New method for just
9111 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
9114 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
9115 Updated after another emitcontext usage was clean up. It should help us to
9116 synchronize with gmcs easier.
9118 2006-03-04 Marek Safar <marek.safar@seznam.cz>
9122 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
9123 (Event.Define): ditto
9124 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
9126 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
9127 Removed redundant code and set NewSlot for Invoke method too.
9129 * parameter.cs (Parameters.ctor): Add custom, type ctor.
9130 (Parameters.MergeGenerated): New method. Use this method when you merge
9131 compiler generated argument with user arguments.
9133 2006-03-03 Marek Safar <marek.safar@seznam.cz>
9135 * attribute.cs (ResolveAsTypeTerminal): Removed.
9137 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
9138 specialization for predefined types; 30% speed up.
9139 Finally placed obsolete check to right place.
9140 (Expression.ResolveType): Removed.
9142 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
9143 Updated after ResolveType was removed.
9145 * expression.cs (Cast.ctor): Check void cast.
9146 (Binary.ResolveAsTypeTerminal): Is never type.
9147 (Conditional.ResolveAsTypeTerminal): Is never type.
9149 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
9151 2006-03-01 Raja R Harinath <rharinath@novell.com>
9154 * expression.cs (ParameterReference.DoResolveBase): Change return
9156 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
9160 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
9163 * typemanager.cs (GetFullNameSignature): Don't nullref on
9164 protected accessors.
9166 2006-02-27 Marek Safar <marek.safar@seznam.cz>
9168 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
9169 these two separated members to simplify the code.
9170 (Attribute.Resolve): Refactored to use new fields and methods.
9171 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
9172 implemented obsolete attribute checking.
9173 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
9174 implemented obsolete checking again. It look line never ending quest ;-)
9175 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
9177 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
9179 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
9181 *class.cs (Property.Define): Add RegisterProperty call.
9183 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
9184 argument groups (only 2).
9186 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
9187 encoding expression to arguments.
9188 (Expression.ExprClassToResolveFlags): Just turned to property.
9190 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
9191 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
9192 optimized as well as implemented support for zero-length attributes.
9194 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
9195 Add caching of PropertyInfo's.
9197 2006-02-25 Marek Safar <marek.safar@seznam.cz>
9199 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
9200 error multiple times.
9202 2006-02-25 Marek Safar <marek.safar@seznam.cz>
9204 New partial class implementation.
9205 A fix for #77027, #77029, #77403
9207 * attribute.cs (Attributable): Made attributes protected.
9209 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
9210 the replacements of ClassPart and PartialContainer.
9211 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
9212 (TypeContainer.AddInterface): Ditto.
9213 (TypeContainer.AddPartial): The main method for partial classes. It checks
9214 for errors and merges ModFlags and attributes. At the end class is added to
9216 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
9218 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
9219 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
9220 from the rest of partial classes.
9221 (TypeContainer.GetClassBases): Simplified.
9222 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
9224 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
9225 (TypeContainer.HasExplicitLayout): Uses Flags now.
9226 (PartialContainer): Removed.
9227 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
9228 (StaticClass): Was merged with Class.
9229 (Class.GetClassBases): class and static class bases are verified here.
9230 (Class.TypeAttr): Added static attributes when class is static.
9231 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
9232 (MemberBase): In some cases we need to call parent container for partial
9233 class. It should be eliminated but it's not easy now.
9235 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
9237 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
9238 partial classed to accumulate class comments.
9239 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
9241 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
9243 * driver.cs (MainDriver): Tree.GetDecl was removed.
9245 * modifiers.cs (Modifiers): Add partial modifier.
9247 * tree.cs (Tree.decl): Removed.
9248 (RootTypes): Started to use this class more often for root types
9251 2006-02-22 Marek Safar <marek.safar@seznam.cz>
9255 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
9256 external interface does not have an attribute.
9258 2006-02-22 Marek Safar <marek.safar@seznam.cz>
9260 Another prerequisites for new partial classs implementation.
9262 * attribute.cs (Attribute.Equal): Implemented.
9263 (Attribute.Emit): Changed as attributes can be applied more than twice.
9264 (Attributes.Emit): Check for duplicate attributes here.
9266 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
9267 as a parameter, clean-up.
9269 2006-02-11 Marek Safar <marek.safar@seznam.cz>
9273 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
9274 contains obsolete attribute check which can in some cases look for base
9275 type of current class which is not initialized yet.
9276 (TypeContainer.BaseType): Replacement of ptype.
9278 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
9280 2006-02-11 Marek Safar <marek.safar@seznam.cz>
9282 First of prerequisites for new partial classs implemention.
9284 * attribute.cs (Attributable): Extended by ResolveContext;
9285 Attributes finally have correct context for resolving in all cases.
9286 (AttachTo): Attribute owner is assigned here.
9288 * codegen.cs (IResolveContext): Introduce new interface to hold
9289 all information needed in resolving phase.
9290 (EmitContext): Implements IResolveContext; more clean-up needed here.
9292 * decl.cs (MemberCore): Implemented IResolveContext.
9294 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
9295 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
9296 parameter.cs, statement.cs, tree.cs, typemanager.cs:
9297 Refactored to use new IResolveContext instead of EmitContext; cleanup
9299 2006-02-06 Miguel de Icaza <miguel@novell.com>
9301 * codegen.cs (EmitScopeInitFromBlock): check here the
9302 capture_context, there is no need to make two calls to the
9305 * anonymous.cs: Add some debugging messages that might help me
9306 track other instances of this problem in the future (the
9307 regression of test 467).
9309 * cs-parser.jay: track the variable block, as we need to initalize
9310 any captured variables declared in this block for the "catch"
9311 portion of the "Try" statement.
9313 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
9314 scope initialization for captured variables.
9316 Also, move the emit for the variables after the block location has
9319 2006-02-06 Marek Safar <marek.safar@seznam.cz>
9321 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
9323 2006-02-02 Miguel de Icaza <miguel@novell.com>
9325 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
9326 commit yesterday, the initialization for the roots is necessary.
9327 What is not necessary is the scope activation.
9329 2006-02-02 Raja R Harinath <rharinath@novell.com>
9331 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
9332 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
9334 (Argument.Resolve): Remove CS0206 checks.
9336 2006-02-01 Miguel de Icaza <miguel@novell.com>
9338 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
9339 scopes for all the roots, the scopes will now be emitted when the
9340 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
9342 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
9343 code. This reduces a lot of existing cruft.
9345 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
9346 that the ScopeInfo is generated as we enter the scope, not at the
9347 time of use, which is what we used to do before.
9349 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
9350 every time a Block is about to be emitted if we have a
9353 2006-02-01 Raja R Harinath <rharinath@novell.com>
9355 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
9357 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
9359 * typemanager.cs (cons_param_array_attribute): Make private.
9360 (Reset): Set it to null.
9361 (InitCoreHelpers): Don't initialize it.
9362 (ConsParamArrayAttribute): New. Initialize it as needed.
9363 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
9365 2006-01-31 Miguel de Icaza <miguel@novell.com>
9367 * expression.cs: There might be errors reported during the
9368 selection of applicable methods. If there are errors, do not
9369 continue execution as it will lead the compiler to crash.
9371 2006-01-30 Miguel de Icaza <miguel@novell.com>
9373 * expression.cs: Member access is not allowed on anonymous
9374 methods. Fixes #77402.
9376 2006-01-30 Raja R Harinath <rharinath@novell.com>
9379 * cs-parser.jay (VariableDeclaration): Don't set
9380 current_array_type to null.
9381 (field_declaration, event_declaration, declaration_statement):
9382 Set it to null here.
9384 2006-01-28 Raja R Harinath <harinath@gmail.com>
9386 * typemanager.cs (GenericParameterPosition): New.
9389 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
9391 * doc.cs : To process "include" elements, first we should create
9392 another list than XmlNodeList, because it could result in node
9393 removal, which could result in that the XmlNodeList gives up
9396 (Also made code identical to gmcs again.)
9398 2006-01-25 Miguel de Icaza <miguel@novell.com>
9400 * ecore.cs: Introduce an error report that we were not catching
9401 before, if not silent, we must report the error. Gonzalo ran into
9404 2006-01-23 Miguel de Icaza <miguel@novell.com>
9406 A fix for bug: #76957
9408 * iterators.cs (MoveNextMethod.CreateMethodHost): call
9409 ComputeMethodHost before creating the method, this is a new
9412 * anonymous.cs (AnonymousContainer): Now we track all the scopes
9413 that this method references (RegisterScope). The actual scope
9414 where the method is hosted is computed with the ComputeMethodHost
9415 before we create the method.
9417 Moved the Deepest routine here.
9419 (AnonymousContainer.ComputeMethodHost): New routine used to
9420 compute the proper ScopeInfo that will host the anonymous method.
9422 (ScopeInfo): Deal with multiple roots. The problem was that we
9423 did not have a unique root where all ScopeInfos could be hanged
9424 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
9427 Remove AdjustMethodScope which is now computed at the end. Remove
9428 LinkScope which did a partial link, instead link all ScopeInfos
9429 before code generation from the new "LinkScopes" routine.
9431 Simplify all the Add* routines as they no longer need to maintain
9432 the tree, they just need to record that they are using variables
9435 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
9436 routines to produce the forest of ScopeInfo trees.
9438 * class.cs (TypeContainer.AppendMethod): This is just like
9439 AddMethod, but ensures that an interface implementation method
9440 (IEnumerable.XXX) is not inserted at the beginning of the queue of
9441 methods, but at the end.
9443 We use this functionality to ensure that the generated MoveNext
9444 method in the iterator class is resolved/emitted before the
9445 enumerator methods created.
9447 This is required because the MoveNext method computes the right
9448 ScopeInfo for the method. And the other methods will eventually
9449 need to resolve and fetch information computed from the anonymous
9452 2006-01-21 Raja R Harinath <harinath@gmail.com>
9453 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9456 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
9458 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
9459 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
9461 2006-01-18 Raja R Harinath <rharinath@novell.com>
9463 Fix #76656, cs0231-2.cs.
9464 * cs-parser.jay (formal_parameter_list): Make error case catch
9466 (parenthesized_expression_0): Add CS1026 check.
9467 (invocation_expression): Remove unused { $$ = lexer.Location }.
9469 2006-01-17 Raja R Harinath <rharinath@novell.com>
9472 * cs-parser.jay (statement_expression): Don't list out the
9473 individual statement-expressions. Convert syntax error into
9476 2006-01-16 Raja R Harinath <rharinath@novell.com>
9479 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
9480 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
9481 CheckIntermediateModification.
9482 (FieldExpr.DoResolve): Add new two-argument version that
9483 allows us to resolve the InstanceExpression as an lvalue.
9484 The one-argument variant is now just a wrapper.
9485 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
9486 Resolve the lhs as an lvalue if the it has a value type.
9487 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
9488 from Assign.DoResolve.
9489 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
9490 resolved as an lvalue.
9491 (PropertyExpr.DoResolve): Update.
9492 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
9493 has a value type. Move CS1612 check here from
9494 CheckIntermediateModification.
9495 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
9496 * expression.cs (EmptyExpression.OutAccess): New. Used as the
9497 'right_side' of a ResolveLValue on an 'out' argument.
9498 (EmptyExpression.LValueMemberAccess): New. Used as the
9499 'right_side' of a propagated ResolveLValue on a value type.
9500 (LocalVariableReference.DoResolveBase): Recognize
9501 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
9503 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
9504 EmptyExpression.Null.
9506 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
9508 * typemanager.cs : added IsGenericParameter(). In mcs it always
9510 * doc.cs : for generic parameters, use GenericParameterPosition,
9513 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
9515 * expression.cs: Fix Console.WriteLine ((this = x).foo);
9517 2006-01-12 Miguel de Icaza <miguel@novell.com>
9519 This fixes the problem where we used ldfld instead of ldflda to
9520 load the "THIS" pointer on captured parameters, when THIS is a
9521 value type. See bug #77205.
9523 * iterators.cs (CapturedThisReference.Emit): Pass false to
9524 EmitThis (we do not need the address).
9526 * codegen.cs (EmitThis): it needs to know whether we need the
9527 address of `this' or not. This is used by value types.
9529 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
9530 every other call passes false.
9532 2006-01-12 Raja R Harinath <rharinath@novell.com>
9535 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
9537 * expression.cs (Invocation.OverloadResolve): Update.
9538 (Invocation.DoResolve): Avoid double resolution of invocation.
9540 2006-01-11 Raja R Harinath <rharinath@novell.com>
9543 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
9544 unary negation of floating point types as 0-expr; negation cannot
9545 overflow in floating point types.
9548 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
9549 on operands of 'void' type.
9552 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
9553 and ExclusiveOr for boolean constants too.
9555 2006-01-09 Raja R Harinath <rharinath@novell.com>
9558 * expression.cs (Invocation.OverloadResolve): Replace reflected
9559 override methods with their base virtual methods, rather than
9561 * typemanager.cs (TypeManager.GetOverride): New.
9563 2006-01-05 Jb Evain <jbevain@gmail.com>
9565 * class.cs (Property.Define, Indexer.Define): do not tag the
9566 properties as SpecialName | RTSpecialName.
9568 2006-01-04 Miguel de Icaza <miguel@novell.com>
9570 * class.cs (MethodCore.IsDuplicateImplementation): This method was
9571 doing a low-level comparission of parameter types. It was lacking
9572 a check for __argslist.
9574 2005-12-30 Miguel de Icaza <miguel@novell.com>
9576 * expression.cs (ParameterReference.DoResolveBase): Allow
9577 reference parameters if they are local to this block.
9579 This allows the ref and out parameters of a delegate to be used in
9580 an anonymous method, for example:
9582 delegate void set (out int x);
9584 set s = delegate (out int x){
9588 This is used by functionality introduced late in the C# language.
9590 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
9591 method that take ref and out parameters.
9593 Fixes #77119 which was a late change in the spec.
9595 2005-12-23 Miguel de Icaza <miguel@novell.com>
9597 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
9598 parent if its the same scope. Fixes #77060.
9600 2005-12-21 Miguel de Icaza <miguel@novell.com>
9602 * driver.cs: Report the case of no source files and no -out:
9605 2005-12-20 Raja R Harinath <rharinath@novell.com>
9608 * expression.cs (ComposedCast.GetSignatureForError): Define.
9610 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9614 * namespace.cs (NamespaceEntry): Add extern_aliases as a
9615 ListDictionary, to contain the ExternAliasEntry entries (in
9616 addition to the NamespaceEntry.aliases hashtable). This field is
9617 shared between the original entry and its doppelganger (bodyless
9619 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
9620 extern_aliases field.
9621 (NamespaceEntry.Lookup): Move the IsImplicit check after the
9622 lookup in extern_aliases.
9624 2005-12-16 Raja R Harinath <rharinath@novell.com>
9627 * class.cs (TypeContainer.Mark_HasEquals): New.
9628 (TypeContainer.Mark_HasGetHashCode): New.
9629 (ClassPart): Override them.
9630 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
9633 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
9634 'parent' argument to the base constructor.
9636 Remove all mention of TypeContainer from decl.cs.
9637 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
9638 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
9639 (DeclSpace.DeclSpace): Likewise.
9640 (DeclSpace.DefineMembers): Remove unused argument.
9641 * cs-parser.jay (pop_current_class): Update to changes. Simplify
9642 debugging check -- we don't care if the debug code throws an
9643 InvalidCastException instead of an InternalErrorException.
9644 * class.cs (TypeContainer.DefineMembers): Update to changes.
9645 (TypeContainer.DoDefineMembers): Likewise.
9646 (TypeContainer.GetMethods): Likewise.
9647 (PropertyMember.Define): Likewise.
9648 (MemberBase.Parent): New property that forwards to
9649 MemberCore.Parent, but ensures that we get a TypeContainer.
9650 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
9651 (RootContext.PopulateTypes): Likewise. Remove special case code
9652 for !RootContext.StdLib: DefineMembers is idempotent.
9654 2005-12-14 Miguel de Icaza <miguel@novell.com>
9656 * convert.cs (ExplicitConversionCore): Check the return value from
9657 ExplicitConversionCore which can return null on failure. Fixes #76914
9659 2005-12-13 Marek Safar <marek.safar@seznam.cz>
9661 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
9663 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
9665 * doc.cs : The search for referenced namespace was insufficient to
9666 get global one as it used to do. Fixed bug #76965.
9668 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
9670 * doc.cs : check name in cref in the last phase that whether it is
9673 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
9675 * cs-tokenizer.cs : reverted the latest change: it somehow broke
9678 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
9680 * doc.cs : so it turned out that we cannot skip override check for
9681 interface members. Fixed bug #76954.
9683 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
9685 * cs-tokenizer.cs : fixed bug #75984:
9686 - #warning and #error should not be handled when the source line
9688 - #line is not checked strictly when the source line is disabled.
9689 - #define and #undef is on the other hand checked strictly at any
9692 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
9694 * cs-tokenizer.cs : missing Location (actually, filename) in one of
9697 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9699 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
9701 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
9703 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
9704 (FieldBase.Initializer): Initializer is now optional.
9705 (EventField.Define): Only event field can have initializer.
9707 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
9709 * const.cs (Const): Reuse initializer.
9711 * cs-parser.jay: Updated after FieldBase changes.
9712 Added current_array_type to simplify array initializers.
9714 * ecore.cs (NullCast.IsDefaultValue): Implemented.
9716 * expression.cs, iterators.cs: Updated.
9718 * namespace.cs (NamespaceEntry): Made UsingFound private.
9720 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9722 * parameterCollection.cs: Obsolete, removed.
9723 * parser.cs: Obsolete, removed.
9725 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9728 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
9730 * enum.cs (Enum.Define): Set obsolete context here.
9732 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
9735 - FindDocumentedMember() now expects 1) paramList as null
9736 when "we don't have to check the number of parameters" and
9737 2) Type.EmptyTypes when "there is no arguments".
9738 - Introduced FoundMember struct to hold the exact type which was
9739 used to find the documented member (the above change broke
9740 test-xml-044; it might be better just to use DeclaringType than
9741 what MS does, like this change does, but it depends on usage.)
9743 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
9745 * doc.cs : documented member might be from DeclaringType for nested
9746 types. Fixed bug #76782.
9748 2005-12-03 Ben Maurer <bmaurer@ximian.com>
9750 * anonymous.cs: Have the param code handle leaving copies on the
9751 stack etc. Allows anonymous params to take part in the assignment
9752 code (++, +=, etc). Fixes bug #76550
9754 * expression.cs: Handle the prepare_for_load/leave_copy by passing
9755 it down to the anon code.
9757 * iterators.cs: Use dummy var here
9759 * codegen.cs: Handle new vars
9761 2005-12-01 Marek Safar <marek.safar@seznam.cz>
9764 * class.cs (MethodData.Define): Set proper Obsolete context.
9766 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
9768 (FieldExpr.DoResolve): Ditto.
9770 2005-12-01 Marek Safar <marek.safar@seznam.cz>
9773 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
9774 parent is not obsolete.
9776 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
9778 * doc.cs : (FindDocumentedMember) find parameterless members first
9779 and get CS0419 in the early stage. Fixed first case of bug #76727.
9781 2005-11-30 Marek Safar <marek.safar@seznam.cz>
9784 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
9785 no error was reported.
9787 *expression.cs (Binary.DoResolve): left can be null.
9789 2005-11-22 Marek Safar <marek.safar@seznam.cz>
9792 * class.cs (MethodData.Emit): Parameters should be labeled first.
9794 2005-11-21 Marek Safar <marek.safar@seznam.cz>
9797 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
9799 2005-11-18 Marek Safar <marek.safar@seznam.cz>
9801 * attribute.cs (AreParametersCompliant): Moved to Parameter.
9803 * class.cs (MethodCore): Parameter clean up.
9804 (IMethodData): Added ParameterInfo.
9805 (MethodData): Parameter clean up.
9806 (Indexer.Define): Parameter clean up.
9818 * typemanager.cs: Parameter clean up.
9820 * delegate.cs (Define): Get rid of duplicated code.
9822 * expression.cs (ParameterReference): Removed useless parameters
9824 (Invocation): Ditto.
9826 * parameter.cs (ParamsParameter): New class, params specialization.
9827 (ArglistParameter): Attemp to separate arglist.
9828 (Parameter): Refactored to be reusable and faster.
9829 (Parameter.Modifier): Made understandable.
9830 (Parameters): Changed to be used as a class for `this' assembly
9831 parameters. Refactored to use new specialized classes.
9833 * support.cs (ParameterData): Added Types property.
9834 (InternalParameters): Deleted.
9836 2005-08-20 Martin Baulig <martin@ximian.com>
9838 Merging this patch from GMCS to fix #75867.
9840 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9841 scope if we don't already have it.
9843 2005-11-17 Martin Baulig <martin@ximian.com>
9846 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
9847 inherit the scope from our parent. Fixes #76653.
9849 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9851 * doc.cs : the previous patch does not actually fix the bug.
9852 PropertyInfo override check is now implemented and really fixed it.
9853 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
9855 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9857 * doc.cs : apply "override filter" also to properties.
9860 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9862 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
9863 no need to check overrides. For classes, omit those results from
9864 interfaces since they must exist in the class. Fixed bug #76726.
9866 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9868 * typemanager.cs : (GetFullNameSignature) differentiate indexers
9869 with different parameters. Fixed the second problem in #76685.
9871 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9873 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
9874 get expected 'protected' access in CheckValidFamilyAccess()).
9877 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9879 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
9880 Fixed bug #76705. CS1569 was incorrectly commented out.
9882 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
9884 * doc.cs : use Invocation.IsOverride() to do real override check.
9885 * expression.cs : made Invocation.IsOverride() internal.
9887 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
9889 * doc.cs : use TypeManager.FindMembers() instead of (possible)
9890 TypeBuilder.FindMembers() and filter overriden base members out.
9893 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9895 * doc.cs : ref/out parameters are represented as '@' (instead of
9896 '&' in type FullName). Fixed bug #76630 (additionally crefs).
9898 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9900 * doc.cs : when there was no '.' in cref to methods in doc comment,
9901 then parameters were missing in the output. Fixed bug #76691.
9903 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9905 * driver.cs : don't output docs when there is an error.
9908 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9911 Now it should detect indexers. Fixed primary concern in bug #76685.
9912 Fixed CS0419 message to not show the identical member signature in
9915 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9917 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
9918 instead of Type.FindMembers() since it does not handle events.
9921 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
9923 * codegen.cs: Fixed typo (speficied -> specified).
9925 2005-11-11 Marek Safar <marek.safar@seznam.cz>
9928 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
9930 2005-11-11 Marek Safar <marek.safar@seznam.cz>
9932 * attribute.cs: Changed error message.
9934 * cs-tokenizer.cs: One more check.
9936 2005-11-10 Marek Safar <marek.safar@seznam.cz>
9938 * statement.cs (Block.Resolve): Ignore empty statement.
9940 2005-11-10 Marek Safar <marek.safar@seznam.cz>
9942 * report.cs: Made error/warning methods more strict to avoid
9945 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
9946 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
9947 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
9948 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
9950 2005-11-08 Marek Safar <marek.safar@seznam.cz>
9952 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
9953 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
9955 * class.cs (TypeContainer.IsComImport): New property.
9956 (Constructor.Define): Create proper ctor for ComImport types.
9958 * expression.cs (New.CheckComImport): Fixed.
9960 2005-11-07 Miguel de Icaza <miguel@novell.com>
9962 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
9963 that a parameter has been captured does not mean that we do not
9964 have to do the rest of the processing. This fixes the second part
9965 of #76592. If there was another anonymous method capturing
9966 values in the past, the Scope would never be set for the second
9967 method that captured the same parameter.
9969 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
9970 properly manipulate the stack. Second part of fix for #76592.
9972 * expression.cs (New): Add support for invoking "new" on
9973 interfaces that have been flagged with the ComImport attribute and
9974 the CoClass. Fixes #76637
9976 * statement.cs (Try.DoEmit): When a variable is captured, do not
9977 try to emit the vi.LocalBuilder variable as it has been captured.
9978 Create a temporary variable and store the results on the
9979 FieldBuilder. Fixes #76642
9981 2005-11-07 Marek Safar <marek.safar@seznam.cz>
9983 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
9985 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
9987 * expression.cs (Binary.DoResolve): Added && optimalization.
9989 * typemanager.cs (AddUserType): Removed useless argument.
9991 2005-11-04 Marek Safar <marek.safar@seznam.cz>
9993 * statement.cs (Block.variables): Uses ListDictionary.
9995 2005-11-03 Marek Safar <marek.safar@seznam.cz>
9998 * class.cs (PartialContainer.EmitType): Customized to emit
9999 security attributes.
10000 (ClassPart.ApplyAttributeBuilder): Transform security attribute
10001 for partial classes.
10003 2005-11-03 Marek Safar <marek.safar@seznam.cz>
10006 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
10007 access has to be fixed.
10009 * typemanager.cs (IsUnmanagedType): Wrong common field type.
10011 2005-11-01 Marek Safar <marek.safar@seznam.cz>
10014 * ecore.cs (NullCast.Reduce): Implemented.
10016 * expression.cs (ArrayCreation.CheckIndices): Correcly check
10019 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
10021 (Foreach.Resolve): Catch null properly.
10023 2005-10-29 Marek Safar <marek.safar@seznam.cz>
10025 * cs-tokenizer.cs: Warning text fix.
10027 * driver.cs: AllWarningNumbers exposed on public interface.
10029 * report.cs (): Reviewed warning numbers.
10030 (IsValidWarning): Use binary search.
10032 2005-10-29 Marek Safar <marek.safar@seznam.cz>
10034 * driver.cs: Implemeted resource visibility.
10035 (Resources): New class for code sharing between /res: and
10038 2005-10-28 Marek Safar <marek.safar@seznam.cz>
10041 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
10044 * convert (Convert.ImplicitReferenceConversion): NullCast holds
10047 * ecore.cs (NullCast): Child is contant only.
10049 * literal.cs (NullLiteral.Reduce): null can be converted to any
10052 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
10054 * driver.cs: Use Encoding.Default as default code page instead
10057 2005-10-27 Raja R Harinath <rharinath@novell.com>
10060 * expression.cs (Invocation.Error_InvalidArguments): Handle
10061 __arglist parameters.
10062 (Invocation.VerifyArgumentsCompat): Likewise.
10063 * support.cs (ReflectionParameters.GetSignatureForError): Print
10064 __arglist parameters.
10065 (InternalParamters.GetSignatureForError): Likewise.
10066 * parameter.cs (Parameters.GetSignatureForError): Likewise.
10068 2005-10-26 Marek Safar <marek.safar@seznam.cz>
10070 * attribute.cs (GetPropertyValue): Made public.
10072 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
10074 Add new property WrapNonExceptionThrows to handle 2.0 assembly
10076 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
10079 * driver.cs: Reflect method name change.
10081 * statement.cs (Try.Resolve): Warn when try has both general
10082 exception handlers.
10084 * typemanager.cs: runtime_compatibility_attr_type new predefined
10087 2005-10-26 Raja R Harinath <harinath@gmail.com>
10090 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
10091 treat it as an empty parameter list.
10093 2005-10-26 Raja R Harinath <rharinath@novell.com>
10096 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
10097 ResolveAsTypeStep silent.
10098 * statement.cs (Block.AddConstant): Mark block as used.
10099 (Block.ResolveMeta): Avoid piling on error messages
10100 if a constant initializer resolution fails.
10102 2005-10-25 Raja R Harinath <rharinath@novell.com>
10104 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
10106 (NamespaceEntry.VerifyAllUsing): New.
10107 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
10108 behaviour. Delegates actual resolution of alias to ...
10109 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
10110 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
10112 * driver.cs (Driver.MainDriver): Update.
10114 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
10115 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
10117 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
10119 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
10120 RootNamespace.DefineNamespacesForAll.
10122 2005-10-24 Raja R Harinath <harinath@gmail.com>
10124 * typemanager.cs (assemblies, external_aliases, modules)
10125 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
10126 (ComputeNamespaces, GetRootNamespace): Remove extra staging
10127 overhead. Move resposibility ...
10128 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
10129 * driver.cs, attribute.cs, codegen.cs: Update to changes.
10131 2005-10-23 Raja R Harinath <harinath@gmail.com>
10133 * namespace.cs (RootNamespace.all_namespaces): Renamed from
10134 cached_namespaces. Improve usage.
10135 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
10136 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
10137 Move from GlobalRootNamespace and simplify.
10138 (RootNamespace.Global): Make instance variable.
10139 (RootNamespace.RootNamespace): Add "alias name" parameter.
10140 (GlobalRootNamespace): Simplify drastically.
10141 (Namespace.Lookup): Don't use GetNamespace.
10142 * typemanager.cs (GetRootNamespace): Rename from
10143 ComputeNamespaceForAlias.
10144 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
10146 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10148 * anonymous.cs (AnonymousContainer): Don't crash when container
10151 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10153 * expression.cs (Binary.DoResolve): Warn when comparing same
10156 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10159 * expression.cs (Binary.DoResolve): It looks like there are no
10160 convetsion rules in enum context.
10162 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10164 Add support for extern alias qualifiers.
10165 * typemanager.cs: Move some LookupTypeReflection code
10166 to namespace.cs, to have cleaner code. Added some methods
10167 to help us keep track of the extern aliased references.
10168 * driver.cs: Add suport for extern alias assemblies on command
10169 line and check for their warnings/errors. Also keep track of the
10170 extern aliased assemblies.
10171 * namespace.cs: Move the global functionality of Namespace
10172 to GlobalRootNamespace/RootNamespace. Now the global namespace
10173 is GlobalRootNamespace.Globa. Also the code moved from
10174 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
10175 Finally added LocalAliasEntry (AliasEntry before) and
10176 ExternAliasEntry, to handle alias statements.
10177 * cs-parser.jay: Add support in the grammar for extern alias
10179 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
10180 Update callings to Namespace (now in GlobalRootNamespace).
10182 2005-10-18 Raja R Harinath <rharinath@novell.com>
10185 * class.cs (TypeContainer.DefineType): Move updating of
10186 topological sort earlier in the code.
10187 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
10189 2005-10-18 Marek Safar <marek.safar@seznam.cz>
10192 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
10194 * constant.cs (Constant.TryReduce): Moved from Cast class.
10195 (Reduce): Made little bit more OO and fixed missing conversions.
10197 * ecore.cs (Reduce): Implemented.
10198 (Binary.EnumLiftUp): New method to upgrade values to enum values.
10200 * literal.cs (Reduce): Implemented.
10202 * class.cs: Reverted Miguel's wrong commit.
10204 2005-10-14 Miguel de Icaza <miguel@novell.com>
10206 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
10208 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
10210 * cs-parser.jay, expression.cs : CS0214 was missing error location
10211 for constants. Fixed bug #76404.
10213 2005-10-11 Marek Safar <marek.safar@seznam.cz>
10216 * convert.cs (ExplicitConversionCore): Fixed object->enum
10219 2005-10-10 Raja R Harinath <rharinath@novell.com>
10221 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
10222 InstanceExpression.
10223 (PropertyExpr.EmitCall): Likewise.
10224 * expression.cs (Invocation.EmitArguments): Handle case where
10226 (Invocation.EmitCall): Avoid allocating temporary variable if
10227 there are no arguments.
10229 2005-10-07 Raja R Harinath <rharinath@novell.com>
10232 * convert.cs (ImplicitConversionStandard): Move conversion of
10233 void* to arbitrary pointer types ...
10234 (ExplicitConversionStandard): .. here.
10235 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
10236 error to always print typenames.
10238 2005-10-07 Raja R Harinath <rharinath@novell.com>
10240 * convert.cs (GetConversionOperator): Rename from
10241 GetConversionOperators. Move operator selection code from ...
10242 (UserDefinedConversion): ... here.
10244 2005-10-06 Marek Safar <marek.safar@seznam.cz>
10246 * convert.cs (ExplicitConversionCore): Removed duplicate enum
10249 2005-10-05 Marek Safar <marek.safar@seznam.cz>
10251 * assign.cs (Assign.DoResolve): Error method changed.
10253 * cfold.cs (DoConstantNumericPromotions): Error method changed.
10255 * const.cs (ResolveValue): Reset in_transit immediately.
10257 * constant.cs: Error method changed.
10259 * convert.cs: Removed useless location parameter.
10260 (ExplicitNumericConversion): Don't do double enum check.
10261 (ExplicitConversionCore): Renamed from ExplicitConversion.
10262 (ExplicitUnsafe): Extracted from ExplicitConversion.
10263 (ExplicitConversion): Uses for error reporting.
10265 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
10267 (ResolveBoolean): Uses common error method.
10268 (CastToDecimal): Get rid of ec.
10269 (CastFromDecimal): Optimized.
10270 (ConvCast): Get rid of ec.
10272 * enum.cs (ResolveValue): Reset in_transit immediately.
10273 (Emit): Return after first error.
10275 * expression.cs: Convert changes.
10277 * literal.cs: Error method changed.
10279 * statement.cs: Error method changed.
10281 2005-10-03 Raja R Harinath <rharinath@novell.com>
10283 * support.cs (SeekableStreamReader.Position): Don't error out when
10284 the requested position is just beyond the end of the current
10287 2005-09-28 Raja R Harinath <rharinath@novell.com>
10289 * support.cs (SeekableStreamReader): Simplify drastically. Don't
10290 try to keep in sync with the byte count of the underlying Stream.
10291 However, this limits us to a window size of 2048 characters: i.e.,
10292 the maximum lookahead of our lexer/parser can be 2048 characters.
10294 2005-09-28 Marek Safar <marek.safar@seznam.cz>
10297 * driver.cs: Fix compilation files with full root path.
10299 2005-09-25 Miguel de Icaza <miguel@novell.com>
10301 * report.cs (SymbolRelatedToPreviousError): Format the output so
10302 it does not use an open parenthesis that is never closed.
10304 * driver.cs: Follow coding guidelines
10306 2005-09-27 Marek Safar <marek.safar@seznam.cz>
10309 * const.cs (Const.ResolveValue): Check for assigning non-null
10310 value to reference type.
10312 2005-09-27 Marek Safar <marek.safar@seznam.cz>
10314 * anonymous.cs: Implemented ExprClassName.
10316 * assign.cs (Assign.DoResolve): Don't chrash when type is not
10319 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
10322 * class.cs (StaticClass.DefineContainerMembers): Report protected
10325 * codegen.cs: if(ed) PRODUCTION.
10327 * convert.cs (Error_CannotImplicitConversion): Better error
10330 * cs-parser.jay: More error checks.
10332 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
10334 * driver.cs (CSCParseOption): Enabled wrong option check.
10336 * ecore.cs (Expression.ExprClassName): Turned to property.
10337 (MemberExpr.CheckIntermediateModification): For checking boxed
10338 value types modification.
10340 * statement.cs (Fixed.Resolve): Expression type must be
10341 convertible to fixed type.
10342 (CollectionForeach.GetEnumeratorFilter,TryType):
10343 Small refactoring for easier error checking.
10345 2005-09-26 Marek Safar <marek.safar@seznam.cz>
10347 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
10350 * class.cs (GeneratedBaseInitializer): New class for customization
10351 compiler generated initializers.
10352 (MemberBase.DoDefine): Check Obsolete attribute here.
10353 (FieldMember.DoDefine): Ditto.
10355 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
10358 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
10359 (MemberCore.GetObsoleteAttribute): Removed argument.
10360 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
10361 (MemberCore.CheckObsoleteType): New helper.
10365 * statement.cs: Updates after MemberCore changes.
10367 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
10368 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
10370 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
10371 obsolete attribute for compiler construct.
10372 (As.DoResolve): Cache result.
10374 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
10376 2005-09-26 Raja R Harinath <rharinath@novell.com>
10379 * expression.cs (This.VerifyFixed): In a value type T, the type of
10380 'this' is T&, iow, 'this' is either an out or ref parameter. In a
10381 value type R, 'this' is treated as a value parameter.
10383 2005-09-22 Miguel de Icaza <miguel@novell.com>
10385 * statement.cs (Lock): Use the TemporaryVariable class instead of
10386 manually using local variables as those do not work when variables
10389 * ecore.cs: Moved the TemporaryVariable class from being a nested
10390 class inside Foreach to be a public class that can be employed in
10393 2005-09-19 Marek Safar <marek.safar@seznam.cz>
10395 * cs-parser.jay: interface_accessors replaced by
10396 accessor_declarations.
10398 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
10401 * statement.cs (GotoCase.Resolve): Convert null constant to
10403 (SwitchLabel.ResolveAndReduce): Ditto.
10404 (SwitchLabel.NullStringCase): Custom null stamp.
10405 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
10407 typemanager.cs (CSharpSignature): Don't skip first argument
10410 2005-09-18 Miguel de Icaza <miguel@novell.com>
10412 * driver.cs: Set InEmacs based on the environment variable EMACS.
10414 * location.cs (InEmacs): in this mode, do not report column
10415 location as it confuses Emacs.
10417 2005-09-16 Marek Safar <marek.safar@seznam.cz>
10419 * cfold.cs, constant.cs, convert.cs, ecore.cs,
10420 expression.cs, iterators.cs, literal.cs: Store constants and
10423 * class.cs (MemberBase.ShortName): Pass location.
10425 * cs-parser.jay: Some location fixes.
10427 * ecore.cs (Expression.Location): Made virtual.
10429 2005-09-05 Miguel de Icaza <miguel@novell.com>
10431 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
10432 if the underlying types are the same, otherwise we need to produce
10433 code that will do the proper cast.
10435 This was exposed by Marek's constant rewrite which produced
10436 invalid code for the call site:
10438 enum X : long { a }
10439 void Method (X v) {}
10443 This fixes test-49.cs
10445 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
10447 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
10448 Type/Object should be allowed as well. Fixed bug #75968.
10450 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
10452 * expression.cs : (Binary.DoResolve): when one is enum constant and
10453 another is constant 0, then return enum one *as enum type*.
10456 2005-09-02 Raja R Harinath <rharinath@novell.com>
10458 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
10462 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
10463 flow-branching for LocalVariableReferences in case we were invoked
10464 from a MemberAccess.
10465 * expression.cs (LocalVariableReference.VerifyAssigned): New.
10467 (LocalVariableReference.DoResolveBase): ... this.
10468 (MemberAccess.Resolve): Do the check that was disabled during
10471 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
10474 (PartialContainer.Create): check abstract/sealed/static strictly
10475 but abstract/sealed can exist only at one side. Fixed bug #75883.
10477 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
10480 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
10481 specified, don't default to UnmanagedType.I4.
10483 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
10485 * expression.cs : conditional operator should check possibly
10486 incorrect assign expression. Fixed bug #75946.
10488 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
10490 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
10491 Reverting the change. gmcs is much complex than mcs on this matter.
10493 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
10495 * cs-tokenizer.cs : To read another token ahead of the actual
10496 consumption, use new SavedToken and cache token instead of moving
10497 back the stream with SeekableStreamReader (it seemed problematic).
10499 driver.cs : Thus use StreamReader directly.
10500 * support.cs : Thus removed SeekableStreamReader.
10502 2005-08-30 Raja R Harinath <rharinath@novell.com>
10505 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
10506 (ScopeInfo.EmitScopeType): Use it to construct field names from
10507 names of captured locals.
10510 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
10511 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
10512 Pass 'target_type' to BoxedCast. Don't default to 'object'.
10513 (ExplicitConversion): Remove enum cases already handled by
10514 implicit conversion. Move implicit conversion check to the beginning.
10515 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
10516 * expression.cs (ArrayCreation.EmitDynamicInitializers):
10517 Don't treat System.Enum as a struct.
10519 2005-08-30 Jb Evain <jbevain@gmail.com>
10521 * attribute.cs: handles as expression in parameters.
10523 2005-08-30 Raja R Harinath <rharinath@novell.com>
10526 * class.cs (TypeContainer.VerifyClsName): Don't use a
10527 PartialContainer when verifying CLS compliance.
10528 (AbstractPropertyEventMethod): Set Parent here, ...
10529 (PropertyMethod): ... not here.
10531 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
10533 * attribute.cs : escaped attribute name should not be allowed to be
10534 resolved (e.g. @class as classAttribute). Fixed bug #75930.
10536 2005-08-29 Raja R Harinath <rharinath@novell.com>
10539 * convert.cs (ImplicitStandardConversionExists): Allow zero also
10540 when converting a long constant to unsigned long.
10541 * expression.cs (Invocation.OverloadResolve): Add sanity check to
10542 detect where IsApplicable and VerifyArgumentsCompat disagree.
10544 2005-08-29 Raja R Harinath <rharinath@novell.com>
10545 and Carlos Alberto Cortez <carlos@unixmexico.org>
10548 * class.cs (TypeContainer.CanElideInitializer): New helper.
10549 (TypeContainer.EmitFieldInitializers): Use it to determine if we
10550 can safely emitting the initializer of a field.
10552 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10554 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
10555 allowed inside a switch (without loop). Fixed bug #75433.
10557 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
10559 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
10560 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
10562 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10564 * driver.cs : kinda reverting the default encoding changes (not exact
10565 revert since I noticed that "codepage:reset" might not work fine).
10567 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10569 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
10570 Location. Now getter and setter store location correctly.
10571 (errors/cs0111-12.cs now reports the expected location.)
10573 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10575 * driver.cs : Use default encoding on the environment.
10576 Removed (now that) extra parameter for SeekableStreamReader.
10577 * support.cs : (SeekableStreamReader) third .ctor() argument for
10578 StreamReader is not required (always true). preamble size could
10579 be acquired in simpler and safe way.
10581 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
10583 * cs-parser.jay: report CS0642 at warning level 3
10584 and report CS0642 for an if else statement also
10585 fixes bug #74745. Patch by John Luke (and a bit
10587 Removed extra CS0642 warning check for "while",
10589 * statement.cs: In Block.Resolve(), CS0642 check
10590 is reimplemented to check a sequence of an empty
10591 statement and a block.
10593 Both fix bug #66777.
10595 2005-08-24 Marek Safar <marek.safar@seznam.cz>
10597 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
10598 detection until I fix it.
10600 * cs-tokenizer.cs: Changed error message.
10602 * cs-parser.jay: Fixed 2 error locations.
10604 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
10605 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
10608 * enum.cs (GetSignatureForError): Fixed.
10610 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
10614 * typemanager.cs (RegisterProperty): Removed.
10616 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
10618 2005-08-24 Raja R Harinath <rharinath@novell.com>
10621 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
10622 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
10624 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10626 * expression.cs : tiny fix is required for not warning positive ulong.
10629 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10631 * expression.cs : add CS0652 check for constant and integral
10632 expression. Fixed bug #53974.
10634 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10636 * expression.cs : in DoNumericPromotions(), check if there is implicit
10637 conversion overload for string (to check CS0034). Fixed bug #52492.
10639 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10641 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
10643 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10645 * ecore.cs : report location when it is *not* Null.
10647 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10653 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
10654 correctly. Fixed bug #75721.
10656 2005-08-23 Raja R Harinath <rharinath@novell.com>
10658 * support.cs (SeekableStreamReader.Position): Avoid an expensive
10659 loop that performs 'min (pos, char_count)'.
10662 * expression.cs (Unary.ResolveOperator): Don't discard implicit
10663 converted value in Operator.OnesComplement.
10665 2005-08-22 Ben Maurer <bmaurer@ximian.com>
10667 * anonymous.cs: If the anon method is pulled into a helper class,
10668 it needs to be `internal' not `private'. Fixes runtime behavior on
10671 2005-08-20 Martin Baulig <martin@ximian.com>
10673 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10674 scope if we don't already have it.
10676 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
10677 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
10680 2005-08-17 Marek Safar <marek.safar@seznam.cz>
10683 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
10684 is a partial class.
10686 2005-08-16 Marek Safar <marek.safar@seznam.cz>
10688 The big constants rewrite
10689 Fix #75746, #75685 and more
10690 As a side effect saved 1MB for MWF ;-)
10692 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
10693 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
10694 enum based for corlib compilation.
10696 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
10699 * class.cs (FixedField.Define): Use ResolveAsConstant.
10701 * const.cs (IConstant): Interface constants and enums.
10702 (Const.ResolveValue): New method for constant resolvning.
10703 (ExternalConstant): Constants from imported assemblies.
10705 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
10706 conversion; like enums.
10707 (Constant.ToType): Converts this constant to different type.
10708 (Constant.Increment): Adds 1.
10710 * convert.cs (ImplicitConversionRequired): Simplified.
10712 * cs-parser.jay: Create EnumMember directly.
10714 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
10716 * doc.cs (GenerateEnumDocComment): Removed.
10718 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
10719 (ConvertIntLiteral): Removed.
10720 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
10722 * enum.cs (EnumMember): Implement IConstant.
10723 (Enum.IsValidEnumConstant): Removed.
10724 (Enum.GetNextDefaultValue): Removed.
10725 (Enum.FindMembers): Updated.
10726 (Enum.GenerateDocComment): Iterate enum members.
10728 * expression.cs (Cast.TryReduce): Handle enums correctly.
10729 (New.Constantify): Made public.
10730 (MemberAccess.DoResolve): Removed contant specific if(s).
10732 * literal.cs (NullLiteral): Implement new abstract methods.
10734 * statement.cs (GotoCase.Resolve): Use new constant methods.
10735 (SwitchLabel.ResolveAndReduce): Use new constant methods.
10737 * typemanager.cs (LookupEnum): Removed.
10738 (IsEnumType): Fixed to work with corlib.
10739 (RegisterConstant): Removed.
10740 (LookupConstant): Removed.
10741 (GetConstant): Changed to work with IConstant.
10743 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
10745 * location.cs : Fixed overflown (>255) column number.
10747 2005-08-03 Raja R Harinath <rharinath@novell.com>
10749 First cut of the qualified-alias-member feature.
10750 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
10752 * cs-parser.jay (DOUBLE_COLON): New token.
10753 (namespace_or_type_name): Add rule for recognizing
10754 qualified-alias-members.
10755 (primary_expression): Likewise.
10756 (element_access): Allow QualifiedAliasMember as a possible
10757 type-bearing expression.
10758 (local_variable_type, local_variable_pointer_type): Likewise.
10759 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
10760 aliases in the current and enclosing namespace declarations.
10761 (NamespaceEntry.UsingAlias): Add CS0440 warning.
10762 * decl.cs (MemberName.is_double_colon): New.
10763 (MemberName.MemberName): Add new constructor for alias-member.
10764 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
10765 * expression.cs (QualifiedAliasMember): New expression type.
10767 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10769 * location.cs : it borked when no argument was specified.
10771 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10773 * location.cs : tiny ToString() format fix.
10775 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10777 * statement.cs : oops, it was missing.
10779 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10781 A set of fixes for precise line/column location.
10784 "token" field now holds a file/line "delta", a line number offset
10785 from the segment, and a column number. See also:
10786 http://lists.ximian.com/pipermail/mono-devel-list/2004-
10787 December/009508.html
10788 Removed static IsNull. Use instance IsNull property instead.
10789 * cs-tokenizer.cs :
10790 For some tokens it stores Location. For Identifier it stores
10791 LocatedToken which is a pair of string name and location.
10792 Column numbers are adjusted only at getChar().
10794 Use Location.ToString() for reporting (it now contains column).
10796 Largely modified to use LocatedToken instead of
10797 string (IDENTIFIER), and to acquire Location from some tokens.
10798 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
10799 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
10801 Now MemberName holds Location. DeclSpace.ctor() receives Location
10802 as a parameter. Removed extra parameters to all derived classes.
10803 Replaced Location.IsNull() with instance property.
10804 * assign.cs, expression.cs :
10805 Added .ctor() overload that omits Location.
10807 Added "nameEscaped" flag that indicates the identifier was escaped
10808 in the source file. This fixes bug #57047.
10810 2005-08-02 Marek Safar <marek.safar@seznam.cz>
10812 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
10813 New method, looking for lo-case imported cls type.
10815 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
10818 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10820 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
10822 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
10823 all_imported_types.
10824 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
10826 Optimized to save 3.5 MB for SWF compilation.
10828 2005-08-01 Marek Safar <marek.safar@seznam.cz>
10830 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
10831 (PartialContainer.Create): Moved logic AddToContainer.
10832 (PartialContainer.MarkForDuplicationCheck): Shares name.
10834 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
10837 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
10839 (Namespace.GetSignatureForError): New method.
10841 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
10842 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
10844 2005-08-01 Raja R Harinath <rharinath@novell.com>
10847 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
10848 member lookup rather than qualifier_type, since qualifier_type can
10851 2005-08-01 Marek Safar <marek.safar@seznam.cz>
10853 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
10856 2005-07-31 Miguel de Icaza <miguel@novell.com>
10858 * statement.cs: Copy the local exception into the exception
10859 captured local. Fixes 75674
10861 2005-07-31 Raja R Harinath <harinath@gmail.com>
10864 * expression.cs (Invocation.OverloadResolve): Don't report error
10865 CS1501 if error CS1502 has been reported.
10866 (New.DoResolve): Delegate CS1501 reporting to
10867 Invocation.OverloadResolve.
10870 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
10871 invariant-meaning-in-block property in an enclosing block if
10874 2005-07-29 Marek Safar <marek.safar@seznam.cz>
10876 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
10877 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
10878 (Switch.CheckSwitch): Just save 50kb for SWF.
10880 2005-07-27 Martin Baulig <martin@ximian.com>
10882 * anonymous.cs (CaptureContext.AddField): Added
10883 `AnonymousContainer am' argument; compute its toplevel scope if
10884 it's not already computed. Fixes #75649.
10886 2005-07-26 Raja R Harinath <rharinath@novell.com>
10889 * class.cs (Constructor.Emit): Reset block to null if the block
10892 2005-07-25 Marek Safar <marek.safar@seznam.cz>
10894 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
10896 2005-07-25 Marek Safar <marek.safar@seznam.cz>
10898 * class.cs (MethodData.Define): Check whether accessor implementing
10899 interface is public.
10901 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
10903 2005-07-22 Marek Safar <marek.safar@seznam.cz>
10906 * namespace.cs (LookupType): Moved same type check to...
10908 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
10909 with the same name.
10911 2005-07-21 Raja R Harinath <rharinath@novell.com>
10913 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
10914 already found a typebuilder.
10915 * class.cs (MethodCore.IsDuplicateImplementation): Compare
10916 MemberNames, not strings.
10918 * const.cs (Error_ExpressionMustBeConst):
10919 Rename from Error_EpressionMustBeConst.
10920 * const.cs, class.cs, statement.cd: Update.
10922 2005-07-21 Marek Safar <marek.safar@seznam.cz>
10926 * const.cs (Const.LookupConstantValue): Report missing contant expression
10928 (Error_EpressionMustBeConstant): Only one error method.
10930 * class.cs, statement.c: Updated.
10932 2005-07-20 Raja R Harinath <rharinath@novell.com>
10934 * statement.cs (Block.Flags): Add back HasVarargs.
10935 (Block.flags): Make protected.
10936 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
10938 * typemanager.cs (types, typecontainers, user_types): Remove.
10939 (UserTypes, TypeContainers): Likewise.
10940 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
10941 (CleanUp, Reset): Update.
10942 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
10943 (GetNestedType): Use Type.GetNestedType.
10944 (CoreLookupType): Take two arguments, the namespace and the
10945 basename of the type. Update to use the Namespace.Lookup
10947 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
10948 (RealMemberLookup): Use IsNestedChildOf instead of playing with
10949 string concatenation and substring matches.
10950 * class.cs, enum.cs, delegate.cs: Update to changes.
10952 2005-07-20 Marek Safar <marek.safar@seznam.cz>
10954 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
10955 Expression and made virtual.
10957 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
10958 (ImplicitStandardConversionExists): Fixed `byte' typo ?
10960 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
10962 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
10965 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
10968 2005-07-18 Marek Safar <marek.safar@seznam.cz>
10971 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
10972 AssemblyCultureAttribute is not used on executable.
10975 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
10977 2005-07-16 Raja R Harinath <rharinath@novell.com>
10980 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
10981 New. Reports CS0252/CS0253.
10982 Mostly taken from preliminary patch by Duncak Mak.
10983 (Binary.DoResolveOperator): Store results of operator lookup.
10984 Use them to detect if we need to warn about unintended reference
10987 2005-07-15 Raja R Harinath <rharinath@novell.com>
10990 * namespace.cs (Namespace.Lookup): Add back location parameter.
10991 (Namespace.LookupType): Add CS0436 report. Add location parameter.
10992 * delegate.cs, ecore.cs, expression.cs: Update to changes.
10994 * codegen.cs (EmitContext.DeclSpace): Make readonly.
10995 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
10996 (Namespace.LookupType): ... this.
10997 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
10999 * typemanager.cs (LookupTypeReflection): Remove buggy code that
11000 purported to handle pointers.
11001 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
11004 2005-07-15 Marek Safar <marek.safar@seznam.cz>
11006 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
11009 2005-07-15 Raja R Harinath <rharinath@novell.com>
11011 * namespace.cs (Namespace.Lookup): Drop location parameter.
11012 (NamespaceEntry.LookupAlias): Remove. Merge into ...
11013 (NamespaceEntry.Lookup): ... this.
11014 (NamespaceEntry.Error_AmbiguousTypeReference):
11015 Move here from DeclSpace.
11016 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
11018 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
11019 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
11020 Move to NamespaceEntry.
11021 * delegate.cs, expression.cs: Update to changes.
11023 2005-07-14 Marek Safar <marek.safar@seznam.cz>
11025 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
11026 CheckAttributeType and refactored.
11027 (Attribute.ResolvePossibleAttributeType): Changed to reuse
11028 ResolveAsTypeTerminal error handling.
11029 (ResolveAsTypeTerminal): Introduced because of global attributes extra
11031 (GetSignatureForError): Print errors in same way.
11034 * codegen.cs: Reflect attribute GetSignatureForError change.
11037 * expression.cs: Add silent parameter to ResolveAsTypeStep.
11039 * namespace.cs (UsingEntry): Refactored to make fields private.
11042 statement.cs: Error_UnexpectedKind has extra parameter.
11044 2005-07-14 Raja R Harinath <rharinath@novell.com>
11046 * ecore.cs (IAlias): Remove.
11047 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
11048 that implement the interface.
11049 * namespace.cs (Namespace): Likewise.
11050 (Namespace.declspaces): Renamed from 'defined_names'.
11051 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
11052 DeclSpace instead of an IAlias.
11053 * tree.cs (Tree.AddDecl): Update.
11055 2005-07-12 Raja R Harinath <rharinath@novell.com>
11057 * statement.cs (Block.Flags); Remove HasVarargs.
11058 (Block.HasVarargs): Move to ToplevelBlock.
11059 (Block.ThisVariable, Block.AddThisVariable): Likewise.
11060 (Block.Variables): Make protected. Initialize variable hashtable
11062 (Block.AddVariable): Update.
11063 (Block.Resolve): Update to changes.
11064 (ToplevelBlock.HasVarargs): New boolean.
11065 (ToplevelBlock.ThisVariable): Move here from Block.
11066 (ToplevelBlock.AddThisVariable): Likewise.
11067 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
11068 * expression.cs (This.ResolveBase): Update to changes.
11069 (ArglistAccess.DoResolve): Likewise.
11071 2005-07-11 Marek Safar <marek.safar@seznam.cz>
11074 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
11076 * class.cs (TypeContainer.VerifyMembers): Distinguish between
11077 not used and not used & assigned.
11078 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
11080 2005-07-11 Marek Safar <marek.safar@seznam.cz>
11083 * expression.cs (Is.DoResolve): null is never provided type.
11085 2005-07-08 Marek Safar <marek.safar@seznam.cz>
11088 * cs-parser.jay: Less strict event error rule to catch more errors.
11090 2005-07-08 Martin Baulig <martin@ximian.com>
11092 Fix test-iter-10.cs - distinguish whether we `yield' in a property
11093 gettter (allowed) or setter (not allowed).
11095 * class.cs (Accessor): Implement IIteratorContainer.
11096 (Accessor.Yields): New public field.
11097 (PropertyBase.PropertyMethod.Define): Handle iterators on a
11098 per-accessor basis.
11101 (get_accessor_declaration, set_accessor_declaration): Set the
11102 `yields' flag on the accessor, not the property.
11103 (property_declaration): Do the iterators check on a per-accessor
11104 basis and not for the whole property.
11106 2005-07-08 Martin Baulig <martin@ximian.com>
11108 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
11109 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
11111 2005-07-07 Marek Safar <marek.safar@seznam.cz>
11114 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
11115 (ExtractSecurityPermissionSet): Cope with self referencing security
11116 attributes properly.
11118 * driver.cs (SetOutputFile): Made public property OutputFile.
11120 2005-07-07 Raja R Harinath <rharinath@novell.com>
11123 * class.cs (TypeContainer.first_nonstatic_field): Rename from
11124 has_nonstatic_fields. Make into a FieldBase pointer.
11125 (TypeContainer.AddField): Add CS0282 check.
11126 (TypeContainer.EmitType): Update.
11128 2005-07-06 Miguel de Icaza <miguel@novell.com>
11130 * cs-tokenizer.cs (consume_identifier): Do not create strings to
11131 compare if they start with __.
11133 2005-07-06 Raja R Harinath <rharinath@novell.com>
11135 * statement.cs (Switch.SwitchGoverningType): Only look at
11136 UserCasts that don't need implicit standard conversions to one of
11137 the allowed switch types (Fixes test-322.cs).
11138 (LocalInfo.Resolve): Re-enable sanity-test.
11140 2005-07-06 Marek Safar <marek.safar@seznam.cz>
11142 * cs-tokenizer.cs (consume_identifier): Detect double undescores
11144 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
11146 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
11148 2005-07-06 Raja R Harinath <rharinath@novell.com>
11151 * ecore.cs (SimpleName.GetSignatureForError): Add.
11152 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
11153 (MemberAccess.GetSignatureForError): Add.
11155 2005-07-05 Marek Safar <marek.safar@seznam.cz>
11157 The big error and warning messages review.
11187 * typemanager.cs: Updated.
11189 * class.cs: (MethodCore.SetYields): Moved here to share.
11190 (PropertyMethod.Define): Moved iterator setup here.
11192 * iterators.cs: Add orig_method to have full access to parent
11195 2005-07-05 Raja R Harinath <rharinath@novell.com>
11197 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
11198 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
11199 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
11200 variable of struct type.
11201 * expression.cs (Unary.ResolveOperator): Update to change.
11202 (Indirection.VerifyFixed): Likewise.
11203 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
11204 (ParameterReference.VerifyFixed): Value parameters are fixed.
11205 (This.VerifyFixed): Treat 'this' as a value parameter.
11206 * statement.cs (LocalInfo.IsFixed): Remove.
11208 2005-07-01 Martin Baulig <martin@ximian.com>
11210 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
11211 `ec.EmitThis ()' to get the correct scope.
11213 2005-07-01 Martin Baulig <martin@ximian.com>
11215 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
11216 instance is a ParameterReference; fixes #75299.
11218 2005-07-01 Martin Baulig <martin@ximian.com>
11220 Reverted Marek's latest patch (r46725):
11221 - it contains structural changes which are neither mentioned in
11222 the ChangeLog nor explained anywhere; for example the additional
11223 argument of EmitContext's and Iterator's .ctor's and the
11224 TypeContainer.DefineMembers() change.
11225 - structural changes like this should go in in seperate patches
11226 and not be hidden in a huge patch which just seems to affect
11227 warnings and errors.
11228 a big and hard to understand patch.
11229 - it breaks iterators and causes regressions, for instance in
11232 2005-06-30 Raja R Harinath <rharinath@novell.com>
11235 * expression.cs (Indexers.map): Remove.
11236 (Indexers.Append): Filter out inaccessible setters and getters.
11237 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
11240 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
11241 Refactored from ...
11242 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
11243 (FieldExpr.Emit, PropertyExpr.Emit): Update.
11244 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
11245 * expression.cs (Invocation.EmitCall): Add CS0120 check.
11247 2005-06-30 Marek Safar <marek.safar@seznam.cz>
11250 * class.cs (FieldBase.GetInitializerExpression): One more field
11253 2005-06-28 Miguel de Icaza <miguel@novell.com>
11255 * pending.cs: Do not define a proxy if the base method is virtual,
11256 it will be picked up by the runtime (bug 75270).
11258 2005-06-08 Martin Baulig <martin@ximian.com>
11260 The big Iterators rewrite :-)
11262 * iterators.cs: Rewrite this to use the anonymous methods framework.
11264 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
11265 before the TypeContainers; see 2test-21.cs.
11268 (TypeContainer.DefineType): Don't create a new EmitContext if we
11269 already have one (this only happens if we're an Iterator).
11270 (TypeContainer.Define): Also call Define() on all our iterators.
11271 (Method.CreateEmitContext): Added support for iterators.
11274 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
11275 (AnonymousContainer.CreateMethodHost): Moved here from
11276 AnonymousMethod and made abstract.
11277 (AnonymousContainer.CreateScopeType): New abstract method.
11278 (AnonymousContainer.IsIterator): New public property.
11279 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
11280 get the ScopeTypeBuilder rather than manually defining it here.
11281 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
11284 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
11285 before RootContext.DefineTypes().
11287 * codegen.cs (EmitContext.RemapToProxy): Removed.
11288 (EmitContext.CurrentAnonymousMethod): Changed type from
11289 AnonymousMethod -> AnonymousContainer.
11290 (EmitContext.ResolveTopBlock): Protect from being called twice.
11291 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
11292 (EmitContext.EmitThis): Removed the iterators hacks; use the
11293 anonymous methods framework for that.
11296 (ToplevelBlock.Container): Make this a property, not a field.
11297 (ToplevelBlock.ReParent): New public method; move the
11298 ToplevelBlock into a new container.
11299 (Foreach.TemporaryVariable): Simplify.
11301 2005-06-05 Martin Baulig <martin@ximian.com>
11303 * statement.cs (LocalInfo.CompilerGenerated): New flag.
11304 (Block.AddTemporaryVariable): New public method; creates a new
11305 `LocalInfo' for a temporary variable.
11306 (Block.EmitMeta): Create the LocalBuilders for all the temporary
11308 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
11309 non-iterator variables.
11311 2005-06-05 Martin Baulig <martin@ximian.com>
11313 * statement.cs (Foreach.TemporaryVariable): Create the
11314 LocalBuilder in the Emit phase and not in Resolve since in some
11315 situations, we don't have an ILGenerator during Resolve; see
11316 2test-19.cs for an example.
11318 2005-06-04 Martin Baulig <martin@ximian.com>
11320 **** Merged r45395 from GCS ****
11322 The big Foreach rewrite - Part II.
11324 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
11325 with `PropertyInfo ienumerator_getcurrent'.
11327 * codegen.cs (VariableStorage): Removed.
11330 (Foreach): Derive from Statement, not ExceptionStatement.
11331 (Foreach.CollectionForeach): New nested class. Moved all the code
11332 dealing with collection foreach here.
11333 (Foreach.ForeachHelperMethods): Removed.
11334 (Foreach.TemporaryVariable): Implement IMemoryLocation.
11336 2005-05-23 Martin Baulig <martin@ximian.com>
11338 * statement.cs (Try.DoResolve): Don't create a `finally' if we
11339 don't need to. Fix #75014.
11341 2005-05-20 Martin Baulig <martin@ximian.com>
11343 Merged r44808 from GMCS.
11345 * class.cs (TypeContainer.CircularDepException): Removed.
11346 (TypeContainer.DefineType): Removed the `InTransit' stuff.
11347 (TypeContainer.CheckRecursiveDefinition): Check for circular class
11348 (CS0146) and interface (CS0529) dependencies here.
11350 2005-06-21 Raja R Harinath <rharinath@novell.com>
11352 * expression.cs (Invocation.EmitCall): Fix initialization
11353 'this_call' to reflect current behaviour. Fix indentation.
11355 * convert.cs (FindMostEncompassedType): Add two trivial special
11356 cases (number_of_types == 0 || number_of_types == 1).
11357 (FindMostEncompasingType): Likewise.
11359 2005-06-17 Raja R Harinath <rharinath@novell.com>
11361 Some cleanups preparing for the fix of #75283.
11362 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
11364 (EventExpr.InstanceResolve): Likewise.
11365 (EventExpr.DoResolve): Remove redundant checks.
11367 2005-06-10 Duncan Mak <duncan@novell.com>
11369 * cs-tokenizer.cs (process_directives): New flag for controlling
11370 the processing of preprocessor directives.
11371 (x_token): After seeing a '#', return Token.NONE instead of going
11372 to handle_preprocessing_directive() when not processing
11373 directives. This avoids unnecessary processing during the token peek in
11378 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
11379 the existing error reporting methods instead of Report.Error.
11381 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
11382 after Raja's rewrite.
11384 2005-06-08 Miguel de Icaza <miguel@novell.com>
11386 * class.cs: Small fix.
11388 2005-06-08 Raja R Harinath <rharinath@novell.com>
11391 * class.cs (GetPartialBases): Fix return value check of
11392 part.GetClassBases.
11394 2005-06-07 Raja R Harinath <rharinath@novell.com>
11396 Ensure that partial classes are registered in their enclosing
11397 namespace. Initial part of fix of #75160.
11398 * tree.cs (Tree.RecordDecl): Add new namespace argument.
11399 Register declspace with namespace here, not in
11400 DeclSpace.RecordDecl.
11401 * cs-parser.jay: Pass namespace to RecordDecl.
11402 * class.cs (PartialContainer.Create): Likewise.
11403 (ClassPart.DefineType): New sanity-check. Throws an exception if
11405 * decl.cs (Declspace.RecordDecl): Remove.
11406 * namespace.cs (NamespaceEntry.DefineName): Remove.
11408 2005-06-06 Marek Safar <marek.safar@seznam.cz>
11410 * rootcontext.cs: Reset TargetExt as well.
11412 2005-06-03 Raja R Harinath <rharinath@novell.com>
11414 * ecore.cs (Expression.Resolve): Emit CS0654 error when
11415 -langversion:ISO-1.
11417 2005-06-02 Raja R Harinath <rharinath@novell.com>
11419 Fix #75080, cs0119.cs.
11420 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
11422 (Expression.Resolve): ... this. Use it. Remove bogus code
11423 allowing ExprClass.Type and ExprClass.Namespace for
11424 ResolveFlags.VariableOrValue.
11425 (Expression.Resolve) [1-argument variant]: Change default resolve
11426 flags based on language version.
11427 (Expression.Error_UnexpectedKind): Use a simple string array
11428 rather than an ArrayList.
11429 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
11430 not ExprClass.Type.
11431 (TypeOfVoid.DoResolve): Likewise.
11432 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
11433 flags argument -- it always has the same value.
11435 2005-05-31 Raja R Harinath <rharinath@novell.com>
11438 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
11439 Use it in the error message.
11440 * assign.cs, expression.cs, statement.cs: Update.
11442 2005-05-30 Raja R Harinath <rharinath@novell.com>
11445 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
11446 the "almostMatchedMember" case too.
11447 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
11448 that failed the accessibility checks to 'almost_match'.
11450 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
11452 * attribute.cs: Use internal MethodBuilder methods to set
11453 ExactSpelling and SetLastError on PInvoke methods, instead
11454 of passing them via charset. Fixes #75060.
11456 2005-05-27 Raja R Harinath <rharinath@novell.com>
11458 * parameter.cs (Parameter): Remove TODO comment.
11459 (Parameter.DefineParameter): Remove Location parameter.
11460 (Parameters.LabelParameters): Likewise.
11461 * class.cs (Constructor.Emit): Update to change.
11462 (MethodData.Emit): Likewise.
11463 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
11464 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
11466 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
11469 Removed Parameters.Location and added Parameter.Location instead.
11470 Removed Location parameter from Emit() and GetSignature().
11477 Modified all related calls.
11479 2005-05-26 Raja R Harinath <rharinath@novell.com>
11481 Improve user-defined conversion handling.
11482 * convert.cs (GetConversionOperators): Rewrite. Return only the
11483 applicable operators.
11484 (AddConversionOperators): New. Helper for GetConversionOperators.
11485 (FindMostEncompassedType, FindMostEncompassingType): Verify that
11486 there is only one most encompassed/encompassing type.
11487 (FindMostSpecificSource, FindMostSpecificTarget): Remove
11488 "applicable operator" handling.
11489 (UserConversion): Move cache here from GetConversionOperators.
11490 Directly cache the chosen operator, rather than the whole
11492 (ExplicitNumericConversion): Fix buggy implementation of Decimal
11493 case. Allow conversion of decimal to sbyte and byte too.
11494 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
11495 New static methods. Used to avoid allocating EmptyExpressions in
11498 2005-05-24 Duncan Mak <duncan@novell.com>
11500 * ecore.cs (CastFromDecimal): New class for casting a decimal to
11501 another class, used in Convert.ExplicitNumericConversion.
11502 (CastToDecimal): New class, similar to above, but casts to
11503 System.Decimal, used in Convert.ImplicitNumericConversion and also
11504 in explicit convesion from double/float to decimal.
11506 * convert.cs (ImplicitNumericConversion): Handle implicit
11507 conversions to System.Decimal.
11508 (ExplicitNumericConversion): handle explicit conversions to
11513 2005-05-20 Miguel de Icaza <miguel@novell.com>
11515 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
11516 know the type at this stage, just break through. Fixes #75008
11518 2005-05-19 Martin Baulig <martin@ximian.com>
11521 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
11522 to disable error reporting.
11524 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
11525 here since we don't want to report an error; see the new test-336.cs.
11527 2005-05-19 Raja R Harinath <rharinath@novell.com>
11529 * statement.cs (ToplevelBlock.GetParameterReference)
11530 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
11531 Move here from class Block.
11532 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
11533 * expression.cs (ParameterReference.DoResolveBase): Likewise.
11535 2005-05-18 Martin Baulig <martin@ximian.com>
11540 (FlowBranching.Reachability): Add non-static public And() and Or()
11542 (FlowBranchingSwitch): New class; do the `break_origins' thing
11543 like in FlowBranchingLoop.
11544 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
11545 reachability, not just locals and parameters.
11546 (FlowBranching.MergeChild): Remove some of the hacks for loop and
11547 switch; MergeBreakOrigins() now takes care of that.
11549 2005-05-18 Martin Baulig <martin@ximian.com>
11551 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11552 a loop and may leave it, reset the barrier; fixes #74974.
11554 2005-05-17 Marek Safar <marek.safar@seznam.cz>
11556 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
11559 * cs-parser.jay: Catch more lexical errors.
11561 * report.cs: Add one more Error method.
11564 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
11566 2005-05-17 Martin Baulig <martin@ximian.com>
11568 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
11571 2005-05-16 Raja R Harinath <rharinath@novell.com>
11573 Fix test-382.cs. Emit values of decimal constants.
11574 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
11576 (TypeContainer.AddField): ... this.
11577 (TypeContainer.EmitFieldInitializers): Allow the list of fields
11578 with initializers to include 'Const's.
11579 (ClassPart.RegisterFieldForInitialization): Forward to
11581 * const.cs (Const.Const): Pass initializer to base class.
11582 (Const.Define): In case of decimal constants, register them for
11583 initialization in a static constructor.
11585 2005-05-14 Martin Baulig <martin@ximian.com>
11587 * statement.cs (Block.Resolve): Correctly handle unreachable code;
11588 do not call ResolveUnreachable() on unreachable statements in
11589 here, see the comment in the source code.
11591 2005-05-13 Raja R Harinath <rharinath@novell.com>
11594 * expression.cs (BinaryResolveOperator): If one of the operands of
11595 an equality comparison is 'null' and the other is a pointer type,
11596 convert the null to a NullPointer.
11597 * convert.cs (ImplicitReferenceConversion): If the expression is a
11598 NullLiteral and the target type is a pointer type, return a
11599 NullPointer instead.
11600 (ImplicitConversionStandard): Likewise.
11602 2005-05-13 Marek Safar <marek.safar@seznam.cz>
11604 * cs-parser.jay: Set readonly context based on special constructs.
11606 * expression.cs (LocalVariableReference.DoResolveBase): Improved
11607 readonly variable error handling.
11609 * rootcontext.cs (EmitCode): Don't verify members when error
11612 * statement.cs (LocalInfo): Add reaodnly context information.
11613 (SetReadOnlyContext, GetReadOnlyContext): New methods.
11615 2005-05-13 Raja R Harinath <rharinath@novell.com>
11617 * statement.cs (Block.Resolve): Revert change below. Modify fix
11618 for #74041 to initialize 'resolved' to false only for explicit
11619 blocks. Fixes #74873.
11621 2005-05-12 Raja R Harinath <harinath@gmail.com>
11624 * typemanager.cs (unmanaged_enclosing_types): New.
11625 (IsUnmanagedType): Avoid infloops by using
11626 'unmanaged_enclosing_types' to talk with recursive invocations.
11628 2005-05-13 Martin Baulig <martin@ximian.com>
11630 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
11631 instance variable, not a local. Fix #74873.
11632 (Block.ResolveUnreachable): Set it to true here.
11634 2005-05-11 Duncan Mak <duncan@novell.com>
11636 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
11637 continuing to process for 'arg'.
11638 (handle_preprocessing_directive): Check the argument of the #endif
11639 directive and report error CS1025 if there are any trailing
11642 According to the C# spec, having even whitespace after the #endif
11643 directive is illegal; however, because we call arg.TrimEnd ()
11644 beforehand, we have the same behavior as csc, allowing whitespace
11645 after the directive.
11649 2005-05-11 Marek Safar <marek.safar@seznam.cz>
11653 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
11654 (Constructor.GetObsoleteAttribute): Implemented correctly.
11656 2005-05-10 Martin Baulig <martin@ximian.com>
11658 * support.cs (ReflectionParameters.ParameterModifier): Use
11659 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
11660 and `ParameterAttributes.In'. Fixes #74884.
11662 2005-05-10 Marek Safar <marek.safar@seznam.cz>
11664 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
11666 * expression.cs (Argument.GetParameterModifier): Turned to property.
11667 (Invocation.Error_InvalidArguments): Add more descriptive errors.
11669 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
11672 2005-05-09 Raja R Harinath <rharinath@novell.com>
11675 * decl.cs (MemberCache.AddMethods): Register override methods,
11676 rather than non-override methods.
11677 * typemanager.cs (RegisterOverride): New.
11678 (IsOverride): Update.
11680 2005-05-09 Marek Safar <marek.safar@seznam.cz>
11684 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
11685 recursive declaration.
11687 * statement.cs (Block.ResolveMeta): Report any error in resolving.
11689 2005-05-06 Marek Safar <marek.safar@seznam.cz>
11691 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
11693 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
11695 2005-05-05 Raja R Harinath <rharinath@novell.com>
11698 * decl.cs (DeclSpace.FamilyAccessible):
11699 Use TypeManager.IsNestedFamilyAccessible.
11701 Fix reopened #64812.
11702 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
11705 2005-05-04 Raja R Harinath <rharinath@novell.com>
11706 Abin Thomas <projectmonokochi@rediffmail.com>
11707 Anoob V E <projectmonokochi@rediffmail.com>
11708 Harilal P R <projectmonokochi@rediffmail.com>
11711 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
11712 allow access to all static members.
11714 2005-05-04 Martin Baulig <martin@ximian.com>
11716 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
11718 2005-05-04 Martin Baulig <martin@ximian.com>
11722 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
11723 section at the end; make things work if `default' is not the last
11726 2005-05-04 Martin Baulig <martin@ximian.com>
11730 * statement.cs (Switch): Replaced the `got_default' field with a
11731 `default_section' one.
11732 (Switch.CheckSwitch): Set `default_section' here.
11733 (Switch.Resolve): If we're a constant switch and the constant is
11734 not found, use the default section.
11736 2005-05-03 Martin Baulig <martin@ximian.com>
11738 * expression.cs (ArrayAccess.EmitGetLength): New public method.
11740 * statement.cs (Foreach.ArrayForeach): New nested class.
11741 (Foreach.TemporaryVariable): New nested class.
11742 (Foreach.EmitArrayForeach): Removed; this is now in the new
11743 ArrayForeach class.
11745 2005-05-03 Raja R Harinath <rharinath@novell.com>
11747 * pending.cs (BaseImplements): Move the #74773 fix here. This is
11749 (VerifyPendingMethods): Revert change below.
11751 * typemanager.cs (IsOverride, RegisterNonOverride): New.
11752 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
11753 that used to trigger warning -28. Remove warning -28.
11754 * expression.cs (Invocation.OverloadResolve): Use
11755 TypeManager.IsOverride to distinguish override methods.
11758 * pending.cs (VerifyPendingMethods): If a base type implements the
11759 requested interface, don't bother checking individual methods of
11760 the base type. As a side-effect, this prevents the creation of
11761 unnecessary proxies.
11763 2005-05-02 Martin Baulig <martin@ximian.com>
11767 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11768 Also `And' the locals if the old vector is null.
11769 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
11770 null; in this case we basically reset all the variables.
11772 2005-05-02 Martin Baulig <martin@ximian.com>
11776 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
11777 Added `FlowBranching branching' argument; always `and' the
11778 variables instead of `or'ing them unless we're an infinite loop.
11780 * statement.cs (While.Resolve): Create a new sibling unless we're
11783 2005-05-02 Martin Baulig <martin@ximian.com>
11787 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
11788 arguments; use it instead of creating a new TopLevelBlock.
11789 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
11790 our ConstructorInitializer.
11793 (TopLevelBlock.TopLevelBranching): New public property.
11794 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
11795 and create our `TopLevelBranching'.
11797 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
11798 anonymous method host, use `block.TopLevelBranching' rather than
11799 creating a new branching.
11801 2005-04-20 Miguel de Icaza <miguel@novell.com>
11803 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
11804 a ScopeInfo, if any of the current children is a child of the new
11805 entry, move those children there.
11807 2005-04-30 Martin Baulig <martin@ximian.com>
11809 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
11810 at the beginning of a SwitchSection. Fix #73335.
11812 2005-04-27 Marek Safar <marek.safar@seznam.cz>
11815 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
11817 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
11818 (FieldExpr.DoResolve): Obsolete members are ignored for field
11821 2005-04-26 Marek Safar <marek.safar@seznam.cz>
11823 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
11824 of arrays detection.
11826 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
11828 (Field.VerifyClsCompliance): Volatile fields are not compliant.
11830 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
11833 2005-04-25 Ben Maurer <bmaurer@ximian.com>
11835 * cs-parser.jay: Use the prefered version of -unsafe in error
11838 2005-04-22 Marek Safar <marek.safar@seznam.cz>
11840 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
11843 2005-04-20 John Luke <john.luke@gmail.com>
11845 * driver.cs: fix typo in error message, --outout to --output
11847 2005-04-20 Marek Safar <marek.safar@seznam.cz>
11849 * codegen.cs (InRefOutArgumentResolving): New field.
11851 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
11852 fields outside contructor.
11854 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
11856 2005-04-19 Miguel de Icaza <miguel@novell.com>
11858 * anonymous.cs (CaptureContext.EmitParameterInstance): The
11859 parameter code was not completed ever, so it was not as up-to-date
11860 as local variables. Must finish it.
11862 The bug fix was to compare the Toplevel of the block, not the
11863 current block. Thanks for Ben for pointing this out.
11865 2005-04-19 Raja R Harinath <rharinath@novell.com>
11867 * decl.cs (AddMethods): Use the declaring type of the problem
11868 method to determine if we want to squash a warning.
11870 2005-04-19 Marek Safar <marek.safar@seznam.cz>
11872 * attribute.cs: Removed debug output.
11874 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
11876 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
11879 2005-04-18 Raja R Harinath <rharinath@novell.com>
11882 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
11883 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
11884 all null comparisons against reference types.
11886 2005-04-18 Marek Safar <marek.safar@seznam.cz>
11889 * class.cs (TypeContainer.CircularDepException) New nested
11891 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
11892 (TypeContainer.DefineType): Removed error, reset InTransit before
11894 (Class.DefineType): Throw exception when is in Transit.
11895 Catch exception and report error.
11896 (Struct.DefineType): Throw exception when is in Transit.
11897 Catch exception and report error.
11898 (Interface.DefineType): Throw exception when is in Transit.
11899 Catch exception and report error.
11901 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
11902 handle nested exception handlers.
11904 * flowanalysis.cs (InTryWithCatch): New method, search for try with
11907 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
11908 InFinally and InCatch storage.
11910 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
11911 (Catch.Resolve): Set and Restore ec.InCatch.
11912 (Try.Resolve): Set and Restore ec.InFinally.
11913 (Try.HasCatch): True when try has catch.
11915 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
11917 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
11918 for the same event member, so exclude such cases from warning 419.
11921 2005-04-16 Miguel de Icaza <miguel@novell.com>
11923 * expression.cs (Binary.ResolveOperator): Apply patch from John
11924 Luke to fix bug 59864: operators &, | and ^ on enumerations
11925 require that the same enum type on both sides.
11927 * driver.cs: Add warnings to old flag usage, this is to assist
11928 people who produce Makefiles and hope that the Makefiles will be
11931 * class.cs (TypeContainer.EmitType): Moved the definition of the
11932 special $PRIVATE$ field from the resolve phase to the Emit phase.
11933 During resolve we do not know if we are a struct with
11934 HasExplicitLayout, we know this only after the attributes for the
11937 Set the FieldOffset to zero on the dummy field that we create for
11938 the class. Fixes 74590.
11940 2005-04-16 Raja R Harinath <rharinath@novell.com>
11943 * ecore.cs (PropertyExpr.resolved): New.
11944 (DoResolve): Use it to handle a case of double resolution here.
11945 Handle a case of identical-name-and-type-name.
11946 * expression.cs (ArrayCreation.CheckIndices): Avoid double
11947 resolution by storing the results of expression resolution back
11948 into the "probes" array.
11950 2005-04-15 Raja R Harinath <rharinath@novell.com>
11952 Fix cs0208-7.cs and cs0208-8.cs.
11953 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
11954 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
11955 error reporting to point out the reason a struct is not unmanaged.
11957 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11959 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
11960 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
11962 2005-04-13 Raja R Harinath <rharinath@novell.com>
11965 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
11966 IdenticalNameAndTypeName here.
11967 (EventExpr.InstanceResolve): Likewise.
11969 2005-04-13 Marek Safar <marek.safar@seznam.cz>
11971 C# 2.0 DefaultCharSetAttribute implementation
11973 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
11974 which allows us to set GlobalNamespace for every resolve.
11975 (Attribute.ResolveArguments): Cut from Resolve.
11976 (Attribute.GetCharSetValue): Returns CharSet named argument.
11977 (Attribute.DefinePInvokeMethod): Gets default charset from
11979 (GlobalAttribute.ResolveAsTypeStep): Override.
11980 (GlobalAttribute.ResolveArguments): Override.
11982 * class.cs (TypeAttr): Is protected.
11984 * codegen.cs (ModuleClass.DefaultCharSet): New member.
11985 (ModuleClass.DefaultCharSetType): New memeber.
11986 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
11988 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
11989 charset from module.
11991 * delegate.cs (TypeAttr): Override.
11992 (Delegate.DefineType): Use this TypeAttr.
11994 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
11995 at very early stage (before types are defined) to resolve model
11996 module attributes. It will probably not work with corlib but it
11999 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
12000 charset from module.
12002 * typemanager.cs (default_charset_type): New type.
12004 2005-04-13 Raja R Harinath <rharinath@novell.com>
12006 * decl.cs (MemberCache.AddMethods): Don't warn if
12007 System.Object.Finalize has buggy MethodAttributes.
12009 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
12012 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12014 * doc.cs : detect ambiguous reference to overloaded members.
12015 Fixed bug #71603. MS 1.1 csc does not detect it.
12017 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
12019 * doc.cs : delegates must not be referenced with parameters.
12022 2005-04-12 Miguel de Icaza <miguel@novell.com>
12024 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
12026 2005-04-10 Miguel de Icaza <miguel@novell.com>
12028 * driver.cs (MainDriver): Stop processing if the CLS stage found
12031 (CompilerCallableEntryPoint.InvokeCompiler): Always
12032 reset after execution; Take a TextWriter argument for the
12035 * report.cs: Use the error stream instead of hardcoding stderr.
12037 2005-04-09 Miguel de Icaza <miguel@novell.com>
12039 * class.cs: Reduce code paths to test, too small of an
12040 optimization to make it worth the extra testing. Always perform
12043 2005-04-08 Raja R Harinath <rharinath@novell.com>
12046 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
12047 operators that had errors reported on them.
12049 2005-04-08 Marek Safar <marek.safar@seznam.cz>
12051 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
12053 (Attribute.Resolve): Add named argument type checking.
12055 * class.cs (FixedField.Define): Use IsPrimitiveType
12057 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
12059 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
12060 unsafe parameter types.
12062 * statement.cs (Using.ResolveExpression): Add better error description.
12064 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
12066 2005-04-08 Raja R Harinath <rharinath@novell.com>
12069 * attribute.cs (Attribute.GetAttributeUsage): Resolve
12070 AttributeUsageAttribute in the emitcontext of the attribute class,
12071 not in the emitcontext of the attributable entity it was attached to.
12072 * cs-parser.jay: Use 'current_class', not 'current_container',
12073 when creating a GlobalAttribute.
12075 2005-04-08 Alp Toker <alp@atoker.com>
12077 * pending.cs: The fix to #58413 failed to compile methods implementing
12078 interfaces with/without params modifiers and vice versa, even though
12079 params modifiers aren't part of the signature. Make the modifier check
12080 less strict as in csc.
12082 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
12083 Anoob V E <projectmonokochi@rediffmail.com>
12084 Harilal P R <projectmonokochi@rediffmail.com>
12087 * pending.cs (TypeAndMethods.mods): New. Store the parameter
12088 modifiers of pending methods.
12089 (PendingImplementation.PendingImplementation): Initialize it.
12090 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
12091 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
12092 with ParameterData. Add check for modifiers.
12093 * class.cs (MethodData.Define): Update to changes.
12095 2005-04-07 Raja R Harinath <rharinath@novell.com>
12097 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
12099 2005-04-07 Marek Safar <marek.safar@seznam.cz>
12101 * class.cs (PropertyMethod.Define): Check private accessor in abstract
12104 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
12107 * typemanager.cs: Registered RequiredAttributeAttribute.
12109 2005-04-06 Marek Safar <marek.safar@seznam.cz>
12111 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
12112 Warning CS0169 is back at level 3.
12113 (IMethodData.SetMemberIsUsed): New method.
12115 * decl.cs (IsUsed): New value; moved from FieldBase.Status
12116 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
12118 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
12120 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
12122 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
12125 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
12128 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
12129 to avoid the problems with nested types.
12131 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
12132 Anoob V.E <projectmonokochi@rediffmail.com>
12133 Harilal P.R <projectmonokochi@rediffmail.com>
12134 Raja R Harinath <rharinath@novell.com>
12137 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
12139 * typemanager (GetConstructor): Make public.
12141 2005-04-05 John Luke <john.luke@gmail.com>
12142 Raja R Harinath <rharinath@novell.com>
12145 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
12146 struct too. Return false quicker in a few cases.
12147 (VerifyUnManaged): Use it.
12149 2005-04-05 Raja R Harinath <rharinath@novell.com>
12152 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
12153 not 'unreachable_seen'.
12155 2005-04-04 Marek Safar <marek.safar@seznam.cz>
12157 * attribute.cs (Attribute.GetValue): Removed unused.
12159 * codegen.cs (CodeGen.TrimExt): Removed unused.
12161 * cs-parser.jay (output): Removed unused.
12163 * cs-tokenizer.cs (hex_digits): Removed unused.
12165 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
12167 * expression.cs (Indirection.LoadExprValue): Removed unused.
12168 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
12170 * iterators.cs (Iterator.param_types): Removed unused.
12172 * statement.cs (Goto.block): Removed unused.
12173 (ToplevelBlock.did): Removed unused.
12174 (Switch.ResolveConstantSwitch): Removed unused.
12176 2005-04-01 Ben Maurer <bmaurer@ximian.com>
12178 * rootcontext.cs: Allow mcs to bootstrap with the compilation
12181 2005-04-01 Raja R Harinath <rharinath@novell.com>
12183 Fix #74232 and cs0208-3.cs.
12184 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
12185 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
12186 unmanaged type. Don't use FieldBuilders when 't' is a
12187 TypeBuilder. Use ModFlags and MemberType fields.
12188 * class.cs (MemberBase.member_type): Rename from MemberType.
12189 (MemberBase.MemberType): New property. Determines member_type on
12191 (MemberBase.DoDefine): Don't initialize MemberType here.
12192 (FieldMember.Define): Likewise.
12194 2005-04-01 Marek Safar <marek.safar@seznam.cz>
12197 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
12198 Attributes are emitted there.
12200 2005-04-01 Raja R Harinath <rharinath@novell.com>
12202 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
12203 keyword in 'partial enum' too.
12204 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
12206 Report from Kamil Skalski <nazgul@omega.pl>.
12209 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
12210 have partial containers too.
12212 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
12213 in block' checks to Block.CheckInvariantMeaningInBlock.
12214 * statement.cs (Block.GetKnownVariableInfo): Make private.
12215 (Block.IsVariableUsedInChildBlock): Remove.
12216 (Block.IsVariableUsedInBlock): Likewise.
12217 (Block.CheckInvariantMeaningInBlock): New. Show location of
12218 conflicting declaration.
12219 (Block.AddVariable): Make error messages less long-winded and more
12220 specific. Show location of conflicting declaration.
12221 * parameter.cs (Parameters.Location): New readonly property.
12223 2005-03-31 Raja R Harinath <rharinath@novell.com>
12225 Clean up semantics of invoking ResolveMemberAccess.
12226 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
12227 can have an instance, ensure that we pass in a non-TypeExpression
12228 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
12229 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
12230 argument. Update to changes and simplify.
12231 (FieldExpr.Emitinstance): Remove CS0120 check.
12232 (PropertyExpr.EmitInstance): Likewise.
12233 * expression.cs (Argument.Resolve): Likewise.
12234 (Invocation.DoResolve): Update to changes in semantics of
12235 InstanceExpression.
12237 2005-03-31 Marek Safar <marek.safar@seznam.cz>
12240 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
12243 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
12245 2005-03-31 Raja R Harinath <rharinath@novell.com>
12247 Fix difference in behaviour with commandline invocation.
12248 * driver.cs (Driver.Reset): New.
12249 (CompilerCallableEntryPoint): Call it.
12251 * statement.cs (If.Resolve): Avoid spurious "uninitialized
12252 variable" warnings if the boolean expression failed to resolve.
12254 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
12256 * attribute.cs: Fix the union of several permissions when some of them
12257 are unrestricted (so the result isn't an unrestricted permission set).
12260 2005-03-30 Raja R Harinath <rharinath@novell.com>
12262 * ecore.cs (MemberExpr): New class. Convert from interface
12264 (MemberExpr.ResolveMemberAccess): Refactor and move here from
12265 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
12267 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
12268 (MethodGroupExpr.IsExplicitImpl): Remove.
12269 (Expression.GetFieldFromEvent): Remove.
12270 (SimpleName.MemberStaticCheck): Remove.
12271 (SimpleName.DoSimpleNameResolve): Update to changes.
12272 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
12273 (MemberAccess.IdenticalNameAndTypeName): Remove.
12274 (MemberAccess.error176): Move to MemberExpr.
12275 (MemberAccess.DoResolve): Update to changes.
12276 (BaseAccess.DoResolve): Likewise.
12278 2005-03-30 Marek Safar <marek.safar@seznam.cz>
12280 C# 2.0 Conditional attribute class implementation
12282 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
12283 Analyzes class whether it has attribute which has ConditionalAttribute
12284 and its condition is not defined.
12286 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
12287 (Class.IsExcluded): New method. Search for at least one defined
12288 condition in ConditionalAttribute of attribute class.
12290 2005-03-30 Raja R Harinath <rharinath@novell.com>
12292 * ecore.cs (PropertyExpr): Derive from Expression, not
12293 ExpressionStatement.
12294 (PropertyExpr.EmitStatement): Remove.
12296 2005-03-29 Raja R Harinath <rharinath@novell.com>
12299 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
12300 internal field "value__" of an enum be private. The examples for
12301 "value__" that I found on MSDN all used FieldAttributes.Private.
12303 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
12304 Don't mention IL method attribute names.
12306 Fix #47991. Remove a TODO.
12307 * statement.cs (Block.Toplevel): Make into a field.
12308 (Block.Parameters): Move into ToplevelBlock.
12309 (Block.known_variables): Rename from child_variable_names.
12310 (Block.Block): Remove variants that take Parameters. Initialize
12311 'Toplevel' with the immediately surrounding toplevel block.
12312 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
12313 LocalInfo parameter.
12314 (Block.GetKnownVariableInfo): New.
12315 (Block.IsVariableNameUsedInChildBlock): Update.
12316 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
12317 the block, even though it may not be in scope.
12318 (Block.AddVariable): Remove Parameters parameter. Use
12319 Toplevel.Parameters instead.
12320 (Block.AddConstant): Remove Parameters parameter.
12321 (Block.GetParameterReference): Update to use Toplevel.Parameters.
12322 (Block.IsParamaterReference): Likewise.
12323 (Block.IsLocalParameter): Likewise. Simplify a lot.
12324 (ToplevelBlock.Parameters): New. Moved from Block.
12325 (ToplevelBlock.ToplevelBlock): Update to changes. Always
12326 initialize Parameters to a non-null value.
12327 * cs-parser.jay: Update to changes.
12328 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
12329 simple names that mean different things in the same block. Use
12330 Block.IsVariableNameUsedInBlock.
12332 2005-03-28 Raja R Harinath <rharinath@novell.com>
12334 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
12335 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
12336 GetTypeHandle. It is possible for a reflected type to derive from
12337 a TypeBuilder (e.g., int[] derives from the TypeBuilder
12338 System.Array during mscorlib compilation).
12339 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
12340 contain a method_hash, don't create one either. Don't create a
12341 deep copy of the base cache's method_hash.
12342 (MemberCache.SetupCache): Rename back from DeepCopy.
12343 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
12344 already initialized. If we see an override function, add its
12345 underlying base virtual function to the member_hash too.
12347 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
12349 2005-03-26 Raja R Harinath <harinath@acm.org>
12352 * assign.cs (Assign.DoResolve): When the RHS of an assignment
12353 fails to resolve, ensure that the LHS is still resolved as an
12356 2005-03-25 Raja R Harinath <harinath@acm.org>
12358 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
12360 (Enum.current_ec): Remove.
12361 (Enum.LookupEnumValue): Remove EmitContext argument.
12362 Just uses the one created during DefineType.
12363 (Enum.FindMembers): Update.
12364 * expression.cs (MemberAccess.DoResolve): Update.
12366 2005-03-22 Marek Safar <marek.safar@seznam.cz>
12368 * assign.cs (Assign.DoResolve): Check for CS1717 when
12369 source and target are same (uses Equals).
12371 * expression.cs (LocalVariableReference, ParameterReference,
12372 This): Implemented Equals, GetHashCode.
12374 * statement.cs (Block.GetParameterReference): Removed useless
12377 2005-03-22 Raja R Harinath <rharinath@novell.com>
12380 * statement.cs (Block.AddVariable): Ensure that we skip implicit
12381 blocks before deciding whether the error is cs0136 or cs0128.
12383 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
12384 (using_alias_directive, using_namespace_directive): Pass
12385 MemberName, not an expression to Namespace.UsingAlias and
12387 (MakeName): Use the MemberName of the namespace.
12388 * namespace.cs (Namespace.MemberName): New.
12389 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
12390 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
12392 * decl.cs (MemberName.Name): Make readonly.
12393 (MemberName.FromDotted): New "constructor".
12394 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
12395 (MemberCore.Name): Compute from MemberName on demand.
12396 (MemberCore.SetMemberName): Provide a way to change the
12398 (MemberCore.AddToContainer): Don't take a fullname parameter.
12399 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
12400 fully qualified name of the container to the member name.
12401 (TypeContainer.AddToTypeContainer): Use a fully qualified name
12402 only if the type is a member of the root container.
12403 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
12404 MemberName.Left rather than searching for an embedded ".".
12405 (PartialContainer.CreatePart): Update to changes in RootContext.
12406 (MemberBase.ShortName): Turn into a property. Use
12407 MemberCore.SetMemberName.
12408 (MemberBase.ExplicitInterfaceName): Remove.
12409 (MemberBase.UpdateMemberName): Remove.
12410 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
12411 (PropertyBase.SetMemberName): New override.
12412 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
12413 (Tree.GetDecl): New.
12414 (Tree.AllDecls): Rename from Decls.
12415 * attribute.cs, enum.cs, report.cs: Update to changes.
12416 * driver.cs (MainDriver): Use MemberName.FromDotted on
12417 RootContext.MainClass.
12419 2005-03-21 Marek Safar <marek.safar@seznam.cz>
12421 * class.cs (FixedField.Define): Check for CS1664 and more sanity
12424 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
12426 2005-03-18 Marek Safar <marek.safar@seznam.cz>
12428 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
12429 property accessor modifiers.
12431 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
12432 fixed buffer attribute (CS1716).
12433 (PropertyMethod.HasCustomAccessModifier): When property accessor
12434 has custom modifier.
12436 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
12438 (PropertyExpr.DoResolveLValue): Add CS0272.
12440 2005-03-17 Miguel de Icaza <miguel@novell.com>
12442 * convert.cs: When converting to a pointer, use the proper Conv.U
12443 or Conv.I depending on the source data type.
12445 * cs-tokenizer.cs: Make the size for large decimal constants,
12448 2005-03-17 Martin Baulig <martin@ximian.com>
12450 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
12451 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
12453 2005-03-17 Martin Baulig <martin@ximian.com>
12455 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
12456 to bool so we can return an error condition.
12457 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
12460 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
12462 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
12465 2005-03-16 Raja R Harinath <rharinath@novell.com>
12467 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
12468 Refactor to avoid traversing the list of assemblies, and to avoid
12469 string concatenation.
12470 * typemanager.cs (guid_attr_type): Remove.
12471 (negative_hits, pointers, references): Remove hashes.
12473 (GetConstructedType): New. Uses type_hash to handle constructed
12474 types (arrays, references, pointers).
12475 (GetReferenceType, GetPointerType): Use it.
12476 (GetNestedType): New. Uses type_hash to handle nested types of
12478 (LookupType, LookupTypeDirect): Remove.
12479 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
12480 'types' hash and LookupTypeReflection directly.
12481 (params_string, params_object): Use GetConstructedType.
12482 * namespace.cs (Namespace.cached_types): New. Cache of reflected
12484 (Namespace.Lookup): Use cached_types.
12485 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
12486 provided by old TypeManager.LookupType.
12487 * rootcontext.cs (MakeFQN): Remove.
12488 * decl.cs (DeclSpace.MakeFQN): Likewise.
12489 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
12490 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12491 TypeManager.GetConstructedType.
12492 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
12494 2005-03-15 Marek Safar <marek.safar@seznam.cz>
12496 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
12499 * cs-parser.jay: Reports CS1527 for any namespace element.
12501 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
12504 * expression.cs (ParameterReference.IsAssigned): Changed error to
12506 (Error_WrongNumArguments): Moved CS0245 detection here.
12508 * statement.cs (Return.Resolve): Add CS1622 report.
12510 2005-03-11 Marek Safar <marek.safar@seznam.cz>
12512 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
12514 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
12516 * attribute.cs expression.cs: Get rid of some allocations.
12518 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
12520 * doc.cs : just eliminate the latest change.
12522 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12524 * doc.cs : commented out the latest change. It breaks xml-030.cs
12526 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12528 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
12529 fail. So invoke CreateType() in FindDocumentedType().
12531 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12533 * cs-tokenizer.cs : added IsKeyword().
12534 * doc.cs : Detect keyword incorrectly used as identifier.
12535 Allow identifiers prefixed by @.
12537 2005-03-10 Marek Safar <marek.safar@seznam.cz>
12539 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
12540 It caused exception in namespace resolving (again!).
12542 * class.cs (Class.ctor): Removed exit.
12543 (PropertyMethod.ctor): ditto.
12545 * codegen.cs (Codegen.Reset): Reset static data.
12546 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
12548 * cs-tokenizer.cs (Cleanup): Removed.
12550 * driver.cs (GetSystemDir): Rewrote to one line command.
12551 It caused problem with unloaded dynamic modules.
12552 (UnixParseOption): Removed Exit.
12553 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
12554 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
12555 Now can be mcs used as library.
12557 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
12560 * location.cs (Reset): Reset static data.
12562 * namespace.cs (Reset): Reset static data.
12564 * report.cs (Report.Reset): Reset static data.
12566 * rootcontext.cs (RootContext.Reset): Reset static data.
12568 * tree.cs (RootTypes.ctor): Use Location.Null
12570 * typemanager.cs (TypeManager.Reset): Reset static data.
12571 (CoreLookupType): Removed Exit.
12572 (TypeHandle.Reset): Reset static data.
12574 2005-03-10 Raja R Harinath <rharinath@novell.com>
12577 * typemanager.cs (ComputeNamespaces): Import namespaces from
12578 referenced modules too.
12580 2005-03-09 Raja R Harinath <rharinath@novell.com>
12582 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
12585 2005-03-09 Raja R Harinath <rharinath@novell.com>
12587 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
12588 enclosing DeclSpace. This ensures that a name-lookup populates
12589 more caches and there are fewer 'TypeExpression's. Carve out
12590 nested type lookup into ...
12591 (LookupNestedTypeInHierarchy): ... this.
12593 2005-03-09 Raja R Harinath <rharinath@novell.com>
12595 Clean up a few partial-class semantics.
12596 Fixes test-357.cs and cs1618-2.cs.
12597 * cs-parser.jay (struct_declaration): Use 'current_class' as
12598 parent of newly-created struct. Remove call to Register ().
12599 Use 'pop_current_class' to complete handing the current struct.
12600 (interface_declaration): Likewise.
12601 (class_declaration): Likewise.
12602 (enum_declaration): Use 'current_class' as parent of newly created
12604 (delegate_declaration): Likewise.
12605 (pop_current_class): New function. This is used to handle closing
12606 up the 'current_class' and 'current_container', and pointing them
12607 to the enclosing class/container.
12608 (CSharpParser): Initialize 'current_class' too.
12609 * decl.cs (MemberCore): Add check for invariant: a partial
12610 container is not a parsed entity, and thus does not enclose any
12612 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
12613 (DeclSpace.BaseTypeExpr): Use it.
12614 (DeclSpace.LookupType): Add check for invariant.
12615 * class.cs (TypeContainer): Add check for invariant: a nested
12616 class should have the same NamespaceEntry as its enclosing class.
12617 (TypeContainer.EmitFieldInitializers): Make virtual.
12618 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
12620 (TypeContainer.Register): Remove.
12621 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
12622 null. Use TypeResolveEmitContext for resolving base types and
12623 interfaces. Move initialization of Parts.TypeBuilder here from
12625 (TypeContainer.DefineNestedTypes): ... here.
12626 (PartialContainer): Take a Namespace not a NamespaceEntry.
12627 (PartialContainer.Create): Don't use Register. Call the
12628 appropriate Add... function directly.
12629 (ClassPart): Take both the PartialContainer and the enclosing
12630 class as constructor arguments.
12631 (ClassPart.EmitFieldInitializers): Override.
12632 (ClassPart.PartFindNestedTypes): Remove.
12633 (FieldBase.GetInitializerExpression): Resolve the initializer
12634 expression in the emit context of the enclosing class.
12635 * tree.cs (RootTypes): Remove Register ().
12637 2005-03-08 Marek Safar <marek.safar@seznam.cz>
12639 * cs-parser.jay: Removed CS0134.
12641 * driver.cs: Removed CS1901.
12643 * expression.cs (SizeOf.DoResolve): Don't report CS0233
12644 for predefined types.
12646 2005-03-07 Duncan Mak <duncan@novell.com>
12648 * codegen.cs (Save): Catch UnauthorizedAccessException as
12649 well. Fixes bug #73454.
12651 2005-03-07 Marek Safar <marek.safar@seznam.cz>
12653 * cs-tokenizer.cs (xtoken): Add CS1035.
12655 * class.cs (MethodData.Define): Add CS0683.
12656 (FieldMember.ctor): Add CS0681.
12658 2005-03-07 Raja R Harinath <rharinath@novell.com>
12660 * ecore.cs (SimpleName.DoResolve): Rename from
12661 SimpleName.DoResolveAllowStatic.
12662 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
12663 Pass 'intermediate' flag to MemberStaticCheck.
12664 (SimpleName.MemberStaticCheck): Skip "static check" only in case
12665 of "intermediate" lookups via MemberAccess.
12666 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
12667 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
12669 2005-03-07 Raja R Harinath <rharinath@novell.com>
12672 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
12673 slipped in because of variable names that are identical to a
12674 builtin type's BCL equivalent ('string String;', 'int Int32;').
12675 (PropertyExpr.EmitInstance): Likewise.
12677 2005-03-04 Marek Safar <marek.safar@seznam.cz>
12679 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
12681 * report.cs (warning_ignore_table): Made public.
12683 2005-03-04 Raja R Harinath <rharinath@novell.com>
12686 * class.cs (MethodData.Emit): Pass 'container' to
12687 container.GetObsoleteAttribute instead of 'container.Parent'.
12689 2005-03-03 Marek Safar <marek.safar@seznam.cz>
12691 * cs-parser.jay: Add 1534 error test.
12693 * iterators.cs (Yield.CheckContext): Add error 1629.
12694 (Iterator.ctor): Save unsafe modifier.
12695 (MoveNextMethod.DoEmit): Restore unsafe context.
12697 * namespace.cs (UsingAlias): Better error message.
12699 2005-03-03 Dan Winship <danw@novell.com>
12701 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
12702 the warning message [#73219]
12704 2005-03-03 Raja R Harinath <rharinath@novell.com>
12706 Fix compile with MCS 1.0.0.0.
12707 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
12708 w_restore to not depend on string constant folding.
12710 2005-03-03 Raja R Harinath <rharinath@novell.com>
12712 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
12713 CS0246 check to users who passed 'silent = false'.
12714 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
12716 (SimpleName.SimpleNameResolve): Update.
12717 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
12718 (MemberAccess.IdenticalNameAndTypeName): Update.
12719 * doc.cs (FindDocumentedTypeNonArray): Update.
12721 2005-03-03 Raja R Harinath <rharinath@novell.com>
12723 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
12724 * parameters.cs (ComputeAndDefineParameters): Remove.
12725 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
12726 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
12727 Use GetParameterInfo.
12729 2005-03-02 Marek Safar <marek.safar@seznam.cz>
12731 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
12733 2005-03-02 Raja R Harinath <rharinath@novell.com>
12735 Unify DeclSpace.LookupType and DeclSpace.FindType.
12736 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
12737 is in charge of defining nested types on demand.
12738 (DeclSpace.LookupType): Use it when the current_type is a
12739 TypeBuilder. Use LookupTypeDirect for reflected types.
12740 (DeclSpace.FindType): Remove.
12741 (DeclSpace.LookupInterfaceOrClass): Likewise.
12742 (DeclSpace.DefineTypeAndParents): Likewise.
12743 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
12744 DeclSpace.LookupType.
12745 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
12746 * typemanager.cs (LookupType): Simplify.
12747 (AddUserType): Remove type from negative_hits.
12748 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
12749 * class.cs (TypeContainer.FindMembers): Move handling of nested
12751 (TypeContainer.FindMembers_NestedTypes): ... here.
12752 (TypeContainer.FindNestedType): Implement override.
12753 (ClassPart.FindNestedType): Delegate to PartialContainer.
12754 (ClassPart.PartFindNestedType): Looks up the nested types of the
12757 2005-03-02 Martin Baulig <martin@ximian.com>
12759 * class.cs (TypeContainer.DoDefineMembers): We also need a default
12760 static constructor in static classes.
12762 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
12764 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
12765 sizeParamIndex is not specified.
12767 2005-03-01 Marek Safar <marek.safar@seznam.cz>
12770 * report.cs (WarningMessage.IsEnabled): Missing null check.
12772 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12774 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
12775 in the fields and not in the properties.
12777 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
12779 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
12782 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12784 * attribute.cs: Small refactoring (improved robustness).
12785 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
12786 (ValidateGuid): Removed.
12787 (Resolve): Removed referenced to above mentioned.
12788 (GetAttributeUsage): Made private and changed to work without
12790 (GetIndexerAttributeValue): Don't crash.
12791 (GetConditionalAttributeValue): Ditto.
12792 (GetClsCompliantAttributeValue): Ditto.
12793 (ExtractSecurityPermissionSet): All attributes exceptions are
12795 (GetPropertyValue): New helper.
12796 (GetMethodImplOptions): New method.
12797 (DefinePInvokeMethod): Reuse common code. Implemented handling of
12798 some missing properties.
12800 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
12801 (Method.ApplyAttributeBuilder): Updated.
12803 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
12806 2005-02-28 Raja R Harinath <rharinath@novell.com>
12809 * report.cs (Report.SymbolRelatedToPreviousError): Handle
12810 non-simple types (array, pointer, reference).
12812 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12814 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
12816 * class.cs (MethodCore.IsDuplicateImplementation): Special error
12818 (Method.CheckBase): Catch wrong destructor here.
12819 (MethodData.Define): Add errors 550, 668.
12821 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
12823 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
12825 * pending.cs (VerifyPendingMethods): Add error 551.
12827 * typemanager.cs (CSharpName): Next error report helper.
12829 2005-02-25 Marek Safar <marek.safar@seznam.cz>
12831 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
12832 attributes. Removed useless attribute double check.
12833 It saves almost 2MBs for corlib.
12835 2005-02-25 Raja R Harinath <rharinath@novell.com>
12838 * statement.cs (ExpressionStatement.Resolve): Make robust to being
12839 called twice in case of error.
12841 2005-02-23 Chris Toshok <toshok@ximian.com>
12843 Fix compiler portions of #72827.
12844 * statement.cs (Block.Emit): call Begin/EndScope on the
12845 EmitContext instead of the ILGenerator.
12847 * codegen.cs (EmitContext.BeginScope): new method, call
12848 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
12850 (EmitContext.BeginScope): same, but EndScope and CloseScope
12852 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
12853 offset and call the superclass's OpenScope(int) with it.
12854 (SymbolWriter.CloseScope): get the current il
12855 offset and call superclass's CloseScope(int) with it.
12857 2005-02-23 Marek Safar <marek.safar@seznam.cz>
12859 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
12860 CS1677 for out and ref as well.
12862 * class.cs (Method.Define): Add error CS1599 detection.
12864 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
12866 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
12868 * delegate.cs (Delegate.Define): Add error CS1599 detection.
12870 * support.cs.cs (ModifierDesc): New helper method.
12872 2005-02-23 Raja R Harinath <rharinath@novell.com>
12873 Abin Thomas <projectmonokochi@rediffmail.com>
12874 Anoob V E <projectmonokochi@rediffmail.com>
12875 Harilal P R <projectmonokochi@rediffmail.com>
12877 Fix #57851, #72718.
12878 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
12879 MemberLookup (used for error reporting) actually returns a result.
12880 Fix error report number (122, not 112).
12882 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
12883 Anoob V E <projectmonokochi@rediffmail.com>
12884 Harilal P R <projectmonokochi@rediffmail.com>
12887 * pending.cs (PendingImplementation.GetAbstractMethods):
12888 Find NonPublic members too.
12890 2005-02-22 Marek Safar <marek.safar@seznam.cz>
12892 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
12895 * class.cs (MethodCore.CheckMethodAgainstBase):
12896 Add error 239 report.
12898 2005-02-21 Raja R Harinath <rharinath@novell.com>
12901 * expression.cs (Invocation.IsApplicable): Make public.
12902 (Invocation.IsParamsMethodApplicable): Likewise.
12903 * delegate.cs (Delegate.VerifyApplicability): Don't use
12904 Invocation.VerifyArgumentCompat for parameter applicability
12905 testing. Use Invocation.IsApplicable and
12906 Invocation.IsParamsMethodApplicable.
12908 2005-02-21 Marek Safar <marek.safar@seznam.cz>
12910 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
12912 * class.cs (Operator.Define): Add error 217 report.
12914 2005-02-21 Raja R Harinath <rharinath@novell.com>
12916 * namespace.cs (UsingEntry.Resolve): Undo change below.
12918 2005-02-21 Raja R Harinath <rharinath@novell.com>
12921 * ecore.cs (Expression.MemberLookupFailed): Add argument to
12922 disable the error message when the extended MemberLookup also
12924 (Expression.MemberLookupFinal): Update.
12925 (SimpleName.DoSimpleNameResolve): Update.
12926 * expression.cs (MemberAccess.ResolveNamespaceOrType):
12927 Don't use MemberLookupFinal.
12928 (New.DoResolve): Update.
12929 (BaseAccess.CommonResolve): Update.
12931 2005-02-21 Raja R Harinath <rharinath@novell.com>
12934 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
12935 occured previously, don't resolve again.
12937 2005-02-21 Marek Safar <marek.safar@seznam.cz>
12940 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
12941 argument. Call ResolveAttributeUsage for unresolved.
12942 when types doesn't match ctor arguments.
12944 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
12945 for nested attribute classes.
12946 (Class.attribute_usage): Removed.
12947 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
12948 for attribute class.
12950 * ecore.cs (IsAttribute): Removed.
12952 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
12954 * rootcontext.cs (RegisterAttribute): Removed, attributes are
12956 (attribute_types): Removed.
12957 (EmitCode): Global attributes are emited as the latest.
12959 2005-02-18 Marek Safar <marek.safar@seznam.cz>
12961 * class.cs (EmitFieldInitializers): Don't emit field initializer
12962 for default values when optimilization is on.
12964 * constant.cs (Constant.IsDefaultValue): New property.
12966 * driver.cs: Add /optimize handling.
12970 * literal.cs: Implement new IsDefaultValue property.
12972 * rootcontext.cs (Optimize): New field, holds /optimize option.
12974 2005-02-18 Raja R Harinath <rharinath@novell.com>
12976 Fix crasher in re-opened #72347.
12977 * namespace.cs (Namespace.Lookup): Return null if
12978 DeclSpace.DefineType returns null.
12981 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
12983 2005-02-18 Raja R Harinath <rharinath@novell.com>
12985 Fix remainder of #63202. Change semantics of DoResolveLValue: it
12986 now returns null if it cannot resolve to an lvalue.
12987 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
12988 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
12989 returned null. Remove check for SimpleName.
12990 (EventExpr.DoResolveLValue): New.
12991 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
12992 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
12994 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
12995 avoid CS0131 error.
12996 (Unary.ResolveOperator): Move CS0211 check ...
12997 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
12999 (Unary.DoResolveLValue): Simplify.
13000 (AddressOf.DoResolveLValue): New.
13001 (ArrayAccess.DoResolveLValue): New.
13003 2005-02-16 Marek Safar <marek.safar@seznam.cz>
13005 * attribute.cs (Attribute.Resolve): Add arguments casting for
13006 when types doesn't match ctor arguments.
13008 2005-02-16 Raja R Harinath <rharinath@novell.com>
13010 Fix parts of #63202.
13011 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
13012 lookup of operator in base type. Ensure that all checks happen
13013 when the operator resolves to an "op_..." method.
13015 2005-02-15 Raja R Harinath <rharinath@novell.com>
13018 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
13019 'ignore_cs0104' parameter. Pass it to ...
13020 (NamespaceEntry.Lookup): ... this.
13021 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
13022 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
13023 (TypeLookupExpression.DoResolveAsTypeStep): Update.
13024 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
13025 Update. Request that cs0104 errors be ignored.
13026 (ComposedCast.ResolveAsTypeStep): Update.
13028 2005-02-14 Raja R Harinath <rharinath@novell.com>
13031 * expression.cs (Invocation.BetterFunction): Remove support for
13032 comparing virtual functions and their overrides.
13033 (Invocation.IsOverride): New.
13034 (Invocation.OverloadResolve): Don't consider 'override' functions
13035 during candidate selection. Store them in a lookaside list.
13036 If the selected method is a 'virtual' function, use the list to
13037 find any overrides that are closer to the LHS type.
13039 2005-02-14 Marek Safar <marek.safar@seznam.cz>
13041 * expression.cs (New.DoResolve): Add complex core type reduction.
13042 (New.Constantify): Converts complex core type syntax like 'new int ()'
13043 to simple constant.
13045 2005-02-14 Raja R Harinath <rharinath@novell.com>
13047 * decl.cs (EntryType.EntryType): New constructor to create an
13048 updated copy of a cache entry.
13049 (MemberCache.AddMethods): Use it.
13050 (MemberCache.ClearDeclaredOnly): Remove.
13051 (MemberCache.MemberCache): Update.
13053 2005-02-11 Miguel de Icaza <miguel@novell.com>
13055 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
13056 variable. This one is represents the actual low-level declaration
13057 of the method, as opposed to the semantic level `IsStatic'.
13059 An anonymous method which is hosted into a static method might be
13060 actually an instance method. IsStatic would reflect the
13061 container, while MethodIsStatic represents the actual code
13064 * expression.cs (ParameterReference): Use the new MethodIsStatic
13065 instead of IsStatic.
13067 * anonymous.cs (AnonymousMethod.Compatible): Pass the
13068 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
13069 set on the current EmitContext.
13071 * expression.cs (Cast): Overload DoResolveLValue so we can pass
13072 resolve our casted expression as an LValue. This triggers the
13073 proper LValue processing that is later required by Assign.
13077 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
13079 2005-02-11 Marek Safar <marek.safar@seznam.cz>
13081 C# 2.0 Fixed buffer implementation
13083 * anonymous.cs: Update after RegisterHelperClass renaming.
13085 * attribute.cs (AttributeTester.fixed_buffer_cache):
13086 Cache of external fixed buffers.
13087 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
13088 implementation if field is fixed buffer else null.
13091 (TypeContainer.AddField): Accept FieldMember instead of Field.
13092 (FieldBase.IsFieldClsCompliant): Extracted code from
13093 VerifyClsCompliance descendant customization.
13094 (FixedField): New class handles fixed buffer fields.
13095 (FixedFieldExternal): Keeps information about imported fixed
13097 (IFixedField): Make access to internal or external fixed buffer
13100 * cs-parser.jay: Add fixed buffer parsing.
13102 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
13105 * expression.cs (Indirection): Extended implementation to accept
13106 fixed buffer field.
13107 (PointerArithmetic.Emit): Get element from fixed buffer as well.
13108 (ElementAccess.MakePointerAccess): Get type as parameter.
13109 (DoResolve): Add fixed buffer field expression conversion.
13110 (DoResolveLValue): Ditto.
13111 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
13112 (ArrayPtr): Derives from FixedBufferPtr.
13113 (ArrayPtr.Emit): Add extra emit for array elements.
13115 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
13117 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
13118 for compiler generated types.
13119 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
13121 * statement.cs (Fixed): Refactored to be easier add fixed buffer
13122 and consume less memory.
13123 (Fixed.Resolve): Add fixed buffer case.
13125 * typemanager.cs (compiler_generated_attr_ctor,
13126 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
13127 (HasElementType): Add our own implementation to work on every
13130 2005-02-11 Miguel de Icaza <miguel@novell.com>
13132 * anonymous.cs (CaptureContext): Track whether `this' has been
13135 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
13136 only captured `this' if it was implicitly done (instance
13137 methods/variables were used).
13139 * codegen.cs (EmitContext.CaptureThis): New method to flag that
13140 `this' must be captured.
13142 2005-01-30 Miguel de Icaza <miguel@novell.com>
13144 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
13145 is null it means that there has been no need to capture anything,
13146 so we just create a sibling.
13148 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
13150 Just a partial fix. The other half is fairly elusive.
13152 2005-02-10 Raja R Harinath <rharinath@novell.com>
13154 Fix #52586, cs0121-4.cs.
13155 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
13156 and return a hashtable.
13157 (MemberCache.ClearDeclaredOnly): New.
13158 (MemberCache.MemberCache): Update to change. Make a deep copy of
13159 the method_hash of a base type too.
13160 (MemberCache.AddMethods): Adapt to having a deep copy of the base
13161 type methods. Overwrite entries with the same MethodHandle so
13162 that the ReflectedType is correct. The process leaves in base
13163 virtual functions and their overrides as distinct entries.
13164 (CacheEntry): Now a class instead of a struct. It shouldn't alter
13165 matters since it was boxed in a ArrayList before.
13166 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
13168 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
13169 case of a virtual function and its override (choose the overload
13171 (Invocation.OverloadResolve): Avoid 'override' members during
13172 'applicable_type' calculation.
13174 2005-02-09 Raja R Harinath <rharinath@novell.com>
13176 Combine two near-redundant caches.
13177 * typemanager.cs (method_params): Rename from method_internal_params.
13178 (TypeManager.GetParameterData): New. Replace
13179 Invocation.GetParameterData.
13180 (TypeManager.LookupParametersByBuilder): Remove.
13181 * expression.cs (Invocation.method_parameter_cache): Remove.
13182 (Invocation.GetParameterData): Remove.
13184 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
13187 2005-02-08 Raja R Harinath <rharinath@novell.com>
13190 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
13191 TypeManager.multicast_delegate_type is null, resolve it by looking
13192 up "System.MulticastDelegate".
13193 * rootcontext.cs (RootContext.ResolveCore): Simplify.
13195 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
13196 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
13197 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
13200 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
13201 (LabeledStatement.AddReference): New. Set 'referenced'.
13202 (Goto.Resolve): Use it.
13204 2005-02-05 John Luke <john.luke@gmail.com>
13206 * driver.cs: remove duplicate -doc line in Usage ()
13208 2005-02-04 Raja R Harinath <rharinath@novell.com>
13210 * location.cs (Location.AddFile): Fix CS2002 error report.
13212 2005-02-02 Martin Baulig <martin@ximian.com>
13214 * delegate.cs (Delegate.DefineType): Report an internal error if
13215 TypeManager.multicast_delegate_type is null. See bug #72015 for
13218 2005-02-02 Raja R Harinath <rharinath@novell.com>
13220 Fix a crasher in a variant of #31984.
13221 * const.cs (Constant.CheckBase): New override that defers the
13222 new-or-override check in case the base type hasn't been populated
13224 (Constant.Define): Ensure the new-or-override check is performed.
13226 2005-02-01 Duncan Mak <duncan@ximian.com>
13228 * const.cs (LookupConstantValue): Check that `ce' is not null
13229 before calling GetValue ().
13231 2005-02-01 Raja R Harinath <rharinath@novell.com>
13233 Fix test-334.cs (#69519).
13234 * cs-parser.jay (using_alias_directive): Pass in an expression to
13235 NamespaceEntry.UsingAlias.
13236 (using_namespace_directive): Pass in an expression to
13237 NamespaceEntry.Using.
13238 (namespace_name): Don't flatten to a string.
13239 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
13240 (NamespaceEntry.AliasEntry.Resolve): Lookup using
13242 (NamespaceEntry.UsingEntry): Likewise.
13243 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
13245 (NamespaceEntry.LookupForUsing): Remove.
13246 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
13248 (NamespaceEntry.Lookup): Remove support for dotted names.
13250 2005-02-01 Raja R Harinath <rharinath@novell.com>
13252 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
13254 (NamespaceEntry.ImplicitParent): Compute on demand.
13255 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
13256 parallels the current.
13257 (NamespaceEntry.LookupForUsing): Use it.
13258 (NamespaceEntry.Lookup): If the current namespace-entry is
13259 implicit, don't search aliases and using tables.
13261 2005-02-01 Raja R Harinath <rharinath@novell.com>
13264 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
13266 (TypeContainer.BaseCache): Compute on demand.
13267 (TypeContainer.FindMembers): Define constants and types if they're
13268 not already created.
13269 (FieldMember.Define): Move resetting of ec.InUnsafe before error
13271 * const.cs (Constant.Define): Make idempotent.
13273 2005-01-29 Miguel de Icaza <miguel@novell.com>
13275 * pending.cs: Produce better code (no nops produced by using Ldarg
13278 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
13279 i - 1' it should be arg + 1.
13283 2005-01-28 Raja R Harinath <rharinath@novell.com>
13285 * attribute.cs (Attribute.CheckAttributeType): Make private
13287 (Attribute.ResolveType): Make virtual.
13288 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
13289 handling of RootContext.Tree.Types.
13291 2005-01-27 Raja R Harinath <rharinath@novell.com>
13293 Update attribute-handling to use the SimpleName/MemberAccess
13295 * cs-parser.jay (attribute): Pass in an expression to the
13296 constructors of Attribute and GlobalAttribute.
13297 * attribute.cs (Attribute): Take an expression for the name.
13298 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
13299 passed in attribute name expression.
13300 (Attribute.CheckAttributeType): Use it.
13301 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
13302 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
13303 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
13304 argument to prevent error messages if the lookup fails.
13306 2005-01-27 Marek Safar <marek.safar@seznam.cz>
13308 * expression.cs (Indirection): Implemented IVariable interface
13309 to support indirection in AddressOf operator.
13310 (PointerArithmetic.Emit): Add optimalization for case where
13311 result can be precomputed.
13313 2005-01-26 Martin Baulig <martin@ximian.com>
13315 * class.cs (TypeContainer.AttributeTargets): Return the correct
13316 AttributeTargets depending on our `Kind' instead of throwing an
13317 exception; fixes #71632.
13319 2005-01-26 Marek Safar <marek.safar@seznam.cz>
13322 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
13325 2005-01-25 Raja R Harinath <rharinath@novell.com>
13328 * expression.cs (MemberAccess.DoResolve): Don't complain with
13329 cs0572 when the LHS of a member access has identical name and type
13332 2005-01-25 Marek Safar <marek.safar@seznam.cz>
13335 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
13337 Create custom PermissionSet only for PermissionSetAttribute.
13339 2005-01-24 Marek Safar <marek.safar@seznam.cz>
13342 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
13343 delegates in static class.
13345 2005-01-24 Martin Baulig <martin@ximian.com>
13347 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13348 merging an implicit block, just use its reachability.
13350 * statement.cs (Block.Resolve): Make the unreachable code check
13351 work wrt. implicit blocks; see test-337 from #63842.
13353 2005-01-21 Alp Toker <alp@atoker.com>
13355 * cs-parser.jay: destructor_declaration's container is PartialContainer
13356 not Class when partial types are used, so use Kind prop instead of
13359 2005-01-22 Miguel de Icaza <miguel@ximian.com>
13361 * cs-parser.jay: Improve error reporting when an interface
13362 declares new types.
13364 2005-01-20 Dick Porter <dick@ximian.com>
13366 * support.cs: SeekableStreamReader fix from Sandor Dobos
13367 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
13368 chars are read. Fixes bug 70369.
13370 2005-01-20 Raja R Harinath <rharinath@novell.com>
13372 * cs-parser.jay (catch_clause): Simplify current_block handling
13375 2005-01-17 Miguel de Icaza <miguel@ximian.com>
13377 * convert.cs (ImplicitStandardConversionExists): Synchronize the
13378 code with ImplicitStandardConversion to handle the implicit
13379 conversion of method groups into valid delegate invocations.
13381 The problem is that in parameter handling we were using this code
13382 path. Fixes bug #64698
13384 2005-01-19 Raja R Harinath <rharinath@novell.com>
13386 * cs-parser.jay: Fix several infelicities.
13387 - Avoid assigning to the parser value stack. Code like
13388 '$3 = null' is unclean. Synthesize a value for the code block
13390 - Avoid using oob_stack for storing location information. Use ...
13391 (_mark_): ... this. New (empty) rule. Saves the current location
13393 (foreach_statement): Avoid using oob_stack for current_block
13394 handling. Use technique used in for_statement and
13395 using_statement. Synthesize a value for the code block to store
13396 additional intermediate information.
13398 2005-01-13 Miguel de Icaza <miguel@ximian.com>
13400 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
13401 of a different type is only allowed to private fields of a
13402 containing type, not on fields of a base class.
13404 See test-174.cs and error cs0122-9.cs
13406 2005-01-13 Raja R Harinath <rharinath@novell.com>
13408 Fix test-335.cs (bug #58126).
13409 * cs-parser.jay (argument): Split out non-expression parts of the
13410 rule into 'non_simple_argument'.
13411 (invocation_expression): Support parenthesized invocations with
13412 multiple arguments, and with single non-simple arguments.
13414 2005-01-13 Raja R Harinath <rharinath@novell.com>
13416 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
13419 2005-01-12 Raja R Harinath <rharinath@novell.com>
13421 Fix cs0038-1.cs, cs1640-6.cs.
13422 * ecore.cs (Expression.Resolve): Remove special-case for
13423 SimpleName in error-handling.
13424 (Expression.almostMatchedMembers): Relax access permission to
13426 (Expression.MemberLookupFailed): Handle duplicates in
13427 almostMatchedMembers list.
13428 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
13429 * expression.cs (New.DoResolve): Report CS1540 for more cases.
13430 * typemanager.cs (GetFullNameSignature): Use the MethodBase
13431 overload if the passed in MemberInfo is a MethodBase.
13433 2005-01-12 Marek Safar <marek.safar@seznam.cz>
13436 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
13437 for non-CAS & merge permission sets properly.
13439 2005-01-11 Raja R Harinath <rharinath@novell.com>
13441 Improve standard-compliance of simple name and member access
13442 resolution. Fixes bugs #52697, #57200, #67520, #69519.
13443 * ecore.cs (FullNamedExpression): New abstract base class
13444 for Namespaces and TypeExpressions.
13445 (ResolveFlags.SimpleName): Remove.
13446 (SimpleName): Remove support for dotted names.
13447 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
13448 DeclSpace.FindType and DeclSpace.LookupType.
13449 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
13450 (Expression.ExprClassName): Make member function.
13451 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
13452 a namespace. Remove creation of dotted "SimpleName"s.
13453 (MemberAccess.DoResolve): Likewise.
13454 * decl.cs (DeclSpace.Cache): Make private.
13455 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
13456 (DeclSpace.FindType): Update.
13457 (DeclSpace.LookupType): Move here from RootContext. Return a
13458 FullNamedExpression.
13459 * namespace.cs (Namespace): Derive from FullNamedExpression
13460 so that it can be part of expression resolution.
13461 (Namespace.Lookup): Return an FullNamedExpression.
13462 (NamespaceEntry.LookupAlias): Lookup aliases only in current
13464 * rootcontext.cs (NamespaceLookup): Remove.
13465 (LookupType): Move to DeclSpace.
13466 * attribute.cs (CheckAttributeType): Update.
13467 * doc.cs (FindDocumentedType): Remove allowAlias argument.
13468 (FindDocumentedTypeNonArray): Likewise.
13470 2005-01-11 Raja R Harinath <rharinath@novell.com>
13472 Fix cs0509.cs, cs1632.cs.
13473 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
13474 is the same as IsInterface.
13475 (TypeContainer.GetClassBases): Likewise.
13476 * statement.cs (LabeledStatement.ig): New field.
13477 (LabeledStatement.LabelTarget): Save ILGenerator which created the
13479 (LabeledStatement.DoEmit): Check that the label was created with
13480 the same ILGenerator.
13482 2005-01-10 Marek Safar <marek.safar@seznam.cz>
13485 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
13486 accessors to its properties.
13488 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
13489 from accessors to property.
13491 2005-01-10 Marek Safar <marek.safar@seznam.cz>
13494 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
13495 only for overrides.
13497 2005-01-08 Miguel de Icaza <miguel@ximian.com>
13499 * attribute.cs: Check for null and empty strings.
13501 I have lost another battle to Paolo.
13503 2005-01-07 Marek Safar <marek.safar@seznam.cz>
13506 * class.cs (PropertyMethod): Set Parent field in ctors.
13507 (SetMethod.InternalParameters): Add unsafe switch hack.
13508 Override MarkForDuplicationCheck where it is appropriate.
13510 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
13511 It says whether container allows members with the same name.
13512 Base default is no.
13513 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
13514 Removed is_method parameter.
13516 2005-01-06 Duncan Mak <duncan@ximian.com>
13518 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
13519 because the previous change led to incorrect reporting of CS1032
13520 ("Cannot define/undefine preprocessor symbols after first token in
13521 file"). Instead of using `tokens_seen' as the only flag that
13522 triggers CS1040, introduce `comments_seen'. This new flag is used
13523 to signify having seen comments on the current line, so it is
13524 unset after a newline.
13526 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
13528 * doc.cs : When searching for a type, find nested type too.
13529 This fixes bug #71040.
13531 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
13534 - Warn missing member comment on those classes which also does not
13535 have doc comments. Fixed bug #71041.
13536 - Don't warn missing doc comment on default constructor.
13539 2005-01-06 Duncan Mak <duncan@ximian.com>
13541 * cs-tokenizer.cs (xtoken): After handling traditional C-style
13542 comments, set `tokens_seen' to true. This allows us to detect
13543 misplaced preprocessor directives (i.e. not at the beginning of
13544 the a line, nor after whitespaces). In that case, report error
13545 CS1040. This fixes bug #56460.
13547 * cs-parser.jay (interface_member_declaration): Add checks for
13548 IsExplicitImpl, and report CS0541 error if an interface member is
13549 defined as an explicit interface declaration.
13551 2005-01-06 Marek Safar <marek.safar@seznam.cz>
13554 * class.cs (PropertyMethod): Set Parent field in ctors.
13555 (SetMethod.InternalParameters): Add unsafe switch hack.
13557 * decl.cs (MemberCore.Parent): Cannot be readonly.
13559 2005-01-06 Raja R Harinath <rharinath@novell.com>
13561 * decl.cs (DeclSpace.ResolveType): Remove.
13562 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
13563 Merge in code from ...
13564 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
13565 * class.cs, enum.cs: Update to changes.
13567 2005-01-06 Miguel de Icaza <miguel@ximian.com>
13569 * anonymous.cs: Ensure that we init the scope of our parent if it
13570 has not been initialized yet.
13572 2004-12-30 Duncan Mak <duncan@ximian.com>
13574 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
13575 if field.FieldBuilder is null. Fixes #70758.
13577 * convert.cs: Fixed some typos and updated some of the comments.
13578 (ImplicitStandardConversionExists):
13579 (TryImplicitIntConversion): If `target_type' is an interface and
13580 the type of `ic' implements this interface, return true or a new
13581 BoxedCast instead of null. This fixes #70468.
13583 2004-12-29 Duncan Mak <duncan@ximian.com>
13585 * expression.cs (Argument.Emit): Check that Expr is
13586 IMemoryLocation before casting to it, and report CS1510 otherwise.
13590 2004-12-21 Ben Maurer <bmaurer@ximian.com>
13592 * statement.cs (Block.ThisVariable): remove the recursion here, to
13593 make the --profile more sane.
13595 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
13597 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
13598 assembly, by JB Evain.
13600 2004-12-17 Raja R Harinath <rharinath@novell.com>
13602 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
13603 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
13604 "parent" refers to enclosing type/class. "base" refers to superclass.
13606 2004-12-17 Raja R Harinath <rharinath@novell.com>
13608 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13609 Ensure that we only have GlobalAttributes.
13610 * attribute.cs (Attribute.Emit): Make non-virtual.
13611 (GlobalAttribute.Emit): Remove.
13612 (Attribute.Resolve): Make virtual.
13613 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
13614 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
13615 the argument. Don't create one.
13616 (Attribute.GetObsoleteAttribute): Likewise.
13617 (Attribute.GetClsCompliantAttributeValue): Likewise.
13618 * class.cs, decl.cs: Update to changes.
13620 2004-12-17 Marek Safar <marek.safar@seznam.cz>
13622 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
13624 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
13626 * statement.cs (Foreach.Resolve): Add error 186 report.
13628 2004-12-16 Marek Safar <marek.safar@seznam.cz>
13630 * expression.cs (Conditional.DoResolve): Add warning 429.
13632 * statement.cs (If.Resolve): Add warning 665.
13634 2004-12-16 Raja R Harinath <rharinath@novell.com>
13636 New invariant: RootContext.Tree.Types.NamespaceEntry == null
13637 except when in the parser, and in GlobalAttribute.
13638 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
13639 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
13640 RootContext.Tree.Types.NamespaceEntry once work is done.
13641 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
13642 and resets RootContext.Tree.Types.NamespaceEntry.
13644 2004-12-15 Marek Safar <marek.safar@seznam.cz>
13646 * cs-parser.jay: Don't create a block for every variable.
13648 2004-12-14 Miguel de Icaza <miguel@ximian.com>
13650 * location.cs: Provide extra information.
13652 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
13653 variables from the captured environment, it is the ldarg_0.
13655 2004-12-14 Marek Safar <marek.safar@seznam.cz>
13657 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
13660 * class.cs: Changed warning level for 169 to avoid developer
13661 displeasure from warning flooding. It will be changed back when they
13662 fix most of current BCL warnings.
13664 * RootContext.cs: Pushed default WarningLevel to 3.
13666 * statement.cs: Removed unused variable.
13668 2004-12-14 Marek Safar <marek.safar@seznam.cz>
13670 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
13671 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
13672 Add error 502 report.
13673 (StaticClass.DefineType): Add error 441 report.
13674 (Class.AllowedModifiersProp): New virtual property as temporary
13675 extension to AllowedModifiers.
13676 (Class.DefineType): Add error 418 report. Moved ModFlags check here
13677 to share implementation with StaticClass and don't call virtual
13680 * driver.cs (MainDriver): Add error 1558 test.
13682 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
13683 report. Moved error 36 test here.
13685 * statement.cs (Throw.Resolve): Add error 724 report.
13687 * typemanager.cs: Add out_attribute_type core type.
13689 2004-12-13 Marek Safar <marek.safar@seznam.cz>
13691 * class.cs (TypeContainer.VerifyClsCompliance): Add error
13693 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
13695 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
13698 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
13700 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
13701 Add error 3023 report.
13702 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
13704 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
13707 2004-12-12 John Luke <john.luke@gmail.com>
13709 * driver.cs (AddArgs): take -- into account when
13710 adding arguments, fixes bug 65710
13712 2004-12-12 Martin Baulig <martin@ximian.com>
13714 * expression.cs (Unary.TryReduceNegative): Added support for
13715 SByteConstant and ByteConstant.
13716 (Unary.Reduce): Check error values from TryReduceNegative().
13718 2004-12-10 Marek Safar <marek.safar@seznam.cz>
13720 * attributes.cs (Attribute.Resolve): Avoid multiple error report
13721 and report exception as error 182.
13723 2004-12-10 Raja R Harinath <rharinath@novell.com>
13725 * driver.cs (Main): Fix message when there are warnings.
13727 2004-12-09 Miguel de Icaza <miguel@ximian.com>
13729 * delegate.cs: Fixed my fix from yesterday, sorry about that.
13731 2004-12-09 Marek Safar <marek.safar@seznam.cz>
13733 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
13734 Reduced number of warnings.
13736 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
13738 2004-12-08 Miguel de Icaza <miguel@ximian.com>
13740 * driver.cs: Removed message.
13742 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
13744 2004-12-08 <vargaz@freemail.hu>
13746 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
13748 2004-12-08 Martin Baulig <martin@ximian.com>
13750 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
13751 instead of a CS3002 for properties and indexer.
13753 2004-12-08 Martin Baulig <martin@ximian.com>
13755 * decl.cs (MemberName.ToString): Make this work again.
13757 2004-12-08 Marek Safar <marek.safar@seznam.cz>
13759 * attribute.cs (Resolve): Add error 591 detection.
13761 * class.cs (FieldMember.Define): Add error 1547 detection.
13762 (Indexer.Define): Add error 620 detection.
13763 (Operator.Define): Add error 590 detection.
13765 * ecore.cs: Missing argument for error 79.
13767 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
13770 2004-12-07 Marek Safar <marek.safar@seznam.cz>
13773 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
13776 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
13778 * cs-parser.jay : handle doc comments on implicit/explicit operators.
13779 Some operator comments were suppressed.
13780 * doc.cs : Implicit/explicit operator name in doc comments are like
13781 "op_Explicit(type)~returnType", so added suffix handling.
13783 2004-12-07 Martin Baulig <martin@ximian.com>
13786 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
13787 (MemberCore.GetClsCompliantAttributeValue): Likewise.
13788 (DeclSpace.ec): New protected field; store the EmitContext here.
13789 (DeclSpace.EmitContext): New public property; moved here from
13791 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
13794 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
13795 (Enum.Emit): Don't create a new EmitContext.
13797 * delegate.cs (Delegate.DefineType): Always create the
13800 * iterators.cs (Iterators.DefineIterator): Create a new
13801 EmitContext and store it in `ec'.
13803 2004-08-24 Martin Baulig <martin@ximian.com>
13806 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
13807 this for accessibility checks.
13808 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
13809 IsNestedFamilyAccessible.
13810 (TypeManager.IsSubclassOf): New method, do what the name actually
13813 2004-12-06 Raja R Harinath <rharinath@novell.com>
13815 Fix crash on cs0657-17.cs.
13816 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13817 Use RootContext.Tree.Types, not 'new RootTypes ()'.
13818 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
13819 the case where the NamespaceEntry gets overwritten.
13821 2004-12-06 Marek Safar <marek.safar@seznam.cz>
13823 Fixed #69195, #56821
13824 * ecore.cs (ResolveBoolean): Tiny refactoring.
13826 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
13827 of right expression resolving when left is false constant and
13828 operator is LogicalAnd OR true constant and operator is LogicalOr.
13830 * statement.cs (ResolveUnreachable): Always reports warning.
13832 2004-12-05 Miguel de Icaza <miguel@ximian.com>
13834 * class.cs: Distinguish between 1721 and 1722 (just a little help
13835 for the programmer).
13837 2004-12-03 Miguel de Icaza <miguel@ximian.com>
13839 * delegate.cs: Only allow this on new versions of the language.
13841 2004-12-02 Duncan Mak <duncan@ximian.com>
13843 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
13845 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
13846 here as a static method. Take an additional bool out parameter
13847 `must_do_cs1540_check' for signaling to InstanceResolve.
13848 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
13849 member field from PropertyExpr class and made it an argument of
13850 the method instead.
13851 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
13852 check for MarshalByRefObject, and report CS0122 instead of CS1540.
13853 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
13854 and `remove_accessor' as well as InstanceResolve: report CS0122
13859 2004-12-03 Raja R Harinath <rharinath@novell.com>
13861 Fix test-327.cs, test-328.cs, and put in early infrastructure
13862 for eventually fixing #52697.
13863 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
13864 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
13865 from other methods.
13866 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
13867 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
13868 (VerifyUsing, error246): Update.
13869 * rootcontext.cs (RootContext.NamespaceLookup): Just use
13870 'NamespaceEntry.LookupNamespaceOrType'.
13872 2004-12-03 Martin Baulig <martin@ximian.com>
13874 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13875 method as our child, call AnonymousMethod.Compatible() on it.
13877 2004-12-03 Raja R Harinath <rharinath@novell.com>
13879 Disable XML documentation support in 'basic' profile.
13880 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
13881 Redirect XmlElement to System.Object.
13882 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
13883 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
13884 * mcs.exe.sources: Add doc-bootstrap.cs.
13885 * doc-bootstrap.cs: New file. Contains empty stub implementation
13888 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
13890 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
13891 comments are allowed.
13893 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
13895 * delegate.cs: Add checks for subtypes in paramaters and return values
13896 in VerifyMethod () to add support for Covariance/Contravariance
13899 2004-12-02 Miguel de Icaza <miguel@ximian.com>
13901 * report.cs: Remove extra closing parenthesis.
13903 * convert.cs (Error_CannotImplicitConversion): If the name of the
13904 types are the same, provide some extra information.
13906 * class.cs (FieldBase): Use an unused bit field from the field to
13907 encode the `has_offset' property from the FieldMember. This saves
13908 a couple of Ks on bootstrap compilation.
13910 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13911 method as our child, return the AnonymousMethod resolved
13914 * expression.cs (New.DoResolve): Allow return values from
13915 NewDelegate to also include AnonymousMethods.
13919 2004-12-02 Marek Safar <marek.safar@seznam.cz>
13922 * attribute.cs (Resolve): Improved implementation of params
13923 attribute arguments.
13925 * support.cs (ParameterData): Add HasParams to be faster.
13927 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
13929 all things are for /doc support:
13931 * doc.cs: new file that supports XML documentation generation.
13932 * mcs.exe.sources: added doc.cs.
13934 Handle /doc command line option.
13935 Report error 2006 instead of 5 for missing file name for /doc.
13936 Generate XML documentation when required, after type resolution.
13938 Added support for picking up documentation (/// and /** ... */),
13939 including a new XmlCommentState enumeration.
13941 Added lines to fill Documentation element for field, constant,
13942 property, indexer, method, constructor, destructor, operator, event
13943 and class, struct, interface, delegate, enum.
13944 Added lines to warn incorrect comment.
13946 Added Documentation field (passed only when /doc was specified).
13948 Added DocComment, DocCommentHeader, GenerateDocComment() and
13949 OnGenerateDocComment() and some supporting private members for
13950 /doc feature to MemberCore.
13952 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
13954 Added overriden DocCommentHeader.
13956 Added overriden DocCommentHeader and GenerateDocComment().
13958 2004-12-01 Miguel de Icaza <miguel@ximian.com>
13960 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
13961 unwrapping the enumeration values, chain to
13962 DoConstantNumericPromotions again, so we can promote things to the
13963 fundamental types (takes care of enums that are bytes, sbytes).
13967 2004-12-01 Raja R Harinath <rharinath@novell.com>
13969 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
13970 Fix long-standing bug in type-lookup. Use FindType instead of
13971 LookupType when ec.ResolvingTypeTree.
13972 (Attribute.ResolveType, Attribute.Resolve)
13973 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
13975 (Attributes.Search): Remove internal version. Update.
13976 (Attributes.SearchMulti): Update.
13977 (Attributes.GetClsCompliantAttribute): Remove.
13978 (Attributes.GetIndexerNameAttribute): Remove.
13979 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
13980 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
13981 * class.cs (Indexer.Define): Likewise.
13983 2004-12-01 Marek Safar <marek.safar@seznam.cz>
13986 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
13987 MarshallByReference members access.
13989 * expression.cs: Use CheckMarshallByRefAccess;
13990 Better error CS0197 message.
13992 * report.cs: Print whole related error message.
13994 2004-11-30 Raja R Harinath <rharinath@novell.com>
13996 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
13997 the current directory to help debugging.
13999 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14001 * class (GetClassBases): Better error 60 report.
14002 (EventProperty): Disabled warning 67 detection.
14004 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14007 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
14009 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
14012 2004-11-29 Marek Safar <marek.safar@seznam.cz>
14015 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
14017 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
14019 2004-11-26 Miguel de Icaza <miguel@ximian.com>
14021 * attribute.cs (Attribute.Resolve): Refine error reporting and
14022 report a cs0117 if the identifier does not exist, to distinguish
14023 from 0617 which is a miss-use of the actual identifier.
14025 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
14026 between cs0070 and cs0079.
14028 * class.cs (MemberBase.DoDefine): When reporting a wrong
14029 accessibility level, we use MethodCore to compare instead of
14030 Method (this was a regression in some refactoring effort).
14032 So now we correctly report cs0056 again.
14034 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
14035 testing the target_type (which was known to be object_type) and
14036 not the source type (which is anonymous_method).
14038 Fixed reporting of error cs1660.
14040 * expression.cs (UserCast.Source): Expose the underlying cast.
14042 * statement.cs (Switch.SwitchGoverningType): Sort the list of
14043 allowed types to find a match to int32 first (most common).
14045 In addition, it ignores any ImplicitUserConversions that did an
14046 internal implicit conversion (as the switch statement allows only
14047 one integral conversion to exist).
14049 * class.cs (PartialContainer.Create): rename `name' to
14050 `member_name' for clarity. Then replace the string calls with a
14051 call to MemberName.GetPartialName, as now using
14052 MemberName.ToString is an error (this is due to the side effects
14053 it had, that were fixed in the past).
14055 This will restore the error reporting on a number of partial class
14056 errors that were missusing this (and getting an exception as a
14057 results, which is now just a plain textual warning, because
14058 yyparse debug output would crash otherwise).
14060 2004-11-26 Raja R Harinath <rharinath@novell.com>
14062 * Makefile (PROGRAM_INSTALL_DIR): Remove.
14064 2004-11-25 Ben Maurer <bmaurer@ximian.com>
14066 * rootcontext.cs (LookupType): Make sure to cache lookups that
14067 don't give us a negative result. This saves about 5% of corlib
14070 2004-11-25 Miguel de Icaza <miguel@ximian.com>
14072 * report.cs (AbstractMessage.Print): messages are sent to stderr
14074 * class.cs (TypeContainer.GetClassBases): It is an error to have a
14075 non-interface in the list of interfaces (at this point, either
14076 parent was properly set, or a base class is being listed in the
14077 interfaces section).
14079 This flags error 1722, and resolves the crash from bug 69259.
14081 2004-11-25 Ben Maurer <bmaurer@ximian.com>
14083 * statement.cs (Using.EmitExpressionFinally): make this work right
14084 for valuetypes. Fixes 69926.
14086 2004-11-25 Miguel de Icaza <miguel@ximian.com>
14088 * const.cs (Const.ChangeType): Cope with the "0 literal can be
14089 converted to an enum" here, before we try to change the underlying
14090 type. This code exists, but it is a different code path than the
14091 one used while encoding constants.
14093 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
14094 old bug: when converting from the null literal to a pointer,
14095 return an EmptyCast, not the NullLiteral.
14097 This fixes #69921, the recent null_type changes probably made this
14098 bug more prominent.
14100 (ImplicitReferenceConversionExists): In addition, resynchronized
14101 the code here, so it matches the same code in
14102 ImplicitReferenceConversionExists for the `from any class-type S
14103 to any interface-type T'.
14106 2004-11-25 Marek Safar <marek.safar@seznam.cz>
14108 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
14110 2004-11-24 Miguel de Icaza <miguel@ximian.com>
14112 * cs-parser.jay: Use verbosity accordingly.
14114 2004-11-24 Marek Safar <marek.safar@seznam.cz>
14116 * expression.cs (Unary.ResolveOperator): Do not report warning;
14117 AddressOf reads from variable.
14119 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
14121 2004-11-24 Marek Safar <marek.safar@seznam.cz>
14125 * attribute.cs (Attributable): Removed CheckTargets.
14126 (Attributes.Emit): Explicit attribute targets are tested here.
14128 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
14129 not enabled for interfaces.
14131 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
14132 (GetAssemblyName): Ouch next bug there.
14134 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
14136 * expression.cs: Error 275 added.
14138 2004-11-23 Marek Safar <marek.safar@seznam.cz>
14140 Fix bug #69177 (Implemented decimal constant support)
14142 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
14143 (BinaryFold): Add DecimalConstant.
14145 * const.cs (Define): Decimal constant
14147 (ChangeType): Add decimal type handling.
14148 (LookupConstantValue): Don't set value for decimal type but
14149 emit DecimalConstantAttribute. Needed for constant optimization.
14151 * constant.cs (ToDecimal): New method.
14152 (ConvertToDecimal): New method.
14153 (IntConstant): Implemented ConvertToDecimal.
14154 (DecimalConstant.Emit): Emit optimized version for decimals in
14157 * expression.cs (ResolveOperator): Changed order of constant
14158 reduction to work correctly with native types which have
14159 overloaded operators.
14160 (ResolveMemberAccess): Extract constant value from attribute
14163 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
14165 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
14166 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
14167 (ChangeType): Decimal is special.
14168 (TypeToCoreType): Add decimal type.
14170 2004-11-22 Marek Safar <marek.safar@seznam.cz>
14172 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
14175 2004-11-22 Marek Safar <marek.safar@seznam.cz>
14177 * class.cs (EventField.ApplyAttributeBuilder): Fix error
14180 2004-11-19 Marek Safar <marek.safar@seznam.cz>
14182 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
14184 * pending.cs (PendingImplementation): Grab only interfaces.
14186 2004-11-19 Marek Safar <marek.safar@seznam.cz>
14188 * statement.cs (ForeachHelperMethods): Add location member and
14189 error 202 detection.
14191 2004-11-19 Raja R Harinath <rharinath@novell.com>
14193 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
14194 automatically handled by executable.make.
14195 (PROGRAM): Make profile-specific.
14197 2004-11-18 Marek Safar <marek.safar@seznam.cz>
14199 * expression.cs (DoResolveBase): Fixed wrong warning for out
14202 2004-11-18 Martin Baulig <martin@ximian.com>
14204 Merged latest changes into gmcs. Please keep this comment in
14205 here, it makes it easier for me to see what changed in MCS since
14206 the last time I merged.
14208 2004-11-17 Raja R Harinath <rharinath@novell.com>
14210 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
14211 (TypeHandle.GetMemberCache): New.
14212 (TypeHandle.TypeHandle): Update.
14213 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
14214 (TypeManager.LookupParentInterfacesCache):
14215 Rename from LookupInterfaceCache. Optimize slightly.
14216 (TypeManager.MemberLookup_FindMembers): Update.
14217 * decl.cs (MemberCache.MemberCache): Set Container to null in the
14218 multi-type variant.
14219 (AddCacheContents): Rename from AddHashtable.
14220 * class.cs (TypeContainer.parent_container): Remove.
14221 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
14222 (TypeContainer.DoDefineMembers): Don't initialize it.
14223 Update to name changes.
14225 2004-11-17 Miguel de Icaza <miguel@ximian.com>
14227 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
14228 that factors the code to check access modifiers on override.
14230 (PropertyBase): Use the code here.
14232 Patch from Lluis S'anchez, fixes bug #69361.
14234 2004-11-15 Miguel de Icaza <miguel@ximian.com>
14236 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
14237 routine that is used to report the use of a captured variable
14238 whose address has been taken.
14240 There are two checks: one when variables are being captured and
14241 the other check is when the address of a variable is taken.
14243 (because an anonymous methods might be resolved before *or* after
14244 the address has been taken) and
14246 * expression.cs (Conditional.DoResolve): Remove the special
14247 casing that Martin added to trueExpr and falseExpr being both
14248 NullLiteral. We get the right behavior now just by introducing
14249 the null_type into the compiler.
14251 * convert.cs (ExplicitConversion): Change the code to use
14252 null_type instead of testing `expr is NullLiteral'.
14253 (ImplicitConversionStandard): use null_type too.
14254 (ImplicitReferenceConversionExists): use null_type too.
14255 (ImplicitReferenceConversion): use null_type too.
14257 * literal.cs: The type of `NullLiteral' is now null_type instead
14259 (Resolve): Set the type here.
14261 * typemanager.cs: Introduce null_type.
14263 2004-11-17 Martin Baulig <martin@ximian.com>
14265 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
14266 direction, like FindMembers() does. Fixes #69546, testcase is in
14269 2004-11-16 Martin Baulig <martin@ximian.com>
14271 This is based on a patch from Marek Safar, see bug #69082.
14272 Fixes bugs #63705 and #67130.
14274 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
14275 method; create a MemberCache for an interface type and cache the
14278 * decl.cs (IMemberContainer.ParentContainer): Removed.
14279 (IMemberContainer.ParentCache): New property.
14280 (MemberCache.SetupCacheForInterface): Removed.
14281 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
14282 to create a cache for an interface's "parent".
14284 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
14287 2004-11-16 Martin Baulig <martin@ximian.com>
14289 Merged back from gmcs; these changes already went into gmcs a
14290 couple of weeks ago.
14293 (TypeManager.AddUserType): Removed the `ifaces' argument.
14294 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
14296 (TypeManager.AddUserInterface): Removed.
14297 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
14299 (TypeManager.GetInterfaces): Likewise.
14300 (TypeManager.GetExplicitInterfaces): Likewise.
14302 * ecore.cs (TypeExpr.GetInterfaces): Removed.
14304 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
14305 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
14307 2004-11-14 Ben Maurer <bmaurer@ximian.com>
14309 * statement.cs: Avoid adding bools to a hashtable.
14311 2004-11-07 Miguel de Icaza <miguel@ximian.com>
14313 * expression.cs (Invocation.OverloadResolve): Flag error if we are
14314 calling an unsafe method from a safe location.
14316 2004-11-06 Marek Safar <marek.safar@seznam.cz>
14319 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
14321 2004-11-06 Miguel de Icaza <miguel@ximian.com>
14323 * namespace.cs (VerifyUsing): use GetPartialName instead of
14326 2004-11-05 Miguel de Icaza <miguel@ximian.com>
14328 * statement.cs (Return.Resolve): Fix regression in typo: if
14329 `in_exc', we have to request a NeedReturnLabel, this was a typo
14330 introduced in the anonymous method check-in. Fixes #69131.
14332 * Indexers were using the ShortName when defining themselves,
14333 causing a regression in the compiler bootstrap when applying the
14334 patch from 2004-11-02 (first part), now they use their full name
14335 and the bug is gone.
14337 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
14339 * driver.cs: Strip the path from the names of embedded resources. Fixes
14342 2004-11-04 Raja R Harinath <rharinath@novell.com>
14344 Fix error message regression: cs0104-2.cs.
14345 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
14346 (AliasEntry.Resolve): Update.
14347 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
14349 (RootContext.LookupType): Update.
14351 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
14353 * cs-parser.jay: Add support for handling accessor modifiers
14354 * class: Add support port accessor modifiers and error checking,
14355 define PropertyMethod.Define as virtual (not abstract anymore)
14356 * ecore.cs: Add checking for proeprties access with access modifiers
14357 * iterators.cs: Modify Accessor constructor call based in the modified
14359 2004-11-02 Ben Maurer <bmaurer@ximian.com>
14361 * expression.cs (StringConcat): Handle being called twice,
14362 as when we have a concat in a field init with more than two
14365 2004-11-02 Miguel de Icaza <miguel@ximian.com>
14367 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
14368 special case explicit implementations, we should always produce
14369 the .property or .event declaration.
14371 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
14372 since it will not return correct data if people use this
14373 unresolved in the presence of using statements (see test-313).
14375 * class.cs (MethodData.Define): If we are an explicit interface
14376 implementation, set the method name to the full name of the
14377 interface plus the name of the method.
14379 Notice that using the method.MethodName.GetFullName() does not
14380 work, as it will only contain the name as declared on the source
14381 file (it can be a shorthand in the presence of using statements)
14382 and not the fully qualifed type name, for example:
14386 class D : ICloneable {
14387 object ICloneable.Clone () {
14391 Would produce a method called `ICloneable.Clone' instead of
14392 `System.ICloneable.Clone'.
14394 * namespace.cs (Alias.Resolve): Use GetPartialName.
14396 2004-11-01 Marek Safar <marek.safar@seznam.cz>
14398 * cs-parser.jay: Add error 1055 report.
14400 2004-11-01 Miguel de Icaza <miguel@ximian.com>
14402 * assign.cs (Assign.DoResolve): Only do the transform of
14403 assignment into a New if the types are compatible, if not, fall
14404 through and let the implicit code deal with the errors and with
14405 the necessary conversions.
14407 2004-11-01 Marek Safar <marek.safar@seznam.cz>
14409 * cs-parser.jay: Add error 1031 report.
14411 * cs-tokenizer.cs: Add location for error 1038.
14413 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14415 * cs-parser.jay: Add error 1016 report.
14417 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14419 * cs-parser.jay: Add errors 1575,1611 report.
14421 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14423 * cs-parser.jay: Add error 1001 report.
14425 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14428 * attribute.cs (GetMarshal): Add method argument for
14429 caller identification.
14431 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
14432 agument for GetMarshal and RuntimeMissingSupport.
14434 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14436 * attribute.cs (ExtractSecurityPermissionSet): Removed
14437 TypeManager.code_access_permission_type.
14439 * typemanager.cs: Removed TypeManager.code_access_permission_type.
14441 2004-10-27 Miguel de Icaza <miguel@ximian.com>
14443 * expression.cs (LocalVariableReference.DoResolveLValue): Check
14444 for obsolete use of a variable here. Fixes regression on errors
14445 cs0619-25 and cs0619-26.
14447 2004-10-27 Marek Safar <marek.safar@seznam.cz>
14449 Fix #62358, implemented security attribute encoding.
14451 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
14452 Tests permitted SecurityAction for assembly or other types.
14453 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
14454 data from SecurityPermissionAttribute to PermisionSet class.
14456 * class.cs (ApplyAttributeBuilder): Added special handling
14457 for System.Security.Permissions.SecurityAttribute based types.
14459 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
14460 special handling for System.Security.Permissions.SecurityAttribute
14463 * enum.cs (ApplyAttributeBuilder): Added special handling
14464 for System.Security.Permissions.SecurityAttribute based types.
14466 * parameter.cs (ApplyAttributeBuilder): Added special handling
14467 for System.Security.Permissions.SecurityAttribute based types.
14469 * rootcontext.cs: Next 2 core types.
14471 * typemanager.cs (TypeManager.security_permission_attr_type):
14472 Built in type for the SecurityPermission Attribute.
14473 (code_access_permission_type): Build in type.
14475 2004-10-17 Miguel de Icaza <miguel@ximian.com>
14477 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
14478 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
14479 all of this information into
14480 EmitContext.EmitCapturedVariableInstance.
14482 * codegen.cs (EmitCapturedVariableInstance): move here the
14483 funcionality of emitting an ldarg.0 in the presence of a
14484 remapping. This centralizes the instance emit code.
14486 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
14487 then emit a load of this: it means that we have reached the
14488 topmost ScopeInfo: the one that contains the pointer to the
14489 instance of the class hosting the anonymous method.
14491 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
14492 captures to the topmost CaptureContext.
14494 2004-10-12 Miguel de Icaza <miguel@ximian.com>
14496 * expression.cs (LocalVariableReference): Move the knowledge about
14497 the iterators into codegen's EmitCapturedVariableInstance.
14499 2004-10-11 Miguel de Icaza <miguel@ximian.com>
14501 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
14502 all code paths return a value from an anonymous method (it is the
14503 same as the 161 error, but for anonymous methods).
14505 2004-10-08 Miguel de Icaza <miguel@ximian.com>
14507 The introduction of anonymous methods in the compiler changed
14508 various ways of doing things in the compiler. The most
14509 significant one is the hard split between the resolution phase
14510 and the emission phases of the compiler.
14512 For instance, routines that referenced local variables no
14513 longer can safely create temporary variables during the
14514 resolution phase: they must do so from the emission phase,
14515 since the variable might have been "captured", hence access to
14516 it can not be done with the local-variable operations from the runtime.
14520 (Block.Flags): New flag `IsTopLevel' to indicate that this block
14521 is a toplevel block.
14523 (ToplevelBlock): A new kind of Block, these are the blocks that
14524 are created by the parser for all toplevel method bodies. These
14525 include methods, accessors and anonymous methods.
14527 These contain some extra information not found in regular blocks:
14528 A pointer to an optional CaptureContext (for tracking captured
14529 local variables and parameters). A pointer to the parent
14532 (Return.Resolve): Catch missmatches when returning a value from an
14533 anonymous method (error 1662).
14534 Invoke NeedReturnLabel from the Resolve phase instead of the emit
14537 (Break.Resolve): ditto.
14539 (SwitchLabel): instead of defining the labels during the
14540 resolution phase, we now turned the public ILLabel and ILLabelCode
14541 labels into methods called GetILLabelCode() and GetILLabel() that
14542 only define the label during the Emit phase.
14544 (GotoCase): Track the SwitchLabel instead of the computed label
14545 (its contained therein). Emit the code by using
14546 SwitchLabel.GetILLabelCode ().
14548 (LocalInfo.Flags.Captured): A new flag has been introduce to track
14549 whether the Local has been captured or not.
14551 (LocalInfo.IsCaptured): New property, used to tell whether the
14552 local has been captured.
14554 * anonymous.cs: Vastly updated to contain the anonymous method
14557 The main classes here are: CaptureContext which tracks any
14558 captured information for a toplevel block and ScopeInfo used to
14559 track the activation frames for various local variables.
14561 Each toplevel block has an optional capture context associated
14562 with it. When a method contains an anonymous method both the
14563 toplevel method and the anonymous method will create a capture
14564 context. When variables or parameters are captured, they are
14565 recorded on the CaptureContext that owns them, for example:
14569 MyDelegate d = delegate {
14574 Here `a' will be recorded as captured on the toplevel
14575 CapturedContext, the inner captured context will not have anything
14576 (it will only have data if local variables or parameters from it
14577 are captured in a nested anonymous method.
14579 The ScopeInfo is used to track the activation frames for local
14580 variables, for example:
14582 for (int i = 0; i < 10; i++)
14583 for (int j = 0; j < 10; j++){
14584 MyDelegate d = delegate {
14589 At runtime this captures a single captured variable `i', but it
14590 captures 10 different versions of the variable `j'. The variable
14591 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
14592 recorded on a child.
14594 The toplevel ScopeInfo will also track information like the `this'
14595 pointer if instance variables were referenced (this is necessary
14596 as the anonymous method lives inside a nested class in the host
14597 type of the method).
14599 (AnonymousMethod): Expanded to track the Toplevel, implement
14600 `AnonymousMethod.Compatible' to tell whether an anonymous method
14601 can be converted to a target delegate type.
14603 The routine now also produces the anonymous method content
14605 (AnonymousDelegate): A helper class that derives from
14606 DelegateCreation, this is used to generate the code necessary to
14607 produce the delegate for the anonymous method that was created.
14609 * assign.cs: API adjustments for new changes in
14610 Convert.ImplicitStandardConversionExists.
14612 * class.cs: Adjustments to cope with the fact that now toplevel
14613 blocks are of type `ToplevelBlock'.
14615 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
14616 insteda of standard blocks.
14618 Flag errors if params arguments are passed to anonymous methods.
14620 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
14621 `CurrentAnonymousMethod' which points to the current Anonymous
14622 Method. The variable points to the AnonymousMethod class that
14623 holds the code being compiled. It is set in the new EmitContext
14624 created for the anonymous method.
14626 (EmitContext.Phase): Introduce a variable and an enumeration to
14627 assist in enforcing some rules about when and where we are allowed
14628 to invoke certain methods (EmitContext.NeedsReturnLabel is the
14629 only one that enfonces this right now).
14631 (EmitContext.HaveCaptureInfo): new helper method that returns
14632 whether we have a CapturedContext initialized.
14634 (EmitContext.CaptureVariable): New method used to register that a
14635 LocalInfo must be flagged for capturing.
14637 (EmitContext.CapturedParameter): New method used to register that a
14638 parameters must be flagged for capturing.
14640 (EmitContext.CapturedField): New method used to register that a
14641 field must be flagged for capturing.
14643 (EmitContext.HaveCapturedVariables,
14644 EmitContext.HaveCapturedFields): Return whether there are captured
14645 variables or fields.
14647 (EmitContext.EmitMethodHostInstance): This is used to emit the
14648 instance for the anonymous method. The instance might be null
14649 (static methods), this (for anonymous methods that capture nothing
14650 and happen to live side-by-side with the current method body) or a
14651 more complicated expression if the method has a CaptureContext.
14653 (EmitContext.EmitTopBlock): Routine that drives the emission of
14654 code: it will first resolve the top block, then emit any metadata
14655 and then emit the code. The split is done so that we can extract
14656 any anonymous methods and flag any captured variables/parameters.
14658 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
14659 during this phase, the ILGenerator should not be used as labels
14660 and local variables declared here might not be accessible to any
14661 code that is part of an anonymous method.
14663 Exceptions to this include the temporary variables that are
14664 created by some statements internally for holding temporary
14667 (EmitContext.EmitMeta): New routine, in charge of emitting all the
14670 (EmitContext.TemporaryReturn): This method is typically called
14671 from the Emit phase, and its the only place where we allow the
14672 ReturnLabel to be defined other than the EmitMeta. The reason is
14673 that otherwise we would have to duplicate a lot of logic in the
14674 Resolve phases of various methods that today is on the Emit
14677 (EmitContext.NeedReturnLabel): This no longer creates the label,
14678 as the ILGenerator is not valid during the resolve phase.
14680 (EmitContext.EmitThis): Extended the knowledge in this class to
14681 work in anonymous methods in addition to iterators.
14683 (EmitContext.EmitCapturedVariableInstance): This emits whatever
14684 code is necessary on the stack to access the instance to a local
14685 variable (the variable will be accessed as a field).
14687 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
14688 EmitContext.EmitAddressOfParameter): Routines to support
14689 parameters (not completed at this point).
14691 Removals: Removed RemapLocal and RemapLocalLValue. We probably
14692 will also remove the parameters.
14694 * convert.cs (Convert): Define a `ConstantEC' which points to a
14695 null. This is just to prefity some code that uses
14696 ImplicitStandardConversion code and do not have an EmitContext
14699 The idea is to flag explicitly that at that point in time, it is
14700 known that the conversion will not trigger the delegate checking
14701 code in implicit conversions (which requires a valid
14704 Everywhere: pass new EmitContext parameter since
14705 ImplicitStandardConversionExists now requires it to check for
14706 anonymous method conversions.
14708 (Convert.ImplicitStandardConversionExists): If the type of an
14709 expression is the anonymous_method_type, and the type is a
14710 delegate, we invoke the AnonymousMethod.Compatible method to check
14711 whether an implicit conversion is possible.
14713 (Convert.ImplicitConversionStandard): Only do implicit method
14714 group conversions if the language level is not ISO_1.
14716 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
14717 MethodInfo for the Invoke method. used by Delegate and
14720 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
14721 method conversions if the target type is a delegate.
14723 Removed extra debugging nops.
14725 (LocalVariableReference): Turn the `local_info' into a public
14728 Add `prepared' field, the same hack used for FieldExprs to cope
14729 with composed assignments, as Local variables do not necessarily
14730 operate purely on the stack as they used to: they can be captured
14733 Add `temp' for a temporary result, like fields.
14735 Refactor DoResolve and DoResolveLValue into DoResolveBase.
14737 It now copes with Local variables that are captured and emits the
14738 proper instance variable to load it from a field in the captured
14741 (ParameterReference.DoResolveBase): During the resolve phase,
14742 capture parameters if we are in an anonymous method.
14744 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
14745 anonymous method, use the EmitContext helper routines to emit the
14746 parameter reference.
14748 * iterators.cs: Set RemapToProxy to true/false during the
14751 * parameters.cs (GetParameterByName): New helper method.
14753 * typemanager.cs (anonymous_method_type) a new type that
14754 represents an anonyous method. This is always an internal type,
14755 used as a fencepost to test against the anonymous-methodness of an
14758 2004-10-20 Marek Safar <marek.safar@seznam.cz>
14760 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
14762 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
14764 2004-10-18 Martin Baulig <martin@ximian.com>
14766 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
14767 `Type' directly, but call ResolveType() on it.
14768 (Catch.Resolve): Likewise.
14769 (Foreach.Resolve): Likewise.
14771 2004-10-18 Martin Baulig <martin@ximian.com>
14773 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
14774 `Type' directly, but call ResolveType() on it.
14775 (Probe.DoResolve): Likewise.
14776 (ArrayCreation.LookupType): Likewise.
14777 (TypeOf.DoResolve): Likewise.
14778 (SizeOf.DoResolve): Likewise.
14780 2004-10-18 Martin Baulig <martin@ximian.com>
14782 * expression.cs (Invocation.BetterFunction): Put back
14783 TypeManager.TypeToCoreType().
14785 2004-10-18 Raja R Harinath <rharinath@novell.com>
14787 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
14790 2004-10-18 Martin Baulig <martin@ximian.com>
14792 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
14793 `Type' directly, but call ResolveType() on it.
14795 2004-10-18 Martin Baulig <martin@ximian.com>
14797 * class.cs (FieldMember.Define): Don't access the TypeExpr's
14798 `Type' directly, but call ResolveType() on it.
14799 (MemberBase.DoDefine): Likewise.
14801 * expression.cs (New.DoResolve): Don't access the TypeExpr's
14802 `Type' directly, but call ResolveType() on it.
14803 (ComposedCast.DoResolveAsTypeStep): Likewise.
14805 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
14806 `Type' directly, but call ResolveType() on it.
14808 2004-10-17 John Luke <john.luke@gmail.com>
14810 * class.cs (Operator.GetSignatureForError): use CSharpName
14812 * parameter.cs (Parameter.GetSignatureForError): Returns
14813 correct name even if was not defined.
14815 2004-10-13 Raja R Harinath <rharinath@novell.com>
14818 * class.cs (TypeContainer.EmitContext): New property.
14819 (DefineNestedTypes): Create an emitcontext for each part.
14820 (MethodCore.DoDefineParameters): Use container's emitcontext.
14821 Pass type array to InternalParameters.
14822 (MemberBase.DoDefine): Use container's emitcontext.
14823 (FieldMember.Define): Likewise.
14824 (Event.Define): Likewise.
14825 (SetMethod.GetParameterInfo): Change argument to EmitContext.
14826 Pass type array to InternalParameters.
14827 (SetIndexerMethod.GetParameterInfo): Likewise.
14828 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
14829 * delegate.cs (Define): Pass emitcontext to
14830 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
14831 array to InternalParameters.
14832 * expression.cs (ParameterReference.DoResolveBase): Pass
14833 emitcontext to GetParameterInfo.
14834 (ComposedCast.DoResolveAsTypeStep): Remove check on
14835 ec.ResolvingTypeTree.
14836 * parameter.cs (Parameter.Resolve): Change argument to
14837 EmitContext. Use ResolveAsTypeTerminal.
14838 (Parameter.GetSignature): Change argument to EmitContext.
14839 (Parameters.ComputeSignature): Likewise.
14840 (Parameters.ComputeParameterTypes): Likewise.
14841 (Parameters.GetParameterInfo): Likewise.
14842 (Parameters.ComputeAndDefineParameterTypes): Likewise.
14843 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
14844 * support.cs (InternalParameters..ctor): Remove variant that takes
14846 * typemanager.cs (system_intptr_expr): New.
14847 (InitExpressionTypes): Initialize it.
14849 2004-10-12 Chris Toshok <toshok@ximian.com>
14851 * cs-parser.jay: fix location for try_statement and catch_clause.
14853 2004-10-11 Martin Baulig <martin@ximian.com>
14855 * report.cs: Don't make --fatal abort on warnings, we have
14856 -warnaserror for that.
14858 2004-10-07 Raja R Harinath <rharinath@novell.com>
14860 More DeclSpace.ResolveType avoidance.
14861 * decl.cs (MemberCore.InUnsafe): New property.
14862 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
14863 with newly created EmitContext.
14864 (FieldMember.Define): Likewise.
14865 * delegate.cs (Delegate.Define): Likewise.
14866 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
14867 only if normal name-lookup fails.
14868 (TypeExpr.DoResolve): Enable error-checking.
14869 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
14870 (SizeOf.DoResolve): Likewise.
14871 (ComposedCast.DoResolveAsTypeStep): Likewise.
14872 (StackAlloc.DoResolve): Likewise.
14873 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
14874 (Block.Unsafe): New property.
14875 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
14876 (Unsafe): Set 'unsafe' flag of contained block.
14877 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
14878 (Fixed.Resolve): Likewise.
14879 (Catch.Resolve): Likewise.
14880 (Using.ResolveLocalVariableDecls): Likewise.
14881 (Foreach.Resolve): Likewise.
14883 2004-10-05 John Luke <john.luke@gmail.com>
14885 * cs-parser.jay: add location to error CS0175
14887 2004-10-04 Miguel de Icaza <miguel@ximian.com>
14889 * ecore.cs (Expression.Constantity): Add support for turning null
14892 * const.cs (Const.Define): Allow constants to be reference types
14893 as long as the value is Null.
14895 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
14897 * namespace.cs (NamespaceEntry.Using): No matter which warning
14898 level is set, check if this namespace name has already been added.
14900 2004-10-03 Ben Maurer <bmaurer@ximian.com>
14902 * expression.cs: reftype [!=]= null should always use br[true,false].
14905 2004-10-03 Marek Safar <marek.safar@seznam.cz>
14908 * attribute.cs: Enum conversion moved to
14909 GetAttributeArgumentExpression to be applied to the all
14912 2004-10-01 Raja R Harinath <rharinath@novell.com>
14914 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
14915 * class.c (TypeContainer.DefineType): Flag error if
14916 base types aren't accessible due to access permissions.
14917 * decl.cs (DeclSpace.ResolveType): Move logic to
14918 Expression.ResolveAsTypeTerminal.
14919 (DeclSpace.ResolveTypeExpr): Thin layer over
14920 Expression.ResolveAsTypeTerminal.
14921 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
14922 Refactor code into NestedAccess. Use it.
14923 (DeclSpace.NestedAccess): New.
14924 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
14925 argument to silence errors. Check access permissions.
14926 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
14927 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
14928 (Cast.DoResolve): Likewise.
14929 (New.DoResolve): Likewise.
14930 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
14931 (TypeOf.DoResolve): Likewise.
14933 * expression.cs (Invocation.BetterConversion): Return the Type of
14934 the better conversion. Implement section 14.4.2.3 more faithfully.
14935 (Invocation.BetterFunction): Make boolean. Make correspondence to
14936 section 14.4.2.2 explicit.
14937 (Invocation.OverloadResolve): Update.
14938 (Invocation): Remove is_base field.
14939 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
14940 (Invocation.Emit): Likewise.
14942 2004-09-27 Raja R Harinath <rharinath@novell.com>
14944 * README: Update to changes.
14946 2004-09-24 Marek Safar <marek.safar@seznam.cz>
14948 * cs-parser.jay: Reverted 642 warning fix.
14950 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14953 * decl.cs (FindMemberWithSameName): Indexer can have more than
14956 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14958 * expression.cs (LocalVariableReference.DoResolveLValue):
14959 Do not report warning 219 for out values.
14960 (EmptyExpression.Null): New member to avoid extra allocations.
14962 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14964 * cs-parser.jay: Fix wrong warning 642 report.
14966 * cs-tokenizer.cs (CheckNextToken): New helper;
14967 Inspect next character if is same as expected.
14969 2004-09-23 Martin Baulig <martin@ximian.com>
14971 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
14972 (Convert.ImplicitReferenceConversionExists): Likewise.
14974 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14976 * class.cs (Operator.Define): Add error 448 and 559 report.
14978 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14980 * class.cs (MemberBase.IsTypePermitted): New protected
14981 method for checking error CS0610.
14983 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14985 * class.cs (TypeContainer.HasExplicitLayout): New property
14986 Returns whether container has StructLayout attribute set Explicit.
14987 (FieldMember): New abstract class for consts and fields.
14988 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
14989 (Field): Reuse FieldMember.
14991 * const.cs (Const): Reuse FieldMember.
14993 * rootcontext.cs: EmitConstants call moved to class.
14995 2004-09-22 Martin Baulig <martin@ximian.com>
14997 Thanks to Peter Sestoft for this bug report.
14999 * expression.cs (Conditional): If both the `trueExpr' and the
15000 `falseExpr' is a NullLiteral, return a NullLiteral.
15002 2004-09-22 Martin Baulig <martin@ximian.com>
15004 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
15005 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
15006 for the "get_Current" call.
15008 2004-09-22 Martin Baulig <martin@ximian.com>
15010 Marek and me just fixed one of our oldest bugs: #28562 :-)
15012 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
15014 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
15015 we're an EnumConstant, just return that.
15016 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
15017 an EnumConstant. In this case, we need to use GetValueAsEnumType()
15018 to get the value which'll actually be written into the attribute.
15019 However, we have to use GetValue() to access the attribute's value
15022 2004-09-22 Marek Safar <marek.safar@seznam.cz>
15024 * constant.cs (Constant.IsNegative): New abstract property
15027 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
15028 (StackAlloc.DoResolve): Reused IsNegative.
15030 2004-09-21 Martin Baulig <martin@ximian.com>
15032 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
15033 if we're used in an iterator, we may be called from different
15036 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
15037 we actually have an exception block.
15039 2004-09-20 John Luke <jluke@cfl.rr.com>
15041 * class.cs, cs-parser.jay: Improve the error report for 1520:
15042 report the actual line where the error happens, not where the
15043 class was declared.
15045 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
15046 Pass location information that was available elsewhere.
15048 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
15050 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
15051 runtime to delay sign assemblies.
15053 2004-09-19 Miguel de Icaza <miguel@ximian.com>
15055 * cs-parser.jay: Do not report the stack trace, this is barely
15058 2004-08-22 John Luke <john.luke@gmail.com>
15060 * driver.cs : check that a resource id is not already used
15061 before adding it, report CS1508 if it is, bug #63637
15063 2004-09-19 Miguel de Icaza <miguel@ximian.com>
15065 * ecore.cs: Removed dead code.
15067 2004-09-18 Marek Safar <marek.safar@seznam.cz>
15069 * class.cs: Do not report warning CS0067 on the interfaces.
15071 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15073 * cs-parser.jay: Add error 504 report.
15075 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15077 * rootcontext.cs: WarningLevel is 4 by default now.
15079 * statement.cs (Fixed.Resolve): Do not null
15082 2004-09-16 Marek Safar <marek.safar@seznam.cz>
15085 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
15086 deep search when property is not virtual.
15087 (PropertyExpr.ResolveAccessors): Make one call for both
15090 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15093 * statement.cs: Error 152 report constains also location.
15095 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15098 * const.cs: Explicitly set constant as static.
15100 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15103 * cs-parser.jay: Add error 1017 report.
15105 2004-09-15 Marek Safar <marek.safar@seznam.cz>
15107 Fixed bug #59980, #64224
15108 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
15110 * typemanager.cs (IsSpecialMethod): Simplified
15112 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15114 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
15115 condition with better params.
15117 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15120 * attribute.cs (Resolve): Property has to have both
15123 2004-09-14 Martin Baulig <martin@ximian.com>
15125 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
15127 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15130 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
15131 called and is obsolete then this member suppress message
15132 when call is inside next [Obsolete] method or type.
15134 * expression.cs: Use TestObsoleteMethodUsage member.
15136 2004-09-14 Martin Baulig <martin@ximian.com>
15138 * cs-parser.jay: Sync a bit with the GMCS version.
15140 2004-09-14 Martin Baulig <martin@ximian.com>
15142 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
15143 (CSharpParser.yacc_verbose_flag): New public field.
15145 * genericparser.cs: Removed.
15147 2004-09-14 Raja R Harinath <rharinath@novell.com>
15149 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
15151 2004-09-13 Marek Safar <marek.safar@seznam.cz>
15153 * class.cs (MethodCore.CheckBase): Fix bug #65757.
15155 2004-09-10 Martin Baulig <martin@ximian.com>
15157 Backported my MemberName changes from GMCS into MCS.
15159 - we are now using a special `MemberName' class instead of using
15160 strings; in GMCS, the `MemberName' also contains the type
15163 - changed the grammar rules a bit:
15164 * the old `member_name' is now a `namespace_or_type_name':
15165 The rule is that we use `namespace_or_type_name' everywhere
15166 where we expect either a "member name" (GetEnumerator) or a
15167 "member name" with an explicit interface name
15168 (IEnumerable.GetEnumerator).
15169 In GMCS, the explicit interface name may include type arguments
15170 (IEnumerable<T>.GetEnumerator).
15171 * we use `member_name' instead of just `IDENTIFIER' for
15173 The rule is that we use `member_name' wherever a member may
15174 have type parameters in GMCS.
15176 * decl.cs (MemberName): New public class.
15177 (MemberCore.MemberName): New public readonly field.
15178 (MemberCore.ctor): Take a `MemberName' argument, not a string.
15179 (DeclSpace): Likewise.
15181 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
15182 * enum.cs (Enum.ctor): Likewise.
15184 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
15186 (AliasEntry.ctor): Take a MemberName, not an Expression.
15187 (AliasEntry.UsingAlias): Likewise.
15189 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
15190 (IMethodData.MemberName): Changed type from string to MemberName.
15191 (MemberBase.ExplicitInterfaceName): Likewise.
15192 (AbstractPropertyEventMethod.SetupName): Make this private.
15193 (AbstractPropertyEventMethod.ctor): Added `string prefix'
15194 argument; compute the member name here.
15195 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
15196 on the `member.MemberName' and the `prefix'.
15198 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
15200 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
15201 thus, we get a `MemberName' instead of a `string'. These
15202 declarations may have type parameters in GMCS.
15203 (interface_method_declaration, delegate_declaration): Likewise.
15204 (class_declaration, interface_declaration): Likewise.
15205 (method_header): Use `namespace_or_type_name' instead of
15206 `member_name'. We may be an explicit interface implementation.
15207 (property_declaration, event_declaration): Likewise.
15208 (member_name): This is now just an `IDENTIFIER', not a
15209 `namespace_or_type_name'.
15210 (type_name, interface_type): Removed.
15211 (namespace_or_type_name): Return a MemberName, not an Expression.
15212 (primary_expression): Use `member_name' instead of `IDENTIFIER';
15213 call GetTypeExpression() on the MemberName to get an expression.
15214 (IndexerDeclaration.interface_type): Changed type from string to
15216 (MakeName): Operate on MemberName's instead of string's.
15218 2004-09-13 Raja R Harinath <rharinath@novell.com>
15221 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
15222 (NamespaceEntry.Lookup): Add new argument to flag if we want the
15223 lookup to avoid symbols introduced by 'using'.
15224 * rootcontext.cs (NamespaceLookup): Update.
15226 2004-09-12 Marek Safar <marek.safar@seznam.cz>
15228 * class.cs (TypeContainer.DoDefineMembers): Do not call
15229 DefineDefaultConstructor for static classes.
15231 2004-09-12 Marek Safar <marek.safar@seznam.cz>
15233 * attribute.cs (Attribute.Resolve): Add error 653 report.
15235 * class.cs (Class.ApplyAttributeBuilder): Add error 641
15237 (Method.ApplyAttributeBuilder): Add error 685 report.
15238 (Operator.Define): Add error 564 report.
15240 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15242 * expression.cs (Invocation.DoResolve): Add error
15243 245 and 250 report.
15245 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
15248 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15250 * class.cs (ConstructorInitializer.Resolve):
15251 Wrong error number (515->516).
15253 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15255 * class.cs (Indexer.Define): Add error 631 report.
15257 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15259 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
15261 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15263 * expression.cs (Probe.DoResolve): Add error CS0241 report.
15265 2004-09-10 Marek Safar <marek.safar@seznam.cz>
15267 * cs-parser.jay: Added error CS0241 report.
15269 2004-09-10 Raja R Harinath <rharinath@novell.com>
15271 * cs-parser.jay (fixed_statement): Introduce a scope for the
15272 declaration in the 'fixed' statement.
15274 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15276 * cs-parser.jay: Added CS0230 error report.
15278 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15280 * cs-parser.jay: Added errors CS0231 and CS0257 report.
15282 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15284 * expression.cs (Argument.Resolve): Added error CS0192 and
15287 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15289 C# 2.0 #pragma warning feature
15291 * cs-tokenizer.cs (PreProcessPragma): New method;
15292 Handles #pragma directive.
15294 * report.cs (WarningRegions): New class; Support
15295 class for #pragma warning directive. It tests whether
15296 warning is enabled for a given line.
15298 2004-09-08 Miguel de Icaza <miguel@ximian.com>
15300 * const.cs: Add more descriptive error report, tahnks to
15303 2004-09-08 Marek Safar <marek.safar@seznam.cz>
15305 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
15307 2004-09-07 Miguel de Icaza <miguel@ximian.com>
15309 * expression.cs: Apply patch from Ben: Remove dead code from
15310 ArrayCreation, and remove the TurnintoConstant call in const.cs,
15311 as that code just threw an exception anwyays.
15313 * const.cs: Remove the call to the turnintoconstant, for details
15316 * literal.cs: The type of the null-literal is the null type; So
15317 we use a placeholder type (literal.cs:System.Null, defined here)
15320 * expression.cs (Conditional.DoResolve): Remove some old code that
15321 is no longer needed, conversions have been fixed.
15323 (ArrayCreationExpression.DoResolve): Return false if we fail to
15324 resolve the inner expression.
15326 2004-09-07 Raja R Harinath <rharinath@novell.com>
15329 * cs-parser.jay (delegate_declaration): Record a delegate
15330 declaration as a type declaration.
15331 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
15333 2004-09-06 Miguel de Icaza <miguel@ximian.com>
15335 * parameter.cs: Do not crash if the type can not be resolved.
15337 * expression.cs: Report errors with unsafe pointers, fixes #64896
15339 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
15341 * expression.cs: Pointer arith always needs to do a conv.i
15342 if the operand is a long. fix 65320
15344 2004-09-04 Marek Safar <marek.safar@seznam.cz>
15346 Fixed cs0619-37.cs, cs0619-38.cs
15348 * enum.cs (GetObsoleteAttribute): Removed.
15350 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
15351 on Enum member is double staged. The first is tested member
15354 2004-09-04 Marek Safar <marek.safar@seznam.cz>
15356 Fixed #56986, #63631, #65231
15358 * class.cs: (TypeContainer.AddToMemberContainer): New method,
15359 adds member to name container.
15360 (TypeContainer.AddToTypeContainer): New method, adds type to
15362 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
15363 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
15364 AddOperator): Simplified by reusing AddToMemberContainer.
15365 (TypeContainer.UserDefinedStaticConstructor): Changed to property
15367 (Method.CheckForDuplications): Fixed implementation to test all
15369 (MemberBase): Detection whether member is explicit interface
15370 implementation is now in constructor.
15371 (MemberBase.UpdateMemberName): Handles IndexerName.
15372 (Accessor): Changed to keep also location information.
15373 (AbstractPropertyEventMethod): Is derived from MemberCore.
15374 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
15375 will be emited or not.
15376 (PropertyBase.AreAccessorsDuplicateImplementation):
15377 Tests whether accessors are not in collision with some method.
15378 (Operator): Is derived from MethodCore to simplify common
15381 * decl.cs (Flags.TestMethodDuplication): Test for duplication
15383 (DeclSpace.AddToContainer): Adds the member to defined_names
15384 table. It tests for duplications and enclosing name conflicts.
15386 * enum.cs (EnumMember): Clean up to reuse the base structures
15388 2004-09-03 Martin Baulig <martin@ximian.com>
15390 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
15391 into TypeContainer, to make partial classes work again.
15393 2004-09-03 Martin Baulig <martin@ximian.com>
15395 * rootcontext.cs (RootContext.V2): Removed.
15397 2004-03-23 Martin Baulig <martin@ximian.com>
15399 * expression.cs (Invocation.OverloadResolve): Added `bool
15400 may_fail' argument and use it instead of the Location.IsNull() hack.
15402 2004-09-03 Martin Baulig <martin@ximian.com>
15404 Merged latest changes into gmcs. Please keep this comment in
15405 here, it makes it easier for me to see what changed in MCS since
15406 the last time I merged.
15408 2004-09-03 Raja R Harinath <rharinath@novell.com>
15411 * expression.cs (BetterConversion): Don't allow either conversion
15412 to be null. Remove redundant implicit conversion test when 'q ==
15413 null' -- when this function is invoked, we already know that the
15414 implicit conversion exists.
15415 (BetterFunction): Assume that 'best' is non-null. Remove
15416 redundant reimplementation of IsApplicable when 'best' is null.
15417 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
15418 number of arguments.
15419 (IsAncestralType): Extract from OverloadResolve.
15420 (OverloadResolve): Make robust to the MethodGroupExpr being
15421 unsorted. Implement all the logic of Section 14.5.5.1, and
15422 support overloading of methods from multiple applicable types.
15423 Clean up logic somewhat. Don't pass null methods to BetterFunction.
15425 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
15426 (RealError, Warning): Append type of report to related symbol.
15428 2004-09-03 Marek Safar <marek.safar@seznam.cz>
15430 * enum.cs: Fixed CLS-Compliance checks for enum members.
15431 Error tests cs3008-8.cs, cs3014-8.cs
15433 2004-09-02 Marek Safar <marek.safar@seznam.cz>
15435 Fixed bug #62342, #63102
15436 * class.cs: ImplementIndexer uses member.IsExplicitImpl
15437 like ImplementMethod.
15439 2004-09-02 Marek Safar <marek.safar@seznam.cz>
15441 * attribute.cs (Attribute.GetAttributeArgumentExpression):
15444 2004-09-02 Martin Baulig <martin@ximian.com>
15446 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
15447 TypeManager.GetArgumentTypes() rather than calling GetParameters()
15450 2004-09-01 Marek Safar <marek.safar@seznam.cz>
15452 C# 2.0 Static classes implemented
15454 * class.cs (TypeContainer): instance_constructors,
15455 initialized_fields, initialized_static_fields,
15456 default_constructor, base_inteface_types are protected to be
15457 accessible from StaticClass.
15458 (TypeContainer.DefineDefaultConstructor): New virtual method
15459 for custom default constructor generating
15460 (StaticClass): New class to handle "Static classes" feature.
15462 * cs-parser.jay: Handle static keyword on class like instance
15465 * driver.cs: Added "/langversion" command line switch with two
15466 options (iso-1, default).
15468 2004-08-31 Marek Safar <marek.safar@seznam.cz>
15470 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
15472 2004-08-31 Miguel de Icaza <miguel@ximian.com>
15474 * delegate.cs: Style.
15476 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
15478 * delegate.cs: Add seperate instance expr field for miguel.
15480 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
15482 * PointerArithmetic (Resolve): make sure we are not doing
15483 pointer arith on void*. Also, make sure we are resolved
15484 by not setting eclass until resolve.
15486 All callers: Make sure that PointerArithmetic gets resolved.
15488 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
15490 * ArrayCreation (LookupType): If the type does not resolve
15491 to an array, give an error.
15493 2004-08-27 Marek Safar <marek.safar@seznam.cz>
15495 * statement.cs (Try.Resolve): Fixed bug #64222
15497 2004-08-27 Martin Baulig <martin@ximian.com>
15500 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
15503 2004-08-26 Marek Safar <marek.safar@seznam.cz>
15505 * ecore.cs (Constantify): Get underlying type via
15506 System.Enum.GetUnderlyingType to avoid StackOverflow on the
15507 Windows in special cases.
15509 2004-08-26 Marek Safar <marek.safar@seznam.cz>
15511 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
15512 for obtaining also private methods.
15513 (GetRemoveMethod): Used GetRemoveMethod (true)
15514 for obtaining also private methods.
15516 2004-08-24 Martin Baulig <martin@ximian.com>
15518 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
15519 MethodAttributes.HideBySig for operators.
15521 2004-08-23 Martin Baulig <martin@ximian.com>
15523 Back to the old error reporting system :-)
15525 * report.cs (Message): Removed.
15526 (Report.MessageData, ErrorData, WarningData): Removed.
15527 (Report.Error, Warning): Back to the old system.
15529 2004-08-23 Martin Baulig <martin@ximian.com>
15531 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
15533 * class.cs (TypeContainer.ParentContainer): New public virtual
15534 method; replaces the explicit interface implementation.
15535 (ClassPart.ParentContainer): Override.
15537 2004-08-23 Martin Baulig <martin@ximian.com>
15539 * statement.cs (Switch): Added support for constant switches; see
15540 #59428 or test-285.cs.
15542 2004-08-22 Marek Safar <marek.safar@seznam.cz>
15545 * statement.cs (GetEnumeratorFilter): Removed useless
15546 logic because C# specs is strict. GetEnumerator must be
15549 2004-08-22 Martin Baulig <martin@ximian.com>
15551 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15552 a switch and may break, reset the barrier. Fixes #59867.
15554 2004-08-22 Marek Safar <marek.safar@seznam.cz>
15556 CLS-Compliance speed up (~5% for corlib)
15558 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
15559 New method. Tests container for CLS-Compliant names
15561 * class.cs (TypeContainer.VerifyClsName): New method.
15562 Checks whether container name is CLS Compliant.
15563 (Constructor): Implements IMethodData.
15565 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
15566 low-case table for CLS Compliance test.
15567 (MemberCache.VerifyClsParameterConflict): New method.
15568 Checks method parameters for CS3006 error.
15570 * enum.cs (EnumMember): Is derived from MemberCore.
15571 (Enum.VerifyClsName): Optimized for better performance.
15573 2004-08-06 Marek Safar <marek.safar@seznam.cz>
15575 * report.cs: Renamed Error_T to Error and changed all
15578 2004-08-06 Marek Safar <marek.safar@seznam.cz>
15580 * class.cs (TypeContainer.IndexerArrayList): New inner class
15581 container for indexers.
15582 (TypeContainer.DefaultIndexerName): New constant for default
15583 indexer name. Replaced all "Item" with this constant.
15584 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
15586 * typemanager.cs (TypeManager.default_member_ctor): Cache here
15587 DefaultMemberAttribute constructor.
15589 2004-08-05 Martin Baulig <martin@ximian.com>
15591 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
15594 2004-08-05 Marek Safar <marek.safar@seznam.cz>
15596 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
15597 multi platforms problem.
15599 * compiler.csproj: Included shared files.
15601 2004-08-04 Marek Safar <marek.safar@seznam.cz>
15603 Fix bug 60333, 55971 in the more general way
15604 * attribute.cs (Attribute.GetAttributeArgumentExpression):
15605 Added arg_type argument for constant conversion.
15606 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
15608 2004-08-04 Marek Safar <marek.safar@seznam.cz>
15611 * class.cs (TypeContainer ): New inner classes MethodArrayList,
15612 OperatorArrayList, MethodCoreArrayList for typecontainer
15613 containers. Changed class member types to these new types.
15614 (MethodArrayList.DefineMembers): Added test for CS0659.
15616 2004-08-04 Miguel de Icaza <miguel@ximian.com>
15618 * cfold.cs: Synchronize the folding with the code in expression.cs
15619 Binary.DoNumericPromotions for uint operands.
15621 * attribute.cs: Revert patch from Raja, it introduced a regression
15622 while building Blam-1.2.1 (hard to isolate a test case).
15624 2004-08-04 Marek Safar <marek.safar@seznam.cz>
15628 (TypeContainer.Define): Renamed to DefineContainerMembers because of
15630 (MethodCore.parent_method): New member. The method we're overriding
15631 if this is an override method.
15632 (MethodCore.CheckBase): Moved from Method class and made common.
15633 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
15635 (MethodCore.CheckForDuplications): New abstract method. For custom
15636 member duplication search in a container
15637 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
15638 method and its return type.
15639 (Event.conflict_symbol): New member. Symbol with same name in the
15643 (MemberCache.FindMemberWithSameName): New method. The method
15644 is looking for conflict with inherited symbols.
15646 2004-08-04 Martin Baulig <martin@ximian.com>
15648 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
15650 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
15652 2004-08-03 Marek Safar <marek.safar@seznam.cz>
15654 * report.cs (Message): New enum for better error, warning reference in
15656 (MessageData): New inner abstract class. It generally handles printing of
15657 error and warning messages.
15658 Removed unused Error, Warning, Message methods.
15660 2004-08-03 Marek Safar <marek.safar@seznam.cz>
15662 Fix for cs0592-8.cs test
15664 (Attributable.ValidAttributeTargets): Made public.
15665 (Attribute.ExplicitTarget): New member for explicit target value.
15666 (Attribute.CheckTargets): Now we translate explicit attribute
15667 target to Target here.
15669 2004-08-03 Ben Maurer <bmaurer@ximian.com>
15671 * ecore.cs (MethodGroupExpr): new IsBase property.
15673 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
15675 * delegate.cs (DelegateCreation): store a MethodGroupExpr
15676 rather than an instance expr.
15678 (DelegateCreation.Emit): Use the method group rather than
15679 the instance expression. Also, if you have base.Foo as the
15680 method for a delegate, make sure to emit ldftn, not ldftnvirt.
15682 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
15684 (NewDelegate.DoResolve): Only check for the existance of Invoke
15685 if the method is going to be needed. Use MethodGroupExpr.
15687 (NewDelegate.Emit): Remove, DelegateCreation implements this.
15689 * expression.cs: For pointer arith., make sure to use
15690 the size of the type, not the size of the pointer to
15693 2004-08-03 Marek Safar <marek.safar@seznam.cz>
15696 * class.cs (Class): Added error CS0502 test.
15698 2004-08-03 John Luke <jluke@cfl.rr.com>
15699 Raja R Harinath <rharinath@novell.com>
15702 * attribute.cs (Attribute.complained_before): New flag.
15703 (Attribute.ResolveType, Attribute.Resolve),
15704 (Attribute.DefinePInvokeMethod): Set it.
15705 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
15707 2004-08-03 Martin Baulig <martin@ximian.com>
15709 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
15710 use a user-defined operator; we still need to do numeric
15711 promotions in case one argument is a builtin type and the other
15712 one has an implicit conversion to that type. Fixes #62322.
15714 2004-08-02 Martin Baulig <martin@ximian.com>
15716 * statement.cs (LocalInfo.Flags): Added `IsThis'.
15717 (LocalInfo.IsThis): New public property.
15718 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
15720 2004-08-01 Martin Baulig <martin@ximian.com>
15722 * class.cs (TypeContainer.GetClassBases): Don't set the default
15723 here since we may get called from GetPartialBases().
15724 (TypeContainer.DefineType): If GetClassBases() didn't return a
15725 parent, use the default one.
15727 2004-07-30 Duncan Mak <duncan@ximian.com>
15729 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
15731 2004-07-30 Martin Baulig <martin@ximian.com>
15733 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
15735 * class.cs (SourceMethod): New public class, derive from the
15736 symbol writer's ISourceMethod.
15737 (Method): Use the new symbol writer API.
15739 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
15740 as argument and use the new symbol writer.
15743 (SourceFile): Implement the symbol writer's ISourceFile.
15744 (Location.SymbolDocument): Removed.
15745 (Location.SourceFile): New public property.
15747 * symbolwriter.cs: Use the new symbol writer API.
15749 2004-07-30 Raja R Harinath <rharinath@novell.com>
15751 * Makefile (install-local): Remove. Functionality moved to
15754 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
15756 * Makefile: Install mcs.exe.config file together with mcs.exe.
15757 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
15758 correct runtime version.
15760 2004-07-25 Martin Baulig <martin@ximian.com>
15763 (TypeContainer.RegisterOrder): Removed, this was unused.
15764 (TypeContainer, interface_order): Removed.
15765 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
15766 TypeContainer as argument since we can also be called with a
15767 `PartialContainer' for a partial class/struct/interface.
15768 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
15769 of checking whether we're an `Interface' - we could be a
15770 `PartialContainer'.
15771 (PartialContainer.Register): Override; call
15772 AddClass()/AddStruct()/AddInterface() on our parent.
15774 * cs-parser.jay (interface_member_declaration): Add things to the
15775 `current_container', not the `current_class'.
15777 * rootcontext.cs (RegisterOrder): The overloaded version which
15778 takes an `Interface' was unused, removed.
15780 * typemanager.cs (TypeManager.LookupInterface): Return a
15781 `TypeContainer', not an `Interface'.
15782 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
15783 contain a `PartialContainer' for an interface, so check it's
15784 `Kind' to figure out what it is.
15786 2004-07-25 Martin Baulig <martin@ximian.com>
15788 * class.cs (Class.DefaultTypeAttributes): New public constant.
15789 (Struct.DefaultTypeAttributes): Likewise.
15790 (Interface.DefaultTypeAttributes): Likewise.
15791 (PartialContainer.TypeAttr): Override this and add the
15792 DefaultTypeAttributes.
15794 2004-07-25 Martin Baulig <martin@ximian.com>
15796 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
15797 we can just use the `Parent' field instead.
15799 2004-07-25 Martin Baulig <martin@ximian.com>
15801 * class.cs (TypeContainer.Emit): Renamed to EmitType().
15803 2004-07-25 Martin Baulig <martin@ximian.com>
15805 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
15806 our parts before defining any methods.
15807 (TypeContainer.VerifyImplements): Make this virtual.
15808 (ClassPart.VerifyImplements): Override and call VerifyImplements()
15809 on our PartialContainer.
15811 2004-07-25 Martin Baulig <martin@ximian.com>
15813 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
15815 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
15816 argument, we can just use the `Parent' field instead.
15819 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
15820 (MemberBase.DoDefine): Likewise.
15822 2004-07-24 Martin Baulig <martin@ximian.com>
15824 * decl.cs (MemberCore.Parent): New public field.
15825 (DeclSpace.Parent): Moved to MemberCore.
15827 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
15828 (MemberBase.ctor): Added TypeContainer argument, pass it to our
15830 (FieldBase, Field, Operator): Likewise.
15831 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
15832 (EventField, Event): Likewise.
15834 2004-07-23 Martin Baulig <martin@ximian.com>
15836 * class.cs (PartialContainer): New public class.
15837 (ClassPart): New public class.
15838 (TypeContainer): Added support for partial classes.
15839 (TypeContainer.GetClassBases): Splitted some of the functionality
15840 out into GetNormalBases() and GetPartialBases().
15842 * cs-tokenizer.cs (Token.PARTIAL): New token.
15843 (Tokenizer.consume_identifier): Added some hacks to recognize
15844 `partial', but only if it's immediately followed by `class',
15845 `struct' or `interface'.
15847 * cs-parser.jay: Added support for partial clases.
15849 2004-07-23 Martin Baulig <martin@ximian.com>
15851 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
15852 a `DeclSpace' and also made it readonly.
15853 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
15854 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
15855 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
15857 * cs-parser.jay: Pass the `current_class', not the
15858 `current_container' (at the moment, this is still the same thing)
15859 to a new Method, Property, Event, Indexer or Constructor.
15861 2004-07-23 Martin Baulig <martin@ximian.com>
15863 * cs-parser.jay (CSharpParser): Added a new `current_class' field
15864 and removed the `current_interface' one.
15865 (struct_declaration, class_declaration, interface_declaration):
15866 Set `current_class' to the newly created class/struct/interface;
15867 set their `Bases' and call Register() before parsing their body.
15869 2004-07-23 Martin Baulig <martin@ximian.com>
15871 * class.cs (Kind): New public enum.
15872 (TypeContainer): Made this class abstract.
15873 (TypeContainer.Kind): New public readonly field.
15874 (TypeContainer.CheckDef): New public method; moved here from
15876 (TypeContainer.Register): New public abstract method.
15877 (TypeContainer.GetPendingImplementations): New public abstract
15879 (TypeContainer.GetClassBases): Removed the `is_class' and
15880 `is_iface' parameters.
15881 (TypeContainer.DefineNestedTypes): Formerly known as
15883 (ClassOrStruct): Made this class abstract.
15885 * tree.cs (RootTypes): New public type.
15887 2004-07-20 Martin Baulig <martin@ximian.com>
15889 * tree.cs (Tree.RecordNamespace): Removed.
15890 (Tree.Namespaces): Removed.
15892 * rootcontext.cs (RootContext.IsNamespace): Removed.
15894 * cs-parser.jay (namespace_declaration): Just create a new
15895 NamespaceEntry here.
15897 2004-07-20 Martin Baulig <martin@ximian.com>
15899 * statement.cs (ExceptionStatement): New abstract class. This is
15900 now used as a base class for everyone who's using `finally'.
15901 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
15902 our local variables before using them.
15904 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
15905 virtual method. This is used by Yield.Resolve() to "steal" an
15906 outer block's `finally' clauses.
15907 (FlowBranchingException): The .ctor now takes an ExceptionStatement
15910 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
15911 version which takes an ExceptionStatement. This version must be
15912 used to create exception branchings.
15915 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
15916 (Iterator.EmitMoveNext): Added exception support; protect the
15917 block with a `fault' clause, properly handle 'finally' clauses.
15918 (Iterator.EmitDispose): Run all the `finally' clauses here.
15920 2004-07-20 Martin Baulig <martin@ximian.com>
15922 * iterator.cs: This is the first of a set of changes in the
15923 iterator code. Match the spec more closely: if we're an
15924 IEnumerable, then GetEnumerator() must be called. The first time
15925 GetEnumerator() is called, it returns the current instance; all
15926 subsequent invocations (if any) must create a copy.
15928 2004-07-19 Miguel de Icaza <miguel@ximian.com>
15930 * expression.cs: Resolve the constant expression before returning
15933 2004-07-19 Martin Baulig <martin@ximian.com>
15935 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
15936 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
15937 the return type of the new EmitContext.
15939 2004-07-18 Martin Baulig <martin@ximian.com>
15941 * class.cs (Property.Define): Fix iterators.
15943 * iterators.cs (Iterator.Define): Moved the
15944 `container.AddInterator (this)' call here from the .ctor; only do
15945 it if we resolved successfully.
15947 2004-07-17 Miguel de Icaza <miguel@ximian.com>
15949 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
15950 `true' for preprocessing directives that we parse. The return
15951 value indicates whether we should return to regular tokenizing or
15952 not, not whether it was parsed successfully.
15954 In the past if we were in: #if false ... #line #endif, we would
15955 resume parsing after `#line'. See bug 61604.
15957 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
15958 building: IsEnumType should return true only for enums, not for
15959 enums or System.Enum itself. This fixes #61593.
15961 Likely what happened is that corlib was wrong: mcs depended on
15962 this bug in some places. The bug got fixed, we had to add the
15963 hack, which caused bug 61593.
15965 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
15966 that was a workaround for the older conditions.
15968 2004-07-16 Ben Maurer <bmaurer@ximian.com>
15970 * assign.cs: IAssignMethod has a new interface, as documented
15971 inline. All assignment code now uses this new api.
15973 * ecore.cs, expression.cs: All classes which implement
15974 IAssignMethod now use the new interface.
15976 * expression.cs (Invocation): add a hack to EmitCall so that
15977 IndexerAccess can be the target of a compound assignment without
15978 evaluating its arguments twice.
15980 * statement.cs: Handle changes in Invocation api.
15982 2004-07-16 Martin Baulig <martin@ximian.com>
15984 * iterators.cs: Rewrote this. We're now using one single Proxy
15985 class for both the IEnumerable and the IEnumerator interface and
15986 `Iterator' derives from Class so we can use the high-level API.
15988 * class.cs (TypeContainer.AddIterator): New method.
15989 (TypeContainer.DoDefineType): New protected virtual method, which
15990 is called from DefineType().
15991 (TypeContainer.DoDefineMembers): Call DefineType() and
15992 DefineMembers() on all our iterators.
15993 (TypeContainer.Emit): Call Emit() on all our iterators.
15994 (TypeContainer.CloseType): Call CloseType() on all our iterators.
15996 * codegen.cs (EmitContext.CurrentIterator): New public field.
15998 2004-07-15 Martin Baulig <martin@ximian.com>
16001 (TypeManager.not_supported_exception_type): New type.
16003 2004-07-14 Martin Baulig <martin@ximian.com>
16005 * iterators.cs: Use real error numbers.
16007 2004-07-14 Martin Baulig <martin@ximian.com>
16009 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
16010 requires this to be a System.Collection.IEnumerable and not a
16011 class implementing that interface.
16012 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
16014 2004-07-13 Marek Safar <marek.safar@seznam.cz>
16016 * class.cs: Fixed previous fix, it broke some error tests.
16018 2004-07-12 Martin Baulig <martin@ximian.com>
16020 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
16023 2004-07-09 Miguel de Icaza <miguel@ximian.com>
16025 * assign.cs (LocalTemporary): Add new argument: is_address,If
16026 `is_address' is true, then the value that we store is the address
16027 to the real value, and not the value itself.
16029 * ecore.cs (PropertyExpr): use the new local temporary
16030 stuff to allow us to handle X.Y += z (where X is a struct)
16032 2004-07-08 Martin Baulig <martin@ximian.com>
16034 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
16035 not always return, just like we're doing in Using.Resolve().
16037 2004-07-07 Miguel de Icaza <miguel@ximian.com>
16039 * cs-parser.jay (fixed_statement): flag this as Pinned.
16041 2004-07-06 Miguel de Icaza <miguel@ximian.com>
16043 * typemanager.cs (TypeManager): Removed MakePinned method, this
16044 mechanism is replaced with the .NET 2.x compatible mechanism of
16045 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
16047 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
16048 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
16049 `IsFixed' property which has a different meaning.
16051 2004-07-02 Raja R Harinath <rharinath@novell.com>
16053 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
16054 visible from inside a nested class, not just the names of the
16055 immediately enclosing class.
16056 Fix for bug #60730.
16058 2004-06-24 Raja R Harinath <rharinath@novell.com>
16060 * expression.cs (BetterConversion): Remove buggy special-case
16061 handling of "implicit constant expression conversions". At this
16062 point, we already know that the conversion is possible -- we're
16063 only checking to see which is better.
16065 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16067 * cs-parser.jay: Added error CS0210 test.
16069 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16071 * cs-parser.jay: Added error CS0134 test.
16073 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16076 * cs-parser.jay: Added error CS0145 test.
16078 2004-06-24 Marek Safar <marek.safar@seznam.cz>
16080 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
16082 2004-06-23 Ben Maurer <bmaurer@ximian.com>
16084 * expression.cs (StackAlloc.Resolve): The argument may not
16085 be a constant; deal with this case.
16087 2004-06-23 Marek Safar <marek.safar@seznam.cz>
16089 * attribute.cs (IndexerName_GetIndexerName): Renamed to
16090 GetIndexerAttributeValue.
16091 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
16093 * class.cs (Indexer.Define): Added error tests for CS0415,
16096 2004-06-23 Miguel de Icaza <miguel@ximian.com>
16098 * attribute.cs (Attribute.Resolve): Keep field code in sync with
16101 2004-06-23 Martin Baulig <martin@ximian.com>
16103 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
16104 neither return nor throw, reset the barrier as well. Fixes #60457.
16106 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
16108 * class.cs : EventAttributes is now set to None by default.
16109 This fixes bug #60459.
16111 2004-06-18 Marek Safar <marek.safar@seznam.cz>
16114 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16115 Don't throw exception but return null (it's sufficient now).
16117 2004-06-18 Marek Safar <marek.safar@seznam.cz>
16119 * typemanager.cs (GetArgumentTypes): Faster implementation.
16121 2004-06-18 Martin Baulig <martin@ximian.com>
16123 * attribute.cs (Attribute.Resolve): Check whether we're an
16124 EmptyCast which a Constant child. Fixes #60333.
16126 2004-06-17 Ben Maurer <bmaurer@ximian.com>
16128 * statement.cs (EmitCollectionForeach): Account for the fact that
16129 not all valuetypes are in areas which we can take the address of.
16130 For these variables, we store to a temporary variable. Also, make
16131 sure that we dont emit a `callvirt' on a valuetype method.
16133 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16135 * expression.cs (StackAlloc.DoReSolve): Added test for
16136 negative parameter (CS0247).
16138 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16141 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
16143 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16146 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
16149 2004-06-14 Marek Safar <marek.safar@seznam.cz>
16151 Fix bug #58254 & cs1555.cs, cs1556.cs
16152 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
16154 2004-06-14 Marek Safar <marek.safar@seznam.cz>
16156 * cs-parser.jay: Added error CS1669 test for indexers.
16158 2004-06-11 Martin Baulig <martin@ximian.com>
16160 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
16161 call this twice: for params and varargs methods.
16163 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16166 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
16168 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16170 * attribute.cs (Attribute.GetValidTargets): Made public.
16173 (AbstractPropertyEventMethod): New class for better code sharing.
16174 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
16176 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
16178 2004-06-11 Raja R Harinath <rharinath@novell.com>
16181 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
16182 that the call to Resolve is part of a MemberAccess.
16183 (Expression.Resolve): Use it for SimpleName resolution.
16184 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
16185 Add 'intermediate' boolean argument.
16186 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
16187 error message when the SimpleName can be resolved ambiguously
16188 between an expression and a type.
16189 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
16191 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
16192 call on the left-side.
16194 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16197 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
16199 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16201 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
16203 2004-06-11 Martin Baulig <martin@ximian.com>
16205 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
16206 varargs methods if applicable.
16208 2004-06-11 Martin Baulig <martin@ximian.com>
16210 * expression.cs (Invocation.EmitCall): Don't use
16211 `method.CallingConvention == CallingConventions.VarArgs' since the
16212 method could also have `CallingConventions.HasThis'.
16214 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16216 * class.cs (Event.GetSignatureForError): Implemented.
16217 Fixed crash in error test cs3010.cs
16219 2004-06-10 Miguel de Icaza <miguel@ximian.com>
16221 * cs-tokenizer.cs: Change the way we track __arglist to be
16222 consistent with the other keywords.
16224 2004-06-09 Miguel de Icaza <miguel@ximian.com>
16226 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
16229 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
16231 * codegen.cs: Check that all referenced assemblies have a strongname
16232 before strongnaming the compiled assembly. If not report error CS1577.
16233 Fix bug #56563. Patch by Jackson Harper.
16234 * typemanager.cs: Added a method to return all referenced assemblies.
16235 Fix bug #56563. Patch by Jackson Harper.
16237 2004-06-08 Marek Safar <marek.safar@seznam.cz>
16240 (Method.ApplyAttributeBuilder): Moved and added conditional
16241 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
16244 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
16246 2004-06-08 Marek Safar <marek.safar@seznam.cz>
16249 * class.cs: (EventField.attribute_targets): Changed default target.
16251 2004-06-08 Martin Baulig <martin@ximian.com>
16253 * expression.cs (Invocation.EmitCall): Enable varargs methods.
16255 2004-06-08 Martin Baulig <martin@ximian.com>
16257 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
16259 2004-06-07 Martin Baulig <martin@ximian.com>
16261 Added support for varargs methods.
16263 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
16266 * cs-parser.jay: Added support for `__arglist'.
16268 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
16270 * expression.cs (Argument.AType): Added `ArgList'.
16271 (Invocation): Added support for varargs methods.
16272 (ArglistAccess): New public class.
16273 (Arglist): New public class.
16275 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
16277 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
16278 a method's top-level block if the method has varargs.
16280 * support.cs (ReflectionParameters, InternalParameters): Added
16281 support for varargs methods.
16283 2004-06-07 Miguel de Icaza <miguel@ximian.com>
16285 * class.cs: Provide location in indexer error report.
16287 * driver.cs: Use standard names.
16289 * namespace.cs: Catch the use of using after a namespace has been
16290 declared also on using aliases.
16292 2004-06-03 Raja R Harinath <rharinath@novell.com>
16295 * typemanager.cs (closure_private_ok, closure_invocation_type)
16296 (closure_qualifier_type, closure_invocation_assembly)
16297 (FilterWithClosure): Move to ...
16298 (Closure): New internal nested class.
16299 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
16300 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
16301 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
16302 (MemberLookup, MemberLookupFailed): Use it.
16303 * expression.cs (New.DoResolve): Treat the lookup for the
16304 constructor as being qualified by the 'new'ed type.
16305 (Indexers.GetIndexersForTypeOrInterface): Update.
16307 2004-06-03 Marek Safar <marek.safar@seznam.cz>
16310 (GetConditionalAttributeValue): New method. Returns
16311 condition of ConditionalAttribute.
16312 (SearchMulti): New method. Returns all attributes of type 't'.
16313 Use it when attribute is AllowMultiple = true.
16314 (IsConditionalMethodExcluded): New method.
16317 (Method.IsExcluded): Implemented. Returns true if method has conditional
16318 attribute and the conditions is not defined (method is excluded).
16319 (IMethodData): Extended interface for ConditionalAttribute support.
16320 (PropertyMethod.IsExcluded): Implemented.
16323 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
16326 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
16329 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
16331 * expression.cs (ArrayCreationExpression): Make this just an
16332 `expression'. It can't be a statement, so the code here was
16335 2004-06-02 Marek Safar <marek.safar@seznam.cz>
16338 * typemanager.cs (GetFullNameSignature): New method for
16341 2004-06-02 Marek Safar <marek.safar@seznam.cz>
16344 * class.cs (MemberBase.GetSignatureForError): New virtual method.
16345 Use this method when MethodBuilder is null.
16346 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
16347 Added test for error CS0626 (MONO reports error for this situation).
16348 (IMethodData.GetSignatureForError): Extended interface.
16350 2004-06-01 Marek Safar <marek.safar@seznam.cz>
16353 (AttributeTester.GetObsoleteAttribute): Returns instance of
16354 ObsoleteAttribute when type is obsolete.
16357 (TypeContainer.VerifyObsoleteAttribute): Override.
16358 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
16359 (MethodCode.VerifyObsoleteAttribute): Override.
16360 (MemberBase.VerifyObsoleteAttribute): Override.
16363 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
16364 and report proper error.
16367 Delegate.VerifyObsoleteAttribute): Override.
16370 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
16371 and report proper error.
16372 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
16375 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
16379 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
16380 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
16381 Added test for ObsoleteAttribute.
16384 (Catch): Derived from Statement.
16386 2004-06-01 Marek Safar <marek.safar@seznam.cz>
16388 Fixed bug #59071 & cs0160.cs
16390 * statement.cs (Try.Resolve): Check here whether order of catch
16391 clauses matches their dependencies.
16393 2004-05-31 Miguel de Icaza <miguel@ximian.com>
16395 * Reverted patch to namespace.cs (Use lookuptypedirect). This
16396 caused a regression: #59343. Referencing nested classes from an
16397 assembly stopped working.
16399 2004-05-31 Martin Baulig <martin@ximian.com>
16401 MCS is now frozen for beta 2.
16403 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16405 * convert.cs: add a trivial cache for overload operator resolution.
16407 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16409 * decl.cs: If possible, use lookuptypedirect here. We can only do
16410 this if there is no `.' after the namespace. Avoids using
16411 LookupType, which does lots of slow processing.
16412 (FindNestedType) New method, does what it says :-).
16413 * namespace.cs: use LookupTypeDirect.
16414 * rootcontext.cs: use membercache, if possible.
16415 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
16417 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16420 According to the spec,
16422 In a member access of the form E.I, if E is a single identifier,
16423 and if the meaning of E as a simple-name (§7.5.2) is a constant,
16424 field, property, localvariable, or parameter with the same type as
16425 the meaning of E as a type-name (§3.8), then both possible
16426 meanings of E are permitted.
16428 We did not check that E as a simple-name had the same type as E as
16431 This trivial check gives us 5-7% on bootstrap time.
16433 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16435 * expression.cs (Invocation.OverloadResolve): Avoid the
16436 use of hashtables and boxing here by allocating on demand.
16438 2004-05-30 Martin Baulig <martin@ximian.com>
16440 * rootcontext.cs (RootContext.LookupType): Don't cache things if
16441 we're doing a silent lookup. Don't try to lookup nested types in
16442 TypeManager.object_type (thanks to Ben Maurer).
16444 2004-05-30 Martin Baulig <martin@ximian.com>
16446 Committing a patch from Ben Maurer.
16448 * rootcontext.cs (RootContext.LookupType): Cache negative results.
16450 2004-05-29 Martin Baulig <martin@ximian.com>
16452 * class.cs (IMethodData.ShouldIgnore): New method.
16454 * typemanager.cs (TypeManager.MethodFlags): Don't take a
16455 `Location' argument, we don't need it anywhere. Use
16456 `IMethodData.ShouldIgnore ()' instead of
16457 `MethodData.GetMethodFlags ()'.
16458 (TypeManager.AddMethod): Removed.
16459 (TypeManager.AddMethod2): Renamed to AddMethod.
16461 2004-05-29 Martin Baulig <martin@ximian.com>
16463 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
16465 * convert.cs (Convert.ImplicitReferenceConversion): If we're
16466 converting from a class type S to an interface type and we already
16467 have an object on the stack, don't box it again. Fixes #52578.
16469 2004-05-29 Martin Baulig <martin@ximian.com>
16471 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16472 Added support for `params' parameters. Fixes #59267.
16474 2004-05-29 Martin Baulig <martin@ximian.com>
16476 * literal.cs (NullPointer): Provide a private .ctor which sets
16477 `type' to TypeManager.object_type. Fixes #59048.
16479 2004-05-29 Martin Baulig <martin@ximian.com>
16481 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
16482 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
16484 * ecore.cs (EventExpr.instance_expr): Make the field private.
16486 2004-05-26 Marek Safar <marek.safar@seznam.cz>
16488 Fixed bug #50080 & cs0214-2.cs
16489 * expression.cs (Cast.DoResolve): Check unsafe context here.
16491 * statement.cs (Resolve.DoResolve): Likewise.
16493 2004-05-26 Martin Baulig <martin@ximian.com>
16495 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
16497 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
16498 (RootContext.LookupType): Pass down the `silent' flag.
16500 2004-05-25 Martin Baulig <martin@ximian.com>
16503 (MethodGroupExpr.IdenticalTypeName): New public property.
16504 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
16505 expression actually refers to a type.
16507 2004-05-25 Martin Baulig <martin@ximian.com>
16509 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
16510 for #56176 and made it actually work.
16512 2004-05-25 Martin Baulig <martin@ximian.com>
16514 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
16515 (FieldExpr, PropertyExpr): Override and implement
16516 CacheTemporaries. Fixes #52279.
16518 2004-05-25 Miguel de Icaza <miguel@ximian.com>
16520 * location.cs: In the new compiler listing a file twice is a
16521 warning, not an error.
16523 2004-05-24 Martin Baulig <martin@ximian.com>
16525 * enum.cs (Enum.DefineType): For the `BaseType' to be a
16526 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
16528 2004-05-24 Martin Baulig <martin@ximian.com>
16530 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
16531 walking the `using' list. Fixes #53921.
16533 2004-05-24 Martin Baulig <martin@ximian.com>
16535 * const.cs (Const.LookupConstantValue): Added support for
16536 EmptyCast's; fixes #55251.
16538 2004-05-24 Martin Baulig <martin@ximian.com>
16540 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
16541 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
16542 which does the CS0135 check. The reason is that we first need to
16543 check whether the variable actually exists.
16545 2004-05-24 Martin Baulig <martin@ximian.com>
16547 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
16548 than RootContext.LookupType() to find the explicit interface
16549 type. Fixes #58584.
16551 2004-05-24 Raja R Harinath <rharinath@novell.com>
16553 * Makefile: Simplify. Use executable.make.
16554 * mcs.exe.sources: New file. List of sources of mcs.exe.
16556 2004-05-24 Anders Carlsson <andersca@gnome.org>
16560 Use the invariant culture when doing String.Compare for CLS case
16563 2004-05-23 Martin Baulig <martin@ximian.com>
16565 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
16566 don't have any dots. Fixes #52622, added cs0246-8.cs.
16568 * namespace.cs (NamespaceEntry.Lookup): Likewise.
16570 2004-05-23 Marek Safar <marek.safar@seznam.cz>
16572 * class.cs (MemberBase.Define): Reuse MemberType member for
16573 resolved type. Other methods can use it too.
16575 2004-05-23 Martin Baulig <martin@ximian.com>
16577 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
16578 the variable also exists in the current block (otherwise, we need
16579 to report a CS0103). Fixes #58670.
16581 2004-05-23 Martin Baulig <martin@ximian.com>
16583 * flowanalysis.cs (Reachability.Reachable): Compute this
16584 on-the-fly rather than storing it as a field.
16586 2004-05-23 Martin Baulig <martin@ximian.com>
16588 * flowanalysis.cs (Reachability.And): Manually compute the
16589 resulting `barrier' from the reachability.
16591 2004-05-23 Marek Safar <marek.safar@seznam.cz>
16594 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
16595 instance of ObsoleteAttribute when symbol is obsolete.
16598 (IMethodData): Extended interface for ObsoleteAttribute support.
16600 2004-05-22 Marek Safar <marek.safar@seznam.cz>
16602 * attribute.cs: Fix bug #55970
16604 2004-05-22 Marek Safar <marek.safar@seznam.cz>
16608 (GetObsoleteAttribute): New method. Creates the instance of
16610 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
16611 ObsoleteAttribute when member is obsolete.
16612 (AttributeTester.Report_ObsoleteMessage): Common method for
16613 Obsolete error/warning reporting.
16616 (TypeContainer.base_classs_type): New member for storing parent type.
16619 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
16620 for this MemberCore.
16622 2004-05-21 Marek Safar <marek.safar@seznam.cz>
16624 * attribute.cs, const.cs: Fix bug #58590
16626 2004-05-21 Martin Baulig <martin@ximian.com>
16628 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
16629 out parameters if the end of the method is unreachable. Fixes
16632 2004-05-21 Marek Safar <marek.safar@seznam.cz>
16634 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
16635 Hari was right, why extra method.
16637 2004-05-21 Marek Safar <marek.safar@seznam.cz>
16639 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
16641 2004-05-20 Martin Baulig <martin@ximian.com>
16643 Merged this back from gmcs to keep the differences to a minumum.
16645 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
16646 instead of a Declspace.
16647 (Attribute.ResolveType): Likewise.
16648 (Attributes.Search): Likewise.
16649 (Attributes.Contains): Likewise.
16650 (Attributes.GetClsCompliantAttribute): Likewise.
16652 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
16654 (MethodData.ApplyAttributes): Take an EmitContext instead of a
16657 2004-05-19 Marek Safar <marek.safar@seznam.cz>
16659 Fix bug #58688 (MCS does not report error when the same attribute
16662 * attribute.cs (Attribute.Emit): Distinction between null and default.
16664 2004-05-19 Raja R Harinath <rharinath@novell.com>
16666 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
16667 of a top-level attribute without an attribute target.
16668 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
16670 (Attribute.Conditional_GetConditionName),
16671 (Attribute.Obsolete_GetObsoleteMessage): Update.
16672 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
16673 part of ScanForIndexerName.
16674 (Attribute.CanIgnoreInvalidAttribute): New function.
16675 (Attribute.ScanForIndexerName): Move to ...
16676 (Attributes.ScanForIndexerName): ... here.
16677 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
16678 (Attributes.Search): New internal variant that can choose not to
16679 complain if types aren't resolved. The original signature now
16681 (Attributes.GetClsCompliantAttribute): Use internal variant, with
16682 complaints suppressed.
16683 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
16684 only if it not useful.
16685 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
16686 top-level for attributes that are shared between the assembly
16687 and a top-level class.
16688 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
16689 * class.cs: Update to reflect changes.
16690 (DefineIndexers): Fuse loops.
16691 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
16692 a couple more variants of attribute names.
16694 2004-05-18 Marek Safar <marek.safar@seznam.cz>
16696 Fix bug #52585 (Implemented explicit attribute declaration)
16699 (Attributable.ValidAttributeTargets): New abstract method. It gets
16700 list of valid attribute targets for explicit target declaration.
16701 (Attribute.Target): It holds target itself.
16702 (AttributeSection): Removed.
16703 (Attribute.CheckTargets): New method. It checks whether attribute
16704 target is valid for the current element.
16707 (EventProperty): New class. For events that are declared like
16708 property (with add and remove accessors).
16709 (EventField): New class. For events that are declared like field.
16712 * cs-parser.jay: Implemented explicit attribute target declaration.
16714 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
16715 Override ValidAttributeTargets.
16718 (ReturnParameter): Class for applying custom attributes on
16720 (ParameterAtribute): New class. Class for applying custom
16721 attributes on the parameter type.
16723 2004-05-17 Miguel de Icaza <miguel@ximian.com>
16725 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
16728 (Method): Allow UNSAFE here.
16730 * modifiers.cs: Support unsafe reporting.
16732 2004-05-17 Marek Safar <marek.safar@seznam.cz>
16734 * decl.cs: Fix bug #58478.
16736 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16738 * statement.cs: When checking for unreachable code on an EmptyStatement,
16739 set the location. Fixes bug #58488.
16741 2004-05-13 Miguel de Icaza <miguel@ximian.com>
16743 * driver.cs: Add -pkg handling.
16745 From Gonzalo: UseShelLExecute=false
16747 2004-05-12 Marek Safar <marek.safar@seznam.cz>
16750 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
16752 (Attribute.IsClsCompliaceRequired): Moved to base for better
16754 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
16755 when attribute is AttributeUsageAttribute.
16756 (Attribute.GetValidTargets): Simplified.
16757 (Attribute.GetAttributeUsage): New method returns AttributeUsage
16758 attribute for this type.
16759 (Attribute.ApplyAttributes): Method renamed to Emit and make
16761 (GlobalAttributeSection): New class for special handling of global
16762 attributes (assembly, module).
16763 (AttributeSection.Emit): New method.
16765 * class.cs: Implemented Attributable abstract methods.
16766 (MethodCore.LabelParameters): Moved to Parameter class.
16767 (Accessor): Is back simple class.
16768 (PropertyMethod): Implemented Attributable abstract class.
16769 (DelegateMethod): Implemented Attributable abstract class.
16770 (Event): New constructor for disctintion between normal Event
16771 and Event with accessors.
16773 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
16775 * codegen.cs, const.cs, decl.cs, delegate.cs:
16776 (CommonAssemblyModulClass): Implemented Attributable abstract class
16779 * enum.cs: Implement IAttributeSupport interface.
16780 (EnumMember): New class for emum members. Implemented Attributable
16784 (ParameterBase): Is abstract.
16785 (ReturnParameter): New class for easier [return:] attribute handling.
16787 * typemanager.cs: Removed builder_to_attr.
16789 2004-05-11 Raja R Harinath <rharinath@novell.com>
16792 * attribute.cs (Attribute.GetPositionalValue): New function.
16793 * class.cs (TypeContainer.VerifyMembers): New function.
16794 (TypeContainer.Emit): Use it.
16795 (ClassOrStruct): New base class for Class and Struct.
16796 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
16797 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
16799 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
16800 then each non-static field should have a FieldOffset attribute.
16801 Otherwise, none of the fields should have a FieldOffset attribute.
16802 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
16803 and FieldOffset attributes.
16804 * typemanager.cs (TypeManager.struct_layout_attribute_type)
16805 (TypeManager.field_offset_attribute_type): New core types.
16806 (TypeManager.InitCoreTypes): Initialize them.
16808 2004-05-11 Michal Moskal <malekith@pld-linux.org>
16810 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
16811 Return correct type.
16814 2004-05-09 Miguel de Icaza <miguel@ximian.com>
16816 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
16817 be implicitly converted to ulong.
16819 * expression.cs: The logic for allowing operator &, | and ^ worked
16820 was wrong, it worked before because we did not report an error in
16821 an else branch. Fixes 57895.
16823 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
16824 allow volatile fields to be reference types.
16826 2004-05-07 Miguel de Icaza <miguel@ximian.com>
16828 * driver.cs: Add support for /debug-
16830 2004-05-07 Raja R Harinath <rharinath@novell.com>
16832 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
16833 Add a 'complain' parameter to silence errors.
16834 (Attribute.Resolve): Update to changes. Put in sanity check to catch
16835 silently overlooked type-resolutions.
16836 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
16837 to reflect changes.
16838 (Attributes.Search): New function.
16839 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
16840 (Attributes.GetAttributeFullName): Remove hack.
16841 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
16842 Update to reflect changes.
16843 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16844 Use Attributes.Search instead of nested loops.
16846 2004-05-07 Marek Safar <marek.safar@seznam.cz>
16849 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
16850 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
16851 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
16853 * report.cs: (Report.Warning): Renamed to Warning_T because of
16854 parameter collision.
16856 2004-05-05 Raja R Harinath <rharinath@novell.com>
16858 * expression.cs (MemberAccess.ResolveMemberAccess):
16859 Exit with non-zero status after Report.Error.
16860 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
16862 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
16864 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
16866 * support.cs: Don't hang when the file is empty.
16868 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
16870 * support.cs: In SeekableStreamReader, compute the preamble size of the
16871 underlying stream. Position changes should take into account that initial
16874 2004-05-03 Todd Berman <tberman@sevenl.net>
16876 * driver.cs: remove unused GetSysVersion function.
16878 2004-05-03 Todd Berman <tberman@sevenl.net>
16880 * driver.cs: Remove the hack from saturday, as well as the hack
16881 from jackson (LoadAssemblyFromGac), also adds the CWD to the
16882 link_paths to get that bit proper.
16884 2004-05-01 Todd Berman <tberman@sevenl.net>
16886 * driver.cs: Try a LoadFrom before a Load, this checks the current
16887 path. This is currently a bug in mono that is be fixed, however, this
16888 provides a workaround for now. This will be removed when the bug
16891 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
16893 * CryptoConvert.cs: Updated to latest version. Fix issue with
16894 incomplete key pairs (#57941).
16896 2004-05-01 Todd Berman <tberman@sevenl.net>
16898 * driver.cs: Remove '.' from path_chars, now System.* loads properly
16901 2004-04-30 Jackson Harper <jackson@ximian.com>
16903 * codegen.cs: Open keys readonly.
16905 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16907 * typemanager.cs: don't report cyclic struct layout when a struct
16908 contains 2 or more fields of the same type. Failed for Pango.AttrShape
16909 which has 2 Pango.Rectangle fields.
16911 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
16913 * expression.cs: Handle IntPtr comparisons with IL code
16914 rather than a method call.
16916 2004-04-29 Martin Baulig <martin@ximian.com>
16918 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
16919 the list of PropertyInfo's in class hierarchy and find the
16920 accessor. Fixes #56013.
16922 2004-04-29 Martin Baulig <martin@ximian.com>
16924 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
16926 2004-04-29 Martin Baulig <martin@ximian.com>
16928 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16930 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
16932 2004-04-29 Martin Baulig <martin@ximian.com>
16934 * class.cs (ConstructorInitializer.Resolve): Check whether the
16935 parent .ctor is accessible. Fixes #52146.
16937 2004-04-29 Martin Baulig <martin@ximian.com>
16939 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16941 * statement.cs (Using.EmitLocalVariableDecls): Use
16942 TypeManager.idisposable_type, not typeof (IDisposable).
16943 (Foreach.EmitCollectionForeach): Added support for valuetypes.
16945 2004-04-29 Martin Baulig <martin@ximian.com>
16947 * class.cs (Event.Define): Don't emit the field and don't set
16948 RTSpecialName and SpecialName for events on interfaces. Fixes
16951 2004-04-29 Raja R Harinath <rharinath@novell.com>
16953 Refactor Attribute.ApplyAttributes.
16954 * attribute.cs (Attributable): New base class for objects that can
16955 have Attributes applied on them.
16956 (Attribute): Make AttributeUsage fields public.
16957 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
16958 (Attribute.IsInternalCall): New property.
16959 (Attribute.UsageAttr): Convert to a public read-only property.
16960 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
16961 (Attribute.ResolveType, Attribute.Resolve)
16962 (Attribute.ScanForIndexerName): Update to reflect changes.
16963 (Attribute.CheckAttributeTarget): Re-format.
16964 (Attribute.ApplyAttributes): Refactor, to various
16965 Attributable.ApplyAttributeBuilder methods.
16966 * decl.cs (MemberCore): Make Attributable.
16967 * class.cs (Accessor): Make Attributable.
16968 (MethodData.ApplyAttributes): Use proper attribute types, not
16970 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
16971 (TypeContainer.ApplyAttributeBuilder)
16972 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
16973 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
16974 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
16975 (Operator.ApplyAttributeBuilder): New factored-out methods.
16976 * const.cs (Const.ApplyAttributeBuilder): Likewise.
16977 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
16978 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
16979 * parameter.cs (ParameterBase): New Attributable base class
16980 that can also represent Return types.
16981 (Parameter): Update to the changes.
16983 2004-04-29 Jackson Harper <jackson@ximian.com>
16985 * driver.cs: Prefer the corlib system version when looking for
16986 assemblies in the GAC. This is still a hack, but its a better hack
16989 2004-04-29 Marek Safar <marek.safar@seznam.cz>
16991 * decl.cs, enum.cs: Improved error 3005 reporting.
16993 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
16994 (related_symbols): New private member for list of symbols
16995 related to reported error/warning.
16997 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
16999 2004-04-29 Martin Baulig <martin@ximian.com>
17001 * ecore.cs (Expression.Constantify): If we're an enum and
17002 TypeManager.TypeToCoreType() doesn't give us another type, use
17003 t.UnderlyingSystemType. Fixes #56178.
17005 2004-04-29 Martin Baulig <martin@ximian.com>
17007 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
17008 interfaces and for each interface, only add members directly
17009 declared in that interface. Fixes #53255.
17011 2004-04-28 Martin Baulig <martin@ximian.com>
17013 * expression.cs (ConditionalLogicalOperator): Use a temporary
17014 variable for `left' to avoid that we evaluate it more than once;
17017 2004-04-28 Martin Baulig <martin@ximian.com>
17019 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
17022 2004-04-28 Martin Baulig <martin@ximian.com>
17024 * statement.cs (LocalInfo.Resolve): Check whether the type is not
17027 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
17028 whether the type is not void (CS1547).
17030 2004-04-28 Martin Baulig <martin@ximian.com>
17032 * expression.cs (Unary.DoResolveLValue): Override this and report
17033 CS0131 for anything but Operator.Indirection.
17035 2004-04-28 Martin Baulig <martin@ximian.com>
17037 Committing a patch from Ben Maurer; see bug #50820.
17039 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17042 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17045 2004-04-28 Martin Baulig <martin@ximian.com>
17047 Committing a patch from Ben Maurer; see bug #50820.
17049 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17052 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17055 2004-04-28 Martin Baulig <martin@ximian.com>
17057 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
17058 (Block.AddLabel): Call DoLookupLabel() to only search in the
17061 2004-04-28 Martin Baulig <martin@ximian.com>
17063 * cfold.cs (ConstantFold.BinaryFold): Added special support for
17064 comparing StringConstants and NullLiterals in Equality and Inequality.
17066 2004-04-28 Jackson Harper <jackson@ximian.com>
17068 * driver.cs: Attempt to load referenced assemblies from the
17069 GAC. This is the quick and dirty version of this method that
17070 doesnt take into account versions and just takes the first
17071 canidate found. Will be good enough for now as we will not have more
17072 then one version installed into the GAC until I update this method.
17074 2004-04-28 Martin Baulig <martin@ximian.com>
17076 * typemanager.cs (TypeManager.CheckStructCycles): New public
17077 static method to check for cycles in the struct layout.
17079 * rootcontext.cs (RootContext.PopulateTypes): Call
17080 TypeManager.CheckStructCycles() for each TypeContainer.
17081 [Note: We only need to visit each type once.]
17083 2004-04-28 Martin Baulig <martin@ximian.com>
17085 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
17087 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
17088 success and added `out object value'. Use a `bool resolved' field
17089 to check whether we've already been called rather than
17090 `ConstantValue != null' since this breaks for NullLiterals.
17092 2004-04-28 Raja R Harinath <rharinath@novell.com>
17094 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
17095 setting of this flag, since the 'set' method may be non-public.
17097 2004-04-28 Raja R Harinath <rharinath@novell.com>
17099 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
17100 check on current_vector.Block.
17102 2004-04-27 Martin Baulig <martin@ximian.com>
17104 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
17105 a field initializer. Fixes #56459.
17107 2004-04-27 Martin Baulig <martin@ximian.com>
17109 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
17110 we're not attempting to use an indexer. Fixes #52154.
17112 2004-04-27 Martin Baulig <martin@ximian.com>
17114 * statement.cs (Return): Don't create a return label if we don't
17115 need it; reverts my change from January 20th. Thanks to Ben
17118 2004-04-27 Martin Baulig <martin@ximian.com>
17120 According to the spec, `goto' can only leave a nested scope, but
17123 * statement.cs (Block.LookupLabel): Only lookup in the current
17124 block, don't recurse into parent or child blocks.
17125 (Block.AddLabel): Check in parent and child blocks, report
17126 CS0140/CS0158 if we find a duplicate.
17127 (Block): Removed this indexer for label lookups.
17128 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
17129 this already does the error reporting for us.
17132 (FlowBranching.UsageVector.Block): New public variable; may be null.
17133 (FlowBranching.CreateSibling): Added `Block' argument.
17134 (FlowBranching.LookupLabel): New public virtual method. Lookup a
17135 label for the target of a `goto' and check whether we're not
17136 leaving a `finally'.
17138 2004-04-27 Martin Baulig <martin@ximian.com>
17140 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17141 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
17144 2004-04-27 Martin Baulig <martin@ximian.com>
17146 * statement.cs (Block.AddLabel): Also check for implicit blocks
17147 and added a CS0158 check.
17149 2004-04-27 Martin Baulig <martin@ximian.com>
17151 * flowanalysis.cs (FlowBranchingLoop): New class.
17152 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
17153 UsageVector's instead of an ArrayList.
17154 (FlowBranching.Label): Likewise.
17155 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
17156 (FlowBranching.AddBreakVector): New method.
17158 2004-04-27 Miguel de Icaza <miguel@ximian.com>
17160 * attribute.cs: Small regression fix: only convert the type if we
17161 the type is different, fixes System.Drawing build.
17163 2004-04-27 Martin Baulig <martin@ximian.com>
17165 * attribute.cs (Attribute.Resolve): If we have a constant value
17166 for a named field or property, implicity convert it to the correct
17169 2004-04-27 Raja R Harinath <rharinath@novell.com>
17171 * statement.cs (Block.Block): Implicit blocks share
17172 'child_variable_names' fields with parent blocks.
17173 (Block.AddChildVariableNames): Remove.
17174 (Block.AddVariable): Mark variable as "used by a child block" in
17175 every surrounding block.
17176 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
17177 been used in a child block, complain about violation of "Invariant
17178 meaning in blocks" rule.
17179 * cs-parser.jay (declare_local_variables): Don't use
17180 AddChildVariableNames.
17181 (foreach_statement): Don't create an implicit block: 'foreach'
17182 introduces a scope.
17184 2004-04-23 Miguel de Icaza <miguel@ximian.com>
17186 * convert.cs (ImplicitNumericConversion): 0 is also positive when
17187 converting from 0L to ulong. Fixes 57522.
17189 2004-04-22 Marek Safar <marek.safar@seznam.cz>
17191 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
17192 derived class hides via 'new' keyword field from base class (test-242.cs).
17193 TODO: Handle this in the more general way.
17195 * class.cs (CheckBase): Ditto.
17197 2004-04-22 Marek Safar <marek.safar@seznam.cz>
17199 * decl.cs (caching_flags): New member for storing cached values
17201 (MemberCore.Flags): New enum where bit flags for caching_flags
17203 (MemberCore.cls_compliance): Moved to caching_flags.
17204 (DeclSpace.Created): Moved to caching_flags.
17206 * class.cs: Use caching_flags instead of DeclSpace.Created
17208 2004-04-21 Miguel de Icaza <miguel@ximian.com>
17210 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
17211 if we are only a derived class, not a nested class.
17213 * typemanager.cs: Same as above, but do this at the MemberLookup
17214 level (used by field and methods, properties are handled in
17215 PropertyExpr). Allow for the qualified access if we are a nested
17218 2004-04-21 Marek Safar <marek.safar@seznam.cz>
17220 * class.cs: Refactoring.
17221 (IMethodData): New inteface; Holds links to parent members
17222 to avoid member duplication (reduced memory allocation).
17223 (Method): Implemented IMethodData interface.
17224 (PropertyBase): New inner classes for get/set methods.
17225 (PropertyBase.PropertyMethod): Implemented IMethodData interface
17226 (Event): New inner classes for add/remove methods.
17227 (Event.DelegateMethod): Implemented IMethodData interface.
17229 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
17230 EmitContext (related to class.cs refactoring).
17232 2004-04-21 Raja R Harinath <rharinath@novell.com>
17234 * delegate.cs (Delegate.VerifyApplicability): If the number of
17235 arguments are the same as the number of parameters, first try to
17236 verify applicability ignoring any 'params' modifier on the last
17240 2004-04-16 Raja R Harinath <rharinath@novell.com>
17242 * class.cs (TypeContainer.AddIndexer): Use
17243 'ExplicitInterfaceName' to determine if interface name was
17244 explicitly specified. 'InterfaceType' is not initialized at this time.
17245 (TypeContainer.DefineIndexers): Remove use of temporary list. The
17246 Indexers array is already in the required order. Initialize
17247 'IndexerName' only if there are normal indexers.
17248 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
17249 (TypeContainer.Emit): Emit DefaultMember attribute only if
17250 IndexerName is initialized.
17253 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
17255 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
17258 2004-04-15 Raja R Harinath <rharinath@novell.com>
17260 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
17264 * attribute.cs (Attribute.Resolve): Check for duplicate named
17268 2004-04-15 Miguel de Icaza <miguel@ximian.com>
17270 * iterators.cs (MarkYield): track whether we are in an exception,
17271 and generate code accordingly. Use a temporary value to store the
17272 result for our state.
17274 I had ignored a bit the interaction of try/catch with iterators
17275 since their behavior was not entirely obvious, but now it is
17276 possible to verify that our behavior is the same as MS .NET 2.0
17280 2004-04-14 Miguel de Icaza <miguel@ximian.com>
17282 * iterators.cs: Avoid creating temporaries if there is no work to
17285 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
17286 Enumerations, use TypeManager.EnumToUnderlying and call
17289 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
17292 (This.Emit): Use EmitContext.EmitThis to emit our
17295 (This.EmitAssign): Ditto.
17297 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
17298 codepaths, we will move all the functionality into
17301 (FieldExpr.EmitAssign): Ditto.
17303 This fixes several hidden bugs that I uncovered while doing a code
17304 review of this today.
17306 * codegen.cs (EmitThis): reworked so the semantics are more clear
17307 and also support value types "this" instances.
17309 * iterators.cs: Changed so that for iterators in value types, we
17310 do not pass the value type as a parameter.
17312 Initialization of the enumerator helpers is now done in the caller
17313 instead of passing the parameters to the constructors and having
17314 the constructor set the fields.
17316 The fields have now `assembly' visibility instead of private.
17318 2004-04-11 Miguel de Icaza <miguel@ximian.com>
17320 * expression.cs (Argument.Resolve): Check if fields passed as ref
17321 or out are contained in a MarshalByRefObject.
17323 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
17324 another compiler type.
17326 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
17328 * class.cs (Indexer.Define): use the new name checking method.
17329 Also, return false on an error.
17330 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
17331 (is_identifier_[start/part]_character): make static.
17333 2004-04-10 Miguel de Icaza <miguel@ximian.com>
17335 * expression.cs (Binary.ResolveOperator): Do no append strings
17336 twice: since we can be invoked more than once (array evaluation)
17337 on the same concatenation, take care of this here. Based on a fix
17338 from Ben (bug #56454)
17340 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
17342 * codegen.cs: Fix another case where CS1548 must be reported (when
17343 delay-sign isn't specified and no private is available #56564). Fix
17344 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
17345 error when MCS is used on the MS runtime and we need to delay-sign
17346 (which seems unsupported by AssemblyBuilder - see #56621).
17348 2004-04-08 Marek Safar <marek.safar@seznam.cz>
17350 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
17351 (TypeManager.ComputeNamespaces): Faster implementation for
17354 * compiler.csproj: Updated AssemblyName to mcs.
17356 2004-04-07 Miguel de Icaza <miguel@ximian.com>
17358 * rootcontext.cs: Add new types to the boot resolution.
17360 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
17361 MulticastDelegate is not allowed.
17363 * typemanager.cs: Add new types to lookup: System.TypedReference
17366 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
17367 check for TypedReference or ArgIterator, they are not allowed.
17369 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
17370 makes us properly catch 1510 in some conditions (see bug 56016 for
17373 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
17375 * CryptoConvert.cs: update from corlib version
17378 2004-04-05 Miguel de Icaza <miguel@ximian.com>
17380 * class.cs (Indexer.Define): Check indexername declaration
17382 2004-04-05 Marek Safar <marek.safar@seznam.cz>
17384 * attribute.cs (IsClsCompliant): Fixed problem with handling
17385 all three states (compliant, not-compliant, undetected).
17387 2004-03-30 Marek Safar <marek.safar@seznam.cz>
17389 * attribute.cs (Attribute): Location is now public.
17390 (Resolve): Store resolved arguments (pos_values) in attribute class.
17391 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
17392 (GetClsCompliantAttributeValue): New method that gets
17393 CLSCompliantAttribute value.
17394 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
17395 if exists else null.
17396 (AttributeTester): New class for CLS-Compliant verification routines.
17398 * class.cs (Emit): Add CLS-Compliant verification.
17399 (Method.GetSignatureForError): Implemented.
17400 (Constructor.GetSignatureForError): Implemented
17401 (Constructor.HasCompliantArgs): Returns if constructor has
17402 CLS-Compliant arguments.
17403 (Constructor.Emit): Override.
17404 (Construcor.IsIdentifierClsCompliant): New method; For constructors
17405 is needed to test only parameters.
17406 (FieldBase.GetSignatureForError): Implemented.
17407 (TypeContainer): New member for storing base interfaces.
17408 (TypeContainer.FindMembers): Search in base interfaces too.
17410 * codegen.cs (GetClsComplianceAttribute): New method that gets
17411 assembly or module CLSCompliantAttribute value.
17412 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
17414 (ModuleClass.Emit): Add error 3012 test.
17416 * const.cs (Emit): Override and call base for CLS-Compliant tests.
17418 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
17419 state for all decl types.
17420 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
17421 if CLS-Compliant tests are required.
17422 (IsClsCompliaceRequired): New method. Analyze whether code
17423 must be CLS-Compliant.
17424 (IsExposedFromAssembly): New method. Returns true when MemberCore
17425 is exposed from assembly.
17426 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
17427 value or gets cached value.
17428 (HasClsCompliantAttribute): New method. Returns true if MemberCore
17429 is explicitly marked with CLSCompliantAttribute.
17430 (IsIdentifierClsCompliant): New abstract method. This method is
17431 used to testing error 3005.
17432 (IsIdentifierAndParamClsCompliant): New method. Common helper method
17433 for identifier and parameters CLS-Compliant testing.
17434 (VerifyClsCompliance): New method. The main virtual method for
17435 CLS-Compliant verifications.
17436 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
17437 null. I don't know why is null (too many public members !).
17438 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
17439 and get value of first CLSCompliantAttribute that found.
17441 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
17442 (VerifyClsCompliance): Override and add extra tests.
17444 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
17445 clscheck- disable CLS-Compliant verification event if assembly is has
17446 CLSCompliantAttribute(true).
17448 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
17449 ApllyAttribute is now called in emit section as in the other cases.
17450 Possible future Emit integration.
17451 (IsIdentifierClsCompliant): New override.
17452 (VerifyClsCompliance): New override.
17453 (GetEnumeratorName): Returns full enum name.
17455 * parameter.cs (GetSignatureForError): Implemented.
17457 * report.cs (WarningData): New struct for Warning message information.
17458 (LocationOfPreviousError): New method.
17459 (Warning): New method. Reports warning based on the warning table.
17460 (Error_T): New method. Reports error based on the error table.
17462 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
17463 verifications are done here.
17465 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
17467 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
17468 CLSCompliantAttribute.
17469 (all_imported_types): New member holds all imported types from other
17471 (LoadAllImportedTypes): New method fills static table with exported types
17472 from all referenced assemblies.
17473 (Modules): New property returns all assembly modules.
17475 2004-03-30 Miguel de Icaza <miguel@ximian.com>
17477 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
17478 throwing a parser error.
17480 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
17481 which removes the hardcoded get_/set_ prefixes for properties, as
17482 IL allows for the properties to be named something else.
17486 * expression.cs: Do not override operand before we know if it is
17487 non-null. Fix 56207
17489 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17491 * typemanager.cs: support for pinned variables.
17493 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17495 * decl.cs, typemanager.cs: Avoid using an arraylist
17496 as a buffer if there is only one result set.
17498 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17500 * expression.cs: Make sure you cant call a static method
17501 with an instance expression, bug #56174.
17503 2004-03-29 Miguel de Icaza <miguel@ximian.com>
17505 * class.cs (IsDuplicateImplementation): Improve error reporting to
17506 flag 663 (method only differs in parameter modifier).
17508 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
17509 in preprocessor directives.
17511 * location.cs (LookupFile): Allow for the empty path.
17513 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
17514 better approach for some of that patch, but its failing with the
17515 CharSet enumeration. For now try/catch will do.
17517 * typemanager.cs: Do not crash if a struct does not have fields.
17520 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17522 * expression.cs: cs0213, cant fix a fixed expression.
17525 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17527 * cs-parser.jay: detect invalid embeded statements gracefully.
17530 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17532 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
17535 the invocation type may not be a subclass of the tye of the item/
17536 The type of the item must be a subclass of the invocation item.
17541 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
17543 * attribute.cs: Added methods to get a string and a bool from an
17544 attribute. Required to information from AssemblyKeyFileAttribute,
17545 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
17546 * codegen.cs: Modified AssemblyName creation to include support for
17547 strongnames. Catch additional exceptions to report them as CS1548.
17548 * compiler.csproj: Updated include CryptoConvert.cs.
17549 * compiler.csproj.user: Removed file - user specific configuration.
17550 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
17551 Mono.Security assembly. The original class is maintained and tested in
17552 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
17553 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
17554 like CSC 8.0 (C# v2) supports.
17555 * Makefile: Added CryptoConvert.cs to mcs sources.
17556 * rootcontext.cs: Added new options for strongnames.
17558 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
17560 * driver.cs: For --expect-error, report error code `2'
17561 if the program compiled with no errors, error code `1' if
17562 it compiled with an error other than the one expected.
17564 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
17566 * compiler.csproj: Updated for Visual Studio .NET 2003.
17567 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
17568 * compiler.sln: Updated for Visual Studio .NET 2003.
17570 2004-03-24 Ravi Pratap M <ravi@ximian.com>
17572 * expression.cs: Fix bug #47234. We basically need to apply the
17573 rule that we prefer the conversion of null to a reference type
17574 when faced with a conversion to 'object' (csc behaviour).
17576 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17578 * statement.cs: Shorter form for foreach, eliminates
17579 a local variable. r=Martin.
17581 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17583 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
17584 checks if we can use brtrue/brfalse to test for 0.
17585 * expression.cs: use the above in the test for using brtrue/brfalse.
17586 cleanup code a bit.
17588 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17590 * expression.cs: Rewrite string concat stuff. Benefits:
17592 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
17593 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
17594 rather than a concat chain.
17596 * typemanager.cs: Add lookups for more concat overloads.
17598 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17600 * expression.cs: Emit shorter il code for array init.
17617 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
17619 * statement.cs: Before, two switch blocks would be merged if the
17620 total size of the blocks (end_item - begin_item + 1) was less than
17621 two times the combined sizes of the blocks.
17623 Now, it will only merge if after the merge at least half of the
17628 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
17630 * class.cs : csc build fix for GetMethods(). See bug #52503.
17632 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
17634 * expression.cs: Make sure fp comparisons work with NaN.
17635 This fixes bug #54303. Mig approved this patch a long
17636 time ago, but we were not able to test b/c the runtime
17639 2004-03-19 Miguel de Icaza <miguel@ximian.com>
17641 * ecore.cs (TypExpr.GetHashCode): implement this overload.
17643 2004-03-19 Martin Baulig <martin@ximian.com>
17645 * class.cs (MemberCore.IsDuplicateImplementation): Report the
17646 error here and not in our caller.
17648 2004-03-19 Martin Baulig <martin@ximian.com>
17650 * interface.cs: Completely killed this file.
17651 (Interface): We're now a TypeContainer and live in class.cs.
17653 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
17654 argument; we're now also called for interfaces.
17655 (TypeContainer.DefineMembers): Allow this method being called
17657 (TypeContainer.GetMethods): New public method; formerly known as
17658 Interface.GetMethod(). This is used by PendingImplementation.
17659 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
17660 it's now private and non-static.
17661 (Interface): Moved this here; it's now implemented similar to
17663 (Method, Property, Event, Indexer): Added `bool is_interface'
17664 argument to their .ctor's.
17665 (MemberBase.IsInterface): New public field.
17667 * cs-parser.jay: Create normal Method, Property, Event, Indexer
17668 instances instead of InterfaceMethod, InterfaceProperty, etc.
17669 (opt_interface_base): Removed; we now use `opt_class_base' instead.
17670 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
17672 2004-03-19 Martin Baulig <martin@ximian.com>
17674 * class.cs (MethodCore.IsDuplicateImplementation): New private
17675 method which does the CS0111 checking.
17676 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
17677 Use IsDuplicateImplementation().
17679 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
17681 * decl.cs (FindMemberToOverride): New method to find the correct
17682 method or property to override in the base class.
17684 - Make Method/Property use the above method to find the
17685 version in the base class.
17686 - Remove the InheritableMemberSignatureCompare as it is now
17689 This patch makes large code bases much faster to compile, as it is
17690 O(n) rather than O(n^2) to do this validation.
17692 Also, it fixes bug 52458 which is that nested classes are not
17693 taken into account when finding the base class member.
17695 Reviewed/Approved by Martin.
17697 2004-03-17 Marek Safar <marek.safar@seznam.cz>
17699 * interface.cs: In all interface classes removed redundant
17700 member initialization.
17702 2004-03-16 Martin Baulig <martin@ximian.com>
17704 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
17706 2004-03-15 Miguel de Icaza <miguel@ximian.com>
17708 * decl.cs (DefineTypeAndParents): New helper method to define a
17709 type's containers before the type itself is defined; This is a
17710 bug exposed by the recent changes to Windows.Forms when an
17711 implemented interface was defined inside a class that had not been
17714 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
17716 (Check): Loop correctly to report errors modifiers
17717 (UNSAFE was not in the loop, since it was the same as TOP).
17719 * interface.cs: Every interface member now takes a ModFlags,
17720 instead of a "is_new" bool, which we set on the base MemberCore.
17722 Every place where we called "UnsafeOk" in the interface, now we
17723 call the proper member (InterfaceMethod.UnsafeOK) instead to get
17724 the unsafe settings from the member declaration instead of the
17725 container interface.
17727 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
17729 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
17730 `set_indexer_name' to the pending bits (one per type).
17732 We fixed a bug today that was picking the wrong method to
17733 override, since for properties the existing InterfaceMethod code
17734 basically ignored the method name. Now we make sure that the
17735 method name is one of the valid indexer names.
17737 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
17739 * support.cs (SeekableStreamReader): Keep track of stream byte
17740 positions and don't mix them with character offsets to the buffer.
17742 Patch from Gustavo Giráldez
17744 2004-03-15 Marek Safar <marek.safar@seznam.cz>
17746 * interface.cs (InterfaceSetGetBase): Removed double member
17747 initialization, base class does it as well.
17749 2004-03-13 Martin Baulig <martin@ximian.com>
17751 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
17752 when compiling corlib.
17754 2004-03-13 Miguel de Icaza <miguel@ximian.com>
17756 * convert.cs (ExplicitConversion): We were reporting an error on
17757 certain conversions (object_type source to a value type, when the
17758 expression was `null') before we had a chance to pass it through
17759 the user defined conversions.
17761 * driver.cs: Replace / and \ in resource specifications to dots.
17764 * class.cs: Add check for duplicate operators. Fixes 52477
17766 2004-03-11 Miguel de Icaza <miguel@ximian.com>
17768 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
17769 that are in the middle of the statements, not only at the end.
17772 * class.cs (TypeContainer.AddField): No longer set the
17773 `HaveStaticConstructor' flag, now we call it
17774 `UserDefineStaticConstructor' to diferentiate the slightly
17775 semantic difference.
17777 The situation is that we were not adding BeforeFieldInit (from
17778 Modifiers.TypeAttr) to classes that could have it.
17779 BeforeFieldInit should be set to classes that have no static
17784 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
17786 And most importantly Zoltan's comment:
17788 http://bugzilla.ximian.com/show_bug.cgi?id=44229
17790 "I think beforefieldinit means 'it's ok to initialize the type sometime
17791 before its static fields are used', i.e. initialization does not need
17792 to be triggered by the first access to the type. Setting this flag
17793 helps the JIT to compile better code, since it can run the static
17794 constructor at JIT time, and does not need to generate code to call it
17795 (possibly lots of times) at runtime. Unfortunately, mcs does not set
17796 this flag for lots of classes like String.
17798 csc sets this flag if the type does not have an explicit static
17799 constructor. The reasoning seems to be that if there are only static
17800 initalizers for a type, and no static constructor, then the programmer
17801 does not care when this initialization happens, so beforefieldinit
17804 This bug prevents the AOT compiler from being usable, since it
17805 generates so many calls to mono_runtime_class_init that the AOT code
17806 is much slower than the JITted code. The JITted code is faster,
17807 because it does not generate these calls if the vtable is type is
17808 already initialized, which is true in the majority of cases. But the
17809 AOT compiler can't do this."
17811 2004-03-10 Miguel de Icaza <miguel@ximian.com>
17813 * class.cs (MethodData.Emit): Refactor the code so symbolic
17814 information is generated for destructors; For some reasons we
17815 were taking a code path that did not generate symbolic information
17818 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
17820 * class.cs: Create a Constructor.CheckBase method that
17821 takes care of all validation type code. The method
17822 contains some code that was moved from Define.
17824 It also includes new code that checks for duplicate ctors.
17825 This fixes bug #55148.
17827 2004-03-09 Joshua Tauberer <tauberer@for.net>
17829 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
17830 a { ... }-style array creation invokes EmitStaticInitializers
17831 which is not good for reference-type arrays. String, decimal
17832 and now null constants (NullCast) are not counted toward
17833 static initializers.
17835 2004-03-05 Martin Baulig <martin@ximian.com>
17837 * location.cs (SourceFile.HasLineDirective): New public field;
17838 specifies whether the file contains or is referenced by a "#line"
17840 (Location.DefineSymbolDocuments): Ignore source files which
17841 either contain or are referenced by a "#line" directive.
17843 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
17845 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
17846 direct access to our parent, so check the method inline there.
17848 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
17850 * expression.cs (Invocation.EmitCall): Miguel's last commit
17851 caused a regression. If you had:
17856 In Foo the implict this would be null.
17858 2004-02-27 Miguel de Icaza <miguel@ximian.com>
17860 * expression.cs (Invocation.EmitCall): If the method is not
17861 virtual, do not emit a CallVirt to it, use Call.
17863 * typemanager.cs (GetFullNameSignature): Improve the method to
17864 cope with ".ctor" and replace it with the type name.
17866 * class.cs (ConstructorInitializer.Resolve): Now the method takes
17867 as an argument the ConstructorBuilder where it is being defined,
17868 to catch the recursive constructor invocations.
17870 2004-02-26 Miguel de Icaza <miguel@ximian.com>
17872 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
17873 routines to check if a type is an enumerable/enumerator allow
17874 classes that implement the IEnumerable or IEnumerator interfaces.
17876 * class.cs (Property, Operator): Implement IIteratorContainer, and
17877 implement SetYields.
17879 (Property.Define): Do the block swapping for get_methods in the
17880 context of iterators. We need to check if Properties also
17881 include indexers or not.
17883 (Operator): Assign the Block before invoking the
17884 OperatorMethod.Define, so we can trigger the Iterator code
17887 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
17888 Property and Operator classes are not created when we parse the
17889 declarator but until we have the block completed, so we use a
17890 singleton SimpleIteratorContainer.Simple to flag whether the
17891 SetYields has been invoked.
17893 We propagate this setting then to the Property or the Operator to
17894 allow the `yield' to function.
17896 2004-02-25 Marek Safar <marek.safar@seznam.cz>
17898 * codegen.cs: Implemented attribute support for modules.
17899 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
17900 Assembly/Module functionality.
17902 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
17903 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
17904 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
17906 2004-02-16 Marek Safar <marek.safar@seznam.cz>
17908 * interface.cs (FindMembers): The operation is performed on all base
17909 interfaces and not only on the first. It is required for future CLS Compliance patch.
17911 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
17913 * statement.cs, codegen.cs:
17914 This patch deals with patterns such as:
17916 public class List : IEnumerable {
17918 public MyEnumerator GetEnumerator () {
17919 return new MyEnumerator(this);
17922 IEnumerator IEnumerable.GetEnumerator () {
17926 public struct MyEnumerator : IEnumerator {
17931 Before, there were a few things we did wrong:
17932 1) we would emit callvirt on a struct, which is illegal
17933 2) we emited ldarg when we needed to emit ldarga
17934 3) we would mistakenly call the interface methods on an enumerator
17935 type that derived from IEnumerator and was in another assembly. For example:
17937 public class MyEnumerator : IEnumerator
17939 Would have the interface methods called, even if there were public impls of the
17940 method. In a struct, this lead to invalid IL code.
17942 2004-02-11 Marek Safar <marek.safar@seznam.cz>
17944 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
17947 * delegate.cs (Define): Fixed crash when delegate type is undefined.
17949 2004-02-11 Miguel de Icaza <miguel@ximian.com>
17951 * cs-parser.jay: Fix small regression: we were not testing V2
17952 compiler features correctly.
17954 * interface.cs: If the emit context is null, then create one
17956 2004-02-09 Marek Safar <marek.safar@seznam.cz>
17958 * decl.cs (GetSignatureForError): New virtual method to get full name
17959 for error messages.
17961 * attribute.cs (IAttributeSupport): New interface for attribute setting.
17962 Now it is possible to rewrite ApplyAttributes method to be less if/else.
17964 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
17965 Duplicated members and code in these classes has been removed.
17966 Better encapsulation in these classes.
17968 2004-02-07 Miguel de Icaza <miguel@ximian.com>
17970 * assign.cs (Assign.DoResolve): When dealing with compound
17971 assignments, there is a new rule in ECMA C# 2.4 (might have been
17972 there before, but it is documented here) that states that in:
17976 If b is of type int, and the `op' is a shift-operator, then the
17977 above is evaluated as:
17981 * expression.cs (Binary.ResolveOperator): Instead of testing for
17982 int/uint/long/ulong, try to implicitly convert to any of those
17983 types and use that in pointer arithmetic.
17985 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
17986 method to print information for from the type, not from the
17987 null-method we were given.
17989 2004-02-01 Duncan Mak <duncan@ximian.com>
17991 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
17992 parsing for cmd, fixes bug #53694.
17994 2004-02-04 Marek Safar <marek.safar@seznam.cz>
17996 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
17997 in the member name duplication tests. Property and operator name duplication
17998 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
18000 2004-02-03 Marek Safar <marek.safar@seznam.cz>
18002 * interface.cs (PopulateMethod): Fixed crash when interface method
18003 returns not existing type (error test cs0246-3.cs).
18005 2004-02-02 Ravi Pratap M <ravi@ximian.com>
18007 * cs-parser.jay (interface_accessors): Re-write actions to also
18008 store attributes attached to get and set methods. Fix spelling
18011 (inteface_property_declaration): Modify accordingly.
18013 (InterfaceAccessorInfo): New helper class to store information to pass
18014 around between rules that use interface_accessors.
18016 * interface.cs (Emit): Apply attributes on the get and set
18017 accessors of properties and indexers too.
18019 * attribute.cs (ApplyAttributes): Modify accordingly to use the
18020 right MethodBuilder when applying attributes to the get and set accessors.
18022 2004-01-31 Miguel de Icaza <miguel@ximian.com>
18024 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
18026 2004-01-26 Miguel de Icaza <miguel@ximian.com>
18028 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
18030 2004-01-25 Miguel de Icaza <miguel@ximian.com>
18032 * cs-parser.jay: Remove YIELD token, instead use the new grammar
18033 changes that treat `yield' specially when present before `break'
18034 or `return' tokens.
18036 * cs-tokenizer.cs: yield is no longer a keyword.
18038 2004-01-23 Marek Safar <marek.safar@seznam.cz>
18040 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
18041 setting for default constructors.
18042 For default constructors are almost every time set wrong Modifier. The
18043 generated IL code has been alright. But inside mcs this values was
18044 wrong and this was reason why several of my CLS Compliance tests
18047 2004-01-22 Martin Baulig <martin@ximian.com>
18049 * cs-parser.jay (namespace_or_type_name): Return an Expression,
18050 not a QualifiedIdentifier. This is what `type_name_expression'
18051 was previously doing.
18052 (type_name_expression): Removed; the code is now in
18053 `namespace_or_type_name'.
18054 (qualified_identifier): Removed, use `namespace_or_type_name'
18056 (QualifiedIdentifier): Removed this class.
18058 2004-01-22 Martin Baulig <martin@ximian.com>
18060 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
18061 not a string as alias name.
18063 2004-01-21 Miguel de Icaza <miguel@ximian.com>
18065 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
18066 #52730 bug, and instead compute correctly the need to use a
18067 temporary variable when requesting an address based on the
18068 static/instace modified of the field and the constructor.
18070 2004-01-21 Martin Baulig <martin@ximian.com>
18072 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
18073 class and namespace before looking up aliases. Fixes #52517.
18075 2004-01-21 Martin Baulig <martin@ximian.com>
18077 * flowanalysis.cs (UsageVector.Merge): Allow variables being
18078 assinged in a 'try'; fixes exception4.cs.
18080 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18081 * class.cs : Implemented parameter-less constructor for TypeContainer
18083 * decl.cs: Attributes are now stored here. New property OptAttributes
18085 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
18087 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
18089 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18091 * typemanager.cs (CSharpSignature): Now reports also inner class name.
18092 (CSharpSignature): New method for indexer and property signature.
18094 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18096 * pending.cs (IsVirtualFilter): Faster implementation.
18098 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18100 * typemanager.cs: Avoid inclusion of same assembly more than once.
18102 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18104 * cs-parser.jay: Fixed problem where the last assembly attribute
18105 has been applied also to following declaration (class, struct, etc.)
18107 2004-01-21 Marek Safar <marek.safar@seznam.cz>
18109 * class.cs: Added error CS0538, CS0539 reporting.
18110 Fixed crash on Microsoft runtime when field type is void.
18112 * cs-parser.jay: Added error CS0537 reporting.
18114 * pending.cs: Added error CS0535 reporting.
18115 Improved error report for errors CS0536, CS0534.
18117 2004-01-20 Miguel de Icaza <miguel@ximian.com>
18119 Merge a few bits from the Anonymous Method MCS tree.
18121 * statement.cs (ToplevelBlock): New class for toplevel methods,
18122 will hold anonymous methods, lifted variables.
18124 * cs-parser.jay: Create toplevel blocks for delegates and for
18125 regular blocks of code.
18127 2004-01-20 Martin Baulig <martin@ximian.com>
18129 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
18130 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
18131 and `NeedExplicitReturn'; added `IsLastStatement'.
18132 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
18133 have a `ReturnLabel' or we're not unreachable.
18135 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
18136 child's reachability; don't just override ours with it. Fixes
18137 #58058 (lluis's example).
18138 (FlowBranching): Added public InTryOrCatch(), InCatch(),
18139 InFinally(), InLoop(), InSwitch() and
18140 BreakCrossesTryCatchBoundary() methods.
18142 * statement.cs (Return): Do all error checking in Resolve().
18143 Unless we are the last statement in a top-level block, always
18144 create a return label and jump to it.
18145 (Break, Continue): Do all error checking in Resolve(); also make
18146 sure we aren't leaving a `finally'.
18147 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
18148 statement in a top-level block.
18149 (Block.Flags): Added `IsDestructor'.
18150 (Block.IsDestructor): New public property.
18152 2004-01-20 Martin Baulig <martin@ximian.com>
18154 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
18156 2004-01-20 Martin Baulig <martin@ximian.com>
18158 * statement.cs (Statement.ResolveUnreachable): New public method.
18159 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
18160 (Block.Resolve): Resolve unreachable statements.
18162 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
18164 * expression.cs: We need to fix the case where we do
18165 not have a temp variable here.
18167 * assign.cs: Only expression compound assignments need
18168 temporary variables.
18170 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
18172 * flowanalysis.cs: Reduce memory allocation in a few ways:
18173 - A block with no variables should not allocate a bit
18175 - A method with no out parameters does not need any tracking
18176 for assignment of the parameters, so we need not allocate
18179 public readonly Type[] VariableTypes;
18180 public readonly string[] VariableNames;
18181 Are redundant. The data is already stored in the variable
18182 map, so we need not allocate another array for it.
18183 - We need to add alot of checks for if (params | locals) == null
18184 due to the first two changes.
18186 2004-01-18 Miguel de Icaza <miguel@ximian.com>
18188 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
18189 implement IMemoryLocation, we store a copy on a local variable and
18190 take the address of it. Patch from Benjamin Jemlich
18192 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
18193 to use a special "type_name_expression" rule which reduces the
18194 number of "QualifiedIdentifier" classes created, and instead
18195 directly creates MemberAccess expressions.
18197 2004-01-17 Miguel de Icaza <miguel@ximian.com>
18199 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
18200 that fixes #52853. Null literal assignment to ValueType
18202 * class.cs (MethodData.Emit): Instead of checking the name of the
18203 method to determine if its a destructor, create a new derived
18204 class from Method called Destructor, and test for that.
18206 * cs-parser.jay: Create a Destructor object instead of a Method.
18208 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
18212 2004-01-16 Miguel de Icaza <miguel@ximian.com>
18214 * expression.cs (Binary.ResolveOperator): Perform an implicit
18215 conversion from MethodGroups to their delegate types on the
18216 Addition operation.
18218 * delegate.cs: Introduce a new class DelegateCreation that is the
18219 base class for `NewDelegate' and `ImplicitDelegateCreation',
18220 factor some code in here.
18222 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
18223 conversion from MethodGroups to compatible delegate types.
18225 * ecore.cs (Expression.Resolve): Do not flag error 654
18226 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
18227 we allow conversions from MethodGroups to delegate types now.
18229 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
18230 assignments in v2 either.
18232 2004-01-10 Miguel de Icaza <miguel@ximian.com>
18234 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
18235 static read-only fields in ctors.
18237 Applied patch from Benjamin Jemlich
18239 * expression.cs (UnaryMutator): Avoid leaking local variables.
18241 2004-01-09 Miguel de Icaza <miguel@ximian.com>
18243 * cs-tokenizer.cs (IsCastToken): Allow the various native types
18244 here to return true, as they can be used like this:
18246 (XXX) int.MEMBER ()
18248 Fixed 49836 and all the other dups
18250 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
18252 * driver.cs: Implement /win32res and /win32icon.
18254 2004-01-08 Miguel de Icaza <miguel@ximian.com>
18256 * cs-parser.jay: Add a rule to improve error handling for the
18257 common mistake of placing modifiers after the type.
18259 2004-01-07 Miguel de Icaza <miguel@ximian.com>
18261 * cs-parser.jay (interface_event_declaration): Catch
18262 initialization of events on interfaces, and report cs0068
18264 * cs-parser.jay (interface_event_declaration): Catch
18265 initialization of events.
18267 * ecore.cs: Better report missing constructors.
18269 * expression.cs (Binary.ResolveOperator): My previous bug fix had
18270 the error reporting done in the wrong place. Fix.
18272 * expression.cs (Binary.ResolveOperator): Catch the
18273 operator + (E x, E y) error earlier, and later allow for implicit
18274 conversions in operator +/- (E e, U x) from U to the underlying
18277 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
18278 52596, if the container class is abstract, the default constructor
18279 is protected otherwise its public (before, we were always public).
18281 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
18284 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
18285 Jemlich that fixes bug #52597, MCS was generating invalid code for
18286 idisposable structs. Thanks to Ben for following up with this
18289 2004-01-06 Miguel de Icaza <miguel@ximian.com>
18291 * driver.cs: Allow assemblies without code to be generated, fixes
18294 2004-01-07 Nick Drochak <ndrochak@gol.com>
18296 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
18298 2004-01-05 Miguel de Icaza <miguel@ximian.com>
18300 * cs-parser.jay: Add rules to improve error reporting if fields or
18301 methods are declared at the namespace level (error 116)
18303 * Add rules to catch event add/remove
18305 2004-01-04 David Sheldon <dave-mono@earth.li>
18307 * expression.cs: Added matching ")" to error message for
18310 2004-01-03 Todd Berman <tberman@gentoo.org>
18312 * ecore.cs, attribute.cs:
18313 Applying fix from #52429.
18315 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18317 * ecore.cs, expression.cs, statement.cs:
18318 Total rewrite of how we handle branching. We
18319 now handle complex boolean expressions with fewer
18320 jumps. As well if (x == 0) no longer emits a ceq.
18322 if (x is Foo) is much faster now, because we generate
18325 Overall, we get a pretty big improvement on our benchmark
18326 tests. The code we generate is smaller and more readable.
18328 I did a full two-stage bootstrap. The patch was reviewed
18329 by Martin and Miguel.
18331 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18333 * cs-parser.jay: Make primary_expression not take a QI.
18334 we dont need this because the member_access rule covers
18335 us here. So we replace the rule with just IDENTIFIER.
18337 This has two good effects. First, we remove a s/r conflict.
18338 Second, we allocate many fewer QualifiedIdentifier objects.
18340 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18342 * attribute.cs: Handle MarshalAs attributes as pseudo, and
18343 set the correct information via SRE. This prevents
18344 hanging on the MS runtime. Fixes #29374.
18346 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18348 * convert.cs: correctly handle conversions to value types
18349 from Enum and ValueType as unboxing conversions.
18351 Fixes bug #52569. Patch by Benjamin Jemlich.
18353 2004-01-02 Ravi Pratap <ravi@ximian.com>
18355 * expression.cs (BetterConversion): Prefer int -> uint
18356 over int -> ulong (csc's behaviour). This fixed bug #52046.
18358 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
18360 * decl.cs (MemberCache.FindMembers): now returns a
18363 * typemanager.cs: In general, go with with ^^.
18364 (CopyNewMethods): take an IList.
18365 (RealMemberLookup): Only allocate an arraylist
18366 if we copy from two sets of methods.
18368 This change basically does two things:
18369 1) Fewer array lists allocated due to CopyNewMethods.
18370 2) the explicit cast in MemberList costed ALOT.
18372 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
18374 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
18375 a hashtable to avoid needless string allocations when an identifier is
18376 used more than once (the common case).
18378 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
18380 * pending.cs: MS's TypeBuilder.GetInterfaces ()
18381 is broken, it will not return anything. So, we
18382 have to use the information we have in mcs to
18385 * typemanager.cs: Add a cache for GetInterfaces,
18386 since this will now be used more often (due to ^^)
18388 (GetExplicitInterfaces) New method that gets the
18389 declared, not effective, interfaces on a type
18390 builder (eg, if you have interface IFoo, interface
18391 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
18394 This patch makes MCS able to bootstrap itself on
18397 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
18399 * expression.cs: Remove the Nop's that Miguel put
18402 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18404 * report.cs, codegen.cs: Give the real stack trace to
18405 the error when an exception is thrown.
18407 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18409 * decl.cs: only allocate hashtables for ifaces if
18412 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18414 * expression.cs: fix the error from cs0121-2.cs
18415 (a parent interface has two child interfaces that
18416 have a function with the same name and 0 params
18417 and the function is called through the parent).
18419 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
18421 * class.cs, rootcontext.cs, typmanager.cs: do not
18424 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
18426 * codegen.cs: remove stack for the ec flow branching.
18427 It is already a linked list, so no need.
18429 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
18431 * Makefile: Allow custom profiler here.
18433 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
18435 * typemanager.cs (LookupType):
18436 - Use a static char [], because split takes
18437 a param array for args, so it was allocating
18439 - Do not store true in a hashtable, it boxes.
18441 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
18443 * flowanalysis.cs: bytify common enums.
18445 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18447 * modifiers.cs: Add a new set of flags for the
18448 flags allowed on explicit interface impls.
18449 * cs-parser.jay: catch the use of modifiers in
18450 interfaces correctly.
18451 * class.cs: catch private void IFoo.Blah ().
18453 All related to bug #50572.
18455 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18457 * decl.cs: Rewrite the consistant accessability checking.
18458 Accessability is not linear, it must be implemented in
18459 a tableish way. Fixes #49704.
18461 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18463 * expression.cs: Handle negation in a checked context.
18464 We must use subtraction from zero. Fixes #38674.
18466 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
18468 * class.cs: Ignore static void main in DLLs.
18469 * rootcontext.cs: Handle the target type here,
18470 since we are have to access it from class.cs
18471 * driver.cs: account for the above.
18473 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
18475 * report.cs: Give line numbers and files if available.
18477 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
18479 * driver.cs: Implement /addmodule.
18481 * typemanager.cs: Change 'modules' field so it now contains Modules not
18484 2003-12-20 Martin Baulig <martin@ximian.com>
18486 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
18487 (FieldBase.IsAssigned): Removed this field.
18488 (FieldBase.SetAssigned): New public method.
18489 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
18491 2003-12-20 Martin Baulig <martin@ximian.com>
18493 * expression.cs (LocalVariableReference.DoResolve): Don't set
18494 `vi.Used' if we're called from DoResolveLValue().
18496 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
18497 returns the usage vector it just merged into the current one -
18498 pass this one to UsageWarning().
18499 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
18500 of the `EmitContext', don't call this recursively on our children.
18502 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
18504 * driver.cs: Implement /target:module.
18506 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
18508 * support.cs (CharArrayHashtable): New helper class.
18510 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
18511 char arrays, not strings, so we can avoid creating a string in
18512 consume_identifier if the identifier is a keyword.
18514 2003-12-16 Martin Baulig <martin@ximian.com>
18516 * statement.cs (LocalInfo.Assigned): Removed this property.
18517 (LocalInfo.Flags): Removed `Assigned'.
18518 (LocalInfo.IsAssigned): New public method; takes the EmitContext
18519 and uses flow analysis.
18520 (Block.UsageWarning): Made this method private.
18521 (Block.Resolve): Call UsageWarning() if appropriate.
18523 * expression.cs (LocalVariableReference.DoResolve): Always set
18524 LocalInfo.Used here.
18526 2003-12-13 Martin Baulig <martin@ximian.com>
18528 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
18529 any value here; we're now using flow analysis to figure out
18530 whether a statement/block returns a value.
18532 2003-12-13 Martin Baulig <martin@ximian.com>
18534 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
18536 (FlowBranching.MergeFinally): Don't call
18537 `branching.CheckOutParameters()' here, this is called in
18539 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
18540 when adding the `finally' vector.
18542 2003-12-13 Martin Baulig <martin@ximian.com>
18545 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
18546 actually work and also fix #48962.
18548 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
18550 * decl.cs: Do not check System.Object for nested types,
18551 since we know it does not have any. Big bang for buck:
18554 Run 1: 8.35 seconds
18555 Run 2: 8.32 seconds
18556 corlib: 17.99 seconds
18558 Run 1: 8.17 seconds
18559 Run 2: 8.17 seconds
18560 corlib: 17.39 seconds
18562 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
18564 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
18565 time we are returning 0 members, so we save alot here.
18567 2003-12-11 Martin Baulig <martin@ximian.com>
18569 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
18570 `MergeChild()', also just take the `FlowBranching' as argument;
18571 call Merge() on it and return the result.
18572 (FlowBranching.Merge): We don't need to do anything if we just
18575 2003-12-11 Martin Baulig <martin@ximian.com>
18577 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
18578 them in an `ArrayList' to reduce memory usage. Thanks to Ben
18579 Maurer for this idea.
18581 2003-12-11 Martin Baulig <martin@ximian.com>
18583 * flowanalysis.cs (MergeResult): This class is now gone; we now
18584 use the `UsageVector' for this. The reason for this is that if a
18585 branching just has one sibling, we don't need to "merge" them at
18586 all - that's the next step to do.
18587 (FlowBranching.Merge): We now return a `UsageVector' instead of a
18590 2003-12-11 Martin Baulig <martin@ximian.com>
18592 Reworked flow analyis and made it more precise and bug-free. The
18593 most important change is that we're now using a special `Reachability'
18594 class instead of having "magic" meanings of `FlowReturns'. I'll
18595 do some more cleanups and optimizations and also add some more
18596 documentation this week.
18598 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
18599 largely reworked this class.
18600 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
18601 the new `Reachability' class instead of having "magic" values here.
18602 (FlowBranching): We're now using an instance of `Reachability'
18603 instead of having separate `Returns', `Breaks' etc. fields.
18605 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
18606 based on flow analysis; ignore the return value of block.Emit ().
18608 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
18610 * driver.cs typemanager.cs: Find the mono extensions to corlib even
18611 if they are private.
18613 2003-12-09 Martin Baulig <martin@ximian.com>
18615 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
18616 call them directly on the UsageVector.
18618 2003-12-09 Martin Baulig <martin@ximian.com>
18620 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
18621 Changed return type from `FlowReturns' to `Reachability'.
18623 2003-12-09 Martin Baulig <martin@ximian.com>
18625 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
18626 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
18627 `Reachable' fields with a single `Reachability' one.
18629 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18631 * class.cs (FindMembers): Remove foreach's.
18636 Run 1: 8.74 seconds
18637 Run 2: 8.71 seconds
18640 Run 1: 8.64 seconds
18641 Run 2: 8.58 seconds
18644 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18649 This patch does a few things:
18650 1. EmptyStatement is now a singleton, so it is never reallocated.
18651 2. All blah is EmptyStatement constructs have been changed to
18652 blah == EmptyStatement.Value, which is much faster and valid
18653 now that EmptyStatement is a singleton.
18654 3. When resolving a block, rather than allocating a new array for
18655 the non-empty statements, empty statements are replaced with
18656 EmptyStatement.Value
18657 4. Some recursive functions have been made non-recursive.
18658 Mainly the performance impact is from (3), however (1) and (2) are needed for
18659 this to work. (4) does not make a big difference in normal situations, however
18660 it makes the profile look saner.
18665 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18666 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18667 Total memory allocated: 56397 KB
18670 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
18671 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
18672 Total memory allocated: 55666 KB
18674 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18676 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
18677 than the hashtable in a hashtable version
18679 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
18680 we always end up concating a string. This results in a huge perf
18681 loss, because many strings have to be tracked by the GC. In this
18682 patch, we first use a hashtable that works with two keys, so that
18683 the strings do not need to be concat'ed.
18687 Run 1: 8.74 seconds
18688 Run 2: 8.71 seconds
18691 Run 1: 8.65 seconds
18692 Run 2: 8.56 seconds
18694 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18696 * Makefile: Add a new target `do-time' that does a quick and simple
18697 profile, leaving easy to parse output.
18699 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
18701 * codegen.cs (Init): Create the dynamic assembly with
18702 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
18704 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
18706 * support.cs: Make the PtrHashtable use only one
18707 instance of its comparer.
18709 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
18711 * typemanager.cs: Fix lookup of GetNamespaces.
18713 2003-11-29 Miguel de Icaza <miguel@ximian.com>
18715 * expression.cs: Removed redundant line.
18717 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
18718 ArrayLists, use for loops with bounds.
18720 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
18723 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
18724 arraylists, use for loop with bounds.
18726 The above three changes give us a 0.071 second performance
18727 improvement out of 3.294 seconds down to 3.223. On my machine
18728 the above changes reduced the memory usage by 1,387 KB during
18729 compiler bootstrap.
18731 * cs-parser.jay (QualifiedIdentifier): New class used to represent
18732 QualifiedIdentifiers. Before we created a new string through
18733 concatenation, and mostly later on, the result would be
18734 manipulated by DecomposeQI through string manipulation.
18736 This reduced the compiler memory usage for bootstrapping from
18737 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
18738 compile times in 0.05 seconds.
18740 2003-11-28 Dick Porter <dick@ximian.com>
18742 * support.cs: Do string compares with the Invariant culture.
18750 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
18751 the comparison is done with the Invariant culture.
18753 2003-11-27 Miguel de Icaza <miguel@ximian.com>
18755 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
18756 GetEnumerator method.
18758 (ProbeCollectionType): Iterate starting at the most specific type
18759 upwards looking for a GetEnumerator
18761 * expression.cs: Shift count can be up to 31 for int/uint and 63
18764 2003-11-26 Miguel de Icaza <miguel@ximian.com>
18766 * statement.cs (Block.LookupLabel): Also look for the label on the
18767 children blocks. Use a hash table to keep track of visited
18770 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
18771 we actually did transform the other operand, otherwise fall back
18772 to the common codepath that casts to long.
18774 * cs-tokenizer.cs: Use the same code pattern as the int case.
18775 Maybe I should do the parsing myself, and avoid depending on the
18776 Parse routines to get this done.
18778 2003-11-25 Miguel de Icaza <miguel@ximian.com>
18780 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
18781 which fixes bug 51347. This time test it.
18783 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
18784 attributes for example can not tell the difference between these.
18785 The difference was only a syntax feature of the language.
18787 * attribute.cs: Apply attributes to delegates.
18789 * delegate.cs: Call the apply attributes method.
18791 2003-11-24 Miguel de Icaza <miguel@ximian.com>
18793 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
18794 comparing 0 vs Byte.MinValue, not the value
18796 (ImplicitConversionRequired): When reporting a conversion error,
18797 use error 31 to print out the constant error instead of the
18800 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
18801 which fixes bug 51347.
18803 2003-11-22 Miguel de Icaza <miguel@ximian.com>
18805 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
18806 which fixes the -warnaserror command line option.
18808 2003-11-21 Miguel de Icaza <miguel@ximian.com>
18810 * cfold.cs (DoNumericPromotions): During constant folding of
18811 additions on UIntConstant, special case intconstants with
18812 IntConstants like we do on the expression binary operator.
18814 2003-11-12 Miguel de Icaza <miguel@ximian.com>
18816 * convert.cs (ImplicitReferenceConversion): We were missing a case
18817 (System.Enum are not value types or class types, so we need to
18818 classify them separatedly).
18820 * driver.cs: We do not support error 2007.
18822 2003-11-12 Jackson Harper <jackson@ximian.com>
18824 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
18825 system directory. Also use the full file name so users can
18826 libraries names mscorlib-o-tron.dll in a non system dir.
18828 2003-11-10 Martin Baulig <martin@ximian.com>
18830 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
18831 (TypeManager.InitCoreTypes): Initialize them here, but instead of
18832 calling `ResolveType()' on them, directly assign their `Type'.
18834 2003-11-08 Martin Baulig <martin@ximian.com>
18836 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
18837 return value and the `out parent' parameter.
18838 (TypeContainer.DefineType): Moved the CS0644 check into
18839 GetClassBases(). Don't pass the interface types to the
18840 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
18841 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
18843 * ecore.cs (TypeExpr.IsAttribute): New property.
18844 (TypeExpr.GetInterfaces): New method.
18846 * interface.cs (Interface.GetInterfaceTypeByName): Return a
18847 TypeExpr instead of a Type.
18848 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
18849 (Interface.DefineType): Don't pass the interface types to the
18850 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
18851 them later and then call `TypeBulider.AddInterfaceImplementation()'.
18853 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
18854 instead of a `Type[]'.
18855 (TypeManager.RegisterBuilder): Likewise.
18856 (TypeManager.AddUserInterface): Likewise.
18857 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
18858 `Type[]' and also return a `TypeExpr[]'.
18859 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
18861 2003-11-08 Martin Baulig <martin@ximian.com>
18863 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
18866 2003-11-08 Martin Baulig <martin@ximian.com>
18868 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
18869 TypeManager.ResolveExpressionTypes().
18871 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
18872 instead of an Expression.
18873 (TypeExpr): This is now an abstract base class for `TypeExpression'.
18874 (TypeExpression): New public class; formerly known as `TypeExpr'.
18876 * expression.cs (ComposedCast): Derive from TypeExpr.
18878 * typemanager.cs (TypeManager.system_*_expr): These are now
18879 TypExpr's instead of Expression's.
18880 (TypeManager.ResolveExpressionTypes): New public static function;
18881 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
18884 2003-11-06 Miguel de Icaza <miguel@ximian.com>
18886 * expression.cs (New.DoResolve): Do not dereference value that
18887 might be a null return.
18889 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
18890 sure that the constant value has the right type. Fixes an
18891 unreported bug, similar to 50425.
18893 * const.cs (Const.LookupConstantValue): Call
18894 ImplicitStandardConversionExists before doing a conversion to
18895 avoid havng the TypeManager.ChangeType do conversions.
18897 Reduced the number of casts used
18899 (Const.ChangeType): New routine to enable reuse of the constant
18900 type changing code from statement.
18902 * typemanager.cs (ChangeType): Move common initialization to
18903 static global variables.
18907 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
18908 every value type to go through, even if it was void. Fix that.
18910 * cs-tokenizer.cs: Use is_identifier_start_character on the start
18911 character of the define, and the is_identifier_part_character for
18912 the rest of the string.
18914 2003-11-05 Miguel de Icaza <miguel@ximian.com>
18916 * expression.cs (UnaryMutator.EmitCode): When I updated
18917 LocalVariableReference.DoResolve, I overdid it, and dropped an
18918 optimization done on local variable references.
18920 2003-11-04 Miguel de Icaza <miguel@ximian.com>
18922 * ecore.cs: Convert the return from Ldlen into an int.
18924 2003-10-20 Miguel de Icaza <miguel@ximian.com>
18926 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
18927 the accessibility, this is a special case for toplevel non-public
18928 classes (internal for instance).
18930 2003-10-20 Nick Drochak <ndrochak@gol.com>
18932 * ecore.cs: Fix typo and build. Needed another right paren.
18934 2003-10-19 Miguel de Icaza <miguel@ximian.com>
18936 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
18937 `internal' case regular and protected, but not allowing protected
18938 to be evaluated later. Bug 49840
18940 2003-10-15 Miguel de Icaza <miguel@ximian.com>
18942 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
18943 to kb.Nlast, and not the kb.nFirst to isolate the switch
18946 Extract the underlying type, so enumerations of long/ulong are
18947 treated like long/ulong.
18949 2003-10-14 Miguel de Icaza <miguel@ximian.com>
18951 * expression.cs (New): Overload the meaning of RequestedType to
18952 track the possible creation of the NewDelegate type, since
18953 DoResolve is invoked more than once for new constructors on field
18956 See bugs: #48800 and #37014
18958 * cs-parser.jay (declare_local_constants): Take an arraylist
18959 instead of a single constant.
18961 (local_constant_declaration): It should take a
18962 constant_declarators, not a constant_declarator. Fixes 49487
18964 * convert.cs: Fix error report.
18966 2003-10-13 Jackson Harper <jackson@ximian.com>
18968 * typemanager.cs (TypeToCoreType): Add float and double this fixes
18971 2003-10-09 Martin Baulig <martin@ximian.com>
18973 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
18975 (MethodCore.DoDefineParameters): Removed the TypeContainer
18976 argument; use the DeclSpace which was passed to the .ctor instead.
18977 (MethodCore.CheckParameter): Take a DeclSpace instead of a
18978 TypeContainer; we only need a DeclSpace here.
18980 2003-10-09 Martin Baulig <martin@ximian.com>
18982 * class.cs (MethodData): Added additional `DeclSpace ds' argument
18984 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
18985 EmitContext's .ctor.
18987 2003-10-09 Martin Baulig <martin@ximian.com>
18989 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
18990 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
18991 AsAccessible(), moved them as well.
18993 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
18995 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
18997 * cs-parser.jay : Renamed yyName to yyNames related to jay.
18999 2003-10-07 Miguel de Icaza <miguel@ximian.com>
19001 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
19002 generation for >=, as spotted by Paolo, bug 48679.
19003 Patch from David Waite.
19005 * cs-tokenizer.cs: Add handling for #pragma.
19007 * cs-parser.jay: Allow for both yield and yield return in the
19008 syntax. The anti-cobolization of C# fight will go on!
19010 * class.cs (TypeBuilder.DefineType): Catch error condition here
19011 (Parent.DefineType erroring out and returning null).
19013 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19014 coping with enumerations variables, we were mistakenly processing
19015 them as a regular value type instead of built-in types. Fixes the
19018 * typemanager.cs (IsBuiltinOrEnum): New method.
19020 2003-09-30 Miguel de Icaza <miguel@ximian.com>
19022 * cs-parser.jay: Upgrade: yield now needs the return clause.
19024 2003-09-19 Martin Baulig <martin@ximian.com>
19026 * decl.cs (MemberCache.SetupCacheForInterface): Take a
19027 `MemberCache parent' argument. Normally, an interface doesn't
19028 have a parent type except System.Object, but we use this in gmcs
19029 for generic type parameters.
19031 2003-09-18 Martin Baulig <martin@ximian.com>
19033 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
19034 on `type.IsInterface'; don't check whether the type has a parent
19035 to determine whether it's an interface.
19037 2003-09-15 Martin Baulig <martin@ximian.com>
19039 * class.cs (TypeContainer.DefineType): Added an error flag to
19040 avoid reporting duplicate CS0146's ("class definition is
19043 * driver.cs (Driver.MainDriver): Abort if
19044 RootContext.ResolveTree() reported any errors.
19046 2003-09-07 Martin Baulig <martin@ximian.com>
19048 * report.cs (Error, Warning): Added overloaded versions which take
19049 a `params object[] args' and call String.Format().
19051 2003-09-07 Martin Baulig <martin@ximian.com>
19053 * decl.cs (DeclSpace..ctor): Don't call
19054 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
19055 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
19056 (DeclSpace.RecordDecl): New method.
19058 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
19060 2003-09-02 Ravi Pratap <ravi@ximian.com>
19062 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
19063 value attributes to be applied to ParameterBuilders.
19065 * class.cs (MethodCore.LabelParameters): Make static and more
19066 generic so that it can be used from other places - like interface
19067 methods, for instance.
19069 * interface.cs (Interface.Emit): Call LabelParameters before
19070 emitting attributes on the InterfaceMethod.
19072 2003-08-26 Martin Baulig <martin@ximian.com>
19074 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
19075 resolving aliases; fixes #47927.
19077 2003-08-26 Martin Baulig <martin@ximian.com>
19079 * statement.cs (Using.DoResolve): This is internally emitting a
19080 try/finally clause, so we need to set ec.NeedExplicitReturn if we
19081 do not always return. Fixes #47681.
19083 2003-08-26 Martin Baulig <martin@ximian.com>
19085 * decl.cs (MemberCore): Moved WarningNotHiding(),
19086 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
19088 (AdditionResult): Make this nested in DeclSpace.
19089 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
19090 argument; call NamespaceEntry.Define() unless we're nested in a
19093 * namespace.cs (Namespace.DefineName): New public function. This
19094 is called from DeclSpace's .ctor to add
19095 (Namespace.Lookup): Include DeclSpaces in the lookup.
19097 * class.cs (Operator): Derive from MemberBase, not MemberCore.
19099 * const.cs (Const): Derive from MemberBase, not MemberCore.
19101 2003-08-25 Martin Baulig <martin@ximian.com>
19103 * convert.cs (Convert.ExplicitReferenceConversion): When
19104 converting from an interface type to a class, unbox if the target
19105 type is a struct type. Fixes #47822.
19107 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19109 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
19112 2003-08-22 Martin Baulig <martin@ximian.com>
19114 * class.cs (TypeManager.DefineType): When defining a nested type,
19115 call DefineType() on our parent; fixes #47801.
19117 2003-08-22 Martin Baulig <martin@ximian.com>
19119 * class.cs (MethodData.Define): While checking if a method is an
19120 interface implementation, improve the test a bit more to fix #47654.
19122 2003-08-22 Martin Baulig <martin@ximian.com>
19124 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
19125 correctly; fixes #47722.
19127 2003-08-22 Martin Baulig <martin@ximian.com>
19129 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
19130 LocalVariableReference, ensure it's not read-only. Fixes #47536.
19132 * statement.cs (Fixed.DoResolve): Make all variables read-only.
19134 2003-08-22 Martin Baulig <martin@ximian.com>
19136 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
19137 can only be assigned in static constructors. Fixes #47161.
19139 2003-08-22 Martin Baulig <martin@ximian.com>
19141 Rewrote and improved the flow analysis code.
19143 * flowbranching.cs (FlowBranching): Make this class abstract.
19144 (FlowBranching.CreateBranching): New static function to create a
19145 new flow branching.
19146 (FlowBranchingBlock, FlowBranchingException): New classes.
19147 (FlowBranching.UsageVector.Type): New public readonly field.
19148 (FlowBranching.UsageVector.Breaks): Removed the setter.
19149 (FlowBranching.UsageVector.Returns): Removed the setter.
19150 (FlowBranching.UsageVector): Added Break(), Return(),
19151 NeverReachable() and Throw() methods to modify the reachability.
19152 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
19153 done by FlowBranching.Merge().
19154 (FlowBranching.UsageVector.MergeChild): New method; merges the
19155 merge result into the current vector.
19156 (FlowBranching.Merge): New abstract method to merge a branching.
19158 2003-08-12 Martin Baulig <martin@ximian.com>
19160 * expression.cs (Indirection.CacheTemporaries): Create the
19161 LocalTemporary with the pointer type, not its element type.
19163 2003-08-10 Miguel de Icaza <miguel@ximian.com>
19165 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
19166 token was a keyword or not.
19168 Add `error' options where an IDENTIFIER was expected; Provide
19169 CheckToken and CheckIdentifierToken convenience error reporting
19172 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
19174 * decl.cs: Rename `NamespaceEntry Namespace' public field into
19175 NameSpaceEntry NameSpaceEntry.
19177 (LookupInterfaceOrClass): Avoid creating a full qualified name
19178 from namespace and name: avoid doing lookups when we know the
19179 namespace is non-existant. Use new Tree.LookupByNamespace which
19180 looks up DeclSpaces based on their namespace, name pair.
19182 * driver.cs: Provide a new `parser verbose' to display the
19183 exception thrown during parsing. This is turned off by default
19184 now, so the output of a failure from mcs is more graceful.
19186 * namespace.cs: Track all the namespaces defined in a hashtable
19189 (IsNamespace): New method
19191 2003-08-09 Miguel de Icaza <miguel@ximian.com>
19193 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
19194 we know that we need to concatenate (full typename can never be
19199 * statement.cs: Use a bitfield; Do not initialize to null things
19200 which are done by the constructor by default.
19202 * cs-parser.jay: bug fix, parameter was 4, not 3.
19204 * expression.cs: Just use the property;
19206 * statement.cs: No need for GetVariableInfo method.
19208 2003-08-08 Martin Baulig <martin@ximian.com>
19210 * flowanalysis.cs (FlowReturns): This is now nested in the
19211 `FlowBranching' class.
19212 (MyBitVector): Moved this here from statement.cs.
19213 (FlowBranching.SiblingType): New enum type.
19214 (FlowBranching.CreateSibling): Added `SiblingType' argument.
19216 2003-08-07 Martin Baulig <martin@ximian.com>
19218 * flowanalysis.cs (FlowBranchingType): This is now nested in the
19219 `FlowBranching' class and called `BranchingType'.
19221 2003-08-07 Martin Baulig <martin@ximian.com>
19223 * flowanalysis.cs: Moved all the control flow analysis code into
19226 2003-08-07 Martin Baulig <martin@ximian.com>
19228 * assign.cs (Assign.DoResolve): `target' must either be an
19229 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
19232 2003-08-07 Miguel de Icaza <miguel@ximian.com>
19234 * expression.cs (BinaryMethod): This kind of expression is created by the
19235 Binary class if it determines that the operator has to be handled
19238 (BinaryDelegate): This kind of expression is created if we are
19239 dealing with a + or - operator on delegates.
19241 (Binary): remove method, argumetns, and DelegateOperator: when
19242 dealing with methods,
19244 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
19246 * statement.cs (Block): use bitfields for the three extra booleans
19247 we had in use. Remove unused topblock parameter.
19249 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
19251 * assign.cs: Drop extra unneeded tests.
19253 2003-08-06 Miguel de Icaza <miguel@ximian.com>
19255 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
19257 * statement.cs (Foreach): Use VariableStorage instead of
19260 * codegen.cs (VariableStorage): New class used by clients that
19261 require a variable stored: locals or fields for variables that
19262 need to live across yield.
19264 Maybe provide a convenience api for EmitThis+EmitLoad?
19266 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
19269 2003-08-05 Miguel de Icaza <miguel@ximian.com>
19271 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
19272 RemapParameterLValue): New methods that are used to turn a
19273 precomputed FieldInfo into an expression like this:
19277 The idea is to use this instead of making LocalVariableReference
19278 have more than one meaning.
19280 * cs-parser.jay: Add error production to BASE.
19282 * ecore.cs: Deal with TypeManager.GetField returning null, which
19283 is now a valid return value.
19285 (FieldExprNoAddress): New expression for Fields whose address can
19288 * expression.cs (LocalVariableReference): During the resolve
19289 phases, create new expressions if we are in a remapping context.
19290 Remove code that dealt with remapping here.
19292 (ParameterReference): same.
19294 (ProxyInstance): New expression, like the `This' expression, but
19295 it is born fully resolved. We know what we are doing, so remove
19296 the errors that are targeted to user-provided uses of `this'.
19298 * statement.cs (Foreach): our variable is now stored as an
19299 Expression; During resolution, follow the protocol, dont just
19300 assume it will return this.
19302 2003-08-06 Martin Baulig <martin@ximian.com>
19304 * support.cs (SeekableStreamReader.cs): New public class.
19306 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
19307 SeekableStreamReader instead of the normal StreamReader.
19309 2003-08-04 Martin Baulig <martin@ximian.com>
19311 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
19312 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
19313 deambiguate casts and delegate invocations.
19314 (parenthesized_expression): Use the new tokens to ensure this is
19315 not a cast of method invocation.
19317 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
19318 when reading a `)' and Deambiguate_CloseParens () was previously
19321 * expression.cs (ParenthesizedExpression): New class. This is
19322 just used for the CS0075 test.
19323 (Binary.DoResolve): Check for CS0075.
19325 2003-07-29 Ravi Pratap <ravi@ximian.com>
19327 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
19328 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
19329 reference comparison.
19331 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
19332 examine the ReturnType for equality - this is necessary in the
19333 cases of implicit and explicit operators whose signature also
19334 includes the return type.
19336 2003-07-26 Miguel de Icaza <miguel@ximian.com>
19338 * namespace.cs: Cache the result of the namespace computation,
19339 instead of computing it every time.
19341 2003-07-24 Miguel de Icaza <miguel@ximian.com>
19343 * decl.cs: Use a global arraylist that we reuse over invocations
19344 to avoid excesive memory consumption. Reduces memory usage on an
19345 mcs compile by one meg (45 average).
19347 * typemanager.cs (LookupTypeReflection): In .NET pointers are
19348 private, work around that.
19350 2003-07-23 Miguel de Icaza <miguel@ximian.com>
19352 * literal.cs (IntLiteral): Define Zero and One static literals.
19354 * cs-parser.jay (integer_literal): use static literals to reduce
19355 memory usage for the most used literals (0, 1 and -1). 211kb
19356 reduced in memory usage.
19358 Replace all calls to `new ArrayList' with `new
19359 ArrayList(4)' which is a good average number for most allocations,
19360 and also requires only 16 bytes of memory for its buffer by
19363 This reduced MCS memory usage in seven megabytes for the RSS after
19366 2003-07-28 Ravi Pratap <ravi@ximian.com>
19368 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
19369 handle params methods the correct way by forming only one
19370 applicable set with params and normal methods in them. Earlier we
19371 were looking at params methods only if we found no normal methods
19372 which was not the correct thing to do.
19374 (Invocation.BetterFunction): Take separate arguments indicating
19375 when candidate and the best method are params methods in their
19378 This fixes bugs #43367 and #46199.
19380 * attribute.cs: Documentation updates.
19382 (CheckAttribute): Rename to CheckAttributeTarget.
19383 (GetValidPlaces): Rename to GetValidTargets.
19385 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
19386 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
19390 2003-07-28 Martin Baulig <martin@ximian.com>
19392 * class.cs (TypeContainer.DefineMembers): Use the base type's full
19393 name when looking up the base class of a nested class. Fixes #46977.
19395 2003-07-26 Martin Baulig <martin@ximian.com>
19397 * expression.cs (Indexers.Indexer): New nested struct; contains
19398 getter, setter and the indexer's type.
19399 (Indexers.Properties): This is now an ArrayList of
19400 Indexers.Indexer's.
19401 (IndexerAccess.DoResolveLValue): Correctly set the type if the
19402 indexer doesn't have any getters.
19404 * assign.cs (Assign.DoResolve): Also do the implicit conversions
19405 for embedded property and indexer assignments.
19407 2003-07-26 Martin Baulig <martin@ximian.com>
19409 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
19410 preprocessor directive is not the first non-whitespace character
19413 2003-07-26 Martin Baulig <martin@ximian.com>
19415 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
19416 namespace parsing, follow the spec more closely.
19418 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
19419 NamespaceEntry.Lookup().
19421 2003-07-25 Martin Baulig <martin@ximian.com>
19423 * MethodCore.cs (OverridesSomething): New public field; it's set
19424 from TypeContainer.DefineMembers if this method overrides
19425 something (which doesn't need to be a method). Fix #39462.
19427 2003-07-25 Ravi Pratap <ravi@ximian.com>
19429 * typemanager.cs (GetMembers): Ensure that the list of members is
19430 reversed. This keeps things in sync.
19432 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
19433 find an AttributeUsage attribute.
19435 * expression.cs (Invocation.OverloadResolve): Perform the check
19436 which disallows Invoke to be directly called on a Delegate.
19438 (Error_InvokeOnDelegate): Report error cs1533.
19440 2003-07-25 Martin Baulig <martin@ximian.com>
19442 * expression.cs (Indexers.GetIndexersForType): Only look in the
19443 interface hierarchy if the requested type is already an
19444 interface. Fixes #46788 while keeping #46502 fixed.
19446 2003-07-25 Martin Baulig <martin@ximian.com>
19448 * class.cs (TypeContainer.DefineMembers): Check whether all
19449 readonly fields have been assigned and report warning CS0649 if
19452 * statement.cs (LocalInfo.IsFixed): Always return true if this is
19455 2003-07-24 Ravi Pratap <ravi@ximian.com>
19457 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
19458 returned from GetMethods to make things consistent with the
19459 assumptions MCS makes about ordering of methods.
19461 This should comprehensively fix bug #45127 and it does :-)
19463 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
19464 ordering is actually reverse.
19466 * Clean up some debug messages I left lying around.
19468 * interface.cs (Populate*): Get rid of code which emits attributes
19469 since the stage in which we emit attributes is the 'Emit' stage,
19470 not the define stage.
19472 (Emit): Move attribute emission for interface members here.
19474 2003-07-22 Ravi Pratap <ravi@ximian.com>
19476 * expression.cs (Invocation.OverloadResolve): Follow the spec more
19477 closely: we eliminate methods in base types when we have an
19478 applicable method in a top-level type.
19480 Please see section 14.5.5.1 for an exact description of what goes
19483 This fixes bug #45127 and a host of other related to corlib compilation.
19485 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
19486 array is the method corresponding to the top-level type (this is
19487 because of the changes made to icall.c) so we change this
19490 (MethodGroupExpr.Name): This too.
19492 * typemanager.cs (GetElementType): New method which does the right
19493 thing when compiling corlib.
19495 * everywhere: Make use of the above in the relevant places.
19497 2003-07-22 Martin Baulig <martin@ximian.com>
19499 * cs-parser.jay (invocation_expression): Moved
19500 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
19501 `cast_expression', but create a InvocationOrCast which later
19502 resolves to either an Invocation or a Cast.
19504 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
19505 method; call this before EmitStatement() to make sure that this
19506 expression can be used as a statement.
19508 * expression.cs (InvocationOrCast): New class; resolves to either
19509 an Invocation or a Cast.
19511 * statement.cs (StatementExpression): Call ResolveStatement() on
19512 the ExpressionStatement before emitting it.
19514 2003-07-21 Martin Baulig <martin@ximian.com>
19516 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
19517 `ref' and `out' attributes match; fixes #46220.
19518 (MemberAccess.ResolveMemberAccess): You can't reference a type
19519 through an expression; fixes #33180.
19520 (Indexers.GetIndexersForType): Don't return the indexers from
19521 interfaces the class implements; fixes #46502.
19523 2003-07-21 Martin Baulig <martin@ximian.com>
19525 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
19526 CS0661 checks; fixes bug #30442.
19528 2003-07-21 Martin Baulig <martin@ximian.com>
19530 * decl.cs (AdditionResult): Added `Error'.
19532 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
19534 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
19535 makes cs0031.cs actually work.
19537 2003-07-20 Martin Baulig <martin@ximian.com>
19539 * namespace.cs: Fixed that bug which caused a crash when compiling
19540 the debugger's GUI.
19542 2003-07-20 Miguel de Icaza <miguel@ximian.com>
19544 * typemanager.cs (LookupTypeReflection): Never expose types which
19545 are NotPublic, NestedPrivate, NestedAssembly, or
19546 NestedFamANDAssem. We used to return these, and later do a check
19547 that would report a meaningful error, but the problem is that we
19548 would not get the real match, if there was a name override.
19550 2003-07-18 Miguel de Icaza <miguel@ximian.com>
19552 * namespace.cs (Namespace, Name): Do not compute the namespace
19553 name dynamically, compute it in the constructor. This reduced
19554 memory usage by 1697 KB.
19556 * driver.cs: Use --pause to pause at the end.
19558 2003-07-17 Peter Williams <peter@newton.cx>
19560 * Makefile: Change the name of the test target so that it doesn't
19561 conflict with the recursive test target.
19563 2003-07-17 Miguel de Icaza <miguel@ximian.com>
19565 * expression.cs (LocalVariableReference.Emit, EmitAssign,
19566 AddressOf): Do not use EmitThis, that was wrong, use the actual
19569 2003-07-15 Miguel de Icaza <miguel@ximian.com>
19571 * class.cs (MethodData.Define): While checking if a method is an
19572 interface implementation, improve the test: If we are not public
19573 (use new test here: use the computed MethodAttributes directly,
19574 instead of the parsed modifier flags) check if the `implementing'
19575 method comes from an interface or not.
19577 * pending.cs (VerifyPendingMethods): Slightly better error
19580 * makefile: add test target that does the mcs bootstrap.
19582 2003-07-16 Ravi Pratap <ravi@ximian.com>
19584 * interface.cs (Define): Do nothing here since there are no
19585 members to populate etc. Move the attribute emission out of here
19586 since this was just totally the wrong place to put it. Attribute
19587 application happens during the 'Emit' phase, not in the 'Define'
19590 (Emit): Add this method and move the attribute emission here
19592 * rootcontext.cs (EmitCode): Call the Emit method on interface
19595 2003-07-14 Ravi Pratap M <ravi@ximian.com>
19597 * expression.cs (OverloadResolve): Report error only if Location
19598 is not 'Null' which means that there was a probe going on.
19600 2003-07-14 Martin Baulig <martin@ximian.com>
19602 * expression.cs (ConditionalLogicalOperator): New public class to
19603 implement user defined conditional logical operators.
19604 This is section 14.11.2 in the spec and bug #40505.
19606 2003-07-14 Martin Baulig <martin@ximian.com>
19608 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
19610 2003-07-14 Martin Baulig <martin@ximian.com>
19612 * codegen.cs (EmitContext.InFixedInitializer): New public field.
19614 * ecore.cs (IVariable.VerifyFixed): New interface method.
19616 * expression.cs (Unary.ResolveOperator): When resolving the `&'
19617 operator, check whether the variable is actually fixed. Fixes bug
19618 #36055. Set a variable definitely assigned when taking its
19619 address as required by the spec.
19621 * statement.cs (LocalInfo.IsFixed): New field.
19622 (LocalInfo.MakePinned): Set `IsFixed' to true.
19624 2003-07-14 Ravi Pratap M <ravi@ximian.com>
19626 * attribute.cs (Attribute.Resolve): While doing a Member lookup
19627 for .ctors, ensure that we only ask for members declared in the
19628 attribute type (BindingFlags.DeclaredOnly).
19632 * expression.cs (Error_WrongNumArguments): Report error 1501
19633 correctly the way CSC does.
19635 2003-07-13 Martin Baulig <martin@ximian.com>
19637 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
19638 lookup on the fully qualified name, to make things like "X.X" work
19639 where "X.X" is a fully qualified type name, but we also have a
19640 namespace "X" in the using list. Fixes #41975.
19642 2003-07-13 Martin Baulig <martin@ximian.com>
19644 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
19645 function. If we're a CompoundAssign, we need to create an embedded
19646 CompoundAssign, not an embedded Assign.
19647 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
19650 2003-07-13 Martin Baulig <martin@ximian.com>
19652 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
19653 work to fix bug #46088.
19655 2003-07-13 Ravi Pratap <ravi@ximian.com>
19657 * class.cs (Operator.Emit): Do not emit attributes here - it is
19658 taken care of by the Method class that we delegate too. This takes
19659 care of bug #45876.
19661 2003-07-10 Martin Baulig <martin@ximian.com>
19663 * expression.cs (TypeOfVoid): New class.
19664 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
19666 2003-07-10 Martin Baulig <martin@ximian.com>
19668 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
19671 2003-07-10 Martin Baulig <martin@ximian.com>
19673 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
19674 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
19676 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
19678 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
19680 2003-07-10 Martin Baulig <martin@ximian.com>
19682 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
19683 of decimal. Fixes #42850.
19685 NOTE: I also fixed the created byte blob, but this doesn't work on
19686 the MS runtime and csc never produces any byte blobs for decimal
19689 2003-07-10 Martin Baulig <martin@ximian.com>
19691 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
19692 structs; fixes #32068.
19693 (Block.AddChildVariableNames): Fixed #44302.
19695 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19697 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
19699 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19701 * attribute.cs: And this test is onger needed.
19703 2003-07-08 Martin Baulig <martin@ximian.com>
19705 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
19706 inaccessible types. Fixes #36313.
19708 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
19710 * namespace.cs (NamespaceEntry): Create implicit entries for all
19711 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
19712 implicit entries for N1.N2 and N1.
19714 2003-07-08 Martin Baulig <martin@ximian.com>
19716 Rewrote the handling of namespaces to fix a lot of the issues
19717 wrt. `using' aliases etc.
19719 * namespace.cs (Namespace): Splitted this class into a
19720 per-assembly `Namespace' and a per-file `NamespaceEntry'.
19722 * typemanager.cs (TypeManager.IsNamespace): Removed.
19723 (TypeManager.ComputeNamespaces): Only compute namespaces from
19724 loaded assemblies here, not the namespaces from the assembly we're
19725 currently compiling.
19727 2003-07-08 Martin Baulig <martin@ximian.com>
19729 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
19731 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19733 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
19736 I thought about the memory savings here, but LookupTypeReflection
19737 is used under already very constrained scenarios. Compiling
19738 corlib or mcs only exposes one hit, so it would not really reduce
19739 any memory consumption.
19741 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19743 * typemanager.cs: fixes bug #45889 by only adding public types from
19744 other assemblies to the list of known types.
19746 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19748 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
19749 on the type we resolved.
19751 2003-07-05 Martin Baulig <martin@ximian.com>
19753 * pending.cs (PendingImplementation.ParentImplements): Don't
19754 create the proxy if the parent is abstract.
19756 * class.cs (TypeContainer.DefineIndexers): Process explicit
19757 interface implementations first. Fixes #37714.
19759 2003-07-04 Miguel de Icaza <miguel@ximian.com>
19761 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
19762 defined recursively; but since we modify the input parameters
19763 (left is set to `this' temporarily), we reset this value if the
19764 left_is_explicit is false, which gives the original semantics to
19767 * literal.cs (NullPointer): new class used to represent a null
19768 literal in a pointer context.
19770 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
19771 type is a pointer, use a NullPointer object instead of a
19772 NullLiteral. Closes 43687
19774 (ExplicitConversion): Convert pointer values using
19775 the conv opcode to the proper type.
19777 * ecore.cs (New): change ValueTypeVariable property into a method,
19778 that returns whether the valuetype is suitable for being used.
19780 * expression.cs (Binary.DoNumericPromotions): Only return if we
19781 the int constant was a valid uint, and we can return both left and
19782 right as uints. If not, we continue processing, to trigger the
19783 type conversion. This fixes 39018.
19785 * statement.cs (Block.EmitMeta): During constant resolution, set
19786 the CurrentBlock property on the emitcontext, so that we resolve
19787 constants propertly.
19789 2003-07-02 Martin Baulig <martin@ximian.com>
19791 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
19792 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
19794 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
19795 than emitting it here.
19797 * statement.cs: Fixed some more flow analysis bugs.
19799 2003-07-02 Martin Baulig <martin@ximian.com>
19801 * class.cs (MethodData.Define): When implementing interface
19802 methods, set Final unless we're Virtual.
19804 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
19805 check work for interface methods.
19807 2003-07-01 Martin Baulig <martin@ximian.com>
19809 * ecore.cs (EmitContext.This): Replaced this property with a
19810 GetThis() method which takes a Location argument. This ensures
19811 that we get the correct error location for a CS0188.
19813 2003-07-01 Miguel de Icaza <miguel@ximian.com>
19815 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
19816 ImplicitStandardConversion.
19818 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
19820 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
19822 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
19825 2003-06-30 Miguel de Icaza <miguel@ximian.com>
19827 * class.cs (Constructor.Define): Turn off initlocals for unsafe
19830 (MethodData.Define): Turn off initlocals for unsafe methods.
19832 2003-06-29 Miguel de Icaza <miguel@ximian.com>
19834 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
19835 complete; Fixes #37521.
19837 * delegate.cs: Use Modifiers.TypeAttr to compute the
19838 TypeAttributes, instead of rolling our own. This makes the flags
19839 correct for the delegates.
19841 2003-06-28 Miguel de Icaza <miguel@ximian.com>
19843 * class.cs (Constructor.Define): Set the private flag for static
19844 constructors as well.
19846 * cs-parser.jay (statement_expression): Set the return value to
19847 null, to avoid a crash when we catch an error.
19849 2003-06-24 Miguel de Icaza <miguel@ximian.com>
19851 * cs-parser.jay: Applied patch from Jackson that adds support for
19852 extern and unsafe modifiers to destructor declarations.
19854 * expression.cs: Report error 21 if the user is trying to index a
19857 * driver.cs: Add an error message, suggested by the bug report.
19859 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
19860 if we do not have a ": this ()" constructor initializer. Fixes 45149
19862 2003-06-14 Miguel de Icaza <miguel@ximian.com>
19864 * namespace.cs: Add some information to reduce FAQs.
19866 2003-06-13 Miguel de Icaza <miguel@ximian.com>
19868 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
19869 underlying enumeration types. Fixes #43915.
19871 * expression.cs: Treat ushort/short as legal values to be used in
19872 bitwise operations.
19874 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
19876 * delegate.cs: transfer custom attributes for paramenters from
19877 the delegate declaration to Invoke and BeginInvoke.
19879 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
19881 * attribute.cs: handle custom marshalers and emit marshal info
19884 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
19886 * makefile.gnu: Added anonymous.cs to the compiler sources.
19888 2003-05-28 Miguel de Icaza <miguel@ximian.com>
19890 * iterators.cs: Change the name of the proxy class to include two
19893 * cs-parser.jay: Update grammar to include anonymous methods.
19895 * anonymous.cs: new file.
19897 2003-05-27 Miguel de Icaza <miguel@ximian.com>
19899 * class.cs (Field.Define): Add missing test for pointers and
19902 2003-05-27 Ravi Pratap <ravi@ximian.com>
19904 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
19905 we use the stobj opcode.
19907 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
19908 since it wasn't the correct fix.
19910 It still is puzzling that we are required to use stobj for IntPtr
19911 which seems to be a ValueType.
19913 2003-05-26 Miguel de Icaza <miguel@ximian.com>
19915 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
19916 during regular simple name resolution. Now, the trick is that
19917 instead of returning for processing the simplename, we do a
19918 TypeManager.LookupType (ie, a rooted lookup as opposed to a
19919 contextual lookup type). If a match is found, return that, if
19920 not, return for further composition.
19922 This fixes long-standing 30485.
19924 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19925 using the address to initialize an object, do an Stobj instead of
19926 using the regular Stelem.
19928 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
19929 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
19930 Because if we are a BaseIndexerAccess that value will be true.
19933 * statement.cs (GotoCase.Resolve): Return after reporting an
19934 error, do not attempt to continue.
19936 * expression.cs (PointerArithmetic.Emit): If our operand is a
19937 long, convert our constants to match the operand before
19938 multiplying. Convert to I type before adding. Fixes 43670.
19940 2003-05-14 Ravi Pratap <ravi@ximian.com>
19942 * enum.cs (ImplicitConversionExists) : Rename to
19943 ImplicitEnumConversionExists to remove ambiguity.
19945 * ecore.cs (NullCast): New type of cast expression class which
19946 basically is very similar to EmptyCast with the difference being
19947 it still is a constant since it is used only to cast a null to
19949 (eg. (string) null)
19951 * convert.cs (ImplicitReferenceConversion): When casting a null
19952 literal, we return a NullCast.
19954 * literal.cs (NullLiteralTyped): Remove - I don't see why this
19955 should be around anymore.
19957 The renaming (reported was slightly wrong). Corrections:
19959 ConvertImplicitStandard -> ImplicitConversionStandard
19960 ConvertExplicitStandard -> ExplicitConversionStandard
19962 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
19963 before passing them in !
19965 * convert.cs (ImplicitConversionStandard): When comparing for
19966 equal expr and target types, ensure that expr is not a
19969 In general, we must not be checking (expr_type ==
19970 target_type) in the top level conversion methods
19971 (ImplicitConversion, ExplicitConversion etc). This checking is
19972 done in the methods that they delegate to.
19974 2003-05-20 Miguel de Icaza <miguel@ximian.com>
19976 * convert.cs: Move Error_CannotConvertType,
19977 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
19978 ImplicitNumericConversion, ImplicitConversionExists,
19979 ImplicitUserConversionExists, StandardConversionExists,
19980 FindMostEncompassedType, FindMostSpecificSource,
19981 FindMostSpecificTarget, ImplicitUserConversion,
19982 ExplicitUserConversion, GetConversionOperators,
19983 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
19984 TryImplicitIntConversion, Error_CannotConvertImplicit,
19985 ConvertImplicitRequired, ConvertNumericExplicit,
19986 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
19987 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
19990 Perform the following renames:
19992 StandardConversionExists -> ImplicitStandardConversionExists
19993 ConvertImplicit -> ImplicitConversion
19994 ConvertImplicitStandard -> ImplicitStandardConversion
19995 TryImplicitIntConversion -> ImplicitIntConversion
19996 ConvertImplicitRequired -> ImplicitConversionRequired
19997 ConvertNumericExplicit -> ExplicitNumericConversion
19998 ConvertReferenceExplicit -> ExplicitReferenceConversion
19999 ConvertExplicit -> ExplicitConversion
20000 ConvertExplicitStandard -> ExplicitStandardConversion
20002 2003-05-19 Martin Baulig <martin@ximian.com>
20004 * statement.cs (TypeInfo.StructInfo): Made this type protected.
20005 (TypeInfo): Added support for structs having structs as fields.
20007 * ecore.cs (FieldExpr): Implement IVariable.
20008 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
20009 VariableInfo for the field.
20011 2003-05-18 Martin Baulig <martin@ximian.com>
20013 * expression.cs (This.DoResolve): Report a CS0027 if we're
20014 emitting a field initializer.
20016 2003-05-18 Martin Baulig <martin@ximian.com>
20018 * expression.cs (This.ResolveBase): New public function.
20019 (This.DoResolve): Check for CS0188.
20021 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
20024 * ecore.cs (MethodGroupExpr.DoResolve): Set the
20025 `instance_expression' to null if we don't have any non-static
20028 2003-05-18 Martin Baulig <martin@ximian.com>
20030 Reworked the way how local variables and parameters are handled by
20031 the flow analysis code.
20033 * statement.cs (TypeInfo, VariableMap): New public classes.
20034 (VariableInfo): New public class. This is now responsible for
20035 checking whether a variable has been assigned. It is used for
20036 parameters and local variables.
20037 (Block.EmitMeta): Take the InternalParameters as argument; compute
20038 the layout of the flow vectors here.
20039 (Block.LocalMap, Block.ParameterMap): New public properties.
20040 (FlowBranching): The .ctor doesn't get the InternalParameters
20041 anymore since Block.EmitMeta() now computes the layout of the flow
20043 (MyStructInfo): This class is now known as `StructInfo' and nested
20044 in `TypeInfo'; we don't access this directly anymore.
20046 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
20047 property and removed IsAssigned(), IsFieldAssigned(),
20048 SetAssigned() and SetFieldAssigned(); we now call them on the
20049 VariableInfo so we don't need to duplicate this code everywhere.
20051 * expression.cs (ParameterReference): Added `Block block' argument
20053 (LocalVariableReference, ParameterReference, This): The new
20054 VariableInfo class is now responsible for all the definite
20057 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
20058 IsParameterAssigned, SetParameterAssigned): Removed.
20060 2003-05-18 Martin Baulig <martin@ximian.com>
20062 * typemanager.cs (InitCoreTypes): Try calling
20063 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
20064 the 3-args-version. Corlib now also needs our `void_type'.
20065 (GetMethod): Added overloaded version which takes an optional
20066 `bool report_errors' to allow lookups of optional methods.
20068 2003-05-12 Martin Baulig <martin@ximian.com>
20070 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
20071 only used for locals and not for parameters.
20073 2003-05-12 Miguel de Icaza <miguel@ximian.com>
20075 * support.cs (InternalParameters.ParameterType): Return the
20076 ExternalType of the parameter.
20078 * parameter.cs (Parameter.ExternalType): drop the two arguments,
20081 2003-05-11 Miguel de Icaza <miguel@ximian.com>
20083 * class.cs (MethodData.Define): Do not set the `newslot' on
20084 interface members, if they are also flagged as "override".
20086 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
20087 better code for ++i and i++. This only works for static fields
20088 and local variables.
20090 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
20091 want to pull the DeclSpace out of the builder_to_declspace instead
20092 of the TypeBuilder (like in TypeContainer.FindMembers).
20094 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
20095 instead of LookupTypeContainer. Fixes the crash on .NET for
20096 looking up interface members.
20098 * const.cs: Create our own emit context during the Definition
20099 stage, so that constants are evaluated in the proper context, when
20100 a recursive definition happens.
20102 2003-05-11 Martin Baulig <martin@ximian.com>
20104 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
20105 new block for a switch section.
20106 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
20107 the adding/lookup in the switch block. Fixes #39828.
20109 2003-05-09 Miguel de Icaza <miguel@ximian.com>
20111 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
20112 functionality: I needed to convert the data after I had performed
20113 the add/sub operation into the operands type size.
20115 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
20116 pass the type for the box operation, otherwise the resulting
20117 object would have been of type object.
20119 (BoxedCast): Add constructor to specify the type to box as.
20121 2003-05-07 Miguel de Icaza <miguel@ximian.com>
20123 * iterators.cs: I was reusing the `count' variable inadvertently,
20124 take steps to not allow this to happen.
20126 2003-05-06 Miguel de Icaza <miguel@ximian.com>
20128 * attribute.cs (Attribute.Resolve): Params attributes are encoded
20129 by creating an array at the point where the params starts and
20130 putting all those arguments there, then adjusting the size of the
20133 2003-05-05 Miguel de Icaza <miguel@ximian.com>
20135 * expression.cs (New.AddressOf): Implement interface
20136 IMemoryLocation. This is used when the `new' operator is used in
20137 the context of an invocation to a method on a value type.
20139 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
20142 * namespace.cs: Also check the using aliases here.
20144 * driver.cs: Move the test for using validity after the types have
20145 been entered, so we do a single pass that also includes the using
20148 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
20149 in the regular case. CreateSiblingForFinally is doing extra
20152 * attribute.cs (GetAttributeArgumentExpression): Store the result
20153 on an out value, and use the return value to indicate failure
20154 instead of using null (which is a valid return for Constant.GetValue).
20156 * statement.cs: Perform the analysis flow for the increment
20157 portion after the statement, because this will be the real flow of
20158 execution. Fixes #42385
20160 * codegen.cs (EmitContext.EmitArgument,
20161 EmitContext.EmitStoreArgument): New helper functions when the
20162 RemapToProxy flag is set.
20164 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
20167 Add support for remapping parameters.
20169 * iterators.cs: Propagate parameter values; Store parameter
20170 values in the proxy classes.
20172 2003-05-04 Miguel de Icaza <miguel@ximian.com>
20174 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
20175 need a proxy reference; I do not know what I was thinking
20177 * cs-parser.jay (constructor_initializer): catch another error,
20178 and display nice message.
20180 (field_declaration): catch void field declaration
20181 to flag a better error.
20183 * class.cs (MemberBase.CheckBase): Report an error instead of a
20184 warning if a new protected member is declared in a struct.
20185 (Field.Define): catch the error of readonly/volatile.
20187 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
20189 (FieldExpr.AddressOf): ditto. Catch error where the address of a
20190 volatile variable is taken
20192 2003-05-02 Miguel de Icaza <miguel@ximian.com>
20194 * statement.cs (Fixed.Resolve): Report an error if we are not in
20197 2003-05-01 Miguel de Icaza <miguel@ximian.com>
20199 * typemanager.cs: reuse the code that handles type clashes for
20200 delegates and enumerations.
20202 * class.cs (Report28): Always report.
20204 * expression.cs (EncodeAsAttribute): Allow nulls here.
20206 2003-04-28 Miguel de Icaza <miguel@ximian.com>
20208 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
20209 the functionality for testing whether an expression is valid for
20210 an attribute here. Also handle the case of arrays of elements
20213 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
20214 encoding a linear array into an array of objects that are suitable
20215 to be passed to an CustomAttributeBuilder.
20217 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
20219 * ecore.cs: (FieldExpr): Handle field remapping here.
20221 * iteratators.cs: Pass the instance variable (if the method is an
20222 instance method) to the constructors, so we can access the field
20223 variables on the class.
20225 TODO: Test this with structs. I think the THIS variable on
20226 structs might have to be a pointer, and not a refenrece
20228 2003-04-27 Miguel de Icaza <miguel@ximian.com>
20230 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
20231 local variables to fields in a proxy class.
20233 * iterators.cs (PopulateProxy): Rename our internal fields to
20235 Create a <THIS> field if we are an instance method, so we can
20236 reference our parent container variables.
20237 (MapVariable): Called back from the EmitContext code to enter a
20238 new variable to field mapping into the proxy class (we just create
20242 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
20243 for using the remapped locals to fields.
20245 I placed the code here, because that gives the same semantics to
20246 local variables, and only changes the Emit code.
20248 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
20249 statements inside iterators.
20250 (VariableInfo): Add a FieldBuilder for the cases when we are
20251 remapping local variables to fields in a proxy class
20253 * ecore.cs (SimpleNameResolve): Avoid testing two times for
20254 current_block != null.
20256 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
20257 not cope with strings, as it has been moved to the
20258 TableSwitchEmit. Fixed bug in switch generation.
20260 * expression.cs (New.DoResolve): Provide more context for the user
20261 when reporting an error.
20263 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
20266 * expression.cs (MemberAccess.DoResolve): When we get a type back,
20267 check the permissions for it. Note than in a type-resolution
20268 context the check was already present in DeclSpace.ResolveType,
20269 but was missing from the MemberAccess.
20271 (ArrayCreation.CheckIndices): warn if the user has
20272 more nested levels of expressions, but there are no more
20273 dimensions specified. Avoids crash on bug 41906.
20275 2003-04-26 Miguel de Icaza <miguel@ximian.com>
20277 * statement.cs (Block): replace Implicit bool, for a generic
20279 New flag: `Unchecked'. This is used during the EmitMeta phase
20280 (which is out-of-line with the regular Resolve/Emit process for a
20281 statement, as this is done ahead of time, but still gets a chance
20282 to call constant resolve).
20284 (Block.Flags): new enum for adding a new flag.
20286 (Block.EmitMeta): track the state of unchecked.
20288 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
20289 to enable constant resolution to work there as well.
20291 2003-04-22 Miguel de Icaza <miguel@ximian.com>
20293 * typemanager.cs (ienumerable_type): Also look up
20294 System.Collections.IEnumerable.
20296 2003-04-21 Miguel de Icaza <miguel@ximian.com>
20298 TODO: Test more than one conditional per method.
20300 * class.cs (Indexer.Define): Report the location where the user is
20301 referencing the unsupported feature.
20303 (MethodData): Overload the use of `conditionals' to
20304 minimize the creation of needless ArrayLists. This saves roughly
20305 212kb on my machine.
20307 (Method): Implement the new IIteratorContainer interface.
20308 (Method.SetYields): Implement the method by setting the ModFlags
20309 to contain METHOD_YIELDS.
20311 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
20312 which just got set to null.
20314 * iterators.cs: New file.
20316 (Yield, YieldBreak): New statements.
20318 * statement.cs (Return.Resolve): Flag an error if we are used in
20319 an iterator method.
20321 * codegen.cs (InIterator): New flag set if the code is being
20322 compiled in an iterator method.
20324 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
20325 internal modifier, and we just use it to avoid adding extra
20326 fields, as this is seldom used.
20328 * cs-parser.jay: Add yield_statement (yield and yield break).
20330 * driver.cs: New flag -v2 to turn on version 2 features.
20332 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
20333 hashtable when v2 is enabled.
20335 2003-04-20 Miguel de Icaza <miguel@ximian.com>
20337 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
20338 there is already a namespace defined with this name.
20340 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
20341 people upgraded their corlibs.
20343 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
20344 always use fully qualified types, no need to use the compiler
20347 (TypeManager.IsNamespace): Use binarysearch.
20349 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
20350 AddDelegate): I did not quite use the new IsValid API properly: I
20351 have to pass the short-name and the fullname. I was passing only
20352 the basename instead of the fullname sometimes.
20354 (TypeContainer.DefineType): call NamespaceClash.
20356 * interface.cs (Interface.DefineType): use NamespaceClash before
20359 * delegate.cs (Delegate.DefineType): use NamespaceClash before
20362 * enum.cs: (Enum.DefineType): use NamespaceClash before
20365 * typemanager.cs (: 3-line patch that gives us some tasty 11%
20366 speed increase. First, use the negative_hits cache when we get a
20367 negative. Second, add the type with its full original name
20368 instead of the new . and + encoded name (reflection uses + to
20369 separate type from a nested type). Use LookupTypeReflection
20370 directly which bypasses the type->name hashtable (that we already
20371 know does not contain the type.
20373 * decl.cs (DeclSpace.ResolveTypeExpr): track the
20374 location/container type.
20376 * driver.cs: When passing utf8, use directly the UTF8Encoding.
20378 2003-04-19 Miguel de Icaza <miguel@ximian.com>
20380 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
20382 * delegate.cs (NewDelegate.Resolve): Test whether an instance
20383 method is being referenced in the method group from a static
20384 context, and report error 120 if so.
20386 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
20389 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
20390 is created, we create the A namespace).
20392 * cs-parser.jay: A namespace also introduces a DeclarationFound.
20395 2003-04-18 Miguel de Icaza <miguel@ximian.com>
20397 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
20398 invocation to ModuleBuilder.GetType with the same values will
20399 return a new type instance, so we need to cache its return
20402 * expression.cs (Binary.ResolveOperator): Only allow the compare
20403 operators on enums if they are of the same type.
20405 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
20406 types of ValueType on their own case. Before we were giving them
20407 the same treatment as objects.
20409 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
20410 fullname. Short name is used to compare against container name.
20411 Fullname is used to check against defined namespace names.
20413 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
20414 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
20416 (Method.CheckBase): Call parent.
20417 (MemberBase.CheckBase): Check for protected members on sealed
20419 (PropertyBase.CheckBase): Call parent.
20420 (Field.Define): Call parent.
20422 * report.cs: Negative error codes are now mapped to 8000 - code,
20423 so that the display is render more nicely.
20425 * typemanager.cs: Do not use try/catch, instead report a regular
20428 (GetPointerType, GetReferenceType): These methods provide
20429 mechanisms to obtain the T* and T& from a T. We had the code
20430 previously scattered around the code base, and it also used
20431 TypeManager.LookupType that would go through plenty of caches.
20432 This one goes directly to the type source.
20434 In some places we did the Type.GetType followed by
20435 ModuleBuilder.GetType, but not in others, so this unifies the
20436 processing as well.
20438 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
20439 statements now that we have namespace information.
20441 * typemanager.cs (IsNamespace): New method, returns whether the
20442 string presented is a namespace or not.
20444 (ComputeNamespaces): New public entry point, computes the list of
20445 available namespaces, using the GetNamespaces API call in Mono, or
20446 the slower version in MS.NET.
20448 Now before we start the semantic analysis phase, we have a
20449 complete list of namespaces including everything that the user has
20452 Deleted old code to cache namespaces in .nsc files.
20454 2003-04-17 Miguel de Icaza <miguel@ximian.com>
20456 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
20457 class/struct location definition Location for the implicit
20458 constructor location.
20460 (Operator.Define): Use the location of the operator for the
20461 implicit Method definition.
20463 (Constructor.Emit): use the constructor location for the implicit
20464 base initializer constructor.
20466 * ecore.cs: Remove ITypeExpression. This interface is now gone,
20467 and the Expression class now contains two new methods:
20469 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
20470 isolate type lookup from the rest of the resolution process.
20472 Since we use Expressions to hold type definitions due to the way
20473 we parse the input we have historically overloaded Resolve to
20474 perform the Type lookups if a special flag is passed. Now this is
20475 eliminated and two methods take their place.
20477 The differences in the two methods between xStep and xTerminal is
20478 that xStep is involved in our current lookup system that uses
20479 SimpleNames to compose a name, while xTerminal is used just to
20480 catch the case where the simplename lookup failed.
20482 2003-04-16 Miguel de Icaza <miguel@ximian.com>
20484 * expression.cs (ResolveMemberAccess): Remove redundant code.
20485 TypeExpr expressions are always born fully resolved.
20487 * interface.cs (PopulateMethod): Do not lookup the types twice.
20488 We were doing it once during SemanticAnalysis and once during
20491 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
20492 in local variable type definitions, were being returned as a
20493 SimpleName (we decomposed everything into a string), that is
20494 because primary_expression was being used instead of a type in the
20495 grammar (reduce/reduce conflicts).
20497 The part that was wrong is that we converted the expression into a
20498 string (an oversimplification in one hand, compounded with primary
20499 expressions doing string concatenation).
20505 Would return "A.B.C[]" as a SimpleName. This stopped things like
20506 using clauses from working on this particular context. And a type
20507 was being matched directly against "A.B.C[]".
20509 We now use the correct approach, and allow for ComposedCast to be
20510 part of the unary expression. So the "A.B.C []" become a composed
20511 cast of "A.B.C" (as a nested group of MemberAccess with a
20512 SimpleName at the end) plus the rank composition "[]".
20516 2003-04-10 Miguel de Icaza <miguel@ximian.com>
20518 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
20519 for the access level checking.
20521 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
20522 `TypeContainer container', because I kept getting confused when I
20523 was debugging this code.
20525 * expression.cs (Indexers): Instead of tracking getters/setters,
20526 we now track them in parallel. We create one arraylist less, but
20527 most importantly it is possible now for the LValue code to find a
20528 matching get for a set.
20530 (IndexerAccess.DoResolveLValue): Update the code.
20531 GetIndexersForType has been modified already to extract all the
20532 indexers from a type. The code assumed it did not.
20534 Also make the code set the correct return type for the indexer.
20535 This was fixed a long time ago for properties, but was missing for
20536 indexers. It used to be void_type.
20538 (Binary.Emit): Test first for doubles instead of
20539 floats, as they are more common.
20541 (Binary.EmitBranchable): Use the .un version of the branch opcodes
20542 when dealing with floats and the <=, >= operators. This fixes bug
20545 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
20546 to load the array value by emitting a load on the foreach variable
20547 type. This was incorrect.
20549 We now emit the code to load an element using the the array
20550 variable type, and then we emit the conversion operator.
20554 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
20556 * attribute.cs: Avoid allocation of ArrayLists in the common case.
20558 2003-04-09 Miguel de Icaza <miguel@ximian.com>
20560 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
20561 test for protection before we test for signatures.
20563 (MethodSignature.ToString): implement.
20565 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
20566 to the case where we reduced into a LongConstant.
20568 * decl.cs (CheckAccessLevel): If the type is an array, we can not
20569 depend on whether the information is acurrate, because the
20570 Microsoft runtime will always claim that the array type is public,
20571 regardless of the real state.
20573 If the type is a pointer, another problem happens: the type is
20574 reported as non-public in Microsoft.
20576 In both cases we have to call CheckAccessLevel recursively with
20577 the underlying type as the argument to be tested.
20579 2003-04-08 Miguel de Icaza <miguel@ximian.com>
20581 * assign.cs (Assign.Emit): If we are dealing with a compound
20582 assignment expression, we should use the code path that stores the
20583 intermediate result in a temporary value. This fixes #40903.
20585 *expression.cs (Indirection.ToString): Provide ToString method for
20588 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
20590 * class.cs: Null out fields holding references to Block objects so
20591 they can be garbage collected.
20593 * expression.cs (OverloadResolve): Remove unused local.
20595 2003-04-07 Martin Baulig <martin@ximian.com>
20597 * codegen.cs (EmitContext.CurrentFile): New public field.
20598 (EmitContext.Mark): Use the CurrentFile to check whether the
20599 location is in the correct file.
20600 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
20602 2003-04-07 Martin Baulig <martin@ximian.com>
20604 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
20606 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
20607 location. [FIXME: The location argument which gets passed to this
20608 method is sometimes wrong!]
20610 2003-04-07 Nick Drochak <ndrochak@gol.com>
20612 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
20614 2003-04-07 Miguel de Icaza <miguel@ximian.com>
20616 * expression.cs (Indirection.EmitAssign): We were using the
20617 temporary, but returning immediately instead of continuing the
20620 2003-04-06 Martin Baulig <martin@ximian.com>
20622 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
20623 if it's a nested child, but also deriving from the outer class.
20626 * typemanager.cs (IsNestedChildOf): Make this work if it's a
20627 nested child, but also deriving from the outer class. See
20629 (FilterWithClosure): We may access private members of the outer
20630 class if we're a nested child and deriving from the outer class.
20631 (RealMemberLookup): Only set `closure_private_ok' if the
20632 `original_bf' contained BindingFlags.NonPublic.
20634 2003-04-05 Martin Baulig <martin@ximian.com>
20636 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
20638 2003-04-02 Miguel de Icaza <miguel@ximian.com>
20640 * class.cs (Event.Define): Do not allow abstract events to have
20643 2003-04-01 Miguel de Icaza <miguel@ximian.com>
20645 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
20646 block in event declarations.
20648 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
20649 value type, get its address.
20651 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
20652 leaving a class on the stack instead of a boolean value (int
20653 0/1). Change the code so we compare against null, and then the
20654 result against zero.
20656 * class.cs (TypeContainer.GetClassBases): We were checking for the
20657 parent class being sealed too late.
20659 * expression.cs (Binary.Emit): For <= and >= when dealing with
20660 floating point values, use cgt.un and clt.un instead of cgt and
20663 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
20665 * statement.cs: Apply the same optimization as MS: skip the
20666 GetEnumerator returning an IEnumerator, and use the one returning a
20667 CharEnumerator instead. This allows us to avoid the try-finally block
20670 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
20672 * cs-parser.jay: Attributes cannot be applied to
20673 namespaces. Fixes #40473
20675 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20678 (Add*): check if the name is valid using the full name for constants,
20679 fields, properties and events.
20681 2003-03-28 Miguel de Icaza <miguel@ximian.com>
20683 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
20684 char constants to be part of the enumeration.
20686 * expression.cs (Conditional.DoResolve): Add support for operator
20687 true. Implements the missing functionality from 14.12
20689 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
20690 operator true/false as required by the spec.
20692 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
20693 implicit conversion to boolean.
20695 * statement.cs (Statement.ResolveBoolean): A boolean expression is
20696 also one where the type implements `operator true'.
20698 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
20699 get an expression that will invoke operator true based on an
20702 (GetConversionOperators): Removed the hack that called op_True
20705 (Expression.ResolveBoolean): Move this from Statement.
20707 2003-03-17 Miguel de Icaza <miguel@ximian.com>
20709 * ecore.cs (FieldExpr): do not allow initialization of initonly
20710 fields on derived classes
20712 2003-03-13 Martin Baulig <martin@ximian.com>
20714 * statement.cs (Block.Emit): Call ig.BeginScope() and
20715 ig.EndScope() when compiling with debugging info; call
20716 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
20718 2003-03-08 Miguel de Icaza <miguel@ximian.com>
20720 * expression.cs (Indexers): Do not construct immediately, allow
20721 for new members to be appended as we go. Fixes 38143
20723 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20725 * expression.cs: save/restore context when resolving an unchecked
20728 2003-03-05 Miguel de Icaza <miguel@ximian.com>
20730 * cfold.cs: Catch division by zero in modulus operator during
20733 2003-03-03 Miguel de Icaza <miguel@ximian.com>
20735 * interface.cs (Interface.DefineMembers): Avoid defining members
20738 2003-02-27 Miguel de Icaza <miguel@ximian.com>
20740 * driver.cs: handle the +/- options for -noconfig
20742 * statement.cs (Unckeched.Resolve): Also track the state of
20743 unchecked in the Resolve phase.
20745 2003-02-27 Martin Baulig <martin@ximian.com>
20747 * ecore.cs (Expression.MemberLookup): Don't create a
20748 MethodGroupExpr for something which is not a method. Fixes #38291.
20750 2003-02-25 Miguel de Icaza <miguel@ximian.com>
20752 * class.cs (MemberBase.CheckParameters): Also check that the type
20753 is unmanaged if it is a pointer.
20755 * expression.cs (SizeOf.Resolve): Add location information.
20757 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
20758 a managed type is declared.
20760 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
20761 parameter modifiers as well. Fixes bug 38606
20763 * class.cs: Very sad. Am backing out the speed up changes
20764 introduced by the ArrayList -> Array in the TypeContainer, as they
20765 were not actually that much faster, and introduced a bug (no error
20766 reports on duplicated methods).
20768 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
20769 source first, this will guarantee that we have a valid expression
20770 before calling in lower levels functions that will require a
20771 resolved object. Then use this original_source in the
20772 target.ResolveLValue instead of the original source that was
20775 Another change. Use target.Resolve instead of LValueResolve.
20776 Although we are resolving for LValues, we will let the Assign code
20777 take care of that (it will be called again from Resolve). This
20778 basically allows code like this:
20780 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
20781 class Y { void A (X x) { x [0] += o; }
20783 The problem was that the indexer was trying to resolve for
20784 set_Item (idx, object o) and never finding one. The real set_Item
20785 was set_Item (idx, X). By delaying the process we get the right
20790 2003-02-23 Martin Baulig <martin@ximian.com>
20792 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
20793 while calling DoEmit ().
20795 * codegen.cs (EmitContext.Mark): Don't mark locations in other
20796 source files; if you use the #line directive inside a method, the
20797 compiler stops emitting line numbers for the debugger until it
20798 reaches the end of the method or another #line directive which
20799 restores the original file.
20801 2003-02-23 Martin Baulig <martin@ximian.com>
20803 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
20805 2003-02-23 Martin Baulig <martin@ximian.com>
20807 * statement.cs (Block.AddChildVariableNames): We need to call this
20808 recursively, not just for our immediate children.
20810 2003-02-23 Martin Baulig <martin@ximian.com>
20812 * class.cs (Event.Define): Always make the field private, like csc does.
20814 * typemanager.cs (TypeManager.RealMemberLookup): Make events
20815 actually work, fixes bug #37521.
20817 2003-02-23 Miguel de Icaza <miguel@ximian.com>
20819 * delegate.cs: When creating the various temporary "Parameters"
20820 classes, make sure that we call the ComputeAndDefineParameterTypes
20821 on those new parameters (just like we do with the formal ones), to
20822 allow them to be resolved in the context of the DeclSpace.
20824 This fixes the bug that Dick observed in Bugzilla #38530.
20826 2003-02-22 Miguel de Icaza <miguel@ximian.com>
20828 * expression.cs (ResolveMemberAccess): When resolving a constant,
20829 do not attempt to pull a constant if the value was not able to
20830 generate a valid constant.
20832 * const.cs (LookupConstantValue): Do not report more errors than required.
20834 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20836 * expression.cs: fixes bug #38328.
20838 2003-02-18 Miguel de Icaza <miguel@ximian.com>
20840 * class.cs: Changed all the various members that can be part of a
20841 class from being an ArrayList to be an Array of the right type.
20842 During the DefineType type_list, interface_list, delegate_list and
20843 enum_list are turned into types, interfaces, delegates and enums
20846 And during the member population, indexer_list, event_list,
20847 constant_list, field_list, instance_constructor_list, method_list,
20848 operator_list and property_list are turned into their real arrays.
20850 Although we could probably perform this operation earlier, for
20851 good error reporting we need to keep the lists and remove the
20852 lists for longer than required.
20854 This optimization was triggered by Paolo profiling the compiler
20855 speed on the output of `gen-sample-program.pl' perl script.
20857 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
20858 not crash in methods like MemberLookupFailed that use this field.
20860 This problem arises when the compiler fails to resolve a type
20861 during interface type definition for example.
20863 2003-02-18 Miguel de Icaza <miguel@ximian.com>
20865 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
20866 inherit from System.Object, so we have to stop at null, not only
20867 when reaching System.Object.
20869 2003-02-17 Miguel de Icaza <miguel@ximian.com>
20871 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
20872 DeclaredOnly because the parent indexer might have had a different
20873 name, but did not loop until the top of the hierarchy was reached.
20875 The problem this one fixes is 35492: when a class implemented an
20876 indexer from an interface, we were getting the interface method
20877 (which was abstract) and we were flagging an error (can not invoke
20880 This also keeps bug 33089 functioning, and test-148 functioning.
20882 * typemanager.cs (IsSpecialMethod): The correct way of figuring
20883 out if a method is special is to see if it is declared in a
20884 property or event, or whether it is one of the predefined operator
20885 names. This should fix correctly #36804.
20887 2003-02-15 Miguel de Icaza <miguel@ximian.com>
20889 The goal here is to remove the dependency on EmptyCast.Peel ().
20890 Killing it completely.
20892 The problem is that currently in a number of places where
20893 constants are expected, we have to "probe" for an EmptyCast, and
20894 Peel, which is not the correct thing to do, as this will be
20895 repetitive and will likely lead to errors.
20897 The idea is to remove any EmptyCasts that are used in casts that
20898 can be reduced to constants, so we only have to cope with
20901 This bug hunt was triggered by Bug 37363 and the desire to remove
20902 the duplicate pattern where we were "peeling" emptycasts to check
20903 whether they were constants. Now constants will always be
20906 * ecore.cs: Use an enumconstant here instead of wrapping with
20909 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
20910 throwing me off. By handling this we can get rid of a few hacks.
20912 * statement.cs (Switch): Removed Peel() code.
20914 2003-02-14 Miguel de Icaza <miguel@ximian.com>
20916 * class.cs: Location information for error 508
20918 * expression.cs (New.DoResolve): Add a guard against double
20919 resolution of an expression.
20921 The New DoResolve might be called twice when initializing field
20922 expressions (see EmitFieldInitializers, the call to
20923 GetInitializerExpression will perform a resolve on the expression,
20924 and later the assign will trigger another resolution
20926 This leads to bugs (#37014)
20928 * delegate.cs: The signature for EndInvoke should contain any ref
20929 or out parameters as well. We were not doing this in the past.
20931 * class.cs (Field.Define): Do not overwrite the type definition
20932 inside the `volatile' group. Turns out that volatile enumerations
20933 were changing the type here to perform a validity test, which
20936 2003-02-12 Miguel de Icaza <miguel@ximian.com>
20938 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
20939 and structs, we do not want to load the instance variable
20941 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
20942 enum_type has to be handled like an object reference (implicit
20943 conversions exists from this to object), but the regular IsClass
20944 and IsValueType tests will never return true for this one.
20946 Also we use TypeManager.IsValueType instead of type.IsValueType,
20947 just for consistency with the rest of the code (this is only
20948 needed if we ever use the construct exposed by test-180.cs inside
20949 corlib, which we dont today).
20951 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
20953 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
20956 2003-02-09 Martin Baulig <martin@ximian.com>
20958 * namespace.cs (Namespace..ctor): Added SourceFile argument.
20959 (Namespace.DefineNamespaces): New static public method; this is
20960 called when we're compiling with debugging to add all namespaces
20961 to the symbol file.
20963 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
20964 pass it to the Namespace's .ctor.
20966 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
20967 and MethodBase arguments; pass the namespace ID to the symwriter;
20968 pass the MethodBase instead of the token to the symwriter.
20969 (SymbolWriter.DefineNamespace): New method to add a namespace to
20972 2003-02-09 Martin Baulig <martin@ximian.com>
20974 * symbolwriter.cs: New file. This is a wrapper around
20975 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
20976 methods here in near future.
20978 2003-02-09 Martin Baulig <martin@ximian.com>
20980 * codegen.cs (EmitContext.Mark): Just pass the arguments to
20981 ILGenerator.MarkSequencePoint() which are actually used by the
20984 2003-02-09 Martin Baulig <martin@ximian.com>
20986 * location.cs (SourceFile): New public sealed class. This
20987 contains the name and an index which is used in the location's token.
20988 (Location): Reserve an appropriate number of bits in the token for
20989 the source file instead of walking over that list, this gives us a
20990 really huge performance improvement when compiling with debugging.
20992 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
20993 `SourceFile' argument instead of a string.
20994 (Driver.ProcessFile): Add all the files via Location.AddFile(),
20995 but don't parse/tokenize here, we need to generate the list of all
20996 source files before we do that.
20997 (Driver.ProcessFiles): New static function. Parses/tokenizes all
21000 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
21001 instead of a string.
21003 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
21006 2003-02-09 Martin Baulig <martin@ximian.com>
21008 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
21009 filename on `#line default'.
21011 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
21013 * statement.cs: don't clear the pinned var when the fixed statement
21014 returns from the method (fixes bug#37752).
21016 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
21018 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
21021 2003-02-07 Martin Baulig <martin@ximian.com>
21023 * driver.cs: Removed the `--debug-args' command line argument.
21025 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
21026 automatically by the AsssemblyBuilder.
21027 (CodeGen.InitializeSymbolWriter): We don't need to call any
21028 initialization function on the symbol writer anymore. This method
21029 doesn't take any arguments.
21031 2003-02-03 Miguel de Icaza <miguel@ximian.com>
21033 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
21034 from referenced assemblies as well.
21036 2003-02-02 Martin Baulig <martin@ximian.com>
21038 * class.cs (MethodData.Emit): Generate debugging info for external methods.
21040 2003-02-02 Martin Baulig <martin@ximian.com>
21042 * class.cs (Constructor.Emit): Open the symbol writer before
21043 emitting the constructor initializer.
21044 (ConstructorInitializer.Emit): Call ec.Mark() to allow
21045 single-stepping through constructor initializers.
21047 2003-01-30 Miguel de Icaza <miguel@ximian.com>
21049 * class.cs: Handle error 549: do not allow virtual methods in
21052 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
21054 * decl.cs: Check access levels when resolving types
21056 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
21058 * statement.cs: Add parameters and locals set in catch blocks that might
21059 return to set vector
21061 2003-01-29 Miguel de Icaza <miguel@ximian.com>
21063 * class.cs (Operator): Set the SpecialName flags for operators.
21065 * expression.cs (Invocation.DoResolve): Only block calls to
21066 accessors and operators on SpecialName methods.
21068 (Cast.TryReduce): Handle conversions from char constants.
21071 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
21073 * statement.cs: small memory and time optimization in FlowBranching.
21075 2003-01-28 Pedro Mart <yoros@wanadoo.es>
21077 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
21078 problem that the last fix but in the other sid (Set).
21080 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
21081 access when there is no indexer in the hierarchy.
21083 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
21085 * class.cs: Combine some if statements.
21087 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21089 * driver.cs: fixed bug #37187.
21091 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
21093 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
21094 any indexer, it's needed to build a list with all the indexers in the
21095 hierarchy (AllGetters), else we have problems. Fixes #35653.
21097 2003-01-23 Miguel de Icaza <miguel@ximian.com>
21099 * class.cs (MethodData.Define): It is wrong for an interface
21100 implementation to be static in both cases: explicit and implicit.
21101 We were only handling this in one case.
21103 Improve the if situation there to not have negations.
21105 * class.cs (Field.Define): Turns out that we do not need to check
21106 the unsafe bit on field definition, only on usage. Remove the test.
21108 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21110 * driver.cs: use assembly.Location instead of Codebase (the latest
21111 patch made mcs fail when using MS assemblies).
21113 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
21115 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
21116 get the path to *corlib.dll.
21118 2003-01-21 Nick Drochak <ndrochak@gol.com>
21122 * typemanager.cs: Remove compiler warnings
21124 2003-01-20 Duncan Mak <duncan@ximian.com>
21126 * AssemblyInfo.cs: Bump the version number to 0.19.
21128 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21130 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
21132 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
21134 * class.cs (Constructor::Emit): Emit debugging info for constructors.
21136 2003-01-17 Miguel de Icaza <miguel@ximian.com>
21138 * cs-parser.jay: Small fix: we were not comparing the constructor
21139 name correctly. Thanks to Zoltan for the initial pointer.
21141 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
21143 * cs-tokenizer.cs: Set file name when specified with #line
21145 2003-01-15 Miguel de Icaza <miguel@ximian.com>
21147 * cs-parser.jay: Only perform the constructor checks here if we
21148 are named like the class; This will help provider a better
21149 error. The constructor path is taken when a type definition is
21150 not found, but most likely the user forgot to add the type, so
21151 report that rather than the constructor error.
21153 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
21155 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
21158 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21160 * cs-parser.jay: Add cleanup call.
21162 2003-01-13 Duncan Mak <duncan@ximian.com>
21164 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
21165 consistent with other methods.
21167 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21169 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
21171 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
21173 * attribute.cs: only set GuidAttr to true when we have a
21176 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21180 * typemanager.cs: fixes to allow mcs compile corlib with the new
21181 Type.IsSubclassOf fix.
21183 2003-01-08 Miguel de Icaza <miguel@ximian.com>
21185 * expression.cs (LocalVariableReference.DoResolve): Classify a
21186 constant as a value, not as a variable. Also, set the type for
21189 * cs-parser.jay (fixed_statement): take a type instead of a
21190 pointer_type, so we can produce a better error message later.
21192 * statement.cs (Fixed.Resolve): Flag types that are not pointers
21195 (For.DoEmit): Make inifinite loops have a
21196 non-conditional branch back.
21198 (Fixed.DoEmit): First populate the pinned variables, then emit the
21199 statement, then clear the variables. Before I was emitting the
21200 code once for each fixed piece.
21203 2003-01-08 Martin Baulig <martin@ximian.com>
21205 * statement.cs (FlowBranching.MergeChild): A break in a
21206 SWITCH_SECTION does not leave a loop. Fixes #36155.
21208 2003-01-08 Martin Baulig <martin@ximian.com>
21210 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
21211 lives in the same number space than `param_map'. Fixes #36154.
21213 2003-01-07 Miguel de Icaza <miguel@ximian.com>
21215 * cs-parser.jay (constructor_declaration): Set the
21216 Constructor.ModFlags before probing for it. This makes the
21217 compiler report 514, 515 and 132 (the code was there, but got
21220 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
21221 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
21222 (GotoCase.Resolve): Set `Returns' to ALWAYS.
21224 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
21226 * enum.cs: create the enum static fields using the enum type.
21228 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
21230 * class.cs: don't try to create the ParamBuilder for the return
21231 type if it's not needed (and handle it breaking for the ms runtime
21234 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
21236 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
21238 2002-12-29 Miguel de Icaza <miguel@ximian.com>
21240 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
21241 the command. This showed up while compiling the JANET source
21242 code, which used \r as its only newline separator.
21244 2002-12-28 Miguel de Icaza <miguel@ximian.com>
21246 * class.cs (Method.Define): If we are an operator (because it
21247 reuses our code), then set the SpecialName and HideBySig. #36128
21249 2002-12-22 Miguel de Icaza <miguel@ximian.com>
21251 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
21252 exception, report error 120 `object reference required'.
21254 * driver.cs: Add --pause option, used during to measure the size
21255 of the process as it goes with --timestamp.
21257 * expression.cs (Invocation.DoResolve): Do not allow methods with
21258 SpecialName to be invoked.
21260 2002-12-21 Miguel de Icaza <miguel@ximian.com>
21262 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
21263 number before adding it.
21265 2002-12-21 Ravi Pratap <ravi@ximian.com>
21267 * ecore.cs (StandardImplicitConversion): When in an unsafe
21268 context, we allow conversion between void * to any other pointer
21269 type. This fixes bug #35973.
21271 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
21273 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
21274 is not thrown when extensionless outputs are used
21276 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21278 * rootcontext.cs: fixed compilation of corlib.
21280 2002-12-19 Miguel de Icaza <miguel@ximian.com>
21282 * attribute.cs (Attributes.Contains): Add new method.
21284 * class.cs (MethodCore.LabelParameters): if the parameter is an
21285 `out' parameter, check that no attribute `[In]' has been passed.
21287 * enum.cs: Handle the `value__' name in an enumeration.
21289 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
21291 * decl.cs: Added special case to allow overrides on "protected
21294 2002-12-18 Ravi Pratap <ravi@ximian.com>
21296 * attribute.cs (Attributes.AddAttributeSection): Rename to this
21297 since it makes much more sense.
21299 (Attributes.ctor): Don't require a Location parameter.
21301 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
21303 * attribute.cs (ApplyAttributes): Remove extra Location parameters
21304 since we already have that information per attribute.
21306 * everywhere : make appropriate changes.
21308 * class.cs (LabelParameters): Write the code which actually
21309 applies attributes to the return type. We can't do this on the MS
21310 .NET runtime so we flag a warning in the case an exception is
21313 2002-12-18 Miguel de Icaza <miguel@ximian.com>
21315 * const.cs: Handle implicit null conversions here too.
21317 2002-12-17 Ravi Pratap <ravi@ximian.com>
21319 * class.cs (MethodCore.LabelParameters): Remove the extra
21320 Type [] parameter since it is completely unnecessary. Instead
21321 pass in the method's attributes so that we can extract
21322 the "return" attribute.
21324 2002-12-17 Miguel de Icaza <miguel@ximian.com>
21326 * cs-parser.jay (parse): Use Report.Error to flag errors instead
21327 of ignoring it and letting the compile continue.
21329 * typemanager.cs (ChangeType): use an extra argument to return an
21330 error condition instead of throwing an exception.
21332 2002-12-15 Miguel de Icaza <miguel@ximian.com>
21334 * expression.cs (Unary.TryReduce): mimic the code for the regular
21335 code path. Perform an implicit cast in the cases where we can
21336 implicitly convert to one of the integral types, and then reduce
21337 based on that constant. This fixes bug #35483.
21339 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21341 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
21343 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21345 * namespace.cs: fixed bug #35489.
21347 2002-12-12 Miguel de Icaza <miguel@ximian.com>
21349 * class.cs: Remove some dead code.
21351 * cs-parser.jay: Estimate the number of methods needed
21352 (RootContext.MethodCount);
21354 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
21355 numbers instead of StringBuilders.
21357 * support.cs (PtrHashtable): Add constructor with initial size;
21358 We can now reduce reallocations of the method table.
21360 2002-12-10 Ravi Pratap <ravi@ximian.com>
21362 * attribute.cs (ApplyAttributes): Keep track of the emitted
21363 attributes on a per-target basis. This fixes bug #35413.
21365 2002-12-10 Miguel de Icaza <miguel@ximian.com>
21367 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
21368 default to the Windows 1252 encoding.
21370 (UnixParseOption): Support version, thanks to Alp for the missing
21373 * AssemblyInfo.cs: Add nice assembly information.
21375 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
21378 * cs-parser.jay: Allow a trailing comma before the close bracked
21379 in the attribute_section production.
21381 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
21382 address of the instance was being taken, I will take this out,
21383 because we take the address of the object immediately here.
21385 2002-12-09 Ravi Pratap <ravi@ximian.com>
21387 * typemanager.cs (AreMultipleAllowed): Take care of the most
21388 obvious case where attribute type is not in the current assembly -
21391 2002-12-08 Miguel de Icaza <miguel@ximian.com>
21393 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
21394 definitions, instead of doing that afterwards.
21396 Also we use a nice little hack, depending on the constructor, we
21397 know if we are a "composed" name or a simple name. Hence, we
21398 avoid the IndexOf test, and we avoid
21400 * codegen.cs: Add code to assist in a bug reporter to track down
21401 the source of a compiler crash.
21403 2002-12-07 Ravi Pratap <ravi@ximian.com>
21405 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
21406 types have been emitted for a given element and flag an error
21407 if something which does not have AllowMultiple set is used more
21410 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
21411 attribute types and their corresponding AllowMultiple properties
21413 (AreMultipleAllowed): Check the property for a given type.
21415 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
21416 property in the case we have a TypeContainer.
21418 (Attributes.AddAttribute): Detect duplicates and just skip on
21419 adding them. This trivial fix catches a pretty gross error in our
21420 attribute emission - global attributes were being emitted twice!
21422 Bugzilla bug #33187 is now fixed.
21424 2002-12-06 Miguel de Icaza <miguel@ximian.com>
21426 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
21427 instead of pp_and).
21429 * expression.cs (Binary.ResolveOperator): I can only use the
21430 Concat (string, string, string) and Concat (string, string,
21431 string, string) if the child is actually a concatenation of
21434 2002-12-04 Miguel de Icaza <miguel@ximian.com>
21436 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
21437 context where we need a 2-character lookahead.
21439 * pending.cs (PendingImplementation): Rework so we can keep track
21440 of interface types all the time, and flag those which were
21441 implemented by parents as optional.
21443 2002-12-03 Miguel de Icaza <miguel@ximian.com>
21445 * expression.cs (Binary.ResolveOperator): Use
21446 String.Concat(string,string,string) or
21447 String.Concat(string,string,string,string) when possible.
21449 * typemanager: More helper methods.
21452 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
21454 * pending.cs: remove the bogus return from GetMissingInterfaces()
21455 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
21457 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21459 * namespace.cs: avoid duplicated 'using xxx' being added to
21460 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
21461 when we get more than one 'using' statement for the same namespace.
21462 Report a CS0105 warning for it.
21464 2002-11-30 Miguel de Icaza <miguel@ximian.com>
21466 * cs-tokenizer.cs (consume_identifier): use read directly, instead
21467 of calling getChar/putback, uses internal knowledge of it.
21469 (xtoken): Reorder tokenizer so most common patterns are checked
21470 first. This reduces the compilation time in another 5% (from 8.11s
21471 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
21473 The parsing time is 22% of the compilation in mcs, and from that
21474 64% is spent on the tokenization process.
21476 I tried using a binary search for keywords, but this is slower
21477 than the hashtable. Another option would be to do a couple of
21480 * Not use a StringBuilder, instead use an array of chars,
21481 with a set value. Notice that this way we could catch
21482 the 645 error without having to do it *afterwards*.
21484 * We could write a hand-parser to avoid the hashtable
21485 compares altogether.
21487 The identifier consumption process takes 37% of the tokenization
21488 time. Another 15% is spent on is_number. 56% of the time spent
21489 on is_number is spent on Int64.Parse:
21491 * We could probably choose based on the string length to
21492 use Int32.Parse or Int64.Parse and avoid all the 64-bit
21495 Another 3% is spend on wrapping `xtoken' in the `token' function.
21497 Handle 0xa0 as whitespace (#34752)
21499 2002-11-26 Miguel de Icaza <miguel@ximian.com>
21501 * typemanager.cs (IsCLRType): New routine to tell whether a type
21502 is one of the builtin types.
21504 Maybe it needs to use TypeCodes to be faster. Maybe we could use
21505 typecode in more places instead of doing pointer comparissions.
21506 We could leverage some knowledge about the way the typecodes are
21509 New code to cache namespaces in assemblies, it is currently not
21510 invoked, to be used soon.
21512 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
21514 * expression.cs (Binary.ResolveOperator): specially handle
21515 strings, and do not perform user-defined operator overloading for
21518 2002-11-24 Miguel de Icaza <miguel@ximian.com>
21520 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
21521 internalcall as it is a pretty simple operation; Avoid whenever
21522 possible to call Char.IsLetter.
21524 (consume_identifier): Cut by half the number of
21525 hashtable calls by merging the is_keyword and GetKeyword behavior.
21527 Do not short-circuit, because if we do, we
21528 report errors (ie, #if false && true would produce an invalid
21532 2002-11-24 Martin Baulig <martin@ximian.com>
21534 * expression.cs (Cast.TryReduce): If we're in checked syntax,
21535 check constant ranges and report a CS0221. Fixes #33186.
21537 2002-11-24 Martin Baulig <martin@ximian.com>
21539 * cs-parser.jay: Make this work for uninitialized variable
21540 declarations in the `for' initializer. Fixes #32416.
21542 2002-11-24 Martin Baulig <martin@ximian.com>
21544 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
21545 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
21547 2002-11-24 Martin Baulig <martin@ximian.com>
21549 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
21550 argument; if true, we also check for user-defined conversions.
21551 This is only needed if both arguments are of a user-defined type.
21552 Fixes #30443, added test-175.cs.
21553 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
21555 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
21557 2002-11-24 Martin Baulig <martin@ximian.com>
21559 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
21560 function to get the store opcode.
21561 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
21562 only emit the Ldelema if the store opcode is Stobj. You must run
21563 both test-34 and test-167 to test this. Fixes #34529.
21565 2002-11-23 Martin Baulig <martin@ximian.com>
21567 * ecore.cs (Expression.MemberLookup): Added additional
21568 `qualifier_type' argument which is used when we're being called
21569 from MemberAccess.DoResolve() and null if we're called from a
21571 (Expression.MemberLookupFailed): New method to report errors; this
21572 does the CS1540 check and reports the correct error message.
21574 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
21575 argument for the CS1540 check and redone the way how we're dealing
21576 with private members. See the comment in the source code for details.
21577 (FilterWithClosure): Reverted this back to revision 1.197; renamed
21578 `closure_start_type' to `closure_qualifier_type' and check whether
21579 it's not null. It was not this filter being broken, it was just
21580 being called with the wrong arguments.
21582 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
21583 and pass it the correct `qualifier_type'; this also does the error
21586 2002-11-22 Miguel de Icaza <miguel@ximian.com>
21588 * expression.cs (Invocation.EmitParams): If the we are dealing
21589 with a non-built-in value type, load its address as well.
21591 (ArrayCreation): Use a a pretty constant instead
21592 of the hardcoded value 2. Use 6 instead of 2 for the number of
21593 static initializers.
21595 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
21596 because they are not really value types, just glorified integers.
21598 * driver.cs: Do not append .exe, the CSC compiler does not do it.
21600 * ecore.cs: Remove redundant code for enumerations, make them use
21601 the same code path as everything else, fixes the casting issue
21602 with enumerations in Windows.Forms.
21604 * attribute.cs: Do only cast to string if it is a string, the
21605 validation happens later.
21607 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
21608 people upgrade their corlibs.
21610 * ecore.cs: Oops, enumerations were not following the entire code path
21612 2002-11-21 Miguel de Icaza <miguel@ximian.com>
21614 * typemanager.cs (FilterWithClosure): Commented out the test for
21615 1540 in typemanager.cs, as it has problems when accessing
21616 protected methods from a parent class (see test-174.cs).
21618 * attribute.cs (Attribute.ValidateGuid): new method.
21619 (Attribute.Resolve): Use above.
21621 2002-11-19 Miguel de Icaza <miguel@ximian.com>
21623 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
21625 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
21626 handling for enumerations, as we only needed the TypeContainer
21627 functionality to begin with (this is required for the fix below to
21628 work for enums that reference constants in a container class for
21631 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
21633 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
21634 a valid TypeBuilder to perform lookups on.o
21636 * class.cs (InheritableMemberSignatureCompare): Use true in the
21637 call to GetGetMethod and GetSetMethod, because we are comparing
21638 the signature, and we need to get the methods *even* if they are
21641 (PropertyBase.CheckBase): ditto.
21643 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
21644 GotoCase.Resolve): Use Peel on EmpytCasts.
21646 * ecore.cs (EmptyCast): drop child, add Peel method.
21648 2002-11-17 Martin Baulig <martin@ximian.com>
21650 * ecore.cs (EmptyCast.Child): New public property.
21652 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
21653 label resolved to an EmptyCast. Fixes #34162.
21654 (GotoCase.Resolve): Likewise.
21655 (Block.EmitMeta): Likewise.
21657 2002-11-17 Martin Baulig <martin@ximian.com>
21659 * expression.cs (Invocation.BetterConversion): Prefer int over
21660 uint; short over ushort; long over ulong for integer literals.
21661 Use ImplicitConversionExists instead of StandardConversionExists
21662 since we also need to check for user-defined implicit conversions.
21663 Fixes #34165. Added test-173.cs.
21665 2002-11-16 Martin Baulig <martin@ximian.com>
21667 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
21668 with the `true' and `false' literals. Fixes #33151.
21670 2002-11-16 Martin Baulig <martin@ximian.com>
21672 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
21673 October 22nd; don't do the cs1540 check for static members.
21675 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
21676 now using our own filter here and doing the cs1540 check again.
21678 2002-11-16 Martin Baulig <martin@ximian.com>
21680 * support.cs (InternalParameters): Don't crash if we don't have
21681 any fixed parameters. Fixes #33532.
21683 2002-11-16 Martin Baulig <martin@ximian.com>
21685 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
21686 when looking up static methods to make this work on Windows.
21689 2002-11-16 Martin Baulig <martin@ximian.com>
21691 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
21692 a setter rather than using PropertyInfo.CanWrite.
21694 2002-11-15 Nick Drochak <ndrochak@gol.com>
21696 * class.cs: Allow acces to block member by subclasses. Fixes build
21699 2002-11-14 Martin Baulig <martin@ximian.com>
21701 * class.cs (Constructor.Emit): Added the extern/block check.
21704 2002-11-14 Martin Baulig <martin@ximian.com>
21706 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
21707 iteration while looking for indexers, this is needed because the
21708 indexer may have a different name in our base classes. Fixed the
21709 error reporting (no indexers at all, not get accessor, no
21710 overloaded match). Fixes bug #33089.
21711 (IndexerAccess.DoResolveLValue): Likewise.
21713 2002-11-14 Martin Baulig <martin@ximian.com>
21715 * class.cs (PropertyBase.CheckBase): Make this work for multiple
21716 indexers. Fixes the first part of bug #33089.
21717 (MethodSignature.InheritableMemberSignatureCompare): Added support
21720 2002-11-13 Ravi Pratap <ravi@ximian.com>
21722 * attribute.cs (Attribute.Resolve): Catch the
21723 NullReferenceException and report it since it isn't supposed to
21726 2002-11-12 Miguel de Icaza <miguel@ximian.com>
21728 * expression.cs (Binary.EmitBranchable): Also handle the cases for
21729 LogicalOr and LogicalAnd that can benefit from recursively
21730 handling EmitBranchable. The code now should be nice for Paolo.
21732 2002-11-08 Miguel de Icaza <miguel@ximian.com>
21734 * typemanager.cs (LookupType): Added a negative-hit hashtable for
21735 the Type lookups, as we perform quite a number of lookups on
21736 non-Types. This can be removed once we can deterministically tell
21737 whether we have a type or a namespace in advance.
21739 But this might require special hacks from our corlib.
21743 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
21744 and double which avoids a conversion from an integer to a double.
21746 * expression.cs: tiny optimization, avoid calling IsConstant,
21747 because it effectively performs the lookup twice.
21749 2002-11-06 Miguel de Icaza <miguel@ximian.com>
21751 But a bogus return here to keep the semantics of the old code
21752 until the Mono runtime is fixed.
21754 * pending.cs (GetMissingInterfaces): New method used to remove all
21755 the interfaces that are already implemented by our parent
21756 classes from the list of pending methods.
21758 * interface.cs: Add checks for calls after ResolveTypeExpr.
21760 2002-11-05 Miguel de Icaza <miguel@ximian.com>
21762 * class.cs (Class.Emit): Report warning 67: event not used if the
21763 warning level is beyond 3.
21765 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
21766 being a NullLiteral.
21768 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
21771 * class.cs (TypeContainer.GetClassBases): Cover a missing code
21772 path that might fail if a type can not be resolved.
21774 * expression.cs (Binary.Emit): Emit unsigned versions of the
21777 * driver.cs: use error 5.
21779 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
21781 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
21783 2002-11-01 Miguel de Icaza <miguel@ximian.com>
21785 * cs-parser.jay (switch_section): A beautiful patch from Martin
21786 Baulig that fixed 33094.
21788 2002-10-31 Miguel de Icaza <miguel@ximian.com>
21790 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
21791 Check whether the base is abstract and report an error if so.
21793 * expression.cs (IndexerAccess.DoResolveLValue,
21794 IndexerAccess.DoResolve): ditto.
21796 (Invocation.DoResolve): ditto.
21798 (Invocation.FullMethodDesc): Improve the report string.
21800 * statement.cs (Block): Eliminate IsVariableDefined as it is
21801 basically just a wrapper for GetVariableInfo.
21803 * ecore.cs (SimpleName): Use new
21805 * support.cs (ReflectionParamter.ParameterType): We unwrap the
21806 type, as we return the actual parameter ref/unref state on a
21809 2002-10-30 Miguel de Icaza <miguel@ximian.com>
21811 * support.cs: Return proper flags REF/OUT fixing the previous
21814 * expression.cs: Reverted last patch, that was wrong. Is_ref is
21815 not used to mean `ref' but `ref or out' in ParameterReference
21817 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
21818 full type signature instead of calling TypeManger.CSharpName
21821 * support.cs (InternalParameters.ParameterDesc): Do not compare
21822 directly to the modflags, because REF/OUT will actually be bitsets
21825 * delegate.cs (VerifyMethod): Check also the modifiers.
21827 * cs-tokenizer.cs: Fix bug where floating point values with an
21828 exponent where a sign was missing was ignored.
21830 * driver.cs: Allow multiple assemblies to be specified in a single
21833 2002-10-28 Miguel de Icaza <miguel@ximian.com>
21835 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
21836 because identifiers after a parenthesis would end up in this kind
21837 of production, and we needed to desamiguate it for having casts
21840 (UserDefinedType *) xxx
21842 2002-10-24 Miguel de Icaza <miguel@ximian.com>
21844 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
21845 we should set on the Bindingflags.NonPublic, but not turn on
21846 private_ok. private_ok controls whether a Private member is
21847 returned (this is chekced on the filter routine), while the
21848 BindingFlags.NonPublic just controls whether private/protected
21849 will be allowed. This fixes the problem part of the problem of
21850 private properties being allowed to be used in derived classes.
21852 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
21853 so we can call the children DoResolveLValue method (this will
21854 properly signal errors on lvalue assignments to base properties)
21856 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
21857 getter are null, and we have a property info, we know that this
21858 happened because the lookup failed, so we report an error 122 for
21859 protection level violation.
21861 We also silently return if setter and getter are null in the
21862 resolve functions, this condition only happens if we have flagged
21863 the error before. This is the other half of the problem.
21865 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
21866 not have accessibility information, that is why we were returning
21867 true in the filter function in typemanager.cs.
21869 To properly report 122 (property is inaccessible because of its
21870 protection level) correctly, we report this error in ResolveAccess
21871 by failing if both the setter and the getter are lacking (ie, the
21874 DoResolve and DoLResolve have been modified to check for both
21875 setter/getter being null and returning silently, the reason being
21876 that I did not want to put the knowledge about this error in upper
21879 int old = Report.Errors;
21880 x = new PropertyExpr (...);
21881 if (old != Report.Errors)
21886 So the property expr is returned, but it is invalid, so the error
21887 will be flagged during the resolve process.
21889 * class.cs: Remove InheritablePropertySignatureCompare from the
21890 class, as we no longer depend on the property signature to compute
21891 whether it is possible to implement a method or not.
21893 The reason is that calling PropertyInfo.GetGetMethod will return
21894 null (in .NET, in Mono it works, and we should change this), in
21895 cases where the Get Method does not exist in that particular
21900 class X { public virtual int A { get { return 1; } } }
21902 class Z : Y { public override int A { get { return 2; } } }
21904 Would fail in Z because the parent (Y) would not have the property
21905 defined. So we avoid this completely now (because the alternative
21906 fix was ugly and slow), and we now depend exclusively on the
21909 (PropertyBase.CheckBase): Use a method-base mechanism to find our
21910 reference method, instead of using the property.
21912 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
21913 routines are gone now.
21915 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
21916 names, they were incorrectly named.
21918 * cs-tokenizer.cs: Return are more gentle token on failure.
21920 * pending.cs (PendingImplementation.InterfaceMethod): This routine
21921 had an out-of-sync index variable, which caused it to remove from
21922 the list of pending methods the wrong method sometimes.
21924 2002-10-22 Miguel de Icaza <miguel@ximian.com>
21926 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
21927 CanWrite, because those refer to this particular instance of the
21928 property, and do not take into account the fact that we can
21929 override single members of a property.
21931 Constructor requires an EmitContext. The resolution process does
21932 not happen here, but we need to compute the accessors before,
21933 because the resolution does not always happen for properties.
21935 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
21936 subclass, before we did not update this flag, but we did update
21939 (GetAccessors): Drop this routine, as it did not work in the
21940 presence of partially overwritten set/get methods.
21942 Notice that this broke the cs1540 detection, but that will require
21945 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21949 * driver.cs: issue a warning instead of an error if we don't support
21950 debugging for the platform. Also ignore a couple of errors that may
21951 arise when trying to write the symbols. Undo my previous patch.
21953 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21955 * driver.cs: ignore /debug switch except for Unix platforms.
21957 2002-10-23 Nick Drochak <ndrochak@gol.com>
21959 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
21961 2002-10-21 Miguel de Icaza <miguel@ximian.com>
21963 * driver.cs: Do not make mcs-debug conditional, so we do not break
21964 builds that use it.
21966 * statement.cs (UsageVector.MergeChildren): I would like Martin to
21967 review this patch. But basically after all the children variables
21968 have been merged, the value of "Breaks" was not being set to
21969 new_breaks for Switch blocks. I think that it should be set after
21970 it has executed. Currently I set this to the value of new_breaks,
21971 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
21972 conservative, but I do not understand this code very well.
21974 I did not break anything in the build, so that is good ;-)
21976 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
21978 2002-10-20 Mark Crichton <crichton@gimp.org>
21980 * cfold.cs: Fixed compile blocker. Really fixed it this time.
21982 2002-10-20 Nick Drochak <ndrochak@gol.com>
21984 * cfold.cs: Fixed compile blocker.
21986 2002-10-20 Miguel de Icaza <miguel@ximian.com>
21988 * driver.cs: I was chekcing the key, not the file.
21990 2002-10-19 Ravi Pratap <ravi@ximian.com>
21992 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
21993 message that we were generating - we just need to silently return
21996 2002-10-19 Miguel de Icaza <miguel@ximian.com>
21998 * class.cs (Event.Define): Change my previous commit, as this
21999 breaks the debugger. This is a temporary hack, as it seems like
22000 the compiler is generating events incorrectly to begin with.
22002 * expression.cs (Binary.ResolveOperator): Added support for
22003 "U operator - (E x, E y)"
22005 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
22008 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
22009 init-only variables, but this path did not take into account that
22010 there might be also instance readonly variables. Correct this
22013 This fixes bug 32253
22015 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
22018 * driver.cs: Change the extension for modules to `netmodule'
22020 * cs-parser.jay: Improved slightly the location tracking for
22021 the debugger symbols.
22023 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
22024 modifiers that were specified instead of the hardcoded value
22025 (FamAndAssem). This was basically ignoring the static modifier,
22026 and others. Fixes 32429.
22028 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
22029 fixed a bug in the process (32476)
22031 * expression.cs (ArrayAccess.EmitAssign): Patch from
22032 hwang_rob@yahoo.ca that fixes bug 31834.3
22034 2002-10-18 Miguel de Icaza <miguel@ximian.com>
22036 * driver.cs: Make the module extension .netmodule.
22038 2002-10-16 Miguel de Icaza <miguel@ximian.com>
22040 * driver.cs: Report an error if the resource file is not found
22041 instead of crashing.
22043 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
22044 false, like Emit does.
22046 2002-10-16 Nick Drochak <ndrochak@gol.com>
22048 * typemanager.cs: Remove unused private member. Also reported mcs
22049 bug to report this as a warning like csc.
22051 2002-10-15 Martin Baulig <martin@gnome.org>
22053 * statement.cs (Statement.Emit): Made this a virtual method; emits
22054 the line number info and calls DoEmit().
22055 (Statement.DoEmit): New protected abstract method, formerly knows
22056 as Statement.Emit().
22058 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
22060 2002-10-11 Miguel de Icaza <miguel@ximian.com>
22062 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
22063 have fixed a remaining problem: not every AddXXXX was adding a
22064 fully qualified name.
22066 Now everyone registers a fully qualified name in the DeclSpace as
22067 being defined instead of the partial name.
22069 Downsides: we are slower than we need to be due to the excess
22070 copies and the names being registered this way.
22072 The reason for this is that we currently depend (on the corlib
22073 bootstrap for instance) that types are fully qualified, because
22074 we dump all the types in the namespace, and we should really have
22075 types inserted into the proper namespace, so we can only store the
22076 basenames in the defined_names array.
22078 2002-10-10 Martin Baulig <martin@gnome.org>
22080 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
22081 from bug #31834, see the bug report for a testcase which is
22084 2002-10-10 Martin Baulig <martin@gnome.org>
22086 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
22087 flow analysis code for this.
22089 * statement.cs (Do, While, For): Tell the flow analysis code about
22091 (FlowBranching.UsageVector): Added support for infinite loops.
22092 (Block.Resolve): Moved the dead code elimination here and use flow
22095 2002-10-09 Miguel de Icaza <miguel@ximian.com>
22097 * class.cs (Field.Define): Catch cycles on struct type
22100 * typemanager.cs (IsUnmanagedtype): Do not recursively check
22101 fields if the fields are static. We only need to check instance
22104 * expression.cs (As.DoResolve): Test for reference type.
22106 * statement.cs (Using.ResolveExpression): Use
22107 ConvertImplicitRequired, not ConvertImplicit which reports an
22109 (Using.ResolveLocalVariableDecls): ditto.
22111 * expression.cs (Binary.ResolveOperator): Report errors in a few
22112 places where we had to.
22114 * typemanager.cs (IsUnmanagedtype): Finish implementation.
22116 2002-10-08 Miguel de Icaza <miguel@ximian.com>
22118 * expression.cs: Use StoreFromPtr instead of extracting the type
22119 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
22121 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
22122 an enumeration value to a System.Enum, but System.Enum is not a
22123 value type, but an class type, so we need to box.
22125 (Expression.ConvertExplicit): One codepath could return
22126 errors but not flag them. Fix this. Fixes #31853
22128 * parameter.cs (Resolve): Do not allow void as a parameter type.
22130 2002-10-06 Martin Baulig <martin@gnome.org>
22132 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
22133 if it's a class type and not a struct. Fixes #31815.
22135 2002-10-06 Martin Baulig <martin@gnome.org>
22137 * statement.cs: Reworked the flow analysis code a bit to make it
22138 usable for dead code elimination.
22140 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22142 * cs-parser.jay: allow empty source files. Fixes bug #31781.
22144 2002-10-04 Miguel de Icaza <miguel@ximian.com>
22146 * expression.cs (ComposedCast.DoResolveType): A quick workaround
22147 to fix the test 165, will investigate deeper.
22149 2002-10-04 Martin Baulig <martin@gnome.org>
22151 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
22152 finally blocks actually work.
22153 (Try.Resolve): We don't need to create a sibling for `finally' if
22154 there is no finally block.
22156 2002-10-04 Martin Baulig <martin@gnome.org>
22158 * class.cs (Constructor.Define): The default accessibility for a
22159 non-default constructor is private, not public.
22161 2002-10-04 Miguel de Icaza <miguel@ximian.com>
22163 * class.cs (Constructor): Make AllowedModifiers public, add
22166 * cs-parser.jay: Perform the modifiers test here, as the
22167 constructor for the Constructor class usually receives a zero
22168 because of the way we create it (first we create, later we
22169 customize, and we were never checking the modifiers).
22171 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
22172 is a version of LookupTypeReflection that includes the type-name
22173 cache. This can be used as a fast path for functions that know
22174 the fully qualified name and are only calling into *.GetType() to
22175 obtain a composed type.
22177 This is also used by TypeManager.LookupType during its type
22180 (LookupType): We now also track the real type name, as sometimes
22181 we can get a quey for the real type name from things like
22182 ComposedCast. This fixes bug 31422.
22184 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
22185 complete type fullname, it does not have to go through the type
22186 resolution system to obtain the composed version of the type (for
22187 obtaining arrays or pointers).
22189 (Conditional.Emit): Use the EmitBoolExpression to
22190 generate nicer code, as requested by Paolo.
22192 (ArrayCreation.CheckIndices): Use the patch from
22193 hwang_rob@yahoo.ca to validate the array initializers.
22195 2002-10-03 Miguel de Icaza <miguel@ximian.com>
22197 * class.cs (ConstructorInitializer.Emit): simplify code by using
22198 Invocation.EmitCall, and at the same time, fix the bugs in calling
22199 parent constructors that took variable arguments.
22201 * ecore.cs (Expression.ConvertNumericExplicit,
22202 Expression.ImplicitNumericConversion): Remove the code that
22203 manually wrapped decimal (InternalTypeConstructor call is now gone
22206 * expression.cs (Cast.TryReduce): Also handle decimal types when
22207 trying to perform a constant fold on the type.
22209 * typemanager.cs (IsUnmanagedtype): Partially implemented.
22211 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
22212 that only turned off an error report, and did nothing else.
22214 2002-10-02 Miguel de Icaza <miguel@ximian.com>
22216 * driver.cs: Handle and ignore /fullpaths
22218 2002-10-01 Miguel de Icaza <miguel@ximian.com>
22220 * expression.cs (Binary.ResolveOperator): Catch the case where
22221 DoNumericPromotions returns true,
22223 (Binary.DoNumericPromotions): Simplify the code, and the tests.
22225 2002-09-27 Miguel de Icaza <miguel@ximian.com>
22227 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
22230 2002-09-26 Miguel de Icaza <miguel@ximian.com>
22232 * ecore.cs (ConvertNumericExplicit): It is not enough that the
22233 conversion exists, but it is also required that the conversion be
22234 performed. This manifested in "(Type64Enum) 2".
22236 * class.cs (TypeManager.AddMethod): The fix is not to change
22237 AddEnum, because that one was using a fully qualified name (every
22238 DeclSpace derivative does), but to change the AddMethod routine
22239 that was using an un-namespaced name. This now correctly reports
22240 the duplicated name.
22242 Revert patch until I can properly fix it. The issue
22243 is that we have a shared Type space across all namespaces
22244 currently, which is wrong.
22246 Options include making the Namespace a DeclSpace, and merge
22247 current_namespace/current_container in the parser.
22249 2002-09-25 Miguel de Icaza <miguel@ximian.com>
22251 * cs-parser.jay: Improve error reporting when we get a different
22252 kind of expression in local_variable_type and
22253 local_variable_pointer_type.
22255 Propagate this to avoid missleading errors being reported.
22257 * ecore.cs (ImplicitReferenceConversion): treat
22258 TypeManager.value_type as a target just like object_type. As
22263 Is valid, and needs to result in the int 1 being boxed before it
22264 is assigned to the value type v.
22266 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
22267 to validate the enumeration name.
22269 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
22270 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
22271 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
22273 * ecore.cs (TryImplicitIntConversion): When doing an
22274 implicit-enumeration-conversion, check if the type is 64-bits and
22275 perform a conversion before passing to EnumConstant.
22277 2002-09-23 Miguel de Icaza <miguel@ximian.com>
22279 * decl.cs (Error_AmbiguousTypeReference); New routine used to
22280 report ambiguous type references. Unlike the MS version, we
22281 report what the ambiguity is. Innovation at work ;-)
22283 (DeclSpace.FindType): Require a location argument to
22284 display when we display an ambiguous error.
22286 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
22288 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
22290 * expression.cs (EmitDynamicInitializers): Apply patch from
22291 hwang_rob@yahoo.ca that fixes the order in which we emit our
22294 2002-09-21 Martin Baulig <martin@gnome.org>
22296 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
22297 delegate takes no arguments.
22299 2002-09-20 Miguel de Icaza <miguel@ximian.com>
22301 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
22304 * expression.cs: Extract the underlying type.
22306 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
22308 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
22310 2002-09-19 Miguel de Icaza <miguel@ximian.com>
22312 * class.cs (TypeContainer.DefineType): We can not use the nice
22313 PackingSize with the size set to 1 DefineType method, because it
22314 will not allow us to define the interfaces that the struct
22317 This completes the fixing of bug 27287
22319 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
22320 means also structs. This fixes part of the problem.
22321 (Expresion.ImplicitReferenceConversionExists): ditto.
22323 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
22324 error if there were no errors reported during the type lookup
22325 process, to avoid duplicates or redundant errors. Without this
22326 you would get an ambiguous errors plus a type not found. We have
22327 beaten the user enough with the first error.
22329 (DeclSparce.FindType): Emit a warning if we have an ambiguous
22332 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
22333 during the resolution process, stop the lookup, this avoids
22334 repeated error reports (same error twice).
22336 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
22338 * typemanager.cs (LookupType): Redo the type lookup code to match
22339 the needs of System.Reflection.
22341 The issue is that System.Reflection requires references to nested
22342 types to begin with a "+" sign instead of a dot. So toplevel
22343 types look like: "NameSpace.TopLevelClass", and nested ones look
22344 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
22347 2002-09-19 Martin Baulig <martin@gnome.org>
22349 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
22350 says that a method always returns or always throws an exception,
22351 don't report the CS0161.
22353 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
22354 set `Returns = new_returns'.
22356 2002-09-19 Martin Baulig <martin@gnome.org>
22358 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
22359 to an enum constant, check for a CS0176.
22361 2002-09-18 Miguel de Icaza <miguel@ximian.com>
22363 * class.cs (TypeContainer.CheckPairedOperators): Now we check
22364 for operators that must be in pairs and report errors.
22366 * ecore.cs (SimpleName.DoResolveType): During the initial type
22367 resolution process, when we define types recursively, we must
22368 check first for types in our current scope before we perform
22369 lookups in the enclosing scopes.
22371 * expression.cs (MakeByteBlob): Handle Decimal blobs.
22373 (Invocation.VerifyArgumentsCompat): Call
22374 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
22375 I thought we were supposed to always call this, but there are a
22376 few places in the code where we dont do it.
22378 2002-09-17 Miguel de Icaza <miguel@ximian.com>
22380 * driver.cs: Add support in -linkres and -resource to specify the
22381 name of the identifier.
22383 2002-09-16 Miguel de Icaza <miguel@ximian.com>
22385 * ecore.cs (StandardConversionExists): Sync with the conversion
22386 code: allow anything-* to void* conversions.
22388 (FindMostSpecificSource): Use an Expression argument
22389 instead of a Type, because we might be handed over a Literal which
22390 gets a few more implicit conversions that plain types do not. So
22391 this information was being lost.
22393 Also, we drop the temporary type-holder expression when not
22396 2002-09-17 Martin Baulig <martin@gnome.org>
22398 * class.cs (PropertyBase.CheckBase): Don't check the base class if
22399 this is an explicit interface implementation.
22401 2002-09-17 Martin Baulig <martin@gnome.org>
22403 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
22404 different `IndexerName' attributes.
22406 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
22407 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
22408 virtual CommonResolve().
22410 2002-09-16 Miguel de Icaza <miguel@ximian.com>
22412 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
22413 and convert that to the UnderlyingType.
22415 * statement.cs (Foreach.Resolve): Indexers are just like variables
22416 or PropertyAccesses.
22418 * cs-tokenizer.cs (consume_string): Track line numbers and columns
22419 inside quoted strings, we were not doing this before.
22421 2002-09-16 Martin Baulig <martin@gnome.org>
22423 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
22424 resolve it. This is needed for the definite assignment check of the
22425 instance expression, fixes bug #29846.
22426 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
22428 2002-09-16 Nick Drochak <ndrochak@gol.com>
22430 * parameter.cs: Fix compile error. Cannot reference static member
22431 from an instance object. Is this an mcs bug?
22433 2002-09-14 Martin Baulig <martin@gnome.org>
22435 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
22436 multiple times. Fixes bug #30295, added test-166.cs.
22438 2002-09-14 Martin Baulig <martin@gnome.org>
22440 * statement.cs (Block.Emit): Don't emit unreachable code.
22441 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
22442 `break' statements.
22443 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
22445 2002-09-14 Martin Baulig <martin@gnome.org>
22447 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
22450 2002-09-14 Martin Baulig <martin@gnome.org>
22452 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
22453 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
22454 be false on the ms runtime.
22456 2002-09-13 Martin Baulig <martin@gnome.org>
22458 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
22459 the CS0038 error message.
22461 2002-09-12 Miguel de Icaza <miguel@ximian.com>
22463 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
22464 constant inside, return it.
22466 2002-09-12 Martin Baulig <martin@gnome.org>
22468 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
22469 implicit conversion can be done between enum types.
22471 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
22472 check whether an implicit conversion to the current enum's UnderlyingType
22473 exists and report an error if not.
22475 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
22476 without debugging support.
22478 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
22479 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
22481 2002-09-12 Martin Baulig <martin@gnome.org>
22483 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
22485 * ecore.cs (IMemberExpr.DeclaringType): New property.
22486 (SimpleName.SimpleNameResolve): Check whether we're accessing a
22487 nonstatic member of an outer type (CS0038).
22489 2002-09-11 Miguel de Icaza <miguel@ximian.com>
22491 * driver.cs: Activate the using-error detector at warning level
22492 4 (at least for MS-compatible APIs).
22494 * namespace.cs (VerifyUsing): Small buglett fix.
22496 * pending.cs (PendingImplementation): pass the container pointer.
22498 * interface.cs (GetMethods): Allow for recursive definition. Long
22499 term, I would like to move every type to support recursive
22500 definitions, not the current ordering mechanism that we have right
22503 The situation is this: Attributes are handled before interfaces,
22504 so we can apply attributes to interfaces. But some attributes
22505 implement interfaces, we will now handle the simple cases
22506 (recursive definitions will just get an error).
22508 * parameter.cs: Only invalidate types at the end if we fail to
22511 2002-09-09 Martin Baulig <martin@gnome.org>
22513 * ecore.cs (PropertyExpr.Emit): Also check for
22514 TypeManager.system_int_array_get_length so this'll also work when
22515 compiling corlib. Fixes #30003.
22517 2002-09-09 Martin Baulig <martin@gnome.org>
22519 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
22520 and throw an exception if we can't get the type's size. Fixed #30040,
22523 2002-09-09 Martin Baulig <martin@gnome.org>
22525 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
22527 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
22528 context. Fixes bug #30027.
22530 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
22531 virtual functions. Fixes bug #30043, added test-164.cs.
22533 2002-09-08 Ravi Pratap <ravi@ximian.com>
22535 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
22537 2002-09-08 Nick Drochak <ndrochak@gol.com>
22539 * driver.cs: Use an object to get the windows codepage since it's not a
22542 2002-09-08 Miguel de Icaza <miguel@ximian.com>
22544 * statement.cs (For.Emit): for infinite loops (test == null)
22545 return whether there is a break inside, not always "true".
22547 * namespace.cs (UsingEntry): New struct to hold the name of the
22548 using definition, the location where it is defined, and whether it
22549 has been used in a successful type lookup.
22551 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
22556 2002-09-06 Ravi Pratap <ravi@ximian.com>
22558 * attribute.cs : Fix incorrect code which relied on catching
22559 a NullReferenceException to detect a null being passed in
22560 where an object was expected.
22562 2002-09-06 Miguel de Icaza <miguel@ximian.com>
22564 * statement.cs (Try): flag the catch variable as assigned
22566 * expression.cs (Cast): Simplified by using ResolveType instead of
22567 manually resolving.
22569 * statement.cs (Catch): Fix bug by using ResolveType.
22571 2002-09-06 Ravi Pratap <ravi@ximian.com>
22573 * expression.cs (BetterConversion): Special case for when we have
22574 a NullLiteral as the argument and we have to choose between string
22575 and object types - we choose string the way csc does.
22577 * attribute.cs (Attribute.Resolve): Catch the
22578 NullReferenceException and report error #182 since the Mono
22579 runtime no more has the bug and having this exception raised means
22580 we tried to select a constructor which takes an object and is
22583 2002-09-05 Ravi Pratap <ravi@ximian.com>
22585 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
22586 message (1502, 1503) when we can't locate a method after overload
22587 resolution. This is much more informative and closes the bug
22590 * interface.cs (PopulateMethod): Return if there are no argument
22591 types. Fixes a NullReferenceException bug.
22593 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
22594 expressions too. Previously we were checking only in one place for
22595 positional arguments leaving out named arguments.
22597 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
22598 type to the enum type is not allowed. Remove code corresponding to
22601 (ConvertNumericExplicit): Allow explicit conversions from
22602 the underlying type to enum type. This precisely follows the spec
22603 and closes a bug filed by Gonzalo.
22605 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22608 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
22610 2002-09-03 Miguel de Icaza <miguel@ximian.com>
22612 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
22613 it was important that we stored the right value after the
22614 reduction in `converted'.
22616 2002-09-04 Martin Baulig <martin@gnome.org>
22618 * location.cs (Location.SymbolDocument): Use full pathnames for the
22621 2002-08-30 Miguel de Icaza <miguel@ximian.com>
22623 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
22624 of the expression resolve mechanism, because that will catch the
22625 SimpleName error failures.
22627 (Conditional): If we can not resolve the
22628 expression, return, do not crash.
22630 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22633 (location): display token name instead of its number.
22635 2002-08-28 Martin Baulig <martin@gnome.org>
22637 * expression.cs (Binary.ResolveOperator): Don't silently return
22638 but return an error if an operator cannot be applied between two
22641 2002-08-28 Martin Baulig <martin@gnome.org>
22643 * class.cs (Constructor.Define): Set the permission attributes
22644 correctly instead of making all constructors public.
22646 2002-08-28 Martin Baulig <martin@gnome.org>
22648 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
22649 for private members before reporting a CS0103; if we find anything,
22652 2002-08-28 Martin Baulig <martin@gnome.org>
22654 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
22655 to check whether `closure_start_type == closure_invocation_type',
22656 we also need to check whether `m.DeclaringType == closure_invocation_type'
22657 before bypassing the permission checks. We might be accessing
22658 protected/private members from the base class.
22659 (TypeManager.RealMemberLookup): Only set private_ok if private
22660 members were requested via BindingFlags.NonPublic.
22662 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
22664 * expression.cs (MemberAccess.ResolveMemberAccess): Set
22665 MethodGroupExpr.IsExplicitImpl if appropriate.
22666 (Invocation.DoResolve): Don't report the CS0120 for explicit
22667 interface implementations.
22669 2002-08-27 Martin Baulig <martin@gnome.org>
22671 * expression.cs (Invocation.DoResolve): If this is a static
22672 method and we don't have an InstanceExpression, we must report
22675 2002-08-25 Martin Baulig <martin@gnome.org>
22677 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
22678 `==' between a valuetype and an object.
22680 2002-08-25 Miguel de Icaza <miguel@ximian.com>
22682 * ecore.cs (TypeExpr): Provide a ToString method.
22684 2002-08-24 Martin Baulig <martin@gnome.org>
22686 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
22687 now called proggie.dbg and it's a binary file.
22689 2002-08-23 Martin Baulig <martin@gnome.org>
22691 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
22693 2002-08-23 Martin Baulig <martin@gnome.org>
22695 * struct.cs (MyStructInfo.ctor): Make this work with empty
22696 structs; it's not allowed to use foreach() on null.
22698 2002-08-23 Martin Baulig <martin@gnome.org>
22700 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
22701 writer the full pathname of the generated assembly.
22703 2002-08-23 Martin Baulig <martin@gnome.org>
22705 * statements.cs (FlowBranching.UsageVector.MergeChildren):
22706 A `finally' block never returns or breaks; improved handling of
22709 2002-08-23 Martin Baulig <martin@gnome.org>
22711 * statement.cs (Throw.Resolve): Allow `throw null'.
22713 2002-08-23 Martin Baulig <martin@gnome.org>
22715 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
22716 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
22717 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
22718 MemberLookup would return a wrong event if this is an explicit
22719 interface implementation and the class has an event with the same
22722 2002-08-23 Martin Baulig <martin@gnome.org>
22724 * statement.cs (Block.AddChildVariableNames): New public method.
22725 (Block.AddChildVariableName): Likewise.
22726 (Block.IsVariableNameUsedInChildBlock): Likewise.
22727 (Block.AddVariable): Check whether a variable name has already
22728 been used in a child block.
22730 * cs-parser.jay (declare_local_variables): Mark all variable names
22731 from the current block as being used in a child block in the
22734 2002-08-23 Martin Baulig <martin@gnome.org>
22736 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
22737 find the symbol writer.
22739 * driver.cs: csc also allows the arguments to /define being
22740 separated by commas, not only by semicolons.
22742 2002-08-23 Martin Baulig <martin@gnome.org>
22744 * interface.cs (Interface.GetMembers): Added static check for events.
22746 2002-08-15 Martin Baulig <martin@gnome.org>
22748 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
22749 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
22751 * ecore.cs (Expression.MemberLookup): Added documentation and explained
22752 why the MethodData.EmitDestructor() change was necessary.
22754 2002-08-20 Martin Baulig <martin@gnome.org>
22756 * class.cs (TypeContainer.FindMembers): Added static check for events.
22758 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
22760 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
22761 use Type.GetEvents(), not Type.FindMembers().
22763 2002-08-20 Martin Baulig <martin@gnome.org>
22765 * decl.cs (MemberCache): Added a special method cache which will
22766 be used for method-only searched. This ensures that a method
22767 search will return a MethodInfo with the correct ReflectedType for
22770 2002-08-20 Martin Baulig <martin@gnome.org>
22772 * decl.cs (DeclSpace.FindMembers): Made this public.
22774 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22776 * delegate.cs: fixed build on windows.
22777 [FIXME: Filed as bug #29150: MCS must report these errors.]
22779 2002-08-19 Ravi Pratap <ravi@ximian.com>
22781 * ecore.cs (StandardConversionExists): Return a false
22782 if we are trying to convert the void type to anything else
22783 since that is not allowed.
22785 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
22786 we flag error 70 in the event an event is trying to be accessed
22787 directly from outside the declaring type.
22789 2002-08-20 Martin Baulig <martin@gnome.org>
22791 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
22792 MemberCache from typemanager.cs to decl.cs.
22794 2002-08-19 Martin Baulig <martin@gnome.org>
22796 * class.cs (TypeContainer): Implement IMemberContainer.
22797 (TypeContainer.DefineMembers): Create the MemberCache.
22798 (TypeContainer.FindMembers): Do better BindingFlags checking; only
22799 return public members if BindingFlags.Public was given, check
22800 whether members are static.
22802 2002-08-16 Martin Baulig <martin@gnome.org>
22804 * decl.cs (DeclSpace.Define): Splitted this in Define and
22805 DefineMembers. DefineMembers is called first and initializes the
22808 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
22809 DefineMembers() on all our DeclSpaces.
22811 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
22812 but call DefineMembers() on all nested interfaces. We call their
22813 Define() in our new Define() function.
22815 * interface.cs (Interface): Implement IMemberContainer.
22816 (Interface.Define): Moved all code except the attribute stuf to
22818 (Interface.DefineMembers): Initialize the member cache.
22820 * typemanager.cs (IMemberFinder): Removed this interface, we don't
22821 need this anymore since we can use MemberCache.FindMembers directly.
22823 2002-08-19 Martin Baulig <martin@gnome.org>
22825 * typemanager.cs (MemberCache): When creating the cache for an
22826 interface type, add all inherited members.
22827 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
22828 to `out bool used_cache' and documented it.
22829 (TypeManager.MemberLookup): If we already used the cache in the first
22830 iteration, we don't need to do the interfaces check.
22832 2002-08-19 Martin Baulig <martin@gnome.org>
22834 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
22835 here from IMemberFinder and don't implement this interface anymore.
22836 (DeclSpace.MemberCache): Moved here from IMemberFinder.
22838 * typemanager.cs (IMemberFinder): This interface is now only used by
22839 classes which actually support the member cache.
22840 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
22841 since we only put DeclSpaces into this Hashtable.
22842 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
22843 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
22845 2002-08-16 Martin Baulig <martin@gnome.org>
22847 * typemanager.cs (ICachingMemberFinder): Removed.
22848 (IMemberFinder.MemberCache): New property.
22849 (TypeManager.FindMembers): Merged this with RealFindMembers().
22850 This function will never be called from TypeManager.MemberLookup()
22851 so we can't use the cache here, just the IMemberFinder.
22852 (TypeManager.MemberLookup_FindMembers): Check whether the
22853 IMemberFinder has a MemberCache and call the cache's FindMembers
22855 (MemberCache): Rewrote larger parts of this yet another time and
22856 cleaned it up a bit.
22858 2002-08-15 Miguel de Icaza <miguel@ximian.com>
22860 * driver.cs (LoadArgs): Support quoting.
22862 (Usage): Show the CSC-like command line arguments.
22864 Improved a few error messages.
22866 2002-08-15 Martin Baulig <martin@gnome.org>
22868 * typemanager.cs (IMemberContainer.Type): New property.
22869 (IMemberContainer.IsInterface): New property.
22871 The following changes are conditional to BROKEN_RUNTIME, which is
22872 defined at the top of the file.
22874 * typemanager.cs (MemberCache.MemberCache): Don't add the base
22875 class'es members, but add all members from TypeHandle.ObjectType
22876 if we're an interface.
22877 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
22878 is the current type.
22879 (MemberCache.CacheEntry.Container): Removed this field.
22880 (TypeHandle.GetMembers): Include inherited members.
22882 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22884 * typemanager.cs: fixed compilation and added a comment on a field that
22887 2002-08-15 Martin Baulig <martin@gnome.org>
22889 * class.cs (ConstructorInitializer.Resolve): In the
22890 Expression.MemberLookup call, use the queried_type as
22893 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
22894 declared' attribute, it's always true.
22895 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
22896 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
22897 temporary wrapper for FindMembers which tells MemberLookup whether
22898 members from the base classes are included in the return value.
22899 This will go away soon.
22900 (TypeManager.MemberLookup): Use this temporary hack here; once the
22901 new MemberCache is completed, we don't need to do the DeclaredOnly
22902 looping here anymore since the MemberCache will take care of this.
22903 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
22904 (MemberCache): When creating the MemberCache for a class, get
22905 members from the current class and all its base classes.
22906 (MemberCache.CacheEntry.Container): New field. This is a
22907 temporary hack until the Mono runtime is fixed to distinguish
22908 between ReflectedType and DeclaringType. It allows us to use MCS
22909 with both the MS runtime and the unfixed Mono runtime without
22910 problems and without accecting performance.
22911 (MemberCache.SearchMembers): The DeclaredOnly looping from
22912 TypeManager.MemberLookup is now done here.
22914 2002-08-14 Martin Baulig <martin@gnome.org>
22916 * statement.cs (MyStructInfo.MyStructInfo): Don't call
22917 Type.GetFields on dynamic types but get the fields from the
22918 corresponding TypeContainer.
22919 (MyStructInfo.GetStructInfo): Added check for enum types.
22921 * typemanager.cs (MemberList.IsSynchronized): Implemented.
22922 (MemberList.SyncRoot): Implemented.
22923 (TypeManager.FilterWithClosure): No need to check permissions if
22924 closure_start_type == closure_invocation_type, don't crash if
22925 closure_invocation_type is null.
22927 2002-08-13 Martin Baulig <martin@gnome.org>
22929 Rewrote TypeContainer.FindMembers to use a member cache. This
22930 gives us a speed increase of about 35% for the self-hosting MCS
22931 build and of about 15-20% for the class libs (both on GNU/Linux).
22933 * report.cs (Timer): New class to get enhanced profiling. This
22934 whole class is "TIMER" conditional since it remarkably slows down
22937 * class.cs (MemberList): New class. This is an IList wrapper
22938 which we're now using instead of passing MemberInfo[]'s around to
22939 avoid copying this array unnecessarily.
22940 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
22941 (ICachingMemberFinder, IMemberContainer): New interface.
22942 (TypeManager.FilterWithClosure): If `criteria' is null, the name
22943 has already been checked, otherwise use it for the name comparision.
22944 (TypeManager.FindMembers): Renamed to RealMemberFinder and
22945 provided wrapper which tries to use ICachingMemberFinder.FindMembers
22946 if possible. Returns a MemberList, not a MemberInfo [].
22947 (TypeHandle): New class, implements IMemberContainer. We create
22948 one instance of this class per type, it contains a MemberCache
22949 which is used to do the member lookups.
22950 (MemberCache): New class. Each instance of this class contains
22951 all members of a type and a name-based hash table.
22952 (MemberCache.FindMembers): This is our new member lookup
22953 function. First, it looks up all members of the requested name in
22954 the hash table. Then, it walks this list and sorts out all
22955 applicable members and returns them.
22957 2002-08-13 Martin Baulig <martin@gnome.org>
22959 In addition to a nice code cleanup, this gives us a performance
22960 increase of about 1.4% on GNU/Linux - not much, but it's already
22961 half a second for the self-hosting MCS compilation.
22963 * typemanager.cs (IMemberFinder): New interface. It is used by
22964 TypeManager.FindMembers to call FindMembers on a TypeContainer,
22965 Enum, Delegate or Interface.
22966 (TypeManager.finder_to_member_finder): New PtrHashtable.
22967 (TypeManager.finder_to_container): Removed.
22968 (TypeManager.finder_to_delegate): Removed.
22969 (TypeManager.finder_to_interface): Removed.
22970 (TypeManager.finder_to_enum): Removed.
22972 * interface.cs (Interface): Implement IMemberFinder.
22974 * delegate.cs (Delegate): Implement IMemberFinder.
22976 * enum.cs (Enum): Implement IMemberFinder.
22978 * class.cs (TypeContainer): Implement IMemberFinder.
22980 2002-08-12 Martin Baulig <martin@gnome.org>
22982 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
22984 2002-08-12 Martin Baulig <martin@gnome.org>
22986 * ecore.cs (ITypeExpression): New interface for expressions which
22988 (TypeExpression): Renamed to TypeLookupExpression.
22989 (Expression.DoResolve): If we're doing a types-only lookup, the
22990 expression must implement the ITypeExpression interface and we
22991 call DoResolveType() on it.
22992 (SimpleName): Implement the new ITypeExpression interface.
22993 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
22994 hack, the situation that we're only looking up types can't happen
22995 anymore when this method is called. Moved the type lookup code to
22996 DoResolveType() and call it.
22997 (SimpleName.DoResolveType): This ITypeExpression interface method
22998 is now doing the types-only lookup.
22999 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
23000 (ResolveFlags): Added MaskExprClass.
23002 * expression.cs (MemberAccess): Implement the ITypeExpression
23004 (MemberAccess.DoResolve): Added support for a types-only lookup
23005 when we're called via ITypeExpression.DoResolveType().
23006 (ComposedCast): Implement the ITypeExpression interface.
23008 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
23009 Expression.Resolve() with ResolveFlags.Type instead.
23011 2002-08-12 Martin Baulig <martin@gnome.org>
23013 * interface.cs (Interface.Define): Apply attributes.
23015 * attribute.cs (Attribute.ApplyAttributes): Added support for
23016 interface attributes.
23018 2002-08-11 Martin Baulig <martin@gnome.org>
23020 * statement.cs (Block.Emit): Only check the "this" variable if we
23021 do not always throw an exception.
23023 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
23024 whether the property has a set accessor.
23026 2002-08-11 Martin Baulig <martin@gnome.org>
23028 Added control flow analysis support for structs.
23030 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
23031 with control flow analysis turned off.
23032 (IVariable): New interface.
23033 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
23034 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
23035 (FieldExpr.DoResolve): Resolve the instance expression with flow
23036 analysis turned off and do the definite assignment check after the
23037 resolving when we know what the expression will resolve to.
23039 * expression.cs (LocalVariableReference, ParameterReference):
23040 Implement the new IVariable interface, only call the flow analysis
23041 code if ec.DoFlowAnalysis is true.
23042 (This): Added constructor which takes a Block argument. Implement
23043 the new IVariable interface.
23044 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
23045 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
23046 This does the definite assignment checks for struct members.
23048 * class.cs (Constructor.Emit): If this is a non-static `struct'
23049 constructor which doesn't have any initializer, call
23050 Block.AddThisVariable() to tell the flow analysis code that all
23051 struct elements must be initialized before control returns from
23054 * statement.cs (MyStructInfo): New public class.
23055 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
23056 argument to this indexer. If non-zero, check an individual struct
23057 member, not the whole struct.
23058 (FlowBranching.CheckOutParameters): Check struct members.
23059 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
23060 overloaded versions of these methods which take an additional
23061 `int field_idx' argument to check struct members.
23062 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
23063 overloaded versions of these methods which take an additional
23064 `string field_name' argument to check struct member.s
23065 (VariableInfo): Implement the IVariable interface.
23066 (VariableInfo.StructInfo): New public property. Returns the
23067 MyStructInfo instance of the variable if it's a struct or null.
23068 (Block.AddThisVariable): New public method. This is called from
23069 Constructor.Emit() for non-static `struct' constructor which do
23070 not have any initializer. It creates a special variable for the
23071 "this" instance variable which will be checked by the flow
23072 analysis code to ensure that all of the struct's fields are
23073 initialized before control returns from the constructor.
23074 (UsageVector): Added support for struct members. If a
23075 variable/parameter is a struct with N members, we reserve a slot
23076 in the usage vector for each member. A struct is considered fully
23077 initialized if either the struct itself (slot 0) or all its
23078 members are initialized.
23080 2002-08-08 Martin Baulig <martin@gnome.org>
23082 * driver.cs (Driver.MainDriver): Only report an error CS5001
23083 if there were no compilation errors.
23085 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
23086 `UnsafeContext' property to determine whether the parent is in
23087 unsafe context rather than checking the parent's ModFlags:
23088 classes nested in an unsafe class are unsafe as well.
23090 2002-08-08 Martin Baulig <martin@gnome.org>
23092 * statement.cs (UsageVector.MergeChildren): Distinguish between
23093 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
23094 we return. Added test17() and test18() to test-154.cs.
23096 2002-08-08 Martin Baulig <martin@gnome.org>
23098 * typemanager.cs (TypeManager.FilterWithClosure): If we have
23099 Family access, make sure the invoking type isn't a subclass of the
23100 queried type (that'd be a CS1540).
23102 * ecore.cs (Expression.MemberLookup): Added overloaded version of
23103 this method which takes an additional `Type invocation_type'.
23105 * expression.cs (BaseAccess.DoResolve): Use the base type as
23106 invocation and query type.
23107 (MemberAccess.DoResolve): If the lookup failed and we're about to
23108 report a CS0122, try a lookup with the ec.ContainerType - if this
23109 succeeds, we must report a CS1540.
23111 2002-08-08 Martin Baulig <martin@gnome.org>
23113 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
23114 (MethodGroupExpr): Implement the IMemberExpr interface.
23116 * expression (MemberAccess.ResolveMemberAccess): No need to have
23117 any special code for MethodGroupExprs anymore, they're now
23120 2002-08-08 Martin Baulig <martin@gnome.org>
23122 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
23123 Family, FamANDAssem and FamORAssem permissions.
23124 (TypeManager.IsSubclassOrNestedChildOf): New public method.
23126 2002-08-08 Martin Baulig <martin@gnome.org>
23128 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
23129 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
23132 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
23134 * driver.cs: implemented /resource option to embed managed resources.
23136 2002-08-07 Martin Baulig <martin@gnome.org>
23138 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
23139 (FieldBase.HasFieldInitializer): New public property.
23140 (FieldBase.GetInitializerExpression): New public method. Resolves and
23141 returns the field initializer and makes sure it is only resolved once.
23142 (TypeContainer.EmitFieldInitializers): Call
23143 FieldBase.GetInitializerExpression to get the initializer, this ensures
23144 that it isn't resolved multiple times.
23146 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
23147 the resolving process (SimpleName/MemberLookup) that we're currently
23148 emitting a field initializer (which must not access any instance members,
23149 this is an error CS0236).
23151 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
23152 argument, if the `IsFieldInitializer' flag is set, we must report and
23153 error CS0236 and not an error CS0120.
23155 2002-08-07 Martin Baulig <martin@gnome.org>
23157 * ecore.cs (IMemberExpr): New public interface.
23158 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
23159 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
23160 if the expression is an IMemberExpr.
23162 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
23163 to be null, implicitly default to `this' if we're non-static in
23164 this case. Simplified the code a lot by using the new IMemberExpr
23165 interface. Also fixed bug #28176 here.
23167 2002-08-06 Martin Baulig <martin@gnome.org>
23169 * cs-parser.jay (SimpleLookup): Removed. We need to create
23170 ParameterReferences during semantic analysis so that we can do a
23171 type-only search when resolving Cast, TypeOf and SizeOf.
23172 (block): Pass the `current_local_parameters' to the Block's
23175 * class.cs (ConstructorInitializer): Added `Parameters parameters'
23176 argument to the constructor.
23177 (ConstructorInitializer.Resolve): Create a temporary implicit
23178 block with the parameters.
23180 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
23181 references here if we aren't doing a type-only search.
23183 * statement.cs (Block): Added constructor which takes a
23184 `Parameters parameters' argument.
23185 (Block.Parameters): New public property.
23187 * support.cs (InternalParameters.Parameters): Renamed `parameters'
23188 to `Parameters' and made it public readonly.
23190 2002-08-06 Martin Baulig <martin@gnome.org>
23192 * ecore.cs (Expression.Warning): Made this public as well.
23194 * report.cs (Report.Debug): Print the contents of collections.
23196 2002-08-06 Martin Baulig <martin@gnome.org>
23198 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
23199 used to tell Resolve() which kinds of expressions it may return.
23200 (Expression.Resolve): Added overloaded version of this method which
23201 takes a `ResolveFlags flags' argument. This can be used to tell
23202 Resolve() which kinds of expressions it may return. Reports a
23204 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
23205 ResolveFlags.SimpleName.
23206 (Expression.Error118): Added overloaded version of this method which
23207 takes a `ResolveFlags flags' argument. It uses the flags to determine
23208 which kinds of expressions are allowed.
23210 * expression.cs (Argument.ResolveMethodGroup): New public method.
23211 Resolves an argument, but allows a MethodGroup to be returned.
23212 This is used when invoking a delegate.
23214 * TODO: Updated a bit.
23216 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23218 Fixed compilation with csc.
23220 * ecore.cs: Expression.Error made public. Is this correct? Should
23221 Warning be made public too?
23223 * expression.cs: use ea.Location instead of ea.loc.
23224 [FIXME: Filed as bug #28607: MCS must report these errors.]
23226 2002-08-06 Martin Baulig <martin@gnome.org>
23228 * ecore.cs (Expression.loc): Moved the location here instead of
23229 duplicating it in all derived classes.
23230 (Expression.Location): New public property.
23231 (Expression.Error, Expression.Warning): Made them non-static and
23232 removed the location argument.
23233 (Expression.Warning): Added overloaded version which takes an
23234 `int level' argument.
23235 (Expression.Error118): Make this non-static and removed the
23236 expression and location arguments.
23237 (TypeExpr): Added location argument to the constructor.
23239 * expression.cs (StaticCallExpr): Added location argument to
23241 (Indirection, PointerArithmetic): Likewise.
23242 (CheckedExpr, UnCheckedExpr): Likewise.
23243 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
23244 (StringPtr): Likewise.
23247 2002-08-05 Martin Baulig <martin@gnome.org>
23249 * expression.cs (BaseAccess.DoResolve): Actually report errors.
23251 * assign.cs (Assign.DoResolve): Check whether the source
23252 expression is a value or variable.
23254 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
23255 while resolving the corresponding blocks.
23257 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
23258 an error, don't silently return null.
23260 * statement.cs (Block.AddVariable): Do the error reporting here
23261 and distinguish between CS0128 and CS0136.
23262 (Block.DoResolve): Report all unused labels (warning CS0164).
23263 (LabeledStatement): Pass the location to the constructor.
23264 (LabeledStatement.HasBeenReferenced): New property.
23265 (LabeledStatement.Resolve): Set it to true here.
23267 * statement.cs (Return.Emit): Return success even after reporting
23268 a type mismatch error (CS0126 or CS0127), this is what csc does and
23269 it avoids confusing the users with any consecutive errors.
23271 2002-08-05 Martin Baulig <martin@gnome.org>
23273 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
23275 * const.cs (Const.LookupConstantValue): Catch circular definitions.
23277 * expression.cs (MemberAccess.DoResolve): Silently return if an
23278 error has already been reported.
23280 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
23281 error has already been reported.
23283 2002-08-05 Martin Baulig <martin@gnome.org>
23285 * statement.cs (UsageVector): Only initialize the `parameters'
23286 vector if we actually have any "out" parameters.
23288 2002-08-05 Martin Baulig <martin@gnome.org>
23290 * expression.cs (Binary.ResolveOperator): When combining delegates,
23291 they must have the same type.
23293 2002-08-05 Martin Baulig <martin@gnome.org>
23295 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
23296 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
23297 work with the ms runtime and we also don't need it: if we're a
23298 PropertyBuilder and not in the `indexer_arguments' hash, then we
23299 are a property and not an indexer.
23301 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
23302 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
23303 since the latter one doesn't work with the ms runtime.
23305 2002-08-03 Martin Baulig <martin@gnome.org>
23307 Fixed bugs #27998 and #22735.
23309 * class.cs (Method.IsOperator): New public field.
23310 (Method.CheckBase): Report CS0111 if there's already a method
23311 with the same parameters in the current class. Report CS0508 when
23312 attempting to change the return type of an inherited method.
23313 (MethodData.Emit): Report CS0179 if a method doesn't have a body
23314 and it's not marked abstract or extern.
23315 (PropertyBase): New abstract base class for Property and Indexer.
23316 (PropertyBase.CheckBase): Moved here from Property and made it work
23318 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
23319 the same so we can reuse it there.
23320 (Property, Indexer): Derive from PropertyBase.
23321 (MethodSignature.inheritable_property_signature_filter): New delegate
23322 to find properties and indexers.
23324 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
23325 argument and improved error reporting.
23327 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
23328 EmptyReadOnlyParameters and made it a property.
23330 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
23331 version of this method which takes a `PropertyInfo indexer'.
23332 (TypeManager.RegisterIndexer): New method.
23334 * class.cs: Added myself as author of this file :-)
23336 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23338 * class.cs: fixed compilation on windoze.
23340 2002-08-03 Martin Baulig <martin@gnome.org>
23342 * interface.cs (Interface.GetInterfaceBases): Check whether all
23343 base interfaces are at least as accessible than the current one.
23345 * class.cs (TypeContainer.GetClassBases): Check whether base types
23346 are at least as accessible than the current type.
23347 (TypeContainer.AsAccessible): Implemented and made non-static.
23348 (MemberBase.CheckParameters): Report errors if the accessibility
23351 * delegate.cs (Delegate.Delegate): The default visibility is
23352 internal for top-level types and private for nested types.
23353 (Delegate.Define): Report errors if the accessibility checks fail.
23355 * enum.cs (Enum.Enum): The default visibility is internal for
23356 top-level types and private for nested types.
23357 (Enum.DefineType): Compute the correct visibility.
23359 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
23360 function which takes a `bool is_toplevel' instead of a TypeContainer.
23362 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
23365 2002-08-02 Martin Baulig <martin@gnome.org>
23367 * expression.cs (LocalVariableReferenc): Added constructor which
23368 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
23369 (LocalVariableReference.IsReadOnly): New property.
23370 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
23371 variable is readonly, use our own readonly flag to do this; you can
23372 use the new constructor to get a writable reference to a read-only
23375 * cs-parser.jay (foreach_statement, using_statement): Get a writable
23376 reference to the local variable.
23378 2002-08-01 Miguel de Icaza <miguel@ximian.com>
23380 * rootcontext.cs (ResolveCore): Also include System.Exception
23382 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
23383 we reach an EmptyStatement.
23385 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
23388 * expression.cs (Binary.ResolveOperator): Check error result in
23391 use brtrue/brfalse directly and avoid compares to null.
23393 2002-08-02 Martin Baulig <martin@gnome.org>
23395 * class.cs (TypeContainer.Define): Define all nested interfaces here.
23396 Fixes bug #28407, added test-155.cs.
23398 2002-08-01 Martin Baulig <martin@gnome.org>
23400 * class.cs (Event.EmitDefaultMethod): Make this work with static
23401 events. Fixes #28311, added verify-3.cs.
23403 2002-08-01 Martin Baulig <martin@gnome.org>
23405 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
23406 `is_disposable' fields.
23407 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
23408 `hm.is_disposable' if we're using the collection pattern.
23409 (Foreach.EmitCollectionForeach): Use the correct type for the
23410 enumerator's local variable, only emit the try/finally block if
23411 necessary (fixes #27713).
23413 2002-08-01 Martin Baulig <martin@gnome.org>
23415 * ecore.cs (Expression.report118): Renamed to Error118 and made
23418 * statement.cs (Throw.Resolve): Check whether the expression is of
23419 the correct type (CS0118) and whether the type derives from
23420 System.Exception (CS0155).
23421 (Catch.Resolve): New method. Do the type lookup here and check
23422 whether it derives from System.Exception (CS0155).
23423 (Catch.CatchType, Catch.IsGeneral): New public properties.
23425 * typemanager.cs (TypeManager.exception_type): Added.
23427 2002-07-31 Miguel de Icaza <miguel@ximian.com>
23429 * driver.cs: Updated About function.
23431 2002-07-31 Martin Baulig <martin@gnome.org>
23433 Implemented Control Flow Analysis.
23435 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
23436 (EmitContext.CurrentBranching): Added.
23437 (EmitContext.StartFlowBranching): Added.
23438 (EmitContext.EndFlowBranching): Added.
23439 (EmitContext.KillFlowBranching): Added.
23440 (EmitContext.IsVariableAssigned): Added.
23441 (EmitContext.SetVariableAssigned): Added.
23442 (EmitContext.IsParameterAssigned): Added.
23443 (EmitContext.SetParameterAssigned): Added.
23444 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
23445 Added control flow analysis stuff here.
23447 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
23448 resolve the expression as lvalue.
23449 (LocalVariableReference.DoResolve): Check whether the variable has
23450 already been assigned.
23451 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
23452 the parameter as assigned here.
23453 (ParameterReference.DoResolve): Check whether the parameter has already
23455 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
23456 expression as lvalue.
23458 * statement.cs (FlowBranching): New class for the flow analysis code.
23459 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
23460 (LabeledStatement.IsDefined): New public property.
23461 (LabeledStatement.AddUsageVector): New public method to tell flow
23462 analyis that the label may be reached via a forward jump.
23463 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
23465 (VariableInfo.Number): New public field. This is used by flow analysis
23466 to number all locals of a block.
23467 (Block.CountVariables): New public property. This is the number of
23468 local variables in this block (including the locals from all parent
23470 (Block.EmitMeta): Number all the variables.
23472 * statement.cs: Added flow analysis support to all classes.
23474 2002-07-31 Martin Baulig <martin@gnome.org>
23476 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
23477 To get debugging messages, compile mcs with /define:MCS_DEBUG and
23478 then use this argument.
23480 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
23482 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
23483 use this to specify /define options.
23485 2002-07-29 Martin Baulig <martin@gnome.org>
23487 * statement.cs (Fixed): Moved all code that does variable lookups
23488 and resolvings from Emit to Resolve.
23490 * statement.cs (For): Moved all code that does variable lookups
23491 and resolvings from Emit to Resolve.
23493 * statement.cs (Using): Moved all code that does variable lookups
23494 and resolvings from Emit to Resolve.
23496 2002-07-29 Martin Baulig <martin@gnome.org>
23498 * attribute.cs (Attribute.Resolve): Explicitly catch a
23499 System.NullReferenceException when creating the
23500 CustromAttributeBuilder and report a different warning message.
23502 2002-07-29 Martin Baulig <martin@gnome.org>
23504 * support.cs (ParameterData.ParameterName): Added method to
23505 get the name of a parameter.
23507 * typemanager.cs (TypeManager.IsValueType): New public method.
23509 2002-07-29 Martin Baulig <martin@gnome.org>
23511 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
23512 is a flag which specifies that it's either ref or out.
23513 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
23514 the out parameter to `out Parameter.Modifier mod', also set the
23515 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
23517 * support.cs (InternalParameters.ParameterModifier): Distinguish
23518 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23519 Parameter.Modifier.ISBYREF flag if it's either ref or out.
23521 * expression.cs (Argument.GetParameterModifier): Distinguish
23522 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23523 Parameter.Modifier.ISBYREF flag if it's either ref or out.
23525 2002-07-29 Martin Baulig <martin@gnome.org>
23527 * expression.cs (ParameterReference.ParameterReference): Added
23528 `Location loc' argument to the constructor.
23530 * cs-parser.jay: Pass location to ParameterReference.
23532 2002-07-28 Miguel de Icaza <miguel@ximian.com>
23534 * statement.cs (Try): Initialize the location.
23536 * cs-parser.jay: pass location to Try.
23538 * expression.cs (Unary.Reduce): Change the prototype to return
23539 whether a constant fold could be performed or not. The result is
23540 returned in an out parameters. In the case of Indirection and
23541 AddressOf, we want to perform the full tests.
23543 2002-07-26 Miguel de Icaza <miguel@ximian.com>
23545 * statement.cs (Statement.Emit): Flag dead code.
23547 2002-07-27 Andrew Birkett <andy@nobugs.org>
23549 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
23551 2002-07-27 Martin Baulig <martin@gnome.org>
23553 * class.cs (MethodData.Define): Put back call to
23554 TypeManager.AddMethod(), accidentally commented this out.
23556 * report.cs (Debug): New public method to print debugging information,
23557 this is `[Conditional ("DEBUG")]'.
23559 2002-07-26 Martin Baulig <martin@gnome.org>
23561 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
23562 (switch_statement): Push the current_block to the switch_stack and
23563 pop it again when we're done with the switch.
23564 (switch_section): The new block is a child of the current_block.
23565 Fixes bug #24007, added test-152.cs.
23567 2002-07-27 Martin Baulig <martin@gnome.org>
23569 * expression.cs (Invocation.EmitArguments): When calling a varargs
23570 function with only its fixed arguments, we need to pass an empty
23573 2002-07-27 Martin Baulig <martin@gnome.org>
23575 Mono 0.13 has been released.
23577 2002-07-25 Miguel de Icaza <miguel@ximian.com>
23579 * driver.cs: Rename --resource to --linkres, because that is what
23580 we do currently, we dont support --resource yet.
23582 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
23584 2002-07-25 Martin Baulig <martin@gnome.org>
23586 * class.cs (MethodData): New public class. This is a `method builder'
23587 class for a method or one accessor of a Property/Indexer/Event.
23588 (MethodData.GetMethodFlags): Moved here from MemberBase.
23589 (MethodData.ApplyAttributes): Likewise.
23590 (MethodData.ApplyObsoleteAttribute): Likewise.
23591 (MethodData.ApplyConditionalAttribute): Likewise.
23592 (MethodData.ApplyDllImportAttribute): Likewise.
23593 (MethodData.CheckAbstractAndExternal): Likewise.
23594 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
23595 (MethodData.Emit): Formerly known as Method.Emit().
23596 (MemberBase): Moved everything which was specific to a single
23597 accessor/method to MethodData.
23598 (Method): Create a new MethodData and call Define() and Emit() on it.
23599 (Property, Indexer, Event): Create a new MethodData objects for each
23600 accessor and call Define() and Emit() on them.
23602 2002-07-25 Martin Baulig <martin@gnome.org>
23604 Made MethodCore derive from MemberBase to reuse the code from there.
23605 MemberBase now also checks for attributes.
23607 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
23608 (MemberBase.GetMethodFlags): Moved here from class Method and marked
23610 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
23611 `CallingConventions cc' and `Attributes opt_attrs' arguments.
23612 (MemberBase.ApplyAttributes): New virtual method; applies the
23613 attributes to a method or accessor.
23614 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
23615 (MemberBase.ApplyConditionalAttribute): Likewise.
23616 (MemberBase.ApplyDllImportAttribute): Likewise.
23617 (MemberBase.CheckAbstractAndExternal): Likewise.
23618 (MethodCore.ParameterTypes): This is now a property instead of a
23619 method, it's initialized from DoDefineParameters().
23620 (MethodCore.ParameterInfo): Removed the set accessor.
23621 (MethodCore.DoDefineParameters): New protected virtual method to
23622 initialize ParameterTypes and ParameterInfo.
23623 (Method.GetReturnType): We can now simply return the MemberType.
23624 (Method.GetMethodFlags): Override the MemberBase version and add
23625 the conditional flags.
23626 (Method.CheckBase): Moved some code from Define() here, call
23627 DoDefineParameters() here.
23628 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
23629 here to avoid some larger code duplication.
23630 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
23631 ensure that abstract and external accessors don't declare a body.
23633 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
23634 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
23635 lookup in the attribute's parent classes, so we need to abort as soon
23636 as we found the first match.
23637 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
23638 the attribute has no arguments.
23640 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
23643 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23645 * cs-parser.jay: reverted previous patch.
23647 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23649 * cs-parser.jay: fixed bug #22119.
23651 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23653 * attribute.cs: fixed compilation. The error was:
23654 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
23655 be assigned to before control leaves the current method."
23656 [FIXME: Filed as bug #28186: MCS must report this error.]
23658 2002-07-25 Martin Baulig <martin@gnome.org>
23660 * attribute.cs (Attribute.Conditional_GetConditionName): New static
23661 method to pull the condition name ouf of a Conditional attribute.
23662 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
23663 the obsolete message and error flag out of an Obsolete attribute.
23665 * class.cs (Method.GetMethodFlags): New public method to get the
23666 TypeManager.MethodFlags for this method.
23667 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
23669 (Method.Define): Get and apply the Obsolete and Conditional attributes;
23670 if we're overriding a virtual function, set the new private variable
23671 `parent_method'; call the new TypeManager.AddMethod().
23673 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
23674 the MethodBuilder and the Method in a PtrHashtable.
23675 (TypeManager.builder_to_method): Added for this purpose.
23676 (TypeManager.MethodFlags): Added IsObsoleteError.
23677 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
23678 Obsolete and Conditional arguments in MethodBuilders. If we discover
23679 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
23680 the message from the attribute.
23682 2002-07-24 Martin Baulig <martin@gnome.org>
23684 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
23685 preprocessor directives, ensure that the argument to #define/#undef is
23686 exactly one identifier and that it's actually an identifier.
23688 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
23691 2002-07-24 Martin Baulig <martin@gnome.org>
23693 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
23694 initialize it to TypeManager.object_type in the constructor.
23695 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
23696 of the `hm.get_current' method if we're using the collection pattern.
23697 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
23698 for the explicit conversion to make it work when we're using the collection
23699 pattern and the `Current' property has a different return type than `object'.
23702 2002-07-24 Martin Baulig <martin@gnome.org>
23704 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
23705 does not match, but don't report any errors. This method is called in
23706 order for all methods in a MethodGroupExpr until a matching method is
23707 found, so we don't want to bail out if the first method doesn't match.
23708 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
23709 matches, report the 123. Fixes #28070.
23711 2002-07-24 Martin Baulig <martin@gnome.org>
23713 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
23714 TypeManager.TypeToCoreType() to the top of the method so the
23715 following equality checks will work. Fixes #28107.
23717 2002-07-24 Martin Baulig <martin@gnome.org>
23719 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
23720 operand is of type uint, and the other operand is of type sbyte,
23721 short or int, the operands are converted to type long." -
23722 Actually do what this comment already told us. Fixes bug #28106,
23725 2002-07-24 Martin Baulig <martin@gnome.org>
23727 * class.cs (MethodBase): New abstract class. This is now a base
23728 class for Property, Indexer and Event to avoid some code duplication
23729 in their Define() and DefineMethods() methods.
23730 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
23731 generic methods for Define() and DefineMethods().
23732 (FieldBase): Derive from MemberBase, not MemberCore.
23733 (Property): Derive from MemberBase, not MemberCore.
23734 (Property.DefineMethod): Moved all the code from this method to the
23735 new MethodBase.DefineAccessor(), just call it with appropriate
23737 (Property.Define): Call the new Property.DoDefine(), this does some
23738 sanity checks and we don't need to duplicate the code everywhere.
23739 (Event): Derive from MemberBase, not MemberCore.
23740 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
23741 accessors, this will also make them work with interface events.
23742 (Indexer): Derive from MemberBase, not MemberCore.
23743 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
23744 (Indexer.Define): Use the new MethodBase functions.
23746 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
23747 argument to the constructor.
23748 (Interface.FindMembers): Added support for interface events.
23749 (Interface.PopluateEvent): Implemented.
23751 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
23753 2002-07-22 Miguel de Icaza <miguel@ximian.com>
23755 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
23756 but this is required to check for a method name being the same as
23757 the containing class.
23761 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23763 * interface.cs: initialize variable.
23765 2002-07-23 Martin Baulig <martin@gnome.org>
23767 Implemented the IndexerName attribute in interfaces.
23769 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
23770 name if this is an explicit interface implementation.
23771 (Indexer.InterfaceIndexerName): New public variable. If we're
23772 implementing an interface indexer, this is the IndexerName in that
23773 interface. Otherwise, it's the IndexerName.
23774 (Indexer.DefineMethod): If we're implementing interface indexer,
23775 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
23776 and Pending.ImplementIndexer methods.
23777 (Indexer.Define): Also define the PropertyBuilder if we're
23778 implementing an interface indexer and this is neither an explicit
23779 interface implementation nor do the IndexerName match the one in
23782 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
23783 If a method is defined here, then we always need to create a proxy
23784 for it. This is used when implementing interface indexers.
23785 (Pending.IsInterfaceIndexer): New public method.
23786 (Pending.ImplementIndexer): New public method.
23787 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
23788 This is used when implementing interface indexers to define a proxy
23790 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
23791 define a proxy if necessary.
23793 * interface.cs (Interface.IndexerName): New public variable.
23794 (Interface.PopulateIndexer): Set the IndexerName.
23795 (Interface.DefineIndexers): New private method. Populate all the
23796 indexers and make sure their IndexerNames match.
23798 * typemanager.cs (IndexerPropertyName): Added support for interface
23801 2002-07-22 Martin Baulig <martin@gnome.org>
23803 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
23804 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
23805 ret if HasReturnLabel.
23806 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
23809 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
23810 and set the ec.LoopBeginTryCatchLevel.
23811 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
23812 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
23813 the current ec.TryCatchLevel, the branch goes out of an exception
23814 block. In this case, we need to use Leave and not Br.
23816 2002-07-22 Martin Baulig <martin@gnome.org>
23818 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
23819 block unless the block does not always return or it is contained in
23820 another try { ... } catch { ... } block. Fixes bug #26506.
23821 Added verify-1.cs to the test suite.
23823 2002-07-22 Martin Baulig <martin@gnome.org>
23825 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
23826 then we do not always return. Fixes bug #24985.
23828 2002-07-22 Martin Baulig <martin@gnome.org>
23830 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
23831 lookup on a per-class level; ie. walk up the class hierarchy until we
23832 found at least one applicable method, then choose the best among them.
23833 Fixes bug #24463 and test-29.cs.
23835 2002-07-22 Martin Baulig <martin@gnome.org>
23837 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
23838 return types of the methods. The return type is not part of the
23839 signature and we must not check it to make the `new' modifier work.
23840 Fixes bug #27999, also added test-147.cs.
23841 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
23843 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
23844 on the method's return type.
23846 2002-07-21 Martin Baulig <martin@gnome.org>
23848 * assign.cs: Make this work if the rightmost source is a constant and
23849 we need to do an implicit type conversion. Also adding a few more tests
23850 to test-38.cs which should have caught this.
23852 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
23853 target in the makefile for this. The makefile.gnu is primarily intended
23854 for end-users who don't want to debug the compiler.
23856 2002-07-21 Martin Baulig <martin@gnome.org>
23858 * assign.cs: Improved the Assign class so it can now handle embedded
23859 assignments (X = Y = Z = something). As a side-effect this'll now also
23860 consume less local variables. test-38.cs now passes with MCS, added
23861 a few new test cases to that test.
23863 2002-07-20 Martin Baulig <martin@gnome.org>
23865 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
23866 instructions. Fixes bug #27977, also added test-146.cs.
23868 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23870 * cs-tokenizer.cs: fixed getHex ().
23872 2002-07-19 Martin Baulig <martin@gnome.org>
23874 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
23875 not Type.GetType() to lookup the array type. This is needed when
23876 we're constructing an array of a user-defined type.
23877 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
23878 single-dimensional arrays, but also for single-dimensial arrays of
23881 2002-07-19 Martin Baulig <martin@gnome.org>
23883 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
23884 this function is called, it's not allowed to share LocalBuilders
23885 among ILGenerators.
23887 2002-07-19 Martin Baulig <martin@gnome.org>
23889 * expression.cs (Argument.Resolve): Report an error 118 when trying
23890 to pass a type as argument.
23892 2002-07-18 Martin Baulig <martin@gnome.org>
23894 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
23895 Conv_R_Un for the signed `long' type.
23897 2002-07-15 Miguel de Icaza <miguel@ximian.com>
23899 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
23900 `expr' for the temporary result, as that will fail if we do
23901 multiple resolves on the same expression.
23903 2002-07-05 Miguel de Icaza <miguel@ximian.com>
23905 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
23906 ec.TypeContainer for looking up aliases.
23908 * class.cs (TypeContainer): Remove LookupAlias from here.
23910 * decl.cs (DeclSpace); Move here.
23912 2002-07-01 Miguel de Icaza <miguel@ximian.com>
23914 * class.cs (FindMembers): Only call filter if the constructor
23915 bulider is not null.
23917 Also handle delegates in `NestedTypes' now. Now we will perform
23918 type lookups using the standard resolution process. This also
23921 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
23922 This uses Expressions (the limited kind that can be parsed by the
23923 tree) instead of strings.
23925 * expression.cs (ComposedCast.ToString): Implement, used to flag
23926 errors since now we have to render expressions.
23928 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
23931 * ecore.cs (SimpleName.ToString): ditto.
23933 * cs-parser.jay: Instead of using strings to assemble types, use
23934 Expressions to assemble the type (using SimpleName, ComposedCast,
23935 MemberAccess). This should fix the type lookups in declarations,
23936 because we were using a different code path for this.
23938 * statement.cs (Block.Resolve): Continue processing statements
23939 even when there is an error.
23941 2002-07-17 Miguel de Icaza <miguel@ximian.com>
23943 * class.cs (Event.Define): Also remove the `remove' method from
23944 the list of pending items.
23946 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
23947 generate more compact code.
23949 2002-07-17 Martin Baulig <martin@gnome.org>
23951 * const.cs (Const.LookupConstantValue): Add support for constant
23952 `unchecked' and `checked' expressions.
23953 Also adding test case test-140.cs for this.
23955 2002-07-17 Martin Baulig <martin@gnome.org>
23957 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
23958 check whether mi.ReturnType implements the IEnumerator interface; the
23959 `==' and the IsAssignableFrom() will fail in this situation.
23961 2002-07-16 Ravi Pratap <ravi@ximian.com>
23963 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
23966 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23968 * expression.cs: fixed bug #27811.
23970 2002-07-14 Miguel de Icaza <miguel@ximian.com>
23972 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
23973 Molaro: when we are a ref, the value already contains a pointer
23974 value, do not take the address of it.
23976 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23977 * removed mb-parser.jay and mb-tokenizer.cs
23979 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23981 * expression.cs: check against the building corlib void type.
23983 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
23985 * ecore.cs: fix for valuetype static readonly fields: when
23986 initializing them, we need their address, not the address of a copy.
23988 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23990 * typemanager.cs: register also enum_type in corlib.
23992 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23994 * class.cs: allow calling this (but not base) initializers in structs.
23996 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
23998 * ecore.cs: make sure we compare against the building base types
24001 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
24003 * typemanager.cs: fix TypeToCoreType() to handle void and object
24004 (corlib gets no more typerefs after this change).
24006 2002-07-12 Miguel de Icaza <miguel@ximian.com>
24008 * expression.cs (ArrayCreation.EmitArrayArguments): use
24009 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
24011 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
24012 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
24013 array indexes, the runtime actually forbids them.
24015 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
24016 for array arguments here.
24018 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
24019 instead of the default for ValueTypes.
24021 (New.DoEmit): Use IsValueType instead of
24022 IsSubclassOf (value_type)
24023 (New.DoResolve): ditto.
24024 (Invocation.EmitCall): ditto.
24026 * assign.cs (Assign): ditto.
24028 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
24029 Statements *are* currently doing part of their resolution during
24032 Expressions do always resolve during resolve, but statements are
24033 only required to propagate resolution to their children.
24035 2002-07-11 Miguel de Icaza <miguel@ximian.com>
24037 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
24039 (LoadAssembly): Do not add the dll if it is already specified
24041 (MainDriver): Add the System directory to the link path at the end,
24042 after all the other -L arguments.
24044 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
24045 wrong opcode for loading bytes and bools (ldelem.i1 instead of
24046 ldelem.u1) and using the opposite for sbytes.
24048 This fixes Digger, and we can finally run it.
24050 * driver.cs (UnixParseOption): Move the option parsing here.
24051 (CSCParseOption): Implement CSC-like parsing of options.
24053 We now support both modes of operation, the old Unix way, and the
24054 new CSC-like way. This should help those who wanted to make cross
24055 platform makefiles.
24057 The only thing broken is that /r:, /reference: and /lib: are not
24058 implemented, because I want to make those have the same semantics
24059 as the CSC compiler has, and kill once and for all the confussion
24060 around this. Will be doing this tomorrow.
24062 * statement.cs (Unsafe.Resolve): The state is checked during
24063 resolve, not emit, so we have to set the flags for IsUnsfe here.
24065 2002-07-10 Miguel de Icaza <miguel@ximian.com>
24067 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
24068 not catch the Error_ObjectRefRequired in SimpleName (as it is
24069 possible to have a class/instance variable name that later gets
24070 deambiguated), we have to check this here.
24072 2002-07-10 Ravi Pratap <ravi@ximian.com>
24074 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
24075 make static and put into Expression.
24077 (Event.Define): Register the private field of the event with the
24078 TypeManager so that GetFieldFromEvent can get at it.
24080 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
24081 keep track of the private field associated with an event which
24084 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
24087 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
24089 2002-07-10 Miguel de Icaza <miguel@ximian.com>
24091 * expression.cs (Binary.EmitBranchable): this routine emits the
24092 Binary expression in a branchable context. This basically means:
24093 we need to branch somewhere, not just get the value on the stack.
24095 This works together with Statement.EmitBoolExpression.
24097 * statement.cs (Statement.EmitBoolExpression): Use
24100 2002-07-09 Miguel de Icaza <miguel@ximian.com>
24102 * statement.cs (For): Reduce the number of jumps in loops.
24104 (For): Implement loop inversion for the For statement.
24106 (Break): We can be breaking out of a Try/Catch controlled section
24107 (foreach might have an implicit try/catch clause), so we need to
24108 use Leave instead of Br.
24110 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
24111 now). If the instace expression supports IMemoryLocation, we use
24112 the AddressOf method from the IMemoryLocation to extract the
24113 address instead of emitting the instance.
24115 This showed up with `This', as we were emitting the instance
24116 always (Emit) instead of the Address of This. Particularly
24117 interesting when This is a value type, as we dont want the Emit
24118 effect (which was to load the object).
24120 2002-07-08 Miguel de Icaza <miguel@ximian.com>
24122 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
24124 * statement.cs (Checked): Set the CheckedState during the resolve
24125 process too, as the ConvCast operations track the checked state on
24126 the resolve process, and not emit.
24128 * cs-parser.jay (namespace_member_declaration): Flag that we have
24129 found a declaration when we do. This is used to flag error 1529
24131 * driver.cs: Report ok when we display the help only.
24133 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
24135 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
24137 2002-07-04 Miguel de Icaza <miguel@ximian.com>
24139 * cs-tokenizer.cs (define): We also have to track locally the
24140 defines. AllDefines is just used for the Conditional Attribute,
24141 but we also need the local defines for the current source code.
24143 2002-07-03 Miguel de Icaza <miguel@ximian.com>
24145 * statement.cs (While, For, Do): These loops can exit through a
24146 Break statement, use this information to tell whether the
24147 statement is the last piece of code.
24149 (Break): Flag that we break.
24151 * codegen.cs (EmitContexts): New `Breaks' state variable.
24153 2002-07-03 Martin Baulig <martin@gnome.org>
24155 * class.cs (TypeContainer.MethodModifiersValid): Allow override
24156 modifiers in method declarations in structs. Otherwise, you won't
24157 be able to override things like Object.Equals().
24159 2002-07-02 Miguel de Icaza <miguel@ximian.com>
24161 * class.cs (Method, Property, Indexer): Do not allow the public
24162 modifier to be used in explicit interface implementations.
24164 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
24165 override modifiers in method declarations in structs
24167 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
24169 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
24170 integer or real overflow, report an error
24172 2002-07-02 Martin Baulig <martin@gnome.org>
24174 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
24175 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
24176 to tell the runtime about our newly created System.Object and
24177 System.ValueType types.
24179 2002-07-02 Miguel de Icaza <miguel@ximian.com>
24181 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
24182 struct instead of Ldarg/Starg.
24184 2002-07-02 Martin Baulig <martin@gnome.org>
24186 * expression.cs (Indirection.Indirection): Call
24187 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
24189 2002-07-02 Martin Baulig <martin@gnome.org>
24191 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
24192 ValueType, call TypeManager.TypeToCoreType() on it.
24193 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
24194 the OpCodes.Newarr argument.
24196 2002-07-02 Martin Baulig <martin@gnome.org>
24198 * expression.cs (Invocation.EmitCall): When compiling corlib,
24199 replace all calls to the system's System.Array type to calls to
24200 the newly created one.
24202 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
24203 System.Array methods.
24204 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
24205 from the system's System.Array type which must be replaced.
24207 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
24209 * typemanager.cs: load unverifiable_code_ctor so we can build
24210 corlib using the correct type. Avoid using GetTypeCode() with
24212 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
24213 TypeManager.object_type to allow building corlib.
24215 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24217 * ecore.cs: handle System.Enum separately in LoadFromPtr().
24219 2002-07-01 Martin Baulig <martin@gnome.org>
24221 * class.cs: Make the last change actually work, we need to check
24222 whether `ifaces != null' to avoid a crash.
24224 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24226 * class.cs: when we build structs without fields that implement
24227 interfaces, we need to add the interfaces separately, since there is
24228 no API to both set the size and add the interfaces at type creation
24231 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24233 * expression.cs: the dimension arguments to the array constructors
24234 need to be converted if they are a long.
24236 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24238 * class.cs: don't emit ldarg.0 if there is no parent constructor
24239 (fixes showstopper for corlib).
24241 2002-06-29 Martin Baulig <martin@gnome.org>
24243 MCS now compiles corlib on GNU/Linux :-)
24245 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
24246 ie. check for MethodImplOptions.InternalCall.
24248 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
24249 and TypeManager.attribute_type are null, so we must explicitly check
24250 whether parent is not null to find out whether it's an attribute type.
24251 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
24252 and SetBuilder, not only if the property is neither abstract nor external.
24253 This is necessary to set the MethodImplOptions on the accessor methods.
24254 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
24255 SetBuilder, see Property.Emit().
24257 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
24258 populate "System.Object", "System.ValueType" and "System.Attribute" since
24259 they've already been populated from BootCorlib_PopulateCoreTypes().
24261 2002-06-29 Martin Baulig <martin@gnome.org>
24263 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
24264 is the NullLiteral, we also need to make sure that target_type is not
24267 2002-06-29 Martin Baulig <martin@gnome.org>
24269 * rootcontext.cs (RootContext.ResolveCore): We must initialize
24270 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
24271 before calling BootstrapCorlib_ResolveDelegate ().
24273 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24275 * statement.cs: fixed build-breaker. All tests passed ok.
24277 2002-06-27 Martin Baulig <martin@gnome.org>
24279 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
24280 for System.Decimal when compiling corlib.
24282 2002-06-27 Martin Baulig <martin@gnome.org>
24284 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
24285 switch blocks which contain nothing but a default clause.
24287 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
24289 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
24291 2002-06-27 Martin Baulig <martin@gnome.org>
24293 * ecore.cs (PropertyExpr.PropertyExpr): Call
24294 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
24296 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
24297 is already a TypeBuilder.
24299 2002-06-27 Martin Baulig <martin@gnome.org>
24301 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
24302 `target_type == TypeManager.array_type', not IsAssignableFrom() in
24303 the "from an array-type to System.Array" case. This makes it work
24304 when compiling corlib.
24306 2002-06-27 Martin Baulig <martin@gnome.org>
24308 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
24309 non-static PropertyExpr, set its InstanceExpression. This makes
24310 the `ICollection.Count' property work in System/Array.cs.
24312 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
24314 * driver.cs: Made error handling more consistent. Errors now
24315 tracked by Report class, so many methods which used to return int
24316 now return void. Main() now prints success/failure and
24317 errors/warnings message.
24319 Renamed '--probe' compiler argument to '--expect-error'. Removed
24320 the magic number return values (123 and 124). Now, if the
24321 expected error occurs, the compiler exits with success (exit value
24322 0). If the compilation completes without seeing that particular
24323 error, the compiler exits with failure (exit value 1). The
24324 makefile in mcs/errors has been changed to handle the new behaviour.
24326 * report.cs: Made 'expected error' number a property and renamed
24327 it from 'Probe' to 'ExpectedError'.
24329 * genericparser.cs: Removed error handling support, since it is
24330 now all done by Report class.
24332 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
24333 class, so parse() no longer returns an int.
24335 * namespace.cs: Use Report.Error instead of GenericParser.error
24337 2002-06-22 Miguel de Icaza <miguel@ximian.com>
24339 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
24340 TypeContainer.AddOperator): At the front of the list put the
24341 explicit implementations, so they get resolved/defined first.
24343 2002-06-21 Miguel de Icaza <miguel@ximian.com>
24345 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
24346 interface type is implemented by this TypeContainer. Used during
24347 explicit interface implementation.
24349 (Property.Define, Indexer.Define, Method.Define): Validate that
24350 the given interface in the explicit implementation is one of the
24351 base classes for the containing type.
24353 Also if we are explicitly implementing an interface, but there is
24354 no match in the pending implementation table, report an error.
24356 (Property.Define): Only define the property if we are
24357 not explicitly implementing a property from an interface. Use the
24358 correct name also for those properties (the same CSC uses,
24359 although that is really not needed).
24361 (Property.Emit): Do not emit attributes for explicitly implemented
24362 properties, as there is no TypeBuilder.
24364 (Indexer.Emit): ditto.
24366 Hiding then means that we do not really *implement* a pending
24367 implementation, which makes code fail.
24369 2002-06-22 Martin Baulig <martin@gnome.org>
24371 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
24372 the return value of Object.GetType(). [FIXME: we need to do this whenever
24373 we get a type back from the reflection library].
24375 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24377 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
24379 2002-06-20 Miguel de Icaza <miguel@ximian.com>
24381 * attribute.cs: Return null if we can not look up the type.
24383 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
24384 the interface types found.
24386 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
24387 interface types found.
24389 * typemanager.cs (GetInterfaces): Make this routine returns alll
24390 the interfaces and work around the lame differences between
24391 System.Type and System.Reflection.Emit.TypeBuilder in the results
24392 result for GetInterfaces.
24394 (ExpandInterfaces): Given an array of interface types, expand and
24395 eliminate repeated ocurrences of an interface. This expands in
24396 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
24399 2002-06-21 Martin Baulig <martin@gnome.org>
24401 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
24404 2002-06-21 Martin Baulig <martin@gnome.org>
24406 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
24407 and called with one of the core types, return the corresponding typebuilder for
24410 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
24413 2002-06-21 Martin Baulig <martin@gnome.org>
24415 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
24416 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
24417 (Expression.ConvertReferenceExplicit): Likewise.
24419 * expression.cs (ElementAccess.DoResolve): Likewise.
24420 (ElementAccess.DoResolveLValue): Likewise.
24422 2002-06-10 Martin Baulig <martin@gnome.org>
24424 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
24425 add the "value" parameter to the parameter list.
24427 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
24430 2002-06-19 Miguel de Icaza <miguel@ximian.com>
24432 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
24433 the argument to an int, uint, long or ulong, per the spec. Also
24434 catch negative constants in array creation.
24436 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24438 * class.cs: do not allow the same interface to appear twice in
24439 the definition list.
24441 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24443 * ecore.cs: don't use ldlen with System.Array.
24445 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
24447 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
24449 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
24451 * modifiers.cs: produce correct field attributes for protected
24452 internal. Easy fix so miguel can work on ther harder stuff:-)
24454 2002-06-18 Miguel de Icaza <miguel@ximian.com>
24456 * pending.cs: New file. Move the code from class.cs here.
24457 Support clearning the pending flag for all methods (when not doing
24458 explicit interface implementation).
24460 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
24462 * rootcontext.cs: added a couple more types needed to bootstrap.
24464 2002-06-17 Miguel de Icaza <miguel@ximian.com>
24466 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
24467 constructor in the type, instead of any constructor in the type
24468 hierarchy. Thanks to Paolo for finding this bug (it showed up as
24469 a bug in the Mono runtime when applying the params attribute).
24471 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24472 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
24474 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
24476 * expression.cs (Unary.ResolveOperator): Use TypeManager
24477 to resolve the type.
24479 2002-06-13 Ravi Pratap <ravi@ximian.com>
24481 * cs-parser.jay (enum_member_declaration): Pass in the attributes
24484 * enum.cs (AddEnumMember): Add support to store the attributes associated
24485 with each member too.
24487 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
24488 field builders too - this takes care of the enum member case.
24490 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
24492 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
24493 address-of operator on both value types and pointers.
24495 2002-06-10 Martin Baulig <martin@gnome.org>
24497 * interface.cs (Interface.PopulateIndexer): Add the indexer's
24498 PropertyBuilder to the `property_builders' list.
24500 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
24501 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
24502 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
24503 find any indexers which are inherited from an interface.
24505 2002-06-09 Martin Baulig <martin@gnome.org>
24507 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
24508 the same type as the constant if necessary. There's also a test-130.cs
24511 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
24513 * typemanager.cs (TypeManager.ChangeType): Previously known as
24514 Enum.ChangeEnumType().
24516 2002-06-09 Martin Baulig <martin@gnome.org>
24518 * expression.cs (Cast.TryReduce): Added support for consts.
24520 2002-06-08 Ravi Pratap <ravi@ximian.com>
24522 * class.cs (Accessor): Hold attributes information so we can pass
24525 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
24526 Modify to pass in attributes attached to the methods.
24528 (add_accessor_declaration, remove_accessor_declaration): Ditto.
24530 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
24531 to handle the Accessor kind :-)
24533 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
24535 2002-06-08 Martin Baulig <martin@gnome.org>
24537 * expression.cs (Unary.TryReduceNegative): Added support for
24540 2002-06-08 Martin Baulig <martin@gnome.org>
24542 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
24543 name can't be found in the `defined_names' - the caller will do a
24544 MemberLookup in this case and thus find methods in System.Enum
24545 such as Enum.IsDefined().
24547 2002-06-08 Martin Baulig <martin@gnome.org>
24549 * enum.cs (Enum.ChangeEnumType): This is a custom version of
24550 Convert.ChangeType() which works with TypeBuilder created types.
24551 (Enum.LookupEnumValue, Enum.Define): Use it here.
24553 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
24554 `TypeBuilder.BaseType != null' check.
24555 (TypeContainer.FindMembers): Only lookup parent members if we
24556 actually have a parent.
24557 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
24558 (ConstructorInitializer.Resolve): Likewise.
24560 * interface.cs (Interface.FindMembers): Added
24561 `TypeBuilder.BaseType != null' check.
24563 * rootcontext.cs (RootContext.ResolveCore): Added
24564 "System.Runtime.CompilerServices.IndexerNameAttribute" to
24565 classes_second_stage.
24567 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
24568 debug_type and trace_type when compiling with --nostdlib.
24570 2002-06-07 Martin Baulig <martin@gnome.org>
24572 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
24573 (AddField): Set it to true when adding a non-static field.
24574 (DefineType): Use `have_nonstatic_fields' to find out whether we
24575 have non-static fields, not `Fields != null'.
24577 2002-06-02 Miguel de Icaza <miguel@ximian.com>
24579 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
24580 dereferencing a null on the static-field code path)
24582 2002-05-30 Martin Baulig <martin@gnome.org>
24584 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
24585 to take command line arguments. Use reflection to call the new
24586 custom `Initialize' function on the symbol writer and pass it the
24587 command line arguments.
24589 * driver.cs (--debug-args): New command line argument to pass command
24590 line arguments to the symbol writer.
24592 2002-05-28 Miguel de Icaza <miguel@ximian.com>
24594 * assign.cs (DoResolve): Forgot to do the implicit conversion to
24595 the target type for indexers and properties. Thanks to Joe for
24598 2002-05-27 Miguel de Icaza <miguel@ximian.com>
24600 * typemanager.cs (MethodFlags): returns the method flags
24601 (Obsolete/ShouldIgnore) that control warning emission and whether
24602 the invocation should be made, or ignored.
24604 * expression.cs (Invocation.Emit): Remove previous hack, we should
24605 not do this on matching a base type, we should do this based on an attribute
24607 Only emit calls to System.Diagnostics.Debug and
24608 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
24609 on the command line.
24611 * rootcontext.cs: Global settings for tracing and debugging.
24613 * cs-tokenizer.cs (define): New utility function to track
24614 defines. Set the global settings for TRACE and DEBUG if found.
24616 2002-05-25 Ravi Pratap <ravi@ximian.com>
24618 * interface.cs (Populate*): Pass in the TypeContainer as well as
24619 the DeclSpace as parameters so that we can create EmitContexts and
24620 then use that to apply attributes etc.
24622 (PopulateMethod, PopulateEvent, PopulateProperty)
24623 (PopulateIndexer): Apply attributes everywhere.
24625 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
24628 (ApplyAttributes): Update accordingly.
24630 We now apply interface attributes for all members too.
24632 2002-05-26 Miguel de Icaza <miguel@ximian.com>
24634 * class.cs (Indexer.Define); Correctly check if we are explicit
24635 implementation (instead of checking the Name for a ".", we
24636 directly look up if the InterfaceType was specified).
24638 Delay the creation of the PropertyBuilder.
24640 Only create the PropertyBuilder if we are not an explicit
24641 interface implementation. This means that explicit interface
24642 implementation members do not participate in regular function
24643 lookups, and hence fixes another major ambiguity problem in
24644 overload resolution (that was the visible effect).
24646 (DefineMethod): Return whether we are doing an interface
24649 * typemanager.cs: Temporary hack until we get attributes in
24650 interfaces (Ravi is working on that) and we get IndexerName
24651 support in interfaces.
24653 * interface.cs: Register the indexers as properties.
24655 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
24656 warning, I have verified that this is a bug in the .NET runtime
24657 (JavaScript suffers of the same problem).
24659 * typemanager.cs (MemberLookup): When looking up members for
24660 interfaces, the parent of an interface is the implicit
24661 System.Object (so we succeed in searches of Object methods in an
24662 interface method invocation. Example: IEnumerable x; x.ToString
24665 2002-05-25 Miguel de Icaza <miguel@ximian.com>
24667 * class.cs (Event): Events should also register if they do
24668 implement the methods that an interface requires.
24670 * typemanager.cs (MemberLookup); use the new GetInterfaces
24673 (GetInterfaces): The code used to lookup interfaces for a type is
24674 used in more than one place, factor it here.
24676 * driver.cs: Track the errors at the bottom of the file, we kept
24679 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
24680 instance if the method we are calling is static!
24682 2002-05-24 Miguel de Icaza <miguel@ximian.com>
24684 * attribute.cs (ApplyAttributes): Make this function filter out
24685 the IndexerName attribute (as that attribute in reality is never
24686 applied) and return the string constant for the IndexerName
24689 * class.cs (TypeContainer.Emit): Validate that all the indexers
24690 have the same IndexerName attribute, and if so, set the
24691 DefaultName attribute on the class.
24693 * typemanager.cs: The return value might contain other stuff (not
24694 only methods). For instance, consider a method with an "Item"
24695 property and an Item method.
24697 * class.cs: If there is a problem with the parameter types,
24700 2002-05-24 Ravi Pratap <ravi@ximian.com>
24702 * ecore.cs (ImplicitConversionExists): Wrapper function which also
24703 looks at user defined conversion after making a call to
24704 StandardConversionExists - we need this for overload resolution.
24706 * expression.cs : Update accordingly the various method calls.
24708 This fixes 2 bugs filed against implicit user defined conversions
24710 2002-05-22 Miguel de Icaza <miguel@ximian.com>
24712 * statement.cs: Track the result of the assignment.
24714 2002-05-21 Miguel de Icaza <miguel@ximian.com>
24716 * expression.cs (MemberAccess): Improved error reporting for
24717 inaccessible members.
24719 2002-05-22 Martin Baulig <martin@gnome.org>
24721 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
24722 itself with debugging support.
24724 2002-05-22 Martin Baulig <martin@gnome.org>
24726 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
24727 Removed, this isn't needed anymore.
24729 2002-05-20 Martin Baulig <martin@gnome.org>
24731 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
24732 be underlying type for an enum.
24734 2002-05-20 Miguel de Icaza <miguel@ximian.com>
24736 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
24737 that splits out the loading of just the core types.
24739 * rootcontext.cs (ResolveCore): Split the struct resolution in
24740 two, so we can load the enumeration underlying types before any
24743 * expression.cs (Is): Bandaid until we fix properly Switch (see
24744 bug #24985 for details).
24746 * typemanager.cs (ImplementsInterface): The hashtable will contain
24747 a null if there are no interfaces implemented.
24749 2002-05-18 Miguel de Icaza <miguel@ximian.com>
24751 * cs-parser.jay (indexer_declarator): It is fine to have array
24754 2002-05-17 Miguel de Icaza <miguel@ximian.com>
24756 * typemanager.cs: (RegisterBuilder): New function used to register
24757 TypeBuilders that implement interfaces. Since
24758 TypeBuilder.GetInterfaces (as usual) does not work with lame
24760 (AddUserType): register interfaces.
24762 (ImplementsInterface): Use the builder_to_ifaces hash if we are
24763 dealing with TypeBuilder. Also, arrays are showing up as
24764 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
24765 methods can not be invoked on them!
24767 * ecore.cs (ExplicitReferenceConversionExists): Made public.
24768 (ImplicitReferenceConversionExists): Split out from
24769 StandardConversionExists.
24771 * expression.cs (As): We were only implementing one of the three
24772 cases for the as operator. We now implement them all.
24773 (Is): Implement the various other cases for Is as well.
24775 * typemanager.cs (CACHE): New define used to control if we want or
24776 not the FindMembers cache. Seems to have a negative impact on
24777 performance currently
24779 (MemberLookup): Nested types have full acess to
24780 enclosing type members
24782 Remove code that coped with instance/static returns for events, we
24783 now catch this in RealFindMembers.
24785 (RealFindMembers): only perform static lookup if the instance
24786 lookup did not return a type or an event.
24788 2002-05-17 Miguel de Icaza <miguel@ximian.com>
24790 * assign.cs (CompoundAssign): We pass more semantic information
24791 now to Compound Assignments than we did before: now we have all
24792 the information at hand, and now we resolve the target *before* we
24793 do the expression expansion, which allows the "CacheValue" method
24794 to have the effect we intended (before, a [x] += 1 would generate
24795 two differen ArrayAccess expressions from the ElementAccess,
24796 during the resolution process).
24798 (CompoundAssign.DoResolve): Resolve target and original_source here.
24800 2002-05-16 Miguel de Icaza <miguel@ximian.com>
24802 * expression.cs (ArrayAccess): dropped debugging information.
24804 * typemanager.cs: Small bug fix: I was always returning i_members,
24805 instead of one of i_members or s_members (depending on which had
24808 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
24809 method is invoked before any code generation takes place, and it
24810 is a mechanism to inform that the expression will be invoked more
24811 than once, and that the method should use temporary values to
24812 avoid having side effects
24814 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
24816 * ecore.cs (Expression.CacheTemporaries): Provide empty default
24819 * expression.cs (Indirection, ArrayAccess): Add support for
24820 CacheTemporaries in these two bad boys.
24822 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
24823 ldobj or ldind_ref.
24824 (StoreFromPtr): Handle stobj as well.
24826 * expression.cs (UnaryMutator): Share more code.
24828 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
24829 down: I was not tracking the Filter function as well, which
24830 was affecting the results of the cache.
24832 2002-05-15 Miguel de Icaza <miguel@ximian.com>
24834 * attribute.cs: Remove the hack to handle the CharSet property on
24837 2002-05-14 Miguel de Icaza <miguel@ximian.com>
24839 * attribute.cs (DoResolve): More uglyness, we now only try to
24840 resolve the attribute partially, to extract the CharSet
24841 information (only if we are a StructLayout attribute). Otherwise
24843 (GetExtraTypeInfo): Add some code to conditionally kill in the
24844 future this. I am more and more convinced that the .NET
24845 framework has special code to handle the attribute setting on
24848 * expression.cs (IsParamsMethodApplicable): Revert my previous
24849 foreach change here, it was wrong.
24851 2002-05-13 Miguel de Icaza <miguel@ximian.com>
24853 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
24854 (pp_expr): do not abort on unknown input, just return.
24855 (eval): abort if there are pending chars.
24857 * attribute.cs (Attribute.Resolve): Positional parameters are
24858 optional. Deal with that case.
24860 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
24861 the Ansi/Unicode/Auto information for the type.
24863 (TypeContainer.DefineType): instantiate the EmitContext here, as
24864 we will be using it during the type definition (to resolve
24865 attributes) and during the emit phase.
24867 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
24868 to pull type information out of the attributes
24870 (Attribute.Resolve): track the constructor builder, and allow for
24871 multiple invocations (structs and classes will use this).
24873 * ecore.cs (MemberLookupFinal): new version with all the
24874 parameters customizable.
24876 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
24877 constructors. Return if the result value is null (as the error
24878 would have been flagged already by MemberLookupFinal)
24880 Do not allow instances of abstract classes or interfaces to be
24883 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
24884 We have to compare the assembly property here when dealing with
24885 FamANDAssem and Assembly access modifiers, because we might be
24886 creating an assembly from *modules* (that means that we are not
24887 getting TypeBuilders for types defined in other modules that are
24888 part of this assembly).
24890 (Method.Emit): If the method is marked abstract and has a body,
24893 (TypeContainer.DefineMembers): If both the defined member and the
24894 parent name match are methods, then do not emit any warnings: let
24895 the Method.Define routine take care of flagging warnings. But if
24896 there is a mismatch (method overrides something else, or method is
24897 overriwritten by something, then emit warning).
24899 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
24900 set to null, this means `do not check for the return type on the
24903 (Method.Define): set the return type for the method signature to
24904 null, so that we get methods with the same name and parameters and
24905 different return types. This is used to flag warning 114 (you are
24906 hiding a method, and you probably want to use the new/override
24909 * typemanager.cs (MemberLookup): Implemented proper access
24910 control, closing a long standing set of bug reports. The problem
24911 was that the Framework only has two bits: Public and NonPublic,
24912 and NonPublic includes private and protected methods, but we need
24913 to enforce the FamANDAssem, FamOrAssem and Family.
24915 2002-05-11 Miguel de Icaza <miguel@ximian.com>
24917 * statement.cs (GotoCase): Return true: Ammounts to giving up
24918 knowledge on whether we return or not, and letting the other case
24919 be responsible for it.
24921 2002-05-10 Miguel de Icaza <miguel@ximian.com>
24923 * driver.cs: Do not load directories for each file processed, only
24924 do it if there is a pattern.
24926 * ecore.cs: Report readonly assigns here as well, as we might have
24927 been resolved only by MemberAccess.
24929 (SimpleName.SimpleNameResolve): Also be useful for LValue
24930 resolution. We need this to propagate assign to local readonly variables
24932 * typemanager.cs: Use a ptrhashtable for the criteria, because we
24933 do not want to reuse potential criteria memory.
24935 * class.cs (MyEventBuilder): Set reflected_type;
24937 * ecore.cs (Constantify): Added support for constifying bools.
24939 (RootContext.LookupType): Added a cache for values looked up in
24940 the declaration space.
24942 * typemanager.cs (FindMembers): Now is a front-end to
24943 RealFindMembers, and provides a two-level hashtable-based cache to
24946 15% performance improvement: from 22.5 to 19.2 seconds.
24948 * expression.cs (IsParamsMethodApplicable): use foreach.
24949 (Invocation.DoResolve): ditto.
24950 (New.DoResolve): ditto.
24951 (ArrayCreation.DoResolve): ditto.
24953 * ecore.cs (FindMostEncompassingType): use foreach.
24955 * delegate.cs (NewDelegate.DoResolve): Use foreach
24957 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
24958 (RemoveMethods): use foreach.
24960 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
24961 nested foreach statements instead of for, and also break out of
24962 the inner loop once a match is found.
24964 (Invocation.OverloadResolve): Use foreach, simplify the code.
24966 2002-05-08 Miguel de Icaza <miguel@ximian.com>
24968 * cfold.cs (BinaryFold): During an enumeration evaluation context,
24969 we actually unwrap the expression to allow for extra information
24972 * expression.cs: Use Shr_Un on unsigned operations.
24974 2002-05-08 Ravi Pratap <ravi@ximian.com>
24976 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
24977 applicable operators was not being considered correctly. This closes
24978 the bug Miguel reported.
24980 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
24982 * attribute.cs: check that the type derives from System.Attribute
24983 and report the correct error in that case (moved the duplicate code to
24984 its own method, too).
24986 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
24988 * attribute.cs: lookup attribute type name as the spec says: first the
24989 bare attribute name and then name + "Attribute" (nant compiles with
24990 mcs after this fix).
24992 2002-05-07 Miguel de Icaza <miguel@ximian.com>
24994 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
24995 Because of the way we parse things, we should try to see if a
24996 UIntConstant can fit in an integer.
24998 2002-05-07 Ravi Pratap <ravi@ximian.com>
25000 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
25001 when we are in an explicit context.
25003 (ConvertReferenceExplicit): When converting from Iface type S to Class
25004 T make sure the rules are implemented as an OR.
25006 * parameter.cs (ParameterType): Make it a property for now although the
25007 purpose really isn't anything immediate.
25009 * expression.cs (Is*Applicable): Do better checking on the parameter type
25010 of a ref/out parameter. The ones from the system assemblies are already
25011 marked with the correct type so we don't need to do any correction.
25013 * ecore.cs (StandardConversionExists): Conversion from Interface types to
25014 the object type is standard too so include that.
25016 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25018 * ecore.cs (StandardConversionExists): Augment with missing code:
25019 deal with IntConstant, LongConstants and Enumerations.
25021 * assign.cs: Report the error, instead of failing silently
25023 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
25024 typecontainer that they are declared, because the
25025 typecontainer/namespace will have the list of using clauses that
25026 need to be applied.
25028 Assembly Attributes were escaping the normal registration
25031 (EmitCode): Apply attributes within an EmitContext that represents
25032 the container they were declared on.
25034 * cs-parser.jay: Track bases for structs. How did I get this wrong?
25036 2002-05-06 Ravi Pratap <ravi@ximian.com>
25038 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
25039 Revamp completely - make much cleaner as we now operate only
25042 (FindMostSpecificSource, FindMostSpecificTarget): New methods
25043 to implement the logic detailed in the spec more correctly.
25045 (UserDefinedConversion): Update accordingly.
25047 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25049 * statement.cs: Return flow analysis information up.
25051 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
25054 (token): Do not consume an extra character before calling
25057 2002-05-06 Piers Haken <piersh@friskit.com>
25059 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
25061 2002-05-06 Miguel de Icaza <miguel@ximian.com>
25063 * class.cs (Constructor.Emit): Set the IsStatic flag in the
25064 EmitContext during the instance constructor initializer
25065 resolution, to stop access to instance variables.
25067 This is mandated by the spec, last paragraph of the `constructor
25068 initializers' section.
25070 2002-05-05 Miguel de Icaza <miguel@ximian.com>
25072 * cs-parser.jay, class.cs (Accessor): new class used to represent
25073 an accessor (get or set). In the past we used `null' to represent
25074 a missing accessor. But this is ambiguous because there was no
25075 way to tell in abstract indexers/properties if one of them was
25078 Now there is a way of addressing that.
25080 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
25081 instead of FindMembers.
25083 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
25084 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
25086 * attribute.cs: Treat indexers and properties as the same in terms
25087 of applying attributes
25089 * ecore.cs (FindMostEncompassedType): Use statically initialized
25090 EmptyExpressions()s like we do elsewhere to avoid creating useless
25091 objects (and we take this out of the tight loop).
25093 (GetConversionOperators): Move the code to extract the actual
25094 operators to a separate routine to clean things up.
25096 2002-05-04 Miguel de Icaza <miguel@ximian.com>
25098 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
25099 events are always registered FieldBuilders.
25101 * class.cs (FieldBase): New class shared by Fields
25103 * delegate.cs: If we are a toplevel delegate, use our full name.
25104 If we are a nested delegate, then only use our tail name.
25106 2002-05-02 Ravi Pratap <ravi@ximian.com>
25108 * expression.cs (IsApplicable): Ensure that we add the "&" to
25109 ref/out types before comparing it with the type of the argument.
25111 (IsParamsMethodApplicable): Ditto.
25113 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
25116 * delegate.cs : Handle the case when we have more than one applicable
25117 method. Flag an error only when we finish checking all.
25119 2002-05-02 Miguel de Icaza <miguel@ximian.com>
25121 * expression.cs: Add support for boolean static initializers.
25123 2002-05-01 Miguel de Icaza <miguel@ximian.com>
25125 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
25127 * parameter.cs (ComputeParameterTypes,
25128 ComputeAndDefineParameterTypes): Better error handling: now we
25129 clear the `types' cache if we fail during any of the type lookups.
25130 We also return the status code correctly to our caller
25132 * delegate.cs: If we fail to define a delegate, abort the extra
25135 * expression.cs (Binary.ResolveOperator): for
25136 operator==(object,object) and operator !=(object, object) we also
25137 have to verify that there is an implicit conversion from one to
25140 (ArrayAccess.DoResolve): Array Access can operate on
25143 2002-04-30 Miguel de Icaza <miguel@ximian.com>
25145 * assign.cs (CompoundAssign): A new class used as a "flag" that
25146 the assignment actually is happening as part of a compound
25147 assignment operator.
25149 During compound assignment, a few new rules exist to enable things
25156 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
25157 to the type of x) if y is implicitly convertible to the type of x,
25158 and the operator is a builtin operator and the return type of the
25159 operator is explicitly convertible to the type of x.
25161 * rootcontext.cs: Reset warning level to 2. 4 catches various
25162 "interesting" features in mcs, we must clean this up at some
25163 point, but currently am trying to kill other bugs ;-)
25165 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
25166 in container classes as well.
25168 * expression.cs (Binary.ResolveOperator): Handle string case
25169 before anything else (as operator overloading does emit an error
25170 before doing anything else).
25172 This code could go away when we move to a table driven model, but
25173 i could not come up with a good plan last night.
25175 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
25177 * typemanager.cs (CSharpName): reimplementation using regex.
25178 * class.cs: added null check for fields in Emit
25179 * rootcontext.cs: set warninglevel to 4
25181 2002-04-29 Miguel de Icaza <miguel@ximian.com>
25183 * typemanager.cs (CSharpName): reimplemented with Lupus
25186 2002-04-28 Miguel de Icaza <miguel@ximian.com>
25188 * statement.cs (If): correclty implement Resolve, because we were
25189 not catching sem errors in there. The same process is needed
25191 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
25194 (Statement.Warning_DeadCodeFound): Factorize code.
25195 (While): Report dead code here too.
25197 (Statement): Added Resolve virtual method to allow
25198 for resolution split from the emit code.
25200 2002-04-26 Miguel de Icaza <miguel@ximian.com>
25202 * statement.cs (EmitBoolExpression): No longer try to resolve the
25204 (MakeBoolean): New utility function that resolve, implicitly
25205 converts to boolean and tags the expression.
25208 (If, Do): Implement dead code elimination.
25209 (While): Implement loop inversion
25211 (Do, While, For, If): Resolve the expression prior to calling our
25214 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
25217 - added method Report28 (warning: program has more than one entry point)
25218 - added method IsEntryPoint, implements paragraph 10.1 of the spec
25219 - modified method Method.Define, the part at the end of the method
25221 * rootcontext.cs: added static public Location EntryPointLocation;
25223 * ../errors/cs0028.cs : Add test case for the above warning.
25226 - modified method CSharpName to allow arrays of primitive type to
25227 be printed nicely (e.g. instead of System.Int32[][] it now prints
25229 - added method CSharpSignature: returns the signature of a method
25230 in string format to be used in reporting errors, warnings, etc.
25232 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
25235 2002-04-26 Ravi Pratap <ravi@ximian.com>
25237 * delegate.cs (Define): Fix extremely silly bug where I was
25238 setting the type of the 'object' parameter of the BeginInvoke
25239 method to System.IAsyncResult instead of System.Object ;-)
25241 2002-04-26 Miguel de Icaza <miguel@ximian.com>
25243 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
25246 (Constructor.Emit): return if we fail to initialize the
25247 constructor. Another door closed!
25249 * expression.cs (New.DoResolve): Improve error message (from -6 to
25250 1501). Use DeclaredOnly lookup to find the exact constructor.
25252 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
25253 loop. This is useful.
25255 * cs-parser.jay: Adjust the default parameters so that destructors
25256 have the proper signature.
25258 2002-04-26 Martin Baulig <martin@gnome.org>
25260 * driver.cs (LoadAssembly): If `assembly' contains any characters
25261 which are only valid in path names and not in assembly names
25262 (currently slash, backslash and point), use Assembly.LoadFrom ()
25263 instead of Assembly.Load () on the `assembly' (before iteration
25264 over the link_paths).
25266 2002-04-26 Martin Baulig <martin@gnome.org>
25268 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
25270 2002-04-25 Miguel de Icaza <miguel@ximian.com>
25272 * class.cs (Property): use the new typemanager.MemberLookup
25274 (TypeContainer.MemberLookup): Implement using the
25275 TypeManager.MemberLookup now.
25277 * typemanager.cs: Make MemberLookup a function of the TypeManager,
25278 and return MemberInfos, so that these can be used without an
25279 EmitContext (what we had before).
25281 2002-04-24 Miguel de Icaza <miguel@ximian.com>
25283 * expression.cs: Fix the case where the argument to params if the
25284 type of the params. I omitted handling this before. Fixed
25286 2002-04-22 Miguel de Icaza <miguel@ximian.com>
25288 * driver.cs: Call BootCorlib_PopulateCoreType
25290 * class.cs (Property.CheckBase): Check for properties only, not
25293 * interface.cs: Temporary hack: try/catch around the
25294 CustomAttributeBuilder, because I am getting an exception that I
25297 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
25298 types whose definitions are required to be there (attributes are
25299 defined before standard types).
25301 Compute definitions as we boot the various types, as they are used
25302 immediately (value_type class will need object_type, but if we do
25303 not initialize object_type, we will pass a null, which will let
25304 the runtime pick the System.Object from the existing corlib, which
25305 is not what we want).
25307 2002-04-22 Patrik Torstensson <totte@labs2.com>
25309 * cs-tokenizer.cs: fixed a number of trim() issues.
25311 2002-04-22 Ravi Pratap <ravi@ximian.com>
25313 * expression.cs (Argument.Type): Ensure that we return the correct
25314 type when we have out or ref parameters [in which case we
25317 2002-04-22 Miguel de Icaza <miguel@ximian.com>
25319 * class.cs (Property, Indexer): Allow extern modifier in there.
25321 * typemanager.cs (InitBaseTypes): Initializes object_type and
25322 value_type, since those will be used early on during the bootstrap
25323 process to compile corlib.
25325 (InitCoreTypes): Move code from here to InitBaseTypes.
25327 2002-04-21 Miguel de Icaza <miguel@ximian.com>
25329 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
25330 single-dimension arrays as using the ldlen opcode.
25332 Daniel Lewis discovered this optimization.
25334 * typemanager.cs: Add signature for System.Array::get_Length
25336 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25338 * statement.cs: report the error when the foreach does not apply to an
25339 array nor a collection.
25341 2002-04-19 Miguel de Icaza <miguel@ximian.com>
25343 * expression.cs: Add implicit conversions to the operator ~.
25345 * constant.cs (DecimalConstant.Emit): Emit decimal value.
25347 * typemanager.cs: Locate the decimal constructor.
25349 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25351 * attribute.cs: use the new property of TypeOf.
25352 * expression.cs: added 'get' property around typearg.
25354 These changes fix a build breaker reported by NickD. Is this the
25355 correct way to fix? If not, please, revert my changes and make it
25358 2002-04-17 Miguel de Icaza <miguel@ximian.com>
25360 * attribute.cs: Add support for typeof in attribute invocations.
25361 I am not sure that this is right though.
25363 2002-04-14 Duncan Mak <duncan@ximian.com>
25365 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
25366 Binary.Operator.Division case.
25368 2002-04-13 Ravi Pratap <ravi@ximian.com>
25370 * class.cs (DefineType): Ensure that we do a proper check on
25371 attribute types and also register it with the TypeManager.
25373 (TypeContainer.Targets): The default for attribute types is
25374 AttributeTargets.All.
25376 * attribute.cs (ApplyAttributes): Registering the attribute type
25377 is done elsewhere, not when we discover we have a Usage attribute.
25379 2002-04-12 Ravi Pratap <ravi@ximian.com>
25381 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
25382 and get rid of is_delegate parameter.
25384 * everywhere : update.
25386 2002-04-12 Ravi Pratap <ravi@ximian.com>
25388 * cs-parser.jay (compilation_unit): Revamp completely to use
25389 some new ideas that I got from Rhys' grammar to solve the problems
25390 with assembly level attributes.
25392 (outer_declaration): New grammar production.
25394 (attribute_sections): Add.
25396 (opt_attributes): Base on attribute_sections
25398 (namespace_declaration): Allow opt_attributes to tackle the case
25399 when we have assembly level attributes - we are clever in this
25402 * attribute.cs (ApplyAttributes): Do not worry about assembly
25403 attributes in the non-global context.
25405 * rootcontext.cs (AddGlobalAttributes): Go back to using this
25406 instead of SetGlobalAttributes.
25408 * class.cs, rootcontext.cs : Ensure we define and generate
25409 attribute types before anything else.
25411 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
25412 and flag the new error -20 for the case when the attribute type
25413 does not have valid targets specified. csc does not catch this.
25415 * ../errors/errors.txt : update for error # -20
25417 2002-04-11 Ravi Pratap <ravi@ximian.com>
25419 * support.cs (InternalParameters.ParameterModifier): Do some null
25420 checking and return sane values.
25422 * class.cs (Method.Define): If we are a PInvoke method, ensure
25423 that we are static and extern. Report error # 601
25425 * ../errors/cs0601.cs : Add test case for the above error.
25427 2002-04-07 Ravi Pratap <ravi@ximian.com>
25429 * rootcontext.cs (attribute_types): We need to keep type of
25430 all attribute types separately and emit code for them first.
25432 (RegisterAttribute) : Implement.
25434 * class.cs (DefineType): Check if the current Type is a custom
25435 attribute type and register it accordingly.
25437 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
25438 adding the first attribute twice and rename to
25440 (SetGlobalAttributes): this.
25442 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
25445 * attribute.cs (ApplyAttributes): Take an additional argument telling us
25446 if we are processing global arguments. Hmm, I am unsure of this.
25448 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25450 * expression.cs: added static array of strings to avoid calling
25451 Enum.ToString () for Operator in Binary. Significant recover of
25454 2002-04-10 Miguel de Icaza <miguel@ximian.com>
25456 * class.cs (FindMembers): Allow the Builders of the various
25457 members to be null. If they are skip them. This only happens
25458 during the PInvoke declaration.
25460 2002-04-09 Miguel de Icaza <miguel@ximian.com>
25462 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
25463 failure, so we do not keep going afterwards.
25465 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
25466 wanted to pass `false' as the `is_delegate' argument. If this is
25467 the case, why not use delegate_type == null to mean `is_delegate =
25468 false' and anything else as is_delegate = true.
25470 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
25472 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
25473 code for the section, not the beginning of the tests.
25475 2002-04-08 Miguel de Icaza <miguel@ximian.com>
25477 * cfold.cs: Handle operator + (Enum x, Underlying x)
25479 * expression.cs (Binary): same. Warn about errors where we have
25480 Enum/Enum in operator + as well.
25482 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
25485 - added support for switch(bool)
25486 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
25487 - add TableSwitchEmit() to handle table-based switch statements
25489 2002-04-05 Ravi Pratap <ravi@ximian.com>
25491 * expression.cs (Invocation.OverloadResolve): Factor out code which
25492 does parameter compatibility checking with arguments so that we can
25493 re-use the code even from Delegate.VerifyApplicability
25495 (VerifyArgumentsCompat): Move above code here.
25497 * delegate.cs (VerifyApplicability): Get rid of duplicate code
25498 and instead make a call to the above method.
25500 2002-03-31 Ravi Pratap <ravi@ximian.com>
25502 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
25503 We use it to keep track of classes which are attribute types.
25505 2002-04-02 Miguel de Icaza <miguel@ximian.com>
25507 * delegate.cs (Delegate.Define): Correctly define the types in the
25508 presence of fixed and array parameters.
25510 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
25513 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
25514 include NonPublic after the first iteration.
25516 * class.cs (Indexer.CheckBase): Only check if both parents are
25519 * cs-parser.jay (accessor_body): If empty, set to null.
25521 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
25522 same code path here to resolve constants names that we did have in
25523 MemberAccess.DoResolve. There is too much code duplicated here.
25525 2002-04-01 Miguel de Icaza <miguel@ximian.com>
25527 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
25529 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
25532 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
25533 tokens, numbers and strings.
25535 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
25538 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
25539 asyncronous parameters and the regular parameters.
25541 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
25542 specify the target directory.
25544 * expression.cs: (This.DoResolve): Simplify
25545 (As.Emit): Optimize, do not generate IsInst if the expression is
25546 always of the given type.
25548 (Is.DoResolve): Bug fix, we were reporting both always/never for
25551 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
25552 creating too many unnecessary arrays.
25554 2002-03-31 Miguel de Icaza <miguel@ximian.com>
25556 * class.cs (EmitFieldInitializer): Use Assign expression to assign
25557 fields instead of rolling our own initializer. Takes care of all
25558 implicit conversions, and drops unnecessary static checks/argument.
25560 2002-03-31 Dick Porter <dick@ximian.com>
25562 * driver.cs: use the GetDirectories() return values properly, and
25563 use "/" as path separator.
25565 2002-03-30 Miguel de Icaza <miguel@ximian.com>
25567 * expression.cs (Unary): Optimize - - expr into expr.
25568 (Binary): Optimize a + (-b) into a -b.
25570 * codegen.cs (CodeGen): Made all methods static.
25572 2002-03-29 Miguel de Icaza <miguel@ximian.com>
25576 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
25577 TypeBuilder property.
25579 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
25582 * tree.cs: Removed the various RecordXXXX, and replaced with a
25583 single RecordDecl. Removed all the accessor methods, and just
25584 left a single access point Type
25586 * enum.cs: Rename DefineEnum to DefineType.
25588 * decl.cs: New abstract method `DefineType' used to unify the
25589 Defines for Enumerations, Interfaces, TypeContainers and
25592 (FindType): Moved LookupInterfaceOrClass here. Moved the
25593 LookupBaseClasses method that used to live in class.cs and
25594 interface.cs here, and renamed to FindType.
25596 * delegate.cs: Implement DefineType. Take advantage of the
25597 refactored pattern for locating the parent builder without taking
25598 the parent_builder argument (which we know does not work if we are
25599 nested, and triggering a toplevel definition).
25601 2002-03-28 Miguel de Icaza <miguel@ximian.com>
25603 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
25604 accessibility of a member has changed during override and report
25607 * class.cs (Method.Define, Property.Define): Only complain on
25608 overrides if the method is private, any other accessibility is
25609 fine (and since we just checked the permission is the same, we are
25612 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
25613 and elif are processed always. The other pre-processing
25614 directives are only processed if we are "taking" the path
25616 2002-03-29 Martin Baulig <martin@gnome.org>
25618 * class.cs (Method.Emit): Only emit symbolic debugging info if the
25619 current location is not Null.
25621 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
25622 a separate method so we can profile it.
25624 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
25625 `span.Seconds' are just seconds, but no minutes or hours.
25626 (MainDriver): Profile the CodeGen.SaveSymbols calls.
25628 2002-03-28 Miguel de Icaza <miguel@ximian.com>
25630 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
25631 Remove the gratuitous set of Final:
25633 // If an interface implementation, then we can set Final.
25634 if (((flags & MethodAttributes.Abstract) == 0) &&
25635 implementing.DeclaringType.IsInterface)
25636 flags |= MethodAttributes.Final;
25638 I do not know what I was smoking when I used that.
25641 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
25642 step into fixing the name resolution issues for delegates and
25643 unifying the toplevel name resolution.
25645 2002-03-28 Martin Baulig <martin@gnome.org>
25647 * class.cs (Method.Emit): If we have a symbol writer, call its
25648 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
25649 tell it about the current method.
25651 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
25652 writer that we're going to emit the first byte of IL code for a new
25653 statement (a new source line).
25654 (EmitContext.EmitTopBlock): If we have a symbol writer, call
25655 EmitContext.Mark() before emitting any code.
25657 * location.cs (SymbolDocument): Return null when we're Null.
25659 * statement.cs (Statement): Moved the `Location loc' variable here.
25660 (Statement.EmitBoolExpression): If we have a symbol writer, call
25661 ec.Mark() before emitting any code to tell it that we're at the
25662 beginning of a new statement.
25663 (StatementExpression): Added `Location' argument to the constructor.
25664 (Block): Added public readonly variable `StartLocation' and public
25665 variable `EndLocation'. The latter is to be set using SetEndLocation().
25666 (Block): Added constructor which takes a start and end location.
25667 (Block.SetEndLocation): New method. This sets the end location.
25668 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
25669 local variables we create.
25670 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
25671 each statement and do also mark the begin and end of the block.
25673 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
25674 tell it the current lexer.Location, use Location.Null for the end of the
25676 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
25677 current block, set its end location using SetEndLocation().
25678 (statement_expression): StatementExpression constructor now takes the
25679 lexer.Location as additional argument.
25680 (for_statement, declare_local_variables): Likewise.
25681 (declare_local_variables): When creating a new implicit block, use the
25682 new Block constructor and pass it the lexer.Location.
25684 2002-03-28 Miguel de Icaza <miguel@ximian.com>
25686 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
25687 members also on the parent interfaces recursively.
25689 2002-03-27 Miguel de Icaza <miguel@ximian.com>
25691 * report.cs: Use new formats, since Gonzalo finished the missing
25694 * expression.cs (Binary.ResolveOperator): added missing operator|
25695 operator& and operator^ for bool/bool.
25697 * cs-parser.jay: CheckDef now takes a Location argument that is
25698 used to report errors more precisly (instead of reporting the end
25699 of a definition, we try to track something which is a lot closer
25700 to the source of the problem).
25702 * cs-tokenizer.cs: Track global token use, so we can properly flag
25703 the use of #define/#undef after the first token has been seen.
25705 Also, rename the reportXXXX to Error_DescriptiveName
25707 * decl.cs (DeclSpace.IsTopLevel): Move property here from
25708 TypeContainer, so that Enum and Interface can use this too.
25710 * class.cs (TypeContainer.LookupInterfaceOrClass,
25711 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
25712 `builder' argument. Typically this was used to pass the parent
25713 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
25716 The problem is that a nested class could trigger the definition of
25717 a toplevel class, and the builder would be obviously wrong in that
25720 So we drop this argument, and we compute dynamically the
25721 TypeBuilder/ModuleBuilder (the correct information was available
25722 to us anyways from DeclSpace.Parent)
25724 * interface.cs (Interface.DefineInterface): Drop builder
25725 parameter cleanup like class.cs
25727 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
25730 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
25733 (Try.Emit): Propagate the returns value from the statement.
25735 (Return.Emit): Even if we are leavning
25737 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
25739 * modifiers.cs: Fix the computation of MethodAttributes flags.
25741 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
25743 * driver.cs: allow compilation of files that start with '/'.
25744 Add a default case when checking the argument of --target.
25746 2002-03-25 Miguel de Icaza <miguel@ximian.com>
25748 * interface.cs: Implement the same search algorithm for types in
25749 the interface code.
25751 * delegate.cs: Do not allow multiple definition.
25753 * Recovered ChangeLog that got accidentally amputated
25755 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
25757 * rootcontext.cs: Load manually enum to allow core classes to
25758 contain enumerations.
25760 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
25761 Update to new static methods in TypeManager.
25763 * typemanager.cs (GetMethod, GetConstructor): Use our
25764 implementation of FindMembers to find the members, since during
25765 corlib compilation, the types are TypeBuilders and GetMethod and
25766 GetConstructor do not work.
25768 Make all methods in TypeManager static.
25770 (InitCodeHelpers): Split the functionality from
25771 the InitCodeTypes function.
25773 * driver.cs: Call InitCodeHelpers after we have populated the
25776 * cs-parser.jay (delegate_declaration): we did not used to compute
25777 the delegate name correctly for void delegates.
25779 2002-03-24 Miguel de Icaza <miguel@ximian.com>
25781 * rootcontext.cs (RootContext): Init the interface_resolve_order
25782 and type_container_resolve_order always.
25784 (ResolveCore, BootstrapCorlib_ResolveClass,
25785 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
25786 compiler when compiling with --nostdlib
25788 * class.cs (TypeContainer.DefineType): Check that our parent is
25789 not null. This test is most important when we are bootstraping
25792 * codegen.cs: Split out the symbol writing code.
25794 2002-03-25 Martin Baulig <martin@gnome.org>
25796 * driver.cs (-g): Made -g an alias for --debug.
25798 2002-03-24 Martin Baulig <martin@gnome.org>
25800 * codegen.cs (SymbolWriter): New public variable. Returns the
25801 current symbol writer.
25802 (CodeGen): Added `bool want_debugging_support' argument to the
25803 constructor. If true, tell the ModuleBuild that we want debugging
25804 support and ask it for the ISymbolWriter.
25805 (Save): If we have a symbol writer, call it's Close() method after
25806 saving the assembly.
25808 * driver.c (--debug): New command line argument to create a
25809 debugger information file.
25811 * location.cs (SymbolDocument): New public property. Returns an
25812 ISymbolDocumentWriter object for the current source file or null
25813 if we don't have a symbol writer.
25815 2002-03-21 Miguel de Icaza <miguel@ximian.com>
25817 * driver.cs (LoadAssembly): Correctly return when all the paths
25818 have been tried and not before.
25820 * statement.cs (Switch.Emit): return the actual coverage for this
25821 statement (returns/not-returns)
25823 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
25824 switch of the statement if we are the last switch section. That
25825 kills two problems: try/catch problems (we used to emit an empty
25826 nop at the end) and switch statements where all branches would
25829 2002-03-19 Miguel de Icaza <miguel@ximian.com>
25831 * driver.cs: Add default assemblies (the equivalent to the
25832 Microsoft CSC.RSP file)
25834 * cs-tokenizer.cs: When updating `cols and setting it to zero,
25835 also update tokens_seen and set it to false.
25837 * driver.cs: Implement --recurse for Mike.
25839 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
25840 correctly splitting out the paths.
25842 2002-03-18 Miguel de Icaza <miguel@ximian.com>
25844 * interface.cs (Interface.PopulateProperty): Instead of using
25845 `parent' as the declaration space for the set parameters, use
25848 * support.cs (InternalParameters): InternalParameters constructor
25849 takes a DeclSpace instead of a TypeContainer.
25851 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
25852 types are being initialized, load the address of it before calling
25855 (New): Provide a mechanism to disable the generation of local
25856 value type temporaries when the caller will be providing us with
25857 an address to store it.
25859 (ArrayCreation.EmitDynamicInitializers): Use it.
25861 2002-03-17 Miguel de Icaza <miguel@ximian.com>
25863 * expression.cs (Invocation.EmitArguments): Only probe for array
25864 property if there is more than one argument. Sorry about that.
25866 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
25867 empty param arrays.
25869 * class.cs (Method.LabelParameters): Fix incorrect code path that
25870 prevented the `ParamArrayAttribute' from being applied to the
25873 2002-03-16 Miguel de Icaza <miguel@ximian.com>
25875 * support.cs (ReflectionParameters): Correctly compute whether the
25876 last argument is a params array. Fixes the problem with
25879 * typemanager.cs: Make the assemblies array always be non-null
25880 (empty, but non-null)
25882 * tree.cs (RecordDecl): New function that abstracts the recording
25883 of names. This reports error 101, and provides a pointer to the
25884 previous declaration. Fixes a crash in the compiler.
25886 * cs-parser.jay (constructor_declaration): Update to new grammar,
25887 and provide a constructor_body that can be empty.
25889 2002-03-15 Miguel de Icaza <miguel@ximian.com>
25891 * driver.cs: Add support for --resources.
25893 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
25894 Make all types for the various array helper methods be integer.
25896 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
25897 CheckState to ConvCast.
25899 (ConvCast): Now it takes a `checked' state argument, to avoid
25900 depending on the emit context for the conversion, and just using
25901 the resolve time setting.
25903 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
25904 instead of Invocation.EmitArguments. We do not emit the original
25905 arguments, instead we emit those which have been converted to
25906 unsigned int expressions.
25908 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
25910 * codegen.cs: ditto.
25912 * expression.cs (LocalVariableReference): Drop the use of the
25913 Store function that depended on the variable index.
25915 * statement.cs (VariableInfo): Drop the `Idx' property from this
25916 class, as this is not taking into account the indexes for
25917 temporaries tat we generate during the execution, getting the
25920 * class.cs: First emit class initializers, then call the parent
25923 * expression.cs (Binary): Fix opcode emision.
25924 (UnaryMutator.EmitCode): Support checked code generation
25926 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
25927 matches for events for both the Static and Instance scans,
25928 pointing to the same element. Fix that.
25930 2002-03-14 Miguel de Icaza <miguel@ximian.com>
25932 * rootcontext.cs (ResolveTree): Always set the
25933 interface_resolve_order, because nested interfaces will be calling
25936 * class.cs (GetInterfaceOrClass): Track the same resolution
25937 process used by TypeManager.LookupType. This fixes the nested
25938 type lookups in class declarations (separate path from
25941 (TypeContainer.DefineType): Also define nested interfaces.
25942 (TypeContainer.RegisterOrder): New public function used to
25943 register the order in which child interfaces need to be closed.
25945 Nested interfaces need to be closed after their parents have been
25948 * interface.cs (InterfaceAttr): Put all the logic for computing
25949 the interface attribute here.
25951 (DefineInterface): Register our interface order with the
25952 RootContext or with the TypeContainer depending on the case.
25954 2002-03-12 Miguel de Icaza <miguel@ximian.com>
25956 * cs-parser.jay: rework foreach statement to work with the new
25957 changes to the policy on SimpleNames.
25959 * report.cs: support Stacktrace on warnings as well.
25961 * makefile: drop --unsafe and /unsafe from the compile.
25963 2002-03-13 Ravi Pratap <ravi@ximian.com>
25965 * ecore.cs (StandardConversionExists): Modify to take an Expression
25966 as the first parameter. Ensure we do null -> reference type conversion
25969 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
25970 temporary Expression objects.
25972 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
25974 * interface.cs: workaround bug in method overloading resolution
25975 (there is already a bugzilla bug for it).
25977 2002-03-12 Miguel de Icaza <miguel@ximian.com>
25979 We could also solve this problem by having a separate path for
25980 performing type lookups, instead of DoResolve, we could have a
25981 ResolveType entry point, and only participating pieces of the
25982 production (simplename, deref, array) would implement this.
25984 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
25985 signal SimpleName to only resolve type names and not attempt to
25986 resolve anything else.
25988 * expression.cs (Cast): Set the flag.
25990 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
25992 * class.cs: Only report 108 if there is no `new' modifier.
25994 * cs-parser.jay: rework foreach statement to work with the new
25995 changes to the policy on SimpleNames.
25997 * report.cs: support Stacktrace on warnings as well.
25999 * makefile: drop --unsafe and /unsafe from the compile.
26001 2002-03-11 Miguel de Icaza <miguel@ximian.com>
26003 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26004 lookups here, instead of doing that at parse time. This means
26005 that our grammar will not introduce `LocalVariableReferences' as
26006 expressions at this point. That solves the problem of code like
26010 static void Main ()
26014 This is only half the fix. The full fix requires parameters to
26015 also be handled in this way.
26017 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
26018 makes the use more obvious of the DeclSpace. The
26019 ec.TypeContainer.TypeBuilder is now only used to pull the
26020 TypeBuilder for it.
26022 My theory is that I can get rid of the TypeBuilder completely from
26023 the EmitContext, and have typecasts where it is used (from
26024 DeclSpace to where it matters).
26026 The only pending problem is that the code that implements Aliases
26027 is on TypeContainer, and probably should go in DeclSpace.
26029 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26030 lookups here, instead of doing that at parse time. This means
26031 that our grammar will not introduce `LocalVariableReferences' as
26032 expressions at this point. That solves the problem of code like
26036 static void Main ()
26040 This is only half the fix. The full fix requires parameters to
26041 also be handled in this way.
26043 * class.cs (Property.DefineMethod): When implementing an interface
26044 method, set newslot, when implementing an abstract method, do not
26045 set the flag (before we tried never setting it, or always setting
26046 it, which is the difference).
26047 (Indexer.DefineMethod): same.
26048 (Method.DefineMethod): same.
26050 * ecore.cs: Only set the status used flag if we get back a Field.
26052 * attribute.cs: Temporary hack, so Paolo can keep working.
26054 2002-03-08 Ravi Pratap <ravi@ximian.com>
26056 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
26057 the unmanaged type in the case we have a MarshalAs attribute.
26059 (Resolve): Handle the case when we are parsing the special MarshalAs
26060 attribute [we need to store the unmanaged type to use later]
26062 * typemanager.cs (marshal_as_attr_type): Built in type for the
26063 MarshalAs Attribute.
26065 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
26066 on parameters and accordingly set the marshalling info.
26068 2002-03-09 Miguel de Icaza <miguel@ximian.com>
26070 * class.cs: Optimizing slightly by removing redundant code after
26071 we switched to the `NoTypes' return value.
26072 (Property.DefineMethod): use NoTypes here too.
26074 This fixes the bug I introduced in my last batch of changes.
26076 2002-03-05 Ravi Pratap <ravi@ximian.com>
26078 * tree.cs (RecordEnum): Add. We now keep track of enums too.
26080 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
26081 Enums since those are types too.
26083 * cs-parser.jay (enum_declaration): Record enums as we parse them.
26085 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
26086 thanks to a call during the lookup process.
26088 2002-03-07 Miguel de Icaza <miguel@ximian.com>
26090 * statement.cs (Foreach): Lots of work to accomodate a particular
26091 kind of foreach statement that I had not kept in mind. It is
26092 possible to have foreachs on classes that provide a GetEnumerator
26093 method that return objects that implement the "pattern" for using
26094 a foreach, there is no need to support GetEnumerator
26097 This is needed to compile nant.
26099 * decl.cs: Only report 114 if the member is not `Finalize' and if
26100 the warning level is at least 2.
26102 * class.cs: Moved the compare function from Method to
26105 (MethodSignature.InheritableMemberSignatureCompare): Add new
26106 filter function that is used to extract inheritable methods from a
26109 (Method.Define): Use the new `inheritable_method_signature_filter'
26112 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
26115 2002-03-06 Miguel de Icaza <miguel@ximian.com>
26117 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
26119 * cs-parser.jay: Add opt_semicolon to the interface declaration.
26121 * expression.cs: Pass location information to
26122 ConvertImplicitStandard.
26124 * class.cs: Added debugging code to track return values from
26127 2002-03-05 Miguel de Icaza <miguel@ximian.com>
26129 * expression.cs (Is.DoResolve): If either side of the `is' is an
26130 interface, do not flag the warning.
26132 * ecore.cs (ImplicitReferenceConversion): We need a separate test
26135 * report.cs: Allow for --fatal to be used with --probe.
26137 * typemanager.cs (NoTypes): Move the definition for the empty Type
26140 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
26142 (TypeContainer.DefineProxy): New function used to proxy to parent
26143 implementations when implementing interfaces.
26144 (TypeContainer.ParentImplements): used to lookup if our parent
26145 implements a public function that is required by an interface.
26146 (TypeContainer.VerifyPendingMethods): Hook this up.
26148 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
26149 `modules' and `assemblies' arraylists into arrays. We only grow
26150 these are the very early start up of the program, so this improves
26151 the speedof LookupType (nicely measured).
26153 * expression.cs (MakeByteBlob): Replaced unsafe code with
26154 BitConverter, as suggested by Paolo.
26156 * cfold.cs (ConstantFold.Binary): Special case: perform constant
26157 folding of string concatenation, but if either side is a string,
26158 and the other is not, then return null, and let the runtime use
26159 the concatenation on the string plus the object (using
26160 `Object.ToString').
26162 2002-03-04 Miguel de Icaza <miguel@ximian.com>
26164 Constant Folding has been implemented now.
26166 * expression.cs (Unary.Reduce): Do not throw an exception, catch
26167 the error instead on types that are not supported in one's
26170 * constant.cs (Constant and all children): New set of functions to
26171 perform implict and explicit conversions.
26173 * ecore.cs (EnumConstant): Implement the new functions to perform
26174 conversion by proxying to the child expression.
26176 * codegen.cs: (ConstantCheckState): Constant evaluation has its
26177 own separate setting that can not be turned off from the command
26178 line using --unchecked or --checked and is only controlled using
26179 the checked/unchecked statements and expressions. This setting is
26180 used by the constant folder to flag errors.
26182 * expression.cs (CheckedExpr, UncheckedExpr): Set the
26183 ConstantCheckState as well.
26185 During Resolve, they also have to flag the state, because the
26186 constant folder runs completely in the Resolve phase.
26188 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
26191 2002-03-01 Miguel de Icaza <miguel@ximian.com>
26193 * cfold.cs: New file, this file contains the constant folder.
26195 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
26196 argument to track whether we are using the resulting address to
26197 load or store a value and provide better error messages.
26199 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
26200 new AddressOf arguments.
26202 * statement.cs (Foreach.EmitCollectionForeach): Update
26204 * expression.cs (Argument.Emit): Call AddressOf with proper
26205 arguments to track usage.
26207 (New.DoEmit): Call AddressOf with new arguments.
26209 (Unary.Emit): Adjust AddressOf call.
26211 2002-03-01 Ravi Pratap <ravi@ximian.com>
26213 * cs-parser.jay (member_access): Change the case for pre-defined types
26214 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
26217 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
26220 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
26221 essentially like methods and apply attributes like MethodImplOptions to them too.
26223 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
26226 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
26227 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
26230 * Update code everywhere accordingly.
26232 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
26234 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
26236 2002-02-28 Ravi Pratap <ravi@ximian.com>
26238 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
26239 try performing lookups against those instead of jumping straight into using
26240 the 'using' clauses.
26242 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
26244 (LookupType): Perform lookups in implicit parents too.
26246 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
26247 sequence as RootContext.LookupType.
26249 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
26250 the various cases of namespace lookups into this method.
26252 2002-03-01 Miguel de Icaza <miguel@ximian.com>
26254 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
26255 in positional arguments)
26257 * class.cs (Operator): Update the AllowedModifiers to contain
26260 * cs-parser.jay: Update operator declaration to allow for the
26261 operator body to be empty.
26263 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
26266 2002-02-27 Miguel de Icaza <miguel@ximian.com>
26268 * class.cs (Method.Emit): Label parameters.
26270 * driver.cs: Return 1 or 0 as the program exit code.
26272 2002-02-26 Miguel de Icaza <miguel@ximian.com>
26274 * expression.cs: Special case the `null' object when trying to
26275 auto-compute the type, as anything can be explicitly converted to
26278 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
26279 spotting this Paolo.
26281 (Expression.ImplicitNumericConversion): Perform comparissions of
26282 the type using the underlying type in the case of an enumeration
26283 rather than using the enumeration type for the compare.
26285 Cope with the underlying == type case, which is not possible to
26288 (Expression.ConvertNumericExplicit): Perform comparissions of
26289 the type using the underlying type in the case of an enumeration
26290 rather than using the enumeration type for the compare.
26292 * driver.cs: If the user does not supply an extension, assume .exe
26294 * cs-parser.jay (if_statement): Rewrote so that we can track the
26295 location for the if statement.
26297 * expression.cs (Binary.ConstantFold): Only concat strings when
26298 the operation is "+", not everything ;-)
26300 * statement.cs (Statement.EmitBoolExpression): Take a location
26302 (If, While, Do): Track location.
26304 * expression.cs (Binary.ResolveOperator): In the object + string
26305 case, I was missing a call to ConvertImplicit
26307 2002-02-25 Ravi Pratap <ravi@ximian.com>
26309 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
26310 Location arguments. Ensure we use RootContext.LookupType to do our work
26311 and not try to do a direct Type.GetType and ModuleBuilder.GetType
26313 * interface.cs (PopulateMethod): Handle the type of the parameter being
26316 * expression.cs (Invocation.BetterFunction): Handle the case when we
26317 have a params method with no fixed arguments and a call is made with no
26320 2002-02-25 Miguel de Icaza <miguel@ximian.com>
26322 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
26323 the verbatim-string-literal
26325 * support.cs (InternalParameters.ParameterModifier): handle null
26327 (InternalParameters.ParameterType): ditto.
26329 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
26330 duplicating the name of the variable parameter.
26331 (GetParameterByName): Fix bug where we were not looking up array
26332 paramters if they were the only present (thanks Paolo!).
26333 (GetParameterInfo): We only have an empty set of types if both
26334 fixed and array are set to null.
26335 (GetParameterInfo-idx): Handle FixedParameter == null
26337 * cs-parser.jay: Handle the case where there is no catch
26338 statements (missing null test).
26340 2002-02-22 Miguel de Icaza <miguel@ximian.com>
26342 * driver.cs (MainDriver): Be conservative on our command line
26345 Catch DirectoryNotFoundException when calling GetFiles.
26347 (SplitPathAndPattern): Used to split the input specification into
26348 a path and a pattern that we can feed to Directory.GetFiles.
26350 2002-02-21 Miguel de Icaza <miguel@ximian.com>
26352 * statement.cs (Fixed): Implement the last case of the Fixed
26353 statement (string handling).
26355 * expression.cs (StringPtr): New class used to return a char * to
26356 a string; Used by the Fixed statement.
26358 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
26360 * expression.cs (Binary.ResolveOperator): Remove redundant
26361 MemberLookup pn parent type.
26362 Optimize union call, we do not need a union if the types are the same.
26363 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
26366 Specialize the use of MemberLookup everywhere, instead of using
26367 the default settings.
26369 (StackAlloc): Implement stackalloc keyword.
26371 * cs-parser.jay: Add rule to parse stackalloc.
26373 * driver.cs: Handle /h, /help, /?
26375 * expression.cs (MakeByteBlob): Removed the hacks we had in place
26376 before we supported unsafe code.
26378 * makefile: add --unsafe to the self compilation of mcs.
26380 2002-02-20 Miguel de Icaza <miguel@ximian.com>
26382 * expression.cs (PointerArithmetic): New class that is used to
26383 perform pointer arithmetic.
26384 (Binary.Resolve): Handle pointer arithmetic
26385 Handle pointer comparission.
26386 (ArrayPtr): Utility expression class that is used to take the
26387 address of an array.
26389 (ElementAccess): Implement array access for pointers
26391 * statement.cs (Fixed): Implement fixed statement for arrays, we
26392 are missing one more case before we are done.
26394 * expression.cs (Indirection): Implement EmitAssign and set the
26395 ExprClass to Variable. This allows pointer dereferences to be
26396 treated as variables, and to have values assigned to them.
26398 * ecore.cs (Expression.StoreFromPtr): New utility function to
26399 store values dereferencing.
26401 2002-02-20 Ravi Pratap <ravi@ximian.com>
26403 * expression.cs (Binary.ResolveOperator): Ensure that we are
26404 not trying to operate on a void type - this fixes the reported
26407 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
26408 the parent implementation is sealed.
26410 * ../errors/cs0239.cs : Add.
26412 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
26414 * typemanager.cs (unverifiable_code_type): Corresponds to
26415 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
26416 which have unsafe code in them.
26418 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
26421 2002-02-19 Miguel de Icaza <miguel@ximian.com>
26423 * cs-tokenizer.cs: Add support for @"litreal strings"
26425 Make tokenizer accept pre-processor directives
26426 on any column (remove the old C-like limitation).
26428 * rootcontext.cs (EmitCode): Emit any global attributes.
26429 (AddGlobalAttributes): Used to keep track of assembly attributes.
26431 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
26433 * cs-parser.jay: Add support for global attributes.
26435 2002-02-17 Miguel de Icaza <miguel@ximian.com>
26437 * expression.cs (Indirection): New helper class. Unary will
26438 create Indirection classes to be able to implement the
26439 IMemoryLocation interface on it.
26441 2002-02-16 Miguel de Icaza <miguel@ximian.com>
26443 * cs-parser.jay (fixed_statement): reference the right statement.
26445 * statement.cs (Fixed.Emit): Finish implementing the fixed
26446 statement for the &x case.
26448 2002-02-14 Miguel de Icaza <miguel@ximian.com>
26450 * class.cs (Property.Define, Method.Define): Remove newslot when
26453 * modifiers.cs: My use of NewSlot when `Abstract' was set was
26454 wrong. NewSlot should only be used if the `new' keyword is present.
26456 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
26457 locating our system dir. Sorry about this.
26459 2002-02-13 Miguel de Icaza <miguel@ximian.com>
26461 * driver.cs (GetSystemDir): Compute correctly the location of our
26462 system assemblies. I was using the compiler directory instead of
26463 the library directory.
26465 2002-02-13 Ravi Pratap <ravi@ximian.com>
26467 * expression.cs (BetterFunction): Put back in what Miguel commented out
26468 since it is the correct fix. The problem is elsewhere ;-)
26470 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
26471 parameters of the parms method are themselves compatible or not !
26473 (StandardConversionExists): Fix very dangerous bug where we were forgetting
26474 to check that a class implements an interface before saying that an implicit
26475 conversion was allowed. Use ImplementsInterface to do the checking.
26477 2002-02-13 Miguel de Icaza <miguel@ximian.com>
26479 * class.cs (Method.Define): Track whether we are an explicit
26480 implementation or not. And only call DefineMethodOverride if we
26481 are an explicit implementation.
26483 (Property.DefineMethod): Ditto.
26485 2002-02-11 Ravi Pratap <ravi@ximian.com>
26487 * expression.cs (BetterFunction): Catch hideous bug which was
26488 preventing us from detecting ambiguous calls due to implicit casts i.e
26491 2002-01-29 Miguel de Icaza <miguel@ximian.com>
26493 * support.cs (Pair): Remove un-needed method. I figured why I was
26494 getting the error in cs-parser.jay, the variable in a foreach loop
26495 is readonly, and the compiler does not really treat this as a variable.
26497 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
26498 instead of EQUALS in grammar.
26500 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
26502 * expression.cs (Unary.DoResolve): Check whether the argument is
26505 2002-01-28 Miguel de Icaza <miguel@ximian.com>
26507 * support.cs: Api for Pair to set a value. Despite the fact that
26508 the variables are public the MS C# compiler refuses to compile
26509 code that accesses the field if the variable is part of a foreach
26512 * statement.cs (Fixed): Begin implementation of the fixed
26515 (Block.AddVariable): Return the VariableInfo on success and null
26516 on failure instead of true/false.
26518 * cs-parser.jay (foreach): Catch errors on variables already
26519 defined (we were ignoring this value before) and properly unwind
26520 the block hierarchy
26522 (fixed_statement): grammar for the fixed statement.
26524 2002-01-25 Miguel de Icaza <miguel@ximian.com>
26526 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
26527 pointer types to be incretemented.
26529 (SizeOf): Implement.
26531 * cs-parser.jay (pointer_member_access): Implement
26532 expr->IDENTIFIER production.
26534 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
26535 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
26538 (Unary): Implement indirection.
26540 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
26541 use in non-unsafe context).
26543 (SimpleName.DoResolve): Check for pointers in field access on safe
26546 (Expression.LoadFromPtr): Factor the load-indirect code in this
26547 function. This was duplicated in UnboxCast and ParameterReference
26549 2002-01-24 Miguel de Icaza <miguel@ximian.com>
26551 * expression.cs (ComposedCast): report an error if a pointer cast
26552 is used in a safe region.
26554 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
26555 pointer type casts in unsafe context.
26557 * codegen.cs (EmitContext): Set up IsUnsafe.
26559 * cs-parser.jay (non_expression_type): Add productions for pointer
26562 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
26563 code. We should not use force into static mode if the method is
26564 not virtual. Fixes bug in MIS
26566 * statement.cs (Do.Emit, While.Emit, For.Emit,
26567 Statement.EmitBoolExpression): Add support to Do and While to
26568 propagate infinite loop as `I do return' semantics.
26570 Improve the For case to also test for boolean constants.
26572 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
26573 to the list of attributes we can add.
26575 Remove `EmitContext' argument.
26577 * class.cs (Method.Define): Apply parameter attributes.
26578 (Constructor.Define): Apply parameter attributes.
26579 (MethodCore.LabelParameters): Move here the core of labeling
26582 * support.cs (ReflectionParameters.ParameterModifier,
26583 InternalParameters.ParameterModifier): Use IsByRef on the type and
26584 only return the OUT bit for these parameters instead of in/out/ref
26587 This is because I miss-understood things. The ParameterInfo.IsIn
26588 and IsOut represent whether the parameter has the [In] and [Out]
26591 2002-01-22 Miguel de Icaza <miguel@ximian.com>
26593 * ecore.cs (FieldExpr.Emit): Release temporaries.
26595 * assign.cs (LocalTemporary.Release): new function.
26597 * codegen.cs (EmitContext.GetTemporaryStorage,
26598 EmitContext.FreeTemporaryStorage): Rework the way we deal with
26599 temporary storage. Now we can "put back" localbuilders when we
26602 2002-01-21 Miguel de Icaza <miguel@ximian.com>
26604 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
26605 need to make a copy of the variable to generate verifiable code.
26607 2002-01-19 Miguel de Icaza <miguel@ximian.com>
26609 * driver.cs: Compute dynamically the system directory.
26611 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
26612 Slower, but more generally useful. Used by the abstract
26613 registering implementation.
26615 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
26616 the rules for the special rule on Type/instances. First check if
26617 we have the same name, and if so, try that special static path
26618 rather than the instance path.
26620 2002-01-18 Miguel de Icaza <miguel@ximian.com>
26622 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
26625 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
26626 Enum, ValueType, Delegate or Array for non-corlib compiles.
26628 * cs-tokenizer.cs: Catch long identifiers (645)
26630 * typemanager.cs (IndexerPropetyName): Ravi never tested this
26633 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
26634 fix, we were returning too early, so we were not registering
26635 pending methods from abstract classes.
26637 Do not register pending methods if the class is abstract.
26639 * expression.cs (Conditional.DoResolve): Report circular implicit
26640 conversions when we neecd to compute it for conditional
26643 (Is.DoResolve): If the expression is always of the provided type,
26644 flag warning 183. If the expression can not ever be of the
26645 provided type flag warning 184.
26647 * class.cs: Catch 169 as well.
26649 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
26652 2002-01-18 Nick Drochak <ndrochak@gol.com>
26654 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
26656 2002-01-17 Miguel de Icaza <miguel@ximian.com>
26658 * interface.cs: (PopulateMethod): Check for pointers being defined
26659 only if the unsafe context is active.
26660 (PopulateProperty): ditto.
26661 (PopulateIndexer): ditto.
26663 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
26664 specified. If pointers are present, make sure that they are
26665 present in an unsafe context.
26666 (Constructor, Constructor.Define): ditto.
26667 (Field, Field.Define): ditto.
26668 (Property, Property.Define): ditto.
26669 (Event, Event.Define): ditto.
26671 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
26672 hashtable if there are classes or structs defined.
26674 * expression.cs (LocalVariableReference.DoResolve): Simplify this
26675 code, as the constant resolution moved.
26677 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
26678 the metadata, so we can flag error 133.
26680 * decl.cs (MemberCore.UnsafeOK): New function to test that a
26681 pointer is being declared in an unsafe context.
26683 2002-01-16 Miguel de Icaza <miguel@ximian.com>
26685 * modifiers.cs (Modifiers.Check): Require a Location argument.
26686 Report error 227 for Unsafe use.
26688 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
26690 * statement.cs (For.Emit): If the test is null, then report that
26691 we do `return', as we wont reach anything afterwards.
26693 (Switch.SwitchGoverningType): Track the expression that matched
26696 * driver.cs: Allow negative numbers as an error code to flag.
26698 * cs-parser.jay: Handle 1551.
26700 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
26702 2002-01-15 Miguel de Icaza <miguel@ximian.com>
26704 * cs-parser.jay: Report 1518 (type declaration can only contain
26705 class, struct, interface, enum or delegate)
26707 (switch_label): Report 1523 (keywords `case' or `default' must
26710 (opt_switch_sections): Report 1522 (empty switch)
26712 * driver.cs: Report 1515 (response file specified multiple times)
26713 Report 1516 (Source file specified multiple times).
26715 * expression.cs (Argument.Resolve): Signal 1510
26717 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
26718 access not allowed in static code)
26720 2002-01-11 Ravi Pratap <ravi@ximian.com>
26722 * typemanager.cs (IsPointerType): Utility method which we are going
26725 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
26726 the object type, so we take care of that.
26728 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
26730 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
26731 added to non-params parameters :-)
26733 * typemanager.cs (CSharpName): Include 'void' type too.
26735 (void_ptr_type): Include in the set of core types.
26737 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
26740 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
26743 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
26744 completely forgotten about it.
26746 2002-01-10 Ravi Pratap <ravi@ximian.com>
26748 * cs-parser.jay (pointer_type): Add. This begins our implementation
26749 of parsing rules for unsafe code.
26751 (unsafe_statement): Implement.
26753 (embedded_statement): Modify to include the above.
26755 * statement.cs (Unsafe): Implement new class for unsafe blocks.
26757 * codegen.cs (EmitContext.InUnsafe): Add. This determines
26758 if the current context is an unsafe one.
26760 * cs-parser.jay (local_variable_pointer_type): Since local variable types
26761 are handled differently, we need separate rules for them.
26763 (local_variable_declaration): Update to use local_variable_pointer_type
26764 to allow variable declarations of unmanaged pointer types.
26766 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
26767 in unsafe contexts.
26769 * ../errors/cs0214.cs : Add.
26771 2002-01-16 Nick Drochak <ndrochak@gol.com>
26773 * makefile: remove 'response' file when cleaning.
26775 2002-01-15 Miguel de Icaza <miguel@ximian.com>
26777 * cs-parser.jay: Report 1524.
26779 2002-01-14 Miguel de Icaza <miguel@ximian.com>
26781 * typemanager.cs (RegisterMethod): drop checking if we have
26782 registered this from here
26784 2002-01-12 Miguel de Icaza <miguel@ximian.com>
26786 * class.cs (Method.EmitDestructor): Implement calling our base
26789 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
26790 value of InFinally.
26792 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
26793 this routine and will wrap the call in a try/catch block. Deal
26796 2002-01-11 Miguel de Icaza <miguel@ximian.com>
26798 * ecore.cs (Expression.MemberLookup): instead of taking a
26799 parameter `same_type' that was used to tell whether we could
26800 access private members we compute our containing type from the
26803 (FieldExpr): Added partial support for volatile fields. This does
26804 not work for volatile fields exposed from assemblies, as I can not
26805 figure out how to extract the modreq from it.
26807 Updated all the source files to use this.
26809 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
26810 because it is referenced by MemberLookup very often.
26812 2002-01-09 Ravi Pratap <ravi@ximian.com>
26814 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
26815 TypeBuilder.GetCustomAttributes to retrieve what we need.
26817 Get rid of redundant default_member_attr_type as this is the same as
26818 default_member_type which already exists.
26820 * interface.cs, attribute.cs : Update accordingly.
26822 2002-01-08 Miguel de Icaza <miguel@ximian.com>
26824 * typemanager.cs: Enable IndexerPropertyName again. It does not
26825 work for TYpeBuilders though. Ravi, can you please fix this?
26827 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
26829 * expression.cs (Argument.Emit): Handle the case of ref objects
26830 being passed to ref functions;
26832 (ParameterReference.EmitLoad): Loads the content of the pointer
26833 without dereferencing.
26835 2002-01-07 Miguel de Icaza <miguel@ximian.com>
26837 * cs-tokenizer.cs: Implemented the pre-processing expressions.
26839 2002-01-08 Ravi Pratap <ravi@ximian.com>
26841 * class.cs (Indexer.DefineMethod): Incorporate the interface
26842 type in the name of the method if we are doing explicit interface
26845 * expression.cs (ConversionExists): Remove as it is completely obsolete.
26847 (BetterConversion): Fix extremely trivial bug where we were referring to
26848 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
26851 * ../errors/bug16.cs : Add although we have fixed it.
26853 2002-01-07 Miguel de Icaza <miguel@ximian.com>
26855 * expression.cs (BaseIndexer): Begin implementation.
26857 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
26859 * cs-parser.jay (indexer_declarator): Use qualified_identifier
26860 production directly to remove a shift/reduce, and implement
26861 explicit interface implementation.
26863 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
26864 after a floating point suffix.
26866 * expression.cs (DoNumericPromotions): Improved the conversion for
26867 uint/uint. If we have a constant, we avoid doing a typecast to a
26870 * class.cs (Indexer): Implement explicit interface implementation
26873 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
26875 * class.cs: make the default instance constructor public and hidebysig.
26877 2001-01-03 Ravi Pratap <ravi@ximian.com>
26879 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
26880 so we can call it from elsewhere.
26882 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
26883 we emit it internally if the class has a defined indexer; otherwise the user
26884 emits it by decorating the class definition with the DefaultMemberAttribute.
26886 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
26887 attribute is not used on a type which defines an indexer.
26889 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
26890 character when we skip whitespace.
26892 * ../errors/cs0646.cs : Add.
26894 2002-01-03 Miguel de Icaza <miguel@ximian.com>
26896 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
26899 * makefile: Add practical target `mcs3.exe' which builds the third
26900 generation compiler.
26902 * expression.cs (New): Fix structures constructor calling.
26904 * class.cs (Property, Method, Indexer): Emit Final flag on the
26905 method if we are an interface implementation and we are not
26908 * ecore.cs (PropertyExpr): New public field `IsBase', tells
26909 whether this property is referencing a `base' method.
26911 * expression.cs (Invocation.EmitCall): take an extra argument:
26912 is_base, this is used to determine whether the `call' or
26913 `callvirt' opcode should be used.
26916 * delegate.cs: update EmitCall.
26918 * class.cs (Method.Define): Set NewSlot for the cases where we are
26919 not implementing an interface method.
26921 (Property.Define): ditto.
26923 2002-01-02 Miguel de Icaza <miguel@ximian.com>
26925 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
26926 'r'. Allows mcs to parse itself fully.
26928 2002-01-02 Ravi Pratap <ravi@ximian.com>
26930 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
26931 of the number of initializers that require the InitializeArray method.
26933 (CheckIndices): Store the Expression in all cases - not the plain value. Also
26934 update the above field where necessary.
26936 (MakeByteBlob): Update accordingly.
26938 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
26941 (EmitDynamicInitializers): Update in accordance with the new optimization.
26943 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
26944 same OpCode applies.
26946 * cs-parser.jay : Fix some glaring errors I introduced.
26948 2002-01-01 Ravi Pratap <ravi@ximian.com>
26950 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
26951 so that we can check for name clashes there too.
26953 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
26954 for interface indexers.
26956 * interfaces.cs (Define): Emit the default member attribute.
26958 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
26959 variable was being referred to while setting the value ;-)
26961 2002-01-01 Miguel de Icaza <miguel@ximian.com>
26963 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
26964 byte-by-byte information when we know the data is zero.
26966 Make the block always a multiple of 4, because
26967 DefineInitializedData has a bug.
26969 * assign.cs: Fix, we should assign from the temporary, not from
26972 * expression.cs (MakeByteBlob): Fix my incorrect code.
26974 2001-12-31 Miguel de Icaza <miguel@ximian.com>
26976 * typemanager.cs (EnumToUnderlying): This function is used to get
26977 the underlying type from an enumeration, because it does not
26980 * constant.cs: Use the I4_S form for values between -128 and 127.
26982 * statement.cs (Block.LookupLabel): Looks up a label.
26983 (Block): Drop support for labeled blocks.
26985 (LabeledStatement): New kind of statement that represents a label
26988 (Goto): Finally implement this bad boy.
26990 * cs-parser.jay: Update to reflect new mechanism to implement
26993 2001-12-30 Miguel de Icaza <miguel@ximian.com>
26995 * codegen.cs (EmitContext.This): a codegen property that keeps the
26996 a single instance of this instead of creating many different this
26999 * delegate.cs (Delegate.DoResolve): Update to use the property;
27001 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
27003 * expression.cs (BaseAccess.DoResolve): Ditto.
27005 2001-12-29 Ravi Pratap <ravi@ximian.com>
27007 * typemanager.cs (methodimpl_attr_type): Add to hold the type
27008 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
27010 (InitCoreTypes): Update accordingly.
27012 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
27013 so we can quickly store the state.
27015 (ApplyAttributes): Set the correct implementation flags
27016 for InternalCall methods.
27018 2001-12-29 Miguel de Icaza <miguel@ximian.com>
27020 * expression.cs (EmitCall): if a method is not virtual, then do
27021 not use callvirt on it.
27023 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
27024 user defined stuff) requires the use of stobj, which takes an
27025 address on the stack instead of an array and an index. So emit
27026 the Ldelema operation for it.
27028 (EmitStoreOpcode): Use stobj for valuetypes.
27030 (UnaryMutator.EmitCode): Use the right 1 value depending on
27031 whether we are dealing with int64/uint64, float or doubles.
27033 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
27034 constructors that I implemented last night.
27036 (Constructor.IsDefault): Fix to work properly for static
27039 * cs-parser.jay (CheckDef): report method signature errors.
27040 Update error number 103 to be 132.
27042 * decl.cs: New AdditionResult enumeration value: MethodExists.
27043 Although we do this check for methods later on in the semantic
27044 analysis, catching repeated default constructors is so easy that
27045 we catch these here.
27047 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
27050 (ParameterReference.EmitAssign, Emit): handle
27053 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
27054 (ArrayAccess.EmitStoreOpcode): ditto.
27056 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
27058 * expression.cs (MakeByteBlob): Complete all the missing types
27059 (uint, short, ushort, byte, sbyte)
27061 * class.cs: Only init instance field initializers on instance
27064 Rename `constructors' to instance_constructors.
27066 (TypeContainer.AddConstructor): Only add constructors to the list
27067 if it is not static.
27069 Make sure that we handle default_static_constructor independently
27070 everywhere where we handle instance_constructors
27072 2001-12-28 Miguel de Icaza <miguel@ximian.com>
27074 * class.cs: Do not lookup or create a base initializer for a
27075 static constructor.
27077 (ConstructorInitializer.Resolve): use the proper type to lookup
27080 * cs-parser.jay: Report error 1585 (modifiers between type and name).
27082 * enum.cs, interface.cs: Remove CloseType, this is taken care by
27085 * decl.cs: CloseType is now an virtual method, the default
27086 implementation just closes this type.
27088 2001-12-28 Ravi Pratap <ravi@ximian.com>
27090 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
27091 to PreserveSig by default. Also emit HideBySig on such methods.
27093 Basically, set the defaults to standard values.
27095 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
27096 argument, if candidate is better, it can't be worse than the best !
27098 (Invocation): Re-write bits to differentiate between methods being
27099 applicable in their expanded form and their normal form - for params
27102 Get rid of use_standard everywhere as only standard conversions are allowed
27103 in overload resolution.
27105 More spec conformance.
27107 2001-12-27 Miguel de Icaza <miguel@ximian.com>
27109 * driver.cs: Add --timestamp, to see where the compiler spends
27112 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
27113 `this' in static code.
27115 (SimpleName.DoResolve): Implement in terms of a helper function
27116 that allows static-references to be passed upstream to
27119 (Expression.ResolveWithSimpleName): Resolve specially simple
27120 names when called by MemberAccess to implement the special
27123 (Expression.ImplicitReferenceConversion): Handle conversions from
27124 Null to reference types before others, as Null's type is
27127 * expression.cs (Invocation.EmitCall): Handle the special case of
27128 calling methods declared on a reference type from a ValueType
27129 (Base classes System.Object and System.Enum)
27131 (MemberAccess.Resolve): Only perform lookups on Enumerations if
27132 the left hand side is a TypeExpr, not on every enumeration.
27134 (Binary.Resolve): If types are reference types, then do a cast to
27135 object on operators != and == of both arguments.
27137 * typemanager.cs (FindMembers): Extract instance and static
27138 members if requested.
27140 * interface.cs (PopulateProperty): Use void_type instead of null
27141 as the return type for the setter method.
27143 (PopulateIndexer): ditto.
27145 2001-12-27 Ravi Pratap <ravi@ximian.com>
27147 * support.cs (ReflectionParameters): Fix minor bug where we
27148 were examining the wrong parameter for the ParamArray attribute.
27150 Cope with requests for the type of the parameter at position
27151 greater than the params parameter's. We now return the element
27152 type of the params array as that makes more sense.
27154 * expression.cs (Invocation.IsParamsMethodApplicable): Update
27155 accordingly as we no longer have to extract the element type
27158 (Invocation.OverloadResolve): Update.
27160 2001-12-27 Miguel de Icaza <miguel@ximian.com>
27162 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
27163 against IEnumerator, test whether the return value is a descendant
27164 of the IEnumerator interface.
27166 * class.cs (Indexer.Define): Use an auxiliary method to implement
27167 the other bits of the method definition. Begin support for
27168 explicit interface implementation.
27170 (Property.DefineMethod): Use TypeManager.void_type instead of null
27171 for an empty return value.
27173 2001-12-26 Miguel de Icaza <miguel@ximian.com>
27175 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
27176 dealing with a FieldExpr which is composed of a FieldBuilder, in
27177 the code path we did extract the constant, but we should have
27178 obtained the underlying value to be able to cast it (otherwise we
27179 end up in an infinite loop, this is what Ravi was running into).
27181 (ArrayCreation.UpdateIndices): Arrays might be empty.
27183 (MemberAccess.ResolveMemberAccess): Add support for section
27184 14.5.4.1 that deals with the special case of E.I when E is a type
27185 and something else, that I can be a reference to a static member.
27187 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
27188 handle a particular array type to create byte blobs, it is just
27189 something we dont generate byteblobs for.
27191 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
27194 * location.cs (Push): remove the key from the hashtable that we
27195 are about to add. This happens for empty files.
27197 * driver.cs: Dispose files after we have parsed them.
27199 (tokenize): new function that only runs the tokenizer on its
27200 input, for speed testing.
27202 2001-12-26 Ravi Pratap <ravi@ximian.com>
27204 * class.cs (Event.Define): Define the private field only if there
27205 are no accessors defined.
27207 * expression.cs (ResolveMemberAccess): If there is no associated
27208 field with the event, that means we have an event defined with its
27209 own accessors and we should flag error cs0070 since transforming
27210 ourselves into a field is not valid in that case.
27212 * ecore.cs (SimpleName.DoResolve): Same as above.
27214 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
27215 and charset to sane values.
27217 2001-12-25 Ravi Pratap <ravi@ximian.com>
27219 * assign.cs (DoResolve): Perform check on events only if they
27220 are being accessed outside the declaring type.
27222 * cs-parser.jay (event_declarations): Update rules to correctly
27223 set the type of the implicit parameter etc.
27225 (add_accessor, remove_accessor): Set current local parameters.
27227 * expression.cs (Binary): For delegate addition and subtraction,
27228 cast the return value from the method into the appropriate delegate
27231 2001-12-24 Ravi Pratap <ravi@ximian.com>
27233 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
27234 of these as the workaround is unnecessary.
27236 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
27237 delegate data - none of that is needed at all.
27239 Re-write bits to extract the instance expression and the delegate method
27242 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
27245 * attribute.cs (ApplyAttributes): New method to take care of common tasks
27246 of attaching attributes instead of duplicating code everywhere.
27248 * everywhere : Update code to do attribute emission using the above method.
27250 2001-12-23 Miguel de Icaza <miguel@ximian.com>
27252 * expression.cs (IsParamsMethodApplicable): if there are not
27253 parameters, return immediately.
27255 * ecore.cs: The 0 literal can be implicity converted to an enum
27258 (SimpleName.DoResolve): First lookup the type, then lookup the
27261 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
27262 want to get its address. If the InstanceExpression is not
27263 addressable, store the result in a temporary variable, then get
27266 * codegen.cs: Only display 219 errors on warning level or above.
27268 * expression.cs (ArrayAccess): Make it implement the
27269 IMemoryLocation interface.
27271 (Binary.DoResolve): handle the operator == (object a, object b)
27272 and operator != (object a, object b) without incurring into a
27273 BoxedCast (because 5 != o should never be performed).
27275 Handle binary enumerator operators.
27277 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
27278 value type, otherwise use Ldelem_ref.
27280 Use precomputed names;
27282 (AddressOf): Implement address of
27284 * cs-parser.jay (labeled_statement): Fix recursive block
27285 addition by reworking the production.
27287 * expression.cs (New.DoEmit): New has a special case:
27289 If we are dealing with a ValueType, we have a few
27290 situations to deal with:
27292 * The target of New is a ValueType variable, that is
27293 easy, we just pass this as the variable reference
27295 * The target of New is being passed as an argument,
27296 to a boxing operation or a function that takes a
27299 In this case, we need to create a temporary variable
27300 that is the argument of New.
27303 2001-12-23 Ravi Pratap <ravi@ximian.com>
27305 * rootcontext.cs (LookupType): Check that current_type is not null before
27306 going about looking at nested types.
27308 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
27309 not implement the IAssignMethod interface any more.
27311 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
27312 where we tranform them into FieldExprs if they are being resolved from within
27313 the declaring type.
27315 * ecore.cs (SimpleName.DoResolve): Do the same here.
27317 * assign.cs (DoResolve, Emit): Clean up code considerably.
27319 * ../errors/bug10.cs : Add.
27321 * ../errors/cs0070.cs : Add.
27323 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
27325 * assign.cs : Get rid of EventIsLocal everywhere.
27327 2001-12-23 Miguel de Icaza <miguel@ximian.com>
27329 * ecore.cs (ConvertIntLiteral): finished the implementation.
27331 * statement.cs (SwitchLabel): Convert the value we are using as a
27332 key before looking up the table.
27334 2001-12-22 Miguel de Icaza <miguel@ximian.com>
27336 * codegen.cs (EmitTopBlock): Require a Location argument now.
27338 * cs-parser.jay (constructor_declarator): We need to setup
27339 current_local_parameters before we parse the
27340 opt_constructor_initializer, to allow the variables to be bound
27341 to the constructor arguments.
27343 * rootcontext.cs (LookupType): First lookup nested classes in our
27344 class and our parents before we go looking outside our class.
27346 * expression.cs (ConstantFold): Extract/debox the values at the
27349 * rootcontext.cs (EmitCode): Resolve the constants first before we
27350 resolve the types. This is not really needed, but it helps debugging.
27352 * statement.cs: report location.
27354 * cs-parser.jay: pass location to throw statement.
27356 * driver.cs: Small bug fix.
27358 * report.cs: Updated format to be 4-zero filled digits.
27360 2001-12-22 Ravi Pratap <ravi@ximian.com>
27362 * expression.cs (CheckIndices): Fix minor bug where the wrong
27363 variable was being referred to ;-)
27365 (DoEmit): Do not call EmitStaticInitializers when the
27366 underlying type is System.Object.
27368 2001-12-21 Ravi Pratap <ravi@ximian.com>
27370 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
27371 and do the usual workaround for SRE.
27373 * class.cs (MyEventBuilder.EventType): New member to get at the type
27374 of the event, quickly.
27376 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
27378 * assign.cs (Assign.DoResolve): Handle the case when the target
27379 is an EventExpr and perform the necessary checks.
27381 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
27384 (SimpleName.MemberStaticCheck): Include check for EventExpr.
27386 (EventExpr): Set the type in the constructor itself since we
27387 are meant to be born fully resolved.
27389 (EventExpr.Define): Revert code I wrote earlier.
27391 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
27392 instance expression is null. The instance expression is a This in that case
27393 or a null, depending on whether it is a static method or not.
27395 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
27396 refers to more than one method.
27398 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
27399 and accordingly flag errors.
27401 2001-12-21 Miguel de Icaza <miguel@ximian.com>
27403 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
27405 2001-12-22 Miguel de Icaza <miguel@ximian.com>
27407 * location.cs (ToString): Provide useful rutine.
27409 2001-12-21 Miguel de Icaza <miguel@ximian.com>
27411 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
27412 objects, return the actual integral boxed.
27414 * statement.cs (SwitchLabel): define an ILLabel for each
27417 (Switch.CheckSwitch): If the value is a Literal, extract
27418 the underlying literal.
27420 Also in the unused hashtable we had, add the SwitchLabel so we can
27421 quickly look this value up.
27423 * constant.cs: Implement a bunch of new constants. Rewrite
27424 Literal based on this. Made changes everywhere to adapt to this.
27426 * expression.cs (Expression.MakeByteBlob): Optimize routine by
27427 dereferencing array only once, and also copes with enumrations.
27429 bytes are two bytes wide, not one.
27431 (Cast): Perform constant conversions.
27433 * ecore.cs (TryImplicitIntConversion): Return literals instead of
27434 wrappers to the literals here.
27436 * expression.cs (DoNumericPromotions): long literals can converted
27437 to ulong implicity (this is taken care of elsewhere, but I was
27438 missing this spot).
27440 * ecore.cs (Expression.Literalize): Make the return type Literal,
27441 to improve type checking.
27443 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
27445 2001-12-20 Miguel de Icaza <miguel@ximian.com>
27447 * literal.cs: Revert code from ravi that checked the bounds. The
27448 bounds are sane by the definition of the type itself.
27450 * typemanager.cs: Fix implementation of ImplementsInterface. We
27451 need to actually look up in our parent hierarchy for interfaces
27454 * const.cs: Use the underlying type for enumerations
27456 * delegate.cs: Compute the basename for the delegate creation,
27457 that should fix the delegate test case, and restore the correct
27458 Type Lookup semantics in rootcontext
27460 * rootcontext.cs: Revert Ravi's last patch. The correct way of
27461 referencing a nested type with the Reflection API is using the "+"
27464 * cs-parser.jay: Do not require EOF token at the end.
27466 2001-12-20 Ravi Pratap <ravi@ximian.com>
27468 * rootcontext.cs (LookupType): Concatenate type names with
27469 a '.' instead of a '+' The test suite passes again.
27471 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
27472 field of the enumeration.
27474 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
27475 the case when the member is an EventExpr.
27477 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
27478 static has an associated instance expression.
27480 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
27482 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
27484 * class.cs (Event.Define): Register event and perform appropriate checks
27487 We define the Add and Remove methods even if the use provides none because
27488 in that case, we provide default implementations ourselves.
27490 Define a private field of the type of the event. This is done by the CSC compiler
27491 and we should be doing it too ;-)
27493 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
27494 More methods we use in code we generate.
27496 (multicast_delegate_type, delegate_type): Two separate types since the distinction
27499 (InitCoreTypes): Update accordingly for the above.
27501 * class.cs (Event.Emit): Generate code for default accessors that we provide
27503 (EmitDefaultMethod): Do the job in the above.
27505 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
27508 2001-12-20 Miguel de Icaza <miguel@ximian.com>
27510 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
27511 builders even if we were missing one.
27513 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
27514 pass the Basename as our class name instead of the Name. The
27515 basename will be correctly composed for us.
27517 * parameter.cs (Paramters): Now takes a Location argument.
27519 * decl.cs (DeclSpace.LookupType): Removed convenience function and
27520 make all the code call directly LookupType in RootContext and take
27521 this chance to pass the Location information everywhere.
27523 * Everywhere: pass Location information.
27525 2001-12-19 Miguel de Icaza <miguel@ximian.com>
27527 * class.cs (Constructor.Define): Updated way of detecting the
27528 length of the parameters.
27530 (TypeContainer.DefineType): Use basename as the type name for
27533 (TypeContainer.Define): Do not recursively define types here, as
27534 definition is taken care in order by the RootContext.
27536 * tree.cs: Keep track of namespaces in a per-file basis.
27538 * parameter.cs (Parameter.ComputeSignature): Update to use
27541 (Parameters.GetSignature): ditto.
27543 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
27544 instead of a TypeContainer.
27546 (Interface.SemanticAnalysis): Use `this' instead of our parent to
27547 resolve names. Because we need to be resolve in our context, not
27550 * driver.cs: Implement response files.
27552 * class.cs (TypeContainer.DefineType): If we are defined, do not
27553 redefine ourselves.
27555 (Event.Emit): Emit the code for add/remove handlers.
27556 (Event.Define): Save the MethodBuilders for add/remove.
27558 * typemanager.cs: Use pair here too.
27560 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
27561 DictionaryEntry requires the first argument to be non-null.
27563 (enum_declaration): Compute full name for registering the
27566 (delegate_declaration): Instead of using
27567 formal_parameter_list, use opt_formal_parameter_list as the list
27570 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
27571 (EventParsing): New property that controls whether `add' and
27572 `remove' are returned as tokens or identifiers (for events);
27574 2001-12-19 Ravi Pratap <ravi@ximian.com>
27576 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
27577 use MyEventBuilder only and let it wrap the real builder for us.
27579 (MyEventBuilder): Revamp constructor etc.
27581 Implement all operations that we perform on EventBuilder in precisely the same
27584 (FindMembers): Update to use the EventBuilder member.
27586 (Event.Emit): Update accordingly.
27588 2001-12-18 Ravi Pratap <ravi@ximian.com>
27590 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
27591 by calling the appropriate methods.
27593 (GetCustomAttributes): Make stubs as they cannot possibly do anything
27596 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
27598 2001-12-17 Ravi Pratap <ravi@ximian.com>
27600 * delegate.cs (Delegate.Populate): Check that the return type
27601 and various parameters types are indeed accessible.
27603 * class.cs (Constructor.Define): Same here.
27605 (Field.Define): Ditto.
27607 (Event.Define): Ditto.
27609 (Operator.Define): Check that the underlying Method defined itself
27610 correctly - so it's MethodBuilder should not be null.
27612 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
27613 expression happens to be null.
27615 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
27616 members but as of now we don't seem to be able to do anything really useful with it.
27618 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
27619 not the EventBuilder.
27621 2001-12-18 Miguel de Icaza <miguel@ximian.com>
27623 * cs-tokenizer.cs: Add support for defines.
27624 Add support for #if, #elif, #else, #endif
27626 (eval_var): evaluates a variable.
27627 (eval): stubbed for evaluating functions.
27629 * cs-parser.jay: Pass the defines information
27631 * driver.cs: Add --define command line option.
27633 * decl.cs: Move MemberCore here.
27635 Make it the base class for DeclSpace. This allows us to catch and
27636 report 108 and 109 for everything now.
27638 * class.cs (TypeContainer.Define): Extract all the members
27639 before populating and emit the warning 108 (new keyword required
27640 to override) instead of having each member implement this.
27642 (MemberCore.Define): New abstract method, we will be using this in
27643 the warning reporting engine in Populate.
27645 (Operator.Define): Adjust to new MemberCore protocol.
27647 * const.cs (Const): This does not derive from Expression, it is a
27648 temporary object we use to create fields, it is a MemberCore.
27650 * class.cs (Method.Define): Allow the entry point to be in a
27653 * driver.cs: Rewrite the argument handler to clean it up a bit.
27655 * rootcontext.cs: Made it just an auxiliary namespace feature by
27656 making everything static.
27658 * driver.cs: Adapt code to use RootContext type name instead of
27661 * delegate.cs: Remove RootContext argument.
27663 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
27666 * class.cs (Event.Define): The lookup can fail.
27668 * cs-tokenizer.cs: Begin implementation of pre-procesor.
27670 * expression.cs: Resolve the this instance before invoking the code.
27672 2001-12-17 Miguel de Icaza <miguel@ximian.com>
27674 * cs-parser.jay: Add a production in element_access that allows
27675 the thing to become a "type" reference. This way we can parse
27676 things like "(string [])" as a type.
27678 Note that this still does not handle the more complex rules of
27682 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
27684 * ecore.cs: (CopyNewMethods): new utility function used to
27685 assemble the list of methods from running FindMembers.
27687 (MemberLookup): Rework FindMembers so that
27689 2001-12-16 Miguel de Icaza <miguel@ximian.com>
27691 * class.cs (TypeContainer): Remove Delegates who fail to be
27694 * delegate.cs (Populate): Verify that we dont get null return
27695 values. TODO: Check for AsAccessible.
27697 * cs-parser.jay: Use basename to emit error 574 (destructor should
27698 have the same name as container class), not the full name.
27700 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
27701 possible representation.
27703 Also implements integer type suffixes U and L.
27705 2001-12-15 Miguel de Icaza <miguel@ximian.com>
27707 * expression.cs (ArrayCreation.DoResolve): We need to do the
27708 argument resolution *always*.
27710 * decl.cs: Make this hold the namespace. Hold the root context as
27712 (LookupType): Move here.
27714 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
27716 * location.cs (Row, Name): Fixed the code, it was always returning
27717 references to the first file.
27719 * interface.cs: Register properties defined through interfaces.
27721 * driver.cs: Add support for globbing on the command line
27723 * class.cs (Field): Make it derive from MemberCore as well.
27726 2001-12-15 Ravi Pratap <ravi@ximian.com>
27728 * class.cs (Event::Define): Check that the type of the event is a delegate
27729 type else flag error #66.
27731 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
27734 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
27735 values of EntryPoint, CharSet etc etc.
27737 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
27739 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
27740 be null and we should ignore this. I am not sure if this is really clean. Apparently,
27741 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
27742 which needs this to do its work.
27744 * ../errors/cs0066.cs : Add.
27746 2001-12-14 Miguel de Icaza <miguel@ximian.com>
27748 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
27751 * class.cs: (MethodSignature.MethodSignature): Removed hack that
27752 clears out the parameters field.
27753 (MemberSignatureCompare): Cleanup
27755 (MemberCore): New base class used to share code between MethodCore
27758 (RegisterRequiredImplementations) BindingFlags.Public requires
27759 either BindingFlags.Instace or Static. Use instance here.
27761 (Property): Refactored code to cope better with the full spec.
27763 * parameter.cs (GetParameterInfo): Return an empty array instead
27766 * class.cs (Property): Abstract or extern properties have no bodies.
27768 * parameter.cs (GetParameterInfo): return a zero-sized array.
27770 * class.cs (TypeContainer.MethodModifiersValid): Move all the
27771 method modifier validation to the typecontainer so we can reuse
27772 this on properties.
27774 (MethodCore.ParameterTypes): return an empty sized array of types.
27776 (Property.Define): Test property modifier validity.
27778 Add tests for sealed/override too.
27780 (Method.Emit): abstract or extern methods have no bodies.
27782 2001-12-14 Ravi Pratap <ravi@ximian.com>
27784 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
27787 (Method::Define, ::Emit): Modify accordingly.
27789 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
27791 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
27793 * makefile: Pass in /unsafe.
27795 2001-12-13 Miguel de Icaza <miguel@ximian.com>
27797 * class.cs (MakeKey): Kill routine.
27799 * class.cs (TypeContainer.Define): Correctly define explicit
27800 method implementations (they require the full interface name plus
27803 * typemanager.cs: Deply the PtrHashtable here and stop using the
27804 lame keys. Things work so much better.
27806 This of course broke everyone who depended on `RegisterMethod' to
27807 do the `test for existance' test. This has to be done elsewhere.
27809 * support.cs (PtrHashtable): A hashtable that avoid comparing with
27810 the object stupid Equals method (because, that like fails all over
27811 the place). We still do not use it.
27813 * class.cs (TypeContainer.SetRequiredInterface,
27814 TypeContainer.RequireMethods): Killed these two routines and moved
27815 all the functionality to RegisterRequiredImplementations.
27817 (TypeContainer.RegisterRequiredImplementations): This routine now
27818 registers all the implementations required in an array for the
27819 interfaces and abstract methods. We use an array of structures
27820 which can be computed ahead of time to reduce memory usage and we
27821 also assume that lookups are cheap as most classes will not
27822 implement too many interfaces.
27824 We also avoid creating too many MethodSignatures.
27826 (TypeContainer.IsInterfaceMethod): Update and optionally does not
27827 clear the "pending" bit if we find that there are problems with
27830 (TypeContainer.VerifyPendingMethods): Update to report errors of
27831 methods that look like implementations but are not.
27833 (TypeContainer.Define): Add support for explicit interface method
27836 2001-12-12 Miguel de Icaza <miguel@ximian.com>
27838 * typemanager.cs: Keep track of the parameters here instead of
27839 being a feature of the TypeContainer.
27841 * class.cs: Drop the registration of parameters here, as
27842 InterfaceMethods are also interface declarations.
27844 * delegate.cs: Register methods with the TypeManager not only with
27845 the TypeContainer. This code was buggy.
27847 * interface.cs: Full registation here.
27849 2001-12-11 Miguel de Icaza <miguel@ximian.com>
27851 * expression.cs: Remove reducer for binary expressions, it can not
27854 * const.cs: Put here the code that used to go into constant.cs
27856 * constant.cs: Put here the code for constants, this is a new base
27857 class for Literals.
27859 * literal.cs: Make Literal derive from Constant.
27861 2001-12-09 Miguel de Icaza <miguel@ximian.com>
27863 * statement.cs (Return.Emit): Report error 157 if the user
27864 attempts to return from a finally block.
27866 (Return.Emit): Instead of emitting a return, jump to the end of
27869 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
27870 LocalBuilder to store the result of the function. ReturnLabel is
27871 the target where we jump.
27874 2001-12-09 Radek Doulik <rodo@ximian.com>
27876 * cs-parser.jay: remember alias in current namespace
27878 * ecore.cs (SimpleName::DoResolve): use aliases for types or
27881 * class.cs (LookupAlias): lookup alias in my_namespace
27883 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
27885 (LookupAlias): lookup alias in this and if needed in parent
27888 2001-12-08 Miguel de Icaza <miguel@ximian.com>
27892 * rootcontext.cs: (ModuleBuilder) Made static, first step into
27893 making things static. I need this to avoid passing the
27894 TypeContainer when calling ParameterType.
27896 * support.cs (InternalParameters.ParameterType): Remove ugly hack
27897 that did string manipulation to compute the type and then call
27898 GetType. Use Parameter.ParameterType instead.
27900 * cs-tokenizer.cs: Consume the suffix for floating values.
27902 * expression.cs (ParameterReference): figure out whether this is a
27903 reference parameter or not. Kill an extra variable by computing
27904 the arg_idx during emission.
27906 * parameter.cs (Parameters.GetParameterInfo): New overloaded
27907 function that returns whether a parameter is an out/ref value or not.
27909 (Parameter.ParameterType): The type of the parameter (base,
27910 without ref/out applied).
27912 (Parameter.Resolve): Perform resolution here.
27913 (Parameter.ExternalType): The full type (with ref/out applied).
27915 * statement.cs (Using.Emit, Using.EmitExpression): Implement
27916 support for expressions on the using statement.
27918 2001-12-07 Miguel de Icaza <miguel@ximian.com>
27920 * statement.cs (Using.EmitLocalVariableDecls): Split the
27921 localvariable handling of the using statement.
27923 (Block.EmitMeta): Keep track of variable count across blocks. We
27924 were reusing slots on separate branches of blocks.
27926 (Try.Emit): Emit the general code block, we were not emitting it.
27928 Check the type of the declaration to be an IDisposable or
27929 something that can be implicity converted to it.
27931 Emit conversions if required.
27933 * ecore.cs (EmptyExpression): New utility class.
27934 (Expression.ImplicitConversionExists): New utility function.
27936 2001-12-06 Miguel de Icaza <miguel@ximian.com>
27938 * statement.cs (Using): Implement.
27940 * expression.cs (LocalVariableReference): Support read only variables.
27942 * statement.cs: Remove the explicit emit for the Leave opcode.
27943 (VariableInfo): Add a readonly field.
27945 2001-12-05 Miguel de Icaza <miguel@ximian.com>
27947 * ecore.cs (ConvCast): new class used to encapsulate the various
27948 explicit integer conversions that works in both checked and
27949 unchecked contexts.
27951 (Expression.ConvertNumericExplicit): Use new ConvCast class to
27952 properly generate the overflow opcodes.
27954 2001-12-04 Miguel de Icaza <miguel@ximian.com>
27956 * statement.cs: The correct type for the EmptyExpression is the
27957 element_type, not the variable type. Ravi pointed this out.
27959 2001-12-04 Ravi Pratap <ravi@ximian.com>
27961 * class.cs (Method::Define): Handle PInvoke methods specially
27962 by using DefinePInvokeMethod instead of the usual one.
27964 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
27965 above to do the task of extracting information and defining the method.
27967 2001-12-04 Ravi Pratap <ravi@ximian.com>
27969 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
27970 of the condition for string type.
27972 (Emit): Move that here.
27974 (ArrayCreation::CheckIndices): Keep string literals in their expression
27977 (EmitDynamicInitializers): Handle strings appropriately.
27979 2001-12-04 Miguel de Icaza <miguel@ximian.com>
27981 * codegen.cs (EmitContext): Replace multiple variables with a
27982 single pointer to the current Switch statement.
27984 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
27987 2001-12-03 Miguel de Icaza <miguel@ximian.com>
27991 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
27994 (Foreach.Emit): Foreach on arrays was not setting
27995 up the loop variables (for break/continue).
27997 (GotoCase): Semi-implented.
27999 2001-12-03 Ravi Pratap <ravi@ximian.com>
28001 * attribute.cs (CheckAttribute): Handle system attributes by using
28002 Attribute.GetAttributes to examine information we need.
28004 (GetValidPlaces): Same here.
28006 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
28008 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
28010 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
28012 (Method::Define): Set appropriate flags if we have a DllImport attribute.
28014 (Method::Emit): Handle the case when we are a PInvoke method.
28016 2001-12-03 Miguel de Icaza <miguel@ximian.com>
28018 * expression.cs: Use ResolveWithSimpleName on compound names.
28020 2001-12-02 Ravi Pratap <ravi@ximian.com>
28022 * constant.cs (EmitConstant): Make sure we resolve the associated expression
28023 before trying to reduce it.
28025 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
28027 * constant.cs (LookupConstantValue): Implement.
28029 (EmitConstant): Use the above in emitting the constant.
28031 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
28032 that are user-defined by doing a LookupConstantValue on them.
28034 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
28037 2001-11-29 Miguel de Icaza <miguel@ximian.com>
28039 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
28041 (BaseAccess.DoResolve): Implement.
28043 (MemberAccess.DoResolve): Split this routine into a
28044 ResolveMemberAccess routine that can be used independently
28046 2001-11-28 Miguel de Icaza <miguel@ximian.com>
28048 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
28049 As that share bits of the implementation. Is returns a boolean,
28050 while As returns the Type that is being probed.
28052 2001-12-01 Ravi Pratap <ravi@ximian.com>
28054 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
28055 instead of a Literal - much easier.
28057 (EnumInTransit): Remove - utterly useless :-)
28059 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
28061 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
28063 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
28064 chain when we have no associated expression.
28066 2001-11-30 Ravi Pratap <ravi@ximian.com>
28068 * constant.cs (Define): Use Location while reporting the errror.
28070 Also emit a warning when 'new' is used and there is no inherited
28073 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
28076 (LookupEnumValue): Implement to lookup an enum member's value and define it
28079 (Populate): Re-write accordingly to use the above routine.
28081 2001-11-27 Miguel de Icaza <miguel@ximian.com>
28083 * expression.cs (This): Fix prototype for DoResolveLValue to
28084 override the base class DoResolveLValue.
28086 * cs-parser.cs: Report errors cs574 and cs575 (destructor
28089 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
28090 (we need to load the address of the field here). This fixes
28093 (FieldExpr.DoResolveLValue): Call the DoResolve
28094 function to initialize the Instance expression.
28096 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
28097 correctly the GetEnumerator operation on a value type.
28099 * cs-parser.jay: Add more simple parsing error catches.
28101 * statement.cs (Switch): Add support for string switches.
28102 Handle null specially.
28104 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
28106 2001-11-28 Ravi Pratap <ravi@ximian.com>
28108 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
28110 (declare_local_constant): New helper function.
28112 * statement.cs (AddConstant): Keep a separate record of constants
28114 (IsConstant): Implement to determine if a variable is a constant.
28116 (GetConstantExpression): Implement.
28118 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
28120 * statement.cs (IsVariableDefined): Re-write.
28122 2001-11-27 Ravi Pratap <ravi@ximian.com>
28124 * class.cs (TypeContainer::FindMembers): Look for constants
28125 in the case when we are looking for MemberTypes.Field
28127 * expression.cs (MemberAccess::DoResolve): Check that in the
28128 case we are a FieldExpr and a Literal, we are not being accessed
28129 by an instance reference.
28131 * cs-parser.jay (local_constant_declaration): Implement.
28133 (declaration_statement): Implement for constant declarations.
28135 2001-11-26 Miguel de Icaza <miguel@ximian.com>
28137 * statement.cs (Switch): Catch double defaults.
28139 (Switch): More work on the switch() statement
28140 implementation. It works for integral values now, need to finish
28144 2001-11-24 Miguel de Icaza <miguel@ximian.com>
28146 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
28147 integer literals into other integer literals. To be used by
28150 2001-11-24 Ravi Pratap <ravi@ximian.com>
28152 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
28155 (EmitDynamicInitializers): Cope with the above since we extract data
28156 directly from ArrayData now.
28158 (ExpectInitializers): Keep track of whether initializers are mandatory
28161 (Bounds): Make it a hashtable to prevent the same dimension being
28162 recorded for every element in that dimension.
28164 (EmitDynamicInitializers): Fix bug which prevented the Set array method
28167 Also fix bug which was causing the indices to be emitted in the reverse
28170 2001-11-24 Miguel de Icaza <miguel@ximian.com>
28172 * expression.cs (ArrayCreation): Implement the bits that Ravi left
28173 unfinished. They do not work, because the underlying code is
28176 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28178 * cs-parser.jay: Remove bogus fixme.
28180 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
28181 on Switch statement.
28183 2001-11-23 Ravi Pratap <ravi@ximian.com>
28185 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
28188 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
28189 parameter. Apparently, any expression is allowed.
28191 (ValidateInitializers): Update accordingly.
28193 (CheckIndices): Fix some tricky bugs thanks to recursion.
28195 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
28196 I was being completely brain-dead.
28198 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
28199 and re-write acordingly.
28201 (DelegateInvocation): Re-write accordingly.
28203 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
28205 (MakeByteBlob): Handle types more correctly.
28207 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
28208 initialization from expressions but it is incomplete because I am a complete
28211 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28213 * statement.cs (If.Emit): Fix a bug that generated incorrect code
28214 on If. Basically, we have to return `true' (ie, we do return to
28215 our caller) only if both branches of the if return.
28217 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
28218 short-circuit operators, handle them as short circuit operators.
28220 (Cast.DoResolve): Resolve type.
28221 (Cast.Cast): Take an expression as the target type.
28223 * cs-parser.jay (cast_expression): Remove old hack that only
28224 allowed a limited set of types to be handled. Now we take a
28225 unary_expression and we resolve to a type during semantic
28228 Use the grammar productions from Rhys to handle casts (this is
28229 not complete like Rhys syntax yet, we fail to handle that corner
28230 case that C# has regarding (-x), but we will get there.
28232 2001-11-22 Ravi Pratap <ravi@ximian.com>
28234 * class.cs (EmitFieldInitializer): Take care of the case when we have a
28235 field which is an array type.
28237 * cs-parser.jay (declare_local_variables): Support array initialization too.
28239 * typemanager.cs (MakeKey): Implement.
28241 (everywhere): Use the above appropriately.
28243 * cs-parser.jay (for_statement): Update for array initialization while
28244 declaring variables.
28246 * ecore.cs : The error message was correct, it's the variable's names that
28247 were misleading ;-) Make the code more readable.
28249 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
28250 the correct type etc.
28252 (ConvertExplicit): Handle Enum types by examining the underlying type.
28254 2001-11-21 Ravi Pratap <ravi@ximian.com>
28256 * parameter.cs (GetCallingConvention): Always return
28257 CallingConventions.Standard for now.
28259 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28261 * expression.cs (Binary.ResolveOperator): Update the values of `l'
28262 and `r' after calling DoNumericPromotions.
28264 * ecore.cs: Fix error message (the types were in the wrong order).
28266 * statement.cs (Foreach.ProbeCollectionType): Need to pass
28267 BindingFlags.Instance as well
28269 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
28270 implicit int literal conversion in an empty cast so that we
28271 propagate the right type upstream.
28273 (UnboxCast): new class used to unbox value types.
28274 (Expression.ConvertExplicit): Add explicit type conversions done
28277 (Expression.ImplicitNumericConversion): Oops, forgot to test for
28278 the target type before applying the implicit LongLiterals to ULong
28281 2001-11-21 Miguel de Icaza <miguel@ximian.com>
28283 * cs-parser.jay (for_statement): Reworked the way For works: now
28284 we declare manually any variables that are introduced in
28285 for_initializer to solve the problem of having out-of-band code
28286 emition (that is what got for broken).
28288 (declaration_statement): Perform the actual variable declaration
28289 that used to be done in local_variable_declaration here.
28291 (local_variable_declaration): Do not declare anything, just pass
28292 the information on a DictionaryEntry
28294 2001-11-20 Ravi Pratap <ravi@ximian.com>
28296 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
28297 re-write of the logic to now make it recursive.
28299 (UpdateIndices): Re-write accordingly.
28301 Store element data in a separate ArrayData list in the above methods.
28303 (MakeByteBlob): Implement to dump the array data into a byte array.
28305 2001-11-19 Ravi Pratap <ravi@ximian.com>
28307 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
28310 * constant.cs (Define): Implement.
28312 (EmitConstant): Re-write fully.
28314 Pass in location info.
28316 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
28319 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
28320 DictionaryEntry since we need location info too.
28322 (constant_declaration): Update accordingly.
28324 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
28325 code into another method : UpdateIndices.
28327 2001-11-18 Ravi Pratap <ravi@ximian.com>
28329 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
28330 some type checking etc.
28332 2001-11-17 Ravi Pratap <ravi@ximian.com>
28334 * expression.cs (ArrayCreation::ValidateInitializers): Implement
28335 bits to provide dimension info if the user skips doing that.
28337 Update second constructor to store the rank correctly.
28339 2001-11-16 Ravi Pratap <ravi@ximian.com>
28341 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
28342 and try to implement.
28344 * ../errors/cs0150.cs : Add.
28346 * ../errors/cs0178.cs : Add.
28348 2001-11-16 Miguel de Icaza <miguel@ximian.com>
28350 * statement.cs: Implement foreach on multi-dimensional arrays.
28352 * parameter.cs (Parameters.GetParameterByName): Also lookup the
28353 name of the params argument.
28355 * expression.cs: Use EmitStoreOpcode to get the right opcode while
28356 initializing the array.
28358 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
28359 we can use this elsewhere.
28361 * statement.cs: Finish implementation of foreach for single
28364 * cs-parser.jay: Use an out-of-band stack to pass information
28365 around, I wonder why I need this.
28367 foreach_block: Make the new foreach_block the current_block.
28369 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
28370 function used to return a static Parameters structure. Used for
28371 empty parameters, as those are created very frequently.
28373 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
28375 2001-11-15 Ravi Pratap <ravi@ximian.com>
28377 * interface.cs : Default modifier is private, not public. The
28378 make verify test passes again.
28380 2001-11-15 Ravi Pratap <ravi@ximian.com>
28382 * support.cs (ReflectionParameters): Fix logic to determine
28383 whether the last parameter is a params one. Test 9 passes again.
28385 * delegate.cs (Populate): Register the builders we define with
28386 RegisterParameterForBuilder. Test 19 passes again.
28388 * cs-parser.jay (property_declaration): Reference $6 instead
28389 of $$ to get at the location.
28391 (indexer_declaration): Similar stuff.
28393 (attribute): Ditto.
28395 * class.cs (Property): Register parameters for the Get and Set methods
28396 if they exist. Test 23 passes again.
28398 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
28399 call to EmitArguments as we are sure there aren't any params arguments.
28400 Test 32 passes again.
28402 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
28403 IndexOutOfRangeException.
28405 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
28406 Test 33 now passes again.
28408 2001-11-15 Miguel de Icaza <miguel@ximian.com>
28410 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
28411 broke a bunch of things. Will have to come up with a better way
28412 of tracking locations.
28414 * statement.cs: Implemented foreach for single dimension arrays.
28416 2001-11-09 Miguel de Icaza <miguel@ximian.com>
28418 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
28419 an error. This removes the lookup from the critical path.
28421 * cs-parser.jay: Removed use of temporary_loc, which is completely
28424 2001-11-14 Miguel de Icaza <miguel@ximian.com>
28426 * support.cs (ReflectionParameters.ParameterModifier): Report
28427 whether the argument is a PARAMS argument or not.
28429 * class.cs: Set the attribute `ParamArrayAttribute' on the
28430 parameter argument.
28432 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
28433 and cons_param_array_attribute (ConstructorInfo for
28434 ParamArrayAttribute).,
28436 * codegen.cs: Emit the return using the `Return' statement, that
28437 way we can report the error correctly for missing return values.
28439 * class.cs (Method.Emit): Clean up.
28441 * expression.cs (Argument.Resolve): Take another argument: the
28442 location where this argument is used. Notice that this is not
28443 part of the "Argument" class as to reduce the size of the
28444 structure (we know the approximate location anyways).
28446 Test if the argument is a variable-reference, if not, then
28447 complain with a 206.
28449 (Argument.Emit): Emit addresses of variables.
28451 (Argument.FullDesc): Simplify.
28453 (Invocation.DoResolve): Update for Argument.Resolve.
28455 (ElementAccess.DoResolve): ditto.
28457 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
28458 method should be virtual, as this method is always virtual.
28460 (NewDelegate.DoResolve): Update for Argument.Resolve.
28462 * class.cs (ConstructorInitializer.DoResolve): ditto.
28464 * attribute.cs (Attribute.Resolve): ditto.
28466 2001-11-13 Miguel de Icaza <miguel@ximian.com>
28468 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
28470 * expression.cs (ParameterReference): Drop IStackStorage and implement
28471 IAssignMethod instead.
28473 (LocalVariableReference): ditto.
28475 * ecore.cs (FieldExpr): Drop IStackStorage and implement
28476 IAssignMethod instead.
28478 2001-11-13 Miguel de Icaza <miguel@ximian.com>
28480 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
28481 enumerations that are used in heavily used structures derive from
28482 byte in a laughable and pathetic attempt to reduce memory usage.
28483 This is the kind of pre-optimzations that you should not do at
28484 home without adult supervision.
28486 * expression.cs (UnaryMutator): New class, used to handle ++ and
28487 -- separatedly from the other unary operators. Cleans up the
28488 code, and kills the ExpressionStatement dependency in Unary.
28490 (Unary): Removed `method' and `Arguments' from this class, making
28491 it smaller, and moving it all to SimpleCall, so I can reuse this
28492 code in other locations and avoid creating a lot of transient data
28493 strucutres when not required.
28495 * cs-parser.jay: Adjust for new changes.
28497 2001-11-11 Miguel de Icaza <miguel@ximian.com>
28499 * enum.cs (Enum.Populate): If there is a failure during
28502 * cs-parser.jay (opt_enum_base): we used to catch type errors
28503 here, but this is really incorrect. The type error should be
28504 catched during semantic analysis.
28506 2001-12-11 Ravi Pratap <ravi@ximian.com>
28508 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
28509 current_local_parameters as expected since I, in my stupidity, had forgotten
28512 * attribute.cs (GetValidPlaces): Fix stupid bug.
28514 * class.cs (Method::Emit): Perform check on applicability of attributes.
28516 (Constructor::Emit): Ditto.
28518 (Field::Emit): Ditto.
28520 (Field.Location): Store location information.
28522 (Property, Event, Indexer, Operator): Ditto.
28524 * cs-parser.jay (field_declaration): Pass in location for each field.
28526 * ../errors/cs0592.cs : Add.
28528 2001-11-12 Ravi Pratap <ravi@ximian.com>
28530 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
28532 (InitCoreTypes): Update accordingly.
28534 (RegisterAttrType, LookupAttr): Implement.
28536 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
28537 info about the same.
28539 (Resolve): Update to populate the above as necessary.
28541 (Error592): Helper.
28543 (GetValidPlaces): Helper to the above.
28545 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
28547 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
28549 2001-11-12 Ravi Pratap <ravi@ximian.com>
28551 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
28553 * ../errors/cs0617.cs : Add.
28555 2001-11-11 Ravi Pratap <ravi@ximian.com>
28557 * enum.cs (Emit): Rename to Populate to be more consistent with what
28558 we expect it to do and when exactly it is called.
28560 * class.cs, rootcontext.cs : Update accordingly.
28562 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
28563 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
28565 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
28567 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
28568 of a fieldinfo using the above, when dealing with a FieldBuilder.
28570 2001-11-10 Ravi Pratap <ravi@ximian.com>
28572 * ../errors/cs0031.cs : Add.
28574 * ../errors/cs1008.cs : Add.
28576 * ../errrors/cs0543.cs : Add.
28578 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
28581 (FindMembers): Implement.
28583 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
28584 enums and delegates too.
28586 (enum_types): Rename to builder_to_enum.
28588 (delegate_types): Rename to builder_to_delegate.
28590 * delegate.cs (FindMembers): Implement.
28592 2001-11-09 Ravi Pratap <ravi@ximian.com>
28594 * typemanager.cs (IsEnumType): Implement.
28596 * enum.cs (Emit): Re-write parts to account for the underlying type
28597 better and perform checking etc.
28599 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
28600 of the underlying type.
28602 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
28605 * enum.cs (error31): Helper to report error #31.
28607 * cs-parser.jay (enum_declaration): Store location of each member too.
28609 * enum.cs (member_to_location): New hashtable.
28611 (AddEnumMember): Update location hashtable.
28613 (Emit): Use the location of each member while reporting errors.
28615 2001-11-09 Miguel de Icaza <miguel@ximian.com>
28617 * cs-parser.jay: A for_initializer if is a
28618 local_variable_declaration really ammount to have an implicit
28619 block with the variable declaration and no initializer for for.
28621 * statement.cs (For.Emit): Cope with null initializers.
28623 This fixes the infinite loop on for initializers.
28625 2001-11-08 Miguel de Icaza <miguel@ximian.com>
28627 * enum.cs: More cleanup.
28629 * ecore.cs: Remove dead code.
28631 * class.cs (Property.Emit): More simplification.
28632 (Event.Emit): ditto.
28634 Reworked to have less levels of indentation.
28636 2001-11-08 Ravi Pratap <ravi@ximian.com>
28638 * class.cs (Property): Emit attributes.
28648 * enum.cs (Emit): Ditto.
28650 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
28653 * class.cs (Field, Event, etc.): Move attribute generation into the
28654 Emit method everywhere.
28656 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
28657 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
28658 as we had no way of defining nested enums !
28660 * rootcontext.cs : Adjust code accordingly.
28662 * typemanager.cs (AddEnumType): To keep track of enum types separately.
28664 2001-11-07 Ravi Pratap <ravi@ximian.com>
28666 * expression.cs (EvalConstantExpression): Move into ecore.cs
28668 * enum.cs (Enum): Rename some members and make them public and readonly
28669 according to our convention.
28671 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
28674 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
28676 (Enum::Emit): Write a simple version for now which doesn't try to compute
28677 expressions. I shall modify this to be more robust in just a while.
28679 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
28681 (TypeContainer::CloseType): Create the Enum types too.
28683 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
28685 * expression.cs (EvalConstantExpression): Get rid of completely.
28687 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
28688 user-defined values and other cases.
28690 (IsValidEnumLiteral): Helper function.
28692 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
28693 out there in the case we had a literal FieldExpr.
28695 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
28697 (Literalize): Revamp a bit to take two arguments.
28699 (EnumLiteral): New class which derives from Literal to wrap enum literals.
28701 2001-11-06 Ravi Pratap <ravi@ximian.com>
28703 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
28705 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
28707 (Resolve): Use the above to ensure we have proper initializers.
28709 2001-11-05 Ravi Pratap <ravi@ximian.com>
28711 * expression.cs (Expression::EvalConstantExpression): New method to
28712 evaluate constant expressions.
28714 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
28716 2001-11-07 Miguel de Icaza <miguel@ximian.com>
28718 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
28721 (Binary.ResolveOperator): Handle operator != (object a, object b)
28722 and operator == (object a, object b);
28724 (Binary.DoNumericPromotions): Indicate whether the numeric
28725 promotion was possible.
28727 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
28730 Made the ArrayAccess implement interface IAssignMethod instead of
28731 IStackStore as the order in which arguments are passed reflects
28734 * assign.cs: Instead of using expr.ExprClass to select the way of
28735 assinging, probe for the IStackStore/IAssignMethod interfaces.
28737 * typemanager.cs: Load InitializeArray definition.
28739 * rootcontext.cs (RootContext.MakeStaticData): Used to define
28740 static data that can be used to initialize arrays.
28742 2001-11-05 Miguel de Icaza <miguel@ximian.com>
28744 * expression.cs: Handle operator== and operator!= for booleans.
28746 (Conditioal.Reduce): Implement reducer for the ?: operator.
28748 (Conditional.Resolve): Implement dead code elimination.
28750 (Binary.Resolve): Catch string literals and return a new
28751 concatenated string.
28753 (Unary.Reduce): Implement reduction of unary expressions.
28755 * ecore.cs: Split out the expression core handling here.
28757 (Expression.Reduce): New method used to perform constant folding
28758 and CSE. This is needed to support constant-expressions.
28760 * statement.cs (Statement.EmitBoolExpression): Pass true and false
28761 targets, and optimize for !x.
28763 2001-11-04 Ravi Pratap <ravi@ximian.com>
28765 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
28766 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
28767 set custom atttributes.
28769 * literal.cs (Literal::GetValue): New abstract method to return the actual
28770 value of the literal, cast as an object.
28772 (*Literal): Implement GetValue method.
28774 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
28775 expressions to the arraylist but objects of type Argument.
28777 * class.cs (TypeContainer::Emit): Emit our attributes too.
28779 (Method::Emit, Constructor::Emit): Ditto.
28781 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
28782 to be ignoring earlier.
28784 2001-11-03 Ravi Pratap <ravi@ximian.com>
28786 * attribute.cs (AttributeSection::Define): Implement to do the business
28787 of constructing a CustomAttributeBuilder.
28789 (Attribute): New trivial class. Increases readability of code.
28791 * cs-parser.jay : Update accordingly.
28793 (positional_argument_list, named_argument_list, named_argument): New rules
28795 (attribute_arguments): Use the above so that we are more correct.
28797 2001-11-02 Ravi Pratap <ravi@ximian.com>
28799 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
28800 to perform all checks for a method with a params parameter.
28802 (Invocation::OverloadResolve): Update to use the above method and therefore
28803 cope correctly with params method invocations.
28805 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
28808 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
28809 constructors in our parent too because we can't afford to miss out on
28812 * attribute.cs (AttributeSection): New name for the class Attribute
28814 Other trivial changes to improve readability.
28816 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
28817 use the new class names.
28819 2001-11-01 Ravi Pratap <ravi@ximian.com>
28821 * class.cs (Method::Define): Complete definition for params types too
28823 (Indexer::Define): Ditto.
28825 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
28826 Cope everywhere with a request for info about the array parameter.
28828 2001-11-01 Ravi Pratap <ravi@ximian.com>
28830 * tree.cs (RecordNamespace): Fix up to check for the correct key.
28832 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
28833 local_variable_type to extract the string corresponding to the type.
28835 (local_variable_type): Fixup the action to use the new helper method.
28837 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
28840 * expression.cs : Clean out code which uses the above.
28842 2001-10-31 Ravi Pratap <ravi@ximian.com>
28844 * typemanager.cs (RegisterMethod): Check if we already have an existing key
28845 and bale out if necessary by returning a false.
28847 (RegisterProperty): Ditto.
28849 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
28850 and print out appropriate error messages.
28852 * interface.cs (everywhere): Ditto.
28854 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
28855 location to constructor.
28857 * class.cs (Property, Event, Indexer): Update accordingly.
28859 * ../errors/cs111.cs : Added.
28861 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
28862 of a method, as laid down by the spec.
28864 (Invocation::OverloadResolve): Use the above method.
28866 2001-10-31 Ravi Pratap <ravi@ximian.com>
28868 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
28869 now take a TypeContainer and a Parameters object.
28871 (ParameterData): Modify return type of ParameterModifier method to be
28872 Parameter.Modifier and not a string.
28874 (ReflectionParameters, InternalParameters): Update accordingly.
28876 * expression.cs (Argument::GetParameterModifier): Same here.
28878 * support.cs (InternalParameters::ParameterType): Find a better way of determining
28879 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
28880 symbol in it at all so maybe this is only for now.
28882 2001-10-30 Ravi Pratap <ravi@ximian.com>
28884 * support.cs (InternalParameters): Constructor now takes an extra argument
28885 which is the actual Parameters class.
28887 (ParameterDesc): Update to provide info on ref/out modifiers.
28889 * class.cs (everywhere): Update call to InternalParameters to pass in
28890 the second argument too.
28892 * support.cs (ParameterData): Add ParameterModifier, which is a method
28893 to return the modifier info [ref/out etc]
28895 (InternalParameters, ReflectionParameters): Implement the above.
28897 * expression.cs (Argument::ParameterModifier): Similar function to return
28898 info about the argument's modifiers.
28900 (Invocation::OverloadResolve): Update to take into account matching modifiers
28903 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
28904 a new SetFormalParameters object which we pass to InternalParameters.
28906 2001-10-30 Ravi Pratap <ravi@ximian.com>
28908 * expression.cs (NewArray): Merge into the ArrayCreation class.
28910 2001-10-29 Ravi Pratap <ravi@ximian.com>
28912 * expression.cs (NewArray): Merge classes NewBuiltinArray and
28913 NewUserdefinedArray into one as there wasn't much of a use in having
28916 * expression.cs (Argument): Change field's name to ArgType from Type.
28918 (Type): New readonly property which returns the proper type, taking into
28919 account ref/out modifiers.
28921 (everywhere): Adjust code accordingly for the above.
28923 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
28924 whether we are emitting for a ref or out parameter.
28926 * expression.cs (Argument::Emit): Use the above field to set the state.
28928 (LocalVariableReference::Emit): Update to honour the flag and emit the
28931 * parameter.cs (Attributes): Set the correct flags for ref parameters.
28933 * expression.cs (Argument::FullDesc): New function to provide a full desc.
28935 * support.cs (ParameterData): Add method ParameterDesc to the interface.
28937 (ReflectionParameters, InternalParameters): Implement the above method.
28939 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
28942 (Invocation::FullMethodDesc): Ditto.
28944 2001-10-29 Miguel de Icaza <miguel@ximian.com>
28946 * cs-parser.jay: Add extra production for the second form of array
28949 * expression.cs (ArrayCreation): Update to reflect the above
28952 * Small changes to prepare for Array initialization.
28954 2001-10-28 Miguel de Icaza <miguel@ximian.com>
28956 * typemanager.cs (ImplementsInterface): interface might be null;
28957 Deal with this problem;
28959 Also, we do store negative hits on the cache (null values), so use
28960 this instead of calling t.GetInterfaces on the type everytime.
28962 2001-10-28 Ravi Pratap <ravi@ximian.com>
28964 * typemanager.cs (IsBuiltinType): New method to help determine the same.
28966 * expression.cs (New::DoResolve): Get rid of array creation code and instead
28967 split functionality out into different classes.
28969 (New::FormArrayType): Move into NewBuiltinArray.
28971 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
28974 (NewBuiltinArray): New class to handle creation of built-in arrays.
28976 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
28977 account creation of one-dimensional arrays.
28979 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
28981 (NewUserdefinedArray::DoResolve): Implement.
28983 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
28985 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
28986 we maintain inside the TypeManager. This is necessary to perform lookups on the
28989 (LookupType): Update to perform GetType on the module builders too.
28991 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
28993 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
28995 2001-10-23 Ravi Pratap <ravi@ximian.com>
28997 * expression.cs (New::DoResolve): Implement guts of array creation.
28999 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
29001 2001-10-27 Miguel de Icaza <miguel@ximian.com>
29003 * expression.cs: Fix bug I introduced lsat night that broke
29006 (Expression.Resolve): Report a 246 error (can not resolve name)
29007 if we find a SimpleName in the stream.
29009 (Expression.ResolveLValue): Ditto.
29011 (Expression.ResolveWithSimpleName): This function is a variant of
29012 ResolveName, this one allows SimpleNames to be returned without a
29013 warning. The only consumer of SimpleNames is MemberAccess
29015 2001-10-26 Miguel de Icaza <miguel@ximian.com>
29017 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
29018 might arrive here. I have my doubts that this is correct.
29020 * statement.cs (Lock): Implement lock statement.
29022 * cs-parser.jay: Small fixes to support `lock' and `using'
29024 * cs-tokenizer.cs: Remove extra space
29026 * driver.cs: New flag --checked, allows to turn on integer math
29029 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
29030 Threading.Monitor.Exit
29032 2001-10-23 Miguel de Icaza <miguel@ximian.com>
29034 * expression.cs (IndexerAccess::DoResolveLValue): Set the
29035 Expression Class to be IndexerAccess.
29037 Notice that Indexer::DoResolve sets the eclass to Value.
29039 2001-10-22 Miguel de Icaza <miguel@ximian.com>
29041 * class.cs (TypeContainer::Emit): Emit code for indexers.
29043 * assign.cs (IAssignMethod): New interface implemented by Indexers
29044 and Properties for handling assignment.
29046 (Assign::Emit): Simplify and reuse code.
29048 * expression.cs (IndexerAccess, PropertyExpr): Implement
29049 IAssignMethod, clean up old code.
29051 2001-10-22 Ravi Pratap <ravi@ximian.com>
29053 * typemanager.cs (ImplementsInterface): New method to determine if a type
29054 implements a given interface. Provides a nice cache too.
29056 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
29059 (ConvertReferenceExplicit): Ditto.
29061 * delegate.cs (Delegate::Populate): Update to define the parameters on the
29062 various methods, with correct names etc.
29064 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
29065 Operator.UnaryNegation.
29067 * cs-parser.jay (operator_declarator): Be a little clever in the case where
29068 we have a unary plus or minus operator.
29070 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
29073 * everywhere : update accordingly.
29075 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
29078 * class.cs (Method::Define): For the case where we are implementing a method
29079 inherited from an interface, we need to set the MethodAttributes.Final flag too.
29080 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
29082 2001-10-21 Ravi Pratap <ravi@ximian.com>
29084 * interface.cs (FindMembers): Implement to work around S.R.E
29087 * typemanager.cs (IsInterfaceType): Implement.
29089 (FindMembers): Update to handle interface types too.
29091 * expression.cs (ImplicitReferenceConversion): Re-write bits which
29092 use IsAssignableFrom as that is not correct - it doesn't work.
29094 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
29095 and accordingly override EmitStatement.
29097 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
29098 using the correct logic :-)
29100 2001-10-19 Ravi Pratap <ravi@ximian.com>
29102 * ../errors/cs-11.cs : Add to demonstrate error -11
29104 2001-10-17 Miguel de Icaza <miguel@ximian.com>
29106 * assign.cs (Assign::Resolve): Resolve right hand side first, and
29107 then pass this as a hint to ResolveLValue.
29109 * expression.cs (FieldExpr): Add Location information
29111 (FieldExpr::LValueResolve): Report assignment to readonly
29114 (Expression::ExprClassFromMemberInfo): Pass location information.
29116 (Expression::ResolveLValue): Add new method that resolves an
29119 (Expression::DoResolveLValue): Default invocation calls
29122 (Indexers): New class used to keep track of indexers in a given
29125 (IStackStore): Renamed from LValue, as it did not really describe
29126 what this did. Also ResolveLValue is gone from this interface and
29127 now is part of Expression.
29129 (ElementAccess): Depending on the element access type
29131 * typemanager.cs: Add `indexer_name_type' as a Core type
29132 (System.Runtime.CompilerServices.IndexerNameAttribute)
29134 * statement.cs (Goto): Take a location.
29136 2001-10-18 Ravi Pratap <ravi@ximian.com>
29138 * delegate.cs (Delegate::VerifyDelegate): New method to verify
29139 if two delegates are compatible.
29141 (NewDelegate::DoResolve): Update to take care of the case when
29142 we instantiate a delegate from another delegate.
29144 * typemanager.cs (FindMembers): Don't even try to look up members
29145 of Delegate types for now.
29147 2001-10-18 Ravi Pratap <ravi@ximian.com>
29149 * delegate.cs (NewDelegate): New class to take care of delegate
29152 * expression.cs (New): Split the delegate related code out into
29153 the NewDelegate class.
29155 * delegate.cs (DelegateInvocation): New class to handle delegate
29158 * expression.cs (Invocation): Split out delegate related code into
29159 the DelegateInvocation class.
29161 2001-10-17 Ravi Pratap <ravi@ximian.com>
29163 * expression.cs (New::DoResolve): Implement delegate creation fully
29164 and according to the spec.
29166 (New::DoEmit): Update to handle delegates differently.
29168 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
29169 because of which we were printing out arguments in reverse order !
29171 * delegate.cs (VerifyMethod): Implement to check if the given method
29172 matches the delegate.
29174 (FullDelegateDesc): Implement.
29176 (VerifyApplicability): Implement.
29178 * expression.cs (Invocation::DoResolve): Update to accordingly handle
29179 delegate invocations too.
29181 (Invocation::Emit): Ditto.
29183 * ../errors/cs1593.cs : Added.
29185 * ../errors/cs1594.cs : Added.
29187 * delegate.cs (InstanceExpression, TargetMethod): New properties.
29189 2001-10-16 Ravi Pratap <ravi@ximian.com>
29191 * typemanager.cs (intptr_type): Core type for System.IntPtr
29193 (InitCoreTypes): Update for the same.
29195 (iasyncresult_type, asynccallback_type): Ditto.
29197 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
29200 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
29203 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
29204 the builders for the 4 members of a delegate type :-)
29206 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
29209 * expression.cs (New::DoResolve): Implement guts for delegate creation.
29211 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
29213 2001-10-15 Miguel de Icaza <miguel@ximian.com>
29215 * statement.cs (Break::Emit): Implement.
29216 (Continue::Emit): Implement.
29218 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
29219 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
29220 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
29221 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
29224 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
29225 properties that track the label for the current loop (begin of the
29226 loop and end of the loop).
29228 2001-10-15 Ravi Pratap <ravi@ximian.com>
29230 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
29231 use of emitting anything at all.
29233 * class.cs, rootcontext.cs : Get rid of calls to the same.
29235 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
29237 (Populate): Define the constructor correctly and set the implementation
29240 * typemanager.cs (delegate_types): New hashtable to hold delegates that
29243 (AddDelegateType): Implement.
29245 (IsDelegateType): Implement helper method.
29247 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
29249 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
29250 and accordingly handle it.
29252 * delegate.cs (Populate): Take TypeContainer argument.
29253 Implement bits to define the Invoke method. However, I still haven't figured out
29254 how to take care of the native int bit :-(
29256 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
29257 Qualify the name of the delegate, not its return type !
29259 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
29262 (StandardConversionExists): Checking for array types turns out to be recursive.
29264 (ConvertReferenceExplicit): Implement array conversion.
29266 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
29268 2001-10-12 Ravi Pratap <ravi@ximian.com>
29270 * cs-parser.jay (delegate_declaration): Store the fully qualified
29271 name as it is a type declaration.
29273 * delegate.cs (ReturnType, Name): Rename members to these. Make them
29276 (DefineDelegate): Renamed from Define. Does the same thing essentially,
29277 as TypeContainer::DefineType.
29279 (Populate): Method in which all the definition of the various methods (Invoke)
29282 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
29285 (CloseDelegate): Finally creates the delegate.
29287 * class.cs (TypeContainer::DefineType): Update to define delegates.
29288 (Populate, Emit and CloseType): Do the same thing here too.
29290 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
29291 delegates in all these operations.
29293 2001-10-14 Miguel de Icaza <miguel@ximian.com>
29295 * expression.cs: LocalTemporary: a new expression used to
29296 reference a temporary that has been created.
29298 * assign.cs: Handle PropertyAccess back here, so that we can
29299 provide the proper semantic access to properties.
29301 * expression.cs (Expression::ConvertReferenceExplicit): Implement
29302 a few more explicit conversions.
29304 * modifiers.cs: `NEW' modifier maps to HideBySig.
29306 * expression.cs (PropertyExpr): Make this into an
29307 ExpressionStatement, and support the EmitStatement code path.
29309 Perform get/set error checking, clean up the interface.
29311 * assign.cs: recognize PropertyExprs as targets, and if so, turn
29312 them into toplevel access objects.
29314 2001-10-12 Miguel de Icaza <miguel@ximian.com>
29316 * expression.cs: PropertyExpr::PropertyExpr: use work around the
29319 * typemanager.cs: Keep track here of our PropertyBuilders again to
29320 work around lameness in SRE.
29322 2001-10-11 Miguel de Icaza <miguel@ximian.com>
29324 * expression.cs (LValue::LValueResolve): New method in the
29325 interface, used to perform a second resolution pass for LValues.
29327 (This::DoResolve): Catch the use of this in static methods.
29329 (This::LValueResolve): Implement.
29331 (This::Store): Remove warning, assigning to `this' in structures
29334 (Invocation::Emit): Deal with invocation of
29335 methods on value types. We need to pass the address to structure
29336 methods rather than the object itself. (The equivalent code to
29337 emit "this" for structures leaves the entire structure on the
29338 stack instead of a pointer to it).
29340 (ParameterReference::DoResolve): Compute the real index for the
29341 argument based on whether the method takes or not a `this' pointer
29342 (ie, the method is static).
29344 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
29345 value types returned from functions when we need to invoke a
29346 method on the sturcture.
29349 2001-10-11 Ravi Pratap <ravi@ximian.com>
29351 * class.cs (TypeContainer::DefineType): Method to actually do the business of
29352 defining the type in the Modulebuilder or Typebuilder. This is to take
29353 care of nested types which need to be defined on the TypeBuilder using
29354 DefineNestedMethod.
29356 (TypeContainer::GetClassBases): Implement. Essentially the code from the
29357 methods in RootContext, only ported to be part of TypeContainer.
29359 (TypeContainer::GetInterfaceOrClass): Ditto.
29361 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
29363 * interface.cs (Interface::DefineInterface): New method. Does exactly
29364 what RootContext.CreateInterface did earlier, only it takes care of nested types
29367 (Interface::GetInterfaces): Move from RootContext here and port.
29369 (Interface::GetInterfaceByName): Same here.
29371 * rootcontext.cs (ResolveTree): Re-write.
29373 (PopulateTypes): Re-write.
29375 * class.cs (TypeContainer::Populate): Populate nested types too.
29376 (TypeContainer::Emit): Emit nested members too.
29378 * typemanager.cs (AddUserType): Do not make use of the FullName property,
29379 instead just use the name argument passed in as it is already fully
29382 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
29383 to TypeContainer mapping to see if a type is user-defined.
29385 * class.cs (TypeContainer::CloseType): Implement.
29387 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
29388 the default constructor.
29390 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
29393 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
29395 * interface.cs (CloseType): Create the type here.
29397 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
29400 Remove all the methods which are now in TypeContainer.
29402 2001-10-10 Ravi Pratap <ravi@ximian.com>
29404 * delegate.cs (Define): Re-write bits to define the delegate
29407 2001-10-10 Miguel de Icaza <miguel@ximian.com>
29409 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
29411 * expression.cs (ImplicitReferenceConversion): handle null as well
29412 as a source to convert to any reference type.
29414 * statement.cs (Return): Perform any implicit conversions to
29415 expected return type.
29417 Validate use of return statement.
29419 * codegen.cs (EmitContext): Pass the expected return type here.
29421 * class.cs (Method, Constructor, Property): Pass expected return
29422 type to EmitContext.
29424 2001-10-09 Miguel de Icaza <miguel@ximian.com>
29426 * expression.cs: Make DoResolve take an EmitContext instead of a
29429 Replaced `l' and `location' for `loc', for consistency.
29431 (Error, Warning): Remove unneeded Tc argument.
29433 * assign.cs, literal.cs, constant.cs: Update to new calling
29436 * codegen.cs: EmitContext now contains a flag indicating whether
29437 code is being generated in a static method or not.
29439 * cs-parser.jay: DecomposeQI, new function that replaces the old
29440 QualifiedIdentifier. Now we always decompose the assembled
29441 strings from qualified_identifier productions into a group of
29444 2001-10-08 Miguel de Icaza <miguel@ximian.com>
29446 * rootcontext.cs: Deal with field-less struct types correctly now
29447 by passing the size option to Define Type.
29449 * class.cs: Removed hack that created one static field.
29451 2001-10-07 Miguel de Icaza <miguel@ximian.com>
29453 * statement.cs: Moved most of the code generation here.
29455 2001-10-09 Ravi Pratap <ravi@ximian.com>
29457 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
29460 (ElementAccess): Remove useless bits for now - keep checks as the spec
29463 2001-10-08 Ravi Pratap <ravi@ximian.com>
29465 * expression.cs (ElementAccess::DoResolve): Remove my crap code
29466 and start performing checks according to the spec.
29468 2001-10-07 Ravi Pratap <ravi@ximian.com>
29470 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
29471 rank_specifiers instead.
29473 (rank_specifiers): Change the order in which the rank specifiers are stored
29475 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
29477 * expression.cs (ElementAccess): Implement the LValue interface too.
29479 2001-10-06 Ravi Pratap <ravi@ximian.com>
29481 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
29482 except that user defined conversions are not included.
29484 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
29485 perform the conversion of the return type, if necessary.
29487 (New::DoResolve): Check whether we are creating an array or an object
29488 and accordingly do the needful.
29490 (New::Emit): Same here.
29492 (New::DoResolve): Implement guts of array creation.
29494 (New::FormLookupType): Helper function.
29496 2001-10-07 Miguel de Icaza <miguel@ximian.com>
29498 * codegen.cs: Removed most of the code generation here, and move the
29499 corresponding code generation bits to the statement classes.
29501 Added support for try/catch/finalize and throw.
29503 * cs-parser.jay: Added support for try/catch/finalize.
29505 * class.cs: Catch static methods having the flags override,
29506 virtual or abstract.
29508 * expression.cs (UserCast): This user cast was not really doing
29509 what it was supposed to do. Which is to be born in fully resolved
29510 state. Parts of the resolution were being performed at Emit time!
29514 2001-10-05 Miguel de Icaza <miguel@ximian.com>
29516 * expression.cs: Implicity convert the result from UserCast.
29518 2001-10-05 Ravi Pratap <ravi@ximian.com>
29520 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
29521 prevented it from working correctly.
29523 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
29524 merely ConvertImplicit.
29526 2001-10-05 Miguel de Icaza <miguel@ximian.com>
29528 * typemanager.cs: Make the LookupTypeContainer function static,
29529 and not per-instance.
29531 * class.cs: Make static FindMembers (the one that takes a Type
29534 * codegen.cs: Add EmitForeach here.
29536 * cs-parser.jay: Make foreach a toplevel object instead of the
29537 inline expansion, as we need to perform semantic analysis on it.
29539 2001-10-05 Ravi Pratap <ravi@ximian.com>
29541 * expression.cs (Expression::ImplicitUserConversion): Rename to
29542 UserDefinedConversion.
29544 (Expression::UserDefinedConversion): Take an extra argument specifying
29545 whether we look for explicit user conversions too.
29547 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
29549 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
29551 (ExplicitUserConversion): Make it a call to UserDefinedConversion
29552 with the appropriate arguments.
29554 * cs-parser.jay (cast_expression): Record location too.
29556 * expression.cs (Cast): Record location info.
29558 (Expression::ConvertExplicit): Take location argument.
29560 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
29561 to determine if we are doing explicit conversions.
29563 (UserCast::Emit): Update accordingly.
29565 (Expression::ConvertExplicit): Report an error if everything fails.
29567 * ../errors/cs0030.cs : Add.
29569 2001-10-04 Miguel de Icaza <miguel@ximian.com>
29571 * modifiers.cs: If the ABSTRACT keyword is present, also set the
29572 virtual and newslot bits.
29574 * class.cs (TypeContainer::RegisterRequiredImplementations):
29575 Record methods we need.
29577 (TypeContainer::MakeKey): Helper function to make keys for
29578 MethodBases, since the Methodbase key is useless.
29580 (TypeContainer::Populate): Call RegisterRequiredImplementations
29581 before defining the methods.
29583 Create a mapping for method_builders_to_methods ahead of time
29584 instead of inside a tight loop.
29586 (::RequireMethods): Accept an object as the data to set into the
29587 hashtable so we can report interface vs abstract method mismatch.
29589 2001-10-03 Miguel de Icaza <miguel@ximian.com>
29591 * report.cs: Make all of it static.
29593 * rootcontext.cs: Drop object_type and value_type computations, as
29594 we have those in the TypeManager anyways.
29596 Drop report instance variable too, now it is a global.
29598 * driver.cs: Use try/catch on command line handling.
29600 Add --probe option to debug the error reporting system with a test
29603 * report.cs: Add support for exiting program when a probe
29604 condition is reached.
29606 2001-10-03 Ravi Pratap <ravi@ximian.com>
29608 * expression.cs (Binary::DoNumericPromotions): Fix the case when
29609 we do a forcible conversion regardless of type, to check if
29610 ForceConversion returns a null.
29612 (Binary::error19): Use location to report error.
29614 (Unary::error23): Use location here too.
29616 * ../errors/cs0019.cs : Check in.
29618 * ../errors/cs0023.cs : Check in.
29620 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
29621 case of a non-null MethodInfo object with a length of 0 !
29623 (Binary::ResolveOperator): Flag error if overload resolution fails to find
29624 an applicable member - according to the spec :-)
29625 Also fix logic to find members in base types.
29627 (Unary::ResolveOperator): Same here.
29629 (Unary::report23): Change name to error23 and make first argument a TypeContainer
29630 as I was getting thoroughly confused between this and error19 :-)
29632 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
29633 (::FindMostEncompassedType): Implement.
29634 (::FindMostEncompassingType): Implement.
29635 (::StandardConversionExists): Implement.
29637 (UserImplicitCast): Re-vamp. We now need info about most specific
29638 source and target types so that we can do the necessary conversions.
29640 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
29641 mathematical union with no duplicates.
29643 2001-10-03 Miguel de Icaza <miguel@ximian.com>
29645 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
29646 in order from base classes to child classes, so that we can in
29647 child classes look up in our parent for method names and
29648 attributes (required for handling abstract, virtual, new, override
29649 constructs: we need to instrospect our base class, and if we dont
29650 populate the classes in order, the introspection might be
29651 incorrect. For example, a method could query its parent before
29652 the parent has any methods and would determine that the parent has
29653 no abstract methods (while it could have had them)).
29655 (RootContext::CreateType): Record the order in which we define the
29658 2001-10-02 Miguel de Icaza <miguel@ximian.com>
29660 * class.cs (TypeContainer::Populate): Also method definitions can
29661 fail now, keep track of this.
29663 (TypeContainer::FindMembers): Implement support for
29664 DeclaredOnly/noDeclaredOnly flag.
29666 (Constructor::Emit) Return the ConstructorBuilder.
29668 (Method::Emit) Return the MethodBuilder.
29669 Check for abstract or virtual methods to be public.
29671 * rootcontext.cs (RootContext::CreateType): Register all the
29672 abstract methods required for the class to be complete and the
29673 interface methods that must be implemented.
29675 * cs-parser.jay: Report error 501 (method requires body if it is
29676 not marked abstract or extern).
29678 * expression.cs (TypeOf::Emit): Implement.
29680 * typemanager.cs: runtime_handle_type, new global type.
29682 * class.cs (Property::Emit): Generate code for properties.
29684 2001-10-02 Ravi Pratap <ravi@ximian.com>
29686 * expression.cs (Unary::ResolveOperator): Find operators on base type
29687 too - we now conform exactly to the spec.
29689 (Binary::ResolveOperator): Same here.
29691 * class.cs (Operator::Define): Fix minor quirk in the tests.
29693 * ../errors/cs0215.cs : Added.
29695 * ../errors/cs0556.cs : Added.
29697 * ../errors/cs0555.cs : Added.
29699 2001-10-01 Miguel de Icaza <miguel@ximian.com>
29701 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
29702 single integer which is really efficient
29704 2001-10-01 Ravi Pratap <ravi@ximian.com>
29706 * expression.cs (Expression::ImplicitUserConversion): Use location
29707 even in the case when we are examining True operators.
29709 * class.cs (Operator::Define): Perform extensive checks to conform
29710 with the rules for operator overloading in the spec.
29712 * expression.cs (Expression::ImplicitReferenceConversion): Implement
29713 some of the other conversions mentioned in the spec.
29715 * typemanager.cs (array_type): New static member for the System.Array built-in
29718 (cloneable_interface): For System.ICloneable interface.
29720 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
29721 we start resolving the tree and populating types.
29723 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
29725 2001-10-01 Miguel de Icaza <miguel@ximian.com>
29727 * expression.cs (Expression::ExprClassFromMemberInfo,
29728 Expression::Literalize): Create literal expressions from
29729 FieldInfos which are literals.
29731 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
29732 type casts, because they were wrong. The test suite in tests
29735 (ImplicitNumericConversion): ushort to ulong requires a widening
29738 Int32 constant to long requires widening cast as well.
29740 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
29741 for integers because the type on the stack is not i4.
29743 2001-09-30 Miguel de Icaza <miguel@ximian.com>
29745 * expression.cs (report118): require location argument.
29747 * parameter.cs: Do not dereference potential null value.
29749 * class.cs: Catch methods that lack the `new' keyword when
29750 overriding a name. Report warnings when `new' is used without
29751 anything being there to override.
29753 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
29755 * class.cs: Only add constructor to hashtable if it is non-null
29756 (as now constructors can fail on define).
29758 (TypeManager, Class, Struct): Take location arguments.
29760 Catch field instance initialization in structs as errors.
29762 accepting_filter: a new filter for FindMembers that is static so
29763 that we dont create an instance per invocation.
29765 (Constructor::Define): Catch errors where a struct constructor is
29768 * cs-parser.jay: Pass location information for various new
29771 * delegate.cs (Delegate): take a location argument.
29773 * driver.cs: Do not call EmitCode if there were problesm in the
29774 Definition of the types, as many Builders wont be there.
29776 * decl.cs (Decl::Decl): Require a location argument.
29778 * cs-tokenizer.cs: Handle properly hex constants that can not fit
29779 into integers, and find the most appropiate integer for it.
29781 * literal.cs: Implement ULongLiteral.
29783 * rootcontext.cs: Provide better information about the location of
29784 failure when CreateType fails.
29786 2001-09-29 Miguel de Icaza <miguel@ximian.com>
29788 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
29791 * expression.cs (Binary::CheckShiftArguments): Add missing type
29793 (Binary::ResolveOperator): Add type to the logical and and logical
29794 or, Bitwise And/Or and Exclusive Or code paths, it was missing
29797 (Binary::DoNumericPromotions): In the case where either argument
29798 is ulong (and most signed types combined with ulong cause an
29799 error) perform implicit integer constant conversions as well.
29801 2001-09-28 Miguel de Icaza <miguel@ximian.com>
29803 * expression.cs (UserImplicitCast): Method should always be
29805 (Invocation::BetterConversion): Simplified test for IntLiteral.
29807 (Expression::ImplicitNumericConversion): Split this routine out.
29808 Put the code that performs implicit constant integer conversions
29811 (Expression::Resolve): Become a wrapper around DoResolve so we can
29812 check eclass and type being set after resolve.
29814 (Invocation::Badness): Remove this dead function
29816 (Binary::ResolveOperator): Do not compute the expensive argumnets
29817 unless we have a union for it.
29819 (Probe::Emit): Is needs to do an isinst and then
29820 compare against null.
29822 (::CanConvert): Added Location argument. If the Location argument
29823 is null (Location.Null), then we do not report errors. This is
29824 used by the `probe' mechanism of the Explicit conversion. We do
29825 not want to generate an error for something that the user
29826 explicitly requested to be casted. But the pipeline for an
29827 explicit cast first tests for potential implicit casts.
29829 So for now, if the Location is null, it means `Probe only' to
29830 avoid adding another argument. Might have to revise this
29833 (ClassCast): New class used to type cast objects into arbitrary
29834 classes (used in Explicit Reference Conversions).
29836 Implement `as' as well.
29838 Reverted all the patches from Ravi below: they were broken:
29840 * The use of `level' as a mechanism to stop recursive
29841 invocations is wrong. That was there just to catch the
29842 bug with a strack trace but not as a way of addressing
29845 To fix the problem we have to *understand* what is going
29846 on and the interactions and come up with a plan, not
29847 just get things going.
29849 * The use of the type conversion cache that I proposed
29850 last night had an open topic: How does this work across
29851 protection domains. A user defined conversion might not
29852 be public in the location where we are applying the
29853 conversion, a different conversion might be selected
29854 (ie, private A->B (better) but public B->A (worse),
29855 inside A, A->B applies, but outside it, B->A will
29858 * On top of that (ie, even if the above is solved),
29859 conversions in a cache need to be abstract. Ie, `To
29860 convert from an Int to a Short use an OpcodeCast', not
29861 `To convert from an Int to a Short use the OpcodeCast on
29862 the variable 5' (which is what this patch was doing).
29864 2001-09-28 Ravi Pratap <ravi@ximian.com>
29866 * expression.cs (Invocation::ConversionExists): Re-write to use
29867 the conversion cache
29869 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
29870 cache all conversions done, not just user-defined ones.
29872 (Invocation::BetterConversion): The real culprit. Use ConversionExists
29873 to determine if a conversion exists instead of acutually trying to
29874 perform the conversion. It's faster too.
29876 (Expression::ConvertExplicit): Modify to use ConversionExists to check
29877 and only then attempt the implicit conversion.
29879 2001-09-28 Ravi Pratap <ravi@ximian.com>
29881 * expression.cs (ConvertImplicit): Use a cache for conversions
29882 already found. Check level of recursion and bail out if necessary.
29884 2001-09-28 Miguel de Icaza <miguel@ximian.com>
29886 * typemanager.cs (string_concat_string_string, string_concat_object_object):
29887 Export standard methods that we expect for string operations.
29889 * statement.cs (Block::UsageWarning): Track usage of variables and
29890 report the errors for not used variables.
29892 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
29895 2001-09-27 Miguel de Icaza <miguel@ximian.com>
29897 * codegen.cs: remove unnneded code
29899 * expression.cs: Removed BuiltinTypeAccess class
29901 Fix the order in which implicit conversions are
29904 The previous fixed dropped support for boxed conversions (adding a
29905 test to the test suite now)
29907 (UserImplicitCast::CanConvert): Remove test for source being null,
29908 that code is broken. We should not feed a null to begin with, if
29909 we do, then we should track the bug where the problem originates
29910 and not try to cover it up here.
29912 Return a resolved expression of type UserImplicitCast on success
29913 rather than true/false. Ravi: this is what I was talking about,
29914 the pattern is to use a static method as a "constructor" for
29917 Also, do not create arguments until the very last minute,
29918 otherwise we always create the arguments even for lookups that
29919 will never be performed.
29921 (UserImplicitCast::Resolve): Eliminate, objects of type
29922 UserImplicitCast are born in a fully resolved state.
29924 * typemanager.cs (InitCoreTypes): Init also value_type
29925 (System.ValueType).
29927 * expression.cs (Cast::Resolve): First resolve the child expression.
29929 (LValue): Add new method AddressOf to be used by
29932 Change the argument of Store to take an EmitContext instead of an
29933 ILGenerator, because things like FieldExpr need to be able to call
29934 their children expression to generate the instance code.
29936 (Expression::Error, Expression::Warning): Sugar functions for
29939 (Expression::MemberLookup): Accept a TypeContainer instead of a
29940 Report as the first argument.
29942 (Expression::ResolvePrimary): Killed. I still want to improve
29943 this as currently the code is just not right.
29945 (Expression::ResolveMemberAccess): Simplify, but it is still
29948 (Unary::Resolve): Catch errors in AddressOf operators.
29950 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
29951 index to a byte for the short-version, or the compiler will choose
29952 the wrong Emit call, which generates the wrong data.
29954 (ParameterReference::Emit, ::Store): same.
29956 (FieldExpr::AddressOf): Implement.
29958 * typemanager.cs: TypeManager: made public variable instead of
29961 * driver.cs: document --fatal.
29963 * report.cs (ErrorMessage, WarningMessage): new names for the old
29964 Error and Warning classes.
29966 * cs-parser.jay (member_access): Turn built-in access to types
29967 into a normal simplename
29969 2001-09-27 Ravi Pratap <ravi@ximian.com>
29971 * expression.cs (Invocation::BetterConversion): Fix to cope
29972 with q being null, since this was introducing a bug.
29974 * expression.cs (ConvertImplicit): Do built-in conversions first.
29976 2001-09-27 Ravi Pratap <ravi@ximian.com>
29978 * expression.cs (UserImplicitCast::Resolve): Fix bug.
29980 2001-09-27 Ravi Pratap <ravi@ximian.com>
29982 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
29983 I had introduced long ago (what's new ?).
29985 * expression.cs (UserImplicitCast::CanConvert): Static method to do
29986 the work of all the checking.
29987 (ConvertImplicit): Call CanConvert and only then create object if necessary.
29988 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
29990 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
29991 that is the right way.
29993 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
29994 overloading resolution. Use everywhere instead of cutting and pasting code.
29996 (Binary::ResolveOperator): Use MakeUnionSet.
29998 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
29999 we have to convert to bool types. Not complete yet.
30001 2001-09-27 Miguel de Icaza <miguel@ximian.com>
30003 * typemanager.cs (TypeManager::CSharpName): support ushort.
30005 * expression.cs (Expression::TryImplicitIntConversion): Attempts
30006 to provide an expression that performsn an implicit constant int
30007 conversion (section 6.1.6).
30008 (Expression::ConvertImplicitRequired): Reworked to include
30009 implicit constant expression conversions.
30011 (Expression::ConvertNumericExplicit): Finished.
30013 (Invocation::Emit): If InstanceExpression is null, then it means
30014 that we perform a call on this.
30016 2001-09-26 Miguel de Icaza <miguel@ximian.com>
30018 * expression.cs (Unary::Emit): Remove some dead code.
30019 (Probe): Implement Resolve and Emit for `is'.
30020 (Expression::ConvertImplicitRequired): Attempt to do constant
30021 expression conversions here. Maybe should be moved to
30022 ConvertImplicit, but I am not sure.
30023 (Expression::ImplicitLongConstantConversionPossible,
30024 Expression::ImplicitIntConstantConversionPossible): New functions
30025 that tell whether is it possible to apply an implicit constant
30026 expression conversion.
30028 (ConvertNumericExplicit): Started work on explicit numeric
30031 * cs-parser.jay: Update operator constants.
30033 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
30034 (Parameters::GetSignature): Hook up VerifyArgs here.
30035 (Parameters::VerifyArgs): Verifies that no two arguments have the
30038 * class.cs (Operator): Update the operator names to reflect the
30039 ones that the spec expects (as we are just stringizing the
30042 * expression.cs (Unary::ResolveOperator): Fix bug: Use
30043 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
30044 previous usage did only work for our methods.
30045 (Expression::ConvertImplicit): Handle decimal implicit numeric
30046 conversions as well.
30047 (Expression::InternalTypeConstructor): Used to invoke constructors
30048 on internal types for default promotions.
30050 (Unary::Emit): Implement special handling for the pre/post
30051 increment/decrement for overloaded operators, as they need to have
30052 the same semantics as the other operators.
30054 (Binary::ResolveOperator): ditto.
30055 (Invocation::ConversionExists): ditto.
30056 (UserImplicitCast::Resolve): ditto.
30058 2001-09-26 Ravi Pratap <ravi@ximian.com>
30060 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
30061 operator, return after emitting body. Regression tests pass again !
30063 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
30064 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
30065 (Invocation::OverloadResolve): Ditto.
30066 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
30068 * everywhere : update calls to the above methods accordingly.
30070 2001-09-26 Miguel de Icaza <miguel@ximian.com>
30072 * assign.cs (Assign): Make it inherit from ExpressionStatement.
30074 * expression.cs (ExpressionStatement): New base class used for
30075 expressions that can appear in statements, so that we can provide
30076 an alternate path to generate expression that do not leave a value
30079 (Expression::Emit, and all the derivatives): We no longer return
30080 whether a value is left on the stack or not. Every expression
30081 after being emitted leaves a single value on the stack.
30083 * codegen.cs (EmitContext::EmitStatementExpression): Use the
30084 facilties of ExpressionStatement if possible.
30086 * cs-parser.jay: Update statement_expression.
30088 2001-09-25 Miguel de Icaza <miguel@ximian.com>
30090 * driver.cs: Change the wording of message
30092 2001-09-25 Ravi Pratap <ravi@ximian.com>
30094 * expression.cs (Binary::ResolveOperator): Had forgottten to set
30095 the type of the expression to the return type of the method if
30096 we have an overloaded operator match ! The regression tests pass again !
30097 (Unary::ResolveOperator): Ditto.
30099 * expression.cs (Invocation::ConversionExists): Correct the member lookup
30100 to find "op_Implicit", not "implicit" ;-)
30101 (UserImplicitCast): New class to take care of user-defined implicit conversions.
30102 (ConvertImplicit, ForceConversion): Take TypeContainer argument
30104 * everywhere : Correct calls to the above accordingly.
30106 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
30107 (ConvertImplicit): Do user-defined conversion if it exists.
30109 2001-09-24 Miguel de Icaza <miguel@ximian.com>
30111 * assign.cs: track location.
30112 (Resolve): Use implicit conversions on assignment.
30114 * literal.cs: Oops. Not good, Emit of short access values should
30115 pass (Bytes) or the wrong argument will be selected.
30117 * expression.cs (Unary::Emit): Emit code for -expr.
30119 (Unary::ResolveOperator): Handle `Substract' for non-constants
30120 (substract from zero from the non-constants).
30121 Deal with Doubles as well.
30123 (Expression::ConvertImplicitRequired): New routine that reports an
30124 error if no implicit conversion exists.
30126 (Invocation::OverloadResolve): Store the converted implicit
30127 expressions if we make them
30129 2001-09-24 Ravi Pratap <ravi@ximian.com>
30131 * class.cs (ConstructorInitializer): Take a Location argument.
30132 (ConstructorBaseInitializer): Same here.
30133 (ConstructorThisInitializer): Same here.
30135 * cs-parser.jay : Update all calls accordingly.
30137 * expression.cs (Unary, Binary, New): Take location argument.
30138 Update accordingly everywhere.
30140 * cs-parser.jay : Update all calls to the above to take a location
30143 * class.cs : Ditto.
30145 2001-09-24 Ravi Pratap <ravi@ximian.com>
30147 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
30148 (Invocation::BetterConversion): Same here
30149 (Invocation::ConversionExists): Ditto.
30151 (Invocation::ConversionExists): Implement.
30153 2001-09-22 Ravi Pratap <ravi@ximian.com>
30155 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
30156 Also take an additional TypeContainer argument.
30158 * All over : Pass in TypeContainer as argument to OverloadResolve.
30160 * typemanager.cs (CSharpName): Update to check for the string type and return
30163 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
30166 2001-09-21 Ravi Pratap <ravi@ximian.com>
30168 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
30169 (Invocation::BetterFunction): Implement.
30170 (Invocation::BetterConversion): Implement.
30171 (Invocation::ConversionExists): Skeleton, no implementation yet.
30173 Okay, things work fine !
30175 2001-09-21 Miguel de Icaza <miguel@ximian.com>
30177 * typemanager.cs: declare and load enum_type, delegate_type and
30180 * expression.cs (Expression::Emit): Now emit returns a value that
30181 tells whether a value is left on the stack or not. This strategy
30182 might be reveted tomorrow with a mechanism that would address
30183 multiple assignments.
30184 (Expression::report118): Utility routine to report mismatches on
30187 (Unary::Report23): Report impossible type/operator combination
30190 (Unary::IsIncrementableNumber): Whether the type can be
30191 incremented or decremented with add.
30192 (Unary::ResolveOperator): Also allow enumerations to be bitwise
30194 (Unary::ResolveOperator): Implement ++, !, ~,
30196 (Invocation::Emit): Deal with new Emit convetion.
30198 * All Expression derivatives: Updated their Emit method to return
30199 whether they leave values on the stack or not.
30201 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
30202 stack for expressions that are statements.
30204 2001-09-20 Miguel de Icaza <miguel@ximian.com>
30206 * expression.cs (LValue): New interface. Must be implemented by
30208 (LocalVariableReference, ParameterReference, FieldExpr): Implement
30211 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
30212 interface for generating code, simplifies the code.
30214 2001-09-20 Ravi Pratap <ravi@ximian.com>
30216 * expression.cs (everywhere): Comment out return statements in ::Resolve
30217 methods to avoid the warnings.
30219 2001-09-20 Miguel de Icaza <miguel@ximian.com>
30221 * driver.cs (parse): Report error 2001 if we can not open the
30224 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
30227 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
30230 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
30231 otherwise nested blocks end up with the same index.
30233 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
30235 * expression.cs: Instead of having FIXMEs in the Resolve
30236 functions, throw exceptions so it is obvious that we are facing a
30239 * cs-parser.jay (invocation_expression): Pass Location information.
30241 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
30242 Use a basename for those routines because .NET does not like paths
30245 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
30248 2001-09-19 Miguel de Icaza <miguel@ximian.com>
30250 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
30251 are loading the correct data types (throws an exception if not).
30252 (TypeManager::InitCoreTypes): Use CoreLookupType
30254 * expression.cs (Unary::ResolveOperator): return the child
30255 expression for expressions which are just +expr.
30256 (Unary::ResolveOperator): Return negative literals for -LITERAL
30257 expressions (otherwise they are Unary {Literal}).
30258 (Invocation::Badness): Take into account `Implicit constant
30259 expression conversions'.
30261 * literal.cs (LongLiteral): Implement long literal class.
30262 (IntLiteral): export the `Value' of the intliteral.
30264 2001-09-19 Ravi Pratap <ravi@ximian.com>
30266 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
30268 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
30269 instead of 'Operator'
30271 * expression.cs (Binary::ResolveOperator): Update accordingly.
30272 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
30275 * cs-parser.jay (unary_expression): Update to use the new names.
30277 * gen-treedump.cs (GetUnary): Same here.
30279 * expression.cs (Unary::Resolve): Implement.
30280 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
30281 operators are found instead of making noise ;-)
30282 (Unary::ResolveOperator): New method to do precisely the same thing which
30283 Binary::ResolveOperator does for Binary expressions.
30284 (Unary.method, .Arguments): Add.
30285 (Unary::OperName): Implement.
30286 (Unary::ForceConversion): Copy and Paste !
30288 * class.cs (Operator::Define): Fix a small bug for the case when we have
30291 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
30292 for the inbuilt operators. Only overloading works for now ;-)
30294 2001-09-18 Miguel de Icaza <miguel@ximian.com>
30296 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
30297 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
30299 * expression.cs (This::Emit): Implement.
30300 (This::Resolve): Implement.
30301 (TypeOf:Resolve): Implement.
30302 (Expression::ResolveSimpleName): Add an implicit this to instance
30304 (MemberAccess::Resolve): Deal with Parameters and Fields.
30305 Bind instance variable to Field expressions.
30306 (FieldExpr::Instance): New field used to track the expression that
30307 represents the object instance.
30308 (FieldExpr::Resolve): Track potential errors from MemberLookup not
30310 (FieldExpr::Emit): Implement.
30312 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
30313 the last instruction contains a return opcode to avoid generating
30314 the last `ret' instruction (this generates correct code, and it is
30315 nice to pass the peverify output).
30317 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
30318 initializer for static and instance variables.
30319 (Constructor::Emit): Allow initializer to be null in the case of
30320 static constructors. Only emit initializer for instance
30323 (TypeContainer::FindMembers): Return a null array if there are no
30326 Also fix the code for the MemberTypes.Method branch, as it was not
30327 scanning that for operators (or tried to access null variables before).
30329 * assign.cs (Assign::Emit): Handle instance and static fields.
30333 * driver.cs: Stop compilation if there are parse errors.
30335 * cs-parser.jay (constructor_declaration): Provide default base
30336 initializer for non-static constructors.
30337 (constructor_declarator): Do not provide a default base
30338 initializers if none was specified.
30339 Catch the fact that constructors should not have parameters.
30341 * class.cs: Do not emit parent class initializers for static
30342 constructors, that should be flagged as an error.
30344 2001-09-18 Ravi Pratap <ravi@ximian.com>
30346 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
30347 Move back code into TypeContainer::Populate.
30349 2001-09-18 Ravi Pratap <ravi@ximian.com>
30351 * class.cs (TypeContainer::AddConstructor): Fix the check to
30352 compare against Name, not Basename.
30353 (Operator::OpType): Change Plus and Minus to Add and Subtract.
30355 * cs-parser.jay : Update accordingly.
30357 * class.cs (TypeContainer::FindMembers): For the case where we are searching
30358 for methods, don't forget to look into the operators too.
30359 (RegisterMethodBuilder): Helper method to take care of this for
30360 methods, constructors and operators.
30361 (Operator::Define): Completely revamp.
30362 (Operator.OperatorMethod, MethodName): New fields.
30363 (TypeContainer::Populate): Move the registering of builders into
30364 RegisterMethodBuilder.
30365 (Operator::Emit): Re-write.
30367 * expression.cs (Binary::Emit): Comment out code path to emit method
30368 invocation stuff for the case when we have a user defined operator. I am
30369 just not able to get it right !
30371 2001-09-17 Miguel de Icaza <miguel@ximian.com>
30373 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
30376 (Expression::MemberLookup): Provide a version that allows to
30377 specify the MemberTypes and BindingFlags.
30379 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
30380 so it was not fetching variable information from outer blocks.
30382 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
30383 Beforefieldinit as it was buggy.
30385 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
30386 that Ravi put here.
30388 * class.cs (Constructor::Emit): Only emit if block is not null.
30389 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
30390 deal with this by semantically definining it as if the user had
30393 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
30394 constructors as we now "emit" them at a higher level.
30396 (TypeContainer::DefineDefaultConstructor): Used to define the
30397 default constructors if none was provided.
30399 (ConstructorInitializer): Add methods Resolve and Emit.
30401 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
30403 2001-09-17 Ravi Pratap <ravi@ximian.com>
30405 * class.cs (TypeContainer::EmitDefaultConstructor): Register
30406 the default constructor builder with our hashtable for methodbuilders
30409 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
30410 and argument_count is 0 in which case we have a match.
30411 (Binary::ResolveOperator): More null checking and miscellaneous coding
30414 2001-09-17 Ravi Pratap <ravi@ximian.com>
30416 * rootcontext.cs (IsNameSpace): Compare against null.
30418 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
30420 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
30421 and Unary::Operator.
30423 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
30426 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
30427 we have overloaded operators.
30428 (Binary::ResolveOperator): Implement the part which does the operator overload
30431 * class.cs (Operator::Emit): Implement.
30432 (TypeContainer::Emit): Emit the operators we have too.
30434 * expression.cs (Binary::Emit): Update to emit the appropriate code for
30435 the case when we have a user-defined operator.
30437 2001-09-17 Miguel de Icaza <miguel@ximian.com>
30439 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
30441 2001-09-16 Ravi Pratap <ravi@ximian.com>
30443 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
30444 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
30445 (Constructor::Emit): Implement.
30446 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
30447 if we have no work to do.
30448 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
30451 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
30452 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
30454 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
30457 2001-09-15 Ravi Pratap <ravi@ximian.com>
30459 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
30461 (Tree::RecordNamespace): Method to do what the name says ;-)
30462 (Tree::Namespaces): Property to get at the namespaces hashtable.
30464 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
30467 * rootcontext.cs (IsNamespace): Fixed it :-)
30469 2001-09-14 Miguel de Icaza <miguel@ximian.com>
30471 * class.cs (TypeContainer::FindMembers): Add support for
30473 (MethodCore): New class that encapsulates both the shared aspects
30474 of a Constructor and a Method.
30475 (Method, Constructor): Factored pieces into MethodCore.
30477 * driver.cs: Added --fatal which makes errors throw exceptions.
30478 Load System assembly as well as part of the standard library.
30480 * report.cs: Allow throwing exceptions on errors for debugging.
30482 * modifiers.cs: Do not use `parent', instead use the real type
30483 container to evaluate permission settings.
30485 * class.cs: Put Ravi's patch back in. He is right, and we will
30486 have to cope with the
30488 2001-09-14 Ravi Pratap <ravi@ximian.com>
30490 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
30491 FamORAssem, not FamANDAssem.
30493 2001-09-14 Miguel de Icaza <miguel@ximian.com>
30495 * driver.cs: Added --parse option that only parses its input files
30498 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
30499 incorrect. IsTopLevel is not used to tell whether an object is
30500 root_types or not (that can be achieved by testing this ==
30501 root_types). But to see if this is a top-level *class* (not
30502 necessarly our "toplevel" container).
30504 2001-09-14 Ravi Pratap <ravi@ximian.com>
30506 * enum.cs (Enum::Define): Modify to call the Lookup method on the
30507 parent instead of a direct call to GetType.
30509 2001-09-14 Ravi Pratap <ravi@ximian.com>
30511 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
30512 Modifiers.TypeAttr. This should just be a call to that method.
30514 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
30515 object so that we can determine if we are top-level or not.
30517 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
30520 * enum.cs (Enum::Define): Ditto.
30522 * modifiers.cs (FieldAttr): Re-write.
30524 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
30525 (TypeContainer::HaveStaticConstructor): New property to provide access
30526 to precisely that info.
30528 * modifiers.cs (MethodAttr): Re-write.
30529 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
30531 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
30532 of top-level types as claimed.
30534 2001-09-13 Miguel de Icaza <miguel@ximian.com>
30536 * expression.cs (MemberLookup): Fruitless attempt to lookup
30537 constructors. Maybe I need to emit default constructors? That
30538 might be it (currently .NET emits this for me automatically).
30539 (Invocation::OverloadResolve): Cope with Arguments == null.
30540 (Invocation::EmitArguments): new function, shared by the new
30541 constructor and us.
30542 (Invocation::Emit): Handle static and instance methods. Emit
30543 proper call instruction for virtual or non-virtual invocations.
30544 (New::Emit): Implement.
30545 (New::Resolve): Implement.
30546 (MemberAccess:Resolve): Implement.
30547 (MethodGroupExpr::InstanceExpression): used conforming to the spec
30548 to track instances.
30549 (FieldExpr::Resolve): Set type.
30551 * support.cs: Handle empty arguments.
30553 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
30554 SimpleLookup): Auxiliary routines to help parse a qualifier
30557 Update qualifier_identifier rule.
30559 * codegen.cs: Removed debugging messages.
30561 * class.cs: Make this a global thing, this acts just as a "key" to
30562 objects that we might have around.
30564 (Populate): Only initialize method_builders_to_methods once.
30566 * expression.cs (PropertyExpr): Initialize type from the
30569 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
30570 Resolve pattern. Attempt to implicitly convert value to boolean.
30573 * expression.cs: Set the type for the int32/int32 argument case.
30574 (Binary::ResolveOperator): Set the return type to boolean for
30575 comparission operators
30577 * typemanager.cs: Remove debugging print code.
30579 (Invocation::Resolve): resolve type.
30581 * class.cs: Allocate a MemberInfo of the correct size, as the code
30582 elsewhere depends on the test to reflect the correct contents.
30584 (Method::) Keep track of parameters, due to System.Reflection holes
30586 (TypeContainer::Populate): Keep track of MethodBuilders to Method
30589 (TypeContainer::FindMembers): Use ArrayList and then copy an array
30590 of the exact size and return that.
30592 (Class::LookupMethodByBuilder): New function that maps
30593 MethodBuilders to its methods. Required to locate the information
30594 on methods because System.Reflection bit us again.
30596 * support.cs: New file, contains an interface ParameterData and
30597 two implementations: ReflectionParameters and InternalParameters
30598 used to access Parameter information. We will need to grow this
30601 * expression.cs (Invocation::GetParameterData): implement a cache
30602 and a wrapper around the ParameterData creation for methods.
30603 (Invocation::OverloadResolve): Use new code.
30605 2001-09-13 Ravi Pratap <ravi@ximian.com>
30607 * class.cs (TypeContainer::EmitField): Remove and move into
30608 (Field::Define): here and modify accordingly.
30609 (Field.FieldBuilder): New member.
30610 (TypeContainer::Populate): Update accordingly.
30611 (TypeContainer::FindMembers): Implement.
30613 2001-09-13 Miguel de Icaza <miguel@ximian.com>
30615 * statement.cs: (VariableInfo::VariableType): New field to be
30616 initialized with the full type once it is resolved.
30618 2001-09-12 Miguel de Icaza <miguel@ximian.com>
30620 * parameter.cs (GetParameterInfo): Use a type cache to compute
30621 things only once, and to reuse this information
30623 * expression.cs (LocalVariableReference::Emit): Implement.
30624 (OpcodeCast::Emit): fix.
30626 (ParameterReference::Resolve): Implement.
30627 (ParameterReference::Emit): Implement.
30629 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
30630 that are expressions need to stay as Expressions.
30632 * typemanager.cs (CSharpName): Returns the C# name of a type if
30635 * expression.cs (Expression::ConvertImplicit): New function that
30636 implements implicit type conversions.
30638 (Expression::ImplicitReferenceConversion): Implements implicit
30639 reference conversions.
30641 (EmptyCast): New type for transparent casts.
30643 (OpcodeCast): New type for casts of types that are performed with
30644 a sequence of bytecodes.
30646 (BoxedCast): New type used for casting value types into reference
30647 types. Emits a box opcode.
30649 (Binary::DoNumericPromotions): Implements numeric promotions of
30650 and computation of the Binary::Type.
30652 (Binary::EmitBranchable): Optimization.
30654 (Binary::Emit): Implement code emission for expressions.
30656 * typemanager.cs (TypeManager): Added two new core types: sbyte
30659 2001-09-12 Ravi Pratap <ravi@ximian.com>
30661 * class.cs (TypeContainer::FindMembers): Method which does exactly
30662 what Type.FindMembers does, only we don't have to use reflection. No
30663 implementation yet.
30665 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
30666 typecontainer objects as we need to get at them.
30667 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
30669 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
30670 typecontainer object.
30672 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
30673 of just a Report object.
30675 2001-09-11 Ravi Pratap <ravi@ximian.com>
30677 * class.cs (Event::Define): Go back to using the prefixes "add_" and
30679 (TypeContainer::Populate): Now define the delegates of the type too.
30680 (TypeContainer.Delegates): Property to access the list of delegates defined
30683 * delegates.cs (Delegate::Define): Implement partially.
30685 * modifiers.cs (TypeAttr): Handle more flags.
30687 2001-09-11 Ravi Pratap <ravi@ximian.com>
30689 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
30691 (Operator::Define): Re-write logic to get types by using the LookupType method
30692 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
30693 (Indexer::Define): Ditto.
30694 (Event::Define): Ditto.
30695 (Property::Define): Ditto.
30697 2001-09-10 Ravi Pratap <ravi@ximian.com>
30699 * class.cs (TypeContainer::Populate): Now define operators too.
30700 (TypeContainer.Operators): New property to access the list of operators
30702 (Operator.OperatorMethodBuilder): New member to hold the method builder
30703 for the operator we are defining.
30704 (Operator::Define): Implement.
30706 2001-09-10 Ravi Pratap <ravi@ximian.com>
30708 * class.cs (Event::Define): Make the prefixes of the accessor methods
30709 addOn_ and removeOn_
30711 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
30712 of the location being passed in too. Ideally, this should go later since all
30713 error reporting should be done through the Report object.
30715 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
30716 (Populate): Iterate thru the indexers we have and define them too.
30717 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
30718 for the get and set accessors.
30719 (Indexer::Define): Implement.
30721 2001-09-09 Miguel de Icaza <miguel@ximian.com>
30723 * expression.cs (Binary::Resolve): Beginning of it. I scratched
30724 my previous implementation, did not work.
30726 * typemanager.cs: Add a couple of missing types (the longs).
30728 * literal.cs: Use TypeManager.bool_type instead of getting it.
30730 * expression.cs (EventExpr): New kind of expressions.
30731 (Expressio::ExprClassFromMemberInfo): finish
30733 2001-09-08 Miguel de Icaza <miguel@ximian.com>
30735 * assign.cs: Emit stores to static fields differently.
30737 2001-09-08 Ravi Pratap <ravi@ximian.com>
30739 * Merge in changes and adjust code to tackle conflicts. Backed out my
30740 code in Assign::Resolve ;-)
30742 2001-09-08 Ravi Pratap <ravi@ximian.com>
30744 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
30745 instead Report.Error and also pass in the location.
30746 (CSharpParser::Lexer): New readonly property to return the reference
30747 to the Tokenizer object.
30748 (declare_local_variables): Use Report.Error with location instead of plain
30752 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
30753 (Operator.CheckBinaryOperator): Ditto.
30755 * cs-parser.jay (operator_declarator): Update accordingly.
30757 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
30758 (CheckBinaryOperator): Same here.
30760 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
30761 on the name without any prefixes of namespace names etc. This is because we
30762 already might have something already fully qualified like
30763 'System.Console.WriteLine'
30765 * assign.cs (Resolve): Begin implementation. Stuck ;-)
30767 2001-09-07 Ravi Pratap <ravi@ximian.com>
30769 * cs-tokenizer.cs (location): Return a string which also contains
30772 * expression.cs (ElementAccess): New class for expressions of the
30773 type 'element access.'
30774 (BaseAccess): New class for expressions of the type 'base access.'
30775 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
30778 * cs-parser.jay (element_access): Implement action.
30779 (base_access): Implement actions.
30780 (checked_expression, unchecked_expression): Implement.
30782 * cs-parser.jay (local_variable_type): Correct and implement.
30783 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
30785 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
30787 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
30788 name and the specifiers.
30790 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
30792 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
30793 making them all public ;-)
30795 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
30798 2001-09-07 Miguel de Icaza <miguel@ximian.com>
30800 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
30802 (FieldExpr, PropertyExprs): New resolved expressions.
30803 (SimpleName::MemberStaticCheck): Perform static checks for access
30804 to non-static fields on static methods. Maybe this should be
30805 generalized for MemberAccesses.
30806 (SimpleName::ResolveSimpleName): More work on simple name
30809 * cs-parser.jay (primary_expression/qualified_identifier): track
30810 the parameter index.
30812 * codegen.cs (CodeGen::Save): Catch save exception, report error.
30813 (EmitContext::EmitBoolExpression): Chain to expression generation
30814 instead of temporary hack.
30815 (::EmitStatementExpression): Put generic expression code generation.
30817 * assign.cs (Assign::Emit): Implement variable assignments to
30818 local variables, parameters and fields.
30820 2001-09-06 Miguel de Icaza <miguel@ximian.com>
30822 * statement.cs (Block::GetVariableInfo): New method, returns the
30823 VariableInfo for a variable name in a block.
30824 (Block::GetVariableType): Implement in terms of GetVariableInfo
30826 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
30827 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
30829 2001-09-06 Ravi Pratap <ravi@ximian.com>
30831 * cs-parser.jay (operator_declaration): Continue on my quest : update
30832 to take attributes argument.
30833 (event_declaration): Ditto.
30834 (enum_declaration): Ditto.
30835 (indexer_declaration): Ditto.
30837 * class.cs (Operator::Operator): Update constructor accordingly.
30838 (Event::Event): Ditto.
30840 * delegate.cs (Delegate::Delegate): Same here.
30842 * enum.cs (Enum::Enum): Same here.
30844 2001-09-05 Ravi Pratap <ravi@ximian.com>
30846 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
30848 * ../tests/cs0658.cs : New file to demonstrate error 0658.
30850 * attribute.cs (Attributes): New class to encapsulate all attributes which were
30851 being passed around as an arraylist.
30852 (Attributes::AddAttribute): Method to add attribute sections.
30854 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
30855 (struct_declaration): Update accordingly.
30856 (constant_declaration): Update.
30857 (field_declaration): Update.
30858 (method_header): Update.
30859 (fixed_parameter): Update.
30860 (parameter_array): Ditto.
30861 (property_declaration): Ditto.
30862 (destructor_declaration): Ditto.
30864 * class.cs (Struct::Struct): Update constructors accordingly.
30865 (Class::Class): Ditto.
30866 (Field::Field): Ditto.
30867 (Method::Method): Ditto.
30868 (Property::Property): Ditto.
30869 (TypeContainer::OptAttribute): update property's return type.
30871 * interface.cs (Interface.opt_attributes): New member.
30872 (Interface::Interface): Update to take the extra Attributes argument.
30874 * parameter.cs (Parameter::Parameter): Ditto.
30876 * constant.cs (Constant::Constant): Ditto.
30878 * interface.cs (InterfaceMemberBase): New OptAttributes field.
30879 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
30880 the attributes as a parameter.
30881 (InterfaceProperty): Update constructor call.
30882 (InterfaceEvent): Ditto.
30883 (InterfaceMethod): Ditto.
30884 (InterfaceIndexer): Ditto.
30886 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
30887 pass the attributes too.
30888 (interface_event_declaration): Ditto.
30889 (interface_property_declaration): Ditto.
30890 (interface_method_declaration): Ditto.
30891 (interface_declaration): Ditto.
30893 2001-09-05 Miguel de Icaza <miguel@ximian.com>
30895 * class.cs (Method::Define): Track the "static Main" definition to
30896 create an entry point.
30898 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
30899 EntryPoint if we find it.
30901 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
30902 (EmitContext::ig): Make this variable public.
30904 * driver.cs: Make the default output file be the first file name
30905 with the .exe extension.
30907 Detect empty compilations
30909 Handle various kinds of output targets. Handle --target and
30910 rename -t to --dumper.
30912 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
30913 methods inherited from Expression return now an Expression. This
30914 will is used during the tree rewriting as we resolve them during
30917 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
30918 the spec. Missing entirely is the information about
30919 accessability of elements of it.
30921 (Expression::ExprClassFromMemberInfo): New constructor for
30922 Expressions that creates a fully initialized Expression based on
30923 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
30926 (Invocation::Resolve): Begin implementing resolution of invocations.
30928 * literal.cs (StringLiteral): Implement Emit.
30930 2001-09-05 Ravi Pratap <ravi@ximian.com>
30932 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
30935 2001-09-04 Ravi Pratap <ravi@ximian.com>
30937 * cs-parser.jay (attribute_arguments): Implement actions.
30938 (attribute): Fix bug in production. Implement action.
30939 (attribute_list): Implement.
30940 (attribute_target): Implement.
30941 (attribute_target_specifier, opt_target_specifier): Implement
30942 (CheckAttributeTarget): New method to check if the attribute target
30944 (attribute_section): Implement.
30945 (opt_attributes): Implement.
30947 * attribute.cs : New file to handle attributes.
30948 (Attribute): Class to hold attribute info.
30950 * cs-parser.jay (opt_attribute_target_specifier): Remove production
30951 (attribute_section): Modify production to use 2 different rules to
30952 achieve the same thing. 1 s/r conflict down !
30953 Clean out commented, useless, non-reducing dimension_separator rules.
30955 * class.cs (TypeContainer.attributes): New member to hold list
30956 of attributes for a type.
30957 (Struct::Struct): Modify to take one more argument, the attribute list.
30958 (Class::Class): Ditto.
30959 (Field::Field): Ditto.
30960 (Method::Method): Ditto.
30961 (Property::Property): Ditto.
30963 * cs-parser.jay (struct_declaration): Update constructor call to
30964 pass in the attributes too.
30965 (class_declaration): Ditto.
30966 (constant_declaration): Ditto.
30967 (field_declaration): Ditto.
30968 (method_header): Ditto.
30969 (fixed_parameter): Ditto.
30970 (parameter_array): Ditto.
30971 (property_declaration): Ditto.
30973 * constant.cs (Constant::Constant): Update constructor similarly.
30974 Use System.Collections.
30976 * parameter.cs (Parameter::Parameter): Update as above.
30978 2001-09-02 Ravi Pratap <ravi@ximian.com>
30980 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
30981 (TypeContainer.delegates): New member to hold list of delegates.
30983 * cs-parser.jay (delegate_declaration): Implement the action correctly
30984 this time as I seem to be on crack ;-)
30986 2001-09-02 Miguel de Icaza <miguel@ximian.com>
30988 * rootcontext.cs (RootContext::IsNamespace): new function, used to
30989 tell whether an identifier represents a namespace.
30991 * expression.cs (NamespaceExpr): A namespace expression, used only
30992 temporarly during expression resolution.
30993 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
30994 utility functions to resolve names on expressions.
30996 2001-09-01 Miguel de Icaza <miguel@ximian.com>
30998 * codegen.cs: Add hook for StatementExpressions.
31000 * class.cs: Fix inverted test for static flag in methods.
31002 2001-09-02 Ravi Pratap <ravi@ximian.com>
31004 * class.cs (Operator::CheckUnaryOperator): Correct error number used
31005 to make it coincide with MS' number.
31006 (Operator::CheckBinaryOperator): Ditto.
31008 * ../errors/errors.txt : Remove error numbers added earlier.
31010 * ../errors/cs1019.cs : Test case for error # 1019
31012 * ../errros/cs1020.cs : Test case for error # 1020
31014 * cs-parser.jay : Clean out commented cruft.
31015 (dimension_separators, dimension_separator): Comment out. Ostensibly not
31016 used anywhere - non-reducing rule.
31017 (namespace_declarations): Non-reducing rule - comment out.
31019 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
31020 with TypeContainer::AddEnum.
31022 * delegate.cs : New file for delegate handling classes.
31023 (Delegate): Class for declaring delegates.
31025 * makefile : Update.
31027 * cs-parser.jay (delegate_declaration): Implement.
31029 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
31031 * class.cs (Event::Define): Implement.
31032 (Event.EventBuilder): New member.
31034 * class.cs (TypeContainer::Populate): Update to define all enums and events
31036 (Events): New property for the events arraylist we hold. Shouldn't we move to using
31037 readonly fields for all these cases ?
31039 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
31041 * class.cs (Property): Revamp to use the convention of making fields readonly.
31042 Accordingly modify code elsewhere.
31044 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
31045 the Define method of the Property class.
31047 * class.cs : Clean up applied patch and update references to variables etc. Fix
31049 (TypeContainer::Populate): Update to define all the properties we have. Also
31050 define all enumerations.
31052 * enum.cs (Define): Implement.
31054 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
31056 * cs-parser.jay (overloadable_operator): The semantic value is an
31057 enum of the Operator class.
31058 (operator_declarator): Implement actions.
31059 (operator_declaration): Implement.
31061 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
31062 validity of definitions.
31063 (Operator::CheckBinaryOperator): Static method to check for binary operators
31064 (TypeContainer::AddOperator): New method to add an operator to a type.
31066 * cs-parser.jay (indexer_declaration): Added line to actually call the
31067 AddIndexer method so it gets added ;-)
31069 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
31070 already taken care of by the MS compiler ?
31072 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
31074 * class.cs (Operator): New class for operator declarations.
31075 (Operator::OpType): Enum for the various operators.
31077 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
31079 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
31080 ostensibly handle this in semantic analysis.
31082 * cs-parser.jay (general_catch_clause): Comment out
31083 (specific_catch_clauses, specific_catch_clause): Ditto.
31084 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
31085 (catch_args, opt_catch_args): New productions.
31086 (catch_clause): Rewrite to use the new productions above
31087 (catch_clauses): Modify accordingly.
31088 (opt_catch_clauses): New production to use in try_statement
31089 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
31090 and re-write the code in the actions to extract the specific and
31091 general catch clauses by being a little smart ;-)
31093 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
31094 Hooray, try and catch statements parse fine !
31096 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31098 * statement.cs (Block::GetVariableType): Fix logic to extract the type
31099 string from the hashtable of variables.
31101 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
31102 I end up making that mistake ;-)
31103 (catch_clauses): Fixed gross error which made Key and Value of the
31104 DictionaryEntry the same : $1 !!
31106 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31108 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
31110 * cs-parser.jay (event_declaration): Correct to remove the semicolon
31111 when the add and remove accessors are specified.
31113 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
31115 * cs-parser.jay (IndexerDeclaration): New helper class to hold
31116 information about indexer_declarator.
31117 (indexer_declarator): Implement actions.
31118 (parsing_indexer): New local boolean used to keep track of whether
31119 we are parsing indexers or properties. This is necessary because
31120 implicit_parameters come into picture even for the get accessor in the
31121 case of an indexer.
31122 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
31124 * class.cs (Indexer): New class for indexer declarations.
31125 (TypeContainer::AddIndexer): New method to add an indexer to a type.
31126 (TypeContainer::indexers): New member to hold list of indexers for the
31129 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
31131 * cs-parser.jay (add_accessor_declaration): Implement action.
31132 (remove_accessor_declaration): Implement action.
31133 (event_accessors_declaration): Implement
31134 (variable_declarators): swap statements for first rule - trivial.
31136 * class.cs (Event): New class to hold information about event
31138 (TypeContainer::AddEvent): New method to add an event to a type
31139 (TypeContainer::events): New member to hold list of events.
31141 * cs-parser.jay (event_declaration): Implement actions.
31143 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
31145 * cs-parser.jay (dim_separators): Implement. Make it a string
31146 concatenating all the commas together, just as they appear.
31147 (opt_dim_separators): Modify accordingly
31148 (rank_specifiers): Update accordingly. Basically do the same
31149 thing - instead, collect the brackets here.
31150 (opt_rank_sepcifiers): Modify accordingly.
31151 (array_type): Modify to actually return the complete type string
31152 instead of ignoring the rank_specifiers.
31153 (expression_list): Implement to collect the expressions
31154 (variable_initializer): Implement. We make it a list of expressions
31155 essentially so that we can handle the array_initializer case neatly too.
31156 (variable_initializer_list): Implement.
31157 (array_initializer): Make it a list of variable_initializers
31158 (opt_array_initializer): Modify accordingly.
31160 * expression.cs (New::NType): Add enumeration to help us
31161 keep track of whether we have an object/delegate creation
31162 or an array creation.
31163 (New:NewType, New::Rank, New::Indices, New::Initializers): New
31164 members to hold data about array creation.
31165 (New:New): Modify to update NewType
31166 (New:New): New Overloaded contructor for the array creation
31169 * cs-parser.jay (array_creation_expression): Implement to call
31170 the overloaded New constructor.
31172 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
31174 * class.cs (TypeContainer::Constructors): Return member
31175 constructors instead of returning null.
31177 2001-08-26 Miguel de Icaza <miguel@ximian.com>
31179 * typemanager.cs (InitCoreTypes): Initialize the various core
31180 types after we have populated the type manager with the user
31181 defined types (this distinction will be important later while
31182 compiling corlib.dll)
31184 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
31185 on Expression Classification. Now all expressions have a method
31186 `Resolve' and a method `Emit'.
31188 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
31189 generation from working. Also add some temporary debugging
31192 2001-08-24 Miguel de Icaza <miguel@ximian.com>
31194 * codegen.cs: Lots of code generation pieces. This is only the
31195 beginning, will continue tomorrow with more touches of polish. We
31196 handle the fundamentals of if, while, do, for, return. Others are
31197 trickier and I need to start working on invocations soon.
31199 * gen-treedump.cs: Bug fix, use s.Increment here instead of
31202 * codegen.cs (EmitContext): New struct, used during code
31203 emission to keep a context. Most of the code generation will be
31206 * cs-parser.jay: Add embedded blocks to the list of statements of
31207 this block. So code generation proceeds in a top down fashion.
31209 2001-08-23 Miguel de Icaza <miguel@ximian.com>
31211 * statement.cs: Add support for multiple child blocks.
31213 2001-08-22 Miguel de Icaza <miguel@ximian.com>
31215 * codegen.cs (EmitCode): New function, will emit the code for a
31216 Block of code given a TypeContainer and its ILGenerator.
31218 * statement.cs (Block): Standard public readonly optimization.
31219 (Block::Block constructors): Link children.
31220 (Block::Child): Child Linker.
31221 (Block::EmitVariables): Emits IL variable declarations.
31223 * class.cs: Drop support for MethodGroups here, delay until
31225 (Method::): Applied the same simplification that I did before, and
31226 move from Properties to public readonly fields.
31227 (Method::ParameterTypes): Returns the parameter types for the
31228 function, and implements a cache that will be useful later when I
31229 do error checking and the semantic analysis on the methods is
31231 (Constructor::GetCallingConvention): Renamed from CallingConvetion
31232 and made a method, optional argument tells whether this is a class
31233 or a structure to apply the `has-this' bit.
31234 (Method::GetCallingConvention): Implement, returns the calling
31236 (Method::Define): Defines the type, a second pass is performed
31237 later to populate the methods.
31239 (Constructor::ParameterTypes): implement a cache similar to the
31240 one on Method::ParameterTypes, useful later when we do semantic
31243 (TypeContainer::EmitMethod): New method. Emits methods.
31245 * expression.cs: Removed MethodGroup class from here.
31247 * parameter.cs (Parameters::GetCallingConvention): new method.
31249 2001-08-21 Miguel de Icaza <miguel@ximian.com>
31251 * class.cs (TypeContainer::Populate): Drop RootContext from the
31254 (Constructor::CallingConvention): Returns the calling convention.
31255 (Constructor::ParameterTypes): Returns the constructor parameter
31258 (TypeContainer::AddConstructor): Keep track of default constructor
31259 and the default static constructor.
31261 (Constructor::) Another class that starts using `public readonly'
31262 instead of properties.
31264 (Constructor::IsDefault): Whether this is a default constructor.
31266 (Field::) use readonly public fields instead of properties also.
31268 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
31269 track of static constructors; If none is used, turn on
31270 BeforeFieldInit in the TypeAttributes.
31272 * cs-parser.jay (opt_argument_list): now the return can be null
31273 for the cases where there are no arguments.
31275 (constructor_declarator): If there is no implicit `base' or
31276 `this', then invoke the default parent constructor.
31278 * modifiers.cs (MethodAttr): New static function maps a set of
31279 modifiers flags into a MethodAttributes enum
31280 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
31281 MethodAttr, TypeAttr to represent the various mappings where the
31282 modifiers are used.
31283 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
31285 2001-08-19 Miguel de Icaza <miguel@ximian.com>
31287 * parameter.cs (GetParameterInfo): Fix bug where there would be no
31290 * interface.cs (PopulateIndexer): Implemented the code generator
31291 for interface indexers.
31293 2001-08-17 Miguel de Icaza <miguel@ximian.com>
31295 * interface.cs (InterfaceMemberBase): Now we track the new status
31298 (PopulateProperty): Implement property population. Woohoo! Got
31299 Methods and Properties going today.
31301 Removed all the properties for interfaces, and replaced them with
31302 `public readonly' fields.
31304 2001-08-16 Miguel de Icaza <miguel@ximian.com>
31306 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
31307 initialize their hashtables/arraylists only when they are needed
31308 instead of doing this always.
31310 * parameter.cs: Handle refs and out parameters.
31312 * cs-parser.jay: Use an ArrayList to construct the arguments
31313 instead of the ParameterCollection, and then cast that to a
31316 * parameter.cs: Drop the use of ParameterCollection and use
31317 instead arrays of Parameters.
31319 (GetParameterInfo): Use the Type, not the Name when resolving
31322 2001-08-13 Miguel de Icaza <miguel@ximian.com>
31324 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
31325 and instead use public readonly fields.
31327 * class.cs: Put back walking code for type containers.
31329 2001-08-11 Miguel de Icaza <miguel@ximian.com>
31331 * class.cs (MakeConstant): Code to define constants.
31333 * rootcontext.cs (LookupType): New function. Used to locate types
31336 2001-08-08 Miguel de Icaza <miguel@ximian.com>
31338 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
31339 this System.Reflection code is. Kudos to Microsoft
31341 * typemanager.cs: Implement a type cache and avoid loading all
31342 types at boot time. Wrap in LookupType the internals. This made
31343 the compiler so much faster. Wow. I rule!
31345 * driver.cs: Make sure we always load mscorlib first (for
31346 debugging purposes, nothing really important).
31348 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
31349 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
31351 * rootcontext.cs: Lookup types on their namespace; Lookup types
31352 on namespaces that have been imported using the `using' keyword.
31354 * class.cs (TypeContainer::TypeAttr): Virtualize.
31355 (Class::TypeAttr): Return attributes suitable for this bad boy.
31356 (Struct::TypeAttr): ditto.
31357 Handle nested classes.
31358 (TypeContainer::) Remove all the type visiting code, it is now
31359 replaced with the rootcontext.cs code
31361 * rootcontext.cs (GetClassBases): Added support for structs.
31363 2001-08-06 Miguel de Icaza <miguel@ximian.com>
31365 * interface.cs, statement.cs, class.cs, parameter.cs,
31366 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
31367 Drop use of TypeRefs, and use strings instead.
31369 2001-08-04 Miguel de Icaza <miguel@ximian.com>
31373 * class.cs (Struct::Struct): set the SEALED flags after
31374 checking the modifiers.
31375 (TypeContainer::TypeAttr): new property, returns the
31376 TypeAttributes for a class.
31378 * cs-parser.jay (type_list): Oops, list production was creating a
31379 new list of base types.
31381 * rootcontext.cs (StdLib): New property.
31382 (GetInterfaceTypeByName): returns an interface by type name, and
31383 encapsulates error handling here.
31384 (GetInterfaces): simplified.
31385 (ResolveTree): Encapsulated all the tree resolution here.
31386 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
31389 * driver.cs: Add support for --nostdlib, to avoid loading the
31390 default assemblies.
31391 (Main): Do not put tree resolution here.
31393 * rootcontext.cs: Beginning of the class resolution.
31395 2001-08-03 Miguel de Icaza <miguel@ximian.com>
31397 * rootcontext.cs: Provide better error reporting.
31399 * cs-parser.jay (interface_base): set our $$ to be interfaces.
31401 * rootcontext.cs (CreateInterface): Handle the case where there
31402 are no parent interfaces.
31404 (CloseTypes): Routine to flush types at the end.
31405 (CreateInterface): Track types.
31406 (GetInterfaces): Returns an array of Types from the list of
31407 defined interfaces.
31409 * typemanager.c (AddUserType): Mechanism to track user types (puts
31410 the type on the global type hash, and allows us to close it at the
31413 2001-08-02 Miguel de Icaza <miguel@ximian.com>
31415 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
31416 RecordInterface instead.
31418 * cs-parser.jay: Updated to reflect changes above.
31420 * decl.cs (Definition): Keep track of the TypeBuilder type that
31421 represents this type here. Not sure we will use it in the long
31422 run, but wont hurt for now.
31424 * driver.cs: Smaller changes to accomodate the new code.
31426 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
31429 * rootcontext.cs (CreateInterface): New method, used to create
31430 the System.TypeBuilder type for interfaces.
31431 (ResolveInterfaces): new entry point to resolve the interface
31433 (CodeGen): Property, used to keep track of the code generator.
31435 2001-07-26 Miguel de Icaza <miguel@ximian.com>
31437 * cs-parser.jay: Add a second production for delegate_declaration
31440 (enum_body): Put an opt_comma here instead of putting it on
31441 enum_body or enum_member_declarations so we can handle trailing
31442 commas on enumeration members. Gets rid of a shift/reduce.
31444 (type_list): Need a COMMA in the middle.
31446 (indexer_declaration): Tell tokenizer to recognize get/set
31448 * Remove old targets.
31450 * Re-add the parser target.
31452 2001-07-13 Simon Cozens <simon@simon-cozens.org>
31454 * cs-parser.jay: Add precendence rules for a number of operators
31455 ot reduce the number of shift/reduce conflicts in the grammar.
31457 2001-07-17 Miguel de Icaza <miguel@ximian.com>
31459 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
31462 Get rid of old crufty code.
31464 * rootcontext.cs: Use this to keep track of the parsed
31465 representation and the defined types available to the program.
31467 * gen-treedump.cs: adjust for new convention.
31469 * type.cs: Split out the type manager, and the assembly builder
31472 * typemanager.cs: the type manager will live here now.
31474 * cil-codegen.cs: And the code generator here.
31476 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
31478 * makefile: Fixed up for easy making.
31480 2001-07-13 Simon Cozens <simon@simon-cozens.org>
31482 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
31485 (unary_expression): Expand pre_increment_expression and
31486 post_decrement_expression to reduce a shift/reduce.
31488 2001-07-11 Simon Cozens
31490 * cs-tokenizer.cs: Hex numbers should begin with a 0.
31492 Improve allow_keyword_as_indent name.
31494 2001-06-19 Miguel de Icaza <miguel@ximian.com>
31496 * Adjustments for Beta2.
31498 2001-06-13 Miguel de Icaza <miguel@ximian.com>
31500 * decl.cs: Added `Define' abstract method.
31501 (InTransit): new property, used to catch recursive definitions.
31503 * interface.cs: Implement `Define'.
31505 * modifiers.cs: Map Modifiers.constants to
31506 System.Reflection.TypeAttribute flags.
31508 * class.cs: Keep track of types and user-defined types.
31509 (BuilderInit): New method for creating an assembly
31510 (ResolveType): New function to launch the resolution process, only
31511 used by interfaces for now.
31513 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
31514 that are inserted into the name space.
31516 2001-06-08 Miguel de Icaza <miguel@ximian.com>
31518 * ARGH. I have screwed up my tree so many times due to the use of
31519 rsync rather than using CVS. Going to fix this at once.
31521 * driver.cs: Objetify driver. Load assemblies, use assemblies to
31524 2001-06-07 Miguel de Icaza <miguel@ximian.com>
31526 * Experiment successful: Use System.Type rather that our own
31529 2001-05-25 Miguel de Icaza <miguel@ximian.com>
31531 * cs-parser.jay: Removed nsAliases from here.
31533 Use new namespaces, handle `using XXX;'
31535 * namespace.cs: Reimplemented namespace handling, use a recursive
31536 definition of the class. Now we can keep track of using clauses
31537 and catch invalid using clauses.
31539 2001-05-24 Miguel de Icaza <miguel@ximian.com>
31541 * gen-treedump.cs: Adapted for all the renaming.
31543 * expression.cs (Expression): this class now has a Type property
31544 which returns an expression Type.
31546 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
31547 `Type', as this has a different meaning now in the base
31549 2001-05-22 Miguel de Icaza <miguel@ximian.com>
31551 * interface.cs, class.cs: Removed from all the sources the
31552 references to signature computation, as we can not do method
31553 signature computation during the parsing time, as we are not
31554 trying to solve at that point distinguishing:
31558 void a (NS.Blah x) {}
31561 Which depending on the context might be valid or not, as we do not
31562 know if Blah is the same thing as NS.Blah at that point.
31564 * Redid everything so the code uses TypeRefs now instead of
31565 Types. TypeRefs are just temporary type placeholders, that need
31566 to be resolved. They initially have a pointer to a string and the
31567 current scope in which they are used. This is used later by the
31568 compiler to resolve the reference to an actual Type.
31570 * DeclSpace is no longer a CIR.Type, and neither are
31571 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
31572 are all DeclSpaces, but no Types.
31574 * type.cs (TypeRefManager): This implements the TypeRef manager,
31575 which keeps track of all the types that need to be resolved after
31576 the parsing has finished.
31578 2001-05-13 Miguel de Icaza <miguel@ximian.com>
31580 * ARGH. We are going to have to store `foreach' as a class rather
31581 than resolving it, as we need to verify error 1579 after name
31582 resolution. *OR* we could keep a flag that says `This request to
31583 IEnumerator comes from a foreach statement' which we can then use
31584 to generate the error.
31586 2001-05-10 Miguel de Icaza <miguel@ximian.com>
31588 * class.cs (TypeContainer.AddMethod): we now add methods to the
31589 MethodGroup instead of the method hashtable.
31591 * expression.cs: Add MethodGroup abstraction, which gets us one
31592 step closer to the specification in the way we handle method
31595 * cs-parser.jay (primary_expression): qualified_identifier now
31596 tried to match up an identifier to a local variable reference or
31597 to a parameter reference.
31599 current_local_parameters is now a parser global variable that
31600 points to the current parameters for the block, used during name
31603 (property_declaration): Now creates an implicit `value' argument to
31606 2001-05-09 Miguel de Icaza <miguel@ximian.com>
31608 * parameter.cs: Do not use `param' arguments as part of the
31609 signature, per the spec.
31611 2001-05-08 Miguel de Icaza <miguel@ximian.com>
31613 * decl.cs: Base class for classes, structs and interfaces. This
31614 is the "Declaration Space"
31616 * cs-parser.jay: Use CheckDef for checking declaration errors
31617 instead of having one on each function.
31619 * class.cs: Factor out some code for handling error handling in
31620 accordance to the "Declarations" section in the "Basic Concepts"
31621 chapter in the ECMA C# spec.
31623 * interface.cs: Make all interface member classes derive from
31624 InterfaceMemberBase.
31626 2001-05-07 Miguel de Icaza <miguel@ximian.com>
31628 * Many things: all interfaces are parsed and generated in
31629 gen-treedump. Support for member variables, constructors,
31630 destructors, properties, constants is there.
31632 Beginning of the IL backend, but very little done, just there for
31635 2001-04-29 Miguel de Icaza <miguel@ximian.com>
31637 * cs-parser.jay: Fix labeled statement.
31639 * cs-tokenizer.cs (escape): Escape " and ' always.
31640 ref_line, ref_name: keep track of the line/filename as instructed
31641 by #line by the compiler.
31644 2001-04-27 Miguel de Icaza <miguel@ximian.com>
31646 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
31647 to match the values in System.CodeDOM.
31649 Divid renamed to Divide.
31651 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
31653 (Statements.set): remove.
31655 * System.CodeDOM/CodeCatchClause.cs: always have a valid
31658 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
31659 falseStatements always have valid values.
31661 * cs-parser.jay: Use System.CodeDOM now.