1 2009-01-30 Marek Safar <marek.safar@gmail.com>
4 * statement.cs: Introduced BlockScopeExpression, needed when
5 expression tree conversion has to emit scope variables.
7 2009-01-29 Marek Safar <marek.safar@gmail.com>
9 * class.cs: Remove duplicate CallingConvention.
11 2009-01-29 Marek Safar <marek.safar@gmail.com>
13 *.cs: Rename Parameters to ParametersCompiled and ParametersImported
14 when I finally found the right naming convention.
16 2009-01-29 Marek Safar <marek.safar@gmail.com>
18 * cs-tokenizer.cs: Put back different open parens optimization.
20 2009-01-28 Marek Safar <marek.safar@gmail.com>
23 * cs-tokenizer.cs: Remove too agressive parser optimization.
25 2009-01-28 Marek Safar <marek.safar@gmail.com>
28 * class.cs: Remove too early base type resolve.
30 2009-01-27 Marek Safar <marek.safar@gmail.com>
33 * ecore.cs: Explicitly type null when assigning to type argument to
34 make pass verifier check.
36 2009-01-27 Marek Safar <marek.safar@gmail.com>
38 * anonymous.cs: Fixed recent regression when initializing captured
41 2009-01-26 Marek Safar <marek.safar@gmail.com>
44 * anonymous.cs: Use all parent type parameters when instantiating
45 nested generic storey.
47 2009-01-26 Marek Safar <marek.safar@gmail.com>
49 * expression.cs: Check for null instance methodgroup expression.
51 2009-01-26 Marek Safar <marek.safar@gmail.com>
54 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
55 instance inside a conditional expression.
57 2009-01-23 Marek Safar <marek.safar@gmail.com>
59 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
60 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
61 GetElementType and HasElementType. IsValueType clean up.
63 2009-01-23 Marek Safar <marek.safar@gmail.com>
65 * nullable.cs: Use common EmitCall.
67 * expression.cs: Emit constraint. for virtual calls only.
69 2009-01-23 Marek Safar <marek.safar@gmail.com>
71 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
72 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
73 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
76 2009-01-22 Jb Evain <jbevain@novell.com>
78 * anonymous.cs: make anonymous types' ToString implementation
79 match what csc outputs.
81 2009-01-21 Marek Safar <marek.safar@gmail.com>
83 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
86 2009-01-17 Marek Safar <marek.safar@gmail.com>
88 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
91 2009-01-16 Marek Safar <marek.safar@gmail.com>
93 * nullable.cs (LiftedBinaryOperator): Check for all possible null
96 2009-01-15 Marek Safar <marek.safar@gmail.com>
99 * statement.cs: Add reference for nested storey when only this
102 2009-01-15 Marek Safar <marek.safar@gmail.com>
104 A fix for bug #466474
105 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
108 2009-01-15 Marek Safar <marek.safar@gmail.com>
110 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
111 Fixed nested stories parent referencing process. Also fixes #463985.
113 2009-01-06 Marek Safar <marek.safar@gmail.com>
115 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
116 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
117 implementation. Also fixes #463108.
119 2009-01-05 Marek Safar <marek.safar@gmail.com>
121 A fix for bug #416109
122 * decl.cs: Issue correct CLSAttribute warning location.
124 2009-01-05 Marek Safar <marek.safar@gmail.com>
126 A fix for bug #456775
127 * attribute.cs: Use attribute owner scope when resolving attribute
130 2009-01-05 Marek Safar <marek.safar@gmail.com>
132 A fix for bug #457257
133 * decl.cs: Fixed incorrect member declaring type comparison.
135 2009-01-05 Marek Safar <marek.safar@gmail.com>
137 A fix for bug #460896
138 * driver.cs: Handle /RES resources as embeddable.
140 2009-01-05 Marek Safar <marek.safar@gmail.com>
142 A fix for bug #462515
143 * ecore.cs: Report inacessible members upwards.
145 2009-01-05 Marek Safar <marek.safar@gmail.com>
147 A fix for bug #463190, #463192
148 * decl.cs, namespace.cs: Also import internal extension classes.
150 2009-01-04 Marek Safar <marek.safar@gmail.com>
152 A fix for bug #463415
153 * generic.cs: Use right index for RemoveDependentTypes.
155 2009-01-02 Marek Safar <marek.safar@gmail.com>
157 A fix for bug #463196
158 * expression.cs: Fixed enum to null comparison.
160 2009-01-02 Marek Safar <marek.safar@gmail.com>
162 A fix for bug #463121
163 * nullable.cs: Fixed nullable user equality operator comparison.
165 2009-01-02 Marek Safar <marek.safar@gmail.com>
167 A fix for bug #462950
168 * class.cs, decl.cs: Use full explicit name when defining automatic
169 property backing field.
171 2009-01-02 Marek Safar <marek.safar@gmail.com>
173 A fix for bug #462592
174 * pending.cs: Emit type arguments for generic proxy method.
176 2008-12-30 Marek Safar <marek.safar@gmail.com>
178 * expression.cs (As): Mutate all type arguments.
180 2008-12-29 Marek Safar <marek.safar@gmail.com>
182 A fix for bug #462622
183 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
186 2008-12-29 Marek Safar <marek.safar@gmail.com>
188 A fix for bug #450782
189 * ecore.cs: Consider more variables of form V.I to be fixed.
191 2008-12-29 Marek Safar <marek.safar@gmail.com>
193 A fix for bug #460712
194 * typemanager.cs: Core types could be imported.
196 2008-12-28 Marek Safar <marek.safar@gmail.com>
198 A fix for bugs #460847, #460772, #458049, #457339, #447807
199 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
200 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
201 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
202 user lambdas used inside query clauses.
204 2008-12-18 Marek Safar <marek.safar@gmail.com>
206 A fix for bug #460229
207 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
209 2008-12-18 Marek Safar <marek.safar@gmail.com>
211 A fix for bug #459952
212 * decl.cs, namespace.cs: Use common CheckAccessLevel.
214 2008-12-18 Marek Safar <marek.safar@gmail.com>
216 A fix for bug #459630
217 * convert.cs: Enum to valuetype conversion is not allowed.
219 2008-12-18 Marek Safar <marek.safar@gmail.com>
221 A fix for bug #457087
222 * generic.cs: Don't crash when constraint comes from type
225 2008-12-16 Marek Safar <marek.safar@gmail.com>
227 A fix for bug #459221
228 * anonymous.cs, statement.cs: Delay only captured this
231 2008-12-12 Marek Safar <marek.safar@gmail.com>
233 A fix for bug #457489
234 * anonymous.cs, statement.cs: Split anonymous storey instantiation
235 and initialization to capture scope initializers correctly.
237 2008-12-11 Marek Safar <marek.safar@gmail.com>
239 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
240 ParameterReference refactoring.
242 2008-12-03 Marek Safar <marek.safar@gmail.com>
244 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
245 to be imported from any assembly.
247 2008-12-03 Marek Safar <marek.safar@gmail.com>
249 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
250 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
251 from anonymous method and lambda expression.
253 2008-12-01 Marek Safar <marek.safar@gmail.com>
255 A fix for bug #448560
256 * expression.cs (As): Box any generic type arguments to be
259 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
261 Add tripwire for implicit conversion bugs
262 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
264 (MethodGroupExpr.OverloadResolve): Add sanity check between
265 IsApplicable and VerifyArgumentsCompat.
266 (VerifyArgumentsCompat): Report CS1501 where appropriate.
268 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
270 Fix build break in System.Data_test
271 * convert.cs (ImplicitConversionExists): Move NullLiteral
273 (ImplicitStandardConversionExists): ... here.
275 2008-11-28 Marek Safar <marek.safar@gmail.com>
277 * literal.cs: Emit correctly explicit null to nullable cast.
279 2008-11-28 Marek Safar <marek.safar@gmail.com>
281 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
284 2008-11-28 Marek Safar <marek.safar@gmail.com>
286 A fix for bug #449005
287 * convert.cs, nullable.cs: Use only one implicit nullable
290 2008-11-27 Marek Safar <marek.safar@gmail.com>
292 * convert.cs, literal.cs: More Convert cleanup is needed.
294 2008-11-27 Marek Safar <marek.safar@gmail.com>
296 * decl.cs, class.cs: Fixed misleading error message.
298 2008-11-26 Marek Safar <marek.safar@gmail.com>
300 A fix for bug #449005
301 * nullable.cs (EmitEquality): Disable optimization for user operator
304 2008-11-25 Marek Safar <marek.safar@gmail.com>
306 A fix for bug #447027
307 * anonymous.cs (HoistedVariable): Cache also outer access to deal
308 with context variables stored as expression instances.
310 2008-11-25 Marek Safar <marek.safar@gmail.com>
312 A fix for bug #447027
313 * delegate.cs: Fixed delegate VerifyMethod logic.
315 2008-11-24 Marek Safar <marek.safar@gmail.com>
317 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
320 2008-11-21 Marek Safar <marek.safar@gmail.com>
322 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
323 member type resolve to follow normal flow, instead of random
326 2008-11-21 Marek Safar <marek.safar@gmail.com>
328 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
331 2008-11-21 Marek Safar <marek.safar@gmail.com>
333 * const.cs: Emit decimal array constant as literal.
335 2008-11-20 Marek Safar <marek.safar@gmail.com>
337 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
339 2008-11-19 Marek Safar <marek.safar@gmail.com>
341 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
342 into real property (saves 8 MB for corlib compilation).
344 2008-11-19 Marek Safar <marek.safar@gmail.com>
346 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
347 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
348 generic-mcs.cs: Small cleanup of TypeArguments.
350 2008-11-18 Marek Safar <marek.safar@gmail.com>
352 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
353 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
354 of ConstructedType expression, renamed to GenericTypeExpr.
356 2008-11-17 Marek Safar <marek.safar@gmail.com>
358 A fix for bug #445303
359 * location.cs (IsConditionalDefined): Handle undefined global
362 2008-11-17 Marek Safar <marek.safar@gmail.com>
364 A fix for bug #444678
365 * expression.cs (TryReduceConstant): Always create new constant
368 2008-11-17 Marek Safar <marek.safar@gmail.com>
370 A fix for bug #444673
371 * ecore.cs: Ignore open generic types when used as generic type
374 2008-11-17 Marek Safar <marek.safar@gmail.com>
376 A fix for bug #445458
377 * expression.cs, cs-parser.jay: Don't crash when an expression
380 2008-11-17 Marek Safar <marek.safar@gmail.com>
382 A fix for bug #445464
383 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
386 2008-11-14 Jb Evain <jbevain@novell.com>
388 * driver.cs: ignore empty -nowarn argument such as
389 the one in -nowarn:12,13,,.
391 2008-11-13 Marek Safar <marek.safar@gmail.com>
393 A fix for bug #444271
394 * anonymous.cs: Rescan parent storeys when best candidate was
397 2008-11-13 Marek Safar <marek.safar@gmail.com>
399 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
400 useless UnboundTypeExpression.
402 * attribute.cs: Do check obsolete attribute on generic types.
404 2008-11-12 Marek Safar <marek.safar@gmail.com>
406 A fix for bugs #425680, #400139
407 * ecore.cs, expression.cs: Trying to do some almost_matched_members
410 2008-11-11 Marek Safar <marek.safar@gmail.com>
412 A fix for bug #435747
413 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
414 compound value types assignment. Few micro optimizations added.
416 2008-11-10 Marek Safar <marek.safar@gmail.com>
418 A fix for bug #442610
419 * anonymous.cs (MutateConstructor): More SRE hacking.
421 2008-11-10 Marek Safar <marek.safar@gmail.com>
423 A fix for bug #442579
424 * ecore.cs: Also initialize expanded form of a method with 1 params
427 2008-11-06 Marek Safar <marek.safar@gmail.com>
429 * expression.cs (UnaryMutator): Do early l-side check.
431 2008-11-05 Miguel de Icaza <miguel@novell.com>
433 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
434 Init, otherwise we would crash later on when checking for friend
437 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
438 Otherwise we never get any meaningful information as to what
441 2008-11-05 Marek Safar <marek.safar@gmail.com>
443 A fix for bug #436318
444 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
446 2008-11-05 Miguel de Icaza <miguel@novell.com>
448 * namespace.cs: Turns out that it was a really bad idea to hide
449 the errors for namespaces not found here in eval mode.
451 * eval.cs: When we process using clauses, only enter those into
452 the list of valid using clauses after they have been validated.
454 The above change gives the proper semantics: it does not
455 senselessly report the same errors with broken using statements by
456 never storing them in the first place when they are invalid.
458 2008-11-05 Marek Safar <marek.safar@gmail.com>
460 A fix for bug #421839
461 * cs-parser.jay: Remove expression from coalesce rule to force lower
462 priority than the assignment operator.
464 2008-11-05 Marek Safar <marek.safar@gmail.com>
466 A fix for bug #437875
467 * nullable.cs: Compile correctly method group operand used with null
470 2008-11-04 Marek Safar <marek.safar@gmail.com>
472 A fix for bug #434589
473 * expression.cs (Binary): Ignore lifted conversions when at least
474 one operand is of reference type.
476 2008-11-04 Marek Safar <marek.safar@gmail.com>
478 * cs-parser.jay: Better syntax error report.
480 2008-11-03 Marek Safar <marek.safar@gmail.com>
482 A fix for bug #436792
483 * cs-parser.jay: Use GetLocation to access location.
485 2008-11-03 Marek Safar <marek.safar@gmail.com>
487 A fix for bug #440774
488 * cs-parser.jay: Also set current_array_type when parsing local
491 2008-11-03 Marek Safar <marek.safar@gmail.com>
493 A fix for bug #440785
494 * expression.cs (As): Don't resolve self modifing expression
497 2008-11-03 Marek Safar <marek.safar@gmail.com>
499 A fix for bug #439447
500 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
502 2008-11-03 Marek Safar <marek.safar@gmail.com>
504 A fix for bug #437571
505 * cs-parser.jay: Fixes internal error for invalid expression
508 2008-10-17 Marek Safar <marek.safar@gmail.com>
510 * ecore.cs: Resolve correctly ambiguous params delegate methods.
512 2008-10-17 Marek Safar <marek.safar@gmail.com>
514 * generic.cs, anonymous.cs: Simplified GetDeclarations.
516 2008-10-17 Marek Safar <marek.safar@gmail.com>
518 * cs-tokenizer.cs: More precise cast parsing.
520 2008-10-16 Martin Baulig <martin@ximian.com>
522 * anonymous.cs (AnonymousMethodStorey): Put back the
523 `hoisted_locals' hashtable and use it in EmitType().
525 2008-10-15 Marek Safar <marek.safar@gmail.com>
527 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
528 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
531 2008-10-14 Marek Safar <marek.safar@gmail.com>
533 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
535 2008-10-14 Marek Safar <marek.safar@gmail.com>
537 * statement.cs: Mutate scope initializers.
539 2008-10-14 Marek Safar <marek.safar@gmail.com>
541 * expression.cs: Use typeless value for This constant.
543 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
545 2008-10-14 Marek Safar <marek.safar@gmail.com>
547 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
550 2008-10-13 Marek Safar <marek.safar@gmail.com>
552 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
555 2008-10-13 Marek Safar <marek.safar@gmail.com>
557 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
558 parser and tokenizer. Fixes many ambiguities including #433258.
560 2008-10-10 Marek Safar <marek.safar@gmail.com>
562 * cs-parser.jay: Fixed missing accessor recovery.
564 2008-10-10 Marek Safar <marek.safar@gmail.com>
566 A fix for bug #433701
567 * expression.cs: Better error message.
569 2008-10-10 Marek Safar <marek.safar@gmail.com>
571 * cs-parser.jay, expression.cs: Start reporting real parser errors.
573 * Makefile: Disabled unused debug symbols.
575 Also fixes: #320556, #321097, #321656, #321876, #351316
577 2008-10-09 Miguel de Icaza <miguel@novell.com>
579 * eval.cs: rename "<interactive>" to "{interactive}", to work
580 around a requirement in the compiler that this be a valid
581 filename, and in Windows it is not (433886).
583 2008-10-09 Marek Safar <marek.safar@gmail.com>
585 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
587 2008-10-08 Marek Safar <marek.safar@gmail.com>
589 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
590 cs-parser.jay: Generic type declaration and type arguments cleanup.
592 2008-10-05 Marek Safar <marek.safar@gmail.com>
594 * cs-parser.jay: Allow parsing weird array creation construct.
596 2008-10-05 Marek Safar <marek.safar@gmail.com>
598 * cs-parser.jay: Conflicts reduction.
600 2008-10-04 Marek Safar <marek.safar@gmail.com>
602 * cs-parser.jay: Conflicts reduction.
604 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
607 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
608 property. Add a 'count' hint about the use of the shared vector.
609 Ensure that we don't leak out dirty bits.
610 (UsageVector.MergeChild): Throw away information about variables
612 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
614 2008-10-03 Marek Safar <marek.safar@gmail.com>
616 A fix for bug #431746
617 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
618 parameters when iterator is created.
620 2008-10-03 Marek Safar <marek.safar@gmail.com>
622 A fix for bug #431827
623 * expression.cs: Fixed right based pointer arithmetic operations
626 2008-10-03 Marek Safar <marek.safar@gmail.com>
628 A fix for bug #353779
629 * assign.cs, expression.cs: Fixed compound assignment conversions.
631 2008-10-02 Marek Safar <marek.safar@gmail.com>
633 A fix for bug #375262
634 * statement.cs: Refactor ArrayForeach to be usable with string
635 indexer. Optimized single dimentional arrays foreach.
637 2008-10-02 Marek Safar <marek.safar@gmail.com>
639 A fix for bug #431255
640 * anonymous.cs, expression.cs: Removed broken optimization.
642 2008-10-01 Marek Safar <marek.safar@gmail.com>
644 * anonymous.cs: Use full type parameters of parent generic
645 containers. Removed unnecessary AddParentStoreyReference call.
647 2008-10-01 Marek Safar <marek.safar@gmail.com>
649 A fix for bug #324702
650 * class.cs: Use better shorter names for explicit interface member
653 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
655 2008-10-01 Marek Safar <marek.safar@gmail.com>
657 * expression.cs: Use new interface to check fixed expression.
659 2008-10-01 Marek Safar <marek.safar@gmail.com>
661 A fix for bug #421101
662 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
663 interface to check for fixed fixed-buffers.
665 2008-10-01 Marek Safar <marek.safar@gmail.com>
667 A fix for bug #429264
668 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
670 * delegate.cs: Removed unnecessary casts.
672 2008-09-30 Marek Safar <marek.safar@gmail.com>
674 A fix for bug #352151
675 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
676 class.cs: Fixed already defined explicit interface members check.
678 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
680 cs-tokenizer.cs: Fix typo.
682 2008-09-28 Miguel de Icaza <miguel@novell.com>
684 * eval.cs (InteractiveBase): The quit command now just sets a
685 flag, instead of calling Environment.Exit(), it is milder on
688 CompiledMethod is now in Mono.CSharp, not nested inside
689 the Evaluator, it was inconvenient to use.
691 2008-09-27 Miguel de Icaza <miguel@novell.com>
693 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
694 code to be invoked without having to reparse.
696 2008-09-27 Miguel de Icaza <miguel@novell.com>
698 * ecore.cs: The recent changes to FieldExpr broke this as well.
699 Fixes LINQ queries in the interactive shell.
701 * Multiple files: indentation fixing for the Mono coding
702 guidelines for the switch statement.
704 * eval.cs: Make the Evaluator API thread safe.
706 2008-09-26 Marek Safar <marek.safar@gmail.com>
708 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
711 2008-09-26 Marek Safar <marek.safar@gmail.com>
713 A fix for bug #325326
714 * statement.cs: Check possible mistaken empty statement using
715 explicit blocks only.
717 2008-09-25 Miguel de Icaza <miguel@novell.com>
719 * eval.cs (LoadAssembly, ReferenceAssembly): Call
720 RootNamespace.ComputeNamespaces to update the internal list of
721 namespaces, this is no longer done for us.
723 (InteractiveBase): Use the Evaluator APIs instead of calling into
726 2008-09-25 Marek Safar <marek.safar@gmail.com>
728 A fix for bug #429264
729 * expression.cs: Missing mutator for access to multidimensional
732 2008-09-25 Marek Safar <marek.safar@gmail.com>
734 * class.cs, statement: Emit DebuggerHidden attribute for iterator
737 * driver.cs: Missing input argument check.
739 2008-09-25 Marek Safar <marek.safar@gmail.com>
741 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
742 expression.cs, statement.cs, rootcontext.cs, class.cs,
743 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
746 2008-09-24 Miguel de Icaza <miguel@novell.com>
748 * ecore.cs (FieldExpr): Only initialize eclass when we return a
749 fully constructed FieldExpr, fixes the regression introduced in
752 * ecore.cs, expression.cs: Plug back the eclass initialization as
753 otherwise it regresses `csharp'.
755 2008-09-24 Marek Safar <marek.safar@gmail.com>
757 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
758 ecore.cs, attribute.cs: Moved obsolete method checks from emit
759 phase to resolve phase. It resolves problems with expression trees
760 and fixes bugs #323796, #325156.
762 2008-09-23 Marek Safar <marek.safar@gmail.com>
764 * codegen.cs: Report better error when symbol writer is missing.
766 2008-09-23 Marek Safar <marek.safar@gmail.com>
768 * codegen.cs: Set .NET symbol writer.
770 * decl.cs: Guard against null generic arguments.
772 * report.cs: Don't report exactly same additional details.
774 2008-09-22 Marek Safar <marek.safar@gmail.com>
776 A fix for bug #324917
777 * cs-parser.jay: Add missing multidimensional non-expression type
780 2008-09-22 Marek Safar <marek.safar@gmail.com>
782 A fix for bug #428191
783 * anonymous.cs: Create an outer generic fields also for non-storey
786 2008-09-22 Marek Safar <marek.safar@gmail.com>
788 A fix for bug #378294
789 * class.cs: Make fixed size buffers gmcs feature only.
791 2008-09-22 Marek Safar <marek.safar@gmail.com>
793 A fix for bug #355622, #324993
794 * assign.cs, const.cs, class.cs: Create new EmitContext for each
797 2008-09-19 Marek Safar <marek.safar@gmail.com>
799 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
802 2008-09-19 Marek Safar <marek.safar@gmail.com>
804 A fix for bug #416110
805 * generic.cs: Struct constraint results in default ctor and
806 ValueType base type constraint to be set.
808 2008-09-19 Marek Safar <marek.safar@gmail.com>
810 A fix for bug #423791
811 * generic.cs: Fixed params output type type-inference.
813 2008-09-19 Marek Safar <marek.safar@gmail.com>
815 * cs-parser.jay, expression.cs: Fixed few expression crashes.
817 2008-09-19 Marek Safar <marek.safar@gmail.com>
819 * cs-tokenizer.cs: Don't break on extra partial modifier.
821 2008-09-19 Marek Safar <marek.safar@gmail.com>
823 A fix for bug #427592
824 * generic.cs: Use common parameter resolve method.
826 2008-09-18 Marek Safar <marek.safar@gmail.com>
828 A fix for bug #414758
829 * expression.cs, ecore.cs: Fixed crash when accessing non-static
832 2008-09-18 Marek Safar <marek.safar@gmail.com>
834 * driver.cs, namespace.cs: Read types and namespaces after all
835 requested assemblies are loaded, fixes issues with System.Core
836 auto-reference, and #419888.
838 2008-09-18 Marek Safar <marek.safar@gmail.com>
840 A fix for bug #417705
841 * cs-parser.jay: Fixed as/is operator expression split.
843 2008-09-18 Marek Safar <marek.safar@gmail.com>
845 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
846 Fixed expression tree representation of empty new expression and
847 new initializer expression.
849 2008-09-18 Miguel de Icaza <miguel@novell.com>
851 * eval.cs: Remove warning, keep reference to driver around.
853 * Hide fields that do not need to be public.
855 2008-09-17 Marek Safar <marek.safar@gmail.com>
857 A fix for bug #426385
858 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
859 conversion for array elements.
861 2008-09-17 Marek Safar <marek.safar@gmail.com>
863 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
864 void parsing conflicts.
866 2008-09-15 Marek Safar <marek.safar@gmail.com>
868 A fix for bug #425601
869 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
870 System.Core only when there is no custom ExtensionAttribute
873 2008-09-15 Miguel de Icaza <miguel@novell.com>
875 * namespace.cs: Do not report CS0246 (name
877 2008-09-12 Marek Safar <marek.safar@gmail.com>
879 A fix for bug #425669
880 * generic.cs: Don't cache generic static anonymous method
883 2008-09-12 Marek Safar <marek.safar@gmail.com>
885 * generic.cs, class.cs, delegate.cs: Check recursive inherited
886 conflicting constraints.
888 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
890 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
893 2008-09-12 Marek Safar <marek.safar@gmail.com>
895 * literal.cs, convert.cs, expression.cs, statement.cs: More null
896 to null pointer conversion fixes.
898 2008-09-11 Marek Safar <marek.safar@gmail.com>
900 * cs-parser.jay, expression.cs: An implicitly typed local variable
901 declarator cannot use an array initializer.
903 2008-09-11 Marek Safar <marek.safar@gmail.com>
905 * cs-parser.jay: Reduced number of printed tokens, add sorting.
907 2008-09-11 Marek Safar <marek.safar@gmail.com>
909 * generic.cs (InflatedConstraints): Don't crash when constraints
912 * cs-parser.jay: const_declarator is a block.
914 * constant.cs: Check for not allowed NaN conversions.
916 2008-09-10 Miguel de Icaza <miguel@novell.com>
918 * driver.cs: Drop --shell argument, the compiler is no longer a
921 * eval.cs: Move most of the code that deals with evaluation into
922 this file and document the public API from repl.cs
924 * repl.cs: Remove from here.
926 2008-09-10 Marek Safar <marek.safar@gmail.com>
928 A fix for bug #424684
929 * generic.cs: Generic class constraints must come first.
931 2008-09-09 Miguel de Icaza <miguel@novell.com>
933 * cs-parser.jay: Improve error reporting for syntax errors in
934 statements and expressions, we now report the expected tokens
935 instead of reporting the useless "; expected".
937 Drop the strings from the token declaration, it turns out that
938 they did not do what I thought they did. Instead they were adding
939 two sets of tokens to the tables.
941 2008-09-09 Marek Safar <marek.safar@gmail.com>
943 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
944 delegate.cs: Share special type check.
946 2008-09-09 Marek Safar <marek.safar@gmail.com>
948 A fix for bug #423981
949 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
951 2008-09-09 Marek Safar <marek.safar@gmail.com>
953 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
956 2008-09-09 Marek Safar <marek.safar@gmail.com>
958 A fix for bugs: #324750, #335946
959 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
960 lookup rule to determine ?-based tokens.
962 2008-09-08 Miguel de Icaza <miguel@novell.com>
964 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
965 expressions (like event adding or removing) end up here, so we
966 need to treat those as statements.
968 Add LoadAssembly method.
970 2008-09-04 Miguel de Icaza <miguel@novell.com>
972 * repl.cs: Add Time method.
974 2008-09-05 Marek Safar <marek.safar@gmail.com>
976 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
978 2008-09-05 Miguel de Icaza <miguel@novell.com>
980 * repl.cs: Add workaround for old compilers.
982 2008-09-04 Jb Evain <jbevain@novell.com>
984 * repl.cs (PrettyPrint): pretty print everything that
985 implements IDictionary, as well as IEnumerables. Also,
986 add a quit helper property.
988 2008-09-04 Marek Safar <marek.safar@gmail.com>
990 * constant.cs: Better error reporting for decimal literals.
992 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
995 2008-09-04 Marek Safar <marek.safar@gmail.com>
996 Miguel de Icaza <miguel@novell.com>
998 A fix for bug #422951
999 * assign.cs (Assign.DoResolve): Perform the type conversions
1000 checks before we attempt to initialize `New' initializers.
1002 2008-09-04 Marek Safar <marek.safar@gmail.com>
1004 A fix for bug #422853
1005 * delegate.cs (DelegateCreation): Add special handling for
1006 EmptyExpression.Null instance expression which is just another
1007 hack for undecided member instance exression.
1009 2008-09-04 Marek Safar <marek.safar@gmail.com>
1011 * expression.cs, ecore.cs: Emit full expression tree for reduced
1014 2008-09-04 Marek Safar <marek.safar@gmail.com>
1016 * expression.cs (This): Guard against multi-resolving.
1018 * ecore.cs, statement.cs (Throw): Simplified.
1020 * flowanalysis.cs: Also verify event fields.
1022 2008-09-04 Miguel de Icaza <miguel@novell.com>
1024 * assign.cs (Assign.DoResolve): Perform the type conversions
1025 checks before we attempt to initialize `New' initializers.
1027 * repl.cs (PrettyPrint): Add Hashtable prettyprint
1029 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
1032 * repl.cs: Update help.
1034 2008-09-03 Miguel de Icaza <miguel@novell.com>
1036 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
1037 handling of the default config handling, including the special
1038 treatment of System.Core assembly.
1040 Fixes the REPL processing for LINQ.
1042 2008-09-03 Marek Safar <marek.safar@gmail.com>
1044 A fix for bug #422507
1045 * expression.cs (UnboxCast): Add missing child expression mutator.
1047 2008-09-03 Marek Safar <marek.safar@gmail.com>
1049 * driver.cs: Don't self reference System.Core assembly.
1051 2008-09-03 Marek Safar <marek.safar@gmail.com>
1053 A fix for bug #422507
1054 * expression.cs (StringConcat): Add missing type mutator.
1056 2008-09-03 Marek Safar <marek.safar@gmail.com>
1058 * generic.cs (TypeInferenceContext): Follow equality rule for
1059 constructed type lower bound type inference.
1061 2008-09-02 Miguel de Icaza <miguel@novell.com>
1063 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
1064 <dblank@cs.brynmawr.edu> which updates the cursor position on
1067 2008-09-02 Marek Safar <marek.safar@gmail.com>
1069 A fix for bug #367145
1070 * driver.cs: Fixed import of extension methods when using -noconfig
1073 2008-09-02 Marek Safar <marek.safar@gmail.com>
1075 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
1076 version from non-generic implementation instead.
1078 2008-09-01 Marek Safar <marek.safar@gmail.com>
1080 A fix for bug #418908
1081 * class.cs: Use AddScopeStatement for field initializers.
1083 2008-09-01 Marek Safar <marek.safar@gmail.com>
1085 A fix for bug #415385
1086 * ecore.cs, convert.cs: Do method group conversion for equal group types.
1088 2008-09-01 Marek Safar <marek.safar@gmail.com>
1090 A fix for bug #421736
1091 * iterators.cs: Don't crash on unreachable iterators.
1093 2008-09-01 Marek Safar <marek.safar@gmail.com>
1095 A fix for bug #421628
1096 * parameter.cs, attribute.cs: Clone also parameter attributes.
1098 2008-08-30 Miguel de Icaza <miguel@novell.com>
1100 * namespace.cs (LookupType): In EvalMode, try to replace
1101 the TypeBuilder from our cache with a Type as Reflection.Emit does
1102 not like to mix code from older assemblies emitted and new
1105 This sounds like a serious Mono bug that prevents multiple
1106 assemblies to be generated and consumed at the same time.
1108 * cs-parser.jay (push_current_class): Do not make interactive
1109 classes internal or private, make them public as we currently
1110 generate each new class in a new assembly.
1112 2008-08-29 Miguel de Icaza <miguel@novell.com>
1114 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
1115 remove types that are entered into the global namespace during
1116 parsing so that we can remove them on failure.
1118 * cs-parser.jay: Parsing: we now keep track of types that are
1119 entered into global variables and queue those in case the parsing
1122 This happens in a few situations: during partial-input, we invoke
1123 the parser repeatedly for example with the string "class X", this
1124 would cause X to be registed, and we need to remove this
1125 registration so that another parse attempt later with say "class X {"
1126 would actually work.
1128 Additionally, if there is an error in the resolution phase, for
1129 example: "class X : NonExistant {}" th
1131 * cs-parser.jay: Be more precise with the errors being raised,
1132 instead of flagging all exceptions during parsing to be attributed
1133 to the parsing process, distinguish those from errors happening in
1134 the actions and hint that using -v would produce the actual
1137 * repl.cs: Do not load all compiler references on each reset,
1138 doing the partial reset takes care of this.
1140 2008-08-28 Miguel de Icaza <miguel@novell.com>
1142 * repl.cs: Add support for loading all the files from
1143 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
1146 Introduce a micro-parser that is able to deambiguate on its input
1147 whether we are dealing with a compilation unit (namespace, class,
1148 interface, struct, delegate) declaration or a statement. This
1149 allows both declarations and statements to be entered.
1151 Set history size by default to 300 lines.
1153 Instead of distinguishing based on the parser.InteractiveResult,
1154 have only two cases: statements were parsed, or a compilation unit
1155 was. Always pull the Using statement additions from the
1156 compilation unit parse.
1158 * cs-tokenizer.cs: Rename tokens to better describe their intent
1159 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
1161 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
1162 EvalMode is used to trigger the lookup of global variables while
1163 StatementMode is used turn variable declarations into static
1166 * getline.cs: Allow history size to be set.
1168 2008-08-29 Marek Safar <marek.safar@gmail.com>
1170 A fix for bug #360755
1171 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
1173 2008-08-29 Marek Safar <marek.safar@gmail.com>
1175 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
1177 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
1178 member name, it is too confusing
1180 * decl.cs, class.cs: Don't report unused fields with attached attribute.
1182 * rootcontext.cs: Finally default to warning level 4.
1184 2008-08-28 Marek Safar <marek.safar@gmail.com>
1186 * class.cs (CheckBase): Ignore overloaded operators.
1188 2008-08-28 Marek Safar <marek.safar@gmail.com>
1190 A fix for bug #420830
1191 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
1193 2008-08-28 Marek Safar <marek.safar@gmail.com>
1195 A fix for bug #420832
1196 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
1198 2008-08-28 Marek Safar <marek.safar@gmail.com>
1200 A fix for bug #420386
1201 * nullables.cs: Fixed logic of nullable user comparison operators involving
1204 2008-08-28 Marek Safar <marek.safar@gmail.com>
1206 * attribute (IsClsCompliant): Use FALSE value for pointer types.
1208 2008-08-27 Miguel de Icaza <miguel@novell.com>
1210 * repl.cs: Add support for aborting the running code with C-c.
1212 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
1214 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
1216 2008-08-27 Miguel de Icaza <miguel@novell.com>
1218 * cs-parser.jay (interactive_statement_list): A new set of rules
1219 for hosting statements that uses the "interactive_" prefix.
1221 * repl.cs: Add support for parsing `using' as a statement or as a
1222 directive. Deambiguating before passing this to the parser.
1224 We need to distinguish statement_expressions that occur at the
1225 toplevel vs those that occur embedded into expressions.
1227 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
1228 that fixes the cursor key handling, and a history bug.
1230 2008-08-26 Miguel de Icaza <miguel@novell.com>
1232 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
1233 limitations in Console, instead the 2.0 bootstrap libraries now
1234 include the Console bits.
1236 Also, remove the use of Nullables from getline.cs
1240 Interactive support for the C# compiler. Use gmcs --shell to
1241 enter a read-eval-print loop shell.
1243 Docs: http://www.mono-project.com/CsharpRepl
1245 * sources: include repl.cs here and getline.cs for gmcs.exe,
1246 everything else is getline.cs impaired.
1248 * Makefile: when bootstrapping pass a special flag
1249 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
1250 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
1251 This distinguishes those two cases.
1253 * repl.cs: Support for a read-eval-print loop. Will be soon
1254 refactored into eval support and then REPL on top of it.
1256 * ecore.cs: If a simplename lookup fails, before erroring out,
1257 if we are in EvalMode to resolve the name to a declaration in the
1260 This means that variable declarations that happened in previous
1261 classes (as repl puts every statement in a separate class) are
1262 made visible in this way.
1264 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
1265 triggered an error due to the end of file being reached. This is
1266 used to do multi-line input, and notify the caller that the user
1267 needs to provide more text before a successful parse.
1269 Add new grammar rules after the INTERACTIVE_PARSER token is seen
1270 to drive the evaluation with a custom wrapper.
1272 * driver.cs: Add support for --shell, and refactor some code to be
1275 * namespace.cs: Add support for serializing the contents of the
1276 namespaces and reloading them.
1278 * getline.cs: A managed implementation of ReadLine under
1279 X11/Apache2 license terms. Easy to embed in other applications as
1282 * namespace.cs: Add some functions to save and restore the
1285 * rootcontext.cs: New public field.
1287 * cs-tokenizer.cs: Add support for one of the possible characters
1288 we introduce into the token stream.
1290 This patch does not affect the regular tokenization process, the
1291 only performance hit would happen if there is an invalid character
1292 on the input string.
1294 * support.cs: Move isatty helper routine here.
1296 * codegen.cs: Small cleanup, and add a mechanism to initialize the
1297 code generator for in-memory assemblies.
1299 2008-08-26 Marek Safar <marek.safar@gmail.com>
1301 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
1302 parameter cannot be always used as a type.
1304 2008-08-21 Marek Safar <marek.safar@gmail.com>
1306 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
1308 2008-08-21 Marek Safar <marek.safar@gmail.com>
1310 * convert.cs: Implement explicit array to IList<T> conversion.
1312 2008-08-20 Marek Safar <marek.safar@gmail.com>
1314 A fix for bug #362740
1315 * cs-tokenizer.cs: Handle UTF-16 surrogates.
1317 2008-08-20 Marek Safar <marek.safar@gmail.com>
1319 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
1320 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
1321 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
1322 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
1323 handling to use just one type of infrastructure and deal with generics
1326 2008-07-23 Martin Baulig <martin@ximian.com>
1328 *** Merged this from trunk revision 108527 ***
1331 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
1332 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
1335 2008-08-15 Marek Safar <marek.safar@gmail.com>
1337 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
1340 2008-08-15 Marek Safar <marek.safar@gmail.com>
1342 * delegate.cs: Fixed compiler crash when creating delegate using partial
1345 * typemanager.cs: MulticastDelegate is not a delegate.
1347 2008-08-14 Marek Safar <marek.safar@gmail.com>
1349 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
1352 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
1354 * cs-parser.jay (type): Allow 'var' in mcs too.
1355 (local_variable_type): Likewise.
1357 2008-08-14 Marek Safar <marek.safar@gmail.com>
1359 * driver.cs: Removed broken -noconfig variants.
1361 2008-08-14 Marek Safar <marek.safar@gmail.com>
1363 A fix for bug #417078
1364 * expression.cs: Emit correctly left side pointer operators.
1366 2008-08-13 Marek Safar <marek.safar@gmail.com>
1368 * generic.cs, lambda.cs: Inflate method generic arguments only.
1370 2008-08-12 Marek Safar <marek.safar@gmail.com>
1372 * class.cs: Fixed struct layout check regression.
1374 2008-08-12 Marek Safar <marek.safar@gmail.com>
1376 * cs-parser.jay, enum.cs: Simplified enum parsing.
1378 * decl.cs: Check all type parameters conflicts.
1380 * expression.cs, statement.cs, attribute.cs: More expression checks.
1382 2008-08-11 Marek Safar <marek.safar@gmail.com>
1384 * generic.cs: Add type inference types restriction.
1386 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
1387 anonymous.cs, expression.cs: Allocate less accessor parameters.
1389 2008-08-08 Marek Safar <marek.safar@gmail.com>
1391 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
1394 2008-08-08 Marek Safar <marek.safar@gmail.com>
1396 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
1398 2008-08-07 Marek Safar <marek.safar@gmail.com>
1400 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
1401 Also fixes #362146 and #381592.
1403 2008-08-07 Marek Safar <marek.safar@gmail.com>
1405 * ecore.cs: Reduced constant cannot be used as an attribute value.
1407 * cs-parser.jay: Base expression has to be a type.
1409 * expression.cs (Conditional): Uses ReducedExpression.
1411 2008-08-06 Marek Safar <marek.safar@gmail.com>
1413 A fix for bug #376826
1414 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
1415 address of hoisted local variable or parameter cannot be taken.
1417 2008-08-05 Marek Safar <marek.safar@gmail.com>
1419 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
1420 anonymous method inside checked/unchecked expression.
1422 2008-08-05 Marek Safar <marek.safar@gmail.com>
1424 * typemanager.cs (IsEqual): Guard against null.
1426 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
1427 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
1428 routine. Fixed few misleading conversion errors.
1430 2008-08-04 Marek Safar <marek.safar@gmail.com>
1432 * class.cs: Consider generics when checking cycles in struct layout.
1434 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
1436 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
1438 2008-08-04 Marek Safar <marek.safar@gmail.com>
1440 A fix for bug #414165
1441 * anonymous.cs: Use same anonymous implementation method for all anonymous
1444 2008-08-04 Marek Safar <marek.safar@gmail.com>
1446 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
1449 2008-08-04 Marek Safar <marek.safar@gmail.com>
1451 * cs-parser.jay: Typeof argument has to be a type expression.
1453 * namespace.cs: Check alias and namespace definitions collisions.
1455 * class.cs, pending.cs: Moved explicit interface accessor implementation
1458 * delegate.cs, expression.cs: Verify special name invocations.
1460 2008-08-01 Marek Safar <marek.safar@gmail.com>
1462 * cs-parser.jay: Don't choke on empty generic type arguments.
1464 * cs-tokenizer.cs: Handle escaped preprocessor directives.
1466 * expression.cs, ecore.cs: Minor expressions bugs.
1468 2008-08-01 Marek Safar <marek.safar@gmail.com>
1470 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
1471 and added more error handling.
1473 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
1475 * modifiers.cs, enum.cs: Fixed.
1477 2008-07-31 Jb Evain <jbevain@novell.com>
1479 * driver.cs: remove -pkg ability of smcs.
1481 2008-07-30 Marek Safar <marek.safar@gmail.com>
1483 * statement.cs (Switch): Correctly set empty default target for single
1486 2008-07-30 Marek Safar <marek.safar@gmail.com>
1488 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
1489 string switch statement implementation to use string dictionary which
1490 significantly (2-8x) improves performance of generated code.
1492 2008-07-29 Marek Safar <marek.safar@gmail.com>
1494 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
1495 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
1497 2008-07-29 Marek Safar <marek.safar@gmail.com>
1499 A fix for bug #412595
1500 * typemanager.cs, convert.cs, expression.cs: Some types are never
1501 convertible to each other.
1503 2008-07-29 Marek Safar <marek.safar@gmail.com>
1505 * nullable.cs (CreateNullConstant): An error messages update.
1507 2008-07-29 Marek Safar <marek.safar@gmail.com>
1509 A fix for bug #412595
1510 * cfold.cs: Don't cast undefined bool constant.
1512 2008-07-29 Martin Baulig <martin@ximian.com>
1515 (SymbolWriter.Reset): New public static method.
1518 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
1520 2008-07-28 Marek Safar <marek.safar@gmail.com>
1522 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
1524 * expression.cs (ElementAccess): Exact size allocation.
1526 2008-07-26 Marek Safar <marek.safar@gmail.com>
1528 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
1530 2008-07-25 Marek Safar <marek.safar@gmail.com>
1532 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
1534 * class.cs: Removed $PRIVATE$ field hack which caused problems during
1537 2008-07-25 Marek Safar <marek.safar@gmail.com>
1539 A fix for bug #412217
1540 * assign.cs: Mutate also assignment type.
1542 2008-07-25 Marek Safar <marek.safar@gmail.com>
1544 A fix for bug #323644
1545 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
1548 2008-07-25 Marek Safar <marek.safar@gmail.com>
1550 A fix for bug #412134
1551 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
1552 non-enumerable operands when overloading equality or bitwise operators.
1554 2008-07-25 Marek Safar <marek.safar@gmail.com>
1556 * anonymous.cs: Cache closed generic anonymous method delegates.
1558 2008-07-24 Marek Safar <marek.safar@gmail.com>
1560 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
1561 anonymous.cs, statement.cs: Always emit anonymous method as static method
1562 when is instance free. Use nesting for nested anynomous methods blocks.
1564 2008-07-23 Marek Safar <marek.safar@gmail.com>
1566 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
1569 2008-07-23 Marek Safar <marek.safar@gmail.com>
1571 * expression.cs: Removed MakeSimpleCall.
1573 2008-07-23 Marek Safar <marek.safar@gmail.com>
1575 A fix for bug #323012
1576 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
1577 Base method implementing interface has to be public.
1579 2008-07-23 Marek Safar <marek.safar@gmail.com>
1581 * cs-parser.jay: Don't break on missing argument.
1583 2008-07-22 Marek Safar <marek.safar@gmail.com>
1585 A fix for bug #320993
1586 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
1587 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
1589 2008-07-22 Marek Safar <marek.safar@gmail.com>
1591 A fix for bug #320748
1592 * convert.cs: Implicit user operators cannot convert to interfaces
1594 2008-07-22 Marek Safar <marek.safar@gmail.com>
1596 A fix for bug #312686
1597 * driver.cs: Ignore empty assembly references.
1599 2008-07-22 Marek Safar <marek.safar@gmail.com>
1601 A fix for bug #387040
1602 * ecore.cs: Skip constrains check for an explicit implementation.
1604 2008-07-21 Marek Safar <marek.safar@gmail.com>
1606 A fix for bug #409045
1607 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
1608 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
1609 identifiers are file specific unless passed as input arguments.
1611 2008-07-21 Marek Safar <marek.safar@gmail.com>
1613 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
1614 to emit UnmanagedMarshal data under 2.0 profile.
1616 2008-07-21 Marek Safar <marek.safar@gmail.com>
1618 A fix for bug #410369
1619 * parameter.cs: Clone correctly ParamsParameter.
1621 2008-07-21 Marek Safar <marek.safar@gmail.com>
1623 * expression.cs (Argument): Always report type for type based expressions
1626 2008-07-18 Marek Safar <marek.safar@gmail.com>
1628 A fix for bug #410666
1629 * anonymous.cs: Correctly initialize generic storey reference.
1631 2008-07-18 Marek Safar <marek.safar@gmail.com>
1633 * convert.cs: Don't box same type arguments.
1635 2008-07-18 Marek Safar <marek.safar@gmail.com>
1637 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
1638 Finished missing generic type mutators.
1640 2008-07-18 Marek Safar <marek.safar@gmail.com>
1642 * iterators.cs, statement.cs: Finished statements CloneTo.
1644 2008-07-18 Marek Safar <marek.safar@gmail.com>
1646 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
1648 * expression.cs: Emit optimized default value expressions in expression tree
1651 2008-07-18 Marek Safar <marek.safar@gmail.com>
1653 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
1655 2008-07-17 Marek Safar <marek.safar@gmail.com>
1657 A fix for bug #367536
1658 * cs-parser.jay: Check static constructor of generic types for an access
1661 2008-07-17 Marek Safar <marek.safar@gmail.com>
1663 A fix for bug #353800
1664 * lambda.cs: Emit ret for contextual statements.
1666 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
1667 up emitting redundant ret for all anonymous methods with return.
1669 2008-07-17 Marek Safar <marek.safar@gmail.com>
1671 A fix for bug #365188
1672 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
1673 create anonymous method storey in unreachable block.
1675 2008-07-17 Marek Safar <marek.safar@gmail.com>
1677 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
1678 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
1679 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
1680 statement.cs: Fixed relevant defects found by Gendarme.
1682 2008-07-17 Marek Safar <marek.safar@gmail.com>
1684 A fix for bug #325291
1685 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
1686 statement.cs: Replaced IAnonymousHost with top level block flag.
1688 2008-07-17 Marek Safar <marek.safar@gmail.com>
1690 * cs-parser.jay: Clean up unused open_parens.
1692 2008-07-17 Marek Safar <marek.safar@gmail.com>
1694 * ecore.cs: Custom error message for a range variable assignment.
1696 2008-07-16 Marek Safar <marek.safar@gmail.com>
1698 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
1701 2008-07-16 Marek Safar <marek.safar@gmail.com>
1703 * literal.cs: Null literal is of object type.
1705 2008-07-16 Marek Safar <marek.safar@gmail.com>
1707 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
1708 expression of nullable equality comparison.
1710 2008-07-15 Marek Safar <marek.safar@gmail.com>
1712 * expression.cs(PointerArithmetic): Removed redundant assignment.
1714 2008-07-15 Marek Safar <marek.safar@gmail.com>
1716 * decl.cs (GetSignatureForError): Report full namespace name for containers.
1718 2008-07-14 Marek Safar <marek.safar@gmail.com>
1720 A fix for bug #408361
1721 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
1722 they are replaced by GetMethod.
1724 2008-07-14 Marek Safar <marek.safar@gmail.com>
1726 A fix for bug #408721 by jeremie.laval@gmail.com
1727 * expression.cs (Indirection): Implemented CloneTo.
1729 2008-07-14 Marek Safar <marek.safar@gmail.com>
1731 * statement.cs (AssignableSlots): Temporary disabled variable initialization
1734 2008-07-14 Marek Safar <marek.safar@gmail.com>
1736 * report.cs (EnableReporting): Don't reinitialize 0-based values.
1738 2008-07-11 Marek Safar <marek.safar@gmail.com>
1740 * linq.cs: Reset tranparent parameter counter in probing mode.
1742 2008-07-11 Marek Safar <marek.safar@gmail.com>
1744 * anonymous.cs: Mutate anonymous method type.
1746 2008-07-11 Marek Safar <marek.safar@gmail.com>
1748 * ecore.cs, anonymous.cs: Mutate field expressions.
1750 2008-07-10 Marek Safar <marek.safar@gmail.com>
1752 A fix for bug #369670
1753 * linq.cs, statement.cs: Use explicit block for query expressions variables.
1755 2008-07-10 Marek Safar <marek.safar@gmail.com>
1757 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
1759 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
1762 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
1763 only one '>', and finds a '>>', abort the generic lookahead.
1765 2008-07-10 Marek Safar <marek.safar@gmail.com>
1767 A fix for bug #319902
1768 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
1770 2008-07-10 Marek Safar <marek.safar@gmail.com>
1772 A fix for bug #406371
1773 * statement.cs: Moved EmitSymbolInfo to Block.
1775 2008-07-09 Marek Safar <marek.safar@gmail.com>
1777 * ecore.cs: Report better error for extension method overload failures.
1779 2008-07-09 Marek Safar <marek.safar@gmail.com>
1781 * expression.cs (Is): No need to box reference values.
1783 2008-07-09 Marek Safar <marek.safar@gmail.com>
1785 * class.cs: Use event resolve context when initializing CreateEmitContext.
1787 2008-07-09 Marek Safar <marek.safar@gmail.com>
1789 A fix for bug #394436
1790 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
1791 method used inside expression trees. Added more LINQ to expression tree
1794 2008-07-08 Marek Safar <marek.safar@gmail.com>
1796 A fix for bug #378189, #370577
1797 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
1800 2008-07-08 Marek Safar <marek.safar@gmail.com>
1802 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
1805 2008-07-08 Marek Safar <marek.safar@gmail.com>
1807 A fix for bug #406702
1808 * anonymous.cs: Always park anonymous method in the nearest parent storey.
1810 2008-07-07 Marek Safar <marek.safar@gmail.com>
1812 A fix for bug #406648
1813 * cs-parser.jay: Report nullable use in mcs for some cases.
1815 2008-07-07 Marek Safar <marek.safar@gmail.com>
1817 * ecore.cs: Improved argument mismatch error messages.
1819 2008-07-07 Marek Safar <marek.safar@gmail.com>
1821 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
1823 2008-07-07 Marek Safar <marek.safar@gmail.com>
1825 * expression.cs (TypeOf): Mutate type argument.
1827 2008-07-04 Marek Safar <marek.safar@gmail.com>
1829 * class.cs: Report missing partial modifier for correct type.
1831 2008-07-04 Marek Safar <marek.safar@gmail.com>
1833 * ecore.cs, expression.cs (VariableReference): Variable property is
1836 2008-07-04 Marek Safar <marek.safar@gmail.com>
1838 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
1840 2008-07-04 Marek Safar <marek.safar@gmail.com>
1842 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
1845 2008-07-04 Marek Safar <marek.safar@gmail.com>
1847 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
1848 anonymous method storey to an instance method when only "this" is hoisted.
1850 2008-07-03 Marek Safar <marek.safar@gmail.com>
1852 A fix for bug #321615
1853 * expression.cs: Pointer comparisons use unsigned operator.
1855 2008-07-03 Marek Safar <marek.safar@gmail.com>
1857 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
1859 2008-07-02 Marek Safar <marek.safar@gmail.com>
1861 A fix for bug #404905
1862 * class.cs: Always initialize local unsafe variables.
1864 2008-06-30 Marek Safar <marek.safar@gmail.com>
1866 A fix for bug #396987
1867 * expression.cs (NewInitialize): Clear local temporary variable for next run
1869 2008-06-27 Marek Safar <marek.safar@gmail.com>
1871 A fix for bug #401020
1872 * ecore.cs: Both types and modifiers have to match for ref and out arguments
1874 2008-06-27 Marek Safar <marek.safar@gmail.com>
1876 A fix for bug #398319
1877 * cs-parser.jay: Implemented undocumented base access expression inside
1880 2008-06-26 Marek Safar <marek.safar@gmail.com>
1882 A fix for bug #404227
1883 * cs-parser.jay: Parse namespace declaration using qualified identifier.
1885 2008-06-26 Marek Safar <marek.safar@gmail.com>
1887 A fix for bug #404227
1888 * convert.cs: Fixed explicit array to interface cast.
1890 2008-06-26 Marek Safar <marek.safar@gmail.com>
1892 A fix for bug #403894
1893 * delegate.cs: Mutate DelegateInvocation type.
1895 2008-06-26 Marek Safar <marek.safar@gmail.com>
1897 A fix for bug #379348
1898 * delegate.cs: Box a load of generic parameters.
1900 2008-06-26 Marek Safar <marek.safar@gmail.com>
1902 * expression.cs: Add an array creation arguments mutate.
1904 2008-06-26 Marek Safar <marek.safar@gmail.com>
1906 A fix for bug #386068
1907 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
1910 2008-06-25 Marek Safar <marek.safar@gmail.com>
1912 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
1915 2008-06-25 Marek Safar <marek.safar@gmail.com>
1917 A fix for bug #403518
1918 * delegate.cs: Type correctly anonymous method new invocation.
1920 2008-06-24 Marek Safar <marek.safar@gmail.com>
1922 A fix for bug #394826
1923 * anonymous.cs: Fully qualify members when resolving anonymous type internal
1926 2008-06-24 Marek Safar <marek.safar@gmail.com>
1928 A fix for bug #394826
1929 * anonymous.cs, iterators.cs: Construct generic storey only when is really
1932 2008-06-24 Marek Safar <marek.safar@gmail.com>
1934 * class.cs: Clone indexer parameters for localized capturing.
1936 2008-06-24 Marek Safar <marek.safar@gmail.com>
1938 A fix for bug #402379
1939 * expression.cs: Don't crash when an object initializer resolve fails.
1941 2008-06-24 Marek Safar <marek.safar@gmail.com>
1943 A fix for bug #402888
1944 * expression.cs: Mutate conditional expression.
1946 2008-06-24 Marek Safar <marek.safar@gmail.com>
1948 A fix for bug #401012
1949 * class.cs: Keep StructLayout in shared container.
1951 2008-06-24 Marek Safar <marek.safar@gmail.com>
1953 A fix for bug #400438
1954 * decl.cs, class.cs: Only properties can be automatically implemented.
1956 2008-06-24 Marek Safar <marek.safar@gmail.com>
1958 * statement.cs (ChangeToIterator): Copy also labels.
1960 2008-06-23 Marek Safar <marek.safar@gmail.com>
1962 * ecore.cs: Pass type argument details to parent extension method.
1964 2008-06-23 Marek Safar <marek.safar@gmail.com>
1966 A fix for bug #375966
1967 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
1969 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
1971 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
1973 2008-06-22 Marek Safar <marek.safar@gmail.com>
1975 A fix for bug #394347
1976 * anonymous.cs: Cache compatible delegates as compatibility check produces
1977 a new method every time.
1979 2008-06-20 Marek Safar <marek.safar@gmail.com>
1981 * anonymous.cs: Propagate storey reference for single references.
1983 2008-06-20 Marek Safar <marek.safar@gmail.com>
1985 A fix for bug #387615
1986 * assign.cs, expression.cs: Correctly clone compound assignment.
1988 2008-06-19 Marek Safar <marek.safar@gmail.com>
1990 A fix for bug #359611, #359604
1991 * anonymous.cs: Mutate all types of hoisted parameters.
1993 2008-06-19 Marek Safar <marek.safar@gmail.com>
1995 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
1996 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
1997 expression.cs, codegen.cs, statement.cs
1999 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
2000 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
2002 ** Anonymous methods, lambda expressions rewrite **
2004 Anonymous expressions are now resolved when an explicit block is resolved
2005 and they don't require any registration procedure anymore. Further,
2006 anonymous methods are defined when explicit block is emitted which allows
2007 better control of whole process and opens possibilities for more
2008 optimizations as well as alternative to reverse whole process.
2010 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
2011 process consistent and to correctly emit hoisted generic methods when they
2012 have at least 1 hoisted variable.
2014 2008-06-17 Martin Baulig <martin@ximian.com>
2016 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
2018 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
2019 virtual property; check it in Emit().
2020 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
2022 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
2024 (Indexer.Define): Likewise.
2026 2008-06-17 Marek Safar <marek.safar@gmail.com>
2028 * convert.cs: Don't use IsInterface on type arguments.
2030 * delegate.cs: DelegateInvocation uses MethodInfo.
2032 * parameter.cs: Removed IsTypeParameter.
2034 * generic-mcs.cs: More missing stuff.
2036 2008-06-16 Martin Baulig <martin@ximian.com>
2039 (Modifiers.DEBUGGER_HIDDEN): New public const.
2042 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
2045 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
2046 (AbstractPropertyEventMethod): Likewise.
2047 (Constructor.Emit): Likewise.
2048 (SourceMethod.SetCompilerGenerated): Removed.
2050 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
2054 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
2055 if we're an `IteratorHost'.
2056 (AnonymousMethodMethod..ctor): Don't set
2057 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
2060 2008-06-16 Marek Safar <marek.safar@gmail.com>
2062 * statement.cs: Clean-up foreach statements.
2064 2008-06-12 Marek Safar <marek.safar@gmail.com>
2066 * class.cs: Stop using public method which should not exist
2067 (MethodBuilder.SetGenericMethodSignature).
2069 2008-06-11 Martin Baulig <martin@ximian.com>
2072 (Location.LookupFile): Add `CompilationUnit' argument; when given
2073 a relative file name, make it relative to the directory the .cs
2074 file is located in instead of using the current directory.
2076 2008-06-11 Martin Baulig <martin@ximian.com>
2079 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
2080 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
2081 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
2082 (SourceMethod.SetCompilerGenerated): Likewise.
2084 2008-06-11 Marek Safar <marek.safar@gmail.com>
2086 * codegen.cs, driver: Only write symbol file when it's asked for.
2088 2008-06-11 Marek Safar <marek.safar@gmail.com>
2090 * codegen.cs: Don't use assembly writer error handling for symbol writer.
2092 2008-06-10 Martin Baulig <martin@ximian.com>
2094 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
2096 2008-06-09 Marek Safar <marek.safar@gmail.com>
2098 A fix for bug #316290
2099 * expression.cs: Include decimal operators in predefined table.
2101 * parameters.cs: More readonlyness.
2103 2008-06-09 Marek Safar <marek.safar@gmail.com>
2105 A fix for bug #397213
2106 * cs-parser.jay: One more missing current_local_parameters reset.
2108 2008-06-09 Marek Safar <marek.safar@gmail.com>
2110 A fix for bug #396633
2111 * class.cs: Host backing field in partial container.
2113 2008-06-09 Marek Safar <marek.safar@gmail.com>
2115 A fix for bug #397068
2116 * expression.cs: Check both operand types when predefined operator is used.
2118 2008-06-05 Martin Baulig <martin@ximian.com>
2120 Merged the `debugger-kahalo' branch.
2123 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
2124 we're an iterator method.
2125 (SourceMethod): Reflect latest symbol writer changes;
2126 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
2127 now `start_row' and `end_row'.
2128 (Constructor.Emit): Fix the logic whether to emit symbol information.
2130 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
2134 (CompilationUnit): New public class; derives from `SourceFile'.
2135 (SourceFileEntry.DefineSymbolInfo): New public method.
2136 (SourceFileEntry.SetChecksum): New public method.
2137 (Location): Encode hidden line numbers by using `column == 255';
2138 the .ctor now accepts `column == -1' to mark a hidden line number.
2139 (Location.Hidden): New public property.
2140 (Location.CheckPoint): Add `CompilationUnit'.
2141 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
2142 (Location.Push): Add `CompilationUnit compile_unit' argument.
2143 (Location.CompilationUnit): New public property.
2146 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
2148 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
2150 * driver.cs: `SourceFile' -> `CompilationUnit'.
2152 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
2154 * namespace.cs: `SourceFile' -> `CompilationUnit'.
2156 * cs-tokenizer.cs: Add support for `#pragma checksum' and
2160 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
2161 new symbol writer API to also pass the file.
2163 2008-06-05 Marek Safar <marek.safar@gmail.com>
2165 * statement.cs: Emit catch variable assignment using variable expression.
2167 2008-06-05 Marek Safar <marek.safar@gmail.com>
2169 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
2170 with other variable types.
2172 2008-06-04 Marek Safar <marek.safar@gmail.com>
2174 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
2175 GetLength method emit, it breaks resolve rules.
2177 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
2178 Marek Safar <marek.safar@gmail.com>
2180 A fix for bug #395542
2181 * cs-parser.jay: The trailing comma is allowed in anonymous type member
2184 2008-06-02 Marek Safar <marek.safar@gmail.com>
2186 A fix for bug #395287
2187 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
2189 2008-05-31 Marek Safar <marek.safar@gmail.com>
2191 A fix for bug #395845
2192 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
2193 non-nullable parameter type.
2195 2008-05-31 Marek Safar <marek.safar@gmail.com>
2197 * class.cs: Handle contructor initializer as a statement in top-level block.
2199 2008-05-30 Marek Safar <marek.safar@gmail.com>
2201 * attribute.cs: Don't mix old and new corlib types when emitting corlib
2202 security attributes.
2204 2008-05-24 Marek Safar <marek.safar@gmail.com>
2206 * ecore.cs, expression.cs: Small IVariable refactoring.
2208 2008-05-22 Marek Safar <marek.safar@gmail.com>
2210 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
2212 2008-05-21 Marek Safar <marek.safar@gmail.com>
2214 * cs-parser.jay: Removed redundant catch type check.
2216 2008-05-21 Marek Safar <marek.safar@gmail.com>
2218 A fix for bug #390372
2219 * nullable.cs: Set correct return type.
2221 2008-05-21 Marek Safar <marek.safar@gmail.com>
2223 A fix for bug #391062
2224 * typemanager.cs: Fixed crash when comparing null types.
2226 2008-05-21 Marek Safar <marek.safar@gmail.com>
2228 A fix for bug #391871
2229 * cs-parser.jay: Better error handling for invalid catch type.
2231 2008-05-20 Marek Safar <marek.safar@gmail.com>
2233 A fix for bug #392155
2234 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
2236 2008-05-15 Marek Safar <marek.safar@gmail.com>
2238 A fix for bug #390666
2239 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
2242 2008-05-15 Marek Safar <marek.safar@gmail.com>
2244 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
2247 2008-05-13 Marek Safar <marek.safar@gmail.com>
2249 A fix for bug #389625
2250 * delegate.cs, generic.cs: Some progress on method group return type
2253 2008-05-13 Marek Safar <marek.safar@gmail.com>
2255 A fix for bug #378419
2256 * namespace.cs: Inspect also parent namespaces not only namespace entries.
2258 2008-05-12 Marek Safar <marek.safar@gmail.com>
2260 * class.cs (Constructor): Added IsCompilerGenerated.
2262 2008-05-12 Marek Safar <marek.safar@gmail.com>
2264 * expression.cs: Enum binary operators can accept non-enum operand only when
2265 is implicitly convertible to underlying type.
2267 2008-05-12 Marek Safar <marek.safar@gmail.com>
2269 A fix for bug #389272
2270 * support.cs: Workaround System.InvalidOperationException for enums.
2272 2008-05-12 Marek Safar <marek.safar@gmail.com>
2274 A fix for bug #389073
2275 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
2277 2008-05-10 Marek Safar <marek.safar@gmail.com>
2279 * driver.cs: Split Parse.
2281 * location.cs (LookupFile): Uses string.Empty.
2283 2008-05-07 Marek Safar <marek.safar@gmail.com>
2285 * expression.cs, parameter.cs: Small ParameterReference clean up.
2287 2008-05-07 Marek Safar <marek.safar@gmail.com>
2289 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
2290 hack. Fixes #387502.
2292 2008-05-06 Martin Baulig <martin@ximian.com>
2294 * class.cs (Constructor.Emit): Fix the logic whether to emit
2297 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
2300 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
2301 InvalidOperationException when the iterator is before the start or
2304 2008-05-06 Marek Safar <marek.safar@gmail.com>
2306 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
2307 when left is nullable type.
2309 2008-05-06 Marek Safar <marek.safar@gmail.com>
2311 A fix for bug #386628
2312 * expression.cs (LocalVariableReference): Continue in resolving when
2313 variable is not assigned.
2315 2008-05-05 Marek Safar <marek.safar@gmail.com>
2317 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
2318 nullable operations.
2320 2008-05-04 Marek Safar <marek.safar@gmail.com>
2322 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
2323 it saves many redundant temporary variables for nullable operations.
2325 2008-05-03 Marek Safar <marek.safar@gmail.com>
2327 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
2329 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
2332 * nullable.cs: Constant coalescing operator optimizations.
2334 2008-05-03 Marek Safar <marek.safar@gmail.com>
2336 * constant.cs: Use unsigned conversion for values which are unsigned only.
2338 2008-05-03 Marek Safar <marek.safar@gmail.com>
2340 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
2341 coalescing operator as it should be.
2343 2008-05-02 Marek Safar <marek.safar@gmail.com>
2345 A fix for bug #371016
2346 * expression.cs: All predefined delegate operators require implicit method
2349 2008-05-02 Marek Safar <marek.safar@gmail.com>
2351 * constant.cs: Emit long constant as uint when fits the range.
2353 * convert.cs, expression.cs: Fixed few unsafe conversions.
2355 2008-05-02 Marek Safar <marek.safar@gmail.com>
2357 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
2359 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
2362 * convert.cs (ImplicitNumericConversion): Don't modify the type of
2364 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
2366 2008-05-01 Marek Safar <marek.safar@gmail.com>
2368 * constant.cs, literal.cs: IsLiteral property for error reporting.
2370 * ecore.cs, expression.cs: Implemented Property expression.
2372 2008-05-01 Marek Safar <marek.safar@gmail.com>
2374 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
2376 * nullable.cs: Implemented nullable coalescing null operator.
2378 * ecore.cs, expression.cs: Expression trees work.
2380 2008-05-01 Marek Safar <marek.safar@gmail.com>
2382 * ecore.cs: CreateExpressionTree is finally abstract.
2384 * expression.cs, linq.cs: Updated.
2386 2008-05-01 Marek Safar <marek.safar@gmail.com>
2388 * expression.cs, ecore.cs: Block base access expression inside expression
2391 2008-05-01 Marek Safar <marek.safar@gmail.com>
2393 A fix for bug #385058
2394 * expression.cs: User-defined operator implementations always take
2395 precedence over predefined operator implementations.
2397 2008-04-30 Marek Safar <marek.safar@gmail.com>
2399 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
2400 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
2401 expression tree conversions.
2403 2008-04-30 Marek Safar <marek.safar@gmail.com>
2405 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
2406 operators method details to Operator class.
2408 2008-04-30 Marek Safar <marek.safar@gmail.com>
2410 * anonymous.cs: Pass unsafe flags to anonymous container.
2412 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
2413 inside expression tree.
2415 2008-04-29 Martin Baulig <martin@ximian.com>
2417 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
2418 (Tokenizer.PopPosition): Also restore the `line'.
2420 2008-04-29 Marek Safar <marek.safar@gmail.com>
2422 * delegate.cs: Implemented Invoke expression.
2424 2008-04-29 Marek Safar <marek.safar@gmail.com>
2426 * expression.cs: Fixed equality reference comparison regression.
2428 2008-04-29 Marek Safar <marek.safar@gmail.com>
2430 * ecore.cs: Clean up EmptyCast hack.
2432 * expression.cs, nullable.cs: Implemented enum binary and unary operations
2433 using correct conversion rules. Also fixes #383993.
2435 2008-04-28 Martin Baulig <martin@ximian.com>
2437 * class.cs (Constructor.Emit): Don't emit debugging information
2438 for generated default .ctor's.
2440 2008-04-28 Marek Safar <marek.safar@gmail.com>
2442 * convert.cs: Empty-cast ushort to int conversion.
2444 2008-04-28 Marek Safar <marek.safar@gmail.com>
2446 A fix for bug #384191
2447 * ecore.cs, expression.cs: Fixed expression cloning.
2449 2008-04-28 Marek Safar <marek.safar@gmail.com>
2451 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
2453 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
2455 Fix #381559, test-638.cs, test-639.cs
2456 * assign.cs (CompoundAssign.Helper): New wrapper.
2457 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
2459 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
2460 Pass unconverted expressions to the params array creation expression.
2461 (FieldExpr.EmitAssign): Don't special-case StringConcat.
2462 (PropertyExpr.EmitAssign): Likewise.
2463 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
2464 element if it is of kind CompoundAssign.Helper.
2465 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
2466 first before anything else.
2467 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
2468 (ArrayAccess.LoadArrayAndArguments): Simplify.
2470 2008-04-27 Marek Safar <marek.safar@gmail.com>
2472 * expression.cs: Fixed cloning of typeof(void).
2474 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
2476 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
2477 (Assign.Emit): Likewise. Move it to ...
2478 (CompoundAssign.DoResolve): ... here and ...
2479 (CompoundAssign.Emit): ... here.
2480 (EventAddOrRemove): New helper to handle += and -= on events, and
2481 avoid the use of BinaryDelegates.
2482 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
2483 (EventExpr.EmitAddOrRemove): Improve.
2484 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
2486 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
2487 create VarExprs for 'foo.bar.var'.
2488 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
2489 is a highly inappropriate name for its functionality.
2491 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
2493 Simplify handling of multiple assignments
2494 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
2496 (SimpleAssign): New. Class to be used for normal assignments.
2497 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
2498 * expression.cs, parameter.cs, statement.cs: Likewise.
2500 2008-04-25 Marek Safar <marek.safar@gmail.com>
2502 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
2503 for incompatible underlying types, more to come, uff.
2505 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
2508 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
2509 Handle 'leave_copy'.
2511 2008-04-25 Marek Safar <marek.safar@gmail.com>
2513 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
2515 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
2517 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
2518 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
2519 * statement.cs (While, Do, For): Allow test to have side effects.
2520 (For.DoEmit): Always emit InitStatement.
2523 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
2524 Always create SideEffectConstant.
2525 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
2526 of type EnumConstant.
2528 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2529 Handle 'right' being SideEffectConstant of type 'bool'.
2531 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2532 Use left.EmitBranchable instead of open coding it, so as to
2533 improve optimization opportunities.
2535 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
2537 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
2539 (Expression.EmitSideEffect): Document.
2541 2008-04-23 Marek Safar <marek.safar@gmail.com>
2543 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
2545 2008-04-23 Marek Safar <marek.safar@gmail.com>
2547 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
2549 2008-04-23 Marek Safar <marek.safar@gmail.com>
2551 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
2552 conversion to expression tree.
2554 2008-04-23 Marek Safar <marek.safar@gmail.com>
2556 * ecore.cs: Removed unused expression.
2558 2008-04-22 Marek Safar <marek.safar@gmail.com>
2560 * expression.cs: Implemented NegateChecked and New expressions.
2562 2008-04-22 Marek Safar <marek.safar@gmail.com>
2564 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
2566 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
2569 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
2570 needing final 'ret' instruction.
2572 2008-04-22 Marek Safar <marek.safar@gmail.com>
2574 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
2576 2008-04-21 Marek Safar <marek.safar@gmail.com>
2578 * expression.cs: Emit ldnull and not null expression as an instance argument
2579 of static method expression calls.
2581 2008-04-21 Marek Safar <marek.safar@gmail.com>
2583 A fix for bug #378200
2584 * expression.cs: Fixed crash when creating parameterless expression tree
2587 2008-04-21 Marek Safar <marek.safar@gmail.com>
2589 A fix for bug #375297
2590 * anonymous.cs: Fixed crash when inferring from null argument anonymous
2593 2008-04-21 Marek Safar <marek.safar@gmail.com>
2595 A fix for bug #377596
2596 * decl.cs, class.cs: Emit delegate type argument attributes.
2598 2008-04-21 Marek Safar <marek.safar@gmail.com>
2600 A fix for bug #365314
2601 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
2603 2008-04-21 Marek Safar <marek.safar@gmail.com>
2605 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
2608 2008-04-21 Marek Safar <marek.safar@gmail.com>
2610 * generic.cs (TypeParameter): Removed redundant location.
2612 2008-04-19 Marek Safar <marek.safar@gmail.com>
2614 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
2615 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
2616 FullNamedExpression in all declaration type expression, statements will come
2619 2008-04-18 Marek Safar <marek.safar@gmail.com>
2621 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
2622 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
2624 2008-04-18 Marek Safar <marek.safar@gmail.com>
2626 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
2629 2008-04-17 Marek Safar <marek.safar@gmail.com>
2631 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
2634 2008-04-17 Marek Safar <marek.safar@gmail.com>
2636 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
2640 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
2642 Hook up 'EmitSideEffect'
2643 * constant.cs (Constant.EmitSideEffect): New.
2644 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
2645 (SideEffectConstant.EmitSideEffect): New.
2646 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
2647 unconditional branch in EmitBranchable.
2648 (FieldExpr.EmitBranchable): New.
2649 * expression.cs (Unary.EmitSideEffect): New.
2650 (Binary.EmitSideEffect): New.
2651 (VariableReference.EmitSideEffect): New. Do nothing.
2653 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
2655 Introduce 'EmitSideEffect'
2656 * ecore.cs (Expression.EmitSideEffect): New.
2657 (TypeCast): Rename from EmptyCast.
2659 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
2660 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
2661 * convert.cs, nullable.cs: Update to changes.
2663 2008-04-16 Marek Safar <marek.safar@gmail.com>
2665 * class.cs, cs-parser.jay: Early check for base types expression.
2667 2008-04-16 Marek Safar <marek.safar@gmail.com>
2669 * decl.cs (MemberName): Declare PrettyName as obsolete.
2671 2008-04-16 Marek Safar <marek.safar@gmail.com>
2673 * namespace.cs: Use MemberName comparison.
2675 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
2678 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
2680 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
2681 (MemberName.FullyQualifiedName): New. Provides the functionality
2682 that users assume FullName would have.
2683 * ecore.cs, namespace.cs: Update to changes.
2685 * statement.cs (Using.assign): Make into ExpressionStatement.
2686 (Using.EmitPreTryBody): Simplify.
2688 2008-04-16 Marek Safar <marek.safar@gmail.com>
2690 * report.cs: ColorFormat is protected.
2692 * rootcontext.cs: Unused fields clean-up.
2694 * namespace.cs: Made UsingEntry name private.
2696 2008-04-16 Marek Safar <marek.safar@gmail.com>
2698 * cs-tokenizer.cs, location.cs: Removed unused field.
2700 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
2701 Raja R Harinath <harinath@hurrynot.org>
2704 * constant.cs (SideEffectConstant.value): Rename from 'left'.
2705 (SideEffectConstant.side_effect): Rename from 'right'.
2706 (SideEffectConstant..ctor): Normalize 'side_effect'.
2707 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
2708 value of this constant.
2709 * cfold.cs: Update to changes.
2711 2008-04-15 Marek Safar <marek.safar@gmail.com>
2713 * cs-paser.jay: Removed unused variable.
2715 * driver.cs: Made Compile instance method.
2717 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
2719 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
2721 2008-04-15 Marek Safar <marek.safar@gmail.com>
2723 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
2725 2008-04-13 Jb Evain <jbevain@novell.com>
2727 * namespace.cs: update the System.Core fullname for 2.1
2728 * driver.cs: update the list of required assemblies for 2.1.
2729 Merged from the Moonlight 2 branch.
2731 2008-04-11 Marek Safar <marek.safar@gmail.com>
2733 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
2734 types and user defined operators. User operators arguments has to be checked
2735 for null value before invocation, which also means no operator is called
2736 when any argument is not convertible to unwrapped nullable type.
2738 2008-04-09 Marek Safar <marek.safar@gmail.com>
2740 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
2741 of Unary expressions to follow operator overloading rules precisely.
2742 Also fixes #321794, #323794
2744 2008-04-08 Marek Safar <marek.safar@gmail.com>
2746 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
2749 2008-04-08 Marek Safar <marek.safar@gmail.com>
2751 * expression.cs, ecore.cs: Implemented MemberInit expression.
2753 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
2755 Fix mono/tests/exception4.cs
2756 * statement.cs (ExceptionStatement, TryCatch): Revert to using
2757 ec.NeedReturnLabel () rather emitting a 'nop'.
2759 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
2761 (TryCatch.SomeCodeFollows): Likewise.
2762 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
2763 for 'break', 'continue' and 'return' statements inside a try.
2764 We're fairly sure that the generated IL stream will have more
2765 instructions textually following the try.
2766 (FlowBranchingTryCatch): Likewise.
2768 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
2769 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
2772 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
2773 wrapper -- forward everything to CollectionForeach.
2774 (CollectionForeach.NonDisposableWrapper): New.
2775 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
2776 instead of a pop + branch to end.
2778 2008-04-07 Marek Safar <marek.safar@gmail.com>
2780 A fix for bug #377485
2781 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
2782 Propagate location for extension method groups. Report conversion failure at
2785 2008-04-07 Marek Safar <marek.safar@gmail.com>
2787 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
2788 ListInit and Field expressions.
2790 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
2792 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
2793 Since $PC is always -1 inside the body of MoveNext, the fault
2795 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
2796 * statement.cs (ExceptionStatement.emit_finally): Likewise.
2797 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
2799 The denouement! Fix #324708
2800 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
2801 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
2802 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
2803 'finally' inside the finally clause.
2805 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
2806 inside an iterator. Don't emit the body of the 'finally' inside
2807 the finally clause yet.
2809 Use the ResumableStatement infrastructure for MoveNext ()
2810 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
2811 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
2812 'old_resume_points'. Move dispatcher upfront.
2813 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
2814 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
2815 in an enumerator. This encodes the main fix in this patch series
2816 -- we can only jump into the first instruction of a try from the
2817 outside, but we want to emit try/finally regions in iterators and
2818 resume in the middle of them.
2820 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
2822 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
2823 of NeedReturnLabel here.
2825 Introduce a common point for emitting try/finally to IL
2826 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
2827 features of the various subclasses, which are now driven by ...
2828 (ExceptionStatement.EmitPreTryBody): ... this and ...
2829 (ExceptionStatement.EmitTryBody): ... this and the original
2831 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
2832 Remove DoEmit and update to follow above protocol.
2834 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
2835 of the dispatcher are the same, skip emitting the 'switch'.
2836 * iterator.cs (Iterator.EmitDispose): Update to changes.
2838 Clean up handling of 'using' statement
2839 * statement.cs (UsingTemporary): New. Carved out of ...
2840 (Using): ... this. Simplify drastically. Handle exactly
2842 * cs-parser.jay (using_statement): Split. Create UsingTemporary
2843 or Using as appropriate. If there are multiple variable declared,
2844 create nested Using statements.
2845 (resource_acquisition): Kill.
2847 * statement.cs (ExceptionStatement.EmitForDispose): Use
2848 EmitFinallyBody, not EmitFinally.
2850 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
2851 * iterator.cs: Update to changes.
2853 Start using the ResumableStatement infrastructure
2854 * statement.cs (ResumeableStatement.PrepareForDispose): New.
2855 (ResumableStatement.EmitForDispose): New.
2856 (ExceptionStatement): Override them.
2857 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
2858 EmitForDispose to create the body of the Dispose method. Don't
2861 * iterator.cs (Iterator.AddResumePoint): Move here from ...
2862 * statement.cs (Toplevel.AddResumePoint): ... here.
2863 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
2864 * flowanalysis.cs (FlowBranchingIterator): New.
2865 * codegen.cs (EmitContext): Update to changes.
2867 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
2868 (Iterator.old_resume_points): Rename from 'resume_points'.
2869 (Iterator.MoveNextStatement): Remove unused class.
2871 New infrastructure for try/finally in iterators (still unused)
2872 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
2873 (FlowBranchingToplevel.AddResumePoint): Hook into
2874 ToplevelBlock.AddResumePoint.
2875 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
2876 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
2877 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
2878 resume points and assign program-counter values.
2879 (ExceptionBlock.AddResumePoint): Collect resume points for
2880 de-muxer at the top of try block.
2881 * iterators.cs (Yield.CheckContext): Simplify.
2882 (Yield.Resolve): Use FlowBranching.AddResumePoint.
2884 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
2886 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
2887 argument to an ExitStatement.
2888 (FlowBranchingException): Refactor saved origins code.
2889 * statement.cs (ExitStatement): Update to cahges.
2890 * iterator.cs (YieldBreak): Likewise.
2892 * statement.cs (ResumableStatement): New. Common base class for
2893 YieldReturn and ExceptionStatement.
2894 (ExitStatement): New. Common base class for Return and YieldBreak.
2895 (Return): Update to changes.
2896 * iterator.cs (YieldBreak): Likewise.
2897 * lambda.cs (ContextualReturn): Likewise.
2900 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
2901 emit a meaningful error message.
2903 Fix #324765, #319508
2904 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
2905 (VariableInfo.SetAssigned): Set it.
2906 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
2907 determine if CS0219 or CS0168 is appropriate. Don't use
2908 flow-analysis information.
2909 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
2910 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
2911 (EmitContext.EndFlowBranching): ... this.
2913 2008-04-03 Marek Safar <marek.safar@gmail.com>
2915 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
2917 2008-04-03 Marek Safar <marek.safar@gmail.com>
2919 A fix for bug #376508
2920 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
2921 ImplicitConversionExists.
2923 2008-04-03 Marek Safar <marek.safar@gmail.com>
2925 * expression.cs (Binary): Added remaining binary operators to expression
2928 * nullable.cs: Optimize shift with null argument.
2930 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
2932 Fix minor IL regression
2933 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
2934 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
2935 * cs-parser.jay (try_statement): Update to changes.
2937 * statement.cs (TryFinally.need_exc_block): Delete.
2938 (TryFinally): Update to changes.
2940 Now all ExceptionStatements are unconditional
2941 * statement.cs (CollectionForeach.DisposableWrapper): New.
2942 Extract out the try/finally code into a new wrapper.
2943 (CollectionForeach.Resolve): Use it to simplify the code.
2945 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
2947 Start at simplifying ExceptionStatement semantics a bit
2948 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
2949 * cs-parser.jay (try_statement): Update to changes.
2950 (opt_catch_clauses): Remove.
2951 * flowanalysis.cs: Update to changes.
2952 (FlowBranching.BranchingType.TryCatch): New.
2953 (FlowBranchingTryCatch): New.
2955 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
2956 (FlowBranching.CreateBranching): Update to changes.
2957 (FlowBranchingBlock.AddSibling): Add sanity check.
2958 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
2961 * iterators.cs (Iterator.MarkFinally): Remove.
2962 * statement.cs (ExceptionStatement): Update to changes.
2964 Add support for skipping over finally blocks at runtime. First
2965 in a series to fix #324708
2966 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
2967 (Iterator.EmitMoveNext): Initialize it.
2968 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
2969 branch over the body of the 'finally' clause.
2971 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
2973 Avoid lopsided use of Foo/DoFoo names
2974 * statement.cs (ExpressionStatement.EmitFinallyBody):
2975 Rename from EmitFinally.
2976 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
2977 * iterator.cs: Update to changes.
2979 2008-04-02 Marek Safar <marek.safar@gmail.com>
2981 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
2982 based on UserOperatorCall. More binary nullable operators clean up.
2984 2008-04-02 Martin Baulig <martin@ximian.com>
2986 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
2988 2008-04-02 Marek Safar <marek.safar@gmail.com>
2990 * nullable.cs: Merge user and empty conversions when lifting expression
2993 * expression.cs (StringConcat): Implemented expression tree representation.
2995 2008-04-01 Marek Safar <marek.safar@gmail.com>
2997 * nullable.cs: When lifting null literal and a user operator exists, no call
3000 2008-04-01 Marek Safar <marek.safar@gmail.com>
3002 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
3005 2008-04-01 Marek Safar <marek.safar@gmail.com>
3007 * nullable.cs, expression.cs: Use namespace instead heavily nested
3008 monster abstract class.
3010 2008-04-01 Marek Safar <marek.safar@gmail.com>
3012 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
3013 lifting of null literal and user operators. Clean up of some temporary
3016 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
3018 Fix #368224, test-629.cs
3019 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
3020 if it crossed an unwind-protect boundary.
3021 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
3022 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
3023 inside an unwind-protected region.
3024 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
3025 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
3026 'leave' instead of a 'br' if unwind-protected.
3027 (Iterator.EmitYieldBreak): Likewise.
3029 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
3031 * driver.cs: Only define versioninfo resources if no win32 resource
3034 2008-03-28 Marek Safar <marek.safar@gmail.com>
3036 A fix for bug #372375
3037 * convert.cs: Fixed boxing of nullable types.
3039 2008-03-28 Marek Safar <marek.safar@gmail.com>
3041 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
3044 2008-03-28 Marek Safar <marek.safar@gmail.com>
3046 A fix for bug #374619
3047 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
3049 2008-03-27 Marek Safar <marek.safar@gmail.com>
3051 * lambda.cs: Check return type only for invocation.
3053 2008-03-27 Marek Safar <marek.safar@gmail.com>
3055 A fix for bug #374214
3056 * ecore.cs: Correctly report argument type mismatch.
3058 2008-03-27 Marek Safar <marek.safar@gmail.com>
3060 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
3061 and not rely on broken IsEnum.
3063 2008-03-27 Marek Safar <marek.safar@gmail.com>
3065 * nullable.cs: New file, extracted from generic.cs.
3067 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
3069 2008-03-27 Marek Safar <marek.safar@gmail.com>
3071 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
3072 predefined comparison operators and null literals.
3074 * report.cs: New warning ID.
3076 2008-03-25 Marek Safar <marek.safar@gmail.com>
3078 A fix for bug #370577
3079 * lambda.cs: Check return type too.
3081 2008-03-25 Marek Safar <marek.safar@gmail.com>
3083 A fix for bug #372846
3084 * class.cs: Automatic properties can be declared as unsafe.
3086 2008-03-20 Marek Safar <marek.safar@gmail.com>
3088 * location.cs: Use string based concatenation.
3090 * expression.cs: LiftedBinaryOperator is gmcs only.
3092 2008-03-20 Marek Safar <marek.safar@gmail.com>
3094 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
3095 conversions rules and expression trees.
3097 2008-03-19 Marek Safar <marek.safar@gmail.com>
3099 * delegate.cs: Use extension method source as delegate target.
3101 2008-03-19 Marek Safar <marek.safar@gmail.com>
3103 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
3104 binary operations to be purely based on binary operations and optimized
3105 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
3106 and other ET refactoring.
3108 * typemanager.cs: Fixed warning.
3110 2008-03-17 Marek Safar <marek.safar@gmail.com>
3112 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
3114 * symbolwriter.cs: Fixed.
3116 2008-03-17 Marek Safar <marek.safar@gmail.com>
3118 * anonymous.cs, driver.cs: Reset anonymous types counters.
3120 2008-03-17 Marek Safar <marek.safar@gmail.com>
3122 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
3124 * class.cs: Use fullname for all type member definitions.
3126 2008-02-19 Martin Baulig <martin@ximian.com>
3129 (IMethodData.EmitExtraSymbolInfo): New interface method.
3130 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
3131 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
3132 interface method here as an empty public virtual method.
3135 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
3136 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
3137 CodeGen.SymbolWriter.SetRealMethodName().
3139 2008-02-18 Martin Baulig <martin@ximian.com>
3142 (ScopeInfo.EmitType): Override this and emit debugging
3143 information for captured variables.
3144 (RootScopeInfo.EmitType): Override this and emit symbol
3145 information for a captured `this'.
3147 2008-02-15 Martin Baulig <martin@ximian.com>
3149 * iterators.cs: Emit debugging info.
3152 (EmitContext.Flags): Add `OmitDebuggingInfo'.
3153 (EmitContext.OmitDebuggingInfo): New public property.
3156 (While): Override Emit() and don't emit symbol info there; do it
3157 inside DoEmit() instead.
3158 (Block.Emit): Omit symbol information while emitting the scope
3159 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
3161 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
3162 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
3163 .ctor to make `IsIterator' work.
3165 2008-03-14 Martin Baulig <martin@ximian.com>
3167 * symbolwriter.cs: Added the new symbol writer function from the
3168 debugger's `terrania' branch; temporarily enclose them inside
3169 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
3172 2008-03-14 Martin Baulig <martin@ximian.com>
3175 (SymbolWriter): Make this a public static class.
3178 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
3179 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
3181 2008-03-14 Marek Safar <marek.safar@gmail.com>
3183 A fix for bug #370577
3184 * statement.cs, lambda.cs: Added extra limitations when dealing with void
3187 2008-03-14 Marek Safar <marek.safar@gmail.com>
3189 * typemanager.cs (CSharpName): Made 250 times faster.
3191 2008-03-13 Marek Safar <marek.safar@gmail.com>
3193 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
3195 2008-03-12 Marek Safar <marek.safar@gmail.com>
3197 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
3198 crash when predefined field does not exist.
3200 2008-03-12 Marek Safar <marek.safar@gmail.com>
3202 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
3204 2008-03-12 Marek Safar <marek.safar@gmail.com>
3206 * class.cs (FixedField): Don't crash when contructors are missing.
3208 2008-03-11 Marek Safar <marek.safar@gmail.com>
3210 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
3211 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
3212 check internal types accessibility for internal and external types.
3213 Replaced EnumToUnderlying by GetEnumUnderlyingType.
3215 2008-03-11 Marek Safar <marek.safar@gmail.com>
3217 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
3218 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
3219 attribute.cs, statement: Use corect instance of predefined types (work
3220 related to #364674).
3222 2008-03-07 Marek Safar <marek.safar@gmail.com>
3224 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
3226 2008-03-07 Marek Safar <marek.safar@gmail.com>
3228 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
3229 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
3230 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
3231 predefined types clean up, delayed predefined types members initialization
3232 (work related to #364674).
3234 2008-03-05 Marek Safar <marek.safar@gmail.com>
3236 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
3238 2008-03-05 Marek Safar <marek.safar@gmail.com>
3240 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
3241 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
3242 predefined types clean up (work related to #364674).
3244 2008-03-04 Marek Safar <marek.safar@gmail.com>
3246 * ecore.cs: Print an error message instead of throwing exception.
3248 2008-03-04 Marek Safar <marek.safar@gmail.com>
3250 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
3251 expression.cs, statement.cs: Unififed null literal representation.
3253 2008-03-03 Marek Safar <marek.safar@gmail.com>
3255 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
3256 expression.cs: Refactored binary operators resolve phase and improved speed.
3257 The nullable code is still missing and won't work correctly, more fixes
3260 It also fixes #323726, #324312, #324248, and many other unreported issues.
3262 2008-02-29 Zoltan Varga <vargaz@gmail.com>
3264 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
3267 2008-02-27 Marek Safar <marek.safar@gmail.com>
3269 * ecore.cs: Clean-up and split BetterConversion.
3271 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
3274 * enum.cs (EnumMember.Value): Only access 'value' if
3275 ResolveValue says it's ok.
3276 (EnumMember.DoResolveValue): Don't set prev_member.value.
3277 (Enum.GetDefinition): Reverse arguments of Equals --
3278 EnumMember.Value can return 'null'.
3280 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
3282 2008-02-22 Marek Safar <marek.safar@gmail.com>
3284 * generic.cs, expression.cs: More ongoing work on expression trees.
3286 2008-02-21 Marek Safar <marek.safar@gmail.com>
3288 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
3289 handle missing matches when mutiple operators exist.
3291 2008-02-20 Marek Safar <marek.safar@gmail.com>
3293 A fix for bug #363218
3294 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
3297 2008-02-20 Marek Safar <marek.safar@gmail.com>
3299 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
3300 update. This time to deal correctly with SideEffectConstant expression used
3301 as an argument for another constant folding.
3303 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
3305 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
3308 2008-02-19 Marek Safar <marek.safar@gmail.com>
3310 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
3312 2008-02-19 Marek Safar <marek.safar@gmail.com>
3314 A fix for bug #328136
3315 * expression.cs: Do not fold immediately LogicalAnd operators when the left
3316 side is a false constant, because we still need to evaluate the right-hand
3319 * statement.cs (If): Emit two types of boolean constants (simple constant,
3320 side-effect constant).
3322 2008-02-19 Marek Safar <marek.safar@gmail.com>
3324 * constant.cs (SideEffectConstant): Don't emit boolean constant.
3326 * expression.cs: Fold immediately LogicalAnd operators when both sides are
3329 2008-02-18 Marek Safar <marek.safar@gmail.com>
3331 A fix for bug #361457
3332 * ecore.cs (IsApplicable): Params methods have lower priority.
3334 * support.cs: Return correct parameter modifier for params types.
3336 2008-02-18 Marek Safar <marek.safar@gmail.com>
3338 * generic.cs (TypeParameter): Cache attribute target name.
3340 * support.cs: Removed unused variable.
3342 * typemanager.cs: Removed debugging leftover.
3344 * ecore.cs: Use local type instead of a property;
3346 * class.cs (VerifyMembers): Consider also parent to test whether type member
3349 * expression.cs (FullMethodDesc): Removed.
3351 * attribute.cs (IsValidArgumentType): Made static.
3353 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
3355 Cleanup to be more readable.
3356 * Makefile (GMCS_PROFILE): Remove.
3357 (COMPILER_NAME): New helper.
3359 2008-02-15 Miguel de Icaza <miguel@novell.com>
3361 * cs-tokenizer.cs: if a conditional expression happens inside a
3362 (...) this also means that we do not need to de-ambiguate between
3363 an parenthesized expression and a cast.
3367 * constant.cs (SideEffectConstant): a constant value that happens
3368 to have a side effect.
3370 Fixes the build regressions introduced by the fix for #359789
3372 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
3374 * expression.cs (Conditional.Emit): when emitting the ternary
3375 operator, use local variables to generate code verifiable code.
3377 The verifier cannot infer that the type on stack before the
3378 stloc.0 is executed is of type ParentB. This happens because the
3379 stack merge algorithm uses only parent types when deciding which
3380 is the common type. This is described in Part III 1.8.1.3 of ECMA
3383 This code compiled with mcs is not verifiable under MS. The MS
3384 verifier picks the first common interface of Foo and Bar, which is
3385 wrong, but doesn't use a full join type of the 2 interfaces.
3387 CSC uses a clever hack to compile such code in a verifiable
3388 way. It stores the intermediate values in a local variable with
3393 2008-02-14 Miguel de Icaza <miguel@novell.com>
3395 * expression.cs: Do not fold BitwiseAnd operators when the left
3396 side is a false constant, because we still need to evaluate the
3401 * support.cs: Instead of throwing an InternalErrorException when
3402 the position of the stream is outside the boundary of our buffer,
3403 reset the state of the reader, and restart the reading from the
3404 beginning of the file.
3406 2008-02-14 Marek Safar <marek.safar@gmail.com>
3408 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
3410 2008-02-14 Marek Safar <marek.safar@gmail.com>
3412 A fix for bug #361686
3413 * decl.cs: A protected types used inside a private class which parents
3414 derives from the protected class are accessible.
3416 2008-02-13 Marek Safar <marek.safar@gmail.com>
3418 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
3419 the parameterless constructor.
3421 2008-02-13 Marek Safar <marek.safar@gmail.com>
3423 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
3424 lookup methods to use standard member cache when doing member lookup.
3426 2008-02-12 Marek Safar <marek.safar@gmail.com>
3428 * driver.cs: Don't report full path for referenced module as assembly error.
3430 2008-02-12 Marek Safar <marek.safar@gmail.com>
3432 * Makefile: Fixed `qh' target to work on all machines.
3434 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
3435 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
3436 and HasElementType with TypeManager implementation.
3438 2008-02-08 Marek Safar <marek.safar@gmail.com>
3440 A fix for bugs #325134, #359749
3441 * expression.cs, ecore.cs: Try to resolve an extension method even if the
3442 first binds point to non-method member expression.
3444 2008-02-08 Marek Safar <marek.safar@gmail.com>
3446 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
3448 2008-02-08 Marek Safar <marek.safar@gmail.com>
3450 A fix for bugs #321394, #323028
3451 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
3452 Reworked naive IsAccessibleAs implementation to handle nested types.
3454 2008-02-05 Jb Evain <jbevain@novell.com>
3456 * class.cs: use generic type comparison for parameters
3459 2008-02-05 Marek Safar <marek.safar@gmail.com>
3461 A fix for bug #325372
3462 * class.cs: Use generic type comparison when testing method signatures.
3464 2008-02-05 Marek Safar <marek.safar@gmail.com>
3466 A fix for bug #357047
3467 * ecore.cs: Applied C# 3.0 changes to better conversion.
3469 2008-02-05 Marek Safar <marek.safar@gmail.com>
3471 A fix for bug #358374
3472 * cs-parser.jay: Correctly set modifiers for all constructor types.
3474 2008-02-04 Marek Safar <marek.safar@gmail.com>
3476 A fix for bug #355251
3477 * generic.cs: Added base class constraint based type inference.
3479 2008-02-01 Marek Safar <marek.safar@gmail.com>
3481 A fix for bug #357255
3482 * decl.cs: One more missing visibility check.
3484 2008-02-01 Marek Safar <marek.safar@gmail.com>
3486 * support.cs: Fixed broken return.
3488 2008-01-25 Marek Safar <marek.safar@gmail.com>
3490 * report.cs: Correctly reset warnings count after probing.
3492 2008-01-25 Martin Baulig <martin@ximian.com>
3495 (NamespaceEntry.SymbolFileID): Make this work again after
3496 MemberName.ToString() is gone.
3498 2008-01-25 Marek Safar <marek.safar@gmail.com>
3500 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
3503 2008-01-25 Marek Safar <marek.safar@gmail.com>
3505 * generic.cs: Use full implicit conversion for type inference fixing.
3507 2008-01-24 Marek Safar <marek.safar@gmail.com>
3509 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
3510 Fixed user operator conversions.
3512 2008-01-24 Marek Safar <marek.safar@gmail.com>
3514 * generic.cs: Do nullable type to null comparison optimization during
3517 2008-01-24 Marek Safar <marek.safar@gmail.com>
3519 A fix for bug #355163
3520 * generic.cs: Enabled l-value resolve on nullable expressions.
3522 2008-01-24 Marek Safar <marek.safar@gmail.com>
3524 A fix for bug #353986
3525 * class.cs: Ingore static ctors with parameters for any further checks.
3527 2008-01-24 Marek Safar <marek.safar@gmail.com>
3529 A fix for bug #354310
3530 * namespace.cs: Removed redundant check.
3532 2008-01-24 Marek Safar <marek.safar@gmail.com>
3534 A fix for bug #354928
3535 * expression.cs: ElementInitializers can be resolved only once.
3537 2008-01-24 Marek Safar <marek.safar@gmail.com>
3539 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
3540 Condition expressions.
3542 2008-01-23 Marek Safar <marek.safar@gmail.com>
3544 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
3546 2008-01-22 Marek Safar <marek.safar@gmail.com>
3548 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
3551 * generic.cs: Implemented coalesce expression.
3553 2008-01-22 Marek Safar <marek.safar@gmail.com>
3555 A fix for bug #355145
3556 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
3557 expression tree type inference.
3559 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
3562 * expression.cs (Binary.IsUnsignedType): Fix typo.
3564 2008-01-22 Marek Safar <marek.safar@gmail.com>
3566 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
3568 2008-01-22 Marek Safar <marek.safar@gmail.com>
3570 A fix for bug #355161
3571 * ecore.cs, expression.cs: Wider range of extension method supported
3574 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
3576 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
3577 AssemblyBuilder to operate in compiler context. Fixes mcs part of
3580 2008-01-22 Marek Safar <marek.safar@gmail.com>
3582 A fix for bug #355148
3583 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
3585 2008-01-22 Miguel de Icaza <miguel@novell.com>
3587 * expression.cs (CreateExpressionTree): Add support for or and
3588 logical or, and indent following the coding conventions.
3590 * typemanager.cs (LinqExpression): renamed from
3591 ExpressionTreeManager, for a shorter name.
3593 Use TypeManager.CoreLookupType to lookup types from our core
3594 assemblies and turn those into "Type" variables.
3596 Consumers that previously used "Namespace" and "Type" from this
3597 class should instead use the TypeExpression which is a type that
3598 is fully resolved (without involving the regular C# resolution
3601 This typically looks like this:
3603 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
3604 new MemberAccess (texpr, name, type_arguments, loc)
3606 This avoids the problem in: #355178
3608 2008-01-21 Marek Safar <marek.safar@gmail.com>
3610 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
3611 feature in parser only as we do in other cases.
3613 2008-01-21 Marek Safar <marek.safar@gmail.com>
3615 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
3616 typemanager.cs: A refactoring of params arguments to reuse existing
3617 expressions (params -> array initializer) to emit params argument instead
3618 of specialized handling.
3619 It was required by expression tree implementation and it has other benefits
3620 as well, we now apply same optimization for params arguments as we do for
3623 2008-01-18 Marek Safar <marek.safar@gmail.com>
3625 A fix for bug #353526
3626 * generic.cs: A type inference of params arguments may not required any
3627 temporary array creation.
3629 2008-01-18 Marek Safar <marek.safar@gmail.com>
3631 A fix for bug #353534
3632 * generic.cs, ecore.cs, expression.cs: A method group type inference is
3633 supported for delegates only.
3635 2008-01-18 Marek Safar <marek.safar@gmail.com>
3637 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
3638 type for more than 1 candidates.
3640 2008-01-18 Marek Safar <marek.safar@gmail.com>
3642 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
3645 2008-01-16 Marek Safar <marek.safar@gmail.com>
3647 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
3648 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
3649 operator) expressions.
3651 2008-01-16 Zoltan Varga <vargaz@gmail.com>
3653 * statement.cs: Avoid declaring an IL variable for this_variable since it is
3654 not accessed from the generated IL.
3656 2008-01-14 Marek Safar <marek.safar@gmail.com>
3658 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
3659 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
3660 statement.cs: The first expression tree implementation drop, mostly
3661 infrastructure work.
3663 2008-01-14 Marek Safar <marek.safar@gmail.com>
3665 * ecore.cs (IsNestedChild): Refactored.
3667 2008-01-11 Marek Safar <marek.safar@gmail.com>
3669 * lambda.cs: Don't use a cast on unknown expression statement.
3671 2008-01-10 Geoff Norton <gnorton@novell.com>
3673 * cs-tokenizer.cs: One more token to distinguish between method and lambda
3676 2008-01-09 Marek Safar <marek.safar@gmail.com>
3678 * doc.cs: Report better /doc crash details.
3680 2008-01-09 Marek Safar <marek.safar@gmail.com>
3682 A fix for bug #352536
3683 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
3685 2008-01-08 Marek Safar <marek.safar@gmail.com>
3687 A fix for bug #352287
3688 * ecore.cs, expression.cs: Do `this' access checking in all member access
3691 2008-01-08 Marek Safar <marek.safar@gmail.com>
3693 * rootcontext.cs, driver.cs: Switch to linq mode by default.
3695 * report.cs: Reset message stacks.
3697 2008-01-08 Marek Safar <marek.safar@gmail.com>
3699 * generic.cs (InferInPhases): Correctly calculate params position.
3701 2008-01-08 Marek Safar <marek.safar@gmail.com>
3703 * cs-tokenizer.cs: No need to parse full string when parsing lambda
3706 2008-01-07 Marek Safar <marek.safar@gmail.com>
3708 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
3710 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
3712 * driver.cs: Updated --help option.
3714 2008-01-07 Marek Safar <marek.safar@gmail.com>
3716 * generic.cs (InferParamsTypeArguments): Removed.
3717 (InferInPhases): Add params type inference.
3718 (LowerBoundInference): Fixed scoring mechanism.
3720 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
3722 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
3724 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
3725 byte array for unsigned "baked" assemblies.
3727 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
3729 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
3730 array for assemblies that are not strongnamed.
3732 2008-01-04 Marek Safar <marek.safar@gmail.com>
3734 A fix for bug #351481
3735 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
3736 declaring type for nested generic types.
3738 2008-01-04 Marek Safar <marek.safar@gmail.com>
3740 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
3741 instead of ToString.
3743 2008-01-03 Marek Safar <marek.safar@gmail.com>
3745 A fix for bug #351047
3746 * expression.cs (Binary.ResolveOperator): Allow equality operators between
3747 null and structs only when equality and inequality operators are defined
3748 either as an user-operators or predefined operators.
3750 2008-01-03 Marek Safar <marek.safar@gmail.com>
3752 A fix for bug #351047
3753 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
3755 2008-01-03 Marek Safar <marek.safar@gmail.com>
3757 A fix for bug #351257
3758 * cs-tokenizer.cs: Advance line number for '\r' correctly.
3760 2008-01-03 Marek Safar <marek.safar@gmail.com>
3762 A fix for bug #351157
3763 * class.cs (Using): Fixed yet another broken cloning.
3765 (Block): Put back more sensible default value for statements.
3767 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
3769 * codegen.cs: Allow AssemblyVersion with only major version component.
3772 2007-12-29 Marek Safar <marek.safar@gmail.com>
3774 A fix for bug #324654
3775 * class.cs: Use FullName property as member name.
3777 2007-12-28 Marek Safar <marek.safar@gmail.com>
3779 A fix for bug #342117
3780 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
3781 constructor constraint.
3783 2007-12-28 Marek Safar <marek.safar@gmail.com>
3785 A fix for bug #338273
3786 * class.cs (ProbertyBase): Access modifier checks are required for overrides
3789 2007-12-28 Marek Safar <marek.safar@gmail.com>
3791 A fix for bug #350839
3792 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
3794 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
3796 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3799 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
3801 * statement.cs: Changed some Hashtables to use HybridDictionaries
3802 instead. It was observed that some HashTables only contained a few
3803 items in the vast majority of cases. Since HybridDictionary is
3804 more efficient on small sets (<10 elements), "known_variables"
3805 from class ExplicitBlock as well as "labels" and "constants " from
3806 class Block were changed to HybridDictionaries.
3808 Atsai results: (56216kb->54987kb)
3810 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
3813 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
3815 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3818 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
3820 * expression.cs: foreach loop to for loop, saved on allocation of
3821 enumerator (59333kb->59141kb)
3823 * statement.cs. Changed foreach loops to for loops, saved on
3824 allocation of enumerator (59141kb->59006kb)
3826 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
3827 when constructed with no specified capacity. This was causing a
3828 few ArrayLists to allocate more memory than they would potentially
3829 need in the Block class and MemberCache class. Setting the
3830 ArrayLists to construct with a capacity of 1 saves some
3831 memory. (56216kb->55585kb)
3833 2007-12-27 Marek Safar <marek.safar@gmail.com>
3835 A fix for bug #347189 (2nd issue)
3836 * expression.cs (MemberAccess): Nested type can be found in base non-generic
3839 2007-12-27 Miguel de Icaza <miguel@novell.com>
3841 * report.cs: Do not use colors if stdout and stderr are not a
3844 2007-12-27 Marek Safar <marek.safar@gmail.com>
3846 A fix for bug #346998
3847 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
3850 2007-12-27 Marek Safar <marek.safar@gmail.com>
3852 A fix for bug #343465
3853 * class.cs: Explicit method name for nested types uses dots only.
3855 2007-12-27 Marek Safar <marek.safar@gmail.com>
3857 A fix for bug #343707
3858 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
3860 2007-12-27 Marek Safar <marek.safar@gmail.com>
3862 * ecore.cs: Report type inference errors only when arguments count matches
3865 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
3867 * expression.cs, report.cs: New warning.
3869 * typemanager.cs: Catch anonymous method type too.
3871 2007-12-23 Marek Safar <marek.safar@gmail.com>
3873 A fix for bug #346379
3874 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
3876 2007-12-23 Marek Safar <marek.safar@gmail.com>
3878 A fix for bug #347359
3879 * expression.cs (Invocation): Don't resolve already resolved expression.
3881 2007-12-23 Marek Safar <marek.safar@gmail.com>
3883 A fix for bug #347189
3884 * class.cs (FixedField): Use non-dependent code only in the define phase.
3886 2007-12-23 Marek Safar <marek.safar@gmail.com>
3888 A fix for bug #348076
3889 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
3891 2007-12-22 Marek Safar <marek.safar@gmail.com>
3893 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
3894 discovered extension methods.
3896 2007-12-22 Marek Safar <marek.safar@gmail.com>
3898 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
3901 2007-12-21 Miguel de Icaza <miguel@novell.com>
3903 * report.cs (ErrorMessage): Add support for using colors on
3904 terminals that support it.
3906 2007-12-21 Marek Safar <marek.safar@gmail.com>
3908 * ecore.cs: Use information about expanded params for error reporting.
3910 2007-12-21 Marek Safar <marek.safar@gmail.com>
3912 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
3913 and logic for params overloads.
3915 2007-12-15 Miguel de Icaza <miguel@novell.com>
3917 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
3918 as this is also created from the parser. Fixes #349034
3920 2007-12-12 Miguel de Icaza <miguel@novell.com>
3922 * statement.cs (Throw.CloneTo): it is valid to have empty
3923 expressions for throw.
3925 2007-12-03 Marek Safar <marek.safar@gmail.com>
3927 * cs-parser.jay: Set delegate constraint parsing region correctly.
3929 2007-12-03 Marek Safar <marek.safar@gmail.com>
3931 A fix for bug #345467
3932 * typemanager.cs (IsEqual): Compare generic parameters position only.
3934 2007-11-28 Marek Safar <marek.safar@gmail.com>
3936 * expression.cs (BaseAccess): Type arguments can be null.
3938 2007-11-27 Raja R Harinath <harinath@gmail.com>
3940 * statement.cs (Block.Resolve): Ensure flow-branching tree is
3941 consistent even when an error has occured.
3942 (Switch.Resolve): Likewise.
3944 2007-11-22 Marek Safar <marek.safar@gmail.com>
3946 A fix for bug #334505
3947 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
3950 2007-11-22 Marek Safar <marek.safar@gmail.com>
3952 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
3953 refactorings required to resolve extension methods correctly when mixing
3954 generics and non-generics members.
3956 2007-11-20 Marek Safar <marek.safar@gmail.com>
3958 A fix for bug #342584
3959 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
3962 2007-11-19 Marek Safar <marek.safar@gmail.com>
3964 A fix for bug #342512
3965 * delegate.cs: Use delegate argument expression when is available. Don't
3966 emit virtual call when class is sealed.
3968 2007-11-16 Marek Safar <marek.safar@gmail.com>
3970 A fix for bug #325423
3971 * assign.cs (FieldInitializer): Use resolved expression for emit.
3973 * class.cs: Print less confusing error message.
3975 2007-11-16 Marek Safar <marek.safar@gmail.com>
3977 * cs-tokenizer.cs: Removed GMCS ifdefs.
3979 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
3982 * cs-parser.jay: Disabled nullable check.
3984 * generic-mcs: Copied more generic stuff.
3986 2007-11-16 Marek Safar <marek.safar@gmail.com>
3988 * gcs-parser.jay: Merged to cs-parser.jay.
3990 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
3991 * *.csproj, *.sources: Updated to use only jay parser file.
3993 2007-11-16 Marek Safar <marek.safar@gmail.com>
3995 * gcs-parser.jay: Added nullable and default expression feature checks.
3997 2007-11-16 Marek Safar <marek.safar@gmail.com>
3999 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
4000 it fixes many TODOs and hidden bugs.
4002 * expression: Removed duplicate error check.
4004 2007-11-15 Marek Safar <marek.safar@gmail.com>
4006 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
4007 implicitly type local variable only when it is used in a declaration.
4009 2007-11-15 Marek Safar <marek.safar@gmail.com>
4011 * attribute.cs: Use CS0612 for empty strings.
4013 2007-11-14 Marek Safar <marek.safar@gmail.com>
4015 * lambda.cs, statement.cs: Contextual return may act as a statement.
4017 2007-11-14 Marek Safar <marek.safar@gmail.com>
4019 A fix for a regression cause by #324222
4020 * class.cs: Don't report unused even when it implements an interface.
4022 2007-11-13 Marek Safar <marek.safar@gmail.com>
4024 A fix for bug #341205
4025 * ecore.cs, expression.cs: Method group expression cannot do static
4026 method access with an instance reference check before overloading takes
4029 2007-11-13 Marek Safar <marek.safar@gmail.com>
4031 A fix for bug #325359
4032 * class.cs: Use predictable name for automatically generated property.
4034 2007-11-12 Marek Safar <marek.safar@gmail.com>
4036 A fix for bug #324996
4037 * expression.cs (Is): Handle case where D is nullable and T is not
4040 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
4042 2007-11-12 Marek Safar <marek.safar@gmail.com>
4044 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
4045 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
4046 Flush small error reporting changes.
4048 2007-11-09 Marek Safar <marek.safar@gmail.com>
4050 A fix for bug #324996
4051 * expression.cs: Rewrote Is expression implementation to work with
4052 generics, nullable types, anonymous method. A const result expression
4053 uses existing infrastructure instead of custom not fully-featured one.
4055 2007-11-08 Marek Safar <marek.safar@gmail.com>
4057 A fix for bug #340202
4058 * class.cs: Consider generics for volatile field.
4060 2007-11-08 Marek Safar <marek.safar@gmail.com>
4062 A fix for bug #335594
4063 * expression.cs: Use conversion rules when handling string addition.
4065 2007-11-07 Marek Safar <marek.safar@gmail.com>
4067 A fix for bug #336651
4068 * expression.cs: Fixed a crash when probing is on.
4070 2007-11-07 Marek Safar <marek.safar@gmail.com>
4072 A fix for bug #324242
4073 * covert.cs: Added a conversion from any nullable-type with an
4074 underlying enum-type to the type System.Enum.
4076 2007-11-07 Marek Safar <marek.safar@gmail.com>
4078 A fix for bug #324222
4079 * class.cs: Report all non-used event fields.
4081 2007-11-07 Marek Safar <marek.safar@gmail.com>
4083 A fix for bug #325161
4084 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
4085 qualifier for generic types.
4087 2007-11-07 Marek Safar <marek.safar@gmail.com>
4089 A fix for bug #322971
4090 * expression.cs, ecore.cs: Added intermediate result value check for
4093 2007-11-07 Marek Safar <marek.safar@gmail.com>
4095 A fix for bug #324754
4096 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
4097 when it was requested.
4099 2007-11-07 Marek Safar <marek.safar@gmail.com>
4101 A fix for bug #325101
4102 * expression.cs: Do type not value comparison for `is' expression.
4104 2007-11-07 Marek Safar <marek.safar@gmail.com>
4106 A fix for bug #320236
4107 * convert.cs: Don't apply user conversion on underlying target type.
4109 2007-11-06 Marek Safar <marek.safar@gmail.com>
4111 * expression.cs: Don't use unresolved expression for error reporting.
4113 2007-11-06 Marek Safar <marek.safar@gmail.com>
4115 A fix for bugs #337712, #324490
4116 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
4117 overloading resolution too.
4119 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
4120 the process consistent and more robust.
4122 * expression.cs, linq.cs, report.cs: Update.
4124 2007-11-02 Marek Safar <marek.safar@gmail.com>
4126 A fix for bug #332909
4127 * attribute.cs: Resolve attributes in correct context using error
4130 * rootcontext.cs: Define Obsolete attribute members as core members.
4132 2007-11-02 Marek Safar <marek.safar@gmail.com>
4134 * statement.cs: Removed unused methods.
4136 2007-10-31 Wade Berrier <wberrier@novell.com>
4138 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
4139 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
4142 2007-10-31 Marek Safar <marek.safar@gmail.com>
4144 A fix for bug #338102
4145 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
4146 methods registered as non-generics.
4148 2007-10-31 Marek Safar <marek.safar@gmail.com>
4150 A fix for bugs #337712, #324490
4151 * delegate.cs: Delegate covariance and contravariance is not allowed for
4154 2007-10-31 Marek Safar <marek.safar@gmail.com>
4156 A fix for bug #337719
4157 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
4160 2007-10-30 Marek Safar <marek.safar@gmail.com>
4162 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
4164 2007-10-29 Marek Safar <marek.safar@gmail.com>
4166 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
4169 2007-10-29 Raja R Harinath <rharinath@novell.com>
4171 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
4173 2007-10-29 Marek Safar <marek.safar@gmail.com>
4175 A fix for bug #334652
4176 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
4177 extension methods when we have not found the best candidate in normal
4180 2007-10-27 Marek Safar <marek.safar@gmail.com>
4182 * AssemblyInfo.cs: Keep up-to-date.
4184 2007-10-27 Marek Safar <marek.safar@gmail.com>
4186 * Makefile: Fixed generics compiler name.
4188 2007-10-27 Marek Safar <marek.safar@gmail.com>
4190 * lambda.test: removed, lambda parsing is done differently.
4192 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
4194 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
4196 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
4198 2007-10-27 Marek Safar <marek.safar@gmail.com>
4200 * Makefile, *.sources : All C# compilers are in mcs folder.
4202 * *.cs: Use existing 2_1 define for smcs.
4204 2007-10-26 Marek Safar <marek.safar@gmail.com>
4206 A fix for bug #335847
4207 * assign.cs, expression.cs: Couple of changes to avoid creating a
4208 temporary variable for each object initializer assignment statement. It
4209 simplifies struct initialization too, otherwise two temporary variables
4211 Implemented optimization of redundant default element initializers.
4213 2007-10-25 Marek Safar <marek.safar@gmail.com>
4215 A fix for bug #336766
4216 * expression.cs (Class.CheckBase): Use generic name when method is
4219 2007-10-25 Marek Safar <marek.safar@gmail.com>
4221 A fix for bug #334737
4222 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
4223 variable and not variable argument for prepared copies.
4225 2007-10-24 Marek Safar <marek.safar@gmail.com>
4227 A fix for bug #325110
4228 * class.cs, expression.cs, attribute.cs: Use open generic method when
4229 checking conditional attribute.
4231 2007-10-24 Marek Safar <marek.safar@gmail.com>
4233 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
4234 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
4235 FeatureIsNotAvailable.
4237 2007-10-24 Marek Safar <marek.safar@gmail.com>
4239 ** C# 3.0 Partial methods
4241 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
4242 methods support. Because of member cache issue with generics only
4243 non-generics partial methods are fully supported.
4245 2007-10-23 Marek Safar <marek.safar@gmail.com>
4247 * class.cs, decl.cs: Rewrote member overloads check to cope with
4248 generics and to use member cache for member checking. It also improves
4249 performance and fixes remaining overloads issues.
4251 2007-10-20 Marek Safar <marek.safar@gmail.com>
4253 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
4254 roottypes.cs, typemanager.cs:
4256 A member cache creation logic changed to add members immediately and
4257 not rely on fallback. The member cache is now only prefered way
4258 how to access and find type declaration members. It saves 5 MB of memory
4259 during MWF compilation and makes code ready for more optimizations and
4260 clean-ups, it's also a pre-requirement for partial methods.
4262 2007-10-18 Raja R Harinath <harinath@gmail.com>
4264 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
4265 handling for generic parameters.
4267 2007-10-15 Marek Safar <marek.safar@gmail.com>
4269 * class.cs (FixedField): Removed redundant volatile check.
4271 2007-10-15 Marek Safar <marek.safar@gmail.com>
4273 * class.cs, decl.cs: Fixed overload members verification to do only one
4274 check per possible collision.
4276 2007-10-13 Marek Safar <marek.safar@gmail.com>
4278 A fix for bug #325478
4279 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
4280 and create only one disposable flags container.
4282 2007-10-12 Marek Safar <marek.safar@gmail.com>
4284 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
4285 * statement.cs (Fixed): Fixed variables cloning.
4287 2007-10-12 Marek Safar <marek.safar@gmail.com>
4289 A fix for bug #333342
4290 * class.cs (EventField): Don't mark value type event as synchronized.
4292 2007-10-12 Marek Safar <marek.safar@gmail.com>
4294 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
4295 inference to identify best candidate method correctly.
4296 (ProperyExpr): A range variable is read only and cannot be modified.
4298 2007-10-11 Marek Safar <marek.safar@gmail.com>
4300 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
4301 logic to identify best candidate method correctly.
4303 2007-10-11 Marek Safar <marek.safar@gmail.com>
4305 * location.cs (Equals, GetHashCode): Removed.
4307 2007-10-11 Marek Safar <marek.safar@gmail.com>
4309 * report.cs: Implemented message recorder. It is used mainly for lambda
4310 expressions to capture otherwise swallowed error messages.
4312 * anonymous.cs, lambda.cs.cs: Do full parameters check.
4314 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
4316 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
4318 * expression.cs (MemberAccess): Always report lookup failure.
4320 * location.cs: Implemented Equals, GetHashCode.
4322 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
4324 2007-10-10 Jb Evain <jbevain@novell.com>
4326 * codegen.cs: re-enable assembly version check.
4328 2007-10-09 Marek Safar <marek.safar@gmail.com>
4330 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
4333 * namespace.cs (UsingAlias): Do correct version check.
4335 2007-10-08 Marek Safar <marek.safar@gmail.com>
4337 * expresison.cs, ecore.cs: Issue extension method error message when
4340 * rootcontext.cs: Added ISO_2 compiler mode option.
4342 2007-10-08 Marek Safar <marek.safar@gmail.com>
4344 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
4347 2007-10-08 Marek Safar <marek.safar@gmail.com>
4349 * attribute.cs (GetString, GetBoolean): Work with both literal and
4352 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
4353 Moved method overload specific methods to MethodGroupExpr.
4355 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
4356 it should be less memory consuming.
4358 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
4360 * codegen.cs: remove the assembly version check until the buildbot is
4363 2007-10-07 Jb Evain <jbevain@novell.com>
4365 * attribute.cs (Attribute.GetString): if the value
4366 expression is a StringConstant, return its string value.
4368 2007-10-07 Jb Evain <jbevain@novell.com>
4370 * typemanager.cs: add `assembly_version_attribute_type`.
4371 * codegen.cs: on attribute emission, check that the
4372 AssemblyVersionAttribute doesn't overflow.
4374 2007-10-05 Marek Safar <marek.safar@gmail.com>
4376 A fix for bug #324677
4377 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
4378 parent container of a scope container with currently resolved one.
4380 2007-10-05 Marek Safar <marek.safar@gmail.com>
4382 A fix for bug #325534
4383 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
4386 2007-10-05 Marek Safar <marek.safar@gmail.com>
4388 A fix for bug #327504
4389 * class.cs (Operator.Define): Refactored implicit and explicit user
4390 operator conversion rules.
4392 2007-10-05 Marek Safar <marek.safar@gmail.com>
4394 A fix for bug #327520
4395 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
4397 2007-10-04 Marek Safar <marek.safar@gmail.com>
4399 A fix for bug #328022
4400 * class.cs (MethodData.Define): Use correct method to check whether
4401 a method implementents an accessor.
4403 2007-10-04 Marek Safar <marek.safar@gmail.com>
4405 A fix for bug #330069
4406 * statement.cs (Fixed.Resolve): Read the first array element only when
4407 an array is instantiated.
4409 2007-10-04 Marek Safar <marek.safar@gmail.com>
4411 * expression.cs, assign.cs, generics.cs: Print correct operator when
4412 compound assignment is used.
4414 2007-10-04 Marek Safar <marek.safar@gmail.com>
4416 A fix for bug #325841
4417 * expression.cs (ArrayAccess): Use full argument cloning only for
4418 string compound concatenation.
4420 2007-10-03 Marek Safar <marek.safar@gmail.com>
4422 A fix for bug #328774
4423 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
4425 (PropertyExpr.EmitAssign): Fixed string concatenation compound
4428 2007-10-03 Raja R Harinath <rharinath@novell.com>
4431 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
4432 Event accessibility checks here. Remove some bogus code that
4433 accidently made GenericMethods work.
4434 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
4436 2007-09-25 Marek Safar <marek.safar@gmail.com>
4438 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
4440 * statement.cs (Block): Refactored AddVariable to allow error handling
4443 * generic.cs: New stub.
4445 2007-09-23 Marek Safar <marek.safar@gmail.com>
4447 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
4450 2007-09-17 Marek Safar <marek.safar@gmail.com>
4452 * class.cs: Use partial container to record whether any partial part
4453 contains static field initializer and therefore default contructor has
4456 2007-09-14 Marek Safar <marek.safar@gmail.com>
4458 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
4459 mono-list when only one of two partial parts has defined accessibility
4462 2007-09-14 Marek Safar <marek.safar@gmail.com>
4464 A fix for bug #82845
4466 * class.cs (TypeContainer): Set correct resolve context for all field
4469 2007-09-13 Marek Safar <marek.safar@gmail.com>
4471 * assign.cs: Fixed a crash when field is resolved twice with an error.
4473 * codegen.cs: Changed InFieldInitializer to be flag.
4475 * anonymous.cs, ecore.cs, expression.cs: Update after
4476 IsInFieldInitializer rename.
4478 * const.cs: Removed unused parameter.
4480 * class.cs: Changed the way how we resolve and emit field initializers.
4481 The field initilizers have to have access to contructor block to emit
4482 compiler generated code.
4484 2007-09-13 Marek Safar <marek.safar@gmail.com>
4486 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
4487 generics use TypeContainer instead.
4489 2007-09-12 Marek Safar <marek.safar@gmail.com>
4491 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
4493 * lambda.cs (ResolveParameters): Use more powerful
4494 InflateGenericArgument.
4496 * parameters.cs: Better exception message.
4498 2007-09-10 Marek Safar <marek.safar@gmail.com>
4500 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
4501 correct expression block type.
4503 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
4505 * expression.cs (Invocation): Extracted method group resolve to
4508 2007-09-07 Marek Safar <marek.safar@gmail.com>
4510 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
4511 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
4513 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
4514 generic extension methods.
4516 2007-09-06 Marek Safar <marek.safar@gmail.com>
4518 A fix for bug #82676 (Do I get it right now?)
4519 * convert.cs (Binary.ResolveOperator): An interface is converted to the
4520 object before a standard conversion is applied.
4522 2007-09-06 Marek Safar <marek.safar@gmail.com>
4524 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
4527 2007-09-05 Marek Safar <marek.safar@gmail.com>
4529 A fix for bug #82676
4530 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
4531 non-generic interface types.
4533 2007-09-05 Marek Safar <marek.safar@gmail.com>
4535 A fix for bug #82690
4536 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
4538 2007-09-05 Marek Safar <marek.safar@gmail.com>
4540 A fix for bug #82571
4541 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
4542 modifier for container based methods.
4544 2007-09-05 Marek Safar <marek.safar@gmail.com>
4546 A fix for bug #82676
4547 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
4548 any interface-type T means to any of interface type T.
4550 2007-09-04 Marek Safar <marek.safar@gmail.com>
4552 * namespace.cs: We have 2 versions of System.Core assembly.
4554 2007-09-04 Marek Safar <marek.safar@gmail.com>
4556 A fix for bug #82652
4557 * class.cs (Class.GetClassBases): Compare types and not expressions.
4559 2007-09-04 Marek Safar <marek.safar@gmail.com>
4561 A fix for bug #82620
4562 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
4563 actually never worked before.
4564 (IndexerAccess): Emit prepared arguments before they are modified.
4566 2007-09-04 Marek Safar <marek.safar@gmail.com>
4568 A fix for bug #82563
4569 * assign.cs: Revert wrong fix.
4571 * expression.cs (VariableReference.EmitAssign): Handle ref reference
4573 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
4574 Instead of ldelema/stdind we have to use temporary variables to handle
4575 cases like String.Concat (params string[]).
4577 2007-08-31 Marek Safar <marek.safar@gmail.com>
4579 * class.cs: EmitAttributes to Emit rename.
4581 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
4583 (MemberCore.HasClsCompliantAttribute): Don't depend on
4584 GetClsCompliantAttributeValue execution.
4586 2007-08-31 Marek Safar <marek.safar@gmail.com>
4588 * anonymous.cs: Use shorter type prefix.
4590 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
4593 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
4594 variables when probing is on.
4596 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
4597 unresolved variables.
4598 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
4599 handle transparent identifiers.
4601 2007-08-26 Marek Safar <marek.safar@gmail.com>
4603 * attribute.cs (IsClsCompliant): Add nullable types test.
4605 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
4607 * doc.cs : catch other types of exception than XmlException to
4608 report CS1570. Fixed bug #82565.
4610 2007-08-23 Marek Safar <marek.safar@gmail.com>
4612 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
4613 The number of delegate parameters has to match.
4614 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
4617 2007-08-21 Marek Safar <marek.safar@gmail.com>
4619 * anonymous.cs (AnonymousMethod): Generate private anonymous method
4620 to fix problem with private arguments.
4622 2007-08-20 Marek Safar <marek.safar@gmail.com>
4624 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
4626 * decl.cs (MemberName): Ignore generic type with no generic arguments.
4628 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
4629 empty. Add cloning suport.
4631 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
4633 2007-08-20 Marek Safar <marek.safar@gmail.com>
4635 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
4636 to create EmptyCast. It handles EmptyConstantCast specialization for
4639 2007-08-18 Marek Safar <marek.safar@gmail.com>
4641 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
4642 (EmitArrayArgument): One routine for array arguments.
4643 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
4645 2007-08-17 Marek Safar <marek.safar@gmail.com>
4647 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
4649 2007-08-17 Marek Safar <marek.safar@gmail.com>
4651 * anonymous.cs: MemberLookupFinal update.
4653 * class.cs (ConstructorInitializer): Is expression based.
4655 * delegate.cs: MethodGroupExpr update.
4657 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
4659 (Error_MemberLookupFailed): Customizable error override.
4660 (MethodGroupExpr): Keep queried type for later usage.
4661 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
4664 * expression.cs: Error_MemberLookupFailed refactoring.
4665 (New.DoResolve): Resolve as much as possible.
4666 (ElementInitializer.Error_MemberLookupFailed): Object initializer
4667 customization for invalid member types.
4669 * statement.cs: MethodGroupExpr update.
4671 2007-08-16 Marek Safar <marek.safar@gmail.com>
4673 * modifier.cs (Check): Check all modifiers and not only accessibility
4676 2007-08-16 Marek Safar <marek.safar@gmail.com>
4678 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
4679 type and not an expression.
4681 2007-08-16 Marek Safar <marek.safar@gmail.com>
4683 * statement.cs (Catch.Clone): Type and variable can be null.
4685 2007-08-16 Marek Safar <marek.safar@gmail.com>
4687 A fix for bug #81979
4688 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
4689 I am really not sure whether this is the best fix.
4691 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
4694 2007-08-14 Marek Safar <marek.safar@gmail.com>
4696 ** C# 3.0 Object and collection initializers (major re-write)
4698 * assign.cs (DoResolve): Initializers are not assign related.
4700 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
4701 used during collection or object initialization.
4703 * expression.cs (Error_InvalidArguments): Add initializers specific
4704 messages. More will come later because it requires some general
4706 (New.DoResolve): Better error handling for unsafe types.
4707 (EmptyExpressionStatement): New class.
4708 (ElementInitializer): An object initializer expression.
4709 (CollectionElementInitializer): A collection initializer expression.
4710 (CollectionOrObjectInitializers): A block of object or collection
4712 (NewInitialize): New expression with element/object initializers.
4714 * statement.cs: Reverted object/collection initializer hacks.
4716 * typemanager.cs (CSharpName): Filter __arglist type.
4718 2007-08-09 Marek Safar <marek.safar@gmail.com>
4720 ** C# 3.0 Anonymous Types (update to the latest standard)
4722 * expression.cs (Binary.ResolveOperator): Threat all null based types
4724 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
4725 (AnonymousTypeParameter): Updated.
4727 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
4728 (AnonymousTypeClass): New anonymous type container.
4730 * class.cs (AddField): Return operation result.
4732 * generic.cs: Another empty TypeArguments overload.
4734 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
4735 are stored at top of normal hierarchy.
4737 * typemanager.cs (CSharpName): Filter anonymous types.
4739 2007-08-09 Marek Safar <marek.safar@gmail.com>
4741 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
4742 as single Concat call. How could we miss that :-(
4744 2007-08-08 Marek Safar <marek.safar@gmail.com>
4746 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
4748 2007-08-07 Miguel de Icaza <miguel@novell.com>
4750 * expression.cs: Fix the previous commit, the creation of the
4751 arguments array list needs also to be conditional on the arguments
4754 * class.cs: Add a little bit of help to help narrow down problems.
4756 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
4757 not try to copy in that case.
4759 * driver.cs: When building SMCS, include a new different set of
4760 default assemblies here. Do this here so we can control whether
4761 to include the default assemblies with /noconfig.
4763 2007-08-03 Marek Safar <marek.safar@gmail.com>
4765 A fix for bug #81979
4766 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
4769 2007-08-03 Marek Safar <marek.safar@gmail.com>
4771 A fix for bug #82300
4773 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
4774 we are in probing scope.
4776 2007-08-03 Marek Safar <marek.safar@gmail.com>
4778 A fix for bug #82301
4780 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
4781 (Statement.CloneTo): Clone and not map children blocks.
4783 2007-08-03 Marek Safar <marek.safar@gmail.com>
4785 A fix for bug #82299
4787 * expression.cs (LocalVariableReference.CloneTo): Remap local info
4790 * statement.cs (Statement.CloneTo): Clone variables before statements
4791 to allow remaping of local variables.
4793 2007-08-03 Marek Safar <marek.safar@gmail.com>
4795 A fix for bug #82296
4798 * report.cs: Log crash details for future clone problems.
4800 * statement.cs (Return.Clone): Don't clone non-existent expression.
4802 2007-08-03 Raja R Harinath <harinath@gmail.com>
4804 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
4805 (Class.AddBasesForPart): Move CS0537 check here from ...
4806 * cs-parser.jay (class_declaration): ... here. Move calling of
4807 'AddBasesForPart' to ...
4808 (class_bases): ... here.
4809 (struct_declaration, interface_declaration): Update to changes.
4811 2007-08-02 Marek Safar <marek.safar@gmail.com>
4813 A fix for bug #81923
4815 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
4816 conversion is allowed.
4818 2007-08-02 Marek Safar <marek.safar@gmail.com>
4820 A fix for bug #81564
4822 * ecore.cs (EventExpr): Add IsBase handling.
4824 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
4827 2007-08-02 Raja R Harinath <harinath@gmail.com>
4829 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
4830 * cs-parser.jay: Some whitespace cleanups.
4831 (current_delegate): New.
4833 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
4834 a dummy code block, and use 'type_name' instead of 'member_name'.
4835 (interface_declaration, class_declaration): Likewise.
4836 (delegate_declaration): Likewise. Rearrange slightly and use
4838 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
4839 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
4841 2007-08-02 Marek Safar <marek.safar@gmail.com>
4843 A fix for bug #82039
4845 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
4848 * typemanager.cs (CSharpName): Split to string overload.
4850 2007-08-02 Marek Safar <marek.safar@gmail.com>
4853 * report.cs: Updated warning CS0472.
4855 2007-08-01 Marek Safar <marek.safar@gmail.com>
4857 A fix for bug #82181
4859 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
4861 2007-08-01 Marek Safar <marek.safar@gmail.com>
4863 A fix for bug #82277
4864 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
4866 2007-08-01 Marek Safar <marek.safar@gmail.com>
4868 ** C# 3.0 Type Inference (major bits are working)
4870 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
4871 (.ImplicitStandardConversionExists): Uses compatible.
4872 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
4873 (.InferReturnType): New method.
4874 (.Compatible): Refactored.
4875 (.ResolveParameters): Uses factory to create resolved parameters.
4876 (.CompatibleMethod): Add probing mode support.
4877 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
4878 clearly distinguish between 2 different operations.
4879 (LambdaMethod): Moved to lambda.cs.
4880 (AnonymousMethod): Removed unused fields and methods.
4881 (AnonymousDelegate): Simplified.
4883 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
4885 * convert. cs (ImplicitConversionStandard): Compatible works differently.
4887 * delegate.cs (Delegate): New mehods to reduce code duplication.
4888 (.GetConstructor): New method.
4889 (.GetInvokeMethod): New method.
4890 (DelegateCreation): Updated.
4892 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
4894 (OverloadResolve): Made probing little bit faster.
4896 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
4899 * generic.cs (TypeInferenceContext): Dummy implementation.
4901 * iterators.cs: Updated after Resolve/Define rename.
4903 * lambda.cs (LambdaExpression)
4904 (.ResolveParameters): Handles both type of arguments and type inference too.
4906 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
4907 (InflateTypes): Updated.
4909 * support.cs (InflateTypes): Changed signature and updated.
4911 * typemanager.cs (LookupMemberCache): Better dynamic type check.
4912 (MemberLookup_FindMembers): More MS tricks.
4913 (GetParameterData): Ditto.
4914 (GetDelegateParameters): Uses quick path for dynamic types.
4916 2007-08-01 Marek Safar <marek.safar@gmail.com>
4918 * class.cs (MethodData.Define): EmitContext is required for generic stuff
4921 2007-07-31 Marek Safar <marek.safar@gmail.com>
4923 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
4926 2007-07-26 Jb Evain <jbevain@novell.com>
4928 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
4929 which takes a boolean 'report_errors', similar to the GetMethod.
4930 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
4931 in .net 2.1, do not report errors here.
4933 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
4934 System.Runtime.CompilerServices.RequiredAttributeAttribute and
4935 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
4938 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
4939 of the type InternalsVisibleToAttribute before the first call
4940 to CoreLookupType which is allowed to fail (third boolean parameter
4941 to true). Because, during the resolution for a type that is not
4942 immediately found, we try to check if the type is not defined in
4943 a friend assembly, and to do so, we need the
4944 InternalVisibleToAttribute.
4946 2007-07-23 Miguel de Icaza <miguel@novell.com>
4948 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
4949 feature that allows structs to be compared against null and inline
4950 the result as true or false.
4952 Notice that the same code is not permitted inside a generic block
4953 of code that would do:
4955 class Foo<T> where T : struct {
4962 It is only allowed if the type of T is not bound (no where
4963 clause). In my opinion, this CSC 2 behavior is broken but people
4964 seem to be using it (IronRuby does, a few bug reports on bugzilla
4965 have it and some people have complained about it).
4967 All of the users that depend on this behavior have code that is
4970 * report.cs (Warning, Error): make these take object arguments,
4971 not strings, as that allows us to take advantage of Format.
4973 2007-07-20 William Holmes <billholmes54@gmail.com>
4975 * decl.cs: Changed MemberName.CountTypeArguments to also check the
4976 Left member variable for the Count.
4977 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
4978 MemberName.CountTypeArguments to avoid a NRE.
4980 This code is contributed under the MIT X11 license
4982 2007-07-18 Marek Safar <marek.safar@gmail.com>
4984 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
4986 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
4988 * doc.cs : generic method arguments are written as ``x while generic
4989 type arguments are `x. Combined with the previous change, fixed bug
4992 2007-07-18 Raja R Harinath <rharinath@novell.com>
4995 * expression.cs (Binary.ResolveOperator): When converting
4996 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
4998 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
5000 * doc.cs : when T: or whatever x: is specified, it does not really
5001 check the doc comment's syntax correctness. Fixed bug #82006.
5003 2007-07-18 Marek Safar <marek.safar@gmail.com>
5005 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
5006 LambdaExpression better.
5008 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
5010 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
5012 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
5013 as it can be generated.
5015 * expression.cs (Invocation.Error_InvalidArguments): Show correct
5018 * lambda.cs (LambdaExpression): Refactored to share same code with
5019 AnonymousMethodExpression.
5021 2007-07-17 Marek Safar <marek.safar@gmail.com>
5023 * anonymous.cs (MakeName): Include host name for easier debugging.
5024 (LambdaMethod): New class for lambda spcecific stuff.
5026 * attribute.cs: Set EmitContext return type.
5028 * class.cs: Set EmitContext return type.
5030 * codegen.cs (EmitContext): Return type cannot be null to stop messing
5031 with null/void meaning.
5033 * iterators.cs (ContainerType): Implemented.
5035 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
5037 * statement.cs (Return): Updated to lambda expressions.
5038 (Block.CloneTo): Parent can be null.
5040 2007-07-13 Marek Safar <marek.safar@gmail.com>
5042 A fix for bug #81917
5043 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
5045 * class.cs (FixedField): Check whether field is in unsafe scope.
5047 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
5048 (FieldExpr.Emit): Fixed buffers cannot be volatile.
5050 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
5053 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
5055 2007-07-13 Marek Safar <marek.safar@gmail.com>
5057 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
5058 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
5061 2007-07-13 Marek Safar <marek.safar@gmail.com>
5063 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
5065 2007-07-13 Marek Safar <marek.safar@gmail.com>
5067 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
5068 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
5070 * codegen.cs(EmitContext): Add ProbingMode flag.
5072 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
5074 * driver.cs: For now set both warning values.
5076 * ecore.cs (SimpleName): Name is readonly.
5077 (MethodGroup.OverloadResolve): One quick path for probing.
5079 * expression.cs (Unary): Set Oper r/o.
5080 (Binary): Set Oper r/o.
5081 (ParameterReference): Set few instance variables as r/o.
5082 (ParameterReference.DoResolveBase): Don't capture aruments when
5084 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
5085 (Arglist): arguments are private.
5086 (SizeOf): type is private and r/o.
5087 (MemberAccess): arguments are private.
5089 * report.cs: Enhanced reporting on/off capabilities.
5091 * lambda.cs: Uses ec.IsInProbingMode.
5092 (ContextualReturn): Derives from return.
5094 * rootcontext.cs: For now set both warning values.
5096 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
5098 (Return.Resolve): Don't die immediately.
5099 (Block.Resolve): Speed-up probing.
5100 (Block.CloneTo): Clone only child blocks.
5102 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
5104 * iterators.cs: reverted Miguel's latest change (r81925) as it
5105 breaks the build in System.
5107 2007-07-13 Miguel de Icaza <miguel@novell.com>
5109 * iterators.cs (Yield.CheckContext): Check for the iterator type
5110 also here as we can call into Yield even in codepaths that are not
5112 (MethodOrOperator is the only path that was checked).
5114 In addition to the standard check, use a more specific check for
5115 constructors to report a more verbose error.
5117 2007-07-12 Miguel de Icaza <miguel@novell.com>
5119 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
5120 report the warning and continue
5122 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
5123 values on the stack on the call to Emit. Use EmitStatement if
5124 possible, or using Emit + Pop if not possible. Fixes #82064
5126 2007-07-12 Raja R Harinath <rharinath@novell.com>
5128 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
5129 avoid try...finally in some cases.
5131 2007-07-10 Marek Safar <marek.safar@gmail.com>
5133 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
5135 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
5136 instead of method. Re-use standard error handling.
5137 (ConstructorInitializer.Emit): Simplified.
5139 * delegate.cs: Updated after Invocation.EmitCall change.
5141 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
5142 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
5143 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
5144 method and don't permanently changing input arguments.
5145 (MethodGroupExpr): Introduced resolved best_candidate, when method group
5146 is resolved it has one of the candidates is the best one which is later
5147 used to emit. Removed a few unused method.
5148 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
5150 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
5151 (Binary.ResolveOperator): Ditto.
5152 (ConditionalLogicalOperator.DoResolve): Ditto.
5153 (Invocation): Uses method group.
5154 (Invocation.DoResolve): Simplified.
5155 (Invocation.EmitCall): Removed useless is_static.
5156 (Invocation.Emit): Delegate to method group.
5157 (Invocation.EmitStatement): Simplified.
5158 (New): Uses method group.
5159 (MemberAccess.DoResolve): Don't destroy original expression.
5161 * statement.cs (ForEach.Resolve): Use null for no method arguments.
5163 2007-07-04 Marek Safar <marek.safar@gmail.com>
5165 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
5168 * lambda.cs: Add custom error message type.
5170 2007-07-03 Marek Safar <marek.safar@gmail.com>
5172 * lambda.cs: Simplified little bit.
5174 * parameter.cs: Introduced ImplicitLambdaParameter.
5175 (Parameters.CreateFullyResolved): New factory instead of ctor.
5179 * delegate.cs: Updated parameter creation.
5181 2007-07-03 Marek Safar <marek.safar@gmail.com>
5183 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
5186 * generic.cs: Synchronized with gmcs.
5188 2007-07-03 Marek Safar <marek.safar@gmail.com>
5190 * class.cs (Indexer): Check return type as soon as possible.
5192 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
5195 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
5197 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
5199 * parameter.cs (Parameter): Use expression type when it is available.
5201 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
5202 method modifier for the first parameter only.
5204 2007-06-24 Marek Safar <marek.safar@gmail.com>
5206 A fix for bug #81938
5207 * typemanager.cs (ChangeType): Fixed couple of char conversions.
5209 * constant.cs: Tide up an exception message.
5211 2007-06-22 Marek Safar <marek.safar@gmail.com>
5213 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
5214 an uninitialized variable is used.
5216 * expression.cs (LocalVariableReference.DoResolve): Ditto.
5218 2007-06-22 Marek Safar <marek.safar@gmail.com>
5220 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
5221 not found error handling.
5223 * expression.cs (ArrayCreation): Removed redundant fields and little bit
5225 (ArrayCreation.ResolveArrayElement): To be ready to customization.
5226 (ArrayCreation.DoResolve): Simplified.
5227 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
5228 its own resolve process.
5229 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
5231 2007-06-20 Marek Safar <marek.safar@gmail.com>
5233 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
5236 2007-06-20 Marek Safar <marek.safar@gmail.com>
5238 * cs-tokenizer.cs: Removed var related stuff.
5240 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
5241 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
5242 a type and a keyword at same time.
5244 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
5247 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
5248 implicitly typed arrays, more changes will follow.
5250 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
5252 2007-06-19 Marek Safar <marek.safar@gmail.com>
5254 * ecore.cs (VarExpr): Removed Handled field.
5256 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
5257 build-in assign functionality.
5258 (ForEach.Resolve): Removed all implicitly typed local variable code and
5260 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
5261 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
5263 2007-06-18 Marek Safar <marek.safar@gmail.com>
5265 * assign.cs: Removed implicitly typed local variable check.
5267 * expression.cs (LocalVariableReference.DoResolve): Add check for self
5268 referencing implicitly typed local variable.
5269 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
5272 * statement.cs (Fixed): Removed unsupported implicitly typed local
5275 2007-06-15 Marek Safar <marek.safar@gmail.com>
5277 * decl.cs (MemberName): Moved all Unbound stuff to parser.
5279 2007-06-14 Marek Safar <marek.safar@gmail.com>
5281 A fix for bugs #81855 and #76274
5282 * attribute.cs (AttachTo): Always set owner for global attributes to
5285 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
5288 * cs-parser.jay: Assembly and module attributes must precede all other
5289 elements except using clauses and extern alias declarations.
5291 2007-06-13 Marek Safar <marek.safar@gmail.com>
5293 A fix for bug #81748
5295 * expression.cs: More checks for non ISO-1 features.
5297 2007-06-12 Marek Safar <marek.safar@gmail.com>
5299 A fix for bug #81807
5300 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
5301 present inside switch statement and it is required by nullable check.
5303 2007-06-12 Marek Safar <marek.safar@gmail.com>
5305 A fix for bug #81840
5306 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
5307 when type matching fails.
5309 * namespace.cs: Tiny error message change.
5311 2007-06-12 Marek Safar <marek.safar@gmail.com>
5313 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
5314 reporting. Added automatic property check.
5316 * class.cs: Updated after CheckAbstractAndExtern relocation.
5317 (AEventPropertyAccessor.GetSignatureForError): Customized.
5319 2007-06-11 Marek Safar <marek.safar@gmail.com>
5321 * class.cs (DefineBaseTypes): Base type can be undefined.
5323 * ecore.cs (TypeLookup): Minor refactoring.
5324 (DoResolveAsTypeStep): Removed redundant check.
5326 * namespace.cs (Lookup): Removed redundant check.
5328 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
5329 ResolveAsTypeTerminal step.
5330 (BootstrapCorlib_*): Simplified.
5331 (PopulateCoreType): Core types can be now external.
5333 2007-06-07 Marek Safar <marek.safar@gmail.com>
5335 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
5337 (InferTypeArguments): Infers anonymous expression type arguments.
5338 (Compatible): Split to Compatible and InferTypeArguments.
5340 * lambda.cs: Updated.
5342 2007-06-08 Marek Safar <marek.safar@gmail.com>
5344 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
5346 2007-06-07 Raja R Harinath <harinath@gmail.com>
5348 Fix #80477, cs0135-2.cs, cs0135-3.cs
5349 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
5350 names to the "known" variables list.
5351 (Block.CheckInvariantMeaningInBlock): Handle the fact the
5352 parameter names are also "known".
5353 (Block.CheckError136): Remove.
5354 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
5357 2007-06-07 Marek Safar <marek.safar@gmail.com>
5359 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
5361 2007-06-06 Marek Safar <marek.safar@gmail.com>
5363 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
5364 internal error not an user error.
5366 * expression.cs (IsApplicable): Refactored to make debugging easier.
5368 * support.cs: More tricks for non-mono runtimes.
5370 * typemanager.cs (CoreLookupType): Made public.
5371 (InitSystemCore): All linq specific stuff moved to linq.cs
5373 2007-06-05 Marek Safar <marek.safar@gmail.com>
5375 * typemanager.cs (CSharpSignature): One more missing build-in types
5377 More tricks for non-mono runtime.
5379 2007-06-05 Raja R Harinath <harinath@gmail.com>
5381 * statement.cs (Block.CheckError136_InParents): Remove.
5382 (Block.AddVariable): Use GetParameterInfo instead.
5383 (ToplevelBlock.ProcessArguments): Likewise.
5385 2007-06-04 Raja R Harinath <rharinath@novell.com>
5387 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
5389 (ToplevelBlock.GetParameterInfo): Split out of ...
5390 (ToplevelBlock.GetParameterRefernce): ... this.
5391 (ToplevelBlock.ParameterMap): Remove.
5392 * expression.cs (ParameterReference): Update to use
5393 ToplevelParameterInfo.
5395 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
5398 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
5399 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
5401 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
5402 (ToplevelBlock.ProcessParameters) ... here.
5403 (ToplevelBlock..ctor): Invoke it.
5405 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
5408 * statement.cs (IKnownVariable): New interface.
5409 (LocalInfo): Implement it.
5410 (ToplevelParameterInfo): New class.
5411 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
5412 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
5413 GetKnownVariableInfo.
5415 2007-06-03 Raja R Harinath <harinath@gmail.com>
5417 Partly speed up CS0136 error checks.
5418 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
5419 'recurse' parameter.
5420 (Block.DoCheckError136): Only check errors in parameters. Move
5421 local variable checks ...
5422 (Block.AddVariable): ... here, and ...
5423 (ToplevelBlock.ResolveMeta): ... here.
5425 2007-06-02 Raja R Harinath <harinath@gmail.com>
5427 * statement.cs (Block.IsChildOf): Remove.
5429 * statement.cs (Statement.Clone): Move special case code ...
5430 (Block.CloneTo): ... here.
5432 2007-05-29 Raja R Harinath <rharinath@novell.com>
5434 * statement.cs (ToplevelBlock.container): Remove field. It's
5435 redundant with 'Parent'.
5436 (ToplevelBlock.ContainerBlock): Remove accessor.
5437 (ToplevelBlock..ctor): Update to changes. Register anonymous
5438 child with parent here, ...
5439 * cs-parser.jay (end_anonymous): ... not here. Don't modify
5441 (start_anonymous): Don't save current_block.
5442 (top_current_block): Remove.
5444 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
5445 (Block.Resolve): Update to changes.
5446 (Block..ctor): Move setting of "correct" 'Toplevel'
5447 and 'Explicit' fields to ...
5448 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
5450 2007-05-27 Raja R Harinath <harinath@gmail.com>
5453 * statement.cs (Block.Implicit): Remove.
5454 (Block): Update to changes.
5455 * flowanalysis.cs: Likewise.
5457 Mildly speed up CheckInvariantMeaningInBlock
5458 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
5459 Recursively call AddKnownVariable to all enclosing blocks.
5460 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
5461 Remove recursive calls.
5462 (Block): Update to changes.
5464 New ExplicitBlock invariants
5465 * statement.cs (Block.Explicit): New field. It points to the
5466 immediately enclosing non-implicit block.
5467 (Block..ctor): Maintain the invariant.
5468 * cs-parser.jay: Take advantage of invariant.
5470 Introduce ExplicitBlock
5471 * statement.cs (ExplicitBlock): New.
5472 (ToplevelBlock): Derive from it.
5473 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
5475 (Block.Implicit): Update to changes.
5476 * cs-parser.jay: Update to changes.
5479 * codegen.cs (EmitContext.IsLastStatement): Remove.
5480 * statement.cs (Block.DoEmit): Update to changes.
5482 2007-05-25 Raja R Harinath <rharinath@novell.com>
5484 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
5485 modifying current_block directly.
5487 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
5489 * class.cs: Implemented automatic properties (C# 3.0)
5490 Thanks to Marek for the help.
5492 2007-05-23 Raja R Harinath <rharinath@novell.com>
5494 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
5495 variable as assigned, note also that all its components are
5497 (MyBitVector.SetRange): New. Function to set multiple bits to true.
5499 2007-05-19 Marek Safar <marek.safar@gmail.com>
5501 * anonymous.cs, class.cs: Emit Compiler generated attribute when
5502 member is marked as compiler generated.
5504 * decl.cs (MemberCore): Refactored ModFlags into property.
5506 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
5507 (Check): Check only accessibility modifiers.
5509 2007-05-18 Raja R Harinath <rharinath@novell.com>
5511 Track all assignable slots in one bit array
5512 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
5513 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
5514 logic from VariableMap constructor here. Use the same 'offset'
5515 variable that's later used for computing offsets of local
5517 * flowanalysis.cs (UsageVector.parameters): Remove.
5518 (UsageVector): Update to changes.
5519 (VariableMap): Remove.
5521 Avoid creating ParameterMap in every block
5522 * statement.cs (Block.ParameterMap): Move ...
5523 (ToplevelBlock.ParameterMap): ... here.
5524 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
5526 * flowanalysis.cs (FlowBranching.param_map): Remove.
5527 (FlowBranching.UsageVector): Update to changes.
5528 (FlowBranchingToplevel.CheckOutParameters): Likewise.
5530 * statement.cs (Block.CloneTo): Clone Toplevel field too.
5532 * expression.cs (ParameterReference): Distinguish between block
5533 where parameter was referenced and declared.
5535 2007-05-18 Marek Safar <marek.safar@gmail.com>
5537 * flowanalysis.cs, statement.cs: Put back improved error handling.
5539 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
5543 Imporved object and collection initialization (C# 3.0).
5545 2007-05-15 Marek Safar <marek.safar@gmail.com>
5547 A fix for bug #81380
5548 * expression.cs (Is.DoResolve): Only value types have constant `is'
5551 2007-05-15 Raja R Harinath <rharinath@novell.com>
5553 * statement.cs (ToplevelBlock.child): Remove.
5555 2007-05-15 Raja R Harinath <harinath@gmail.com>
5557 Rationalize ResolveMeta: refactoring
5558 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
5559 out constant handling code into ...
5560 (Block.DoResolveConstants): ... this.
5562 Rationalize ResolveMeta: kill local_map
5563 * statement.cs (Block.local_map, Block.LocalMap): Remove.
5564 (Block.AssignableSlots): New.
5565 (Block.ResolveMeta): Make protected. Don't create a VariableMap
5566 for locals -- move code from VariableMap here. Avoid unnecessary
5568 * flowanalysis.cs (FlowBranching.local_map): Remove.
5569 (FlowBranching..ctor): Use Block.AssignableSlots.
5570 (VariableMap): Remove unused constructors.
5572 2007-05-11 Raja R Harinath <rharinath@novell.com>
5574 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
5576 2007-05-11 Marek Safar <marek.safar@gmail.com>
5578 * typemanager.cs (IsFriendAssembly): Should not be called for building
5581 2007-05-09 Marek Safar <marek.safar@gmail.com>
5583 * literal.cs (NullConstant): Print null in all cases.
5585 * expression.cs (Binary.ResolveOperator): Implemented delegate
5586 comparison based on C# 2.0 changes.
5588 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
5590 This code is contributed under the MIT X11 license
5592 The following enables support for several C# 3.0 language features:
5594 * cs-tokenizer.cs: Added support for the "var" keyword.
5596 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
5597 Added VarExpr class to facilitate type inferencing.
5599 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
5600 to support anonymous types.
5602 * assign.cs: Added support for type inferencing and initialization.
5604 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
5606 * expression.cs: Added implicit array support to ArrayCreation.
5607 Added 5 types and 1 interface:
5609 IInitializable Implementing classes can inject initializing
5610 statements after object instantiation.
5612 Initializer Stores data for object initialization.
5614 AnonymousType An expression for anonymous types.
5616 AnonymousTypeParameter Stores data about an anonymous type's field.
5618 NewInitialize An expression for object initialization.
5620 CollectionInitialize An expression for collection initialization.
5622 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
5625 2007-05-06 Marek Safar <marek.safar@gmail.com>
5627 A fix for bug #81500
5628 * cs-tokenizer.cs: Add special handling for coalescing operator.
5630 2007-05-06 Marek Safar <marek.safar@gmail.com>
5632 A fix for bug #81529
5633 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
5634 its value from base class until it is redefined.
5636 2007-05-02 Raja R Harinath <rharinath@novell.com>
5638 Fix regression in cs0631-3.cs
5639 * cs-parser.jay (operator_declarator): Add opt_attributes to error
5640 fallback. Make error fallback catch more cases.
5642 2007-05-01 Miguel de Icaza <miguel@novell.com>
5644 * cs-parser.jay: Allow parameters in operator declarations to have
5647 2007-04-27 Miguel de Icaza <miguel@novell.com>
5649 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
5652 * lambda.cs (ContextualReturn.Resolve): An expression is valid
5653 inside the ContextualReturn, it does not have to be an
5654 ExpressionStatement.
5656 2007-04-24 Miguel de Icaza <miguel@novell.com>
5658 * lambda.cs (ContextualReturn.Resolve): if the return type is not
5661 2007-04-23 Miguel de Icaza <miguel@novell.com>
5663 * anonymous.cs (AnonymousContainer): split the virtual Resolve
5664 method in two methods: ResolveNoDefine and Resolve.
5666 ResolveNoDefine will stop just after ResolveTopBlock has been
5669 Resolve will then continue by creating a method and issuing the
5670 call to method.Define ().
5672 (AnonymousMethod): Split and implement the new Resolve and
5673 ResolveNoDefine as well.
5675 * lambda.cs (LambdaExpression): Split the anonymous method
5676 resolution code into a separate routine (CoreCompatibilityTest)
5677 from DoCompatibleTest.
5679 (LambdaExpression.TryBuild): New method, this method tries to
5680 build the LambdaExpression with the given set of types to be used
5681 as the types for the various parameters of the lambda expression.
5683 If the compilation succeed with the given types, the infered type
5684 of the Anonymous method is returned, otherwise null is returned.
5686 2007-04-23 Marek Safar <marek.safar@gmail.com>
5688 A fix for bug #81414
5689 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
5691 2007-04-22 Miguel de Icaza <miguel@novell.com>
5693 * cs-tokenizer.cs: Change various identifiers here from the
5694 camelCasing to the recommended Linux-like style for instance
5695 variables from the Coding Guidelines.
5697 2007-04-19 Martin Baulig <martin@ximian.com>
5700 (Convert.ImplicitReferenceConversionCore): Allow conversions from
5701 System.Enum to System.ValueType.
5703 2007-04-13 Martin Baulig <martin@ximian.com>
5705 Rewrote implicit reference conversions. We need to distinguish
5706 between implicit reference conversions (13.1.4) and implicit
5707 boxing conversions (13.1.5).
5709 According to the spec, there's an an implicit conversion
5710 "From a one-dimensional array-type S[] to IList<T> and base
5711 interfaces of this interface, provided there is an implicit
5712 reference conversion from S to T." Note that this does not
5713 include boxing conversions.
5716 (Convert.ImplicitTypeParameterBoxingConversion): New method.
5717 (Convert.ImplicitReferenceConversion): Split into
5718 ImplicitReferenceConversionCore() and
5719 ImplicitBoxingConversionExist().
5720 (Convert.ImplicitReferenceConversionExists): Use the new
5721 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
5723 2007-04-12 Martin Baulig <martin@ximian.com>
5725 * convert.cs (Convert.ImplicitReferenceConversion): Move the
5726 `TypeManager.null_type' checks up to the top of the method.
5728 2007-04-11 Marek Safar <marek.safar@gmail.com>
5730 A fix for bug #81350
5731 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
5734 2007-04-11 Martin Baulig <martin@ximian.com>
5736 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
5737 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
5738 to make this work for generic classes; fixes #79561.
5740 2007-04-11 Martin Baulig <martin@ximian.com>
5742 * expression.cs (As): Add support for nullable types; fixes #79371.
5744 2007-04-11 Martin Baulig <martin@ximian.com>
5746 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
5747 `type.FullName' is null; fixes #80243.
5749 2007-04-11 Martin Baulig <martin@ximian.com>
5751 * expression.cs (Invocation.IsApplicable): Don't modify the method
5752 if type inference succeeded, but the method was not applicable.
5755 2007-04-10 Marek Safar <marek.safar@gmail.com>
5757 A fix for bug #81324
5758 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
5759 internal and external namespaces containers.
5761 2007-04-10 Martin Baulig <martin@ximian.com>
5763 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
5764 TypeManager.DropGenericMethodArguments() so we also call
5765 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
5767 2007-04-10 Martin Baulig <martin@ximian.com>
5769 * iterators.cs (Iterator.CreateIterator): Don't crash if
5770 `method.ReturnType' is null. This happens if something went wrong
5771 while resolving that typ (we already reported an error in this case).
5773 2007-04-10 Martin Baulig <martin@ximian.com>
5775 * expression.cs (New.DoResolve): Don't call CheckComImport() on
5776 generic interfaces; report the CS0144 directly.
5778 2007-04-10 Martin Baulig <martin@ximian.com>
5780 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
5781 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
5783 2007-04-10 Martin Baulig <martin@ximian.com>
5785 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
5787 2007-04-09 Raja R Harinath <rharinath@novell.com>
5790 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
5791 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
5794 * statement.cs (For.Resolve): If resolution fails, use
5797 2007-04-08 Marek Safar <marek.safar@gmail.com>
5799 * anonymous.cs (MakeName): Make faster and zero-based.
5800 (VerifyExplicitParameterCompatibility): Back to mode where generic
5801 parameter is ignored.
5802 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
5804 * class.cs (EmitType): Method can emit another new method.
5806 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
5808 * driver.cs: Updated.
5810 * lambda.cs: Reuse predefined empty parameters.
5812 * parameter.cs: Updated
5814 * support.cs: Implemented InflateTypes.
5816 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
5817 (InitSystemCore): Introduced to isolate 3.0 dependencies.
5819 2007-04-03 Martin Baulig <martin@ximian.com>
5823 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
5824 version of TypeManager.IsOverride() which also works with generic
5827 2007-04-03 Martin Baulig <martin@ximian.com>
5832 (Convert.ExplicitReferenceConversion): We need to cast when
5833 converting from IList<T> to S[].
5835 2007-04-01 Marek Safar <marek.safar@gmail.com>
5837 * decl.cs (FindExtensionMethods): Consider all candidates with same name
5840 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
5842 2007-03-31 Marek Safar <marek.safar@gmail.com>
5844 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
5845 argument and return type inferring.
5847 * codegen.cs (InferReturnType): Flag whether return can be inferred.
5848 (ReturnType): Turned to property.
5850 * statement.cs (Return): Implemented return type inferring.
5852 * support.cs (ReflectionParameters): Use local types if possible.
5854 2007-03-30 Raja R Harinath <rharinath@novell.com>
5856 * flowanalysis.cs (FlowBranching.Reachability): Remove.
5857 (FlowBranching.UsageVector): Update to changes.
5859 Prepare to kill 'Reachability'
5860 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
5861 argument of constructor.
5863 2007-03-29 Raja R Harinath <rharinath@novell.com>
5865 Prepare to kill 'Reachability'
5866 * flowanalysis.cs (UsageVector.is_unreachable): New.
5867 (UsageVector): Update to maintain 'is_unreachable' in parallel to
5868 'reachability', and verify they're consistent.
5871 * expression.cs (New.EmitStatement): Handle type parameters here too.
5873 2007-03-29 Martin Baulig <martin@ximian.com>
5878 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
5879 CompilerGeneratedClass.
5880 (ScopeInfo.EmitScopeInstance): Make this protected.
5881 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
5882 `ec.CurrentAnonymousMethod.Scope == Scope'.
5884 * statement.cs (Block.ScopeInfo): Make this a property.
5886 2007-03-27 Raja R Harinath <harinath@gmail.com>
5888 Prepare to kill 'Reachability'
5889 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
5890 (FlowBranching.UsageVector.Reachability): Remove property.
5891 (FlowBranching.UsageVector.IsUnreachable): New property.
5892 (FlowBranching.UsageVector.ResetBarrier): New.
5893 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
5894 * codegen.cs, statement.cs: Update to changes.
5896 2007-03-27 Martin Baulig <martin@ximian.com>
5901 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
5904 2007-03-26 Raja R Harinath <rharinath@novell.com>
5906 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
5907 instead of TriState. Remove all mention of TriState.
5909 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
5910 replaced by a boolean. Add boolean 'is_unreachable' field, check
5911 and maintain invariants.
5913 2007-03-25 Marek Safar <marek.safar@gmail.com>
5915 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
5917 2007-03-25 Marek Safar <marek.safar@gmail.com>
5919 * expression.cs: Stop using obsolete 2.0 opcodes.
5921 2007-03-25 Marek Safar <marek.safar@gmail.com>
5923 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
5924 one of the latests Martin's fixes.
5926 2007-03-23 Miguel de Icaza <miguel@novell.com>
5928 * expression.cs: On BigEndian systems, swap the bytes, temporary
5929 solution until we get a new bitconverter class.
5931 2007-03-23 Martin Baulig <martin@ximian.com>
5935 * decl.cs (MemberCache.AddMembers): Add generic methods both as
5936 "Method" and "Method`1". Normally, a cache lookup is done on the
5937 "Method" form (ie. without the generic arity), but this one makes
5938 lookups on the full form work as well.
5940 2007-03-22 Raja R Harinath <rharinath@novell.com>
5942 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
5945 2007-03-20 Bill Holmes <billholmes54@gmail.com>
5947 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
5948 ordered_member_list, to TypeBuilder to store members to be defined
5949 in the order they were parsed in.
5950 - ordered_explicit_member_list contains all properties indexers
5951 and methods that are defined as explicit implementation of an
5952 interface or base class.
5953 - ordered_member_list contains all properties indexers and methods
5954 that are not defined as explicit implementation of an interface
5957 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
5958 functionality in these removed classes has been replaced with
5959 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
5960 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
5962 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
5963 to CheckForDuplications inside GetMethod and SetMethod Define Method
5964 to handle method property and indexer name conflicts.
5968 All code is contributed under the MIT/X11 license.
5970 2007-03-20 Martin Baulig <martin@ximian.com>
5972 * class.cs (TypeContainer.Interfaces): Removed; they're now
5973 included in `TypeContainer.Types'.
5975 2007-03-20 Martin Baulig <martin@ximian.com>
5977 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
5979 * class.cs (TypeContainer.CreateType): New public method. This is
5980 now called before DefineType() to create the TypeBuilders.
5981 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
5982 has already been created by CreateType().
5983 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
5984 don't resolve our base classes here; this has been moved into
5985 DefineBaseTypes(). We're now called from CreateType().
5986 (TypeContainer.DefineBaseTypes): New private method; resolve our
5987 base classes here. We're now called from DefineType().
5990 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
5991 our types first to create all the TypeBuilders. After that, call
5992 TypeContainer.DefineType() on all the types which'll resolve their
5993 base classes and setup the resolve order.
5995 2007-03-20 Martin Baulig <martin@ximian.com>
5997 * class.cs (TypeContainer.Enums): Removed; they're now included in
5998 `TypeContainer.Types'.
6000 2007-03-20 Martin Baulig <martin@ximian.com>
6003 (TypeContainer.DefineType): Don't call ResolveMembers() here.
6004 (TypeContainer.DoResolveMembers): Call DefineType() on our
6005 `compiler_generated' classes; moved here from DefineNestedTypes().
6008 (RootContext.ResolveTree): Call ResolveMembers() on all
6009 TypeContainer's in the `type_container_resolve_order'.
6011 2007-03-19 Marek Safar <marek.safar@gmail.com>
6013 * class.cs: Use corlib to handle InternalMethodImplAttribute.
6015 2007-03-17 Marek Safar <marek.safar@gmail.com>
6017 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
6018 implementation flags.
6020 2007-03-17 Marek Safar <marek.safar@gmail.com>
6022 * class.cs: More optimizations for type parameters.
6024 2007-03-15 Marek Safar <marek.safar@gmail.com>
6026 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
6028 * ecore.cs, parameter.cs: More common code for both corlibs.
6030 * typemanager.cs (IsGenericMethod): Simplified.
6032 2007-03-15 Raja R Harinath <rharinath@novell.com>
6034 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6036 * statement.cs, iterators.cs, lambda.cs: Update to changes.
6038 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
6039 unconditionally. Simplify explanation.
6040 (Try.Resolve, Using.Resolve): Likewise.
6042 2007-03-15 Martin Baulig <martin@ximian.com>
6046 * decl.cs (DeclSpace): If we're a partial class, use our
6047 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
6049 2007-03-15 Raja R Harinath <rharinath@novell.com>
6051 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6053 (FlowBranching.UsageVector): Update to changes.
6054 (FlowBranching.MergeSiblings): Likewise.
6055 * statement.cs: Likewise.
6057 2007-03-15 Martin Baulig <martin@ximian.com>
6062 (MemberCache): Added a special .ctor for type parameters.
6065 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
6068 2007-03-09 Martin Baulig <martin@ximian.com>
6070 * enum.cs (Enum): Make this a TypeContainer.
6071 (EnumMember): Derive from `Const'.
6074 (Const.DoResolveValue): New protected virtual method; move most of
6075 the functionality of ResolveValue() here so we can override it in
6077 (Const.CreateConstantReference): Make this virtual.
6079 * class.cs (Kind): Add `Kind.Enum'.
6080 (TypeContainer.Emit): Don't emit the enums here; they're already
6081 in the `RootContext.typecontainer_resolve_order'.
6083 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
6084 here; they're already in the `typecontainer_resolve_order'.
6086 * ecore.cs (EnumConstant.ConvertImplicitly): Add
6087 TypeManager.DropGenericTypeArguments().
6090 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
6091 (TypeManager.IsEnumType): Likewise.
6092 (TypeManager.EnumToUnderlying): Likewise.
6093 (TypeManager.IsEqual): Add support for enums.
6095 2007-03-12 Raja R Harinath <rharinath@novell.com>
6097 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
6098 DefaultParameterValueAttribute to be undefined, say if System.dll
6101 2007-03-11 Marek Safar <marek.safar@gmail.com>
6103 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
6106 2007-03-10 Marek Safar <marek.safar@gmail.com>
6108 * class.cs, parameter.cs: Unified parameters verification.
6110 2007-03-08 Martin Baulig <martin@ximian.com>
6112 * cs-parser.jay (constructor_header): Pass the location to the
6113 newly created TopLevelBlock.
6115 2007-03-07 Martin Baulig <martin@ximian.com>
6117 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
6119 2007-03-06 Miguel de Icaza <miguel@novell.com>
6121 * convert.cs (ExplicitReferenceConversionExists): Sync this method
6122 with the changes from David, fixes the build.
6124 2007-03-05 David Mitchell <dmitchell@logos.com>
6126 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
6127 and its base interfaces to a one-dimensional array type S[],
6128 provided there is an implicit or explicit reference conversion
6131 2007-03-03 Marek Safar <marek.safar@gmail.com>
6133 * cs-tokenizer.cs: Implemented basic linq grammar.
6135 * driver.cs: Set linq lang version on demand.
6137 2007-02-26 Marek Safar <marek.safar@gmail.com>
6139 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
6141 2007-02-25 Marek Safar <marek.safar@gmail.com>
6143 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
6146 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
6148 Check property and event extern attributes.
6150 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
6153 2007-02-24 Marek Safar <marek.safar@gmail.com>
6155 A fix for bug #80407
6156 * ecore.cs: Don't report ambiguity error when methods have same parent.
6158 2007-02-23 Marek Safar <marek.safar@gmail.com>
6160 A fix for bug #80878
6161 * class.cs, cs-parser.jay: Event property can host anonymous methods.
6163 2007-02-22 Marek Safar <marek.safar@gmail.com>
6165 * attribute.cs: Enable ExtensionAttribute presence test.
6167 2007-02-22 Marek Safar <marek.safar@gmail.com>
6169 * class.cs: Warn about missing GetHashCode only when Equals is override.
6171 * decl.cs: Check accessibility of type arguments.
6173 * typemanager.cs: Correctly report nullable array.
6175 2007-02-20 Marek Safar <marek.safar@gmail.com>
6177 * class.cs, report.cs: Capture more details when things go wrong.
6179 2007-02-20 Marek Safar <marek.safar@gmail.com>
6181 A fix for bug #80650
6182 * cs-parser.jay: Anonymous container starts at constructor declaration
6183 and not at block beginning because it has to be usable in constructor
6186 * statement.cs: Use context location and not block one for error reporting.
6188 2007-02-18 Marek Safar <marek.safar@gmail.com>
6190 A fix for bug #78712
6191 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
6194 2007-02-18 Marek Safar <marek.safar@gmail.com>
6196 A fix for bug #80493 by Atsushi Enomoto
6197 * cs-parser.jay: Ignore invalid attribute target.
6199 2007-02-18 Marek Safar <marek.safar@gmail.com>
6201 * cs-tokenizer.cs: Ignore '\0' as white space character.
6203 2007-02-17 Miguel de Icaza <miguel@novell.com>
6205 * cs-parser.jay: Add support for lambda expressions to the mcs
6208 * lambda.cs: Only clone when we are probing, not on the final call
6209 (Compatible is the final call).
6211 * statement.cs (CloneContext): Introduce class to provide block
6212 remapping during clone.
6214 All statements Clone themselves now.
6216 (Clone): special handling for blocks, when we clone a block, we
6217 register the block inside this routine, as children of the block
6218 might trigger a lookup.
6220 * expression.cs: Add support for CloneContext in all expressions.
6222 2007-02-17 Marek Safar <marek.safar@gmail.com>
6224 A fix for bug #80493
6225 * statement.cs: Report ambiguous warning when interfaces are not related.
6227 2007-02-15 Marek Safar <marek.safar@gmail.com>
6229 C# 3.0 extension methods.
6231 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
6232 cannot be used directly.
6234 * class.cs (Class.Emit): Emit extension attribute if any class method
6235 is extension method.
6236 (Method.Define): Add basic extension method validation conditions.
6237 (Method.Emit): Emit extension attribute for method.
6239 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
6240 extension method exists. Currently we follow same approach as Microsoft
6241 does, emit even if a method or a class are private but this can change
6244 * cs-parser.jay: Add handling of `this' keyword in method parameters
6247 * decl.cs (DeclSpace.IsStaticClass): New property.
6248 (MemberCache.FindExtensionMethods): Looks for extension methods with
6249 defined name and extension type.
6251 * doc.cs: Updated after OverloadResolve changes.
6253 * driver.cs: Add new soft reference to System.Core.dll.
6255 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
6256 (ExtensionMethodGroupExpr): Represents group of extension methods.
6258 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
6259 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
6260 to MethodGroupExpr and made non-static for easier customization.
6261 (Invocation.DoResolve): Add extension method lookup when no standard
6263 (MemberAccess.DoResolve): Try extension methods if no member exists.
6265 * modifiers.cs: Add METHOD_EXTENSION modifier.
6267 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
6268 as well as candidate extension type.
6269 (ComputeNamespaces): When assembly constains extension methods registers
6271 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
6272 extension method lookup.
6273 (Namespace.LookupExtensionMethod): Looks for extension method in this
6275 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
6276 find a method which matches name and extensionType.
6278 * parameter.cs (Parameter): Add This modifer.
6279 (HasExtensionMethodModifier): New property.
6280 (Resolve): Add extension parameter check.
6281 (ModFlags): turned to property to exclude this modifier as it is not real
6283 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
6285 * support.cs (ParameterData): Add ExtensionMethodType.
6286 (ReflectionParameters): Implemented ExtensionMethodType interface property.
6288 * typemanager.cs: Add type and ctor extension attribute type.
6290 2007-02-15 Miguel de Icaza <miguel@novell.com>
6292 * report.cs (DisableErrors, EnableErrors): used to prevent error
6293 output when we are "trying" to compile various methods with
6296 * ecore.cs (Expression): Add Clone method that calls the virtual
6297 CloneTo method. The current CloneTo method in Expression throws
6298 an exception so we can track down all the places where this must
6299 be implemented (not using abstract, because that would be a lot of
6300 up-front-work before we can start testing the implementation
6303 Important: we only need Clone capabilities for expressions created
6304 by the parser, as the expressions we will be cloning are
6305 expressions in the pre-resolved state. This vastly simplifies
6308 (SimpleName): Add CloneTo that does nothing.
6309 (EmptyCast): Add CloneTo.
6311 * expression.cs (Binary): Implement CloneTo.
6312 (Invocation.IsApplicable): Store the current ec in
6313 EmitContext.TempEc and restore it on return. This is used so we
6314 do not have to sprinkle hundres of methods with an extra
6315 EmitContext, we know that the only user is the lambda expression
6316 ImplicitConversionExists code.
6318 (Argument): Add Cloning capabilities.
6319 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
6320 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
6321 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
6322 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
6323 IndexerAccess): Add Clone capability.
6325 (LocalVariableReference, This): TODO: needs cloned Block mapping.
6327 (Argument): Add cloning capability.
6329 * assign.cs (Assign): Implement CloneTo.
6331 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
6333 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
6334 version by calling Convert with the EmitContext (that we are
6335 currently storing in ec, this is not great, but will do for now,
6336 to avoid passing EmitContext parameters to hundreds of functions
6337 that do not need them now).
6339 (SetExpression): Remove, it is not needed.
6341 (ContextualReturn): Implement CloneTo.
6343 * statement.cs (Statement): Implement cloning infrastructure,
6344 similar to expressions.
6346 (Block): Partial implementation of Clone for statements.
6348 (Return): Implement clone.
6350 * constant.cs (Constant.CloneTo): New method, does nothing.
6352 * codegen.cs (TempEc): Add a static EmitContext as a temporary
6353 solution, until we decide how to exactly do this.
6355 2007-02-14 Marek Safar <marek.safar@gmail.com>
6357 A fix for bug #80493
6358 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
6359 a property is override we need to use second accessor.
6361 2007-02-13 Marek Safar <marek.safar@gmail.com>
6363 A fix for bug #80418
6364 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
6367 2007-02-13 Marek Safar <marek.safar@gmail.com>
6369 Another fix for bug #80749
6370 * pending.cs: Abstract class has priority over interfaces.
6372 2007-02-13 Marek Safar <marek.safar@gmail.com>
6374 Another fix for bug #80749
6375 * pending.cs: Abstract class has priority over interfaces.
6377 2007-02-13 Marek Safar <marek.safar@gmail.com>
6379 Another fix for bug #80749
6380 * pending.cs: Abstract class has priority over interfaces.
6382 2007-02-13 Marek Safar <marek.safar@gmail.com>
6384 Another fix for bug #80749
6385 * pending.cs: Abstract class has priority over interfaces.
6387 2007-02-13 Marek Safar <marek.safar@gmail.com>
6389 * class.cs Better error message.
6391 * driver.cs: Add shorter versions of -optimize option.
6393 2007-02-13 Martin Baulig <martin@ximian.com>
6395 * class.cs (Constructor.Emit): Check the return value of
6396 ec.ResolveTopBlock() and return on error.
6398 2007-02-13 Raja R Harinath <rharinath@novell.com>
6400 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
6401 message to fix error message regression.
6403 2007-02-12 Marek Safar <marek.safar@gmail.com>
6405 * delegate.cs: Delegate creation expression cannot be of Nullable type.
6407 2007-02-12 Marek Safar <marek.safar@gmail.com>
6409 A fix for bug #80749
6410 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
6411 its parent container.
6413 * class.cs (DefineFieldInitializers): Each initializer can has different
6416 * const.cs: Updated.
6418 2007-02-11 Miguel de Icaza <miguel@novell.com>
6420 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
6421 now all the heavy lifting to check that embedded statements or
6422 expressions have the right form is done in the ContextualReturn.
6424 (ContextualReturn): New class.
6426 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
6427 method that can be invoked to report 201, so we do not replicate
6430 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
6432 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
6433 treating tabs as spaces.
6435 2007-02-09 Marek Safar <marek.safar@gmail.com>
6437 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
6438 * assign.cs: Use full implicit conversion for right side check.
6440 2007-02-09 Marek Safar <marek.safar@gmail.com>
6442 * statement.cs (Switch): Switch over boolean type is not standardized.
6444 2007-02-08 Marek Safar <marek.safar@gmail.com>
6446 A fix for bug #80755
6447 * decl.cs (FindBaseEvent): Don't use method cache for events.
6449 2007-02-07 Marek Safar <marek.safar@gmail.com>
6451 * cs-parser.jay: Better syntax error handling.
6453 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
6454 instead of underlying type value.
6456 2007-02-06 Marek Safar <marek.safar@gmail.com>
6458 * driver.cs: Check define identifier before is registered.
6460 * namespace.cs: Use existing error message.
6462 * report.cs: New warning.
6464 2007-02-06 Marek Safar <marek.safar@gmail.com>
6466 A fix for bug #80742
6467 * expression.cs: Delegate Invoke method can be called directly.
6469 2007-02-06 Marek Safar <marek.safar@gmail.com>
6471 A fix for bug #80676
6472 * class.cs (IsEntryPoint): The Main method can have params modifier.
6474 2007-02-04 Miguel de Icaza <miguel@novell.com>
6476 * parameter.cs (Parameter, Parameters): Add Clone method.
6478 * anonymous.cs (Compatible): Turn method into virtual method, so
6479 LambdaExpression can implement a different behavior.
6481 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
6482 out the basic checking here, so it can be used by
6485 * lambda.cs: Introduce "Compatible" function that will do the
6488 2007-02-02 Marek Safar <marek.safar@gmail.com>
6490 * attribute.cs: Unified one error message.
6492 * class.cs (Class): Use type attributes and not properties to test static
6494 (IsEntryPoint): Don's pass local variable.
6496 * convert.cs: Removed duplicate check.
6498 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
6500 * driver.cs: Don't crash when soft reference does not exist.
6502 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
6503 (UsingEntry): Removed redundant allocation.
6505 * parameter.cs: Add fast path for type parameters.
6507 * support.cs: Don't allocate attribute when it's not used.
6509 2007-01-30 Miguel de Icaza <miguel@novell.com>
6512 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
6513 this into a virtual method, so we can override it in LambdaExpression.
6515 * driver.cs: Improve diagnostics in case of failure.
6517 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
6518 write a function that is slightly more complex and that parses:
6520 type identifier [, type identifier]* )
6522 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
6525 (canEmpty ? i >= 0 : i > 0)
6527 2007-01-30 Raja R Harinath <rharinath@novell.com>
6529 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
6530 exception on possibly valid code.
6532 2007-01-29 Raja R Harinath <rharinath@novell.com>
6534 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
6536 (parse_opt_type_arguments): Remove. It's almost the same as
6538 (parse_namespace_or_typename): Use parse_less_than.
6540 2007-01-28 Miguel de Icaza <miguel@novell.com>
6542 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
6543 this bug took a few hours to find, because the state saved and
6544 restored by PushPosition and PopPosition was ignoring the state of
6545 parse_generic_less_than.
6547 I can also now remove the handling of OP_LT and OP_GT, this solves
6550 * cs-tokenizer.cs: store the location for the ARROW token, we use
6553 (PushPosition, PopPosition): save/restore also `current_token',
6554 restore `parse_generic_less_than' (was missing).
6556 (parse_opt_type_arguments): use parse_type, not
6557 parse_namespace_or_typename to parse types.
6559 * lambda.cs: Empty new file, will eventually have the lambda
6560 expression implementation.
6562 * lambda.test: used to test the internal tokenizer.
6564 * report.cs (FeatureIsNotISO1): Rename from
6565 FeatureIsNotStandardized, because it was about the language level
6566 (1 vs 2) it was not about standarization.
6568 (FeatureRequiresLINQ): New.
6570 * support.cs (SeekableStreamReader): Only require that the reader
6571 is a TextReader, not a StreamReader, so we can plug StringReader.
6573 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
6574 given position in the input stream the following tokens can be
6575 parsed as a type followed by an identifier.
6577 (is_punct): after a '(' if parse_type_and_parameter returns true,
6578 then return a special token OPEN_PARENS_LAMBDA which is used to
6579 avoid reduce/reduce errors in the grammar for the
6580 lambda_expression rules.
6582 (parse_type): implement a type parser inside the
6583 tokenizer, the parser only returns true or false depending on
6584 whether the input at a given position can be parsed as a type.
6586 (peek_token): new method used during type parsing.
6588 2007-01-28 Raja R Harinath <rharinath@novell.com>
6591 * anonymous.cs (ScopeInfo.InflateParameters): New.
6592 (AnonymousContainer.Resolve): Use it to redirect types of
6593 delegate parameters.
6595 2007-01-27 Raja R Harinath <rharinath@novell.com>
6598 * expression.cs (Error_InvalidArguments): Don't use two different
6599 messages for CS1503. Use ExtraInformation and
6600 SymbolRelatedToPreviousError instead.
6603 * decl.cs (DeclSpace.initialize_type_params): Don't access
6604 'type_params' of a partial class directly.
6606 2007-01-26 Miguel de Icaza <miguel@novell.com>
6608 * constant.cs: Removed a handful of out-of-range checks that were
6611 2007-01-25 Marek Safar <marek.safar@gmail.com>
6613 * expression.cs (CheckUselessComparison): Add additional check for char
6616 * namespace.cs: Fixed typo.
6618 2007-01-23 Miguel de Icaza <miguel@novell.com>
6620 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
6621 gone, instead we inline the test, preventing the needless casts to
6622 longs, ulongs and doubles for the parameters, avoiding calls to
6623 methods that overchecked stuff, and instead inlined things
6626 2007-01-20 Marek Safar <marek.safar@gmail.com>
6628 * cs-parser.jay: Better parameter error handling.
6630 2007-01-17 Marek Safar <marek.safar@gmail.com>
6632 A fix for bug #80368, #80522
6633 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
6634 whether array initializer contains constants only.
6635 (ArrayCreation.Emit): Use better formula to decide when
6636 are array initializers for static initialization.
6637 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
6638 have to emit even constants otherwise they are pre-initialized.
6640 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
6641 Raja R Harinath <rharinath@novell.com>
6643 Fix emit order of 'get' vs. 'set'.
6644 * support.cs (Accessors): New.
6645 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
6646 Note the order in which accessors are declared in the source.
6647 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
6648 Refactored from Property.Define and Indexer.Define.
6649 (PropertyBase.DefineAccessors): New helper that calls the above in
6650 appropriate order as noted by the parser.
6651 (Property.Define, Indexer.Define): Update to changes.
6652 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
6654 2007-01-17 Raja R Harinath <rharinath@novell.com>
6656 Fix cs0029-6.cs and gcs0029-2.cs (regression)
6657 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
6658 there's an implicit conversion from the current type to the target
6659 type before converting the underlying constant.
6661 2007-01-16 Marek Safar <marek.safar@gmail.com>
6663 * const.cs (ResolveValue): Updated after constant conversion was made more
6666 * constant.cs (GetAttributableValue): constant to object conversion is
6667 used for attributes only.
6668 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
6669 constant conversions.
6670 (LongConstant.ConvertImplicitly): Ditto.
6672 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
6673 (ImplicitConversionStandard): Handle constant conversion as extra step.
6674 It solves the issue when constant conversion was called indirectly like
6675 inside array initializer and constant folding was skipped.
6677 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
6680 * statement.cs(ImplicitConversionStandard): Updated after constant
6681 conversion was made more generic.
6683 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
6685 * expression.cs (As.DoResolve): Use GenericConstraints instead of
6686 Constraints, solves the problem where the compiler incorrectly
6687 reported that a type parameter was not constrained to a class (Bug
6690 2007-01-14 Marek Habersack <grendello@gmail.com>
6692 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
6694 2007-01-14 Marek Safar <marek.safar@gmail.com>
6696 A fix for bug #80368
6697 * assign.cs (FieldInitializer): New class implements field
6698 initializer statement.
6700 * attribute.cs: Update after FieldMember rename.
6702 * class.cs (PropertyBasedMember): New common class for property based
6704 (InterfaceMemberBase): New base class for all members which can be used as
6705 an interface members.
6706 (MethodCore): Moved really common code to InterfaceMemberBase.
6707 (Method.Define): Equal and GetHasCode detection is relevant for methods
6709 (MethodData.Define): Don't assume that public event implements an
6710 interface automatically.
6711 (MethodData.DefineMethodBuilder): Issue an error even if only extern
6713 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
6714 (FieldMember): Merged with FieldBase.
6715 (EventProperty.AEventPropertyAccessor): New specialization to check whether
6716 event extern modifier can be used.
6717 (EventField.EventFieldAccessor): Moved event field specific code here.
6718 (Event.AllowedModifiers): Even event can be extern.
6719 (Event.FindOutBaseMethod): New override specific to events.
6720 (Indexer.parameters): Reintroduce parameters because base class holds
6721 only properties common data.
6722 (Indexer.CheckForDuplications): Indexers are threated as methods so we
6723 need do extra parameters check.
6725 * const.cs: Update after FieldMember rename.
6727 * decl.cs (MemberCache.FindBaseEvent): New method.
6729 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
6730 to reflect that indexer is now derived from PropertyBased.
6732 * ecore.cs (GetMemberType): Made public.
6733 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
6736 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
6738 * typemanager.cs (CSharpSignature): Correctly print event accessors.
6739 (RegisterEvent): Removed.
6740 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
6741 (GetPrivateFieldOfEvent): Renamed to GetEventField.
6743 2007-01-11 Raja R Harinath <rharinath@novell.com>
6746 * statement.cs (CollectionForeach.TryType): Prefer generic
6747 GetEnumerator over non-generic variant. Fix code to follow comments.
6749 2007-01-09 Raja R Harinath <rharinath@novell.com>
6752 * support.cs (ReflectionParameter): Don't use an invalid index on
6753 the generic parameter data.
6755 2007-01-08 Miguel de Icaza <miguel@novell.com>
6757 * driver.cs: Just add a tiny bit of infrastructure.
6759 2007-01-02 Marek Safar <marek.safar@gmail.com>
6761 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
6762 where field type is struct from current assembly.
6764 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
6767 2007-01-02 Marek Safar <marek.safar@gmail.com>
6769 A fix for bug #80381
6770 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
6773 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
6775 (Namespace.LookupType): Always use core types from corlib when speficied.
6777 * report.cs: A new warning.
6779 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
6780 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
6781 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
6783 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
6784 (InitCoreTypes): Set expression type of object_type and value_type
6785 immediately after lookup.
6787 2007-01-01 Miguel de Icaza <miguel@novell.com>
6789 * cs-tokenizer.cs: Accept Pc class characters (Connector
6790 Punctuation) as valid identifiers. Fixes #78259
6792 * expression.cs (Invocation.DoResolve): Moved the check for the
6793 use of `this' for doing method calls to the Invocation resolution
6794 step, after overload resolution has taken place instead of doing
6795 the check at the low-level `This.DoResolve' level.
6797 The `This.DoResolve'(appens before overload resolution, so it has
6798 no way of knowing if the method that will be called will be
6799 instace or static, triggering an erroneous report for cs0188 (Bug
6802 We now do the check for instance method invocations after we know
6803 what method will be called.
6805 (This.CheckThisUsage): Move the actual use of this structure
6806 checking into its own method and expose it.
6808 * Everywhere that called Error_ValueCannotBeConverted: pass a new
6811 Exceptions: Null.ConvertImplicitly,
6812 Constant.ImplicitConversionRequired as there are too many call
6813 sites for passing the ec.
6815 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
6816 EmitContext, if the value is null, then we do not try to provide
6817 the extra information from the error (If a userdefined conversion
6818 exists, as UserDefinedConversion requires a non null-EmitContext).
6822 2006-12-30 Raja R Harinath <rharinath@novell.com>
6824 * flowanalysis.cs (MyBitVector): Document some invariants.
6825 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
6826 introduced below, and add a couple of others,
6828 2006-12-30 Marek Safar <marek.safar@gmail.com>
6830 * attribute.cs (GetMethodObsoleteAttribute): Uses new
6831 GetPropertyFromAccessor and GetEventFromAccessor.
6833 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
6834 overrides non-obsolete one.
6835 (Indexer.Define): Error message has been moved to the parser.
6837 * cs-parser.jay: Better syntax errors handling.
6839 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
6840 when an invocation has no arguments.
6842 * ecore.cs: Removed not used caching.
6844 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
6847 * report.cs: Add a new warning.
6849 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
6851 * typemanager.cs (enumeration_type): Removed.
6852 (CSharpSignature): Reuses IsSpecialMethod.
6853 (IsEqual): Hack for MS BCL.
6854 (GetPropertyFromAccessor): New method.
6855 (GetEventFromAccessor): New method.
6856 (IsSpecialMethod): Fixed to handle more cases.
6858 2006-12-30 Marek Safar <marek.safar@gmail.com>
6860 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
6861 Made white spaces array static.
6863 * ecore.cs (RemoveGenericArity): Optimized.
6865 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
6867 (MyBitVector.initialize_vector): Simplified.
6869 2006-12-22 Miguel de Icaza <miguel@novell.com>
6871 * ecore.cs: Am not entirely happy with this hack, but it seems to
6872 address the issue in 80257 (a small test case for
6875 I set the MethodGroupExpr.Type to an internal compiler type
6876 (itself in this case) to force the resolution to take place. Why
6877 it does not take place with a null is beyond me.
6879 2006-12-20 Marek Safar <marek.safar@gmail.com>
6881 A fix for bug #80288
6882 * expression.cs (ResolveOperator): Consider user defined conversion for
6883 logical and operator too.
6884 (EmitBranchable): Optimization for logical and when full constant folding
6885 could not be applied but one operand is constant.
6887 2006-12-19 Marek Safar <marek.safar@gmail.com>
6889 * class.cs (GetClassBases): Write 5 times every day, will never use
6890 FullName for error reporting.
6892 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
6894 2006-12-19 Martin Baulig <martin@ximian.com>
6896 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
6897 the symbol file info here.
6899 2006-12-18 Marek Safar <marek.safar@gmail.com>
6901 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
6902 of `elseif' is taking then following sections are not taking.
6903 Fixes an issue reported on mono mailing list.
6905 2006-12-18 Marek Safar <marek.safar@gmail.com>
6907 A fix for bug #80300
6908 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
6909 a caller is not taking.
6911 2006-12-18 Raja R Harinath <rharinath@novell.com>
6913 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
6914 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
6915 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
6916 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
6917 * class.cs: Update to changes.
6919 2006-12-17 Marek Safar <marek.safar@gmail.com>
6921 A fix for bug #79934
6922 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
6925 * class.cs (ResolveMembers): Register an iterator in current container and
6928 2006-12-16 Raja R Harinath <rharinath@novell.com>
6931 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
6932 satisfy a params annotated parameter.
6934 2006-12-16 Marek Safar <marek.safar@gmail.com>
6936 A fix for bug #77014
6937 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
6938 paramters correctly and not rely on hacks in Parameters class.
6939 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
6941 (Invocation.VerifyArgumentsCompat): Ditto.
6942 (Invocation.EmitArguments): Changed to correctly emit params arguments at
6945 * parameter.cs (HasParams): Don't assume that params is the last one.
6947 * support.cs (ReflectionParameters.ctor): Look for params attribute
6949 (ReflectionParameters.ParameterType): Removed hack when we returned last
6950 parameter for out of range parameters.
6951 (ParameterName, ParameterModifier): Ditto.
6953 2006-12-14 Marek Safar <marek.safar@gmail.com>
6955 A fix for bug #79987
6956 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
6957 when assembly is not CLS compliant but type is. I have no idea why is this
6960 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
6962 2006-12-13 Miguel de Icaza <miguel@novell.com>
6964 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
6965 in struct constructors, they are basically no-ops.
6967 2006-12-12 Marek Safar <marek.safar@gmail.com>
6969 * cs-tokenizer.cs (Position): Save preprocessor status too.
6971 2006-12-12 Marek Safar <marek.safar@gmail.com>
6973 A fix for bug #77794
6974 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
6976 2006-12-12 Marek Safar <marek.safar@gmail.com>
6978 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
6980 (pp_expr): Report error for an invalid expression.
6981 (handle_preprocessing_directive): Simplified; add more error checking.
6983 2006-12-11 Marek Safar <marek.safar@gmail.com>
6985 A fix for bug #74939
6986 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
6987 directives handling.
6989 2006-12-10 Marek Safar <marek.safar@gmail.com>
6991 A fix for bugs #80093, and #75984
6992 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
6993 logic, it seems to me as it worked before "by coincidence".
6994 (xtoken): Simplified to use reworked handle_preprocessing_directive.
6995 (cleanup): Enabled endif check.
6997 2006-12-09 Marek Safar <marek.safar@gmail.com>
6999 A fix for bug #80162
7000 * statement.cs (CollectionForeach.TryType): Generics and non-generics
7001 enumerators are never ambiguous.
7003 2006-12-08 Raja R Harinath <rharinath@novell.com>
7006 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
7008 2006-12-06 Marek Safar <marek.safar@gmail.com>
7010 A fix for bug #80144
7011 * class.cs (EventProperty.Define): Explicit implementation means
7012 that an even is used.
7014 2006-12-06 Marek Safar <marek.safar@gmail.com>
7016 Fixes the operators implementation (part II)
7018 * cfold.cs (DoConstantNumericPromotions): Renamed to
7019 DoBinaryNumericPromotions and simplified.
7020 (BinaryFold): Couple of conversion fixes; simplified.
7022 * constant.cs, ecore.cs, literal.cs
7023 (ToType): Renamed to ConvertImplicitly.
7024 (Reduce): Renamed to ConvertExplicitly.
7026 * class.cs, convert.cs: Updated.
7028 * expression.cs: TryReduce doesn't throw an exception.
7030 2006-12-01 Marek Safar <marek.safar@gmail.com>
7032 A fix for bug #80108
7033 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
7036 2006-11-30 Marek Safar <marek.safar@gmail.com>
7038 Fixes unary operators implementation (part I)
7041 * cfold.cs (Error_CompileTimeOverflow): Made internal
7043 * const.cs (IConstant): Changed to use reference to constant and
7044 not constant itself.
7045 Updated IConstant implementations.
7047 * constant.cs (CreateConstant): New factory method.
7048 Updated IConstant implementation.
7050 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
7052 * ecore.cs: Updated to use CreateConstantReference.
7054 * enum.cs: Reflects IConstant changes.
7056 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
7058 * literal.cs (NullConstant): Change to be independently usable.
7060 2006-11-29 Martin Baulig <martin@ximian.com>
7062 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
7063 we need to emit the scope initializer before calling the base .ctor.
7065 * anonymous.cs: Merged back from the new anonymous methods branch.
7066 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
7068 * expression.cs (ParameterReference.DoResolveBase): Create a
7069 "normal" ScopeInfo when capturing parameters rather than using the
7070 root scope; this makes things work with anonymous methods having
7074 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
7076 2006-11-22 Marek Safar <marek.safar@gmail.com>
7078 A fix for bug #79987
7079 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
7080 check to a base class.
7081 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
7082 only when assembly has missing attribute.
7083 * report.cs: Update.
7085 2006-11-21 Marek Safar <marek.safar@gmail.com>
7087 * cs-tokenizer.cs: Merged with gmcs version.
7089 2006-11-20 Marek Safar <marek.safar@gmail.com>
7092 * cs-parser.jay: Better error message when partial keyword is misplaced.
7094 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
7096 A fix for bug #79810
7097 report.cs: CS1058 only applies to 2.0 profile (gmcs).
7098 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
7099 a RuntimeWrappedException by default.
7101 2006-11-18 Marek Safar <marek.safar@gmail.com>
7103 A fix for bug #79843
7104 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
7106 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
7108 2006-11-18 Marek Safar <marek.safar@gmail.com>
7110 * driver.cs, namespace.cs: Uses faster IndexOf version.
7112 2006-11-17 Marek Safar <marek.safar@gmail.com>
7114 A fix for bug #79941
7115 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
7117 (Operator.Define): Implicit/Explicit operator of same type is duplicate
7118 even if internal name is different.
7119 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
7120 (UserDefinedConversion): Simplified as the operators cannot be internal.
7121 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
7123 (MethodLookup): Replaced EmitContext with parentType.
7124 * expression.cs: Updated.
7126 2006-11-09 Raja R Harinath <rharinath@novell.com>
7128 * driver.cs (BadAssembly): Handle all the ugliness of
7129 DefineDynamicAssembly.
7131 2006-11-08 Raja R Harinath <rharinath@novell.com>
7133 Address parts of #58244 -- most of what's left is in the runtime
7134 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
7135 CS1509 error checks, and handle them for all assembly loads, not
7136 just the first invocation.
7137 (LoadModule): Likewise. Move handling of 'adder_method' ...
7138 * codegen.cs (AssemblyClass.AddModule): ... here.
7140 2006-11-02 Marek Safar <marek.safar@gmail.com>
7142 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
7143 IEnumerable<T> is ambiguous.
7145 2006-10-31 Marek Safar <marek.safar@gmail.com>
7147 A fix for bug #67689
7148 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
7149 GetEnumerator is ambiguous.
7151 * report.cs: Add new warning.
7153 2006-10-29 Marek Safar <marek.safar@gmail.com>
7155 A fix for bug #78602
7156 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7157 to protected member can be nested type.
7159 2006-10-28 Marek Safar <marek.safar@gmail.com>
7161 A fix for bug #78965
7162 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7163 to protected member must derive from current type.
7165 2006-10-27 Marek Safar <marek.safar@gmail.com>
7167 assign.cs: Reuses error method.
7169 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
7170 instead of type for constants.
7171 (Expression.Error_ValueAssignment): Common error method.
7173 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
7176 2006-10-27 Marek Safar <marek.safar@gmail.com>
7178 A fix for bug #79081
7179 * expression.cs (MemberAccess.DoResolve): Check nested type
7182 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
7184 * doc.cs : nested delegates were not handled. Fixed bug #79754.
7186 2006-10-26 Marek Safar <marek.safar@gmail.com>
7188 A fix for bug #76591
7189 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
7191 2006-10-26 Marek Safar <marek.safar@gmail.com>
7193 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
7194 type forwarder of the same type multiple times.
7196 2006-10-26 Raja R Harinath <rharinath@novell.com>
7199 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
7200 instance as an rvalue, even when we later resolve as an lvalue.
7202 2006-10-25 Martin Baulig <martin@ximian.com>
7204 * anonymous.cs: Fix #79673.
7206 2006-10-24 Marek Safar <marek.safar@seznam.cz>
7208 A fix for bug #79666
7209 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
7210 ignored when is optimized (= default value) as its value is already set.
7212 2006-10-23 Marek Safar <marek.safar@seznam.cz>
7214 A fix for bug #79724
7215 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
7216 TypeContainer for type lookup.
7218 2006-10-23 Marek Safar <marek.safar@seznam.cz>
7220 A fix for bug #79231
7221 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
7222 * expression.cs (OverloadResolve): Always convert type name for
7224 (ResolveNamespaceOrType): Don't confuse a nested type with any
7227 2006-10-18 Martin Baulig <martin@ximian.com>
7229 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
7231 2006-10-17 Miguel de Icaza <miguel@novell.com>
7233 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
7234 an int32, but requesting an int64 from the conversion
7236 2006-10-12 Martin Baulig <martin@ximian.com>
7239 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
7241 2006-10-12 Martin Baulig <martin@ximian.com>
7244 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
7246 2006-10-11 Miguel de Icaza <miguel@novell.com>
7248 * convert.cs: Remove broken code: I was doing the "Existance"
7249 tests for Implicit conversions.
7251 2006-10-10 Miguel de Icaza <miguel@novell.com>
7253 * convert.cs: Added one missing case in
7254 ImplicitStandardConversionExists uint64 to intptr.
7258 * typemanager.cs (uintptr_type): another core known type.
7260 * ecore.cs (OperatorCast): routine used to do cast operations that
7261 depend on op_Explicit. We could change some of the Decimal
7262 conversions to use this.
7264 This one has a probe mechanism that checks both types for an op_
7265 which it coudl be used to eliminate two classes: CastToDecimal
7266 and CastFromDecimal.
7268 * convert.cs: Implement the conversions documented in #59800
7270 2006-10-10 Martin Baulig <martin@ximian.com>
7272 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
7273 before RootScope.ResolveMembers().
7275 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
7276 `CurrentType' if appropriate.
7278 2006-10-09 Marek Safar <marek.safar@seznam.cz>
7280 A fix for bug #78568
7281 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
7282 when contains binary operators.
7283 * cs-parser.jay: Updated.
7285 2006-10-09 Martin Baulig <martin@ximian.com>
7288 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
7289 moved that into Define() and also do the other type parameter
7290 checks there. Fixes #79094. Added gtest-292.cs.
7293 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
7294 since that doesn't include type parameters; don't use `Ldelema'
7295 for type parameters. Fixes #78980. Added gtest-293.cs.
7297 2006-10-08 Marek Safar <marek.safar@seznam.cz>
7300 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
7301 conversion is allowed.
7303 2006-10-06 Marek Safar <marek.safar@seznam.cz>
7305 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
7306 error reporting when no error occurs.
7308 2006-10-06 Marek Safar <marek.safar@seznam.cz>
7310 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
7313 2006-10-06 Raja R Harinath <rharinath@novell.com>
7316 * class.cs (DefineTypeBuilder): Check circular dependencies before
7317 setting the parent of the TypeBuilder.
7318 (CheckRecursiveDefinition): Don't use 'BaseType', since
7319 it may not be valid until after DefineTypeBuilder. Use
7320 'base_type' instead.
7322 2006-10-04 Martin Baulig <martin@ximian.com>
7324 Merged the Anonymous Methods patch.
7326 * anonymous.cs, iterators.cs: The new anonymous methods code.
7328 * statement.cs (Variable): New public abstract class.
7329 (LocalInfo.Variable): New public property.
7330 (LocalInfo.ResolveVariable): New public method.
7331 (Block.Flags): Add `IsIterator'.
7332 (Block.AddVariable): Improved the CS0136 check.
7333 (Block.AnonymousChildren): New public property.
7334 (Block.AddAnonymousChild): New public method.
7335 (ToplevelBlock): Update to use the new anonymous method framework.
7336 (ToplevelBlock.ctor): `container' is now a `Block' and not a
7337 `ToplevelBlock'; this is required to correctly implement the
7339 (Fixed, Using): Use `TemporaryVariable' instead of directly
7340 creating the `LocalBuilder'.
7342 * parameter.cs (Parameter.ResolveVariable): New public method.
7343 (Parameters.ResolveVariable): Likewise.
7345 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
7347 * class.cs (TypeContainer): Replaced the `iterators' list and
7348 corresponding methods with a list of `CompilerGeneratedClass'es.
7349 (TypeContainer.ResolveMembers): New public method.
7350 (Method): `IIteratorContainer' has been replaced by
7353 * expression.cs (VariableReference): New public abstract base
7354 class for `LocalVariableReference', `ParameterReference' and
7357 * codegen.cs (EmitContext): Removed `capture_context',
7358 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
7359 (EmitContext.EmitThis): Removed.
7361 * cs-parser.jay: Replace `iterator_container' with
7364 2006-10-04 Martin Baulig <martin@ximian.com>
7366 * generic.cs (GenericMethod): Don't make this abstract.
7367 (Constraints.Clone): Added dummy implementation.
7369 2006-10-04 Raja R Harinath <harinath@gmail.com>
7372 * namespace.cs (LookForAnyGenericType): Avoid nullref on
7373 'declspaces'. Avoid allocating arrays willy-nilly.
7376 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
7377 cases out of the switch.
7379 2006-09-28 Marek Safar <marek.safar@seznam.cz>
7381 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
7382 message when non-generic type is used with the type arguments.
7383 * expression.cs: Updated.
7385 2006-09-28 Raja R Harinath <rharinath@novell.com>
7388 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
7389 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7390 Change semantics slightly. Don't insist on having only one
7391 temporary EmptyExpression -- just throttle the creation of new ones.
7394 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
7395 non-interfaces too. If no methods are found, don't try to create
7398 2006-09-28 Marek Safar <marek.safar@seznam.cz>
7400 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
7403 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
7404 us produce better error message.
7406 2006-09-27 Marek Safar <marek.safar@seznam.cz>
7408 * expression.cs (Binary.ResolveOperator): Warn about a side effect
7409 of the `|' operator.
7411 * report.cs: A new warning added.
7413 2006-09-27 Martin Baulig <martin@ximian.com>
7415 * generic.cs (GenericMethod): Don't make this abstract.
7417 2006-09-27 Martin Baulig <martin@ximian.com>
7420 (InternalErrorException): Added overloaded ctor taking a params array.
7422 2006-09-26 Marek Safar <marek.safar@seznam.cz>
7424 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
7425 Fixed the cases when same error was reported twice.
7427 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
7428 now report symbol information.
7430 2006-09-25 Martin Baulig <martin@ximian.com>
7432 * class.cs: Completely unified with the gmcs version.
7434 2006-09-25 Martin Baulig <martin@ximian.com>
7436 * typemanager.cs (TypeManager.IsNullableType): New public function.
7437 (TypeManager.IsNullableTypeOf): Likewise.
7438 (TypeManager.IsNullableValueType): Likewise.
7440 * class.cs (MethodCore): Added the `GenericMethod' argument from
7441 gmcs and also unified all classes derived from `MethodCore' with gmcs.
7443 2006-09-24 Raja R Harinath <harinath@gmail.com>
7445 * convert.cs: Unify with gmcs version.
7447 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7449 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
7450 verify them as well.
7452 * report.cs: New warning.
7454 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7456 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
7457 for anonymous block with out argument.
7459 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7461 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
7462 not used private events only.
7464 2006-09-23 Marek Safar <marek.safar@seznam.cz>
7466 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
7468 * const.cs (Const.Define): Check for constant type.
7469 (Const.IsConstantTypeValid): Looks for valid constant types.
7471 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
7473 * ecore.cs (EmptyConstantCast): New common class for all constant based
7476 * expression.cs (Is.DoResolve): Handle null constant especially.
7477 (New.DoResolve): Check for new void().
7478 (MemberAccess.DoResolve): Cope with all kind of nulls.
7480 * literal.cs (NullConstant): Uses EmptyConstantCast.
7481 (NullDefault): Based on EmptyConstantCast.
7482 (NullLiteral): Uses EmptyConstantCast.
7484 * statement.cs (Block.ResolveMeta): Check for constant type.
7486 2006-09-22 Martin Baulig <martin@ximian.com>
7488 * delegate.cs, attribute.cs: Merged with the gmcs versions.
7490 2006-09-22 Raja R Harinath <rharinath@novell.com>
7492 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
7496 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
7497 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
7500 2006-09-22 Martin Baulig <martin@ximian.com>
7502 * ecore.cs: Merged with the gmcs version.
7504 * generic.cs (ConstructedType): New dummy class.
7505 (TypeArguments): Don't make this abstract.
7508 (TypeManager.IsGenericTypeDefinition): New method.
7509 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
7511 2006-09-22 Raja R Harinath <rharinath@novell.com>
7513 * expression.cs (ComposedCast): Check for arrays of TypedReference
7514 before creating the type, not after.
7516 2006-09-21 Marek Safar <marek.safar@seznam.cz>
7518 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
7519 after ToType change.
7521 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
7522 when constant must be implicitly convertible.
7524 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
7526 * ecore.cs (NullCast): Derives from NullConstant.
7528 * expression.cs (Is.DoResolve): Removed useless variables.
7529 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
7530 (New.Constantify): Add enum support.
7531 (MemberAccess.DoResolve): Add warning when accessing null constant or
7534 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
7537 * literal.cs (NullConstant): New abstract class with common
7538 functionality for all null specializations.
7539 (NullDefault): Represents default(X) when result can be
7541 (NullLiteral): Updated.
7543 * report.cs: Add new warning.
7545 2006-09-21 Martin Baulig <martin@ximian.com>
7547 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
7549 2006-09-21 Martin Baulig <martin@ximian.com>
7551 * generic.cs (GenericConstraints): New dummy class.
7552 (Constraints): Likewise.
7553 (TypeParameter): Likewise.
7554 (TypeParameterName): Likewise.
7555 (GenericMethod): Likewise.
7557 * typemanager.cs (TypeManager.GetGenericArguments): New method.
7559 * decl.cs: Merged with the gmcs version.
7561 2006-09-21 Raja R Harinath <rharinath@novell.com>
7563 * generic.cs (TypeParameter): Implement IMemberContainer.
7564 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
7566 * rootcontext.cs: Unify with gmcs version.
7568 * report.cs: Unify with gmcs version.
7569 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
7570 from gmcs/generics.cs.
7571 * generics.cs (TypeParameter): New dummy class.
7573 * support.cs: Unify with gmcs version.
7575 2006-09-20 Raja R Harinath <rharinath@novell.com>
7577 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
7578 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
7580 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
7581 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
7582 * mcs.exe.sources: Add generic.cs.
7584 * codegen.cs: Unify with gmcs version.
7586 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
7587 (EmitContext): Add GenericDeclContainer implementation.
7588 * decl.cs (MemberCore, DeclSpace): Likewise.
7589 * namespace.cs: Remove #ifdef GMCS_SOURCE.
7591 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
7592 MCS TypeManager has a corresponding dummy method.
7594 2006-09-19 Martin Baulig <martin@ximian.com>
7596 * expression.cs: Completely merged with the gmcs version.
7598 2006-09-19 Martin Baulig <martin@ximian.com>
7600 * expression.cs (Invocation): Merged with the gmcs version.
7601 (ArrayAccess.GetStoreOpcode): Likewise.
7603 2006-09-19 Martin Baulig <martin@ximian.com>
7606 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
7607 (TypeManager.IsGenericMethodDefinition): Likewise.
7609 2006-09-19 Martin Baulig <martin@ximian.com>
7612 (TypeManager.IsEqual): Moved the gmcs implementation here.
7613 (TypeManager.DropGenericTypeArguments): Likewise.
7614 (TypeManager.DropGenericMethodArguments): Likewise.
7615 (TypeManager.GetTypeArguments): Moved here from gmcs.
7616 (TypeManager.HasGenericArguments): Likewise.
7618 2006-09-19 Martin Baulig <martin@ximian.com>
7620 * expression.cs (Binary): Merged with the gmcs version.
7622 2006-09-19 Martin Baulig <martin@ximian.com>
7624 * expression.cs (Probe, As, Is): Merged with the gmcs version.
7626 2006-09-19 Martin Baulig <martin@ximian.com>
7628 * typemanager.cs: Merged with the gmcs version.
7630 2006-09-16 Raja R Harinath <rharinath@novell.com>
7632 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
7633 * driver.cs: Likewise.
7635 2006-09-16 Marek Safar <marek.safar@seznam.cz>
7638 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
7639 only if parent type is class.
7640 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
7643 2006-09-15 Marek Safar <marek.safar@seznam.cz>
7646 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
7648 * typemanager.cs(CSharpName): Converts NullType to null.
7650 2006-09-15 Martin Baulig <martin@ximian.com>
7653 (TypeManager.GetMethodName): Added mcs implementation.
7654 (TypeManager.IsEqual): Likewise.
7657 (SimpleName.RemoveGenericArity): Added dummy implementation.
7659 * pending.cs: Merged with the gmcs version.
7661 2006-09-15 Martin Baulig <martin@ximian.com>
7663 * statement.cs: Merge with the gmcs version.
7665 2006-09-15 Martin Baulig <martin@ximian.com>
7667 * statement.cs (Switch): Merge with the gmcs implementation
7668 (without nullables), which is newer.
7670 2006-09-15 Martin Baulig <martin@ximian.com>
7672 * statement.cs (Block.Variables): Make this public.
7673 (ToplevelBlock.Parameters): Make this a property.
7674 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
7676 2006-09-15 Martin Baulig <martin@ximian.com>
7678 * namespace.cs: Merge with the gmcs version.
7680 2006-09-15 Martin Baulig <martin@ximian.com>
7682 * decl.cs (MemberName): Minor code cleanups.
7684 2006-09-15 Martin Baulig <martin@ximian.com>
7686 * parameter.cs: Merge with the gmcs version.
7688 2006-09-15 Martin Baulig <martin@ximian.com>
7690 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
7691 and an error in mcs.
7693 2006-09-15 Martin Baulig <martin@ximian.com>
7695 * flowanalysis.cs: Merged from GMCS; added the generics code into
7696 a `GMCS_SOURCE' conditional so we can share this file.
7698 2006-09-08 Martin Baulig <martin@ximian.com>
7700 * typemanager.cs (TypeManager.interlocked_type): New public field.
7701 (TypeManager.int_interlocked_compare-exchange): New public field.
7702 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
7703 enumerator types here and call InitGenericCoreTypes().
7704 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
7705 after calling InitEnumUnderlyingTypes().
7708 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
7709 `classes_second_stage'.
7711 2006-09-14 Marek Safar <marek.safar@seznam.cz>
7713 * assign.cs, ecore.cs, expression.cs: Share error message text.
7714 * class.cs (FieldMember.Define): Check for varible of static type.
7715 * driver.cs (LoadAssembly): Uses error output for errors.
7716 * statement.cs: Updated.
7718 2006-09-08 Marek Safar <marek.safar@seznam.cz>
7720 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
7723 2006-09-07 Martin Baulig <martin@ximian.com>
7726 (MainDriver): Revert r62663 from Marek; see #70506 for details.
7728 2006-08-29 Miguel de Icaza <miguel@novell.com>
7730 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
7732 2006-08-17 Miguel de Icaza <miguel@novell.com>
7734 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
7735 #52019 and #79064, the use of the \uXXXX sequence in source code
7736 to represent unicode characters.
7738 2006-08-15 Marek Safar <marek.safar@seznam.cz>
7740 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
7742 * class.cs, ecore.cs, statement.cs: Merged to one error message.
7744 2006-08-13 Miguel de Icaza <miguel@novell.com>
7746 * assign.cs: Catch attempts to assign to a method groups in += and
7749 2006-08-13 Marek Safar <marek.safar@seznam.cz>
7752 * cs-parser.jay: Don't destroy current array type by typeof of array's.
7754 2006-08-12 Marek Safar <marek.safar@seznam.cz>
7756 * class.cs (Method.Define): Issue a warning when generic method looks like
7758 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
7761 2006-08-09 Marek Safar <marek.safar@seznam.cz>
7763 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
7765 * decl.cs (MemberCache.FindMembers): When container is interface we need to
7766 search all base interfaces as a member can be ambiguous.
7767 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
7768 Constructor member type filter.
7769 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
7770 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
7771 reporting for returned memberinfos.
7772 * report.cs: Updated.
7773 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
7774 version to work on all runtimes.
7775 (TypeManager.RealMemberLookup): Removed members filtering.
7777 2006-08-08 Raja R Harinath <rharinath@novell.com>
7779 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
7780 (PropertyExpr.EmitAssign): Likewise.
7781 * expression.cs (Indirection.EmitAssign): Likewise.
7782 (LocalVariableReference.EmitAssign): Likewise.
7783 (ParameterReference.EmitAssign): Likewise.
7784 (Invocation.EmitArguments): Likewise.
7785 (ArrayAccess.EmitAssign): Likewise.
7786 (IndexerAccess.EmitAssign): Likewise.
7787 (This.EmitAssign): Likewise.
7788 (ConditionalLogicalOperator.Emit): Likewise.
7791 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
7792 instead of ArrayList. If the hashtable has a LocalBuilder, don't
7793 leave it in after returning it.
7794 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
7796 2006-08-06 Marek Safar <marek.safar@seznam.cz>
7798 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
7801 2006-08-03 Raja R Harinath <rharinath@novell.com>
7803 Fix cs0146-3.cs and cs0146-4.cs.
7804 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
7805 enclosing types don't depend on the current type.
7807 2006-08-02 Raja R Harinath <rharinath@novell.com>
7810 * class.cs (TypeContainer.DoDefineMembers): Use
7811 FindBaseMemberWithSameName on Parent, since we're interested in
7812 whether we hide inherited members or not.
7813 (FindBaseMemberWithSameName): Make slightly more robust.
7815 Fix the non-generic testcase from #77396
7816 * decl.cs (DeclSpace.DeclContainer): Remove override.
7818 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
7819 declspaces for doppelgangers too.
7820 (UsingEntry): Implement IResolveContext.
7821 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
7822 'this' as the resolve context.
7823 (LocalAliasEntry): Likewise.
7825 Implement parts of #77403
7826 * roottypes.cs (RootDeclSpace): New. Used to represent the
7827 toplevel declaration space. Each namespace declaration introduces
7828 a "partial" root declaretion space.
7829 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
7830 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
7831 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
7832 from 'current_namespace.SlaveDeclSpace'.
7833 (namespace_declaration): Likewise.
7834 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
7835 check. It can't happen now.
7836 * decl.cs (DeclSpace.LookupType): Likewise.
7837 * driver.cs (MainDriver): Sanity check.
7839 2006-08-01 Raja R Harinath <rharinath@novell.com>
7841 * decl.cs (DeclSpace.FindNestedType): Remove.
7842 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
7843 LookupTypeContainer to get the container of the nested type.
7844 * class.cs (TypeContainer.FindNestedType): Make non-override.
7846 2006-07-31 Raja R Harinath <rharinath@novell.com>
7848 * decl.cs (DeclSpace.PartialContainer): Move field from ...
7849 * class.cs (TypeContainer.PartialContainer): ... here.
7850 (TypeContainer.AddBasesForPart): New helper.
7851 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
7853 * cs-parser.jay (current_class): Convert to DeclSpace.
7854 (struct_declaration, interface_declaration, class_declaration):
7855 Use AddBasesForPart instead of .Bases directly.
7856 * const.cs, iterators.cs: Update to changes.
7858 2006-07-28 Raja R Harinath <rharinath@novell.com>
7860 * class.cs (TypeContainer.AddMemberType): Rename from
7862 (TypeContainer.AddMember): Rename from AddToMemberContainer.
7863 (AddTypeContainer): New. Combine AddClassOrStruct and
7865 (AddPartial): Update. Add 'is_partial' argument.
7866 * roottypes.cs: Update to changes.
7867 * cs-parser.jay (push_current_class): New helper for handling
7868 current_container and current_class.
7869 (struct_declaration, interface_declaration, class_declaration):
7872 2006-07-26 Raja R Harinath <rharinath@novell.com>
7874 * roottypes.cs: Rename from tree.cs.
7876 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
7877 * tree.cs (Tree, ITreeDump): Remove types.
7878 * rootcontext.cs (tree, Tree): Remove fields.
7879 (root, ToplevelTypes): New.
7880 * *.cs: Update to rename.
7882 * tree.cs (Tree.RecordDecl): Remove.
7883 (RootTypes.AddToTypeContainer): Record the toplevel type in its
7885 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
7887 2006-07-23 Raja R Harinath <harinath@gmail.com>
7889 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
7890 DoFlowAnalysis and OmitStructFlowAnalysis here.
7891 (ec.With): Rename from WithUnsafe and generalize.
7892 (ec.WithCheckState): Remove. All users can be handled by 'With'.
7893 (ec.WithFlowAnalyis): New.
7894 * ecore.cs, expression.cs, statement.cs: Update.
7896 2006-07-22 Raja R Harinath <harinath@gmail.com>
7898 * statement.cs (Block.ResolveMeta): Simplify slightly.
7900 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
7901 multiple boolean fields. Convert InUnsafe, constant_check_state,
7902 check_state to flags.
7903 (CheckState, ConstantCheckState): Update.
7904 (InUnsafe): New read-only property.
7905 (FlagsHandle): Rename from CheckStateHandle and convert to handle
7907 (WithUnsafe): New helper similar to WithCheckState.
7908 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
7909 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
7911 2006-07-21 Raja R Harinath <rharinath@novell.com>
7913 Make comparisons use the same IL irrespective of whether they're
7914 in a 'checked' or 'unchecked' context: one of the issues in #78899
7915 * codegen.cs (EmitContext.CheckState): Make read-only property.
7916 (EmitContext.ConstantCheckState): Likewise.
7917 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
7918 helper that implement a save/restore stack for CheckState
7919 values. This is the only way to change check-state.
7920 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
7921 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
7922 (CheckedExpr.EmitBranchable): New forwarding method.
7923 (UnCheckedExpr): Likewise.
7924 * statement.cs (Block.ResolveMeta): Use WithCheckState.
7925 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
7926 (Checked.Resolve, checked.DoEmit): Likewise.
7928 2006-07-20 Miguel de Icaza <miguel@novell.com>
7930 * anonymous.cs: Cache the resolved anonymous delegate, and return
7931 this so that the ResolveTopBlock is only triggered once, not
7934 Currently we trigger ResolvetopBlock twice due to a first pass of
7935 argument check compatibility, and a second pass that does the
7938 2006-07-15 Marek Safar <marek.safar@seznam.cz>
7940 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
7942 * rootcontext.cs (Reset): Add helper_classes.
7944 2006-07-15 Marek Safar <marek.safar@seznam.cz>
7947 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
7950 2006-07-13 Miguel de Icaza <miguel@novell.com>
7952 * statement.cs (Lock): Handle expressions of type
7953 TypeManager.null_type specially. Fixes #78770
7955 2006-07-08 Marek Safar <marek.safar@seznam.cz>
7957 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
7960 2006-07-08 Marek Safar <marek.safar@seznam.cz>
7962 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
7963 for accessors as well.
7964 * ecore.cs (EventExpr): Add AccessorTable.
7966 2006-07-01 Marek Safar <marek.safar@seznam.cz>
7969 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
7970 for CS0122 where appropriate.
7971 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
7973 (Filter): Assembly can be null in the case of top level attributes.
7975 2006-06-25 Marek Safar <marek.safar@seznam.cz>
7979 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
7980 is done at global level.
7982 2006-06-24 Marek Safar <marek.safar@seznam.cz>
7984 A fix for #77002, Implemented TypeForwarder support.
7986 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
7987 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
7988 * typemanager.cs (): Add type_forwarder_attr_type.
7990 2006-06-24 Marek Safar <marek.safar@seznam.cz>
7992 * report.cs: Add CS0469 warning.
7994 2006-06-21 Martin Baulig <martin@ximian.com>
7996 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
7997 the `try'-block, so we also report CS0016 etc. there.
7999 2006-06-21 Martin Baulig <martin@ximian.com>
8002 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
8004 2006-06-21 Martin Baulig <martin@ximian.com>
8006 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
8007 also report CS1686 for parameters.
8009 2006-06-21 Martin Baulig <martin@ximian.com>
8011 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
8012 instead of an error if the value is not implicitly convertible to
8013 the switch types; fixes #77964.
8015 2006-06-21 Raja R Harinath <rharinath@novell.com>
8018 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
8019 FieldBuilder is null.
8022 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
8023 'left' and 'right' before error-checking.
8025 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
8027 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
8029 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
8030 (FieldExpr.DoResolve): likewise.
8031 (PropertyExpr.InstanceResolve): likewise.
8032 (EventExpr.InstanceResolve): likewise.
8034 2006-06-04 Marek Safar <marek.safar@seznam.cz>
8036 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
8037 attribute applicable tests for attribute argument.
8039 2006-06-02 Raja R Harinath <rharinath@novell.com>
8042 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
8043 (Binary.OverloadResolve_PredefinedIntegral): New.
8044 (Binary.OverloadResolve_PredefinedFloating): New.
8045 (Binary.OverloadResolve_PredefinedString): New.
8046 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
8047 Follow the standard more closely, and treat numeric promotions in
8048 terms of overload resolution.
8049 (Binary.CheckShiftArguments): Simplify.
8051 2006-06-01 Raja R Harinath <rharinath@novell.com>
8053 * flowanalysis.cs (MyBitVector): Simplify representation.
8054 (MyBitVector.Clone): Avoid allocating BitArray.
8055 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
8056 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
8057 (*): Update. Change all references to MyBitVector.And and
8058 MyBitVector.Or to &= and |=.
8060 2006-05-29 Raja R Harinath <rharinath@novell.com>
8063 * cs-parser.jay (formal_parameter_list): Extend the pattern below
8064 to param arguments too.
8066 2006-05-26 Miguel de Icaza <miguel@novell.com>
8068 * cs-parser.jay: Catch another parsing form for arglist being
8069 followed by other arguments. Fixes #78313.
8071 2006-05-24 Raja R Harinath <rharinath@novell.com>
8073 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
8074 checking of out parameters to ...
8075 (FlowBranchingToplevel.Merge): ... here.
8076 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
8077 set, propagate the origin upward, and only complain if there was
8079 (FlowBranchingException.AddContinueOrigin): Likewise.
8080 (FlowBranchingException.AddReturnOrigin): Likewise.
8081 (FlowBranchingException.AddGotoOrigin): Likewise.
8083 2006-05-23 Raja R Harinath <rharinath@novell.com>
8085 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
8086 unreachable, skip it.
8087 (FlowBranchingException.Merge): Always propagate jumps, even if
8088 the finally block renders subsequent code unreachable.
8090 2006-05-18 Raja R Harinath <rharinath@novell.com>
8093 * statement.cs (Goto.Resolve): Move responsibility for resolving
8094 'goto' to FlowBranching.AddGotoOrigin.
8095 (Goto.SetResolvedTarget): New. Callback to set the
8096 LabeledStatement that's the target of the goto.
8097 (Goto.DoEmit): Use Leave instead of Br when crossing an
8098 unwind-protect boundary.
8099 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
8100 LookupLabel and adjust to new semantics.
8101 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
8102 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
8103 Goto.SetResolvedTarget to update target.
8104 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
8105 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
8106 AddBreakOrigin & co. Delay propagation until ...
8107 (FlowBranchingException.Merge): ... this.
8109 * statement.cs (Block.Resolve): Always depend on flow-branching to
8110 determine unreachability. Kill workaround that originally emitted
8111 only one statement after an "unreachable" label (see infloop in
8114 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
8115 This is still "wrong", but anything better would probably need a
8116 multi-pass algorithm.
8117 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
8118 usage vector. Force current usage vector to be reachable, to
8119 optimistically signify backward jumps.
8120 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
8122 (FlowBranchingLabeled.Merge): New. If no backward jump was
8123 detected, return the original salted-away usage vector instead,
8124 updated with appropriate changes. Print unreachable warning if
8126 * statement.cs (Block.Resolve): Don't print unreachable warning on
8127 a labeled statement.
8129 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
8131 * driver.cs: Pass filename without path to AssemblyBuilder's
8132 AddResourceFile. Fixes bug #78407.
8134 2006-05-17 Raja R Harinath <rharinath@novell.com>
8136 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
8137 * flowanalysis.cs (FlowBranchingLabeled): ... here.
8138 (FlowBranching.MergeChild): Overwrite
8139 reachability information from Labeled branchings too.
8141 2006-05-16 Raja R Harinath <rharinath@novell.com>
8143 * statement.cs (Goto.Resolve): Merge jump origins here ...
8144 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
8146 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
8147 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
8148 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
8149 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
8151 * statement.cs (Goto.Resolve): ... not here.
8152 (Goto.Emit): Remove CS1632 check.
8154 2006-05-14 Marek Safar <marek.safar@seznam.cz>
8156 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
8159 2006-05-11 Raja R Harinath <rharinath@novell.com>
8161 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
8162 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
8163 (FlowBranchingException.Label): Likewise.
8165 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
8167 (MyBitVector.Or): Use it to avoid losing information (Count).
8168 (FlowBranching.MergeOrigins): Likewise.
8170 * flowanalysis.cs (UsageVector.IsDirty): Remove.
8171 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
8172 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
8173 (UsageVector.ToString): Simplify.
8174 (UsageVector.MergeSiblings): Move here from ...
8175 (FlowBranching.Merge): ... here.
8176 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
8179 2006-05-10 Raja R Harinath <rharinath@novell.com>
8181 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
8182 null bitvector is treated as all-true.
8184 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
8185 (MyBitVector): Rationalize invariants. 'vector != null' implies
8186 that we have our own copy of the bitvector. Otherwise,
8187 'InheritsFrom == null' implies all inherited bits are true.
8189 2006-05-09 Marek Safar <marek.safar@seznam.cz>
8191 * statement.cs (LocalInfo): Add IsConstant.
8192 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
8193 local variable for constants.
8195 2006-05-09 Raja R Harinath <rharinath@novell.com>
8197 * flowanalysis.cs (MyBitVector.Empty): New.
8198 (MyBitVector): Don't allow InheritedFrom to be null.
8199 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
8200 (UsageVector, FlowBranching): Update to changes.
8202 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
8203 recursion. The 'Parent == null' condition isn't sufficient for
8205 (FlowBranching.AddBreakOrigin): Likewise.
8206 (FlowBranching.AddContinueOrigin): Likewise.
8207 (FlowBranching.AddReturnOrigin): Likewise.
8208 (FlowBranching.StealFinallyClauses): Likewise.
8209 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
8210 (FlowBranching.CheckOutParameters): Likewise.
8211 (FlowBranchingToplevel): Terminate all the above recursions here.
8212 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
8213 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
8215 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
8217 (FlowBranchingToplevel): New. Empty for now.
8218 (FlowBranching.MergeTopBlock): Update.
8219 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
8220 branching for the anonymous delegate.
8221 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
8223 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
8224 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
8225 information at the start of the merge. Reorganize.
8227 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8229 * class.cs (MethodData.Define): Method cannot implement interface accessor.
8231 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8233 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
8234 to newly introduced ctor.
8236 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
8237 message to one place.
8238 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
8241 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8243 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
8245 * ecore.cs (Expression.ResolveAsConstant): Updated.
8247 * statement.cs (ResolveMeta): Updated.
8249 2006-05-06 Marek Safar <marek.safar@seznam.cz>
8251 * cs-parser.jay: __arglist cannot be used in initializer.
8253 2006-05-06 Marek Safar <marek.safar@seznam.cz>
8256 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
8259 2006-05-05 Raja R Harinath <rharinath@novell.com>
8261 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
8262 (LabeledStatement): Add 'name' parameter.
8263 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
8264 (Block.AddLabel): Update to changes.
8265 * cs-parser.jay (labeled_statement): Likewise.
8267 * flowanalysis.cs (BranchingType.Labeled): New.
8268 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
8269 (FlowBranchingLabeled): New. Does nothing for now, but will
8270 eventually handle 'goto' flows.
8271 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8272 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
8273 that's terminated ...
8274 (Block.Resolve): ... here.
8276 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
8277 (UsageVector.MergeFinallyOrigins): Likewise.
8278 (FlowBranching.InTryOrCatch): Likewise.
8279 (FlowBranching.AddFinallyVector): Likewise.
8280 (FlowBranchingException): Update to changes.
8283 * statement.cs (Return.Resolve): Move error checking to ...
8284 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
8285 (FlowBranchingException): Handle return origins like break and
8287 (FlowBranching.UsageVector.CheckOutParameters): Remove.
8289 2006-05-04 Marek Safar <marek.safar@seznam.cz>
8292 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
8295 2006-05-04 Marek Safar <marek.safar@seznam.cz>
8298 * class.cs (MethodData.Define): Do public accessor check only when method
8299 implements an interface.
8301 2006-05-04 Raja R Harinath <rharinath@novell.com>
8303 Remove special handling of 'break'
8304 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
8305 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
8306 (UsageVector.Break): Remove.
8307 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
8309 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
8311 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
8312 UsageVector.Breaks (). Don't set NeedsReturnLabel.
8314 2006-05-03 Marek Safar <marek.safar@seznam.cz>
8317 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
8318 be the interface member.
8320 2006-05-03 Marek Safar <marek.safar@seznam.cz>
8323 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
8324 for emitting small (int) values.
8326 2006-05-03 Raja R Harinath <rharinath@novell.com>
8329 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
8330 control-flow passes through the 'finally' after merging-in all the
8331 control-flows from 'try' and the 'catch' clauses.
8333 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
8334 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
8335 always true at the only non-recursive entry point.
8336 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
8337 FlowBranchingBreakable.
8338 (FlowBranchingLoop): Remove.
8339 * statement.cs (Return.DoResolve): Update to changes.
8342 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
8343 (FlowBranching.CreateBranching): Handle it: create a
8344 FlowBranchingContinuable.
8345 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
8346 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
8347 except that it handles the 'continue' command.
8348 (FlowBranching.UsageVector.MergeOrigins): Rename from
8350 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
8351 except that it overrides AddContinueOrigin.
8352 (FlowBranchingException): Override AddContinueOrigin, similar to
8354 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
8355 Create a new branching around the embedded statement.
8356 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
8357 control flow after the embedded statement.
8358 (Continue.Resolve): Move all error checking to AddContinueOrigin.
8360 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
8361 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
8362 FlowBranchingBreakable.
8363 (FlowBranchingSwitch): Remove.
8366 * statement.cs (Break.Resolve): Simplify. Move responsibility for
8367 error reporting to ...
8368 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
8369 Rename from 'AddBreakVector'. Add new location argument. Return
8370 a bool indicating whether the 'break' crosses an unwind-protect.
8371 (FlowBranchingException.AddBreakOrigin): Add.
8372 (FlowBranchingException.Merge): Propagate 'break's to surrounding
8373 flowbranching after updating with the effects of the 'finally'
8375 (FlowBranchingBreakable): New common base class for
8376 FlowBranchingLoop and FlowBranchingSwitch.
8378 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
8380 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
8382 2006-05-02 Raja R Harinath <rharinath@novell.com>
8384 * statement.cs (Do.Resolve): If the loop is infinite, set the
8386 (While.Resolve, For.Resolve): Set a barrier after the embedded
8387 statement. There's no direct control flow that goes from the end
8388 of the embedded statement to the end of the loop.
8389 * flowanalysis.cs (FlowBranching.Infinite): Remove.
8390 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
8391 above ensure that the reachability is correctly computed.
8393 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
8394 (UsageVector.MergeBreakOrigins): If the current path is
8395 unreachable, treat it as if all parameters/locals are initialized.
8396 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
8397 infinite loops before merging-in break origins.
8399 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
8400 (Reachability.Reachable): Split part into ...
8401 (Reachability.Unreachable): ... this. Simplify.
8402 (Reachability.IsUnreachable): Use 'Unreachable' instead.
8404 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
8405 (Reachability.SetThrowsSometimes): Likewise.
8406 (FlowBranchingBlock.MergeTopBlock): Don't compare against
8407 TriState.Always, use corresponding property.
8408 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
8409 (Block.Resolve): Likewise. Remove some redundant checks.
8411 2006-05-02 Raja R Harinath <harinath@gmail.com>
8413 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
8414 (Reachability.Meet): Don't bother checking AlwaysThrows --
8415 barrier is always set.
8416 (FlowBranchingBlock.Merge): Likewise.
8418 2006-05-01 Raja R Harinath <harinath@gmail.com>
8420 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
8421 checks for unreachable.
8423 2006-05-01 Marek Safar <marek.safar@seznam.cz>
8426 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
8428 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
8429 whether field is really assigned.
8431 2006-04-30 Raja R Harinath <harinath@gmail.com>
8433 * flowanalysis.cs (Reachability): Make 4-argument constructor
8435 (Reachability.Meet): Rename from 'And'. Remove static variant.
8436 (Reachability.Always): Rename from the highly misleading
8437 'Reachability.Never'.
8438 (FlowBranching.Merge): Update to changes. Mark an impossible
8439 situation with a 'throw'.
8440 (*): Update to changes.
8442 2006-04-29 Raja R Harinath <harinath@gmail.com>
8444 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
8446 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
8447 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
8448 (*): Update to changes.
8449 * statement.cs: Update to changes.
8451 2006-04-28 Marek Safar <marek.safar@seznam.cz>
8454 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
8456 2006-04-28 Raja R Harinath <harinath@gmail.com>
8458 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
8461 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
8462 argument to two arguments: an usage-vector and a bool. Move call
8463 to FlowBranching.Merge () ...
8464 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
8466 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
8467 handling of loop and switch reachability to ...
8468 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
8470 2006-04-27 Raja R Harinath <harinath@gmail.com>
8472 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
8473 handling to FlowBranchingLoop.InLoop.
8474 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
8476 2006-04-26 Marek Safar <marek.safar@seznam.cz>
8479 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
8480 anonymous method is allowed from AnonymousContainer here.
8482 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
8484 2006-04-24 Raja R Harinath <rharinath@novell.com>
8487 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
8489 2006-04-23 Marek Safar <marek.safar@seznam.cz>
8492 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
8493 (DoubleConstant.Reduce): Ditto.
8495 2006-04-23 Raja R Harinath <rharinath@novell.com>
8497 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
8498 Remove 'lvalue_right_side' argument. Move parts to ...
8499 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
8500 (LocalVariable.DoResolveLValue): ... these.
8502 2006-04-21 Raja R Harinath <rharinath@novell.com>
8505 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
8506 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
8507 (LocalVariableReference.DoResolveBase): Use it to implement new
8509 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
8510 (Argument.Resolve): Simplify. Move CS1510 check ...
8511 * ecore.cs (Expression.ResolveLValue): ... here.
8512 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
8513 (PropertyExpr.DoResolveLValue): Likewise.
8514 (FieldExpr.Report_AssignToReadonly): Likewise.
8515 (FieldExpr.DoResolve): Add 'out_access' argument. Use
8516 LValueMemberAccess or LValueMemberOutAccess on instance depending
8518 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
8519 DoResolve as appropriate.
8521 2006-04-20 Raja R Harinath <rharinath@novell.com>
8524 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
8525 implicit conversions on 'out' and 'ref' arguments.
8527 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
8528 improve clarity. Remove dead code.
8531 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
8532 (Catch.Resolve): Resolve VarBlock if it exists.
8534 2006-04-19 Miguel de Icaza <miguel@novell.com>
8536 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
8537 twice, this was some residual code, the enumerator was emitted
8538 properly in the two branche of if later.
8540 2006-04-19 Raja R Harinath <rharinath@novell.com>
8542 * expression.cs (Cast.ResolveLValue): Remove. The result of a
8543 cast is never an lvalue.
8544 (Cast.DoResolve, Cast.ResolveRest): Combine.
8545 (Argument.Emit): Simplify slightly. Move 'Expr is
8546 IMemoryLocation' check ...
8547 (Argument.Resolve): ... here.
8548 (Argument.Error_LValueRequired): Remove. Inline into only user.
8550 Simplifications. Fix cs0191-2.cs
8551 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
8552 CS1649 and CS1651 to ...
8553 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
8554 the actual selection of the error code and message to a lookup
8555 table. Add a dummy return value to simplify callsites.
8556 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
8557 readonly fields of other instances of the same type. Move CS0197
8559 * expression.cs (Argument.Resolve): ... here. Simplify code.
8560 Ensure that ec.InRefOutArgumentResolving is only set during LValue
8561 resolution of an out or ref argument. The code simplification
8562 above uses this invariant.
8564 2006-04-18 Raja R Harinath <rharinath@novell.com>
8566 Possibly fix #77752. Fix cs1690-[4-7].cs.
8567 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
8568 CheckMarshallByRefAccess. Drop parameter.
8569 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
8571 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
8573 * report.cs (AllWarnings): Add CS1690.
8574 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
8576 (LocalVariableReference.DoResolveBase): Update.
8578 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8580 * class.cs (MethodOrOperator): Moved common parts from method class.
8581 detect obsolete attributes.
8582 (Method.Define): Simplified as it reuses code from base.
8583 (Constructor.ValidAttributeTargets): Fixed issue found during
8585 (Destructor.ValidAttributeTargets): Fixed issue found during
8587 (Operator): Finished refactoring set off by #78020. Operator class is now
8588 ordinary method class.
8590 * anonymous.cs: Updated.
8592 * decl.cs (DeclSpace): Add IsGeneric
8594 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8596 * class.cs (Constructor.Emit): Don't emit the attributes twice.
8598 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8600 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
8601 detect obsolete attributes.
8602 (Method.CreateEmitContext): Moved to MethodOrOperator.
8604 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8607 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
8608 customized exception to make crash detection easier.
8609 (MethodOrOperator): Started to work on new base class for methods and
8611 (Method): Derives from MethodOrOperator.
8612 (Constructor.Emit): Emits its own attributes.
8613 (AbstractPropertyEventMethod.Emit): Ditto.
8614 (Operator): Derives from MethodOrOperator, will refactor fully in extra
8616 (Operator.Emit): It's temporary more tricky than should be.
8618 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
8620 * report.cs (InternalErrorException): Add ctor with inner exception.
8622 2006-04-08 Marek Safar <marek.safar@seznam.cz>
8625 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
8628 2006-04-07 Marek Safar <marek.safar@seznam.cz>
8631 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
8634 2006-04-06 Marek Safar <marek.safar@seznam.cz>
8636 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
8637 attribute is present and Guid not.
8638 (Interface.ApplyAttributeBuilder): Ditto.
8640 * attribute.cs: Add error message.
8642 2006-04-06 Marek Safar <marek.safar@seznam.cz>
8646 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
8647 sources (it's composite) so hold them in extra array as they are used in
8648 Emit phase only. It worked in the previous versions by mistake.
8649 (Attribute.Emit): Emit attribute for more owners when exist.
8651 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
8652 it has now different behaviour.
8654 2006-04-04 Marek Safar <marek.safar@seznam.cz>
8656 * constant.cs (Constant.IsDefaultInitializer): New method.
8658 * class.cs: Updated.
8660 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
8661 re-initialize default values. It saves KBs almost for every assembly.
8662 Thanks Zoltan for the idea.
8663 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
8664 (ArrayCreation.DoResolve): Resolve only once.
8665 (ArrayCreation.Emit): Emit static initializer only when it is faster.
8666 (ArrayCreation.GetAttributableValue): Cope with optimized values.
8668 2006-04-03 Zoltan Varga <vargaz@gmail.com>
8670 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
8673 2006-04-01 Marek Safar <marek.safar@seznam.cz>
8675 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
8676 in an embedded statement too.
8678 2006-04-01 Raja R Harinath <rharinath@novell.com>
8681 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
8683 2006-04-01 Marek Safar <marek.safar@seznam.cz>
8687 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
8690 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
8692 2006-03-31 Marek Safar <marek.safar@seznam.cz>
8694 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
8697 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
8698 LocalTemporary change.
8700 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
8702 (ClassOrStruct.DefineFieldInitializers): Implemented static field
8703 initializers optimization.
8704 (ClassOrStruct.TypeAttr): Moved from modifiers.
8705 (Constructor.CheckBase): Don't crash when static ctor has parameters.
8706 (FieldBase.ResolveInitializer): Resolves initializer.
8707 (FieldBase.HasDefaultInitializer): New property.
8709 * cs-parser.jay: Removed message.
8711 * expression.cs (CompilerGeneratedThis): New specialization.
8713 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
8715 2006-03-28 Marek Safar <marek.safar@seznam.cz>
8717 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
8719 2006-03-27 Marek Safar <marek.safar@seznam.cz>
8721 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
8722 be now EnumConstants only.
8724 2006-03-27 Marek Safar <marek.safar@seznam.cz>
8726 * attribute.cs, driver.cs: Reset more caches.
8728 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8730 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
8732 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8734 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
8735 for easier reuse. Updated all overrides.
8736 (IntegralConstant): New base class for all integral constants.
8737 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
8738 of the constant range, report custom error.
8739 (UIntConstant.Reduce): Fixed uint conversion.
8741 * ecore.cs, literal.cs: Reduce updates.
8743 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8747 * class.cs (Constructor.Define): Removed extra if for default ctors.
8748 A patch from Atsushi Enomoto.
8750 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8752 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
8753 GetAttributableValue.
8755 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
8758 * convert.cs (ImplicitConversionRequired): Error message moved to
8761 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
8762 automatic implicit conversion of an output value.
8763 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
8765 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
8767 (TypeOf.GetAttributableValue): Add extra handling for object type.
8769 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
8770 special error message.
8772 2006-03-25 Marek Safar <marek.safar@seznam.cz>
8774 * class.cs (Constructor.Emit): Don't crash when struct ctor is
8776 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
8777 compatible with MS runtime.
8779 2006-03-23 Marek Safar <marek.safar@seznam.cz>
8781 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
8782 attribute arguments here.
8784 * class.cs (Indexer.Define): The check was moved to attribute class.
8786 2006-03-22 Marek Safar <marek.safar@seznam.cz>
8788 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
8789 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
8792 2006-03-22 Raja R Harinath <rharinath@novell.com>
8794 Support ParameterDefaultValueAttribute in gmcs. Also applied to
8795 mcs to keep code differences small.
8796 * attribute.cs (Attribute.GetParameterDefaultValue): New.
8797 * typemanager.cs (parameter_default_value_attribute_type): New.
8798 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
8801 2006-03-21 Marek Safar <marek.safar@seznam.cz>
8803 * expression.cs (StringConcat.Append): Reverted back to no warning state.
8805 2006-03-21 Marek Safar <marek.safar@seznam.cz>
8807 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
8809 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
8812 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
8814 * doc-bootstrap.cs : fix build.
8816 2006-03-20 Marek Safar <marek.safar@seznam.cz>
8818 * expression.cs (StringConcat.Append): Issue a warning when empty string
8821 2006-03-20 Marek Safar <marek.safar@seznam.cz>
8823 * assign.cs (CompoundAssign.ResolveSource): Removed.
8825 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
8828 * class.cs (TypeContainer.FindMethods): Removed.
8829 (TypeContainer.CheckMemberUsage): Made static.
8831 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
8833 * constant.cs (CheckRange): Removed unused type argument.
8834 (CheckUnsigned): Removed unused type argument.
8836 * cs-parser.jay: Updated after MemberAccess clean up.
8837 Uses Length for empty string test.
8839 * cs-tokenizer.cs: Uses Length for empty string test.
8840 (IsCastToken): Made static.
8841 (is_hex): Made static.
8842 (real_type_suffix): Made static.
8844 * decl.cs (SetupCache): Made static.
8845 (OnGenerateDocComment): Removed unused ds argument.
8847 * delegate.cs (VerifyDelegate): Removed unused argument.
8849 * doc.cs: Uses Length for empty string test.
8851 * driver.cs: Uses Length for empty string test.
8853 * enum.cs (IsValidEnumType): Made static
8855 * expression.cs (EnumLiftUp): Removed unused argument.
8856 (ResolveMethodGroup): Ditto.
8857 (BetterConversion): Ditto.
8858 (GetVarargsTypes): Ditto.
8859 (UpdateIndices): Ditto.
8860 (ValidateInitializers): Ditto.
8861 (MemberAccess.ctor): Ditto.
8862 (GetIndexersForType): Ditto.
8864 * flowanalysis.cs: (MergeFinally): Removed unused argument.
8866 * iterators.cs: Updated after MemberAccess clean up.
8868 * location.cs: Uses Length for empty string test.
8870 * namespace.cs: Uses Length for empty string test.
8872 * report.cs (CheckWarningCode): Made static.
8874 * statement.cs (LabeledStatement): Removed unused argument.
8876 * typemanager.cs (FilterNone): Removed.
8878 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8880 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
8883 * class.cs: Updated.
8885 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8887 * cs-parser.jay.cs: __arglist is not allowed for delegates.
8889 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8893 * expression.cs (VerifyArgumentsCompat): Reverted to double error
8894 reporting, it's more tricky than I thought.
8896 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8900 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
8902 (AnonymousMethod.ImplicitStandardConversionExists): New method.
8903 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
8904 Add more error reporting; Fixed issue with params.
8906 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
8908 * cs-parser.jay: AnonymousMethod requires host container.
8910 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
8912 2006-03-18 Raja R Harinath <harinath@gmail.com>
8914 * class.cs: Change 'TypeContainer ds' constructor argument to
8915 'DeclSpace parent'. Some classes were missed below due to
8916 different naming convention.
8918 * class.cs (MemberCore.Parent): Delete. This makes the
8919 ParentContainer changes below enforceable by the compiler.
8921 Treat pointers to enclosing declaration space as 'DeclSpace', not
8923 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
8924 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
8926 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
8928 (Block.AddThisVariable): Likewise.
8929 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
8930 (AbstractPropertyEventMethod.Emit): Likewise.
8931 (AbstractPropertyEventMethod.EmitMethod): Likewise.
8932 (GetMethod.Define, SetMethod.Define): Likewise.
8933 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
8934 (DelegateMethod.EmitMethod): Likewise.
8936 Fix regression test-partial-13.cs.
8937 Rationalize use of PartialContainer. Ensure that the partial
8938 class semantics can be tied to type-correctness, i.e., any
8939 violation will cause a compile error.
8940 * class.cs, const.cs: Access all fields that belong to class
8941 TypeContainer via ParentContainer. Arguments of EmitContexts and
8942 Resolve()-like functions still use 'Parent'.
8944 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
8945 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
8946 (PropertyMethod.CheckModifiers): Remove unused argument.
8947 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
8950 2006-03-17 Raja R Harinath <harinath@gmail.com>
8952 Make semantics of PartialContainer simpler.
8953 * decl.cs (DeclSpace.IsPartial): Remove.
8954 * class.cs (TypeContainer.IsPartial): Likewise.
8955 (TypeContainer..ctor): Set PartialContainer to point to self.
8956 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
8957 (TypeContainer.FindNestedType): Likewise.
8958 (MemberCore.ParentContainer): Simplify. Remove deprecation.
8960 2006-03-17 Marek Safar <marek.safar@seznam.cz>
8962 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
8964 2006-03-15 Marek Safar <marek.safar@seznam.cz>
8966 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
8969 2006-03-15 Marek Safar <marek.safar@seznam.cz>
8971 * class.cs (Operator.Define): An error for base conversion was not
8974 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
8976 * iterator.cs : yield break is allowed in try statement which has
8977 catch clauses. Fixed bug #77767.
8979 2006-03-13 Marek Safar <marek.safar@seznam.cz>
8981 A fix for #77593, #77574.
8983 * class.cs (MethodCore.CheckBase): Another if for operator.
8985 2006-03-09 Marek Safar <marek.safar@seznam.cz>
8987 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
8990 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
8991 (DelegateCreation.ImplicitStandardConversionExists): New method for just
8994 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
8997 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
8998 Updated after another emitcontext usage was clean up. It should help us to
8999 synchronize with gmcs easier.
9001 2006-03-04 Marek Safar <marek.safar@seznam.cz>
9005 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
9006 (Event.Define): ditto
9007 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
9009 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
9010 Removed redundant code and set NewSlot for Invoke method too.
9012 * parameter.cs (Parameters.ctor): Add custom, type ctor.
9013 (Parameters.MergeGenerated): New method. Use this method when you merge
9014 compiler generated argument with user arguments.
9016 2006-03-03 Marek Safar <marek.safar@seznam.cz>
9018 * attribute.cs (ResolveAsTypeTerminal): Removed.
9020 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
9021 specialization for predefined types; 30% speed up.
9022 Finally placed obsolete check to right place.
9023 (Expression.ResolveType): Removed.
9025 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
9026 Updated after ResolveType was removed.
9028 * expression.cs (Cast.ctor): Check void cast.
9029 (Binary.ResolveAsTypeTerminal): Is never type.
9030 (Conditional.ResolveAsTypeTerminal): Is never type.
9032 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
9034 2006-03-01 Raja R Harinath <rharinath@novell.com>
9037 * expression.cs (ParameterReference.DoResolveBase): Change return
9039 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
9043 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
9046 * typemanager.cs (GetFullNameSignature): Don't nullref on
9047 protected accessors.
9049 2006-02-27 Marek Safar <marek.safar@seznam.cz>
9051 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
9052 these two separated members to simplify the code.
9053 (Attribute.Resolve): Refactored to use new fields and methods.
9054 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
9055 implemented obsolete attribute checking.
9056 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
9057 implemented obsolete checking again. It look line never ending quest ;-)
9058 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
9060 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
9062 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
9064 *class.cs (Property.Define): Add RegisterProperty call.
9066 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
9067 argument groups (only 2).
9069 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
9070 encoding expression to arguments.
9071 (Expression.ExprClassToResolveFlags): Just turned to property.
9073 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
9074 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
9075 optimized as well as implemented support for zero-length attributes.
9077 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
9078 Add caching of PropertyInfo's.
9080 2006-02-25 Marek Safar <marek.safar@seznam.cz>
9082 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
9083 error multiple times.
9085 2006-02-25 Marek Safar <marek.safar@seznam.cz>
9087 New partial class implementation.
9088 A fix for #77027, #77029, #77403
9090 * attribute.cs (Attributable): Made attributes protected.
9092 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
9093 the replacements of ClassPart and PartialContainer.
9094 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
9095 (TypeContainer.AddInterface): Ditto.
9096 (TypeContainer.AddPartial): The main method for partial classes. It checks
9097 for errors and merges ModFlags and attributes. At the end class is added to
9099 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
9101 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
9102 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
9103 from the rest of partial classes.
9104 (TypeContainer.GetClassBases): Simplified.
9105 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
9107 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
9108 (TypeContainer.HasExplicitLayout): Uses Flags now.
9109 (PartialContainer): Removed.
9110 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
9111 (StaticClass): Was merged with Class.
9112 (Class.GetClassBases): class and static class bases are verified here.
9113 (Class.TypeAttr): Added static attributes when class is static.
9114 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
9115 (MemberBase): In some cases we need to call parent container for partial
9116 class. It should be eliminated but it's not easy now.
9118 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
9120 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
9121 partial classed to accumulate class comments.
9122 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
9124 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
9126 * driver.cs (MainDriver): Tree.GetDecl was removed.
9128 * modifiers.cs (Modifiers): Add partial modifier.
9130 * tree.cs (Tree.decl): Removed.
9131 (RootTypes): Started to use this class more often for root types
9134 2006-02-22 Marek Safar <marek.safar@seznam.cz>
9138 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
9139 external interface does not have an attribute.
9141 2006-02-22 Marek Safar <marek.safar@seznam.cz>
9143 Another prerequisites for new partial classs implementation.
9145 * attribute.cs (Attribute.Equal): Implemented.
9146 (Attribute.Emit): Changed as attributes can be applied more than twice.
9147 (Attributes.Emit): Check for duplicate attributes here.
9149 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
9150 as a parameter, clean-up.
9152 2006-02-11 Marek Safar <marek.safar@seznam.cz>
9156 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
9157 contains obsolete attribute check which can in some cases look for base
9158 type of current class which is not initialized yet.
9159 (TypeContainer.BaseType): Replacement of ptype.
9161 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
9163 2006-02-11 Marek Safar <marek.safar@seznam.cz>
9165 First of prerequisites for new partial classs implemention.
9167 * attribute.cs (Attributable): Extended by ResolveContext;
9168 Attributes finally have correct context for resolving in all cases.
9169 (AttachTo): Attribute owner is assigned here.
9171 * codegen.cs (IResolveContext): Introduce new interface to hold
9172 all information needed in resolving phase.
9173 (EmitContext): Implements IResolveContext; more clean-up needed here.
9175 * decl.cs (MemberCore): Implemented IResolveContext.
9177 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
9178 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
9179 parameter.cs, statement.cs, tree.cs, typemanager.cs:
9180 Refactored to use new IResolveContext instead of EmitContext; cleanup
9182 2006-02-06 Miguel de Icaza <miguel@novell.com>
9184 * codegen.cs (EmitScopeInitFromBlock): check here the
9185 capture_context, there is no need to make two calls to the
9188 * anonymous.cs: Add some debugging messages that might help me
9189 track other instances of this problem in the future (the
9190 regression of test 467).
9192 * cs-parser.jay: track the variable block, as we need to initalize
9193 any captured variables declared in this block for the "catch"
9194 portion of the "Try" statement.
9196 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
9197 scope initialization for captured variables.
9199 Also, move the emit for the variables after the block location has
9202 2006-02-06 Marek Safar <marek.safar@seznam.cz>
9204 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
9206 2006-02-02 Miguel de Icaza <miguel@novell.com>
9208 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
9209 commit yesterday, the initialization for the roots is necessary.
9210 What is not necessary is the scope activation.
9212 2006-02-02 Raja R Harinath <rharinath@novell.com>
9214 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
9215 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
9217 (Argument.Resolve): Remove CS0206 checks.
9219 2006-02-01 Miguel de Icaza <miguel@novell.com>
9221 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
9222 scopes for all the roots, the scopes will now be emitted when the
9223 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
9225 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
9226 code. This reduces a lot of existing cruft.
9228 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
9229 that the ScopeInfo is generated as we enter the scope, not at the
9230 time of use, which is what we used to do before.
9232 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
9233 every time a Block is about to be emitted if we have a
9236 2006-02-01 Raja R Harinath <rharinath@novell.com>
9238 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
9240 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
9242 * typemanager.cs (cons_param_array_attribute): Make private.
9243 (Reset): Set it to null.
9244 (InitCoreHelpers): Don't initialize it.
9245 (ConsParamArrayAttribute): New. Initialize it as needed.
9246 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
9248 2006-01-31 Miguel de Icaza <miguel@novell.com>
9250 * expression.cs: There might be errors reported during the
9251 selection of applicable methods. If there are errors, do not
9252 continue execution as it will lead the compiler to crash.
9254 2006-01-30 Miguel de Icaza <miguel@novell.com>
9256 * expression.cs: Member access is not allowed on anonymous
9257 methods. Fixes #77402.
9259 2006-01-30 Raja R Harinath <rharinath@novell.com>
9262 * cs-parser.jay (VariableDeclaration): Don't set
9263 current_array_type to null.
9264 (field_declaration, event_declaration, declaration_statement):
9265 Set it to null here.
9267 2006-01-28 Raja R Harinath <harinath@gmail.com>
9269 * typemanager.cs (GenericParameterPosition): New.
9272 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
9274 * doc.cs : To process "include" elements, first we should create
9275 another list than XmlNodeList, because it could result in node
9276 removal, which could result in that the XmlNodeList gives up
9279 (Also made code identical to gmcs again.)
9281 2006-01-25 Miguel de Icaza <miguel@novell.com>
9283 * ecore.cs: Introduce an error report that we were not catching
9284 before, if not silent, we must report the error. Gonzalo ran into
9287 2006-01-23 Miguel de Icaza <miguel@novell.com>
9289 A fix for bug: #76957
9291 * iterators.cs (MoveNextMethod.CreateMethodHost): call
9292 ComputeMethodHost before creating the method, this is a new
9295 * anonymous.cs (AnonymousContainer): Now we track all the scopes
9296 that this method references (RegisterScope). The actual scope
9297 where the method is hosted is computed with the ComputeMethodHost
9298 before we create the method.
9300 Moved the Deepest routine here.
9302 (AnonymousContainer.ComputeMethodHost): New routine used to
9303 compute the proper ScopeInfo that will host the anonymous method.
9305 (ScopeInfo): Deal with multiple roots. The problem was that we
9306 did not have a unique root where all ScopeInfos could be hanged
9307 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
9310 Remove AdjustMethodScope which is now computed at the end. Remove
9311 LinkScope which did a partial link, instead link all ScopeInfos
9312 before code generation from the new "LinkScopes" routine.
9314 Simplify all the Add* routines as they no longer need to maintain
9315 the tree, they just need to record that they are using variables
9318 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
9319 routines to produce the forest of ScopeInfo trees.
9321 * class.cs (TypeContainer.AppendMethod): This is just like
9322 AddMethod, but ensures that an interface implementation method
9323 (IEnumerable.XXX) is not inserted at the beginning of the queue of
9324 methods, but at the end.
9326 We use this functionality to ensure that the generated MoveNext
9327 method in the iterator class is resolved/emitted before the
9328 enumerator methods created.
9330 This is required because the MoveNext method computes the right
9331 ScopeInfo for the method. And the other methods will eventually
9332 need to resolve and fetch information computed from the anonymous
9335 2006-01-21 Raja R Harinath <harinath@gmail.com>
9336 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9339 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
9341 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
9342 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
9344 2006-01-18 Raja R Harinath <rharinath@novell.com>
9346 Fix #76656, cs0231-2.cs.
9347 * cs-parser.jay (formal_parameter_list): Make error case catch
9349 (parenthesized_expression_0): Add CS1026 check.
9350 (invocation_expression): Remove unused { $$ = lexer.Location }.
9352 2006-01-17 Raja R Harinath <rharinath@novell.com>
9355 * cs-parser.jay (statement_expression): Don't list out the
9356 individual statement-expressions. Convert syntax error into
9359 2006-01-16 Raja R Harinath <rharinath@novell.com>
9362 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
9363 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
9364 CheckIntermediateModification.
9365 (FieldExpr.DoResolve): Add new two-argument version that
9366 allows us to resolve the InstanceExpression as an lvalue.
9367 The one-argument variant is now just a wrapper.
9368 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
9369 Resolve the lhs as an lvalue if the it has a value type.
9370 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
9371 from Assign.DoResolve.
9372 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
9373 resolved as an lvalue.
9374 (PropertyExpr.DoResolve): Update.
9375 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
9376 has a value type. Move CS1612 check here from
9377 CheckIntermediateModification.
9378 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
9379 * expression.cs (EmptyExpression.OutAccess): New. Used as the
9380 'right_side' of a ResolveLValue on an 'out' argument.
9381 (EmptyExpression.LValueMemberAccess): New. Used as the
9382 'right_side' of a propagated ResolveLValue on a value type.
9383 (LocalVariableReference.DoResolveBase): Recognize
9384 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
9386 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
9387 EmptyExpression.Null.
9389 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
9391 * typemanager.cs : added IsGenericParameter(). In mcs it always
9393 * doc.cs : for generic parameters, use GenericParameterPosition,
9396 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
9398 * expression.cs: Fix Console.WriteLine ((this = x).foo);
9400 2006-01-12 Miguel de Icaza <miguel@novell.com>
9402 This fixes the problem where we used ldfld instead of ldflda to
9403 load the "THIS" pointer on captured parameters, when THIS is a
9404 value type. See bug #77205.
9406 * iterators.cs (CapturedThisReference.Emit): Pass false to
9407 EmitThis (we do not need the address).
9409 * codegen.cs (EmitThis): it needs to know whether we need the
9410 address of `this' or not. This is used by value types.
9412 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
9413 every other call passes false.
9415 2006-01-12 Raja R Harinath <rharinath@novell.com>
9418 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
9420 * expression.cs (Invocation.OverloadResolve): Update.
9421 (Invocation.DoResolve): Avoid double resolution of invocation.
9423 2006-01-11 Raja R Harinath <rharinath@novell.com>
9426 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
9427 unary negation of floating point types as 0-expr; negation cannot
9428 overflow in floating point types.
9431 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
9432 on operands of 'void' type.
9435 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
9436 and ExclusiveOr for boolean constants too.
9438 2006-01-09 Raja R Harinath <rharinath@novell.com>
9441 * expression.cs (Invocation.OverloadResolve): Replace reflected
9442 override methods with their base virtual methods, rather than
9444 * typemanager.cs (TypeManager.GetOverride): New.
9446 2006-01-05 Jb Evain <jbevain@gmail.com>
9448 * class.cs (Property.Define, Indexer.Define): do not tag the
9449 properties as SpecialName | RTSpecialName.
9451 2006-01-04 Miguel de Icaza <miguel@novell.com>
9453 * class.cs (MethodCore.IsDuplicateImplementation): This method was
9454 doing a low-level comparission of parameter types. It was lacking
9455 a check for __argslist.
9457 2005-12-30 Miguel de Icaza <miguel@novell.com>
9459 * expression.cs (ParameterReference.DoResolveBase): Allow
9460 reference parameters if they are local to this block.
9462 This allows the ref and out parameters of a delegate to be used in
9463 an anonymous method, for example:
9465 delegate void set (out int x);
9467 set s = delegate (out int x){
9471 This is used by functionality introduced late in the C# language.
9473 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
9474 method that take ref and out parameters.
9476 Fixes #77119 which was a late change in the spec.
9478 2005-12-23 Miguel de Icaza <miguel@novell.com>
9480 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
9481 parent if its the same scope. Fixes #77060.
9483 2005-12-21 Miguel de Icaza <miguel@novell.com>
9485 * driver.cs: Report the case of no source files and no -out:
9488 2005-12-20 Raja R Harinath <rharinath@novell.com>
9491 * expression.cs (ComposedCast.GetSignatureForError): Define.
9493 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9497 * namespace.cs (NamespaceEntry): Add extern_aliases as a
9498 ListDictionary, to contain the ExternAliasEntry entries (in
9499 addition to the NamespaceEntry.aliases hashtable). This field is
9500 shared between the original entry and its doppelganger (bodyless
9502 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
9503 extern_aliases field.
9504 (NamespaceEntry.Lookup): Move the IsImplicit check after the
9505 lookup in extern_aliases.
9507 2005-12-16 Raja R Harinath <rharinath@novell.com>
9510 * class.cs (TypeContainer.Mark_HasEquals): New.
9511 (TypeContainer.Mark_HasGetHashCode): New.
9512 (ClassPart): Override them.
9513 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
9516 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
9517 'parent' argument to the base constructor.
9519 Remove all mention of TypeContainer from decl.cs.
9520 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
9521 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
9522 (DeclSpace.DeclSpace): Likewise.
9523 (DeclSpace.DefineMembers): Remove unused argument.
9524 * cs-parser.jay (pop_current_class): Update to changes. Simplify
9525 debugging check -- we don't care if the debug code throws an
9526 InvalidCastException instead of an InternalErrorException.
9527 * class.cs (TypeContainer.DefineMembers): Update to changes.
9528 (TypeContainer.DoDefineMembers): Likewise.
9529 (TypeContainer.GetMethods): Likewise.
9530 (PropertyMember.Define): Likewise.
9531 (MemberBase.Parent): New property that forwards to
9532 MemberCore.Parent, but ensures that we get a TypeContainer.
9533 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
9534 (RootContext.PopulateTypes): Likewise. Remove special case code
9535 for !RootContext.StdLib: DefineMembers is idempotent.
9537 2005-12-14 Miguel de Icaza <miguel@novell.com>
9539 * convert.cs (ExplicitConversionCore): Check the return value from
9540 ExplicitConversionCore which can return null on failure. Fixes #76914
9542 2005-12-13 Marek Safar <marek.safar@seznam.cz>
9544 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
9546 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
9548 * doc.cs : The search for referenced namespace was insufficient to
9549 get global one as it used to do. Fixed bug #76965.
9551 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
9553 * doc.cs : check name in cref in the last phase that whether it is
9556 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
9558 * cs-tokenizer.cs : reverted the latest change: it somehow broke
9561 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
9563 * doc.cs : so it turned out that we cannot skip override check for
9564 interface members. Fixed bug #76954.
9566 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
9568 * cs-tokenizer.cs : fixed bug #75984:
9569 - #warning and #error should not be handled when the source line
9571 - #line is not checked strictly when the source line is disabled.
9572 - #define and #undef is on the other hand checked strictly at any
9575 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
9577 * cs-tokenizer.cs : missing Location (actually, filename) in one of
9580 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9582 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
9584 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
9586 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
9587 (FieldBase.Initializer): Initializer is now optional.
9588 (EventField.Define): Only event field can have initializer.
9590 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
9592 * const.cs (Const): Reuse initializer.
9594 * cs-parser.jay: Updated after FieldBase changes.
9595 Added current_array_type to simplify array initializers.
9597 * ecore.cs (NullCast.IsDefaultValue): Implemented.
9599 * expression.cs, iterators.cs: Updated.
9601 * namespace.cs (NamespaceEntry): Made UsingFound private.
9603 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9605 * parameterCollection.cs: Obsolete, removed.
9606 * parser.cs: Obsolete, removed.
9608 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9611 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
9613 * enum.cs (Enum.Define): Set obsolete context here.
9615 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
9618 - FindDocumentedMember() now expects 1) paramList as null
9619 when "we don't have to check the number of parameters" and
9620 2) Type.EmptyTypes when "there is no arguments".
9621 - Introduced FoundMember struct to hold the exact type which was
9622 used to find the documented member (the above change broke
9623 test-xml-044; it might be better just to use DeclaringType than
9624 what MS does, like this change does, but it depends on usage.)
9626 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
9628 * doc.cs : documented member might be from DeclaringType for nested
9629 types. Fixed bug #76782.
9631 2005-12-03 Ben Maurer <bmaurer@ximian.com>
9633 * anonymous.cs: Have the param code handle leaving copies on the
9634 stack etc. Allows anonymous params to take part in the assignment
9635 code (++, +=, etc). Fixes bug #76550
9637 * expression.cs: Handle the prepare_for_load/leave_copy by passing
9638 it down to the anon code.
9640 * iterators.cs: Use dummy var here
9642 * codegen.cs: Handle new vars
9644 2005-12-01 Marek Safar <marek.safar@seznam.cz>
9647 * class.cs (MethodData.Define): Set proper Obsolete context.
9649 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
9651 (FieldExpr.DoResolve): Ditto.
9653 2005-12-01 Marek Safar <marek.safar@seznam.cz>
9656 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
9657 parent is not obsolete.
9659 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
9661 * doc.cs : (FindDocumentedMember) find parameterless members first
9662 and get CS0419 in the early stage. Fixed first case of bug #76727.
9664 2005-11-30 Marek Safar <marek.safar@seznam.cz>
9667 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
9668 no error was reported.
9670 *expression.cs (Binary.DoResolve): left can be null.
9672 2005-11-22 Marek Safar <marek.safar@seznam.cz>
9675 * class.cs (MethodData.Emit): Parameters should be labeled first.
9677 2005-11-21 Marek Safar <marek.safar@seznam.cz>
9680 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
9682 2005-11-18 Marek Safar <marek.safar@seznam.cz>
9684 * attribute.cs (AreParametersCompliant): Moved to Parameter.
9686 * class.cs (MethodCore): Parameter clean up.
9687 (IMethodData): Added ParameterInfo.
9688 (MethodData): Parameter clean up.
9689 (Indexer.Define): Parameter clean up.
9701 * typemanager.cs: Parameter clean up.
9703 * delegate.cs (Define): Get rid of duplicated code.
9705 * expression.cs (ParameterReference): Removed useless parameters
9707 (Invocation): Ditto.
9709 * parameter.cs (ParamsParameter): New class, params specialization.
9710 (ArglistParameter): Attemp to separate arglist.
9711 (Parameter): Refactored to be reusable and faster.
9712 (Parameter.Modifier): Made understandable.
9713 (Parameters): Changed to be used as a class for `this' assembly
9714 parameters. Refactored to use new specialized classes.
9716 * support.cs (ParameterData): Added Types property.
9717 (InternalParameters): Deleted.
9719 2005-08-20 Martin Baulig <martin@ximian.com>
9721 Merging this patch from GMCS to fix #75867.
9723 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9724 scope if we don't already have it.
9726 2005-11-17 Martin Baulig <martin@ximian.com>
9729 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
9730 inherit the scope from our parent. Fixes #76653.
9732 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9734 * doc.cs : the previous patch does not actually fix the bug.
9735 PropertyInfo override check is now implemented and really fixed it.
9736 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
9738 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9740 * doc.cs : apply "override filter" also to properties.
9743 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9745 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
9746 no need to check overrides. For classes, omit those results from
9747 interfaces since they must exist in the class. Fixed bug #76726.
9749 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9751 * typemanager.cs : (GetFullNameSignature) differentiate indexers
9752 with different parameters. Fixed the second problem in #76685.
9754 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9756 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
9757 get expected 'protected' access in CheckValidFamilyAccess()).
9760 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9762 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
9763 Fixed bug #76705. CS1569 was incorrectly commented out.
9765 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
9767 * doc.cs : use Invocation.IsOverride() to do real override check.
9768 * expression.cs : made Invocation.IsOverride() internal.
9770 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
9772 * doc.cs : use TypeManager.FindMembers() instead of (possible)
9773 TypeBuilder.FindMembers() and filter overriden base members out.
9776 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9778 * doc.cs : ref/out parameters are represented as '@' (instead of
9779 '&' in type FullName). Fixed bug #76630 (additionally crefs).
9781 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9783 * doc.cs : when there was no '.' in cref to methods in doc comment,
9784 then parameters were missing in the output. Fixed bug #76691.
9786 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9788 * driver.cs : don't output docs when there is an error.
9791 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9794 Now it should detect indexers. Fixed primary concern in bug #76685.
9795 Fixed CS0419 message to not show the identical member signature in
9798 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9800 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
9801 instead of Type.FindMembers() since it does not handle events.
9804 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
9806 * codegen.cs: Fixed typo (speficied -> specified).
9808 2005-11-11 Marek Safar <marek.safar@seznam.cz>
9811 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
9813 2005-11-11 Marek Safar <marek.safar@seznam.cz>
9815 * attribute.cs: Changed error message.
9817 * cs-tokenizer.cs: One more check.
9819 2005-11-10 Marek Safar <marek.safar@seznam.cz>
9821 * statement.cs (Block.Resolve): Ignore empty statement.
9823 2005-11-10 Marek Safar <marek.safar@seznam.cz>
9825 * report.cs: Made error/warning methods more strict to avoid
9828 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
9829 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
9830 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
9831 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
9833 2005-11-08 Marek Safar <marek.safar@seznam.cz>
9835 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
9836 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
9838 * class.cs (TypeContainer.IsComImport): New property.
9839 (Constructor.Define): Create proper ctor for ComImport types.
9841 * expression.cs (New.CheckComImport): Fixed.
9843 2005-11-07 Miguel de Icaza <miguel@novell.com>
9845 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
9846 that a parameter has been captured does not mean that we do not
9847 have to do the rest of the processing. This fixes the second part
9848 of #76592. If there was another anonymous method capturing
9849 values in the past, the Scope would never be set for the second
9850 method that captured the same parameter.
9852 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
9853 properly manipulate the stack. Second part of fix for #76592.
9855 * expression.cs (New): Add support for invoking "new" on
9856 interfaces that have been flagged with the ComImport attribute and
9857 the CoClass. Fixes #76637
9859 * statement.cs (Try.DoEmit): When a variable is captured, do not
9860 try to emit the vi.LocalBuilder variable as it has been captured.
9861 Create a temporary variable and store the results on the
9862 FieldBuilder. Fixes #76642
9864 2005-11-07 Marek Safar <marek.safar@seznam.cz>
9866 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
9868 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
9870 * expression.cs (Binary.DoResolve): Added && optimalization.
9872 * typemanager.cs (AddUserType): Removed useless argument.
9874 2005-11-04 Marek Safar <marek.safar@seznam.cz>
9876 * statement.cs (Block.variables): Uses ListDictionary.
9878 2005-11-03 Marek Safar <marek.safar@seznam.cz>
9881 * class.cs (PartialContainer.EmitType): Customized to emit
9882 security attributes.
9883 (ClassPart.ApplyAttributeBuilder): Transform security attribute
9884 for partial classes.
9886 2005-11-03 Marek Safar <marek.safar@seznam.cz>
9889 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
9890 access has to be fixed.
9892 * typemanager.cs (IsUnmanagedType): Wrong common field type.
9894 2005-11-01 Marek Safar <marek.safar@seznam.cz>
9897 * ecore.cs (NullCast.Reduce): Implemented.
9899 * expression.cs (ArrayCreation.CheckIndices): Correcly check
9902 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
9904 (Foreach.Resolve): Catch null properly.
9906 2005-10-29 Marek Safar <marek.safar@seznam.cz>
9908 * cs-tokenizer.cs: Warning text fix.
9910 * driver.cs: AllWarningNumbers exposed on public interface.
9912 * report.cs (): Reviewed warning numbers.
9913 (IsValidWarning): Use binary search.
9915 2005-10-29 Marek Safar <marek.safar@seznam.cz>
9917 * driver.cs: Implemeted resource visibility.
9918 (Resources): New class for code sharing between /res: and
9921 2005-10-28 Marek Safar <marek.safar@seznam.cz>
9924 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
9927 * convert (Convert.ImplicitReferenceConversion): NullCast holds
9930 * ecore.cs (NullCast): Child is contant only.
9932 * literal.cs (NullLiteral.Reduce): null can be converted to any
9935 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
9937 * driver.cs: Use Encoding.Default as default code page instead
9940 2005-10-27 Raja R Harinath <rharinath@novell.com>
9943 * expression.cs (Invocation.Error_InvalidArguments): Handle
9944 __arglist parameters.
9945 (Invocation.VerifyArgumentsCompat): Likewise.
9946 * support.cs (ReflectionParameters.GetSignatureForError): Print
9947 __arglist parameters.
9948 (InternalParamters.GetSignatureForError): Likewise.
9949 * parameter.cs (Parameters.GetSignatureForError): Likewise.
9951 2005-10-26 Marek Safar <marek.safar@seznam.cz>
9953 * attribute.cs (GetPropertyValue): Made public.
9955 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
9957 Add new property WrapNonExceptionThrows to handle 2.0 assembly
9959 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
9962 * driver.cs: Reflect method name change.
9964 * statement.cs (Try.Resolve): Warn when try has both general
9967 * typemanager.cs: runtime_compatibility_attr_type new predefined
9970 2005-10-26 Raja R Harinath <harinath@gmail.com>
9973 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
9974 treat it as an empty parameter list.
9976 2005-10-26 Raja R Harinath <rharinath@novell.com>
9979 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
9980 ResolveAsTypeStep silent.
9981 * statement.cs (Block.AddConstant): Mark block as used.
9982 (Block.ResolveMeta): Avoid piling on error messages
9983 if a constant initializer resolution fails.
9985 2005-10-25 Raja R Harinath <rharinath@novell.com>
9987 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
9989 (NamespaceEntry.VerifyAllUsing): New.
9990 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
9991 behaviour. Delegates actual resolution of alias to ...
9992 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
9993 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
9995 * driver.cs (Driver.MainDriver): Update.
9997 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
9998 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
10000 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
10002 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
10003 RootNamespace.DefineNamespacesForAll.
10005 2005-10-24 Raja R Harinath <harinath@gmail.com>
10007 * typemanager.cs (assemblies, external_aliases, modules)
10008 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
10009 (ComputeNamespaces, GetRootNamespace): Remove extra staging
10010 overhead. Move resposibility ...
10011 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
10012 * driver.cs, attribute.cs, codegen.cs: Update to changes.
10014 2005-10-23 Raja R Harinath <harinath@gmail.com>
10016 * namespace.cs (RootNamespace.all_namespaces): Renamed from
10017 cached_namespaces. Improve usage.
10018 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
10019 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
10020 Move from GlobalRootNamespace and simplify.
10021 (RootNamespace.Global): Make instance variable.
10022 (RootNamespace.RootNamespace): Add "alias name" parameter.
10023 (GlobalRootNamespace): Simplify drastically.
10024 (Namespace.Lookup): Don't use GetNamespace.
10025 * typemanager.cs (GetRootNamespace): Rename from
10026 ComputeNamespaceForAlias.
10027 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
10029 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10031 * anonymous.cs (AnonymousContainer): Don't crash when container
10034 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10036 * expression.cs (Binary.DoResolve): Warn when comparing same
10039 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10042 * expression.cs (Binary.DoResolve): It looks like there are no
10043 convetsion rules in enum context.
10045 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10047 Add support for extern alias qualifiers.
10048 * typemanager.cs: Move some LookupTypeReflection code
10049 to namespace.cs, to have cleaner code. Added some methods
10050 to help us keep track of the extern aliased references.
10051 * driver.cs: Add suport for extern alias assemblies on command
10052 line and check for their warnings/errors. Also keep track of the
10053 extern aliased assemblies.
10054 * namespace.cs: Move the global functionality of Namespace
10055 to GlobalRootNamespace/RootNamespace. Now the global namespace
10056 is GlobalRootNamespace.Globa. Also the code moved from
10057 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
10058 Finally added LocalAliasEntry (AliasEntry before) and
10059 ExternAliasEntry, to handle alias statements.
10060 * cs-parser.jay: Add support in the grammar for extern alias
10062 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
10063 Update callings to Namespace (now in GlobalRootNamespace).
10065 2005-10-18 Raja R Harinath <rharinath@novell.com>
10068 * class.cs (TypeContainer.DefineType): Move updating of
10069 topological sort earlier in the code.
10070 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
10072 2005-10-18 Marek Safar <marek.safar@seznam.cz>
10075 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
10077 * constant.cs (Constant.TryReduce): Moved from Cast class.
10078 (Reduce): Made little bit more OO and fixed missing conversions.
10080 * ecore.cs (Reduce): Implemented.
10081 (Binary.EnumLiftUp): New method to upgrade values to enum values.
10083 * literal.cs (Reduce): Implemented.
10085 * class.cs: Reverted Miguel's wrong commit.
10087 2005-10-14 Miguel de Icaza <miguel@novell.com>
10089 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
10091 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
10093 * cs-parser.jay, expression.cs : CS0214 was missing error location
10094 for constants. Fixed bug #76404.
10096 2005-10-11 Marek Safar <marek.safar@seznam.cz>
10099 * convert.cs (ExplicitConversionCore): Fixed object->enum
10102 2005-10-10 Raja R Harinath <rharinath@novell.com>
10104 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
10105 InstanceExpression.
10106 (PropertyExpr.EmitCall): Likewise.
10107 * expression.cs (Invocation.EmitArguments): Handle case where
10109 (Invocation.EmitCall): Avoid allocating temporary variable if
10110 there are no arguments.
10112 2005-10-07 Raja R Harinath <rharinath@novell.com>
10115 * convert.cs (ImplicitConversionStandard): Move conversion of
10116 void* to arbitrary pointer types ...
10117 (ExplicitConversionStandard): .. here.
10118 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
10119 error to always print typenames.
10121 2005-10-07 Raja R Harinath <rharinath@novell.com>
10123 * convert.cs (GetConversionOperator): Rename from
10124 GetConversionOperators. Move operator selection code from ...
10125 (UserDefinedConversion): ... here.
10127 2005-10-06 Marek Safar <marek.safar@seznam.cz>
10129 * convert.cs (ExplicitConversionCore): Removed duplicate enum
10132 2005-10-05 Marek Safar <marek.safar@seznam.cz>
10134 * assign.cs (Assign.DoResolve): Error method changed.
10136 * cfold.cs (DoConstantNumericPromotions): Error method changed.
10138 * const.cs (ResolveValue): Reset in_transit immediately.
10140 * constant.cs: Error method changed.
10142 * convert.cs: Removed useless location parameter.
10143 (ExplicitNumericConversion): Don't do double enum check.
10144 (ExplicitConversionCore): Renamed from ExplicitConversion.
10145 (ExplicitUnsafe): Extracted from ExplicitConversion.
10146 (ExplicitConversion): Uses for error reporting.
10148 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
10150 (ResolveBoolean): Uses common error method.
10151 (CastToDecimal): Get rid of ec.
10152 (CastFromDecimal): Optimized.
10153 (ConvCast): Get rid of ec.
10155 * enum.cs (ResolveValue): Reset in_transit immediately.
10156 (Emit): Return after first error.
10158 * expression.cs: Convert changes.
10160 * literal.cs: Error method changed.
10162 * statement.cs: Error method changed.
10164 2005-10-03 Raja R Harinath <rharinath@novell.com>
10166 * support.cs (SeekableStreamReader.Position): Don't error out when
10167 the requested position is just beyond the end of the current
10170 2005-09-28 Raja R Harinath <rharinath@novell.com>
10172 * support.cs (SeekableStreamReader): Simplify drastically. Don't
10173 try to keep in sync with the byte count of the underlying Stream.
10174 However, this limits us to a window size of 2048 characters: i.e.,
10175 the maximum lookahead of our lexer/parser can be 2048 characters.
10177 2005-09-28 Marek Safar <marek.safar@seznam.cz>
10180 * driver.cs: Fix compilation files with full root path.
10182 2005-09-25 Miguel de Icaza <miguel@novell.com>
10184 * report.cs (SymbolRelatedToPreviousError): Format the output so
10185 it does not use an open parenthesis that is never closed.
10187 * driver.cs: Follow coding guidelines
10189 2005-09-27 Marek Safar <marek.safar@seznam.cz>
10192 * const.cs (Const.ResolveValue): Check for assigning non-null
10193 value to reference type.
10195 2005-09-27 Marek Safar <marek.safar@seznam.cz>
10197 * anonymous.cs: Implemented ExprClassName.
10199 * assign.cs (Assign.DoResolve): Don't chrash when type is not
10202 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
10205 * class.cs (StaticClass.DefineContainerMembers): Report protected
10208 * codegen.cs: if(ed) PRODUCTION.
10210 * convert.cs (Error_CannotImplicitConversion): Better error
10213 * cs-parser.jay: More error checks.
10215 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
10217 * driver.cs (CSCParseOption): Enabled wrong option check.
10219 * ecore.cs (Expression.ExprClassName): Turned to property.
10220 (MemberExpr.CheckIntermediateModification): For checking boxed
10221 value types modification.
10223 * statement.cs (Fixed.Resolve): Expression type must be
10224 convertible to fixed type.
10225 (CollectionForeach.GetEnumeratorFilter,TryType):
10226 Small refactoring for easier error checking.
10228 2005-09-26 Marek Safar <marek.safar@seznam.cz>
10230 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
10233 * class.cs (GeneratedBaseInitializer): New class for customization
10234 compiler generated initializers.
10235 (MemberBase.DoDefine): Check Obsolete attribute here.
10236 (FieldMember.DoDefine): Ditto.
10238 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
10241 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
10242 (MemberCore.GetObsoleteAttribute): Removed argument.
10243 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
10244 (MemberCore.CheckObsoleteType): New helper.
10248 * statement.cs: Updates after MemberCore changes.
10250 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
10251 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
10253 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
10254 obsolete attribute for compiler construct.
10255 (As.DoResolve): Cache result.
10257 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
10259 2005-09-26 Raja R Harinath <rharinath@novell.com>
10262 * expression.cs (This.VerifyFixed): In a value type T, the type of
10263 'this' is T&, iow, 'this' is either an out or ref parameter. In a
10264 value type R, 'this' is treated as a value parameter.
10266 2005-09-22 Miguel de Icaza <miguel@novell.com>
10268 * statement.cs (Lock): Use the TemporaryVariable class instead of
10269 manually using local variables as those do not work when variables
10272 * ecore.cs: Moved the TemporaryVariable class from being a nested
10273 class inside Foreach to be a public class that can be employed in
10276 2005-09-19 Marek Safar <marek.safar@seznam.cz>
10278 * cs-parser.jay: interface_accessors replaced by
10279 accessor_declarations.
10281 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
10284 * statement.cs (GotoCase.Resolve): Convert null constant to
10286 (SwitchLabel.ResolveAndReduce): Ditto.
10287 (SwitchLabel.NullStringCase): Custom null stamp.
10288 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
10290 typemanager.cs (CSharpSignature): Don't skip first argument
10293 2005-09-18 Miguel de Icaza <miguel@novell.com>
10295 * driver.cs: Set InEmacs based on the environment variable EMACS.
10297 * location.cs (InEmacs): in this mode, do not report column
10298 location as it confuses Emacs.
10300 2005-09-16 Marek Safar <marek.safar@seznam.cz>
10302 * cfold.cs, constant.cs, convert.cs, ecore.cs,
10303 expression.cs, iterators.cs, literal.cs: Store constants and
10306 * class.cs (MemberBase.ShortName): Pass location.
10308 * cs-parser.jay: Some location fixes.
10310 * ecore.cs (Expression.Location): Made virtual.
10312 2005-09-05 Miguel de Icaza <miguel@novell.com>
10314 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
10315 if the underlying types are the same, otherwise we need to produce
10316 code that will do the proper cast.
10318 This was exposed by Marek's constant rewrite which produced
10319 invalid code for the call site:
10321 enum X : long { a }
10322 void Method (X v) {}
10326 This fixes test-49.cs
10328 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
10330 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
10331 Type/Object should be allowed as well. Fixed bug #75968.
10333 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
10335 * expression.cs : (Binary.DoResolve): when one is enum constant and
10336 another is constant 0, then return enum one *as enum type*.
10339 2005-09-02 Raja R Harinath <rharinath@novell.com>
10341 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
10345 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
10346 flow-branching for LocalVariableReferences in case we were invoked
10347 from a MemberAccess.
10348 * expression.cs (LocalVariableReference.VerifyAssigned): New.
10350 (LocalVariableReference.DoResolveBase): ... this.
10351 (MemberAccess.Resolve): Do the check that was disabled during
10354 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
10357 (PartialContainer.Create): check abstract/sealed/static strictly
10358 but abstract/sealed can exist only at one side. Fixed bug #75883.
10360 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
10363 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
10364 specified, don't default to UnmanagedType.I4.
10366 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
10368 * expression.cs : conditional operator should check possibly
10369 incorrect assign expression. Fixed bug #75946.
10371 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
10373 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
10374 Reverting the change. gmcs is much complex than mcs on this matter.
10376 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
10378 * cs-tokenizer.cs : To read another token ahead of the actual
10379 consumption, use new SavedToken and cache token instead of moving
10380 back the stream with SeekableStreamReader (it seemed problematic).
10382 driver.cs : Thus use StreamReader directly.
10383 * support.cs : Thus removed SeekableStreamReader.
10385 2005-08-30 Raja R Harinath <rharinath@novell.com>
10388 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
10389 (ScopeInfo.EmitScopeType): Use it to construct field names from
10390 names of captured locals.
10393 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
10394 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
10395 Pass 'target_type' to BoxedCast. Don't default to 'object'.
10396 (ExplicitConversion): Remove enum cases already handled by
10397 implicit conversion. Move implicit conversion check to the beginning.
10398 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
10399 * expression.cs (ArrayCreation.EmitDynamicInitializers):
10400 Don't treat System.Enum as a struct.
10402 2005-08-30 Jb Evain <jbevain@gmail.com>
10404 * attribute.cs: handles as expression in parameters.
10406 2005-08-30 Raja R Harinath <rharinath@novell.com>
10409 * class.cs (TypeContainer.VerifyClsName): Don't use a
10410 PartialContainer when verifying CLS compliance.
10411 (AbstractPropertyEventMethod): Set Parent here, ...
10412 (PropertyMethod): ... not here.
10414 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
10416 * attribute.cs : escaped attribute name should not be allowed to be
10417 resolved (e.g. @class as classAttribute). Fixed bug #75930.
10419 2005-08-29 Raja R Harinath <rharinath@novell.com>
10422 * convert.cs (ImplicitStandardConversionExists): Allow zero also
10423 when converting a long constant to unsigned long.
10424 * expression.cs (Invocation.OverloadResolve): Add sanity check to
10425 detect where IsApplicable and VerifyArgumentsCompat disagree.
10427 2005-08-29 Raja R Harinath <rharinath@novell.com>
10428 and Carlos Alberto Cortez <carlos@unixmexico.org>
10431 * class.cs (TypeContainer.CanElideInitializer): New helper.
10432 (TypeContainer.EmitFieldInitializers): Use it to determine if we
10433 can safely emitting the initializer of a field.
10435 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10437 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
10438 allowed inside a switch (without loop). Fixed bug #75433.
10440 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
10442 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
10443 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
10445 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10447 * driver.cs : kinda reverting the default encoding changes (not exact
10448 revert since I noticed that "codepage:reset" might not work fine).
10450 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10452 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
10453 Location. Now getter and setter store location correctly.
10454 (errors/cs0111-12.cs now reports the expected location.)
10456 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10458 * driver.cs : Use default encoding on the environment.
10459 Removed (now that) extra parameter for SeekableStreamReader.
10460 * support.cs : (SeekableStreamReader) third .ctor() argument for
10461 StreamReader is not required (always true). preamble size could
10462 be acquired in simpler and safe way.
10464 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
10466 * cs-parser.jay: report CS0642 at warning level 3
10467 and report CS0642 for an if else statement also
10468 fixes bug #74745. Patch by John Luke (and a bit
10470 Removed extra CS0642 warning check for "while",
10472 * statement.cs: In Block.Resolve(), CS0642 check
10473 is reimplemented to check a sequence of an empty
10474 statement and a block.
10476 Both fix bug #66777.
10478 2005-08-24 Marek Safar <marek.safar@seznam.cz>
10480 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
10481 detection until I fix it.
10483 * cs-tokenizer.cs: Changed error message.
10485 * cs-parser.jay: Fixed 2 error locations.
10487 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
10488 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
10491 * enum.cs (GetSignatureForError): Fixed.
10493 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
10497 * typemanager.cs (RegisterProperty): Removed.
10499 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
10501 2005-08-24 Raja R Harinath <rharinath@novell.com>
10504 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
10505 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
10507 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10509 * expression.cs : tiny fix is required for not warning positive ulong.
10512 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10514 * expression.cs : add CS0652 check for constant and integral
10515 expression. Fixed bug #53974.
10517 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10519 * expression.cs : in DoNumericPromotions(), check if there is implicit
10520 conversion overload for string (to check CS0034). Fixed bug #52492.
10522 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10524 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
10526 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10528 * ecore.cs : report location when it is *not* Null.
10530 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10536 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
10537 correctly. Fixed bug #75721.
10539 2005-08-23 Raja R Harinath <rharinath@novell.com>
10541 * support.cs (SeekableStreamReader.Position): Avoid an expensive
10542 loop that performs 'min (pos, char_count)'.
10545 * expression.cs (Unary.ResolveOperator): Don't discard implicit
10546 converted value in Operator.OnesComplement.
10548 2005-08-22 Ben Maurer <bmaurer@ximian.com>
10550 * anonymous.cs: If the anon method is pulled into a helper class,
10551 it needs to be `internal' not `private'. Fixes runtime behavior on
10554 2005-08-20 Martin Baulig <martin@ximian.com>
10556 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10557 scope if we don't already have it.
10559 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
10560 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
10563 2005-08-17 Marek Safar <marek.safar@seznam.cz>
10566 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
10567 is a partial class.
10569 2005-08-16 Marek Safar <marek.safar@seznam.cz>
10571 The big constants rewrite
10572 Fix #75746, #75685 and more
10573 As a side effect saved 1MB for MWF ;-)
10575 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
10576 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
10577 enum based for corlib compilation.
10579 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
10582 * class.cs (FixedField.Define): Use ResolveAsConstant.
10584 * const.cs (IConstant): Interface constants and enums.
10585 (Const.ResolveValue): New method for constant resolvning.
10586 (ExternalConstant): Constants from imported assemblies.
10588 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
10589 conversion; like enums.
10590 (Constant.ToType): Converts this constant to different type.
10591 (Constant.Increment): Adds 1.
10593 * convert.cs (ImplicitConversionRequired): Simplified.
10595 * cs-parser.jay: Create EnumMember directly.
10597 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
10599 * doc.cs (GenerateEnumDocComment): Removed.
10601 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
10602 (ConvertIntLiteral): Removed.
10603 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
10605 * enum.cs (EnumMember): Implement IConstant.
10606 (Enum.IsValidEnumConstant): Removed.
10607 (Enum.GetNextDefaultValue): Removed.
10608 (Enum.FindMembers): Updated.
10609 (Enum.GenerateDocComment): Iterate enum members.
10611 * expression.cs (Cast.TryReduce): Handle enums correctly.
10612 (New.Constantify): Made public.
10613 (MemberAccess.DoResolve): Removed contant specific if(s).
10615 * literal.cs (NullLiteral): Implement new abstract methods.
10617 * statement.cs (GotoCase.Resolve): Use new constant methods.
10618 (SwitchLabel.ResolveAndReduce): Use new constant methods.
10620 * typemanager.cs (LookupEnum): Removed.
10621 (IsEnumType): Fixed to work with corlib.
10622 (RegisterConstant): Removed.
10623 (LookupConstant): Removed.
10624 (GetConstant): Changed to work with IConstant.
10626 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
10628 * location.cs : Fixed overflown (>255) column number.
10630 2005-08-03 Raja R Harinath <rharinath@novell.com>
10632 First cut of the qualified-alias-member feature.
10633 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
10635 * cs-parser.jay (DOUBLE_COLON): New token.
10636 (namespace_or_type_name): Add rule for recognizing
10637 qualified-alias-members.
10638 (primary_expression): Likewise.
10639 (element_access): Allow QualifiedAliasMember as a possible
10640 type-bearing expression.
10641 (local_variable_type, local_variable_pointer_type): Likewise.
10642 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
10643 aliases in the current and enclosing namespace declarations.
10644 (NamespaceEntry.UsingAlias): Add CS0440 warning.
10645 * decl.cs (MemberName.is_double_colon): New.
10646 (MemberName.MemberName): Add new constructor for alias-member.
10647 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
10648 * expression.cs (QualifiedAliasMember): New expression type.
10650 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10652 * location.cs : it borked when no argument was specified.
10654 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10656 * location.cs : tiny ToString() format fix.
10658 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10660 * statement.cs : oops, it was missing.
10662 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10664 A set of fixes for precise line/column location.
10667 "token" field now holds a file/line "delta", a line number offset
10668 from the segment, and a column number. See also:
10669 http://lists.ximian.com/pipermail/mono-devel-list/2004-
10670 December/009508.html
10671 Removed static IsNull. Use instance IsNull property instead.
10672 * cs-tokenizer.cs :
10673 For some tokens it stores Location. For Identifier it stores
10674 LocatedToken which is a pair of string name and location.
10675 Column numbers are adjusted only at getChar().
10677 Use Location.ToString() for reporting (it now contains column).
10679 Largely modified to use LocatedToken instead of
10680 string (IDENTIFIER), and to acquire Location from some tokens.
10681 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
10682 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
10684 Now MemberName holds Location. DeclSpace.ctor() receives Location
10685 as a parameter. Removed extra parameters to all derived classes.
10686 Replaced Location.IsNull() with instance property.
10687 * assign.cs, expression.cs :
10688 Added .ctor() overload that omits Location.
10690 Added "nameEscaped" flag that indicates the identifier was escaped
10691 in the source file. This fixes bug #57047.
10693 2005-08-02 Marek Safar <marek.safar@seznam.cz>
10695 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
10696 New method, looking for lo-case imported cls type.
10698 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
10701 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10703 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
10705 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
10706 all_imported_types.
10707 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
10709 Optimized to save 3.5 MB for SWF compilation.
10711 2005-08-01 Marek Safar <marek.safar@seznam.cz>
10713 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
10714 (PartialContainer.Create): Moved logic AddToContainer.
10715 (PartialContainer.MarkForDuplicationCheck): Shares name.
10717 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
10720 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
10722 (Namespace.GetSignatureForError): New method.
10724 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
10725 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
10727 2005-08-01 Raja R Harinath <rharinath@novell.com>
10730 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
10731 member lookup rather than qualifier_type, since qualifier_type can
10734 2005-08-01 Marek Safar <marek.safar@seznam.cz>
10736 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
10739 2005-07-31 Miguel de Icaza <miguel@novell.com>
10741 * statement.cs: Copy the local exception into the exception
10742 captured local. Fixes 75674
10744 2005-07-31 Raja R Harinath <harinath@gmail.com>
10747 * expression.cs (Invocation.OverloadResolve): Don't report error
10748 CS1501 if error CS1502 has been reported.
10749 (New.DoResolve): Delegate CS1501 reporting to
10750 Invocation.OverloadResolve.
10753 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
10754 invariant-meaning-in-block property in an enclosing block if
10757 2005-07-29 Marek Safar <marek.safar@seznam.cz>
10759 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
10760 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
10761 (Switch.CheckSwitch): Just save 50kb for SWF.
10763 2005-07-27 Martin Baulig <martin@ximian.com>
10765 * anonymous.cs (CaptureContext.AddField): Added
10766 `AnonymousContainer am' argument; compute its toplevel scope if
10767 it's not already computed. Fixes #75649.
10769 2005-07-26 Raja R Harinath <rharinath@novell.com>
10772 * class.cs (Constructor.Emit): Reset block to null if the block
10775 2005-07-25 Marek Safar <marek.safar@seznam.cz>
10777 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
10779 2005-07-25 Marek Safar <marek.safar@seznam.cz>
10781 * class.cs (MethodData.Define): Check whether accessor implementing
10782 interface is public.
10784 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
10786 2005-07-22 Marek Safar <marek.safar@seznam.cz>
10789 * namespace.cs (LookupType): Moved same type check to...
10791 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
10792 with the same name.
10794 2005-07-21 Raja R Harinath <rharinath@novell.com>
10796 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
10797 already found a typebuilder.
10798 * class.cs (MethodCore.IsDuplicateImplementation): Compare
10799 MemberNames, not strings.
10801 * const.cs (Error_ExpressionMustBeConst):
10802 Rename from Error_EpressionMustBeConst.
10803 * const.cs, class.cs, statement.cd: Update.
10805 2005-07-21 Marek Safar <marek.safar@seznam.cz>
10809 * const.cs (Const.LookupConstantValue): Report missing contant expression
10811 (Error_EpressionMustBeConstant): Only one error method.
10813 * class.cs, statement.c: Updated.
10815 2005-07-20 Raja R Harinath <rharinath@novell.com>
10817 * statement.cs (Block.Flags): Add back HasVarargs.
10818 (Block.flags): Make protected.
10819 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
10821 * typemanager.cs (types, typecontainers, user_types): Remove.
10822 (UserTypes, TypeContainers): Likewise.
10823 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
10824 (CleanUp, Reset): Update.
10825 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
10826 (GetNestedType): Use Type.GetNestedType.
10827 (CoreLookupType): Take two arguments, the namespace and the
10828 basename of the type. Update to use the Namespace.Lookup
10830 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
10831 (RealMemberLookup): Use IsNestedChildOf instead of playing with
10832 string concatenation and substring matches.
10833 * class.cs, enum.cs, delegate.cs: Update to changes.
10835 2005-07-20 Marek Safar <marek.safar@seznam.cz>
10837 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
10838 Expression and made virtual.
10840 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
10841 (ImplicitStandardConversionExists): Fixed `byte' typo ?
10843 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
10845 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
10848 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
10851 2005-07-18 Marek Safar <marek.safar@seznam.cz>
10854 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
10855 AssemblyCultureAttribute is not used on executable.
10858 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
10860 2005-07-16 Raja R Harinath <rharinath@novell.com>
10863 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
10864 New. Reports CS0252/CS0253.
10865 Mostly taken from preliminary patch by Duncak Mak.
10866 (Binary.DoResolveOperator): Store results of operator lookup.
10867 Use them to detect if we need to warn about unintended reference
10870 2005-07-15 Raja R Harinath <rharinath@novell.com>
10873 * namespace.cs (Namespace.Lookup): Add back location parameter.
10874 (Namespace.LookupType): Add CS0436 report. Add location parameter.
10875 * delegate.cs, ecore.cs, expression.cs: Update to changes.
10877 * codegen.cs (EmitContext.DeclSpace): Make readonly.
10878 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
10879 (Namespace.LookupType): ... this.
10880 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
10882 * typemanager.cs (LookupTypeReflection): Remove buggy code that
10883 purported to handle pointers.
10884 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
10887 2005-07-15 Marek Safar <marek.safar@seznam.cz>
10889 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
10892 2005-07-15 Raja R Harinath <rharinath@novell.com>
10894 * namespace.cs (Namespace.Lookup): Drop location parameter.
10895 (NamespaceEntry.LookupAlias): Remove. Merge into ...
10896 (NamespaceEntry.Lookup): ... this.
10897 (NamespaceEntry.Error_AmbiguousTypeReference):
10898 Move here from DeclSpace.
10899 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
10901 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
10902 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
10903 Move to NamespaceEntry.
10904 * delegate.cs, expression.cs: Update to changes.
10906 2005-07-14 Marek Safar <marek.safar@seznam.cz>
10908 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
10909 CheckAttributeType and refactored.
10910 (Attribute.ResolvePossibleAttributeType): Changed to reuse
10911 ResolveAsTypeTerminal error handling.
10912 (ResolveAsTypeTerminal): Introduced because of global attributes extra
10914 (GetSignatureForError): Print errors in same way.
10917 * codegen.cs: Reflect attribute GetSignatureForError change.
10920 * expression.cs: Add silent parameter to ResolveAsTypeStep.
10922 * namespace.cs (UsingEntry): Refactored to make fields private.
10925 statement.cs: Error_UnexpectedKind has extra parameter.
10927 2005-07-14 Raja R Harinath <rharinath@novell.com>
10929 * ecore.cs (IAlias): Remove.
10930 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
10931 that implement the interface.
10932 * namespace.cs (Namespace): Likewise.
10933 (Namespace.declspaces): Renamed from 'defined_names'.
10934 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
10935 DeclSpace instead of an IAlias.
10936 * tree.cs (Tree.AddDecl): Update.
10938 2005-07-12 Raja R Harinath <rharinath@novell.com>
10940 * statement.cs (Block.Flags); Remove HasVarargs.
10941 (Block.HasVarargs): Move to ToplevelBlock.
10942 (Block.ThisVariable, Block.AddThisVariable): Likewise.
10943 (Block.Variables): Make protected. Initialize variable hashtable
10945 (Block.AddVariable): Update.
10946 (Block.Resolve): Update to changes.
10947 (ToplevelBlock.HasVarargs): New boolean.
10948 (ToplevelBlock.ThisVariable): Move here from Block.
10949 (ToplevelBlock.AddThisVariable): Likewise.
10950 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
10951 * expression.cs (This.ResolveBase): Update to changes.
10952 (ArglistAccess.DoResolve): Likewise.
10954 2005-07-11 Marek Safar <marek.safar@seznam.cz>
10957 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
10959 * class.cs (TypeContainer.VerifyMembers): Distinguish between
10960 not used and not used & assigned.
10961 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
10963 2005-07-11 Marek Safar <marek.safar@seznam.cz>
10966 * expression.cs (Is.DoResolve): null is never provided type.
10968 2005-07-08 Marek Safar <marek.safar@seznam.cz>
10971 * cs-parser.jay: Less strict event error rule to catch more errors.
10973 2005-07-08 Martin Baulig <martin@ximian.com>
10975 Fix test-iter-10.cs - distinguish whether we `yield' in a property
10976 gettter (allowed) or setter (not allowed).
10978 * class.cs (Accessor): Implement IIteratorContainer.
10979 (Accessor.Yields): New public field.
10980 (PropertyBase.PropertyMethod.Define): Handle iterators on a
10981 per-accessor basis.
10984 (get_accessor_declaration, set_accessor_declaration): Set the
10985 `yields' flag on the accessor, not the property.
10986 (property_declaration): Do the iterators check on a per-accessor
10987 basis and not for the whole property.
10989 2005-07-08 Martin Baulig <martin@ximian.com>
10991 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
10992 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
10994 2005-07-07 Marek Safar <marek.safar@seznam.cz>
10997 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
10998 (ExtractSecurityPermissionSet): Cope with self referencing security
10999 attributes properly.
11001 * driver.cs (SetOutputFile): Made public property OutputFile.
11003 2005-07-07 Raja R Harinath <rharinath@novell.com>
11006 * class.cs (TypeContainer.first_nonstatic_field): Rename from
11007 has_nonstatic_fields. Make into a FieldBase pointer.
11008 (TypeContainer.AddField): Add CS0282 check.
11009 (TypeContainer.EmitType): Update.
11011 2005-07-06 Miguel de Icaza <miguel@novell.com>
11013 * cs-tokenizer.cs (consume_identifier): Do not create strings to
11014 compare if they start with __.
11016 2005-07-06 Raja R Harinath <rharinath@novell.com>
11018 * statement.cs (Switch.SwitchGoverningType): Only look at
11019 UserCasts that don't need implicit standard conversions to one of
11020 the allowed switch types (Fixes test-322.cs).
11021 (LocalInfo.Resolve): Re-enable sanity-test.
11023 2005-07-06 Marek Safar <marek.safar@seznam.cz>
11025 * cs-tokenizer.cs (consume_identifier): Detect double undescores
11027 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
11029 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
11031 2005-07-06 Raja R Harinath <rharinath@novell.com>
11034 * ecore.cs (SimpleName.GetSignatureForError): Add.
11035 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
11036 (MemberAccess.GetSignatureForError): Add.
11038 2005-07-05 Marek Safar <marek.safar@seznam.cz>
11040 The big error and warning messages review.
11070 * typemanager.cs: Updated.
11072 * class.cs: (MethodCore.SetYields): Moved here to share.
11073 (PropertyMethod.Define): Moved iterator setup here.
11075 * iterators.cs: Add orig_method to have full access to parent
11078 2005-07-05 Raja R Harinath <rharinath@novell.com>
11080 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
11081 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
11082 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
11083 variable of struct type.
11084 * expression.cs (Unary.ResolveOperator): Update to change.
11085 (Indirection.VerifyFixed): Likewise.
11086 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
11087 (ParameterReference.VerifyFixed): Value parameters are fixed.
11088 (This.VerifyFixed): Treat 'this' as a value parameter.
11089 * statement.cs (LocalInfo.IsFixed): Remove.
11091 2005-07-01 Martin Baulig <martin@ximian.com>
11093 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
11094 `ec.EmitThis ()' to get the correct scope.
11096 2005-07-01 Martin Baulig <martin@ximian.com>
11098 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
11099 instance is a ParameterReference; fixes #75299.
11101 2005-07-01 Martin Baulig <martin@ximian.com>
11103 Reverted Marek's latest patch (r46725):
11104 - it contains structural changes which are neither mentioned in
11105 the ChangeLog nor explained anywhere; for example the additional
11106 argument of EmitContext's and Iterator's .ctor's and the
11107 TypeContainer.DefineMembers() change.
11108 - structural changes like this should go in in seperate patches
11109 and not be hidden in a huge patch which just seems to affect
11110 warnings and errors.
11111 a big and hard to understand patch.
11112 - it breaks iterators and causes regressions, for instance in
11115 2005-06-30 Raja R Harinath <rharinath@novell.com>
11118 * expression.cs (Indexers.map): Remove.
11119 (Indexers.Append): Filter out inaccessible setters and getters.
11120 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
11123 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
11124 Refactored from ...
11125 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
11126 (FieldExpr.Emit, PropertyExpr.Emit): Update.
11127 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
11128 * expression.cs (Invocation.EmitCall): Add CS0120 check.
11130 2005-06-30 Marek Safar <marek.safar@seznam.cz>
11133 * class.cs (FieldBase.GetInitializerExpression): One more field
11136 2005-06-28 Miguel de Icaza <miguel@novell.com>
11138 * pending.cs: Do not define a proxy if the base method is virtual,
11139 it will be picked up by the runtime (bug 75270).
11141 2005-06-08 Martin Baulig <martin@ximian.com>
11143 The big Iterators rewrite :-)
11145 * iterators.cs: Rewrite this to use the anonymous methods framework.
11147 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
11148 before the TypeContainers; see 2test-21.cs.
11151 (TypeContainer.DefineType): Don't create a new EmitContext if we
11152 already have one (this only happens if we're an Iterator).
11153 (TypeContainer.Define): Also call Define() on all our iterators.
11154 (Method.CreateEmitContext): Added support for iterators.
11157 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
11158 (AnonymousContainer.CreateMethodHost): Moved here from
11159 AnonymousMethod and made abstract.
11160 (AnonymousContainer.CreateScopeType): New abstract method.
11161 (AnonymousContainer.IsIterator): New public property.
11162 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
11163 get the ScopeTypeBuilder rather than manually defining it here.
11164 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
11167 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
11168 before RootContext.DefineTypes().
11170 * codegen.cs (EmitContext.RemapToProxy): Removed.
11171 (EmitContext.CurrentAnonymousMethod): Changed type from
11172 AnonymousMethod -> AnonymousContainer.
11173 (EmitContext.ResolveTopBlock): Protect from being called twice.
11174 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
11175 (EmitContext.EmitThis): Removed the iterators hacks; use the
11176 anonymous methods framework for that.
11179 (ToplevelBlock.Container): Make this a property, not a field.
11180 (ToplevelBlock.ReParent): New public method; move the
11181 ToplevelBlock into a new container.
11182 (Foreach.TemporaryVariable): Simplify.
11184 2005-06-05 Martin Baulig <martin@ximian.com>
11186 * statement.cs (LocalInfo.CompilerGenerated): New flag.
11187 (Block.AddTemporaryVariable): New public method; creates a new
11188 `LocalInfo' for a temporary variable.
11189 (Block.EmitMeta): Create the LocalBuilders for all the temporary
11191 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
11192 non-iterator variables.
11194 2005-06-05 Martin Baulig <martin@ximian.com>
11196 * statement.cs (Foreach.TemporaryVariable): Create the
11197 LocalBuilder in the Emit phase and not in Resolve since in some
11198 situations, we don't have an ILGenerator during Resolve; see
11199 2test-19.cs for an example.
11201 2005-06-04 Martin Baulig <martin@ximian.com>
11203 **** Merged r45395 from GCS ****
11205 The big Foreach rewrite - Part II.
11207 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
11208 with `PropertyInfo ienumerator_getcurrent'.
11210 * codegen.cs (VariableStorage): Removed.
11213 (Foreach): Derive from Statement, not ExceptionStatement.
11214 (Foreach.CollectionForeach): New nested class. Moved all the code
11215 dealing with collection foreach here.
11216 (Foreach.ForeachHelperMethods): Removed.
11217 (Foreach.TemporaryVariable): Implement IMemoryLocation.
11219 2005-05-23 Martin Baulig <martin@ximian.com>
11221 * statement.cs (Try.DoResolve): Don't create a `finally' if we
11222 don't need to. Fix #75014.
11224 2005-05-20 Martin Baulig <martin@ximian.com>
11226 Merged r44808 from GMCS.
11228 * class.cs (TypeContainer.CircularDepException): Removed.
11229 (TypeContainer.DefineType): Removed the `InTransit' stuff.
11230 (TypeContainer.CheckRecursiveDefinition): Check for circular class
11231 (CS0146) and interface (CS0529) dependencies here.
11233 2005-06-21 Raja R Harinath <rharinath@novell.com>
11235 * expression.cs (Invocation.EmitCall): Fix initialization
11236 'this_call' to reflect current behaviour. Fix indentation.
11238 * convert.cs (FindMostEncompassedType): Add two trivial special
11239 cases (number_of_types == 0 || number_of_types == 1).
11240 (FindMostEncompasingType): Likewise.
11242 2005-06-17 Raja R Harinath <rharinath@novell.com>
11244 Some cleanups preparing for the fix of #75283.
11245 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
11247 (EventExpr.InstanceResolve): Likewise.
11248 (EventExpr.DoResolve): Remove redundant checks.
11250 2005-06-10 Duncan Mak <duncan@novell.com>
11252 * cs-tokenizer.cs (process_directives): New flag for controlling
11253 the processing of preprocessor directives.
11254 (x_token): After seeing a '#', return Token.NONE instead of going
11255 to handle_preprocessing_directive() when not processing
11256 directives. This avoids unnecessary processing during the token peek in
11261 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
11262 the existing error reporting methods instead of Report.Error.
11264 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
11265 after Raja's rewrite.
11267 2005-06-08 Miguel de Icaza <miguel@novell.com>
11269 * class.cs: Small fix.
11271 2005-06-08 Raja R Harinath <rharinath@novell.com>
11274 * class.cs (GetPartialBases): Fix return value check of
11275 part.GetClassBases.
11277 2005-06-07 Raja R Harinath <rharinath@novell.com>
11279 Ensure that partial classes are registered in their enclosing
11280 namespace. Initial part of fix of #75160.
11281 * tree.cs (Tree.RecordDecl): Add new namespace argument.
11282 Register declspace with namespace here, not in
11283 DeclSpace.RecordDecl.
11284 * cs-parser.jay: Pass namespace to RecordDecl.
11285 * class.cs (PartialContainer.Create): Likewise.
11286 (ClassPart.DefineType): New sanity-check. Throws an exception if
11288 * decl.cs (Declspace.RecordDecl): Remove.
11289 * namespace.cs (NamespaceEntry.DefineName): Remove.
11291 2005-06-06 Marek Safar <marek.safar@seznam.cz>
11293 * rootcontext.cs: Reset TargetExt as well.
11295 2005-06-03 Raja R Harinath <rharinath@novell.com>
11297 * ecore.cs (Expression.Resolve): Emit CS0654 error when
11298 -langversion:ISO-1.
11300 2005-06-02 Raja R Harinath <rharinath@novell.com>
11302 Fix #75080, cs0119.cs.
11303 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
11305 (Expression.Resolve): ... this. Use it. Remove bogus code
11306 allowing ExprClass.Type and ExprClass.Namespace for
11307 ResolveFlags.VariableOrValue.
11308 (Expression.Resolve) [1-argument variant]: Change default resolve
11309 flags based on language version.
11310 (Expression.Error_UnexpectedKind): Use a simple string array
11311 rather than an ArrayList.
11312 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
11313 not ExprClass.Type.
11314 (TypeOfVoid.DoResolve): Likewise.
11315 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
11316 flags argument -- it always has the same value.
11318 2005-05-31 Raja R Harinath <rharinath@novell.com>
11321 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
11322 Use it in the error message.
11323 * assign.cs, expression.cs, statement.cs: Update.
11325 2005-05-30 Raja R Harinath <rharinath@novell.com>
11328 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
11329 the "almostMatchedMember" case too.
11330 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
11331 that failed the accessibility checks to 'almost_match'.
11333 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
11335 * attribute.cs: Use internal MethodBuilder methods to set
11336 ExactSpelling and SetLastError on PInvoke methods, instead
11337 of passing them via charset. Fixes #75060.
11339 2005-05-27 Raja R Harinath <rharinath@novell.com>
11341 * parameter.cs (Parameter): Remove TODO comment.
11342 (Parameter.DefineParameter): Remove Location parameter.
11343 (Parameters.LabelParameters): Likewise.
11344 * class.cs (Constructor.Emit): Update to change.
11345 (MethodData.Emit): Likewise.
11346 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
11347 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
11349 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
11352 Removed Parameters.Location and added Parameter.Location instead.
11353 Removed Location parameter from Emit() and GetSignature().
11360 Modified all related calls.
11362 2005-05-26 Raja R Harinath <rharinath@novell.com>
11364 Improve user-defined conversion handling.
11365 * convert.cs (GetConversionOperators): Rewrite. Return only the
11366 applicable operators.
11367 (AddConversionOperators): New. Helper for GetConversionOperators.
11368 (FindMostEncompassedType, FindMostEncompassingType): Verify that
11369 there is only one most encompassed/encompassing type.
11370 (FindMostSpecificSource, FindMostSpecificTarget): Remove
11371 "applicable operator" handling.
11372 (UserConversion): Move cache here from GetConversionOperators.
11373 Directly cache the chosen operator, rather than the whole
11375 (ExplicitNumericConversion): Fix buggy implementation of Decimal
11376 case. Allow conversion of decimal to sbyte and byte too.
11377 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
11378 New static methods. Used to avoid allocating EmptyExpressions in
11381 2005-05-24 Duncan Mak <duncan@novell.com>
11383 * ecore.cs (CastFromDecimal): New class for casting a decimal to
11384 another class, used in Convert.ExplicitNumericConversion.
11385 (CastToDecimal): New class, similar to above, but casts to
11386 System.Decimal, used in Convert.ImplicitNumericConversion and also
11387 in explicit convesion from double/float to decimal.
11389 * convert.cs (ImplicitNumericConversion): Handle implicit
11390 conversions to System.Decimal.
11391 (ExplicitNumericConversion): handle explicit conversions to
11396 2005-05-20 Miguel de Icaza <miguel@novell.com>
11398 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
11399 know the type at this stage, just break through. Fixes #75008
11401 2005-05-19 Martin Baulig <martin@ximian.com>
11404 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
11405 to disable error reporting.
11407 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
11408 here since we don't want to report an error; see the new test-336.cs.
11410 2005-05-19 Raja R Harinath <rharinath@novell.com>
11412 * statement.cs (ToplevelBlock.GetParameterReference)
11413 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
11414 Move here from class Block.
11415 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
11416 * expression.cs (ParameterReference.DoResolveBase): Likewise.
11418 2005-05-18 Martin Baulig <martin@ximian.com>
11423 (FlowBranching.Reachability): Add non-static public And() and Or()
11425 (FlowBranchingSwitch): New class; do the `break_origins' thing
11426 like in FlowBranchingLoop.
11427 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
11428 reachability, not just locals and parameters.
11429 (FlowBranching.MergeChild): Remove some of the hacks for loop and
11430 switch; MergeBreakOrigins() now takes care of that.
11432 2005-05-18 Martin Baulig <martin@ximian.com>
11434 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11435 a loop and may leave it, reset the barrier; fixes #74974.
11437 2005-05-17 Marek Safar <marek.safar@seznam.cz>
11439 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
11442 * cs-parser.jay: Catch more lexical errors.
11444 * report.cs: Add one more Error method.
11447 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
11449 2005-05-17 Martin Baulig <martin@ximian.com>
11451 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
11454 2005-05-16 Raja R Harinath <rharinath@novell.com>
11456 Fix test-382.cs. Emit values of decimal constants.
11457 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
11459 (TypeContainer.AddField): ... this.
11460 (TypeContainer.EmitFieldInitializers): Allow the list of fields
11461 with initializers to include 'Const's.
11462 (ClassPart.RegisterFieldForInitialization): Forward to
11464 * const.cs (Const.Const): Pass initializer to base class.
11465 (Const.Define): In case of decimal constants, register them for
11466 initialization in a static constructor.
11468 2005-05-14 Martin Baulig <martin@ximian.com>
11470 * statement.cs (Block.Resolve): Correctly handle unreachable code;
11471 do not call ResolveUnreachable() on unreachable statements in
11472 here, see the comment in the source code.
11474 2005-05-13 Raja R Harinath <rharinath@novell.com>
11477 * expression.cs (BinaryResolveOperator): If one of the operands of
11478 an equality comparison is 'null' and the other is a pointer type,
11479 convert the null to a NullPointer.
11480 * convert.cs (ImplicitReferenceConversion): If the expression is a
11481 NullLiteral and the target type is a pointer type, return a
11482 NullPointer instead.
11483 (ImplicitConversionStandard): Likewise.
11485 2005-05-13 Marek Safar <marek.safar@seznam.cz>
11487 * cs-parser.jay: Set readonly context based on special constructs.
11489 * expression.cs (LocalVariableReference.DoResolveBase): Improved
11490 readonly variable error handling.
11492 * rootcontext.cs (EmitCode): Don't verify members when error
11495 * statement.cs (LocalInfo): Add reaodnly context information.
11496 (SetReadOnlyContext, GetReadOnlyContext): New methods.
11498 2005-05-13 Raja R Harinath <rharinath@novell.com>
11500 * statement.cs (Block.Resolve): Revert change below. Modify fix
11501 for #74041 to initialize 'resolved' to false only for explicit
11502 blocks. Fixes #74873.
11504 2005-05-12 Raja R Harinath <harinath@gmail.com>
11507 * typemanager.cs (unmanaged_enclosing_types): New.
11508 (IsUnmanagedType): Avoid infloops by using
11509 'unmanaged_enclosing_types' to talk with recursive invocations.
11511 2005-05-13 Martin Baulig <martin@ximian.com>
11513 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
11514 instance variable, not a local. Fix #74873.
11515 (Block.ResolveUnreachable): Set it to true here.
11517 2005-05-11 Duncan Mak <duncan@novell.com>
11519 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
11520 continuing to process for 'arg'.
11521 (handle_preprocessing_directive): Check the argument of the #endif
11522 directive and report error CS1025 if there are any trailing
11525 According to the C# spec, having even whitespace after the #endif
11526 directive is illegal; however, because we call arg.TrimEnd ()
11527 beforehand, we have the same behavior as csc, allowing whitespace
11528 after the directive.
11532 2005-05-11 Marek Safar <marek.safar@seznam.cz>
11536 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
11537 (Constructor.GetObsoleteAttribute): Implemented correctly.
11539 2005-05-10 Martin Baulig <martin@ximian.com>
11541 * support.cs (ReflectionParameters.ParameterModifier): Use
11542 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
11543 and `ParameterAttributes.In'. Fixes #74884.
11545 2005-05-10 Marek Safar <marek.safar@seznam.cz>
11547 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
11549 * expression.cs (Argument.GetParameterModifier): Turned to property.
11550 (Invocation.Error_InvalidArguments): Add more descriptive errors.
11552 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
11555 2005-05-09 Raja R Harinath <rharinath@novell.com>
11558 * decl.cs (MemberCache.AddMethods): Register override methods,
11559 rather than non-override methods.
11560 * typemanager.cs (RegisterOverride): New.
11561 (IsOverride): Update.
11563 2005-05-09 Marek Safar <marek.safar@seznam.cz>
11567 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
11568 recursive declaration.
11570 * statement.cs (Block.ResolveMeta): Report any error in resolving.
11572 2005-05-06 Marek Safar <marek.safar@seznam.cz>
11574 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
11576 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
11578 2005-05-05 Raja R Harinath <rharinath@novell.com>
11581 * decl.cs (DeclSpace.FamilyAccessible):
11582 Use TypeManager.IsNestedFamilyAccessible.
11584 Fix reopened #64812.
11585 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
11588 2005-05-04 Raja R Harinath <rharinath@novell.com>
11589 Abin Thomas <projectmonokochi@rediffmail.com>
11590 Anoob V E <projectmonokochi@rediffmail.com>
11591 Harilal P R <projectmonokochi@rediffmail.com>
11594 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
11595 allow access to all static members.
11597 2005-05-04 Martin Baulig <martin@ximian.com>
11599 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
11601 2005-05-04 Martin Baulig <martin@ximian.com>
11605 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
11606 section at the end; make things work if `default' is not the last
11609 2005-05-04 Martin Baulig <martin@ximian.com>
11613 * statement.cs (Switch): Replaced the `got_default' field with a
11614 `default_section' one.
11615 (Switch.CheckSwitch): Set `default_section' here.
11616 (Switch.Resolve): If we're a constant switch and the constant is
11617 not found, use the default section.
11619 2005-05-03 Martin Baulig <martin@ximian.com>
11621 * expression.cs (ArrayAccess.EmitGetLength): New public method.
11623 * statement.cs (Foreach.ArrayForeach): New nested class.
11624 (Foreach.TemporaryVariable): New nested class.
11625 (Foreach.EmitArrayForeach): Removed; this is now in the new
11626 ArrayForeach class.
11628 2005-05-03 Raja R Harinath <rharinath@novell.com>
11630 * pending.cs (BaseImplements): Move the #74773 fix here. This is
11632 (VerifyPendingMethods): Revert change below.
11634 * typemanager.cs (IsOverride, RegisterNonOverride): New.
11635 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
11636 that used to trigger warning -28. Remove warning -28.
11637 * expression.cs (Invocation.OverloadResolve): Use
11638 TypeManager.IsOverride to distinguish override methods.
11641 * pending.cs (VerifyPendingMethods): If a base type implements the
11642 requested interface, don't bother checking individual methods of
11643 the base type. As a side-effect, this prevents the creation of
11644 unnecessary proxies.
11646 2005-05-02 Martin Baulig <martin@ximian.com>
11650 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11651 Also `And' the locals if the old vector is null.
11652 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
11653 null; in this case we basically reset all the variables.
11655 2005-05-02 Martin Baulig <martin@ximian.com>
11659 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
11660 Added `FlowBranching branching' argument; always `and' the
11661 variables instead of `or'ing them unless we're an infinite loop.
11663 * statement.cs (While.Resolve): Create a new sibling unless we're
11666 2005-05-02 Martin Baulig <martin@ximian.com>
11670 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
11671 arguments; use it instead of creating a new TopLevelBlock.
11672 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
11673 our ConstructorInitializer.
11676 (TopLevelBlock.TopLevelBranching): New public property.
11677 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
11678 and create our `TopLevelBranching'.
11680 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
11681 anonymous method host, use `block.TopLevelBranching' rather than
11682 creating a new branching.
11684 2005-04-20 Miguel de Icaza <miguel@novell.com>
11686 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
11687 a ScopeInfo, if any of the current children is a child of the new
11688 entry, move those children there.
11690 2005-04-30 Martin Baulig <martin@ximian.com>
11692 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
11693 at the beginning of a SwitchSection. Fix #73335.
11695 2005-04-27 Marek Safar <marek.safar@seznam.cz>
11698 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
11700 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
11701 (FieldExpr.DoResolve): Obsolete members are ignored for field
11704 2005-04-26 Marek Safar <marek.safar@seznam.cz>
11706 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
11707 of arrays detection.
11709 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
11711 (Field.VerifyClsCompliance): Volatile fields are not compliant.
11713 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
11716 2005-04-25 Ben Maurer <bmaurer@ximian.com>
11718 * cs-parser.jay: Use the prefered version of -unsafe in error
11721 2005-04-22 Marek Safar <marek.safar@seznam.cz>
11723 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
11726 2005-04-20 John Luke <john.luke@gmail.com>
11728 * driver.cs: fix typo in error message, --outout to --output
11730 2005-04-20 Marek Safar <marek.safar@seznam.cz>
11732 * codegen.cs (InRefOutArgumentResolving): New field.
11734 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
11735 fields outside contructor.
11737 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
11739 2005-04-19 Miguel de Icaza <miguel@novell.com>
11741 * anonymous.cs (CaptureContext.EmitParameterInstance): The
11742 parameter code was not completed ever, so it was not as up-to-date
11743 as local variables. Must finish it.
11745 The bug fix was to compare the Toplevel of the block, not the
11746 current block. Thanks for Ben for pointing this out.
11748 2005-04-19 Raja R Harinath <rharinath@novell.com>
11750 * decl.cs (AddMethods): Use the declaring type of the problem
11751 method to determine if we want to squash a warning.
11753 2005-04-19 Marek Safar <marek.safar@seznam.cz>
11755 * attribute.cs: Removed debug output.
11757 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
11759 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
11762 2005-04-18 Raja R Harinath <rharinath@novell.com>
11765 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
11766 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
11767 all null comparisons against reference types.
11769 2005-04-18 Marek Safar <marek.safar@seznam.cz>
11772 * class.cs (TypeContainer.CircularDepException) New nested
11774 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
11775 (TypeContainer.DefineType): Removed error, reset InTransit before
11777 (Class.DefineType): Throw exception when is in Transit.
11778 Catch exception and report error.
11779 (Struct.DefineType): Throw exception when is in Transit.
11780 Catch exception and report error.
11781 (Interface.DefineType): Throw exception when is in Transit.
11782 Catch exception and report error.
11784 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
11785 handle nested exception handlers.
11787 * flowanalysis.cs (InTryWithCatch): New method, search for try with
11790 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
11791 InFinally and InCatch storage.
11793 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
11794 (Catch.Resolve): Set and Restore ec.InCatch.
11795 (Try.Resolve): Set and Restore ec.InFinally.
11796 (Try.HasCatch): True when try has catch.
11798 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
11800 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
11801 for the same event member, so exclude such cases from warning 419.
11804 2005-04-16 Miguel de Icaza <miguel@novell.com>
11806 * expression.cs (Binary.ResolveOperator): Apply patch from John
11807 Luke to fix bug 59864: operators &, | and ^ on enumerations
11808 require that the same enum type on both sides.
11810 * driver.cs: Add warnings to old flag usage, this is to assist
11811 people who produce Makefiles and hope that the Makefiles will be
11814 * class.cs (TypeContainer.EmitType): Moved the definition of the
11815 special $PRIVATE$ field from the resolve phase to the Emit phase.
11816 During resolve we do not know if we are a struct with
11817 HasExplicitLayout, we know this only after the attributes for the
11820 Set the FieldOffset to zero on the dummy field that we create for
11821 the class. Fixes 74590.
11823 2005-04-16 Raja R Harinath <rharinath@novell.com>
11826 * ecore.cs (PropertyExpr.resolved): New.
11827 (DoResolve): Use it to handle a case of double resolution here.
11828 Handle a case of identical-name-and-type-name.
11829 * expression.cs (ArrayCreation.CheckIndices): Avoid double
11830 resolution by storing the results of expression resolution back
11831 into the "probes" array.
11833 2005-04-15 Raja R Harinath <rharinath@novell.com>
11835 Fix cs0208-7.cs and cs0208-8.cs.
11836 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
11837 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
11838 error reporting to point out the reason a struct is not unmanaged.
11840 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11842 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
11843 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
11845 2005-04-13 Raja R Harinath <rharinath@novell.com>
11848 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
11849 IdenticalNameAndTypeName here.
11850 (EventExpr.InstanceResolve): Likewise.
11852 2005-04-13 Marek Safar <marek.safar@seznam.cz>
11854 C# 2.0 DefaultCharSetAttribute implementation
11856 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
11857 which allows us to set GlobalNamespace for every resolve.
11858 (Attribute.ResolveArguments): Cut from Resolve.
11859 (Attribute.GetCharSetValue): Returns CharSet named argument.
11860 (Attribute.DefinePInvokeMethod): Gets default charset from
11862 (GlobalAttribute.ResolveAsTypeStep): Override.
11863 (GlobalAttribute.ResolveArguments): Override.
11865 * class.cs (TypeAttr): Is protected.
11867 * codegen.cs (ModuleClass.DefaultCharSet): New member.
11868 (ModuleClass.DefaultCharSetType): New memeber.
11869 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
11871 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
11872 charset from module.
11874 * delegate.cs (TypeAttr): Override.
11875 (Delegate.DefineType): Use this TypeAttr.
11877 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
11878 at very early stage (before types are defined) to resolve model
11879 module attributes. It will probably not work with corlib but it
11882 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
11883 charset from module.
11885 * typemanager.cs (default_charset_type): New type.
11887 2005-04-13 Raja R Harinath <rharinath@novell.com>
11889 * decl.cs (MemberCache.AddMethods): Don't warn if
11890 System.Object.Finalize has buggy MethodAttributes.
11892 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
11895 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11897 * doc.cs : detect ambiguous reference to overloaded members.
11898 Fixed bug #71603. MS 1.1 csc does not detect it.
11900 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11902 * doc.cs : delegates must not be referenced with parameters.
11905 2005-04-12 Miguel de Icaza <miguel@novell.com>
11907 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
11909 2005-04-10 Miguel de Icaza <miguel@novell.com>
11911 * driver.cs (MainDriver): Stop processing if the CLS stage found
11914 (CompilerCallableEntryPoint.InvokeCompiler): Always
11915 reset after execution; Take a TextWriter argument for the
11918 * report.cs: Use the error stream instead of hardcoding stderr.
11920 2005-04-09 Miguel de Icaza <miguel@novell.com>
11922 * class.cs: Reduce code paths to test, too small of an
11923 optimization to make it worth the extra testing. Always perform
11926 2005-04-08 Raja R Harinath <rharinath@novell.com>
11929 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
11930 operators that had errors reported on them.
11932 2005-04-08 Marek Safar <marek.safar@seznam.cz>
11934 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
11936 (Attribute.Resolve): Add named argument type checking.
11938 * class.cs (FixedField.Define): Use IsPrimitiveType
11940 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
11942 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
11943 unsafe parameter types.
11945 * statement.cs (Using.ResolveExpression): Add better error description.
11947 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
11949 2005-04-08 Raja R Harinath <rharinath@novell.com>
11952 * attribute.cs (Attribute.GetAttributeUsage): Resolve
11953 AttributeUsageAttribute in the emitcontext of the attribute class,
11954 not in the emitcontext of the attributable entity it was attached to.
11955 * cs-parser.jay: Use 'current_class', not 'current_container',
11956 when creating a GlobalAttribute.
11958 2005-04-08 Alp Toker <alp@atoker.com>
11960 * pending.cs: The fix to #58413 failed to compile methods implementing
11961 interfaces with/without params modifiers and vice versa, even though
11962 params modifiers aren't part of the signature. Make the modifier check
11963 less strict as in csc.
11965 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
11966 Anoob V E <projectmonokochi@rediffmail.com>
11967 Harilal P R <projectmonokochi@rediffmail.com>
11970 * pending.cs (TypeAndMethods.mods): New. Store the parameter
11971 modifiers of pending methods.
11972 (PendingImplementation.PendingImplementation): Initialize it.
11973 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
11974 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
11975 with ParameterData. Add check for modifiers.
11976 * class.cs (MethodData.Define): Update to changes.
11978 2005-04-07 Raja R Harinath <rharinath@novell.com>
11980 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
11982 2005-04-07 Marek Safar <marek.safar@seznam.cz>
11984 * class.cs (PropertyMethod.Define): Check private accessor in abstract
11987 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
11990 * typemanager.cs: Registered RequiredAttributeAttribute.
11992 2005-04-06 Marek Safar <marek.safar@seznam.cz>
11994 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
11995 Warning CS0169 is back at level 3.
11996 (IMethodData.SetMemberIsUsed): New method.
11998 * decl.cs (IsUsed): New value; moved from FieldBase.Status
11999 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
12001 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
12003 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
12005 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
12008 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
12011 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
12012 to avoid the problems with nested types.
12014 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
12015 Anoob V.E <projectmonokochi@rediffmail.com>
12016 Harilal P.R <projectmonokochi@rediffmail.com>
12017 Raja R Harinath <rharinath@novell.com>
12020 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
12022 * typemanager (GetConstructor): Make public.
12024 2005-04-05 John Luke <john.luke@gmail.com>
12025 Raja R Harinath <rharinath@novell.com>
12028 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
12029 struct too. Return false quicker in a few cases.
12030 (VerifyUnManaged): Use it.
12032 2005-04-05 Raja R Harinath <rharinath@novell.com>
12035 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
12036 not 'unreachable_seen'.
12038 2005-04-04 Marek Safar <marek.safar@seznam.cz>
12040 * attribute.cs (Attribute.GetValue): Removed unused.
12042 * codegen.cs (CodeGen.TrimExt): Removed unused.
12044 * cs-parser.jay (output): Removed unused.
12046 * cs-tokenizer.cs (hex_digits): Removed unused.
12048 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
12050 * expression.cs (Indirection.LoadExprValue): Removed unused.
12051 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
12053 * iterators.cs (Iterator.param_types): Removed unused.
12055 * statement.cs (Goto.block): Removed unused.
12056 (ToplevelBlock.did): Removed unused.
12057 (Switch.ResolveConstantSwitch): Removed unused.
12059 2005-04-01 Ben Maurer <bmaurer@ximian.com>
12061 * rootcontext.cs: Allow mcs to bootstrap with the compilation
12064 2005-04-01 Raja R Harinath <rharinath@novell.com>
12066 Fix #74232 and cs0208-3.cs.
12067 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
12068 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
12069 unmanaged type. Don't use FieldBuilders when 't' is a
12070 TypeBuilder. Use ModFlags and MemberType fields.
12071 * class.cs (MemberBase.member_type): Rename from MemberType.
12072 (MemberBase.MemberType): New property. Determines member_type on
12074 (MemberBase.DoDefine): Don't initialize MemberType here.
12075 (FieldMember.Define): Likewise.
12077 2005-04-01 Marek Safar <marek.safar@seznam.cz>
12080 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
12081 Attributes are emitted there.
12083 2005-04-01 Raja R Harinath <rharinath@novell.com>
12085 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
12086 keyword in 'partial enum' too.
12087 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
12089 Report from Kamil Skalski <nazgul@omega.pl>.
12092 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
12093 have partial containers too.
12095 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
12096 in block' checks to Block.CheckInvariantMeaningInBlock.
12097 * statement.cs (Block.GetKnownVariableInfo): Make private.
12098 (Block.IsVariableUsedInChildBlock): Remove.
12099 (Block.IsVariableUsedInBlock): Likewise.
12100 (Block.CheckInvariantMeaningInBlock): New. Show location of
12101 conflicting declaration.
12102 (Block.AddVariable): Make error messages less long-winded and more
12103 specific. Show location of conflicting declaration.
12104 * parameter.cs (Parameters.Location): New readonly property.
12106 2005-03-31 Raja R Harinath <rharinath@novell.com>
12108 Clean up semantics of invoking ResolveMemberAccess.
12109 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
12110 can have an instance, ensure that we pass in a non-TypeExpression
12111 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
12112 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
12113 argument. Update to changes and simplify.
12114 (FieldExpr.Emitinstance): Remove CS0120 check.
12115 (PropertyExpr.EmitInstance): Likewise.
12116 * expression.cs (Argument.Resolve): Likewise.
12117 (Invocation.DoResolve): Update to changes in semantics of
12118 InstanceExpression.
12120 2005-03-31 Marek Safar <marek.safar@seznam.cz>
12123 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
12126 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
12128 2005-03-31 Raja R Harinath <rharinath@novell.com>
12130 Fix difference in behaviour with commandline invocation.
12131 * driver.cs (Driver.Reset): New.
12132 (CompilerCallableEntryPoint): Call it.
12134 * statement.cs (If.Resolve): Avoid spurious "uninitialized
12135 variable" warnings if the boolean expression failed to resolve.
12137 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
12139 * attribute.cs: Fix the union of several permissions when some of them
12140 are unrestricted (so the result isn't an unrestricted permission set).
12143 2005-03-30 Raja R Harinath <rharinath@novell.com>
12145 * ecore.cs (MemberExpr): New class. Convert from interface
12147 (MemberExpr.ResolveMemberAccess): Refactor and move here from
12148 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
12150 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
12151 (MethodGroupExpr.IsExplicitImpl): Remove.
12152 (Expression.GetFieldFromEvent): Remove.
12153 (SimpleName.MemberStaticCheck): Remove.
12154 (SimpleName.DoSimpleNameResolve): Update to changes.
12155 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
12156 (MemberAccess.IdenticalNameAndTypeName): Remove.
12157 (MemberAccess.error176): Move to MemberExpr.
12158 (MemberAccess.DoResolve): Update to changes.
12159 (BaseAccess.DoResolve): Likewise.
12161 2005-03-30 Marek Safar <marek.safar@seznam.cz>
12163 C# 2.0 Conditional attribute class implementation
12165 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
12166 Analyzes class whether it has attribute which has ConditionalAttribute
12167 and its condition is not defined.
12169 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
12170 (Class.IsExcluded): New method. Search for at least one defined
12171 condition in ConditionalAttribute of attribute class.
12173 2005-03-30 Raja R Harinath <rharinath@novell.com>
12175 * ecore.cs (PropertyExpr): Derive from Expression, not
12176 ExpressionStatement.
12177 (PropertyExpr.EmitStatement): Remove.
12179 2005-03-29 Raja R Harinath <rharinath@novell.com>
12182 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
12183 internal field "value__" of an enum be private. The examples for
12184 "value__" that I found on MSDN all used FieldAttributes.Private.
12186 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
12187 Don't mention IL method attribute names.
12189 Fix #47991. Remove a TODO.
12190 * statement.cs (Block.Toplevel): Make into a field.
12191 (Block.Parameters): Move into ToplevelBlock.
12192 (Block.known_variables): Rename from child_variable_names.
12193 (Block.Block): Remove variants that take Parameters. Initialize
12194 'Toplevel' with the immediately surrounding toplevel block.
12195 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
12196 LocalInfo parameter.
12197 (Block.GetKnownVariableInfo): New.
12198 (Block.IsVariableNameUsedInChildBlock): Update.
12199 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
12200 the block, even though it may not be in scope.
12201 (Block.AddVariable): Remove Parameters parameter. Use
12202 Toplevel.Parameters instead.
12203 (Block.AddConstant): Remove Parameters parameter.
12204 (Block.GetParameterReference): Update to use Toplevel.Parameters.
12205 (Block.IsParamaterReference): Likewise.
12206 (Block.IsLocalParameter): Likewise. Simplify a lot.
12207 (ToplevelBlock.Parameters): New. Moved from Block.
12208 (ToplevelBlock.ToplevelBlock): Update to changes. Always
12209 initialize Parameters to a non-null value.
12210 * cs-parser.jay: Update to changes.
12211 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
12212 simple names that mean different things in the same block. Use
12213 Block.IsVariableNameUsedInBlock.
12215 2005-03-28 Raja R Harinath <rharinath@novell.com>
12217 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
12218 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
12219 GetTypeHandle. It is possible for a reflected type to derive from
12220 a TypeBuilder (e.g., int[] derives from the TypeBuilder
12221 System.Array during mscorlib compilation).
12222 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
12223 contain a method_hash, don't create one either. Don't create a
12224 deep copy of the base cache's method_hash.
12225 (MemberCache.SetupCache): Rename back from DeepCopy.
12226 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
12227 already initialized. If we see an override function, add its
12228 underlying base virtual function to the member_hash too.
12230 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
12232 2005-03-26 Raja R Harinath <harinath@acm.org>
12235 * assign.cs (Assign.DoResolve): When the RHS of an assignment
12236 fails to resolve, ensure that the LHS is still resolved as an
12239 2005-03-25 Raja R Harinath <harinath@acm.org>
12241 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
12243 (Enum.current_ec): Remove.
12244 (Enum.LookupEnumValue): Remove EmitContext argument.
12245 Just uses the one created during DefineType.
12246 (Enum.FindMembers): Update.
12247 * expression.cs (MemberAccess.DoResolve): Update.
12249 2005-03-22 Marek Safar <marek.safar@seznam.cz>
12251 * assign.cs (Assign.DoResolve): Check for CS1717 when
12252 source and target are same (uses Equals).
12254 * expression.cs (LocalVariableReference, ParameterReference,
12255 This): Implemented Equals, GetHashCode.
12257 * statement.cs (Block.GetParameterReference): Removed useless
12260 2005-03-22 Raja R Harinath <rharinath@novell.com>
12263 * statement.cs (Block.AddVariable): Ensure that we skip implicit
12264 blocks before deciding whether the error is cs0136 or cs0128.
12266 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
12267 (using_alias_directive, using_namespace_directive): Pass
12268 MemberName, not an expression to Namespace.UsingAlias and
12270 (MakeName): Use the MemberName of the namespace.
12271 * namespace.cs (Namespace.MemberName): New.
12272 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
12273 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
12275 * decl.cs (MemberName.Name): Make readonly.
12276 (MemberName.FromDotted): New "constructor".
12277 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
12278 (MemberCore.Name): Compute from MemberName on demand.
12279 (MemberCore.SetMemberName): Provide a way to change the
12281 (MemberCore.AddToContainer): Don't take a fullname parameter.
12282 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
12283 fully qualified name of the container to the member name.
12284 (TypeContainer.AddToTypeContainer): Use a fully qualified name
12285 only if the type is a member of the root container.
12286 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
12287 MemberName.Left rather than searching for an embedded ".".
12288 (PartialContainer.CreatePart): Update to changes in RootContext.
12289 (MemberBase.ShortName): Turn into a property. Use
12290 MemberCore.SetMemberName.
12291 (MemberBase.ExplicitInterfaceName): Remove.
12292 (MemberBase.UpdateMemberName): Remove.
12293 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
12294 (PropertyBase.SetMemberName): New override.
12295 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
12296 (Tree.GetDecl): New.
12297 (Tree.AllDecls): Rename from Decls.
12298 * attribute.cs, enum.cs, report.cs: Update to changes.
12299 * driver.cs (MainDriver): Use MemberName.FromDotted on
12300 RootContext.MainClass.
12302 2005-03-21 Marek Safar <marek.safar@seznam.cz>
12304 * class.cs (FixedField.Define): Check for CS1664 and more sanity
12307 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
12309 2005-03-18 Marek Safar <marek.safar@seznam.cz>
12311 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
12312 property accessor modifiers.
12314 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
12315 fixed buffer attribute (CS1716).
12316 (PropertyMethod.HasCustomAccessModifier): When property accessor
12317 has custom modifier.
12319 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
12321 (PropertyExpr.DoResolveLValue): Add CS0272.
12323 2005-03-17 Miguel de Icaza <miguel@novell.com>
12325 * convert.cs: When converting to a pointer, use the proper Conv.U
12326 or Conv.I depending on the source data type.
12328 * cs-tokenizer.cs: Make the size for large decimal constants,
12331 2005-03-17 Martin Baulig <martin@ximian.com>
12333 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
12334 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
12336 2005-03-17 Martin Baulig <martin@ximian.com>
12338 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
12339 to bool so we can return an error condition.
12340 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
12343 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
12345 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
12348 2005-03-16 Raja R Harinath <rharinath@novell.com>
12350 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
12351 Refactor to avoid traversing the list of assemblies, and to avoid
12352 string concatenation.
12353 * typemanager.cs (guid_attr_type): Remove.
12354 (negative_hits, pointers, references): Remove hashes.
12356 (GetConstructedType): New. Uses type_hash to handle constructed
12357 types (arrays, references, pointers).
12358 (GetReferenceType, GetPointerType): Use it.
12359 (GetNestedType): New. Uses type_hash to handle nested types of
12361 (LookupType, LookupTypeDirect): Remove.
12362 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
12363 'types' hash and LookupTypeReflection directly.
12364 (params_string, params_object): Use GetConstructedType.
12365 * namespace.cs (Namespace.cached_types): New. Cache of reflected
12367 (Namespace.Lookup): Use cached_types.
12368 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
12369 provided by old TypeManager.LookupType.
12370 * rootcontext.cs (MakeFQN): Remove.
12371 * decl.cs (DeclSpace.MakeFQN): Likewise.
12372 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
12373 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12374 TypeManager.GetConstructedType.
12375 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
12377 2005-03-15 Marek Safar <marek.safar@seznam.cz>
12379 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
12382 * cs-parser.jay: Reports CS1527 for any namespace element.
12384 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
12387 * expression.cs (ParameterReference.IsAssigned): Changed error to
12389 (Error_WrongNumArguments): Moved CS0245 detection here.
12391 * statement.cs (Return.Resolve): Add CS1622 report.
12393 2005-03-11 Marek Safar <marek.safar@seznam.cz>
12395 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
12397 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
12399 * attribute.cs expression.cs: Get rid of some allocations.
12401 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
12403 * doc.cs : just eliminate the latest change.
12405 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12407 * doc.cs : commented out the latest change. It breaks xml-030.cs
12409 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12411 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
12412 fail. So invoke CreateType() in FindDocumentedType().
12414 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12416 * cs-tokenizer.cs : added IsKeyword().
12417 * doc.cs : Detect keyword incorrectly used as identifier.
12418 Allow identifiers prefixed by @.
12420 2005-03-10 Marek Safar <marek.safar@seznam.cz>
12422 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
12423 It caused exception in namespace resolving (again!).
12425 * class.cs (Class.ctor): Removed exit.
12426 (PropertyMethod.ctor): ditto.
12428 * codegen.cs (Codegen.Reset): Reset static data.
12429 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
12431 * cs-tokenizer.cs (Cleanup): Removed.
12433 * driver.cs (GetSystemDir): Rewrote to one line command.
12434 It caused problem with unloaded dynamic modules.
12435 (UnixParseOption): Removed Exit.
12436 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
12437 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
12438 Now can be mcs used as library.
12440 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
12443 * location.cs (Reset): Reset static data.
12445 * namespace.cs (Reset): Reset static data.
12447 * report.cs (Report.Reset): Reset static data.
12449 * rootcontext.cs (RootContext.Reset): Reset static data.
12451 * tree.cs (RootTypes.ctor): Use Location.Null
12453 * typemanager.cs (TypeManager.Reset): Reset static data.
12454 (CoreLookupType): Removed Exit.
12455 (TypeHandle.Reset): Reset static data.
12457 2005-03-10 Raja R Harinath <rharinath@novell.com>
12460 * typemanager.cs (ComputeNamespaces): Import namespaces from
12461 referenced modules too.
12463 2005-03-09 Raja R Harinath <rharinath@novell.com>
12465 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
12468 2005-03-09 Raja R Harinath <rharinath@novell.com>
12470 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
12471 enclosing DeclSpace. This ensures that a name-lookup populates
12472 more caches and there are fewer 'TypeExpression's. Carve out
12473 nested type lookup into ...
12474 (LookupNestedTypeInHierarchy): ... this.
12476 2005-03-09 Raja R Harinath <rharinath@novell.com>
12478 Clean up a few partial-class semantics.
12479 Fixes test-357.cs and cs1618-2.cs.
12480 * cs-parser.jay (struct_declaration): Use 'current_class' as
12481 parent of newly-created struct. Remove call to Register ().
12482 Use 'pop_current_class' to complete handing the current struct.
12483 (interface_declaration): Likewise.
12484 (class_declaration): Likewise.
12485 (enum_declaration): Use 'current_class' as parent of newly created
12487 (delegate_declaration): Likewise.
12488 (pop_current_class): New function. This is used to handle closing
12489 up the 'current_class' and 'current_container', and pointing them
12490 to the enclosing class/container.
12491 (CSharpParser): Initialize 'current_class' too.
12492 * decl.cs (MemberCore): Add check for invariant: a partial
12493 container is not a parsed entity, and thus does not enclose any
12495 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
12496 (DeclSpace.BaseTypeExpr): Use it.
12497 (DeclSpace.LookupType): Add check for invariant.
12498 * class.cs (TypeContainer): Add check for invariant: a nested
12499 class should have the same NamespaceEntry as its enclosing class.
12500 (TypeContainer.EmitFieldInitializers): Make virtual.
12501 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
12503 (TypeContainer.Register): Remove.
12504 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
12505 null. Use TypeResolveEmitContext for resolving base types and
12506 interfaces. Move initialization of Parts.TypeBuilder here from
12508 (TypeContainer.DefineNestedTypes): ... here.
12509 (PartialContainer): Take a Namespace not a NamespaceEntry.
12510 (PartialContainer.Create): Don't use Register. Call the
12511 appropriate Add... function directly.
12512 (ClassPart): Take both the PartialContainer and the enclosing
12513 class as constructor arguments.
12514 (ClassPart.EmitFieldInitializers): Override.
12515 (ClassPart.PartFindNestedTypes): Remove.
12516 (FieldBase.GetInitializerExpression): Resolve the initializer
12517 expression in the emit context of the enclosing class.
12518 * tree.cs (RootTypes): Remove Register ().
12520 2005-03-08 Marek Safar <marek.safar@seznam.cz>
12522 * cs-parser.jay: Removed CS0134.
12524 * driver.cs: Removed CS1901.
12526 * expression.cs (SizeOf.DoResolve): Don't report CS0233
12527 for predefined types.
12529 2005-03-07 Duncan Mak <duncan@novell.com>
12531 * codegen.cs (Save): Catch UnauthorizedAccessException as
12532 well. Fixes bug #73454.
12534 2005-03-07 Marek Safar <marek.safar@seznam.cz>
12536 * cs-tokenizer.cs (xtoken): Add CS1035.
12538 * class.cs (MethodData.Define): Add CS0683.
12539 (FieldMember.ctor): Add CS0681.
12541 2005-03-07 Raja R Harinath <rharinath@novell.com>
12543 * ecore.cs (SimpleName.DoResolve): Rename from
12544 SimpleName.DoResolveAllowStatic.
12545 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
12546 Pass 'intermediate' flag to MemberStaticCheck.
12547 (SimpleName.MemberStaticCheck): Skip "static check" only in case
12548 of "intermediate" lookups via MemberAccess.
12549 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
12550 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
12552 2005-03-07 Raja R Harinath <rharinath@novell.com>
12555 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
12556 slipped in because of variable names that are identical to a
12557 builtin type's BCL equivalent ('string String;', 'int Int32;').
12558 (PropertyExpr.EmitInstance): Likewise.
12560 2005-03-04 Marek Safar <marek.safar@seznam.cz>
12562 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
12564 * report.cs (warning_ignore_table): Made public.
12566 2005-03-04 Raja R Harinath <rharinath@novell.com>
12569 * class.cs (MethodData.Emit): Pass 'container' to
12570 container.GetObsoleteAttribute instead of 'container.Parent'.
12572 2005-03-03 Marek Safar <marek.safar@seznam.cz>
12574 * cs-parser.jay: Add 1534 error test.
12576 * iterators.cs (Yield.CheckContext): Add error 1629.
12577 (Iterator.ctor): Save unsafe modifier.
12578 (MoveNextMethod.DoEmit): Restore unsafe context.
12580 * namespace.cs (UsingAlias): Better error message.
12582 2005-03-03 Dan Winship <danw@novell.com>
12584 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
12585 the warning message [#73219]
12587 2005-03-03 Raja R Harinath <rharinath@novell.com>
12589 Fix compile with MCS 1.0.0.0.
12590 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
12591 w_restore to not depend on string constant folding.
12593 2005-03-03 Raja R Harinath <rharinath@novell.com>
12595 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
12596 CS0246 check to users who passed 'silent = false'.
12597 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
12599 (SimpleName.SimpleNameResolve): Update.
12600 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
12601 (MemberAccess.IdenticalNameAndTypeName): Update.
12602 * doc.cs (FindDocumentedTypeNonArray): Update.
12604 2005-03-03 Raja R Harinath <rharinath@novell.com>
12606 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
12607 * parameters.cs (ComputeAndDefineParameters): Remove.
12608 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
12609 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
12610 Use GetParameterInfo.
12612 2005-03-02 Marek Safar <marek.safar@seznam.cz>
12614 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
12616 2005-03-02 Raja R Harinath <rharinath@novell.com>
12618 Unify DeclSpace.LookupType and DeclSpace.FindType.
12619 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
12620 is in charge of defining nested types on demand.
12621 (DeclSpace.LookupType): Use it when the current_type is a
12622 TypeBuilder. Use LookupTypeDirect for reflected types.
12623 (DeclSpace.FindType): Remove.
12624 (DeclSpace.LookupInterfaceOrClass): Likewise.
12625 (DeclSpace.DefineTypeAndParents): Likewise.
12626 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
12627 DeclSpace.LookupType.
12628 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
12629 * typemanager.cs (LookupType): Simplify.
12630 (AddUserType): Remove type from negative_hits.
12631 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
12632 * class.cs (TypeContainer.FindMembers): Move handling of nested
12634 (TypeContainer.FindMembers_NestedTypes): ... here.
12635 (TypeContainer.FindNestedType): Implement override.
12636 (ClassPart.FindNestedType): Delegate to PartialContainer.
12637 (ClassPart.PartFindNestedType): Looks up the nested types of the
12640 2005-03-02 Martin Baulig <martin@ximian.com>
12642 * class.cs (TypeContainer.DoDefineMembers): We also need a default
12643 static constructor in static classes.
12645 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
12647 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
12648 sizeParamIndex is not specified.
12650 2005-03-01 Marek Safar <marek.safar@seznam.cz>
12653 * report.cs (WarningMessage.IsEnabled): Missing null check.
12655 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12657 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
12658 in the fields and not in the properties.
12660 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
12662 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
12665 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12667 * attribute.cs: Small refactoring (improved robustness).
12668 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
12669 (ValidateGuid): Removed.
12670 (Resolve): Removed referenced to above mentioned.
12671 (GetAttributeUsage): Made private and changed to work without
12673 (GetIndexerAttributeValue): Don't crash.
12674 (GetConditionalAttributeValue): Ditto.
12675 (GetClsCompliantAttributeValue): Ditto.
12676 (ExtractSecurityPermissionSet): All attributes exceptions are
12678 (GetPropertyValue): New helper.
12679 (GetMethodImplOptions): New method.
12680 (DefinePInvokeMethod): Reuse common code. Implemented handling of
12681 some missing properties.
12683 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
12684 (Method.ApplyAttributeBuilder): Updated.
12686 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
12689 2005-02-28 Raja R Harinath <rharinath@novell.com>
12692 * report.cs (Report.SymbolRelatedToPreviousError): Handle
12693 non-simple types (array, pointer, reference).
12695 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12697 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
12699 * class.cs (MethodCore.IsDuplicateImplementation): Special error
12701 (Method.CheckBase): Catch wrong destructor here.
12702 (MethodData.Define): Add errors 550, 668.
12704 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
12706 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
12708 * pending.cs (VerifyPendingMethods): Add error 551.
12710 * typemanager.cs (CSharpName): Next error report helper.
12712 2005-02-25 Marek Safar <marek.safar@seznam.cz>
12714 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
12715 attributes. Removed useless attribute double check.
12716 It saves almost 2MBs for corlib.
12718 2005-02-25 Raja R Harinath <rharinath@novell.com>
12721 * statement.cs (ExpressionStatement.Resolve): Make robust to being
12722 called twice in case of error.
12724 2005-02-23 Chris Toshok <toshok@ximian.com>
12726 Fix compiler portions of #72827.
12727 * statement.cs (Block.Emit): call Begin/EndScope on the
12728 EmitContext instead of the ILGenerator.
12730 * codegen.cs (EmitContext.BeginScope): new method, call
12731 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
12733 (EmitContext.BeginScope): same, but EndScope and CloseScope
12735 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
12736 offset and call the superclass's OpenScope(int) with it.
12737 (SymbolWriter.CloseScope): get the current il
12738 offset and call superclass's CloseScope(int) with it.
12740 2005-02-23 Marek Safar <marek.safar@seznam.cz>
12742 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
12743 CS1677 for out and ref as well.
12745 * class.cs (Method.Define): Add error CS1599 detection.
12747 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
12749 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
12751 * delegate.cs (Delegate.Define): Add error CS1599 detection.
12753 * support.cs.cs (ModifierDesc): New helper method.
12755 2005-02-23 Raja R Harinath <rharinath@novell.com>
12756 Abin Thomas <projectmonokochi@rediffmail.com>
12757 Anoob V E <projectmonokochi@rediffmail.com>
12758 Harilal P R <projectmonokochi@rediffmail.com>
12760 Fix #57851, #72718.
12761 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
12762 MemberLookup (used for error reporting) actually returns a result.
12763 Fix error report number (122, not 112).
12765 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
12766 Anoob V E <projectmonokochi@rediffmail.com>
12767 Harilal P R <projectmonokochi@rediffmail.com>
12770 * pending.cs (PendingImplementation.GetAbstractMethods):
12771 Find NonPublic members too.
12773 2005-02-22 Marek Safar <marek.safar@seznam.cz>
12775 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
12778 * class.cs (MethodCore.CheckMethodAgainstBase):
12779 Add error 239 report.
12781 2005-02-21 Raja R Harinath <rharinath@novell.com>
12784 * expression.cs (Invocation.IsApplicable): Make public.
12785 (Invocation.IsParamsMethodApplicable): Likewise.
12786 * delegate.cs (Delegate.VerifyApplicability): Don't use
12787 Invocation.VerifyArgumentCompat for parameter applicability
12788 testing. Use Invocation.IsApplicable and
12789 Invocation.IsParamsMethodApplicable.
12791 2005-02-21 Marek Safar <marek.safar@seznam.cz>
12793 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
12795 * class.cs (Operator.Define): Add error 217 report.
12797 2005-02-21 Raja R Harinath <rharinath@novell.com>
12799 * namespace.cs (UsingEntry.Resolve): Undo change below.
12801 2005-02-21 Raja R Harinath <rharinath@novell.com>
12804 * ecore.cs (Expression.MemberLookupFailed): Add argument to
12805 disable the error message when the extended MemberLookup also
12807 (Expression.MemberLookupFinal): Update.
12808 (SimpleName.DoSimpleNameResolve): Update.
12809 * expression.cs (MemberAccess.ResolveNamespaceOrType):
12810 Don't use MemberLookupFinal.
12811 (New.DoResolve): Update.
12812 (BaseAccess.CommonResolve): Update.
12814 2005-02-21 Raja R Harinath <rharinath@novell.com>
12817 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
12818 occured previously, don't resolve again.
12820 2005-02-21 Marek Safar <marek.safar@seznam.cz>
12823 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
12824 argument. Call ResolveAttributeUsage for unresolved.
12825 when types doesn't match ctor arguments.
12827 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
12828 for nested attribute classes.
12829 (Class.attribute_usage): Removed.
12830 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
12831 for attribute class.
12833 * ecore.cs (IsAttribute): Removed.
12835 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
12837 * rootcontext.cs (RegisterAttribute): Removed, attributes are
12839 (attribute_types): Removed.
12840 (EmitCode): Global attributes are emited as the latest.
12842 2005-02-18 Marek Safar <marek.safar@seznam.cz>
12844 * class.cs (EmitFieldInitializers): Don't emit field initializer
12845 for default values when optimilization is on.
12847 * constant.cs (Constant.IsDefaultValue): New property.
12849 * driver.cs: Add /optimize handling.
12853 * literal.cs: Implement new IsDefaultValue property.
12855 * rootcontext.cs (Optimize): New field, holds /optimize option.
12857 2005-02-18 Raja R Harinath <rharinath@novell.com>
12859 Fix crasher in re-opened #72347.
12860 * namespace.cs (Namespace.Lookup): Return null if
12861 DeclSpace.DefineType returns null.
12864 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
12866 2005-02-18 Raja R Harinath <rharinath@novell.com>
12868 Fix remainder of #63202. Change semantics of DoResolveLValue: it
12869 now returns null if it cannot resolve to an lvalue.
12870 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
12871 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
12872 returned null. Remove check for SimpleName.
12873 (EventExpr.DoResolveLValue): New.
12874 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
12875 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
12877 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
12878 avoid CS0131 error.
12879 (Unary.ResolveOperator): Move CS0211 check ...
12880 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
12882 (Unary.DoResolveLValue): Simplify.
12883 (AddressOf.DoResolveLValue): New.
12884 (ArrayAccess.DoResolveLValue): New.
12886 2005-02-16 Marek Safar <marek.safar@seznam.cz>
12888 * attribute.cs (Attribute.Resolve): Add arguments casting for
12889 when types doesn't match ctor arguments.
12891 2005-02-16 Raja R Harinath <rharinath@novell.com>
12893 Fix parts of #63202.
12894 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
12895 lookup of operator in base type. Ensure that all checks happen
12896 when the operator resolves to an "op_..." method.
12898 2005-02-15 Raja R Harinath <rharinath@novell.com>
12901 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
12902 'ignore_cs0104' parameter. Pass it to ...
12903 (NamespaceEntry.Lookup): ... this.
12904 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
12905 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
12906 (TypeLookupExpression.DoResolveAsTypeStep): Update.
12907 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
12908 Update. Request that cs0104 errors be ignored.
12909 (ComposedCast.ResolveAsTypeStep): Update.
12911 2005-02-14 Raja R Harinath <rharinath@novell.com>
12914 * expression.cs (Invocation.BetterFunction): Remove support for
12915 comparing virtual functions and their overrides.
12916 (Invocation.IsOverride): New.
12917 (Invocation.OverloadResolve): Don't consider 'override' functions
12918 during candidate selection. Store them in a lookaside list.
12919 If the selected method is a 'virtual' function, use the list to
12920 find any overrides that are closer to the LHS type.
12922 2005-02-14 Marek Safar <marek.safar@seznam.cz>
12924 * expression.cs (New.DoResolve): Add complex core type reduction.
12925 (New.Constantify): Converts complex core type syntax like 'new int ()'
12926 to simple constant.
12928 2005-02-14 Raja R Harinath <rharinath@novell.com>
12930 * decl.cs (EntryType.EntryType): New constructor to create an
12931 updated copy of a cache entry.
12932 (MemberCache.AddMethods): Use it.
12933 (MemberCache.ClearDeclaredOnly): Remove.
12934 (MemberCache.MemberCache): Update.
12936 2005-02-11 Miguel de Icaza <miguel@novell.com>
12938 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
12939 variable. This one is represents the actual low-level declaration
12940 of the method, as opposed to the semantic level `IsStatic'.
12942 An anonymous method which is hosted into a static method might be
12943 actually an instance method. IsStatic would reflect the
12944 container, while MethodIsStatic represents the actual code
12947 * expression.cs (ParameterReference): Use the new MethodIsStatic
12948 instead of IsStatic.
12950 * anonymous.cs (AnonymousMethod.Compatible): Pass the
12951 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
12952 set on the current EmitContext.
12954 * expression.cs (Cast): Overload DoResolveLValue so we can pass
12955 resolve our casted expression as an LValue. This triggers the
12956 proper LValue processing that is later required by Assign.
12960 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
12962 2005-02-11 Marek Safar <marek.safar@seznam.cz>
12964 C# 2.0 Fixed buffer implementation
12966 * anonymous.cs: Update after RegisterHelperClass renaming.
12968 * attribute.cs (AttributeTester.fixed_buffer_cache):
12969 Cache of external fixed buffers.
12970 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
12971 implementation if field is fixed buffer else null.
12974 (TypeContainer.AddField): Accept FieldMember instead of Field.
12975 (FieldBase.IsFieldClsCompliant): Extracted code from
12976 VerifyClsCompliance descendant customization.
12977 (FixedField): New class handles fixed buffer fields.
12978 (FixedFieldExternal): Keeps information about imported fixed
12980 (IFixedField): Make access to internal or external fixed buffer
12983 * cs-parser.jay: Add fixed buffer parsing.
12985 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
12988 * expression.cs (Indirection): Extended implementation to accept
12989 fixed buffer field.
12990 (PointerArithmetic.Emit): Get element from fixed buffer as well.
12991 (ElementAccess.MakePointerAccess): Get type as parameter.
12992 (DoResolve): Add fixed buffer field expression conversion.
12993 (DoResolveLValue): Ditto.
12994 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
12995 (ArrayPtr): Derives from FixedBufferPtr.
12996 (ArrayPtr.Emit): Add extra emit for array elements.
12998 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
13000 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
13001 for compiler generated types.
13002 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
13004 * statement.cs (Fixed): Refactored to be easier add fixed buffer
13005 and consume less memory.
13006 (Fixed.Resolve): Add fixed buffer case.
13008 * typemanager.cs (compiler_generated_attr_ctor,
13009 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
13010 (HasElementType): Add our own implementation to work on every
13013 2005-02-11 Miguel de Icaza <miguel@novell.com>
13015 * anonymous.cs (CaptureContext): Track whether `this' has been
13018 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
13019 only captured `this' if it was implicitly done (instance
13020 methods/variables were used).
13022 * codegen.cs (EmitContext.CaptureThis): New method to flag that
13023 `this' must be captured.
13025 2005-01-30 Miguel de Icaza <miguel@novell.com>
13027 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
13028 is null it means that there has been no need to capture anything,
13029 so we just create a sibling.
13031 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
13033 Just a partial fix. The other half is fairly elusive.
13035 2005-02-10 Raja R Harinath <rharinath@novell.com>
13037 Fix #52586, cs0121-4.cs.
13038 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
13039 and return a hashtable.
13040 (MemberCache.ClearDeclaredOnly): New.
13041 (MemberCache.MemberCache): Update to change. Make a deep copy of
13042 the method_hash of a base type too.
13043 (MemberCache.AddMethods): Adapt to having a deep copy of the base
13044 type methods. Overwrite entries with the same MethodHandle so
13045 that the ReflectedType is correct. The process leaves in base
13046 virtual functions and their overrides as distinct entries.
13047 (CacheEntry): Now a class instead of a struct. It shouldn't alter
13048 matters since it was boxed in a ArrayList before.
13049 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
13051 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
13052 case of a virtual function and its override (choose the overload
13054 (Invocation.OverloadResolve): Avoid 'override' members during
13055 'applicable_type' calculation.
13057 2005-02-09 Raja R Harinath <rharinath@novell.com>
13059 Combine two near-redundant caches.
13060 * typemanager.cs (method_params): Rename from method_internal_params.
13061 (TypeManager.GetParameterData): New. Replace
13062 Invocation.GetParameterData.
13063 (TypeManager.LookupParametersByBuilder): Remove.
13064 * expression.cs (Invocation.method_parameter_cache): Remove.
13065 (Invocation.GetParameterData): Remove.
13067 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
13070 2005-02-08 Raja R Harinath <rharinath@novell.com>
13073 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
13074 TypeManager.multicast_delegate_type is null, resolve it by looking
13075 up "System.MulticastDelegate".
13076 * rootcontext.cs (RootContext.ResolveCore): Simplify.
13078 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
13079 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
13080 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
13083 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
13084 (LabeledStatement.AddReference): New. Set 'referenced'.
13085 (Goto.Resolve): Use it.
13087 2005-02-05 John Luke <john.luke@gmail.com>
13089 * driver.cs: remove duplicate -doc line in Usage ()
13091 2005-02-04 Raja R Harinath <rharinath@novell.com>
13093 * location.cs (Location.AddFile): Fix CS2002 error report.
13095 2005-02-02 Martin Baulig <martin@ximian.com>
13097 * delegate.cs (Delegate.DefineType): Report an internal error if
13098 TypeManager.multicast_delegate_type is null. See bug #72015 for
13101 2005-02-02 Raja R Harinath <rharinath@novell.com>
13103 Fix a crasher in a variant of #31984.
13104 * const.cs (Constant.CheckBase): New override that defers the
13105 new-or-override check in case the base type hasn't been populated
13107 (Constant.Define): Ensure the new-or-override check is performed.
13109 2005-02-01 Duncan Mak <duncan@ximian.com>
13111 * const.cs (LookupConstantValue): Check that `ce' is not null
13112 before calling GetValue ().
13114 2005-02-01 Raja R Harinath <rharinath@novell.com>
13116 Fix test-334.cs (#69519).
13117 * cs-parser.jay (using_alias_directive): Pass in an expression to
13118 NamespaceEntry.UsingAlias.
13119 (using_namespace_directive): Pass in an expression to
13120 NamespaceEntry.Using.
13121 (namespace_name): Don't flatten to a string.
13122 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
13123 (NamespaceEntry.AliasEntry.Resolve): Lookup using
13125 (NamespaceEntry.UsingEntry): Likewise.
13126 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
13128 (NamespaceEntry.LookupForUsing): Remove.
13129 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
13131 (NamespaceEntry.Lookup): Remove support for dotted names.
13133 2005-02-01 Raja R Harinath <rharinath@novell.com>
13135 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
13137 (NamespaceEntry.ImplicitParent): Compute on demand.
13138 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
13139 parallels the current.
13140 (NamespaceEntry.LookupForUsing): Use it.
13141 (NamespaceEntry.Lookup): If the current namespace-entry is
13142 implicit, don't search aliases and using tables.
13144 2005-02-01 Raja R Harinath <rharinath@novell.com>
13147 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
13149 (TypeContainer.BaseCache): Compute on demand.
13150 (TypeContainer.FindMembers): Define constants and types if they're
13151 not already created.
13152 (FieldMember.Define): Move resetting of ec.InUnsafe before error
13154 * const.cs (Constant.Define): Make idempotent.
13156 2005-01-29 Miguel de Icaza <miguel@novell.com>
13158 * pending.cs: Produce better code (no nops produced by using Ldarg
13161 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
13162 i - 1' it should be arg + 1.
13166 2005-01-28 Raja R Harinath <rharinath@novell.com>
13168 * attribute.cs (Attribute.CheckAttributeType): Make private
13170 (Attribute.ResolveType): Make virtual.
13171 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
13172 handling of RootContext.Tree.Types.
13174 2005-01-27 Raja R Harinath <rharinath@novell.com>
13176 Update attribute-handling to use the SimpleName/MemberAccess
13178 * cs-parser.jay (attribute): Pass in an expression to the
13179 constructors of Attribute and GlobalAttribute.
13180 * attribute.cs (Attribute): Take an expression for the name.
13181 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
13182 passed in attribute name expression.
13183 (Attribute.CheckAttributeType): Use it.
13184 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
13185 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
13186 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
13187 argument to prevent error messages if the lookup fails.
13189 2005-01-27 Marek Safar <marek.safar@seznam.cz>
13191 * expression.cs (Indirection): Implemented IVariable interface
13192 to support indirection in AddressOf operator.
13193 (PointerArithmetic.Emit): Add optimalization for case where
13194 result can be precomputed.
13196 2005-01-26 Martin Baulig <martin@ximian.com>
13198 * class.cs (TypeContainer.AttributeTargets): Return the correct
13199 AttributeTargets depending on our `Kind' instead of throwing an
13200 exception; fixes #71632.
13202 2005-01-26 Marek Safar <marek.safar@seznam.cz>
13205 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
13208 2005-01-25 Raja R Harinath <rharinath@novell.com>
13211 * expression.cs (MemberAccess.DoResolve): Don't complain with
13212 cs0572 when the LHS of a member access has identical name and type
13215 2005-01-25 Marek Safar <marek.safar@seznam.cz>
13218 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
13220 Create custom PermissionSet only for PermissionSetAttribute.
13222 2005-01-24 Marek Safar <marek.safar@seznam.cz>
13225 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
13226 delegates in static class.
13228 2005-01-24 Martin Baulig <martin@ximian.com>
13230 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13231 merging an implicit block, just use its reachability.
13233 * statement.cs (Block.Resolve): Make the unreachable code check
13234 work wrt. implicit blocks; see test-337 from #63842.
13236 2005-01-21 Alp Toker <alp@atoker.com>
13238 * cs-parser.jay: destructor_declaration's container is PartialContainer
13239 not Class when partial types are used, so use Kind prop instead of
13242 2005-01-22 Miguel de Icaza <miguel@ximian.com>
13244 * cs-parser.jay: Improve error reporting when an interface
13245 declares new types.
13247 2005-01-20 Dick Porter <dick@ximian.com>
13249 * support.cs: SeekableStreamReader fix from Sandor Dobos
13250 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
13251 chars are read. Fixes bug 70369.
13253 2005-01-20 Raja R Harinath <rharinath@novell.com>
13255 * cs-parser.jay (catch_clause): Simplify current_block handling
13258 2005-01-17 Miguel de Icaza <miguel@ximian.com>
13260 * convert.cs (ImplicitStandardConversionExists): Synchronize the
13261 code with ImplicitStandardConversion to handle the implicit
13262 conversion of method groups into valid delegate invocations.
13264 The problem is that in parameter handling we were using this code
13265 path. Fixes bug #64698
13267 2005-01-19 Raja R Harinath <rharinath@novell.com>
13269 * cs-parser.jay: Fix several infelicities.
13270 - Avoid assigning to the parser value stack. Code like
13271 '$3 = null' is unclean. Synthesize a value for the code block
13273 - Avoid using oob_stack for storing location information. Use ...
13274 (_mark_): ... this. New (empty) rule. Saves the current location
13276 (foreach_statement): Avoid using oob_stack for current_block
13277 handling. Use technique used in for_statement and
13278 using_statement. Synthesize a value for the code block to store
13279 additional intermediate information.
13281 2005-01-13 Miguel de Icaza <miguel@ximian.com>
13283 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
13284 of a different type is only allowed to private fields of a
13285 containing type, not on fields of a base class.
13287 See test-174.cs and error cs0122-9.cs
13289 2005-01-13 Raja R Harinath <rharinath@novell.com>
13291 Fix test-335.cs (bug #58126).
13292 * cs-parser.jay (argument): Split out non-expression parts of the
13293 rule into 'non_simple_argument'.
13294 (invocation_expression): Support parenthesized invocations with
13295 multiple arguments, and with single non-simple arguments.
13297 2005-01-13 Raja R Harinath <rharinath@novell.com>
13299 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
13302 2005-01-12 Raja R Harinath <rharinath@novell.com>
13304 Fix cs0038-1.cs, cs1640-6.cs.
13305 * ecore.cs (Expression.Resolve): Remove special-case for
13306 SimpleName in error-handling.
13307 (Expression.almostMatchedMembers): Relax access permission to
13309 (Expression.MemberLookupFailed): Handle duplicates in
13310 almostMatchedMembers list.
13311 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
13312 * expression.cs (New.DoResolve): Report CS1540 for more cases.
13313 * typemanager.cs (GetFullNameSignature): Use the MethodBase
13314 overload if the passed in MemberInfo is a MethodBase.
13316 2005-01-12 Marek Safar <marek.safar@seznam.cz>
13319 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
13320 for non-CAS & merge permission sets properly.
13322 2005-01-11 Raja R Harinath <rharinath@novell.com>
13324 Improve standard-compliance of simple name and member access
13325 resolution. Fixes bugs #52697, #57200, #67520, #69519.
13326 * ecore.cs (FullNamedExpression): New abstract base class
13327 for Namespaces and TypeExpressions.
13328 (ResolveFlags.SimpleName): Remove.
13329 (SimpleName): Remove support for dotted names.
13330 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
13331 DeclSpace.FindType and DeclSpace.LookupType.
13332 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
13333 (Expression.ExprClassName): Make member function.
13334 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
13335 a namespace. Remove creation of dotted "SimpleName"s.
13336 (MemberAccess.DoResolve): Likewise.
13337 * decl.cs (DeclSpace.Cache): Make private.
13338 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
13339 (DeclSpace.FindType): Update.
13340 (DeclSpace.LookupType): Move here from RootContext. Return a
13341 FullNamedExpression.
13342 * namespace.cs (Namespace): Derive from FullNamedExpression
13343 so that it can be part of expression resolution.
13344 (Namespace.Lookup): Return an FullNamedExpression.
13345 (NamespaceEntry.LookupAlias): Lookup aliases only in current
13347 * rootcontext.cs (NamespaceLookup): Remove.
13348 (LookupType): Move to DeclSpace.
13349 * attribute.cs (CheckAttributeType): Update.
13350 * doc.cs (FindDocumentedType): Remove allowAlias argument.
13351 (FindDocumentedTypeNonArray): Likewise.
13353 2005-01-11 Raja R Harinath <rharinath@novell.com>
13355 Fix cs0509.cs, cs1632.cs.
13356 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
13357 is the same as IsInterface.
13358 (TypeContainer.GetClassBases): Likewise.
13359 * statement.cs (LabeledStatement.ig): New field.
13360 (LabeledStatement.LabelTarget): Save ILGenerator which created the
13362 (LabeledStatement.DoEmit): Check that the label was created with
13363 the same ILGenerator.
13365 2005-01-10 Marek Safar <marek.safar@seznam.cz>
13368 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
13369 accessors to its properties.
13371 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
13372 from accessors to property.
13374 2005-01-10 Marek Safar <marek.safar@seznam.cz>
13377 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
13378 only for overrides.
13380 2005-01-08 Miguel de Icaza <miguel@ximian.com>
13382 * attribute.cs: Check for null and empty strings.
13384 I have lost another battle to Paolo.
13386 2005-01-07 Marek Safar <marek.safar@seznam.cz>
13389 * class.cs (PropertyMethod): Set Parent field in ctors.
13390 (SetMethod.InternalParameters): Add unsafe switch hack.
13391 Override MarkForDuplicationCheck where it is appropriate.
13393 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
13394 It says whether container allows members with the same name.
13395 Base default is no.
13396 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
13397 Removed is_method parameter.
13399 2005-01-06 Duncan Mak <duncan@ximian.com>
13401 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
13402 because the previous change led to incorrect reporting of CS1032
13403 ("Cannot define/undefine preprocessor symbols after first token in
13404 file"). Instead of using `tokens_seen' as the only flag that
13405 triggers CS1040, introduce `comments_seen'. This new flag is used
13406 to signify having seen comments on the current line, so it is
13407 unset after a newline.
13409 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
13411 * doc.cs : When searching for a type, find nested type too.
13412 This fixes bug #71040.
13414 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
13417 - Warn missing member comment on those classes which also does not
13418 have doc comments. Fixed bug #71041.
13419 - Don't warn missing doc comment on default constructor.
13422 2005-01-06 Duncan Mak <duncan@ximian.com>
13424 * cs-tokenizer.cs (xtoken): After handling traditional C-style
13425 comments, set `tokens_seen' to true. This allows us to detect
13426 misplaced preprocessor directives (i.e. not at the beginning of
13427 the a line, nor after whitespaces). In that case, report error
13428 CS1040. This fixes bug #56460.
13430 * cs-parser.jay (interface_member_declaration): Add checks for
13431 IsExplicitImpl, and report CS0541 error if an interface member is
13432 defined as an explicit interface declaration.
13434 2005-01-06 Marek Safar <marek.safar@seznam.cz>
13437 * class.cs (PropertyMethod): Set Parent field in ctors.
13438 (SetMethod.InternalParameters): Add unsafe switch hack.
13440 * decl.cs (MemberCore.Parent): Cannot be readonly.
13442 2005-01-06 Raja R Harinath <rharinath@novell.com>
13444 * decl.cs (DeclSpace.ResolveType): Remove.
13445 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
13446 Merge in code from ...
13447 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
13448 * class.cs, enum.cs: Update to changes.
13450 2005-01-06 Miguel de Icaza <miguel@ximian.com>
13452 * anonymous.cs: Ensure that we init the scope of our parent if it
13453 has not been initialized yet.
13455 2004-12-30 Duncan Mak <duncan@ximian.com>
13457 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
13458 if field.FieldBuilder is null. Fixes #70758.
13460 * convert.cs: Fixed some typos and updated some of the comments.
13461 (ImplicitStandardConversionExists):
13462 (TryImplicitIntConversion): If `target_type' is an interface and
13463 the type of `ic' implements this interface, return true or a new
13464 BoxedCast instead of null. This fixes #70468.
13466 2004-12-29 Duncan Mak <duncan@ximian.com>
13468 * expression.cs (Argument.Emit): Check that Expr is
13469 IMemoryLocation before casting to it, and report CS1510 otherwise.
13473 2004-12-21 Ben Maurer <bmaurer@ximian.com>
13475 * statement.cs (Block.ThisVariable): remove the recursion here, to
13476 make the --profile more sane.
13478 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
13480 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
13481 assembly, by JB Evain.
13483 2004-12-17 Raja R Harinath <rharinath@novell.com>
13485 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
13486 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
13487 "parent" refers to enclosing type/class. "base" refers to superclass.
13489 2004-12-17 Raja R Harinath <rharinath@novell.com>
13491 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13492 Ensure that we only have GlobalAttributes.
13493 * attribute.cs (Attribute.Emit): Make non-virtual.
13494 (GlobalAttribute.Emit): Remove.
13495 (Attribute.Resolve): Make virtual.
13496 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
13497 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
13498 the argument. Don't create one.
13499 (Attribute.GetObsoleteAttribute): Likewise.
13500 (Attribute.GetClsCompliantAttributeValue): Likewise.
13501 * class.cs, decl.cs: Update to changes.
13503 2004-12-17 Marek Safar <marek.safar@seznam.cz>
13505 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
13507 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
13509 * statement.cs (Foreach.Resolve): Add error 186 report.
13511 2004-12-16 Marek Safar <marek.safar@seznam.cz>
13513 * expression.cs (Conditional.DoResolve): Add warning 429.
13515 * statement.cs (If.Resolve): Add warning 665.
13517 2004-12-16 Raja R Harinath <rharinath@novell.com>
13519 New invariant: RootContext.Tree.Types.NamespaceEntry == null
13520 except when in the parser, and in GlobalAttribute.
13521 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
13522 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
13523 RootContext.Tree.Types.NamespaceEntry once work is done.
13524 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
13525 and resets RootContext.Tree.Types.NamespaceEntry.
13527 2004-12-15 Marek Safar <marek.safar@seznam.cz>
13529 * cs-parser.jay: Don't create a block for every variable.
13531 2004-12-14 Miguel de Icaza <miguel@ximian.com>
13533 * location.cs: Provide extra information.
13535 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
13536 variables from the captured environment, it is the ldarg_0.
13538 2004-12-14 Marek Safar <marek.safar@seznam.cz>
13540 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
13543 * class.cs: Changed warning level for 169 to avoid developer
13544 displeasure from warning flooding. It will be changed back when they
13545 fix most of current BCL warnings.
13547 * RootContext.cs: Pushed default WarningLevel to 3.
13549 * statement.cs: Removed unused variable.
13551 2004-12-14 Marek Safar <marek.safar@seznam.cz>
13553 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
13554 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
13555 Add error 502 report.
13556 (StaticClass.DefineType): Add error 441 report.
13557 (Class.AllowedModifiersProp): New virtual property as temporary
13558 extension to AllowedModifiers.
13559 (Class.DefineType): Add error 418 report. Moved ModFlags check here
13560 to share implementation with StaticClass and don't call virtual
13563 * driver.cs (MainDriver): Add error 1558 test.
13565 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
13566 report. Moved error 36 test here.
13568 * statement.cs (Throw.Resolve): Add error 724 report.
13570 * typemanager.cs: Add out_attribute_type core type.
13572 2004-12-13 Marek Safar <marek.safar@seznam.cz>
13574 * class.cs (TypeContainer.VerifyClsCompliance): Add error
13576 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
13578 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
13581 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
13583 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
13584 Add error 3023 report.
13585 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
13587 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
13590 2004-12-12 John Luke <john.luke@gmail.com>
13592 * driver.cs (AddArgs): take -- into account when
13593 adding arguments, fixes bug 65710
13595 2004-12-12 Martin Baulig <martin@ximian.com>
13597 * expression.cs (Unary.TryReduceNegative): Added support for
13598 SByteConstant and ByteConstant.
13599 (Unary.Reduce): Check error values from TryReduceNegative().
13601 2004-12-10 Marek Safar <marek.safar@seznam.cz>
13603 * attributes.cs (Attribute.Resolve): Avoid multiple error report
13604 and report exception as error 182.
13606 2004-12-10 Raja R Harinath <rharinath@novell.com>
13608 * driver.cs (Main): Fix message when there are warnings.
13610 2004-12-09 Miguel de Icaza <miguel@ximian.com>
13612 * delegate.cs: Fixed my fix from yesterday, sorry about that.
13614 2004-12-09 Marek Safar <marek.safar@seznam.cz>
13616 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
13617 Reduced number of warnings.
13619 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
13621 2004-12-08 Miguel de Icaza <miguel@ximian.com>
13623 * driver.cs: Removed message.
13625 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
13627 2004-12-08 <vargaz@freemail.hu>
13629 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
13631 2004-12-08 Martin Baulig <martin@ximian.com>
13633 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
13634 instead of a CS3002 for properties and indexer.
13636 2004-12-08 Martin Baulig <martin@ximian.com>
13638 * decl.cs (MemberName.ToString): Make this work again.
13640 2004-12-08 Marek Safar <marek.safar@seznam.cz>
13642 * attribute.cs (Resolve): Add error 591 detection.
13644 * class.cs (FieldMember.Define): Add error 1547 detection.
13645 (Indexer.Define): Add error 620 detection.
13646 (Operator.Define): Add error 590 detection.
13648 * ecore.cs: Missing argument for error 79.
13650 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
13653 2004-12-07 Marek Safar <marek.safar@seznam.cz>
13656 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
13659 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
13661 * cs-parser.jay : handle doc comments on implicit/explicit operators.
13662 Some operator comments were suppressed.
13663 * doc.cs : Implicit/explicit operator name in doc comments are like
13664 "op_Explicit(type)~returnType", so added suffix handling.
13666 2004-12-07 Martin Baulig <martin@ximian.com>
13669 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
13670 (MemberCore.GetClsCompliantAttributeValue): Likewise.
13671 (DeclSpace.ec): New protected field; store the EmitContext here.
13672 (DeclSpace.EmitContext): New public property; moved here from
13674 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
13677 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
13678 (Enum.Emit): Don't create a new EmitContext.
13680 * delegate.cs (Delegate.DefineType): Always create the
13683 * iterators.cs (Iterators.DefineIterator): Create a new
13684 EmitContext and store it in `ec'.
13686 2004-08-24 Martin Baulig <martin@ximian.com>
13689 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
13690 this for accessibility checks.
13691 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
13692 IsNestedFamilyAccessible.
13693 (TypeManager.IsSubclassOf): New method, do what the name actually
13696 2004-12-06 Raja R Harinath <rharinath@novell.com>
13698 Fix crash on cs0657-17.cs.
13699 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13700 Use RootContext.Tree.Types, not 'new RootTypes ()'.
13701 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
13702 the case where the NamespaceEntry gets overwritten.
13704 2004-12-06 Marek Safar <marek.safar@seznam.cz>
13706 Fixed #69195, #56821
13707 * ecore.cs (ResolveBoolean): Tiny refactoring.
13709 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
13710 of right expression resolving when left is false constant and
13711 operator is LogicalAnd OR true constant and operator is LogicalOr.
13713 * statement.cs (ResolveUnreachable): Always reports warning.
13715 2004-12-05 Miguel de Icaza <miguel@ximian.com>
13717 * class.cs: Distinguish between 1721 and 1722 (just a little help
13718 for the programmer).
13720 2004-12-03 Miguel de Icaza <miguel@ximian.com>
13722 * delegate.cs: Only allow this on new versions of the language.
13724 2004-12-02 Duncan Mak <duncan@ximian.com>
13726 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
13728 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
13729 here as a static method. Take an additional bool out parameter
13730 `must_do_cs1540_check' for signaling to InstanceResolve.
13731 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
13732 member field from PropertyExpr class and made it an argument of
13733 the method instead.
13734 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
13735 check for MarshalByRefObject, and report CS0122 instead of CS1540.
13736 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
13737 and `remove_accessor' as well as InstanceResolve: report CS0122
13742 2004-12-03 Raja R Harinath <rharinath@novell.com>
13744 Fix test-327.cs, test-328.cs, and put in early infrastructure
13745 for eventually fixing #52697.
13746 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
13747 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
13748 from other methods.
13749 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
13750 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
13751 (VerifyUsing, error246): Update.
13752 * rootcontext.cs (RootContext.NamespaceLookup): Just use
13753 'NamespaceEntry.LookupNamespaceOrType'.
13755 2004-12-03 Martin Baulig <martin@ximian.com>
13757 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13758 method as our child, call AnonymousMethod.Compatible() on it.
13760 2004-12-03 Raja R Harinath <rharinath@novell.com>
13762 Disable XML documentation support in 'basic' profile.
13763 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
13764 Redirect XmlElement to System.Object.
13765 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
13766 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
13767 * mcs.exe.sources: Add doc-bootstrap.cs.
13768 * doc-bootstrap.cs: New file. Contains empty stub implementation
13771 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
13773 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
13774 comments are allowed.
13776 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
13778 * delegate.cs: Add checks for subtypes in paramaters and return values
13779 in VerifyMethod () to add support for Covariance/Contravariance
13782 2004-12-02 Miguel de Icaza <miguel@ximian.com>
13784 * report.cs: Remove extra closing parenthesis.
13786 * convert.cs (Error_CannotImplicitConversion): If the name of the
13787 types are the same, provide some extra information.
13789 * class.cs (FieldBase): Use an unused bit field from the field to
13790 encode the `has_offset' property from the FieldMember. This saves
13791 a couple of Ks on bootstrap compilation.
13793 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13794 method as our child, return the AnonymousMethod resolved
13797 * expression.cs (New.DoResolve): Allow return values from
13798 NewDelegate to also include AnonymousMethods.
13802 2004-12-02 Marek Safar <marek.safar@seznam.cz>
13805 * attribute.cs (Resolve): Improved implementation of params
13806 attribute arguments.
13808 * support.cs (ParameterData): Add HasParams to be faster.
13810 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
13812 all things are for /doc support:
13814 * doc.cs: new file that supports XML documentation generation.
13815 * mcs.exe.sources: added doc.cs.
13817 Handle /doc command line option.
13818 Report error 2006 instead of 5 for missing file name for /doc.
13819 Generate XML documentation when required, after type resolution.
13821 Added support for picking up documentation (/// and /** ... */),
13822 including a new XmlCommentState enumeration.
13824 Added lines to fill Documentation element for field, constant,
13825 property, indexer, method, constructor, destructor, operator, event
13826 and class, struct, interface, delegate, enum.
13827 Added lines to warn incorrect comment.
13829 Added Documentation field (passed only when /doc was specified).
13831 Added DocComment, DocCommentHeader, GenerateDocComment() and
13832 OnGenerateDocComment() and some supporting private members for
13833 /doc feature to MemberCore.
13835 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
13837 Added overriden DocCommentHeader.
13839 Added overriden DocCommentHeader and GenerateDocComment().
13841 2004-12-01 Miguel de Icaza <miguel@ximian.com>
13843 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
13844 unwrapping the enumeration values, chain to
13845 DoConstantNumericPromotions again, so we can promote things to the
13846 fundamental types (takes care of enums that are bytes, sbytes).
13850 2004-12-01 Raja R Harinath <rharinath@novell.com>
13852 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
13853 Fix long-standing bug in type-lookup. Use FindType instead of
13854 LookupType when ec.ResolvingTypeTree.
13855 (Attribute.ResolveType, Attribute.Resolve)
13856 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
13858 (Attributes.Search): Remove internal version. Update.
13859 (Attributes.SearchMulti): Update.
13860 (Attributes.GetClsCompliantAttribute): Remove.
13861 (Attributes.GetIndexerNameAttribute): Remove.
13862 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
13863 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
13864 * class.cs (Indexer.Define): Likewise.
13866 2004-12-01 Marek Safar <marek.safar@seznam.cz>
13869 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
13870 MarshallByReference members access.
13872 * expression.cs: Use CheckMarshallByRefAccess;
13873 Better error CS0197 message.
13875 * report.cs: Print whole related error message.
13877 2004-11-30 Raja R Harinath <rharinath@novell.com>
13879 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
13880 the current directory to help debugging.
13882 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13884 * class (GetClassBases): Better error 60 report.
13885 (EventProperty): Disabled warning 67 detection.
13887 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13890 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
13892 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
13895 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13898 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
13900 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
13902 2004-11-26 Miguel de Icaza <miguel@ximian.com>
13904 * attribute.cs (Attribute.Resolve): Refine error reporting and
13905 report a cs0117 if the identifier does not exist, to distinguish
13906 from 0617 which is a miss-use of the actual identifier.
13908 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
13909 between cs0070 and cs0079.
13911 * class.cs (MemberBase.DoDefine): When reporting a wrong
13912 accessibility level, we use MethodCore to compare instead of
13913 Method (this was a regression in some refactoring effort).
13915 So now we correctly report cs0056 again.
13917 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
13918 testing the target_type (which was known to be object_type) and
13919 not the source type (which is anonymous_method).
13921 Fixed reporting of error cs1660.
13923 * expression.cs (UserCast.Source): Expose the underlying cast.
13925 * statement.cs (Switch.SwitchGoverningType): Sort the list of
13926 allowed types to find a match to int32 first (most common).
13928 In addition, it ignores any ImplicitUserConversions that did an
13929 internal implicit conversion (as the switch statement allows only
13930 one integral conversion to exist).
13932 * class.cs (PartialContainer.Create): rename `name' to
13933 `member_name' for clarity. Then replace the string calls with a
13934 call to MemberName.GetPartialName, as now using
13935 MemberName.ToString is an error (this is due to the side effects
13936 it had, that were fixed in the past).
13938 This will restore the error reporting on a number of partial class
13939 errors that were missusing this (and getting an exception as a
13940 results, which is now just a plain textual warning, because
13941 yyparse debug output would crash otherwise).
13943 2004-11-26 Raja R Harinath <rharinath@novell.com>
13945 * Makefile (PROGRAM_INSTALL_DIR): Remove.
13947 2004-11-25 Ben Maurer <bmaurer@ximian.com>
13949 * rootcontext.cs (LookupType): Make sure to cache lookups that
13950 don't give us a negative result. This saves about 5% of corlib
13953 2004-11-25 Miguel de Icaza <miguel@ximian.com>
13955 * report.cs (AbstractMessage.Print): messages are sent to stderr
13957 * class.cs (TypeContainer.GetClassBases): It is an error to have a
13958 non-interface in the list of interfaces (at this point, either
13959 parent was properly set, or a base class is being listed in the
13960 interfaces section).
13962 This flags error 1722, and resolves the crash from bug 69259.
13964 2004-11-25 Ben Maurer <bmaurer@ximian.com>
13966 * statement.cs (Using.EmitExpressionFinally): make this work right
13967 for valuetypes. Fixes 69926.
13969 2004-11-25 Miguel de Icaza <miguel@ximian.com>
13971 * const.cs (Const.ChangeType): Cope with the "0 literal can be
13972 converted to an enum" here, before we try to change the underlying
13973 type. This code exists, but it is a different code path than the
13974 one used while encoding constants.
13976 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
13977 old bug: when converting from the null literal to a pointer,
13978 return an EmptyCast, not the NullLiteral.
13980 This fixes #69921, the recent null_type changes probably made this
13981 bug more prominent.
13983 (ImplicitReferenceConversionExists): In addition, resynchronized
13984 the code here, so it matches the same code in
13985 ImplicitReferenceConversionExists for the `from any class-type S
13986 to any interface-type T'.
13989 2004-11-25 Marek Safar <marek.safar@seznam.cz>
13991 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
13993 2004-11-24 Miguel de Icaza <miguel@ximian.com>
13995 * cs-parser.jay: Use verbosity accordingly.
13997 2004-11-24 Marek Safar <marek.safar@seznam.cz>
13999 * expression.cs (Unary.ResolveOperator): Do not report warning;
14000 AddressOf reads from variable.
14002 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
14004 2004-11-24 Marek Safar <marek.safar@seznam.cz>
14008 * attribute.cs (Attributable): Removed CheckTargets.
14009 (Attributes.Emit): Explicit attribute targets are tested here.
14011 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
14012 not enabled for interfaces.
14014 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
14015 (GetAssemblyName): Ouch next bug there.
14017 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
14019 * expression.cs: Error 275 added.
14021 2004-11-23 Marek Safar <marek.safar@seznam.cz>
14023 Fix bug #69177 (Implemented decimal constant support)
14025 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
14026 (BinaryFold): Add DecimalConstant.
14028 * const.cs (Define): Decimal constant
14030 (ChangeType): Add decimal type handling.
14031 (LookupConstantValue): Don't set value for decimal type but
14032 emit DecimalConstantAttribute. Needed for constant optimization.
14034 * constant.cs (ToDecimal): New method.
14035 (ConvertToDecimal): New method.
14036 (IntConstant): Implemented ConvertToDecimal.
14037 (DecimalConstant.Emit): Emit optimized version for decimals in
14040 * expression.cs (ResolveOperator): Changed order of constant
14041 reduction to work correctly with native types which have
14042 overloaded operators.
14043 (ResolveMemberAccess): Extract constant value from attribute
14046 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
14048 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
14049 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
14050 (ChangeType): Decimal is special.
14051 (TypeToCoreType): Add decimal type.
14053 2004-11-22 Marek Safar <marek.safar@seznam.cz>
14055 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
14058 2004-11-22 Marek Safar <marek.safar@seznam.cz>
14060 * class.cs (EventField.ApplyAttributeBuilder): Fix error
14063 2004-11-19 Marek Safar <marek.safar@seznam.cz>
14065 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
14067 * pending.cs (PendingImplementation): Grab only interfaces.
14069 2004-11-19 Marek Safar <marek.safar@seznam.cz>
14071 * statement.cs (ForeachHelperMethods): Add location member and
14072 error 202 detection.
14074 2004-11-19 Raja R Harinath <rharinath@novell.com>
14076 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
14077 automatically handled by executable.make.
14078 (PROGRAM): Make profile-specific.
14080 2004-11-18 Marek Safar <marek.safar@seznam.cz>
14082 * expression.cs (DoResolveBase): Fixed wrong warning for out
14085 2004-11-18 Martin Baulig <martin@ximian.com>
14087 Merged latest changes into gmcs. Please keep this comment in
14088 here, it makes it easier for me to see what changed in MCS since
14089 the last time I merged.
14091 2004-11-17 Raja R Harinath <rharinath@novell.com>
14093 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
14094 (TypeHandle.GetMemberCache): New.
14095 (TypeHandle.TypeHandle): Update.
14096 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
14097 (TypeManager.LookupParentInterfacesCache):
14098 Rename from LookupInterfaceCache. Optimize slightly.
14099 (TypeManager.MemberLookup_FindMembers): Update.
14100 * decl.cs (MemberCache.MemberCache): Set Container to null in the
14101 multi-type variant.
14102 (AddCacheContents): Rename from AddHashtable.
14103 * class.cs (TypeContainer.parent_container): Remove.
14104 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
14105 (TypeContainer.DoDefineMembers): Don't initialize it.
14106 Update to name changes.
14108 2004-11-17 Miguel de Icaza <miguel@ximian.com>
14110 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
14111 that factors the code to check access modifiers on override.
14113 (PropertyBase): Use the code here.
14115 Patch from Lluis S'anchez, fixes bug #69361.
14117 2004-11-15 Miguel de Icaza <miguel@ximian.com>
14119 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
14120 routine that is used to report the use of a captured variable
14121 whose address has been taken.
14123 There are two checks: one when variables are being captured and
14124 the other check is when the address of a variable is taken.
14126 (because an anonymous methods might be resolved before *or* after
14127 the address has been taken) and
14129 * expression.cs (Conditional.DoResolve): Remove the special
14130 casing that Martin added to trueExpr and falseExpr being both
14131 NullLiteral. We get the right behavior now just by introducing
14132 the null_type into the compiler.
14134 * convert.cs (ExplicitConversion): Change the code to use
14135 null_type instead of testing `expr is NullLiteral'.
14136 (ImplicitConversionStandard): use null_type too.
14137 (ImplicitReferenceConversionExists): use null_type too.
14138 (ImplicitReferenceConversion): use null_type too.
14140 * literal.cs: The type of `NullLiteral' is now null_type instead
14142 (Resolve): Set the type here.
14144 * typemanager.cs: Introduce null_type.
14146 2004-11-17 Martin Baulig <martin@ximian.com>
14148 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
14149 direction, like FindMembers() does. Fixes #69546, testcase is in
14152 2004-11-16 Martin Baulig <martin@ximian.com>
14154 This is based on a patch from Marek Safar, see bug #69082.
14155 Fixes bugs #63705 and #67130.
14157 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
14158 method; create a MemberCache for an interface type and cache the
14161 * decl.cs (IMemberContainer.ParentContainer): Removed.
14162 (IMemberContainer.ParentCache): New property.
14163 (MemberCache.SetupCacheForInterface): Removed.
14164 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
14165 to create a cache for an interface's "parent".
14167 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
14170 2004-11-16 Martin Baulig <martin@ximian.com>
14172 Merged back from gmcs; these changes already went into gmcs a
14173 couple of weeks ago.
14176 (TypeManager.AddUserType): Removed the `ifaces' argument.
14177 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
14179 (TypeManager.AddUserInterface): Removed.
14180 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
14182 (TypeManager.GetInterfaces): Likewise.
14183 (TypeManager.GetExplicitInterfaces): Likewise.
14185 * ecore.cs (TypeExpr.GetInterfaces): Removed.
14187 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
14188 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
14190 2004-11-14 Ben Maurer <bmaurer@ximian.com>
14192 * statement.cs: Avoid adding bools to a hashtable.
14194 2004-11-07 Miguel de Icaza <miguel@ximian.com>
14196 * expression.cs (Invocation.OverloadResolve): Flag error if we are
14197 calling an unsafe method from a safe location.
14199 2004-11-06 Marek Safar <marek.safar@seznam.cz>
14202 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
14204 2004-11-06 Miguel de Icaza <miguel@ximian.com>
14206 * namespace.cs (VerifyUsing): use GetPartialName instead of
14209 2004-11-05 Miguel de Icaza <miguel@ximian.com>
14211 * statement.cs (Return.Resolve): Fix regression in typo: if
14212 `in_exc', we have to request a NeedReturnLabel, this was a typo
14213 introduced in the anonymous method check-in. Fixes #69131.
14215 * Indexers were using the ShortName when defining themselves,
14216 causing a regression in the compiler bootstrap when applying the
14217 patch from 2004-11-02 (first part), now they use their full name
14218 and the bug is gone.
14220 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
14222 * driver.cs: Strip the path from the names of embedded resources. Fixes
14225 2004-11-04 Raja R Harinath <rharinath@novell.com>
14227 Fix error message regression: cs0104-2.cs.
14228 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
14229 (AliasEntry.Resolve): Update.
14230 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
14232 (RootContext.LookupType): Update.
14234 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
14236 * cs-parser.jay: Add support for handling accessor modifiers
14237 * class: Add support port accessor modifiers and error checking,
14238 define PropertyMethod.Define as virtual (not abstract anymore)
14239 * ecore.cs: Add checking for proeprties access with access modifiers
14240 * iterators.cs: Modify Accessor constructor call based in the modified
14242 2004-11-02 Ben Maurer <bmaurer@ximian.com>
14244 * expression.cs (StringConcat): Handle being called twice,
14245 as when we have a concat in a field init with more than two
14248 2004-11-02 Miguel de Icaza <miguel@ximian.com>
14250 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
14251 special case explicit implementations, we should always produce
14252 the .property or .event declaration.
14254 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
14255 since it will not return correct data if people use this
14256 unresolved in the presence of using statements (see test-313).
14258 * class.cs (MethodData.Define): If we are an explicit interface
14259 implementation, set the method name to the full name of the
14260 interface plus the name of the method.
14262 Notice that using the method.MethodName.GetFullName() does not
14263 work, as it will only contain the name as declared on the source
14264 file (it can be a shorthand in the presence of using statements)
14265 and not the fully qualifed type name, for example:
14269 class D : ICloneable {
14270 object ICloneable.Clone () {
14274 Would produce a method called `ICloneable.Clone' instead of
14275 `System.ICloneable.Clone'.
14277 * namespace.cs (Alias.Resolve): Use GetPartialName.
14279 2004-11-01 Marek Safar <marek.safar@seznam.cz>
14281 * cs-parser.jay: Add error 1055 report.
14283 2004-11-01 Miguel de Icaza <miguel@ximian.com>
14285 * assign.cs (Assign.DoResolve): Only do the transform of
14286 assignment into a New if the types are compatible, if not, fall
14287 through and let the implicit code deal with the errors and with
14288 the necessary conversions.
14290 2004-11-01 Marek Safar <marek.safar@seznam.cz>
14292 * cs-parser.jay: Add error 1031 report.
14294 * cs-tokenizer.cs: Add location for error 1038.
14296 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14298 * cs-parser.jay: Add error 1016 report.
14300 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14302 * cs-parser.jay: Add errors 1575,1611 report.
14304 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14306 * cs-parser.jay: Add error 1001 report.
14308 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14311 * attribute.cs (GetMarshal): Add method argument for
14312 caller identification.
14314 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
14315 agument for GetMarshal and RuntimeMissingSupport.
14317 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14319 * attribute.cs (ExtractSecurityPermissionSet): Removed
14320 TypeManager.code_access_permission_type.
14322 * typemanager.cs: Removed TypeManager.code_access_permission_type.
14324 2004-10-27 Miguel de Icaza <miguel@ximian.com>
14326 * expression.cs (LocalVariableReference.DoResolveLValue): Check
14327 for obsolete use of a variable here. Fixes regression on errors
14328 cs0619-25 and cs0619-26.
14330 2004-10-27 Marek Safar <marek.safar@seznam.cz>
14332 Fix #62358, implemented security attribute encoding.
14334 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
14335 Tests permitted SecurityAction for assembly or other types.
14336 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
14337 data from SecurityPermissionAttribute to PermisionSet class.
14339 * class.cs (ApplyAttributeBuilder): Added special handling
14340 for System.Security.Permissions.SecurityAttribute based types.
14342 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
14343 special handling for System.Security.Permissions.SecurityAttribute
14346 * enum.cs (ApplyAttributeBuilder): Added special handling
14347 for System.Security.Permissions.SecurityAttribute based types.
14349 * parameter.cs (ApplyAttributeBuilder): Added special handling
14350 for System.Security.Permissions.SecurityAttribute based types.
14352 * rootcontext.cs: Next 2 core types.
14354 * typemanager.cs (TypeManager.security_permission_attr_type):
14355 Built in type for the SecurityPermission Attribute.
14356 (code_access_permission_type): Build in type.
14358 2004-10-17 Miguel de Icaza <miguel@ximian.com>
14360 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
14361 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
14362 all of this information into
14363 EmitContext.EmitCapturedVariableInstance.
14365 * codegen.cs (EmitCapturedVariableInstance): move here the
14366 funcionality of emitting an ldarg.0 in the presence of a
14367 remapping. This centralizes the instance emit code.
14369 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
14370 then emit a load of this: it means that we have reached the
14371 topmost ScopeInfo: the one that contains the pointer to the
14372 instance of the class hosting the anonymous method.
14374 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
14375 captures to the topmost CaptureContext.
14377 2004-10-12 Miguel de Icaza <miguel@ximian.com>
14379 * expression.cs (LocalVariableReference): Move the knowledge about
14380 the iterators into codegen's EmitCapturedVariableInstance.
14382 2004-10-11 Miguel de Icaza <miguel@ximian.com>
14384 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
14385 all code paths return a value from an anonymous method (it is the
14386 same as the 161 error, but for anonymous methods).
14388 2004-10-08 Miguel de Icaza <miguel@ximian.com>
14390 The introduction of anonymous methods in the compiler changed
14391 various ways of doing things in the compiler. The most
14392 significant one is the hard split between the resolution phase
14393 and the emission phases of the compiler.
14395 For instance, routines that referenced local variables no
14396 longer can safely create temporary variables during the
14397 resolution phase: they must do so from the emission phase,
14398 since the variable might have been "captured", hence access to
14399 it can not be done with the local-variable operations from the runtime.
14403 (Block.Flags): New flag `IsTopLevel' to indicate that this block
14404 is a toplevel block.
14406 (ToplevelBlock): A new kind of Block, these are the blocks that
14407 are created by the parser for all toplevel method bodies. These
14408 include methods, accessors and anonymous methods.
14410 These contain some extra information not found in regular blocks:
14411 A pointer to an optional CaptureContext (for tracking captured
14412 local variables and parameters). A pointer to the parent
14415 (Return.Resolve): Catch missmatches when returning a value from an
14416 anonymous method (error 1662).
14417 Invoke NeedReturnLabel from the Resolve phase instead of the emit
14420 (Break.Resolve): ditto.
14422 (SwitchLabel): instead of defining the labels during the
14423 resolution phase, we now turned the public ILLabel and ILLabelCode
14424 labels into methods called GetILLabelCode() and GetILLabel() that
14425 only define the label during the Emit phase.
14427 (GotoCase): Track the SwitchLabel instead of the computed label
14428 (its contained therein). Emit the code by using
14429 SwitchLabel.GetILLabelCode ().
14431 (LocalInfo.Flags.Captured): A new flag has been introduce to track
14432 whether the Local has been captured or not.
14434 (LocalInfo.IsCaptured): New property, used to tell whether the
14435 local has been captured.
14437 * anonymous.cs: Vastly updated to contain the anonymous method
14440 The main classes here are: CaptureContext which tracks any
14441 captured information for a toplevel block and ScopeInfo used to
14442 track the activation frames for various local variables.
14444 Each toplevel block has an optional capture context associated
14445 with it. When a method contains an anonymous method both the
14446 toplevel method and the anonymous method will create a capture
14447 context. When variables or parameters are captured, they are
14448 recorded on the CaptureContext that owns them, for example:
14452 MyDelegate d = delegate {
14457 Here `a' will be recorded as captured on the toplevel
14458 CapturedContext, the inner captured context will not have anything
14459 (it will only have data if local variables or parameters from it
14460 are captured in a nested anonymous method.
14462 The ScopeInfo is used to track the activation frames for local
14463 variables, for example:
14465 for (int i = 0; i < 10; i++)
14466 for (int j = 0; j < 10; j++){
14467 MyDelegate d = delegate {
14472 At runtime this captures a single captured variable `i', but it
14473 captures 10 different versions of the variable `j'. The variable
14474 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
14475 recorded on a child.
14477 The toplevel ScopeInfo will also track information like the `this'
14478 pointer if instance variables were referenced (this is necessary
14479 as the anonymous method lives inside a nested class in the host
14480 type of the method).
14482 (AnonymousMethod): Expanded to track the Toplevel, implement
14483 `AnonymousMethod.Compatible' to tell whether an anonymous method
14484 can be converted to a target delegate type.
14486 The routine now also produces the anonymous method content
14488 (AnonymousDelegate): A helper class that derives from
14489 DelegateCreation, this is used to generate the code necessary to
14490 produce the delegate for the anonymous method that was created.
14492 * assign.cs: API adjustments for new changes in
14493 Convert.ImplicitStandardConversionExists.
14495 * class.cs: Adjustments to cope with the fact that now toplevel
14496 blocks are of type `ToplevelBlock'.
14498 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
14499 insteda of standard blocks.
14501 Flag errors if params arguments are passed to anonymous methods.
14503 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
14504 `CurrentAnonymousMethod' which points to the current Anonymous
14505 Method. The variable points to the AnonymousMethod class that
14506 holds the code being compiled. It is set in the new EmitContext
14507 created for the anonymous method.
14509 (EmitContext.Phase): Introduce a variable and an enumeration to
14510 assist in enforcing some rules about when and where we are allowed
14511 to invoke certain methods (EmitContext.NeedsReturnLabel is the
14512 only one that enfonces this right now).
14514 (EmitContext.HaveCaptureInfo): new helper method that returns
14515 whether we have a CapturedContext initialized.
14517 (EmitContext.CaptureVariable): New method used to register that a
14518 LocalInfo must be flagged for capturing.
14520 (EmitContext.CapturedParameter): New method used to register that a
14521 parameters must be flagged for capturing.
14523 (EmitContext.CapturedField): New method used to register that a
14524 field must be flagged for capturing.
14526 (EmitContext.HaveCapturedVariables,
14527 EmitContext.HaveCapturedFields): Return whether there are captured
14528 variables or fields.
14530 (EmitContext.EmitMethodHostInstance): This is used to emit the
14531 instance for the anonymous method. The instance might be null
14532 (static methods), this (for anonymous methods that capture nothing
14533 and happen to live side-by-side with the current method body) or a
14534 more complicated expression if the method has a CaptureContext.
14536 (EmitContext.EmitTopBlock): Routine that drives the emission of
14537 code: it will first resolve the top block, then emit any metadata
14538 and then emit the code. The split is done so that we can extract
14539 any anonymous methods and flag any captured variables/parameters.
14541 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
14542 during this phase, the ILGenerator should not be used as labels
14543 and local variables declared here might not be accessible to any
14544 code that is part of an anonymous method.
14546 Exceptions to this include the temporary variables that are
14547 created by some statements internally for holding temporary
14550 (EmitContext.EmitMeta): New routine, in charge of emitting all the
14553 (EmitContext.TemporaryReturn): This method is typically called
14554 from the Emit phase, and its the only place where we allow the
14555 ReturnLabel to be defined other than the EmitMeta. The reason is
14556 that otherwise we would have to duplicate a lot of logic in the
14557 Resolve phases of various methods that today is on the Emit
14560 (EmitContext.NeedReturnLabel): This no longer creates the label,
14561 as the ILGenerator is not valid during the resolve phase.
14563 (EmitContext.EmitThis): Extended the knowledge in this class to
14564 work in anonymous methods in addition to iterators.
14566 (EmitContext.EmitCapturedVariableInstance): This emits whatever
14567 code is necessary on the stack to access the instance to a local
14568 variable (the variable will be accessed as a field).
14570 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
14571 EmitContext.EmitAddressOfParameter): Routines to support
14572 parameters (not completed at this point).
14574 Removals: Removed RemapLocal and RemapLocalLValue. We probably
14575 will also remove the parameters.
14577 * convert.cs (Convert): Define a `ConstantEC' which points to a
14578 null. This is just to prefity some code that uses
14579 ImplicitStandardConversion code and do not have an EmitContext
14582 The idea is to flag explicitly that at that point in time, it is
14583 known that the conversion will not trigger the delegate checking
14584 code in implicit conversions (which requires a valid
14587 Everywhere: pass new EmitContext parameter since
14588 ImplicitStandardConversionExists now requires it to check for
14589 anonymous method conversions.
14591 (Convert.ImplicitStandardConversionExists): If the type of an
14592 expression is the anonymous_method_type, and the type is a
14593 delegate, we invoke the AnonymousMethod.Compatible method to check
14594 whether an implicit conversion is possible.
14596 (Convert.ImplicitConversionStandard): Only do implicit method
14597 group conversions if the language level is not ISO_1.
14599 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
14600 MethodInfo for the Invoke method. used by Delegate and
14603 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
14604 method conversions if the target type is a delegate.
14606 Removed extra debugging nops.
14608 (LocalVariableReference): Turn the `local_info' into a public
14611 Add `prepared' field, the same hack used for FieldExprs to cope
14612 with composed assignments, as Local variables do not necessarily
14613 operate purely on the stack as they used to: they can be captured
14616 Add `temp' for a temporary result, like fields.
14618 Refactor DoResolve and DoResolveLValue into DoResolveBase.
14620 It now copes with Local variables that are captured and emits the
14621 proper instance variable to load it from a field in the captured
14624 (ParameterReference.DoResolveBase): During the resolve phase,
14625 capture parameters if we are in an anonymous method.
14627 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
14628 anonymous method, use the EmitContext helper routines to emit the
14629 parameter reference.
14631 * iterators.cs: Set RemapToProxy to true/false during the
14634 * parameters.cs (GetParameterByName): New helper method.
14636 * typemanager.cs (anonymous_method_type) a new type that
14637 represents an anonyous method. This is always an internal type,
14638 used as a fencepost to test against the anonymous-methodness of an
14641 2004-10-20 Marek Safar <marek.safar@seznam.cz>
14643 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
14645 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
14647 2004-10-18 Martin Baulig <martin@ximian.com>
14649 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
14650 `Type' directly, but call ResolveType() on it.
14651 (Catch.Resolve): Likewise.
14652 (Foreach.Resolve): Likewise.
14654 2004-10-18 Martin Baulig <martin@ximian.com>
14656 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
14657 `Type' directly, but call ResolveType() on it.
14658 (Probe.DoResolve): Likewise.
14659 (ArrayCreation.LookupType): Likewise.
14660 (TypeOf.DoResolve): Likewise.
14661 (SizeOf.DoResolve): Likewise.
14663 2004-10-18 Martin Baulig <martin@ximian.com>
14665 * expression.cs (Invocation.BetterFunction): Put back
14666 TypeManager.TypeToCoreType().
14668 2004-10-18 Raja R Harinath <rharinath@novell.com>
14670 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
14673 2004-10-18 Martin Baulig <martin@ximian.com>
14675 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
14676 `Type' directly, but call ResolveType() on it.
14678 2004-10-18 Martin Baulig <martin@ximian.com>
14680 * class.cs (FieldMember.Define): Don't access the TypeExpr's
14681 `Type' directly, but call ResolveType() on it.
14682 (MemberBase.DoDefine): Likewise.
14684 * expression.cs (New.DoResolve): Don't access the TypeExpr's
14685 `Type' directly, but call ResolveType() on it.
14686 (ComposedCast.DoResolveAsTypeStep): Likewise.
14688 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
14689 `Type' directly, but call ResolveType() on it.
14691 2004-10-17 John Luke <john.luke@gmail.com>
14693 * class.cs (Operator.GetSignatureForError): use CSharpName
14695 * parameter.cs (Parameter.GetSignatureForError): Returns
14696 correct name even if was not defined.
14698 2004-10-13 Raja R Harinath <rharinath@novell.com>
14701 * class.cs (TypeContainer.EmitContext): New property.
14702 (DefineNestedTypes): Create an emitcontext for each part.
14703 (MethodCore.DoDefineParameters): Use container's emitcontext.
14704 Pass type array to InternalParameters.
14705 (MemberBase.DoDefine): Use container's emitcontext.
14706 (FieldMember.Define): Likewise.
14707 (Event.Define): Likewise.
14708 (SetMethod.GetParameterInfo): Change argument to EmitContext.
14709 Pass type array to InternalParameters.
14710 (SetIndexerMethod.GetParameterInfo): Likewise.
14711 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
14712 * delegate.cs (Define): Pass emitcontext to
14713 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
14714 array to InternalParameters.
14715 * expression.cs (ParameterReference.DoResolveBase): Pass
14716 emitcontext to GetParameterInfo.
14717 (ComposedCast.DoResolveAsTypeStep): Remove check on
14718 ec.ResolvingTypeTree.
14719 * parameter.cs (Parameter.Resolve): Change argument to
14720 EmitContext. Use ResolveAsTypeTerminal.
14721 (Parameter.GetSignature): Change argument to EmitContext.
14722 (Parameters.ComputeSignature): Likewise.
14723 (Parameters.ComputeParameterTypes): Likewise.
14724 (Parameters.GetParameterInfo): Likewise.
14725 (Parameters.ComputeAndDefineParameterTypes): Likewise.
14726 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
14727 * support.cs (InternalParameters..ctor): Remove variant that takes
14729 * typemanager.cs (system_intptr_expr): New.
14730 (InitExpressionTypes): Initialize it.
14732 2004-10-12 Chris Toshok <toshok@ximian.com>
14734 * cs-parser.jay: fix location for try_statement and catch_clause.
14736 2004-10-11 Martin Baulig <martin@ximian.com>
14738 * report.cs: Don't make --fatal abort on warnings, we have
14739 -warnaserror for that.
14741 2004-10-07 Raja R Harinath <rharinath@novell.com>
14743 More DeclSpace.ResolveType avoidance.
14744 * decl.cs (MemberCore.InUnsafe): New property.
14745 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
14746 with newly created EmitContext.
14747 (FieldMember.Define): Likewise.
14748 * delegate.cs (Delegate.Define): Likewise.
14749 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
14750 only if normal name-lookup fails.
14751 (TypeExpr.DoResolve): Enable error-checking.
14752 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
14753 (SizeOf.DoResolve): Likewise.
14754 (ComposedCast.DoResolveAsTypeStep): Likewise.
14755 (StackAlloc.DoResolve): Likewise.
14756 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
14757 (Block.Unsafe): New property.
14758 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
14759 (Unsafe): Set 'unsafe' flag of contained block.
14760 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
14761 (Fixed.Resolve): Likewise.
14762 (Catch.Resolve): Likewise.
14763 (Using.ResolveLocalVariableDecls): Likewise.
14764 (Foreach.Resolve): Likewise.
14766 2004-10-05 John Luke <john.luke@gmail.com>
14768 * cs-parser.jay: add location to error CS0175
14770 2004-10-04 Miguel de Icaza <miguel@ximian.com>
14772 * ecore.cs (Expression.Constantity): Add support for turning null
14775 * const.cs (Const.Define): Allow constants to be reference types
14776 as long as the value is Null.
14778 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
14780 * namespace.cs (NamespaceEntry.Using): No matter which warning
14781 level is set, check if this namespace name has already been added.
14783 2004-10-03 Ben Maurer <bmaurer@ximian.com>
14785 * expression.cs: reftype [!=]= null should always use br[true,false].
14788 2004-10-03 Marek Safar <marek.safar@seznam.cz>
14791 * attribute.cs: Enum conversion moved to
14792 GetAttributeArgumentExpression to be applied to the all
14795 2004-10-01 Raja R Harinath <rharinath@novell.com>
14797 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
14798 * class.c (TypeContainer.DefineType): Flag error if
14799 base types aren't accessible due to access permissions.
14800 * decl.cs (DeclSpace.ResolveType): Move logic to
14801 Expression.ResolveAsTypeTerminal.
14802 (DeclSpace.ResolveTypeExpr): Thin layer over
14803 Expression.ResolveAsTypeTerminal.
14804 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
14805 Refactor code into NestedAccess. Use it.
14806 (DeclSpace.NestedAccess): New.
14807 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
14808 argument to silence errors. Check access permissions.
14809 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
14810 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
14811 (Cast.DoResolve): Likewise.
14812 (New.DoResolve): Likewise.
14813 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
14814 (TypeOf.DoResolve): Likewise.
14816 * expression.cs (Invocation.BetterConversion): Return the Type of
14817 the better conversion. Implement section 14.4.2.3 more faithfully.
14818 (Invocation.BetterFunction): Make boolean. Make correspondence to
14819 section 14.4.2.2 explicit.
14820 (Invocation.OverloadResolve): Update.
14821 (Invocation): Remove is_base field.
14822 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
14823 (Invocation.Emit): Likewise.
14825 2004-09-27 Raja R Harinath <rharinath@novell.com>
14827 * README: Update to changes.
14829 2004-09-24 Marek Safar <marek.safar@seznam.cz>
14831 * cs-parser.jay: Reverted 642 warning fix.
14833 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14836 * decl.cs (FindMemberWithSameName): Indexer can have more than
14839 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14841 * expression.cs (LocalVariableReference.DoResolveLValue):
14842 Do not report warning 219 for out values.
14843 (EmptyExpression.Null): New member to avoid extra allocations.
14845 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14847 * cs-parser.jay: Fix wrong warning 642 report.
14849 * cs-tokenizer.cs (CheckNextToken): New helper;
14850 Inspect next character if is same as expected.
14852 2004-09-23 Martin Baulig <martin@ximian.com>
14854 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
14855 (Convert.ImplicitReferenceConversionExists): Likewise.
14857 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14859 * class.cs (Operator.Define): Add error 448 and 559 report.
14861 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14863 * class.cs (MemberBase.IsTypePermitted): New protected
14864 method for checking error CS0610.
14866 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14868 * class.cs (TypeContainer.HasExplicitLayout): New property
14869 Returns whether container has StructLayout attribute set Explicit.
14870 (FieldMember): New abstract class for consts and fields.
14871 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
14872 (Field): Reuse FieldMember.
14874 * const.cs (Const): Reuse FieldMember.
14876 * rootcontext.cs: EmitConstants call moved to class.
14878 2004-09-22 Martin Baulig <martin@ximian.com>
14880 Thanks to Peter Sestoft for this bug report.
14882 * expression.cs (Conditional): If both the `trueExpr' and the
14883 `falseExpr' is a NullLiteral, return a NullLiteral.
14885 2004-09-22 Martin Baulig <martin@ximian.com>
14887 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
14888 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
14889 for the "get_Current" call.
14891 2004-09-22 Martin Baulig <martin@ximian.com>
14893 Marek and me just fixed one of our oldest bugs: #28562 :-)
14895 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
14897 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
14898 we're an EnumConstant, just return that.
14899 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
14900 an EnumConstant. In this case, we need to use GetValueAsEnumType()
14901 to get the value which'll actually be written into the attribute.
14902 However, we have to use GetValue() to access the attribute's value
14905 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14907 * constant.cs (Constant.IsNegative): New abstract property
14910 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
14911 (StackAlloc.DoResolve): Reused IsNegative.
14913 2004-09-21 Martin Baulig <martin@ximian.com>
14915 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
14916 if we're used in an iterator, we may be called from different
14919 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
14920 we actually have an exception block.
14922 2004-09-20 John Luke <jluke@cfl.rr.com>
14924 * class.cs, cs-parser.jay: Improve the error report for 1520:
14925 report the actual line where the error happens, not where the
14926 class was declared.
14928 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
14929 Pass location information that was available elsewhere.
14931 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
14933 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
14934 runtime to delay sign assemblies.
14936 2004-09-19 Miguel de Icaza <miguel@ximian.com>
14938 * cs-parser.jay: Do not report the stack trace, this is barely
14941 2004-08-22 John Luke <john.luke@gmail.com>
14943 * driver.cs : check that a resource id is not already used
14944 before adding it, report CS1508 if it is, bug #63637
14946 2004-09-19 Miguel de Icaza <miguel@ximian.com>
14948 * ecore.cs: Removed dead code.
14950 2004-09-18 Marek Safar <marek.safar@seznam.cz>
14952 * class.cs: Do not report warning CS0067 on the interfaces.
14954 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14956 * cs-parser.jay: Add error 504 report.
14958 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14960 * rootcontext.cs: WarningLevel is 4 by default now.
14962 * statement.cs (Fixed.Resolve): Do not null
14965 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14968 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
14969 deep search when property is not virtual.
14970 (PropertyExpr.ResolveAccessors): Make one call for both
14973 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14976 * statement.cs: Error 152 report constains also location.
14978 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14981 * const.cs: Explicitly set constant as static.
14983 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14986 * cs-parser.jay: Add error 1017 report.
14988 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14990 Fixed bug #59980, #64224
14991 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
14993 * typemanager.cs (IsSpecialMethod): Simplified
14995 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14997 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
14998 condition with better params.
15000 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15003 * attribute.cs (Resolve): Property has to have both
15006 2004-09-14 Martin Baulig <martin@ximian.com>
15008 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
15010 2004-09-14 Marek Safar <marek.safar@seznam.cz>
15013 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
15014 called and is obsolete then this member suppress message
15015 when call is inside next [Obsolete] method or type.
15017 * expression.cs: Use TestObsoleteMethodUsage member.
15019 2004-09-14 Martin Baulig <martin@ximian.com>
15021 * cs-parser.jay: Sync a bit with the GMCS version.
15023 2004-09-14 Martin Baulig <martin@ximian.com>
15025 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
15026 (CSharpParser.yacc_verbose_flag): New public field.
15028 * genericparser.cs: Removed.
15030 2004-09-14 Raja R Harinath <rharinath@novell.com>
15032 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
15034 2004-09-13 Marek Safar <marek.safar@seznam.cz>
15036 * class.cs (MethodCore.CheckBase): Fix bug #65757.
15038 2004-09-10 Martin Baulig <martin@ximian.com>
15040 Backported my MemberName changes from GMCS into MCS.
15042 - we are now using a special `MemberName' class instead of using
15043 strings; in GMCS, the `MemberName' also contains the type
15046 - changed the grammar rules a bit:
15047 * the old `member_name' is now a `namespace_or_type_name':
15048 The rule is that we use `namespace_or_type_name' everywhere
15049 where we expect either a "member name" (GetEnumerator) or a
15050 "member name" with an explicit interface name
15051 (IEnumerable.GetEnumerator).
15052 In GMCS, the explicit interface name may include type arguments
15053 (IEnumerable<T>.GetEnumerator).
15054 * we use `member_name' instead of just `IDENTIFIER' for
15056 The rule is that we use `member_name' wherever a member may
15057 have type parameters in GMCS.
15059 * decl.cs (MemberName): New public class.
15060 (MemberCore.MemberName): New public readonly field.
15061 (MemberCore.ctor): Take a `MemberName' argument, not a string.
15062 (DeclSpace): Likewise.
15064 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
15065 * enum.cs (Enum.ctor): Likewise.
15067 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
15069 (AliasEntry.ctor): Take a MemberName, not an Expression.
15070 (AliasEntry.UsingAlias): Likewise.
15072 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
15073 (IMethodData.MemberName): Changed type from string to MemberName.
15074 (MemberBase.ExplicitInterfaceName): Likewise.
15075 (AbstractPropertyEventMethod.SetupName): Make this private.
15076 (AbstractPropertyEventMethod.ctor): Added `string prefix'
15077 argument; compute the member name here.
15078 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
15079 on the `member.MemberName' and the `prefix'.
15081 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
15083 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
15084 thus, we get a `MemberName' instead of a `string'. These
15085 declarations may have type parameters in GMCS.
15086 (interface_method_declaration, delegate_declaration): Likewise.
15087 (class_declaration, interface_declaration): Likewise.
15088 (method_header): Use `namespace_or_type_name' instead of
15089 `member_name'. We may be an explicit interface implementation.
15090 (property_declaration, event_declaration): Likewise.
15091 (member_name): This is now just an `IDENTIFIER', not a
15092 `namespace_or_type_name'.
15093 (type_name, interface_type): Removed.
15094 (namespace_or_type_name): Return a MemberName, not an Expression.
15095 (primary_expression): Use `member_name' instead of `IDENTIFIER';
15096 call GetTypeExpression() on the MemberName to get an expression.
15097 (IndexerDeclaration.interface_type): Changed type from string to
15099 (MakeName): Operate on MemberName's instead of string's.
15101 2004-09-13 Raja R Harinath <rharinath@novell.com>
15104 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
15105 (NamespaceEntry.Lookup): Add new argument to flag if we want the
15106 lookup to avoid symbols introduced by 'using'.
15107 * rootcontext.cs (NamespaceLookup): Update.
15109 2004-09-12 Marek Safar <marek.safar@seznam.cz>
15111 * class.cs (TypeContainer.DoDefineMembers): Do not call
15112 DefineDefaultConstructor for static classes.
15114 2004-09-12 Marek Safar <marek.safar@seznam.cz>
15116 * attribute.cs (Attribute.Resolve): Add error 653 report.
15118 * class.cs (Class.ApplyAttributeBuilder): Add error 641
15120 (Method.ApplyAttributeBuilder): Add error 685 report.
15121 (Operator.Define): Add error 564 report.
15123 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15125 * expression.cs (Invocation.DoResolve): Add error
15126 245 and 250 report.
15128 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
15131 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15133 * class.cs (ConstructorInitializer.Resolve):
15134 Wrong error number (515->516).
15136 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15138 * class.cs (Indexer.Define): Add error 631 report.
15140 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15142 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
15144 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15146 * expression.cs (Probe.DoResolve): Add error CS0241 report.
15148 2004-09-10 Marek Safar <marek.safar@seznam.cz>
15150 * cs-parser.jay: Added error CS0241 report.
15152 2004-09-10 Raja R Harinath <rharinath@novell.com>
15154 * cs-parser.jay (fixed_statement): Introduce a scope for the
15155 declaration in the 'fixed' statement.
15157 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15159 * cs-parser.jay: Added CS0230 error report.
15161 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15163 * cs-parser.jay: Added errors CS0231 and CS0257 report.
15165 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15167 * expression.cs (Argument.Resolve): Added error CS0192 and
15170 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15172 C# 2.0 #pragma warning feature
15174 * cs-tokenizer.cs (PreProcessPragma): New method;
15175 Handles #pragma directive.
15177 * report.cs (WarningRegions): New class; Support
15178 class for #pragma warning directive. It tests whether
15179 warning is enabled for a given line.
15181 2004-09-08 Miguel de Icaza <miguel@ximian.com>
15183 * const.cs: Add more descriptive error report, tahnks to
15186 2004-09-08 Marek Safar <marek.safar@seznam.cz>
15188 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
15190 2004-09-07 Miguel de Icaza <miguel@ximian.com>
15192 * expression.cs: Apply patch from Ben: Remove dead code from
15193 ArrayCreation, and remove the TurnintoConstant call in const.cs,
15194 as that code just threw an exception anwyays.
15196 * const.cs: Remove the call to the turnintoconstant, for details
15199 * literal.cs: The type of the null-literal is the null type; So
15200 we use a placeholder type (literal.cs:System.Null, defined here)
15203 * expression.cs (Conditional.DoResolve): Remove some old code that
15204 is no longer needed, conversions have been fixed.
15206 (ArrayCreationExpression.DoResolve): Return false if we fail to
15207 resolve the inner expression.
15209 2004-09-07 Raja R Harinath <rharinath@novell.com>
15212 * cs-parser.jay (delegate_declaration): Record a delegate
15213 declaration as a type declaration.
15214 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
15216 2004-09-06 Miguel de Icaza <miguel@ximian.com>
15218 * parameter.cs: Do not crash if the type can not be resolved.
15220 * expression.cs: Report errors with unsafe pointers, fixes #64896
15222 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
15224 * expression.cs: Pointer arith always needs to do a conv.i
15225 if the operand is a long. fix 65320
15227 2004-09-04 Marek Safar <marek.safar@seznam.cz>
15229 Fixed cs0619-37.cs, cs0619-38.cs
15231 * enum.cs (GetObsoleteAttribute): Removed.
15233 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
15234 on Enum member is double staged. The first is tested member
15237 2004-09-04 Marek Safar <marek.safar@seznam.cz>
15239 Fixed #56986, #63631, #65231
15241 * class.cs: (TypeContainer.AddToMemberContainer): New method,
15242 adds member to name container.
15243 (TypeContainer.AddToTypeContainer): New method, adds type to
15245 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
15246 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
15247 AddOperator): Simplified by reusing AddToMemberContainer.
15248 (TypeContainer.UserDefinedStaticConstructor): Changed to property
15250 (Method.CheckForDuplications): Fixed implementation to test all
15252 (MemberBase): Detection whether member is explicit interface
15253 implementation is now in constructor.
15254 (MemberBase.UpdateMemberName): Handles IndexerName.
15255 (Accessor): Changed to keep also location information.
15256 (AbstractPropertyEventMethod): Is derived from MemberCore.
15257 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
15258 will be emited or not.
15259 (PropertyBase.AreAccessorsDuplicateImplementation):
15260 Tests whether accessors are not in collision with some method.
15261 (Operator): Is derived from MethodCore to simplify common
15264 * decl.cs (Flags.TestMethodDuplication): Test for duplication
15266 (DeclSpace.AddToContainer): Adds the member to defined_names
15267 table. It tests for duplications and enclosing name conflicts.
15269 * enum.cs (EnumMember): Clean up to reuse the base structures
15271 2004-09-03 Martin Baulig <martin@ximian.com>
15273 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
15274 into TypeContainer, to make partial classes work again.
15276 2004-09-03 Martin Baulig <martin@ximian.com>
15278 * rootcontext.cs (RootContext.V2): Removed.
15280 2004-03-23 Martin Baulig <martin@ximian.com>
15282 * expression.cs (Invocation.OverloadResolve): Added `bool
15283 may_fail' argument and use it instead of the Location.IsNull() hack.
15285 2004-09-03 Martin Baulig <martin@ximian.com>
15287 Merged latest changes into gmcs. Please keep this comment in
15288 here, it makes it easier for me to see what changed in MCS since
15289 the last time I merged.
15291 2004-09-03 Raja R Harinath <rharinath@novell.com>
15294 * expression.cs (BetterConversion): Don't allow either conversion
15295 to be null. Remove redundant implicit conversion test when 'q ==
15296 null' -- when this function is invoked, we already know that the
15297 implicit conversion exists.
15298 (BetterFunction): Assume that 'best' is non-null. Remove
15299 redundant reimplementation of IsApplicable when 'best' is null.
15300 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
15301 number of arguments.
15302 (IsAncestralType): Extract from OverloadResolve.
15303 (OverloadResolve): Make robust to the MethodGroupExpr being
15304 unsorted. Implement all the logic of Section 14.5.5.1, and
15305 support overloading of methods from multiple applicable types.
15306 Clean up logic somewhat. Don't pass null methods to BetterFunction.
15308 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
15309 (RealError, Warning): Append type of report to related symbol.
15311 2004-09-03 Marek Safar <marek.safar@seznam.cz>
15313 * enum.cs: Fixed CLS-Compliance checks for enum members.
15314 Error tests cs3008-8.cs, cs3014-8.cs
15316 2004-09-02 Marek Safar <marek.safar@seznam.cz>
15318 Fixed bug #62342, #63102
15319 * class.cs: ImplementIndexer uses member.IsExplicitImpl
15320 like ImplementMethod.
15322 2004-09-02 Marek Safar <marek.safar@seznam.cz>
15324 * attribute.cs (Attribute.GetAttributeArgumentExpression):
15327 2004-09-02 Martin Baulig <martin@ximian.com>
15329 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
15330 TypeManager.GetArgumentTypes() rather than calling GetParameters()
15333 2004-09-01 Marek Safar <marek.safar@seznam.cz>
15335 C# 2.0 Static classes implemented
15337 * class.cs (TypeContainer): instance_constructors,
15338 initialized_fields, initialized_static_fields,
15339 default_constructor, base_inteface_types are protected to be
15340 accessible from StaticClass.
15341 (TypeContainer.DefineDefaultConstructor): New virtual method
15342 for custom default constructor generating
15343 (StaticClass): New class to handle "Static classes" feature.
15345 * cs-parser.jay: Handle static keyword on class like instance
15348 * driver.cs: Added "/langversion" command line switch with two
15349 options (iso-1, default).
15351 2004-08-31 Marek Safar <marek.safar@seznam.cz>
15353 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
15355 2004-08-31 Miguel de Icaza <miguel@ximian.com>
15357 * delegate.cs: Style.
15359 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
15361 * delegate.cs: Add seperate instance expr field for miguel.
15363 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
15365 * PointerArithmetic (Resolve): make sure we are not doing
15366 pointer arith on void*. Also, make sure we are resolved
15367 by not setting eclass until resolve.
15369 All callers: Make sure that PointerArithmetic gets resolved.
15371 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
15373 * ArrayCreation (LookupType): If the type does not resolve
15374 to an array, give an error.
15376 2004-08-27 Marek Safar <marek.safar@seznam.cz>
15378 * statement.cs (Try.Resolve): Fixed bug #64222
15380 2004-08-27 Martin Baulig <martin@ximian.com>
15383 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
15386 2004-08-26 Marek Safar <marek.safar@seznam.cz>
15388 * ecore.cs (Constantify): Get underlying type via
15389 System.Enum.GetUnderlyingType to avoid StackOverflow on the
15390 Windows in special cases.
15392 2004-08-26 Marek Safar <marek.safar@seznam.cz>
15394 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
15395 for obtaining also private methods.
15396 (GetRemoveMethod): Used GetRemoveMethod (true)
15397 for obtaining also private methods.
15399 2004-08-24 Martin Baulig <martin@ximian.com>
15401 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
15402 MethodAttributes.HideBySig for operators.
15404 2004-08-23 Martin Baulig <martin@ximian.com>
15406 Back to the old error reporting system :-)
15408 * report.cs (Message): Removed.
15409 (Report.MessageData, ErrorData, WarningData): Removed.
15410 (Report.Error, Warning): Back to the old system.
15412 2004-08-23 Martin Baulig <martin@ximian.com>
15414 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
15416 * class.cs (TypeContainer.ParentContainer): New public virtual
15417 method; replaces the explicit interface implementation.
15418 (ClassPart.ParentContainer): Override.
15420 2004-08-23 Martin Baulig <martin@ximian.com>
15422 * statement.cs (Switch): Added support for constant switches; see
15423 #59428 or test-285.cs.
15425 2004-08-22 Marek Safar <marek.safar@seznam.cz>
15428 * statement.cs (GetEnumeratorFilter): Removed useless
15429 logic because C# specs is strict. GetEnumerator must be
15432 2004-08-22 Martin Baulig <martin@ximian.com>
15434 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15435 a switch and may break, reset the barrier. Fixes #59867.
15437 2004-08-22 Marek Safar <marek.safar@seznam.cz>
15439 CLS-Compliance speed up (~5% for corlib)
15441 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
15442 New method. Tests container for CLS-Compliant names
15444 * class.cs (TypeContainer.VerifyClsName): New method.
15445 Checks whether container name is CLS Compliant.
15446 (Constructor): Implements IMethodData.
15448 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
15449 low-case table for CLS Compliance test.
15450 (MemberCache.VerifyClsParameterConflict): New method.
15451 Checks method parameters for CS3006 error.
15453 * enum.cs (EnumMember): Is derived from MemberCore.
15454 (Enum.VerifyClsName): Optimized for better performance.
15456 2004-08-06 Marek Safar <marek.safar@seznam.cz>
15458 * report.cs: Renamed Error_T to Error and changed all
15461 2004-08-06 Marek Safar <marek.safar@seznam.cz>
15463 * class.cs (TypeContainer.IndexerArrayList): New inner class
15464 container for indexers.
15465 (TypeContainer.DefaultIndexerName): New constant for default
15466 indexer name. Replaced all "Item" with this constant.
15467 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
15469 * typemanager.cs (TypeManager.default_member_ctor): Cache here
15470 DefaultMemberAttribute constructor.
15472 2004-08-05 Martin Baulig <martin@ximian.com>
15474 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
15477 2004-08-05 Marek Safar <marek.safar@seznam.cz>
15479 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
15480 multi platforms problem.
15482 * compiler.csproj: Included shared files.
15484 2004-08-04 Marek Safar <marek.safar@seznam.cz>
15486 Fix bug 60333, 55971 in the more general way
15487 * attribute.cs (Attribute.GetAttributeArgumentExpression):
15488 Added arg_type argument for constant conversion.
15489 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
15491 2004-08-04 Marek Safar <marek.safar@seznam.cz>
15494 * class.cs (TypeContainer ): New inner classes MethodArrayList,
15495 OperatorArrayList, MethodCoreArrayList for typecontainer
15496 containers. Changed class member types to these new types.
15497 (MethodArrayList.DefineMembers): Added test for CS0659.
15499 2004-08-04 Miguel de Icaza <miguel@ximian.com>
15501 * cfold.cs: Synchronize the folding with the code in expression.cs
15502 Binary.DoNumericPromotions for uint operands.
15504 * attribute.cs: Revert patch from Raja, it introduced a regression
15505 while building Blam-1.2.1 (hard to isolate a test case).
15507 2004-08-04 Marek Safar <marek.safar@seznam.cz>
15511 (TypeContainer.Define): Renamed to DefineContainerMembers because of
15513 (MethodCore.parent_method): New member. The method we're overriding
15514 if this is an override method.
15515 (MethodCore.CheckBase): Moved from Method class and made common.
15516 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
15518 (MethodCore.CheckForDuplications): New abstract method. For custom
15519 member duplication search in a container
15520 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
15521 method and its return type.
15522 (Event.conflict_symbol): New member. Symbol with same name in the
15526 (MemberCache.FindMemberWithSameName): New method. The method
15527 is looking for conflict with inherited symbols.
15529 2004-08-04 Martin Baulig <martin@ximian.com>
15531 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
15533 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
15535 2004-08-03 Marek Safar <marek.safar@seznam.cz>
15537 * report.cs (Message): New enum for better error, warning reference in
15539 (MessageData): New inner abstract class. It generally handles printing of
15540 error and warning messages.
15541 Removed unused Error, Warning, Message methods.
15543 2004-08-03 Marek Safar <marek.safar@seznam.cz>
15545 Fix for cs0592-8.cs test
15547 (Attributable.ValidAttributeTargets): Made public.
15548 (Attribute.ExplicitTarget): New member for explicit target value.
15549 (Attribute.CheckTargets): Now we translate explicit attribute
15550 target to Target here.
15552 2004-08-03 Ben Maurer <bmaurer@ximian.com>
15554 * ecore.cs (MethodGroupExpr): new IsBase property.
15556 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
15558 * delegate.cs (DelegateCreation): store a MethodGroupExpr
15559 rather than an instance expr.
15561 (DelegateCreation.Emit): Use the method group rather than
15562 the instance expression. Also, if you have base.Foo as the
15563 method for a delegate, make sure to emit ldftn, not ldftnvirt.
15565 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
15567 (NewDelegate.DoResolve): Only check for the existance of Invoke
15568 if the method is going to be needed. Use MethodGroupExpr.
15570 (NewDelegate.Emit): Remove, DelegateCreation implements this.
15572 * expression.cs: For pointer arith., make sure to use
15573 the size of the type, not the size of the pointer to
15576 2004-08-03 Marek Safar <marek.safar@seznam.cz>
15579 * class.cs (Class): Added error CS0502 test.
15581 2004-08-03 John Luke <jluke@cfl.rr.com>
15582 Raja R Harinath <rharinath@novell.com>
15585 * attribute.cs (Attribute.complained_before): New flag.
15586 (Attribute.ResolveType, Attribute.Resolve),
15587 (Attribute.DefinePInvokeMethod): Set it.
15588 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
15590 2004-08-03 Martin Baulig <martin@ximian.com>
15592 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
15593 use a user-defined operator; we still need to do numeric
15594 promotions in case one argument is a builtin type and the other
15595 one has an implicit conversion to that type. Fixes #62322.
15597 2004-08-02 Martin Baulig <martin@ximian.com>
15599 * statement.cs (LocalInfo.Flags): Added `IsThis'.
15600 (LocalInfo.IsThis): New public property.
15601 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
15603 2004-08-01 Martin Baulig <martin@ximian.com>
15605 * class.cs (TypeContainer.GetClassBases): Don't set the default
15606 here since we may get called from GetPartialBases().
15607 (TypeContainer.DefineType): If GetClassBases() didn't return a
15608 parent, use the default one.
15610 2004-07-30 Duncan Mak <duncan@ximian.com>
15612 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
15614 2004-07-30 Martin Baulig <martin@ximian.com>
15616 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
15618 * class.cs (SourceMethod): New public class, derive from the
15619 symbol writer's ISourceMethod.
15620 (Method): Use the new symbol writer API.
15622 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
15623 as argument and use the new symbol writer.
15626 (SourceFile): Implement the symbol writer's ISourceFile.
15627 (Location.SymbolDocument): Removed.
15628 (Location.SourceFile): New public property.
15630 * symbolwriter.cs: Use the new symbol writer API.
15632 2004-07-30 Raja R Harinath <rharinath@novell.com>
15634 * Makefile (install-local): Remove. Functionality moved to
15637 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
15639 * Makefile: Install mcs.exe.config file together with mcs.exe.
15640 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
15641 correct runtime version.
15643 2004-07-25 Martin Baulig <martin@ximian.com>
15646 (TypeContainer.RegisterOrder): Removed, this was unused.
15647 (TypeContainer, interface_order): Removed.
15648 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
15649 TypeContainer as argument since we can also be called with a
15650 `PartialContainer' for a partial class/struct/interface.
15651 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
15652 of checking whether we're an `Interface' - we could be a
15653 `PartialContainer'.
15654 (PartialContainer.Register): Override; call
15655 AddClass()/AddStruct()/AddInterface() on our parent.
15657 * cs-parser.jay (interface_member_declaration): Add things to the
15658 `current_container', not the `current_class'.
15660 * rootcontext.cs (RegisterOrder): The overloaded version which
15661 takes an `Interface' was unused, removed.
15663 * typemanager.cs (TypeManager.LookupInterface): Return a
15664 `TypeContainer', not an `Interface'.
15665 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
15666 contain a `PartialContainer' for an interface, so check it's
15667 `Kind' to figure out what it is.
15669 2004-07-25 Martin Baulig <martin@ximian.com>
15671 * class.cs (Class.DefaultTypeAttributes): New public constant.
15672 (Struct.DefaultTypeAttributes): Likewise.
15673 (Interface.DefaultTypeAttributes): Likewise.
15674 (PartialContainer.TypeAttr): Override this and add the
15675 DefaultTypeAttributes.
15677 2004-07-25 Martin Baulig <martin@ximian.com>
15679 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
15680 we can just use the `Parent' field instead.
15682 2004-07-25 Martin Baulig <martin@ximian.com>
15684 * class.cs (TypeContainer.Emit): Renamed to EmitType().
15686 2004-07-25 Martin Baulig <martin@ximian.com>
15688 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
15689 our parts before defining any methods.
15690 (TypeContainer.VerifyImplements): Make this virtual.
15691 (ClassPart.VerifyImplements): Override and call VerifyImplements()
15692 on our PartialContainer.
15694 2004-07-25 Martin Baulig <martin@ximian.com>
15696 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
15698 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
15699 argument, we can just use the `Parent' field instead.
15702 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
15703 (MemberBase.DoDefine): Likewise.
15705 2004-07-24 Martin Baulig <martin@ximian.com>
15707 * decl.cs (MemberCore.Parent): New public field.
15708 (DeclSpace.Parent): Moved to MemberCore.
15710 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
15711 (MemberBase.ctor): Added TypeContainer argument, pass it to our
15713 (FieldBase, Field, Operator): Likewise.
15714 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
15715 (EventField, Event): Likewise.
15717 2004-07-23 Martin Baulig <martin@ximian.com>
15719 * class.cs (PartialContainer): New public class.
15720 (ClassPart): New public class.
15721 (TypeContainer): Added support for partial classes.
15722 (TypeContainer.GetClassBases): Splitted some of the functionality
15723 out into GetNormalBases() and GetPartialBases().
15725 * cs-tokenizer.cs (Token.PARTIAL): New token.
15726 (Tokenizer.consume_identifier): Added some hacks to recognize
15727 `partial', but only if it's immediately followed by `class',
15728 `struct' or `interface'.
15730 * cs-parser.jay: Added support for partial clases.
15732 2004-07-23 Martin Baulig <martin@ximian.com>
15734 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
15735 a `DeclSpace' and also made it readonly.
15736 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
15737 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
15738 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
15740 * cs-parser.jay: Pass the `current_class', not the
15741 `current_container' (at the moment, this is still the same thing)
15742 to a new Method, Property, Event, Indexer or Constructor.
15744 2004-07-23 Martin Baulig <martin@ximian.com>
15746 * cs-parser.jay (CSharpParser): Added a new `current_class' field
15747 and removed the `current_interface' one.
15748 (struct_declaration, class_declaration, interface_declaration):
15749 Set `current_class' to the newly created class/struct/interface;
15750 set their `Bases' and call Register() before parsing their body.
15752 2004-07-23 Martin Baulig <martin@ximian.com>
15754 * class.cs (Kind): New public enum.
15755 (TypeContainer): Made this class abstract.
15756 (TypeContainer.Kind): New public readonly field.
15757 (TypeContainer.CheckDef): New public method; moved here from
15759 (TypeContainer.Register): New public abstract method.
15760 (TypeContainer.GetPendingImplementations): New public abstract
15762 (TypeContainer.GetClassBases): Removed the `is_class' and
15763 `is_iface' parameters.
15764 (TypeContainer.DefineNestedTypes): Formerly known as
15766 (ClassOrStruct): Made this class abstract.
15768 * tree.cs (RootTypes): New public type.
15770 2004-07-20 Martin Baulig <martin@ximian.com>
15772 * tree.cs (Tree.RecordNamespace): Removed.
15773 (Tree.Namespaces): Removed.
15775 * rootcontext.cs (RootContext.IsNamespace): Removed.
15777 * cs-parser.jay (namespace_declaration): Just create a new
15778 NamespaceEntry here.
15780 2004-07-20 Martin Baulig <martin@ximian.com>
15782 * statement.cs (ExceptionStatement): New abstract class. This is
15783 now used as a base class for everyone who's using `finally'.
15784 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
15785 our local variables before using them.
15787 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
15788 virtual method. This is used by Yield.Resolve() to "steal" an
15789 outer block's `finally' clauses.
15790 (FlowBranchingException): The .ctor now takes an ExceptionStatement
15793 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
15794 version which takes an ExceptionStatement. This version must be
15795 used to create exception branchings.
15798 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
15799 (Iterator.EmitMoveNext): Added exception support; protect the
15800 block with a `fault' clause, properly handle 'finally' clauses.
15801 (Iterator.EmitDispose): Run all the `finally' clauses here.
15803 2004-07-20 Martin Baulig <martin@ximian.com>
15805 * iterator.cs: This is the first of a set of changes in the
15806 iterator code. Match the spec more closely: if we're an
15807 IEnumerable, then GetEnumerator() must be called. The first time
15808 GetEnumerator() is called, it returns the current instance; all
15809 subsequent invocations (if any) must create a copy.
15811 2004-07-19 Miguel de Icaza <miguel@ximian.com>
15813 * expression.cs: Resolve the constant expression before returning
15816 2004-07-19 Martin Baulig <martin@ximian.com>
15818 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
15819 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
15820 the return type of the new EmitContext.
15822 2004-07-18 Martin Baulig <martin@ximian.com>
15824 * class.cs (Property.Define): Fix iterators.
15826 * iterators.cs (Iterator.Define): Moved the
15827 `container.AddInterator (this)' call here from the .ctor; only do
15828 it if we resolved successfully.
15830 2004-07-17 Miguel de Icaza <miguel@ximian.com>
15832 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
15833 `true' for preprocessing directives that we parse. The return
15834 value indicates whether we should return to regular tokenizing or
15835 not, not whether it was parsed successfully.
15837 In the past if we were in: #if false ... #line #endif, we would
15838 resume parsing after `#line'. See bug 61604.
15840 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
15841 building: IsEnumType should return true only for enums, not for
15842 enums or System.Enum itself. This fixes #61593.
15844 Likely what happened is that corlib was wrong: mcs depended on
15845 this bug in some places. The bug got fixed, we had to add the
15846 hack, which caused bug 61593.
15848 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
15849 that was a workaround for the older conditions.
15851 2004-07-16 Ben Maurer <bmaurer@ximian.com>
15853 * assign.cs: IAssignMethod has a new interface, as documented
15854 inline. All assignment code now uses this new api.
15856 * ecore.cs, expression.cs: All classes which implement
15857 IAssignMethod now use the new interface.
15859 * expression.cs (Invocation): add a hack to EmitCall so that
15860 IndexerAccess can be the target of a compound assignment without
15861 evaluating its arguments twice.
15863 * statement.cs: Handle changes in Invocation api.
15865 2004-07-16 Martin Baulig <martin@ximian.com>
15867 * iterators.cs: Rewrote this. We're now using one single Proxy
15868 class for both the IEnumerable and the IEnumerator interface and
15869 `Iterator' derives from Class so we can use the high-level API.
15871 * class.cs (TypeContainer.AddIterator): New method.
15872 (TypeContainer.DoDefineType): New protected virtual method, which
15873 is called from DefineType().
15874 (TypeContainer.DoDefineMembers): Call DefineType() and
15875 DefineMembers() on all our iterators.
15876 (TypeContainer.Emit): Call Emit() on all our iterators.
15877 (TypeContainer.CloseType): Call CloseType() on all our iterators.
15879 * codegen.cs (EmitContext.CurrentIterator): New public field.
15881 2004-07-15 Martin Baulig <martin@ximian.com>
15884 (TypeManager.not_supported_exception_type): New type.
15886 2004-07-14 Martin Baulig <martin@ximian.com>
15888 * iterators.cs: Use real error numbers.
15890 2004-07-14 Martin Baulig <martin@ximian.com>
15892 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
15893 requires this to be a System.Collection.IEnumerable and not a
15894 class implementing that interface.
15895 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
15897 2004-07-13 Marek Safar <marek.safar@seznam.cz>
15899 * class.cs: Fixed previous fix, it broke some error tests.
15901 2004-07-12 Martin Baulig <martin@ximian.com>
15903 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
15906 2004-07-09 Miguel de Icaza <miguel@ximian.com>
15908 * assign.cs (LocalTemporary): Add new argument: is_address,If
15909 `is_address' is true, then the value that we store is the address
15910 to the real value, and not the value itself.
15912 * ecore.cs (PropertyExpr): use the new local temporary
15913 stuff to allow us to handle X.Y += z (where X is a struct)
15915 2004-07-08 Martin Baulig <martin@ximian.com>
15917 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
15918 not always return, just like we're doing in Using.Resolve().
15920 2004-07-07 Miguel de Icaza <miguel@ximian.com>
15922 * cs-parser.jay (fixed_statement): flag this as Pinned.
15924 2004-07-06 Miguel de Icaza <miguel@ximian.com>
15926 * typemanager.cs (TypeManager): Removed MakePinned method, this
15927 mechanism is replaced with the .NET 2.x compatible mechanism of
15928 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
15930 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
15931 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
15932 `IsFixed' property which has a different meaning.
15934 2004-07-02 Raja R Harinath <rharinath@novell.com>
15936 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
15937 visible from inside a nested class, not just the names of the
15938 immediately enclosing class.
15939 Fix for bug #60730.
15941 2004-06-24 Raja R Harinath <rharinath@novell.com>
15943 * expression.cs (BetterConversion): Remove buggy special-case
15944 handling of "implicit constant expression conversions". At this
15945 point, we already know that the conversion is possible -- we're
15946 only checking to see which is better.
15948 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15950 * cs-parser.jay: Added error CS0210 test.
15952 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15954 * cs-parser.jay: Added error CS0134 test.
15956 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15959 * cs-parser.jay: Added error CS0145 test.
15961 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15963 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
15965 2004-06-23 Ben Maurer <bmaurer@ximian.com>
15967 * expression.cs (StackAlloc.Resolve): The argument may not
15968 be a constant; deal with this case.
15970 2004-06-23 Marek Safar <marek.safar@seznam.cz>
15972 * attribute.cs (IndexerName_GetIndexerName): Renamed to
15973 GetIndexerAttributeValue.
15974 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
15976 * class.cs (Indexer.Define): Added error tests for CS0415,
15979 2004-06-23 Miguel de Icaza <miguel@ximian.com>
15981 * attribute.cs (Attribute.Resolve): Keep field code in sync with
15984 2004-06-23 Martin Baulig <martin@ximian.com>
15986 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
15987 neither return nor throw, reset the barrier as well. Fixes #60457.
15989 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
15991 * class.cs : EventAttributes is now set to None by default.
15992 This fixes bug #60459.
15994 2004-06-18 Marek Safar <marek.safar@seznam.cz>
15997 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15998 Don't throw exception but return null (it's sufficient now).
16000 2004-06-18 Marek Safar <marek.safar@seznam.cz>
16002 * typemanager.cs (GetArgumentTypes): Faster implementation.
16004 2004-06-18 Martin Baulig <martin@ximian.com>
16006 * attribute.cs (Attribute.Resolve): Check whether we're an
16007 EmptyCast which a Constant child. Fixes #60333.
16009 2004-06-17 Ben Maurer <bmaurer@ximian.com>
16011 * statement.cs (EmitCollectionForeach): Account for the fact that
16012 not all valuetypes are in areas which we can take the address of.
16013 For these variables, we store to a temporary variable. Also, make
16014 sure that we dont emit a `callvirt' on a valuetype method.
16016 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16018 * expression.cs (StackAlloc.DoReSolve): Added test for
16019 negative parameter (CS0247).
16021 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16024 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
16026 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16029 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
16032 2004-06-14 Marek Safar <marek.safar@seznam.cz>
16034 Fix bug #58254 & cs1555.cs, cs1556.cs
16035 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
16037 2004-06-14 Marek Safar <marek.safar@seznam.cz>
16039 * cs-parser.jay: Added error CS1669 test for indexers.
16041 2004-06-11 Martin Baulig <martin@ximian.com>
16043 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
16044 call this twice: for params and varargs methods.
16046 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16049 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
16051 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16053 * attribute.cs (Attribute.GetValidTargets): Made public.
16056 (AbstractPropertyEventMethod): New class for better code sharing.
16057 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
16059 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
16061 2004-06-11 Raja R Harinath <rharinath@novell.com>
16064 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
16065 that the call to Resolve is part of a MemberAccess.
16066 (Expression.Resolve): Use it for SimpleName resolution.
16067 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
16068 Add 'intermediate' boolean argument.
16069 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
16070 error message when the SimpleName can be resolved ambiguously
16071 between an expression and a type.
16072 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
16074 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
16075 call on the left-side.
16077 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16080 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
16082 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16084 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
16086 2004-06-11 Martin Baulig <martin@ximian.com>
16088 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
16089 varargs methods if applicable.
16091 2004-06-11 Martin Baulig <martin@ximian.com>
16093 * expression.cs (Invocation.EmitCall): Don't use
16094 `method.CallingConvention == CallingConventions.VarArgs' since the
16095 method could also have `CallingConventions.HasThis'.
16097 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16099 * class.cs (Event.GetSignatureForError): Implemented.
16100 Fixed crash in error test cs3010.cs
16102 2004-06-10 Miguel de Icaza <miguel@ximian.com>
16104 * cs-tokenizer.cs: Change the way we track __arglist to be
16105 consistent with the other keywords.
16107 2004-06-09 Miguel de Icaza <miguel@ximian.com>
16109 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
16112 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
16114 * codegen.cs: Check that all referenced assemblies have a strongname
16115 before strongnaming the compiled assembly. If not report error CS1577.
16116 Fix bug #56563. Patch by Jackson Harper.
16117 * typemanager.cs: Added a method to return all referenced assemblies.
16118 Fix bug #56563. Patch by Jackson Harper.
16120 2004-06-08 Marek Safar <marek.safar@seznam.cz>
16123 (Method.ApplyAttributeBuilder): Moved and added conditional
16124 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
16127 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
16129 2004-06-08 Marek Safar <marek.safar@seznam.cz>
16132 * class.cs: (EventField.attribute_targets): Changed default target.
16134 2004-06-08 Martin Baulig <martin@ximian.com>
16136 * expression.cs (Invocation.EmitCall): Enable varargs methods.
16138 2004-06-08 Martin Baulig <martin@ximian.com>
16140 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
16142 2004-06-07 Martin Baulig <martin@ximian.com>
16144 Added support for varargs methods.
16146 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
16149 * cs-parser.jay: Added support for `__arglist'.
16151 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
16153 * expression.cs (Argument.AType): Added `ArgList'.
16154 (Invocation): Added support for varargs methods.
16155 (ArglistAccess): New public class.
16156 (Arglist): New public class.
16158 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
16160 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
16161 a method's top-level block if the method has varargs.
16163 * support.cs (ReflectionParameters, InternalParameters): Added
16164 support for varargs methods.
16166 2004-06-07 Miguel de Icaza <miguel@ximian.com>
16168 * class.cs: Provide location in indexer error report.
16170 * driver.cs: Use standard names.
16172 * namespace.cs: Catch the use of using after a namespace has been
16173 declared also on using aliases.
16175 2004-06-03 Raja R Harinath <rharinath@novell.com>
16178 * typemanager.cs (closure_private_ok, closure_invocation_type)
16179 (closure_qualifier_type, closure_invocation_assembly)
16180 (FilterWithClosure): Move to ...
16181 (Closure): New internal nested class.
16182 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
16183 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
16184 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
16185 (MemberLookup, MemberLookupFailed): Use it.
16186 * expression.cs (New.DoResolve): Treat the lookup for the
16187 constructor as being qualified by the 'new'ed type.
16188 (Indexers.GetIndexersForTypeOrInterface): Update.
16190 2004-06-03 Marek Safar <marek.safar@seznam.cz>
16193 (GetConditionalAttributeValue): New method. Returns
16194 condition of ConditionalAttribute.
16195 (SearchMulti): New method. Returns all attributes of type 't'.
16196 Use it when attribute is AllowMultiple = true.
16197 (IsConditionalMethodExcluded): New method.
16200 (Method.IsExcluded): Implemented. Returns true if method has conditional
16201 attribute and the conditions is not defined (method is excluded).
16202 (IMethodData): Extended interface for ConditionalAttribute support.
16203 (PropertyMethod.IsExcluded): Implemented.
16206 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
16209 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
16212 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
16214 * expression.cs (ArrayCreationExpression): Make this just an
16215 `expression'. It can't be a statement, so the code here was
16218 2004-06-02 Marek Safar <marek.safar@seznam.cz>
16221 * typemanager.cs (GetFullNameSignature): New method for
16224 2004-06-02 Marek Safar <marek.safar@seznam.cz>
16227 * class.cs (MemberBase.GetSignatureForError): New virtual method.
16228 Use this method when MethodBuilder is null.
16229 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
16230 Added test for error CS0626 (MONO reports error for this situation).
16231 (IMethodData.GetSignatureForError): Extended interface.
16233 2004-06-01 Marek Safar <marek.safar@seznam.cz>
16236 (AttributeTester.GetObsoleteAttribute): Returns instance of
16237 ObsoleteAttribute when type is obsolete.
16240 (TypeContainer.VerifyObsoleteAttribute): Override.
16241 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
16242 (MethodCode.VerifyObsoleteAttribute): Override.
16243 (MemberBase.VerifyObsoleteAttribute): Override.
16246 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
16247 and report proper error.
16250 Delegate.VerifyObsoleteAttribute): Override.
16253 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
16254 and report proper error.
16255 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
16258 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
16262 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
16263 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
16264 Added test for ObsoleteAttribute.
16267 (Catch): Derived from Statement.
16269 2004-06-01 Marek Safar <marek.safar@seznam.cz>
16271 Fixed bug #59071 & cs0160.cs
16273 * statement.cs (Try.Resolve): Check here whether order of catch
16274 clauses matches their dependencies.
16276 2004-05-31 Miguel de Icaza <miguel@ximian.com>
16278 * Reverted patch to namespace.cs (Use lookuptypedirect). This
16279 caused a regression: #59343. Referencing nested classes from an
16280 assembly stopped working.
16282 2004-05-31 Martin Baulig <martin@ximian.com>
16284 MCS is now frozen for beta 2.
16286 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16288 * convert.cs: add a trivial cache for overload operator resolution.
16290 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16292 * decl.cs: If possible, use lookuptypedirect here. We can only do
16293 this if there is no `.' after the namespace. Avoids using
16294 LookupType, which does lots of slow processing.
16295 (FindNestedType) New method, does what it says :-).
16296 * namespace.cs: use LookupTypeDirect.
16297 * rootcontext.cs: use membercache, if possible.
16298 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
16300 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16303 According to the spec,
16305 In a member access of the form E.I, if E is a single identifier,
16306 and if the meaning of E as a simple-name (§7.5.2) is a constant,
16307 field, property, localvariable, or parameter with the same type as
16308 the meaning of E as a type-name (§3.8), then both possible
16309 meanings of E are permitted.
16311 We did not check that E as a simple-name had the same type as E as
16314 This trivial check gives us 5-7% on bootstrap time.
16316 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16318 * expression.cs (Invocation.OverloadResolve): Avoid the
16319 use of hashtables and boxing here by allocating on demand.
16321 2004-05-30 Martin Baulig <martin@ximian.com>
16323 * rootcontext.cs (RootContext.LookupType): Don't cache things if
16324 we're doing a silent lookup. Don't try to lookup nested types in
16325 TypeManager.object_type (thanks to Ben Maurer).
16327 2004-05-30 Martin Baulig <martin@ximian.com>
16329 Committing a patch from Ben Maurer.
16331 * rootcontext.cs (RootContext.LookupType): Cache negative results.
16333 2004-05-29 Martin Baulig <martin@ximian.com>
16335 * class.cs (IMethodData.ShouldIgnore): New method.
16337 * typemanager.cs (TypeManager.MethodFlags): Don't take a
16338 `Location' argument, we don't need it anywhere. Use
16339 `IMethodData.ShouldIgnore ()' instead of
16340 `MethodData.GetMethodFlags ()'.
16341 (TypeManager.AddMethod): Removed.
16342 (TypeManager.AddMethod2): Renamed to AddMethod.
16344 2004-05-29 Martin Baulig <martin@ximian.com>
16346 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
16348 * convert.cs (Convert.ImplicitReferenceConversion): If we're
16349 converting from a class type S to an interface type and we already
16350 have an object on the stack, don't box it again. Fixes #52578.
16352 2004-05-29 Martin Baulig <martin@ximian.com>
16354 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16355 Added support for `params' parameters. Fixes #59267.
16357 2004-05-29 Martin Baulig <martin@ximian.com>
16359 * literal.cs (NullPointer): Provide a private .ctor which sets
16360 `type' to TypeManager.object_type. Fixes #59048.
16362 2004-05-29 Martin Baulig <martin@ximian.com>
16364 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
16365 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
16367 * ecore.cs (EventExpr.instance_expr): Make the field private.
16369 2004-05-26 Marek Safar <marek.safar@seznam.cz>
16371 Fixed bug #50080 & cs0214-2.cs
16372 * expression.cs (Cast.DoResolve): Check unsafe context here.
16374 * statement.cs (Resolve.DoResolve): Likewise.
16376 2004-05-26 Martin Baulig <martin@ximian.com>
16378 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
16380 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
16381 (RootContext.LookupType): Pass down the `silent' flag.
16383 2004-05-25 Martin Baulig <martin@ximian.com>
16386 (MethodGroupExpr.IdenticalTypeName): New public property.
16387 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
16388 expression actually refers to a type.
16390 2004-05-25 Martin Baulig <martin@ximian.com>
16392 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
16393 for #56176 and made it actually work.
16395 2004-05-25 Martin Baulig <martin@ximian.com>
16397 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
16398 (FieldExpr, PropertyExpr): Override and implement
16399 CacheTemporaries. Fixes #52279.
16401 2004-05-25 Miguel de Icaza <miguel@ximian.com>
16403 * location.cs: In the new compiler listing a file twice is a
16404 warning, not an error.
16406 2004-05-24 Martin Baulig <martin@ximian.com>
16408 * enum.cs (Enum.DefineType): For the `BaseType' to be a
16409 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
16411 2004-05-24 Martin Baulig <martin@ximian.com>
16413 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
16414 walking the `using' list. Fixes #53921.
16416 2004-05-24 Martin Baulig <martin@ximian.com>
16418 * const.cs (Const.LookupConstantValue): Added support for
16419 EmptyCast's; fixes #55251.
16421 2004-05-24 Martin Baulig <martin@ximian.com>
16423 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
16424 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
16425 which does the CS0135 check. The reason is that we first need to
16426 check whether the variable actually exists.
16428 2004-05-24 Martin Baulig <martin@ximian.com>
16430 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
16431 than RootContext.LookupType() to find the explicit interface
16432 type. Fixes #58584.
16434 2004-05-24 Raja R Harinath <rharinath@novell.com>
16436 * Makefile: Simplify. Use executable.make.
16437 * mcs.exe.sources: New file. List of sources of mcs.exe.
16439 2004-05-24 Anders Carlsson <andersca@gnome.org>
16443 Use the invariant culture when doing String.Compare for CLS case
16446 2004-05-23 Martin Baulig <martin@ximian.com>
16448 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
16449 don't have any dots. Fixes #52622, added cs0246-8.cs.
16451 * namespace.cs (NamespaceEntry.Lookup): Likewise.
16453 2004-05-23 Marek Safar <marek.safar@seznam.cz>
16455 * class.cs (MemberBase.Define): Reuse MemberType member for
16456 resolved type. Other methods can use it too.
16458 2004-05-23 Martin Baulig <martin@ximian.com>
16460 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
16461 the variable also exists in the current block (otherwise, we need
16462 to report a CS0103). Fixes #58670.
16464 2004-05-23 Martin Baulig <martin@ximian.com>
16466 * flowanalysis.cs (Reachability.Reachable): Compute this
16467 on-the-fly rather than storing it as a field.
16469 2004-05-23 Martin Baulig <martin@ximian.com>
16471 * flowanalysis.cs (Reachability.And): Manually compute the
16472 resulting `barrier' from the reachability.
16474 2004-05-23 Marek Safar <marek.safar@seznam.cz>
16477 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
16478 instance of ObsoleteAttribute when symbol is obsolete.
16481 (IMethodData): Extended interface for ObsoleteAttribute support.
16483 2004-05-22 Marek Safar <marek.safar@seznam.cz>
16485 * attribute.cs: Fix bug #55970
16487 2004-05-22 Marek Safar <marek.safar@seznam.cz>
16491 (GetObsoleteAttribute): New method. Creates the instance of
16493 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
16494 ObsoleteAttribute when member is obsolete.
16495 (AttributeTester.Report_ObsoleteMessage): Common method for
16496 Obsolete error/warning reporting.
16499 (TypeContainer.base_classs_type): New member for storing parent type.
16502 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
16503 for this MemberCore.
16505 2004-05-21 Marek Safar <marek.safar@seznam.cz>
16507 * attribute.cs, const.cs: Fix bug #58590
16509 2004-05-21 Martin Baulig <martin@ximian.com>
16511 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
16512 out parameters if the end of the method is unreachable. Fixes
16515 2004-05-21 Marek Safar <marek.safar@seznam.cz>
16517 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
16518 Hari was right, why extra method.
16520 2004-05-21 Marek Safar <marek.safar@seznam.cz>
16522 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
16524 2004-05-20 Martin Baulig <martin@ximian.com>
16526 Merged this back from gmcs to keep the differences to a minumum.
16528 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
16529 instead of a Declspace.
16530 (Attribute.ResolveType): Likewise.
16531 (Attributes.Search): Likewise.
16532 (Attributes.Contains): Likewise.
16533 (Attributes.GetClsCompliantAttribute): Likewise.
16535 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
16537 (MethodData.ApplyAttributes): Take an EmitContext instead of a
16540 2004-05-19 Marek Safar <marek.safar@seznam.cz>
16542 Fix bug #58688 (MCS does not report error when the same attribute
16545 * attribute.cs (Attribute.Emit): Distinction between null and default.
16547 2004-05-19 Raja R Harinath <rharinath@novell.com>
16549 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
16550 of a top-level attribute without an attribute target.
16551 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
16553 (Attribute.Conditional_GetConditionName),
16554 (Attribute.Obsolete_GetObsoleteMessage): Update.
16555 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
16556 part of ScanForIndexerName.
16557 (Attribute.CanIgnoreInvalidAttribute): New function.
16558 (Attribute.ScanForIndexerName): Move to ...
16559 (Attributes.ScanForIndexerName): ... here.
16560 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
16561 (Attributes.Search): New internal variant that can choose not to
16562 complain if types aren't resolved. The original signature now
16564 (Attributes.GetClsCompliantAttribute): Use internal variant, with
16565 complaints suppressed.
16566 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
16567 only if it not useful.
16568 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
16569 top-level for attributes that are shared between the assembly
16570 and a top-level class.
16571 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
16572 * class.cs: Update to reflect changes.
16573 (DefineIndexers): Fuse loops.
16574 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
16575 a couple more variants of attribute names.
16577 2004-05-18 Marek Safar <marek.safar@seznam.cz>
16579 Fix bug #52585 (Implemented explicit attribute declaration)
16582 (Attributable.ValidAttributeTargets): New abstract method. It gets
16583 list of valid attribute targets for explicit target declaration.
16584 (Attribute.Target): It holds target itself.
16585 (AttributeSection): Removed.
16586 (Attribute.CheckTargets): New method. It checks whether attribute
16587 target is valid for the current element.
16590 (EventProperty): New class. For events that are declared like
16591 property (with add and remove accessors).
16592 (EventField): New class. For events that are declared like field.
16595 * cs-parser.jay: Implemented explicit attribute target declaration.
16597 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
16598 Override ValidAttributeTargets.
16601 (ReturnParameter): Class for applying custom attributes on
16603 (ParameterAtribute): New class. Class for applying custom
16604 attributes on the parameter type.
16606 2004-05-17 Miguel de Icaza <miguel@ximian.com>
16608 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
16611 (Method): Allow UNSAFE here.
16613 * modifiers.cs: Support unsafe reporting.
16615 2004-05-17 Marek Safar <marek.safar@seznam.cz>
16617 * decl.cs: Fix bug #58478.
16619 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16621 * statement.cs: When checking for unreachable code on an EmptyStatement,
16622 set the location. Fixes bug #58488.
16624 2004-05-13 Miguel de Icaza <miguel@ximian.com>
16626 * driver.cs: Add -pkg handling.
16628 From Gonzalo: UseShelLExecute=false
16630 2004-05-12 Marek Safar <marek.safar@seznam.cz>
16633 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
16635 (Attribute.IsClsCompliaceRequired): Moved to base for better
16637 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
16638 when attribute is AttributeUsageAttribute.
16639 (Attribute.GetValidTargets): Simplified.
16640 (Attribute.GetAttributeUsage): New method returns AttributeUsage
16641 attribute for this type.
16642 (Attribute.ApplyAttributes): Method renamed to Emit and make
16644 (GlobalAttributeSection): New class for special handling of global
16645 attributes (assembly, module).
16646 (AttributeSection.Emit): New method.
16648 * class.cs: Implemented Attributable abstract methods.
16649 (MethodCore.LabelParameters): Moved to Parameter class.
16650 (Accessor): Is back simple class.
16651 (PropertyMethod): Implemented Attributable abstract class.
16652 (DelegateMethod): Implemented Attributable abstract class.
16653 (Event): New constructor for disctintion between normal Event
16654 and Event with accessors.
16656 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
16658 * codegen.cs, const.cs, decl.cs, delegate.cs:
16659 (CommonAssemblyModulClass): Implemented Attributable abstract class
16662 * enum.cs: Implement IAttributeSupport interface.
16663 (EnumMember): New class for emum members. Implemented Attributable
16667 (ParameterBase): Is abstract.
16668 (ReturnParameter): New class for easier [return:] attribute handling.
16670 * typemanager.cs: Removed builder_to_attr.
16672 2004-05-11 Raja R Harinath <rharinath@novell.com>
16675 * attribute.cs (Attribute.GetPositionalValue): New function.
16676 * class.cs (TypeContainer.VerifyMembers): New function.
16677 (TypeContainer.Emit): Use it.
16678 (ClassOrStruct): New base class for Class and Struct.
16679 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
16680 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
16682 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
16683 then each non-static field should have a FieldOffset attribute.
16684 Otherwise, none of the fields should have a FieldOffset attribute.
16685 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
16686 and FieldOffset attributes.
16687 * typemanager.cs (TypeManager.struct_layout_attribute_type)
16688 (TypeManager.field_offset_attribute_type): New core types.
16689 (TypeManager.InitCoreTypes): Initialize them.
16691 2004-05-11 Michal Moskal <malekith@pld-linux.org>
16693 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
16694 Return correct type.
16697 2004-05-09 Miguel de Icaza <miguel@ximian.com>
16699 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
16700 be implicitly converted to ulong.
16702 * expression.cs: The logic for allowing operator &, | and ^ worked
16703 was wrong, it worked before because we did not report an error in
16704 an else branch. Fixes 57895.
16706 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
16707 allow volatile fields to be reference types.
16709 2004-05-07 Miguel de Icaza <miguel@ximian.com>
16711 * driver.cs: Add support for /debug-
16713 2004-05-07 Raja R Harinath <rharinath@novell.com>
16715 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
16716 Add a 'complain' parameter to silence errors.
16717 (Attribute.Resolve): Update to changes. Put in sanity check to catch
16718 silently overlooked type-resolutions.
16719 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
16720 to reflect changes.
16721 (Attributes.Search): New function.
16722 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
16723 (Attributes.GetAttributeFullName): Remove hack.
16724 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
16725 Update to reflect changes.
16726 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16727 Use Attributes.Search instead of nested loops.
16729 2004-05-07 Marek Safar <marek.safar@seznam.cz>
16732 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
16733 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
16734 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
16736 * report.cs: (Report.Warning): Renamed to Warning_T because of
16737 parameter collision.
16739 2004-05-05 Raja R Harinath <rharinath@novell.com>
16741 * expression.cs (MemberAccess.ResolveMemberAccess):
16742 Exit with non-zero status after Report.Error.
16743 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
16745 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
16747 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
16749 * support.cs: Don't hang when the file is empty.
16751 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
16753 * support.cs: In SeekableStreamReader, compute the preamble size of the
16754 underlying stream. Position changes should take into account that initial
16757 2004-05-03 Todd Berman <tberman@sevenl.net>
16759 * driver.cs: remove unused GetSysVersion function.
16761 2004-05-03 Todd Berman <tberman@sevenl.net>
16763 * driver.cs: Remove the hack from saturday, as well as the hack
16764 from jackson (LoadAssemblyFromGac), also adds the CWD to the
16765 link_paths to get that bit proper.
16767 2004-05-01 Todd Berman <tberman@sevenl.net>
16769 * driver.cs: Try a LoadFrom before a Load, this checks the current
16770 path. This is currently a bug in mono that is be fixed, however, this
16771 provides a workaround for now. This will be removed when the bug
16774 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
16776 * CryptoConvert.cs: Updated to latest version. Fix issue with
16777 incomplete key pairs (#57941).
16779 2004-05-01 Todd Berman <tberman@sevenl.net>
16781 * driver.cs: Remove '.' from path_chars, now System.* loads properly
16784 2004-04-30 Jackson Harper <jackson@ximian.com>
16786 * codegen.cs: Open keys readonly.
16788 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16790 * typemanager.cs: don't report cyclic struct layout when a struct
16791 contains 2 or more fields of the same type. Failed for Pango.AttrShape
16792 which has 2 Pango.Rectangle fields.
16794 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
16796 * expression.cs: Handle IntPtr comparisons with IL code
16797 rather than a method call.
16799 2004-04-29 Martin Baulig <martin@ximian.com>
16801 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
16802 the list of PropertyInfo's in class hierarchy and find the
16803 accessor. Fixes #56013.
16805 2004-04-29 Martin Baulig <martin@ximian.com>
16807 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
16809 2004-04-29 Martin Baulig <martin@ximian.com>
16811 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16813 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
16815 2004-04-29 Martin Baulig <martin@ximian.com>
16817 * class.cs (ConstructorInitializer.Resolve): Check whether the
16818 parent .ctor is accessible. Fixes #52146.
16820 2004-04-29 Martin Baulig <martin@ximian.com>
16822 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16824 * statement.cs (Using.EmitLocalVariableDecls): Use
16825 TypeManager.idisposable_type, not typeof (IDisposable).
16826 (Foreach.EmitCollectionForeach): Added support for valuetypes.
16828 2004-04-29 Martin Baulig <martin@ximian.com>
16830 * class.cs (Event.Define): Don't emit the field and don't set
16831 RTSpecialName and SpecialName for events on interfaces. Fixes
16834 2004-04-29 Raja R Harinath <rharinath@novell.com>
16836 Refactor Attribute.ApplyAttributes.
16837 * attribute.cs (Attributable): New base class for objects that can
16838 have Attributes applied on them.
16839 (Attribute): Make AttributeUsage fields public.
16840 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
16841 (Attribute.IsInternalCall): New property.
16842 (Attribute.UsageAttr): Convert to a public read-only property.
16843 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
16844 (Attribute.ResolveType, Attribute.Resolve)
16845 (Attribute.ScanForIndexerName): Update to reflect changes.
16846 (Attribute.CheckAttributeTarget): Re-format.
16847 (Attribute.ApplyAttributes): Refactor, to various
16848 Attributable.ApplyAttributeBuilder methods.
16849 * decl.cs (MemberCore): Make Attributable.
16850 * class.cs (Accessor): Make Attributable.
16851 (MethodData.ApplyAttributes): Use proper attribute types, not
16853 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
16854 (TypeContainer.ApplyAttributeBuilder)
16855 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
16856 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
16857 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
16858 (Operator.ApplyAttributeBuilder): New factored-out methods.
16859 * const.cs (Const.ApplyAttributeBuilder): Likewise.
16860 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
16861 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
16862 * parameter.cs (ParameterBase): New Attributable base class
16863 that can also represent Return types.
16864 (Parameter): Update to the changes.
16866 2004-04-29 Jackson Harper <jackson@ximian.com>
16868 * driver.cs: Prefer the corlib system version when looking for
16869 assemblies in the GAC. This is still a hack, but its a better hack
16872 2004-04-29 Marek Safar <marek.safar@seznam.cz>
16874 * decl.cs, enum.cs: Improved error 3005 reporting.
16876 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
16877 (related_symbols): New private member for list of symbols
16878 related to reported error/warning.
16880 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
16882 2004-04-29 Martin Baulig <martin@ximian.com>
16884 * ecore.cs (Expression.Constantify): If we're an enum and
16885 TypeManager.TypeToCoreType() doesn't give us another type, use
16886 t.UnderlyingSystemType. Fixes #56178.
16888 2004-04-29 Martin Baulig <martin@ximian.com>
16890 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
16891 interfaces and for each interface, only add members directly
16892 declared in that interface. Fixes #53255.
16894 2004-04-28 Martin Baulig <martin@ximian.com>
16896 * expression.cs (ConditionalLogicalOperator): Use a temporary
16897 variable for `left' to avoid that we evaluate it more than once;
16900 2004-04-28 Martin Baulig <martin@ximian.com>
16902 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
16905 2004-04-28 Martin Baulig <martin@ximian.com>
16907 * statement.cs (LocalInfo.Resolve): Check whether the type is not
16910 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
16911 whether the type is not void (CS1547).
16913 2004-04-28 Martin Baulig <martin@ximian.com>
16915 * expression.cs (Unary.DoResolveLValue): Override this and report
16916 CS0131 for anything but Operator.Indirection.
16918 2004-04-28 Martin Baulig <martin@ximian.com>
16920 Committing a patch from Ben Maurer; see bug #50820.
16922 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16925 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16928 2004-04-28 Martin Baulig <martin@ximian.com>
16930 Committing a patch from Ben Maurer; see bug #50820.
16932 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16935 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16938 2004-04-28 Martin Baulig <martin@ximian.com>
16940 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
16941 (Block.AddLabel): Call DoLookupLabel() to only search in the
16944 2004-04-28 Martin Baulig <martin@ximian.com>
16946 * cfold.cs (ConstantFold.BinaryFold): Added special support for
16947 comparing StringConstants and NullLiterals in Equality and Inequality.
16949 2004-04-28 Jackson Harper <jackson@ximian.com>
16951 * driver.cs: Attempt to load referenced assemblies from the
16952 GAC. This is the quick and dirty version of this method that
16953 doesnt take into account versions and just takes the first
16954 canidate found. Will be good enough for now as we will not have more
16955 then one version installed into the GAC until I update this method.
16957 2004-04-28 Martin Baulig <martin@ximian.com>
16959 * typemanager.cs (TypeManager.CheckStructCycles): New public
16960 static method to check for cycles in the struct layout.
16962 * rootcontext.cs (RootContext.PopulateTypes): Call
16963 TypeManager.CheckStructCycles() for each TypeContainer.
16964 [Note: We only need to visit each type once.]
16966 2004-04-28 Martin Baulig <martin@ximian.com>
16968 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
16970 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
16971 success and added `out object value'. Use a `bool resolved' field
16972 to check whether we've already been called rather than
16973 `ConstantValue != null' since this breaks for NullLiterals.
16975 2004-04-28 Raja R Harinath <rharinath@novell.com>
16977 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
16978 setting of this flag, since the 'set' method may be non-public.
16980 2004-04-28 Raja R Harinath <rharinath@novell.com>
16982 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
16983 check on current_vector.Block.
16985 2004-04-27 Martin Baulig <martin@ximian.com>
16987 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
16988 a field initializer. Fixes #56459.
16990 2004-04-27 Martin Baulig <martin@ximian.com>
16992 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
16993 we're not attempting to use an indexer. Fixes #52154.
16995 2004-04-27 Martin Baulig <martin@ximian.com>
16997 * statement.cs (Return): Don't create a return label if we don't
16998 need it; reverts my change from January 20th. Thanks to Ben
17001 2004-04-27 Martin Baulig <martin@ximian.com>
17003 According to the spec, `goto' can only leave a nested scope, but
17006 * statement.cs (Block.LookupLabel): Only lookup in the current
17007 block, don't recurse into parent or child blocks.
17008 (Block.AddLabel): Check in parent and child blocks, report
17009 CS0140/CS0158 if we find a duplicate.
17010 (Block): Removed this indexer for label lookups.
17011 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
17012 this already does the error reporting for us.
17015 (FlowBranching.UsageVector.Block): New public variable; may be null.
17016 (FlowBranching.CreateSibling): Added `Block' argument.
17017 (FlowBranching.LookupLabel): New public virtual method. Lookup a
17018 label for the target of a `goto' and check whether we're not
17019 leaving a `finally'.
17021 2004-04-27 Martin Baulig <martin@ximian.com>
17023 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17024 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
17027 2004-04-27 Martin Baulig <martin@ximian.com>
17029 * statement.cs (Block.AddLabel): Also check for implicit blocks
17030 and added a CS0158 check.
17032 2004-04-27 Martin Baulig <martin@ximian.com>
17034 * flowanalysis.cs (FlowBranchingLoop): New class.
17035 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
17036 UsageVector's instead of an ArrayList.
17037 (FlowBranching.Label): Likewise.
17038 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
17039 (FlowBranching.AddBreakVector): New method.
17041 2004-04-27 Miguel de Icaza <miguel@ximian.com>
17043 * attribute.cs: Small regression fix: only convert the type if we
17044 the type is different, fixes System.Drawing build.
17046 2004-04-27 Martin Baulig <martin@ximian.com>
17048 * attribute.cs (Attribute.Resolve): If we have a constant value
17049 for a named field or property, implicity convert it to the correct
17052 2004-04-27 Raja R Harinath <rharinath@novell.com>
17054 * statement.cs (Block.Block): Implicit blocks share
17055 'child_variable_names' fields with parent blocks.
17056 (Block.AddChildVariableNames): Remove.
17057 (Block.AddVariable): Mark variable as "used by a child block" in
17058 every surrounding block.
17059 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
17060 been used in a child block, complain about violation of "Invariant
17061 meaning in blocks" rule.
17062 * cs-parser.jay (declare_local_variables): Don't use
17063 AddChildVariableNames.
17064 (foreach_statement): Don't create an implicit block: 'foreach'
17065 introduces a scope.
17067 2004-04-23 Miguel de Icaza <miguel@ximian.com>
17069 * convert.cs (ImplicitNumericConversion): 0 is also positive when
17070 converting from 0L to ulong. Fixes 57522.
17072 2004-04-22 Marek Safar <marek.safar@seznam.cz>
17074 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
17075 derived class hides via 'new' keyword field from base class (test-242.cs).
17076 TODO: Handle this in the more general way.
17078 * class.cs (CheckBase): Ditto.
17080 2004-04-22 Marek Safar <marek.safar@seznam.cz>
17082 * decl.cs (caching_flags): New member for storing cached values
17084 (MemberCore.Flags): New enum where bit flags for caching_flags
17086 (MemberCore.cls_compliance): Moved to caching_flags.
17087 (DeclSpace.Created): Moved to caching_flags.
17089 * class.cs: Use caching_flags instead of DeclSpace.Created
17091 2004-04-21 Miguel de Icaza <miguel@ximian.com>
17093 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
17094 if we are only a derived class, not a nested class.
17096 * typemanager.cs: Same as above, but do this at the MemberLookup
17097 level (used by field and methods, properties are handled in
17098 PropertyExpr). Allow for the qualified access if we are a nested
17101 2004-04-21 Marek Safar <marek.safar@seznam.cz>
17103 * class.cs: Refactoring.
17104 (IMethodData): New inteface; Holds links to parent members
17105 to avoid member duplication (reduced memory allocation).
17106 (Method): Implemented IMethodData interface.
17107 (PropertyBase): New inner classes for get/set methods.
17108 (PropertyBase.PropertyMethod): Implemented IMethodData interface
17109 (Event): New inner classes for add/remove methods.
17110 (Event.DelegateMethod): Implemented IMethodData interface.
17112 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
17113 EmitContext (related to class.cs refactoring).
17115 2004-04-21 Raja R Harinath <rharinath@novell.com>
17117 * delegate.cs (Delegate.VerifyApplicability): If the number of
17118 arguments are the same as the number of parameters, first try to
17119 verify applicability ignoring any 'params' modifier on the last
17123 2004-04-16 Raja R Harinath <rharinath@novell.com>
17125 * class.cs (TypeContainer.AddIndexer): Use
17126 'ExplicitInterfaceName' to determine if interface name was
17127 explicitly specified. 'InterfaceType' is not initialized at this time.
17128 (TypeContainer.DefineIndexers): Remove use of temporary list. The
17129 Indexers array is already in the required order. Initialize
17130 'IndexerName' only if there are normal indexers.
17131 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
17132 (TypeContainer.Emit): Emit DefaultMember attribute only if
17133 IndexerName is initialized.
17136 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
17138 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
17141 2004-04-15 Raja R Harinath <rharinath@novell.com>
17143 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
17147 * attribute.cs (Attribute.Resolve): Check for duplicate named
17151 2004-04-15 Miguel de Icaza <miguel@ximian.com>
17153 * iterators.cs (MarkYield): track whether we are in an exception,
17154 and generate code accordingly. Use a temporary value to store the
17155 result for our state.
17157 I had ignored a bit the interaction of try/catch with iterators
17158 since their behavior was not entirely obvious, but now it is
17159 possible to verify that our behavior is the same as MS .NET 2.0
17163 2004-04-14 Miguel de Icaza <miguel@ximian.com>
17165 * iterators.cs: Avoid creating temporaries if there is no work to
17168 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
17169 Enumerations, use TypeManager.EnumToUnderlying and call
17172 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
17175 (This.Emit): Use EmitContext.EmitThis to emit our
17178 (This.EmitAssign): Ditto.
17180 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
17181 codepaths, we will move all the functionality into
17184 (FieldExpr.EmitAssign): Ditto.
17186 This fixes several hidden bugs that I uncovered while doing a code
17187 review of this today.
17189 * codegen.cs (EmitThis): reworked so the semantics are more clear
17190 and also support value types "this" instances.
17192 * iterators.cs: Changed so that for iterators in value types, we
17193 do not pass the value type as a parameter.
17195 Initialization of the enumerator helpers is now done in the caller
17196 instead of passing the parameters to the constructors and having
17197 the constructor set the fields.
17199 The fields have now `assembly' visibility instead of private.
17201 2004-04-11 Miguel de Icaza <miguel@ximian.com>
17203 * expression.cs (Argument.Resolve): Check if fields passed as ref
17204 or out are contained in a MarshalByRefObject.
17206 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
17207 another compiler type.
17209 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
17211 * class.cs (Indexer.Define): use the new name checking method.
17212 Also, return false on an error.
17213 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
17214 (is_identifier_[start/part]_character): make static.
17216 2004-04-10 Miguel de Icaza <miguel@ximian.com>
17218 * expression.cs (Binary.ResolveOperator): Do no append strings
17219 twice: since we can be invoked more than once (array evaluation)
17220 on the same concatenation, take care of this here. Based on a fix
17221 from Ben (bug #56454)
17223 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
17225 * codegen.cs: Fix another case where CS1548 must be reported (when
17226 delay-sign isn't specified and no private is available #56564). Fix
17227 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
17228 error when MCS is used on the MS runtime and we need to delay-sign
17229 (which seems unsupported by AssemblyBuilder - see #56621).
17231 2004-04-08 Marek Safar <marek.safar@seznam.cz>
17233 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
17234 (TypeManager.ComputeNamespaces): Faster implementation for
17237 * compiler.csproj: Updated AssemblyName to mcs.
17239 2004-04-07 Miguel de Icaza <miguel@ximian.com>
17241 * rootcontext.cs: Add new types to the boot resolution.
17243 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
17244 MulticastDelegate is not allowed.
17246 * typemanager.cs: Add new types to lookup: System.TypedReference
17249 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
17250 check for TypedReference or ArgIterator, they are not allowed.
17252 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
17253 makes us properly catch 1510 in some conditions (see bug 56016 for
17256 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
17258 * CryptoConvert.cs: update from corlib version
17261 2004-04-05 Miguel de Icaza <miguel@ximian.com>
17263 * class.cs (Indexer.Define): Check indexername declaration
17265 2004-04-05 Marek Safar <marek.safar@seznam.cz>
17267 * attribute.cs (IsClsCompliant): Fixed problem with handling
17268 all three states (compliant, not-compliant, undetected).
17270 2004-03-30 Marek Safar <marek.safar@seznam.cz>
17272 * attribute.cs (Attribute): Location is now public.
17273 (Resolve): Store resolved arguments (pos_values) in attribute class.
17274 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
17275 (GetClsCompliantAttributeValue): New method that gets
17276 CLSCompliantAttribute value.
17277 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
17278 if exists else null.
17279 (AttributeTester): New class for CLS-Compliant verification routines.
17281 * class.cs (Emit): Add CLS-Compliant verification.
17282 (Method.GetSignatureForError): Implemented.
17283 (Constructor.GetSignatureForError): Implemented
17284 (Constructor.HasCompliantArgs): Returns if constructor has
17285 CLS-Compliant arguments.
17286 (Constructor.Emit): Override.
17287 (Construcor.IsIdentifierClsCompliant): New method; For constructors
17288 is needed to test only parameters.
17289 (FieldBase.GetSignatureForError): Implemented.
17290 (TypeContainer): New member for storing base interfaces.
17291 (TypeContainer.FindMembers): Search in base interfaces too.
17293 * codegen.cs (GetClsComplianceAttribute): New method that gets
17294 assembly or module CLSCompliantAttribute value.
17295 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
17297 (ModuleClass.Emit): Add error 3012 test.
17299 * const.cs (Emit): Override and call base for CLS-Compliant tests.
17301 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
17302 state for all decl types.
17303 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
17304 if CLS-Compliant tests are required.
17305 (IsClsCompliaceRequired): New method. Analyze whether code
17306 must be CLS-Compliant.
17307 (IsExposedFromAssembly): New method. Returns true when MemberCore
17308 is exposed from assembly.
17309 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
17310 value or gets cached value.
17311 (HasClsCompliantAttribute): New method. Returns true if MemberCore
17312 is explicitly marked with CLSCompliantAttribute.
17313 (IsIdentifierClsCompliant): New abstract method. This method is
17314 used to testing error 3005.
17315 (IsIdentifierAndParamClsCompliant): New method. Common helper method
17316 for identifier and parameters CLS-Compliant testing.
17317 (VerifyClsCompliance): New method. The main virtual method for
17318 CLS-Compliant verifications.
17319 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
17320 null. I don't know why is null (too many public members !).
17321 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
17322 and get value of first CLSCompliantAttribute that found.
17324 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
17325 (VerifyClsCompliance): Override and add extra tests.
17327 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
17328 clscheck- disable CLS-Compliant verification event if assembly is has
17329 CLSCompliantAttribute(true).
17331 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
17332 ApllyAttribute is now called in emit section as in the other cases.
17333 Possible future Emit integration.
17334 (IsIdentifierClsCompliant): New override.
17335 (VerifyClsCompliance): New override.
17336 (GetEnumeratorName): Returns full enum name.
17338 * parameter.cs (GetSignatureForError): Implemented.
17340 * report.cs (WarningData): New struct for Warning message information.
17341 (LocationOfPreviousError): New method.
17342 (Warning): New method. Reports warning based on the warning table.
17343 (Error_T): New method. Reports error based on the error table.
17345 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
17346 verifications are done here.
17348 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
17350 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
17351 CLSCompliantAttribute.
17352 (all_imported_types): New member holds all imported types from other
17354 (LoadAllImportedTypes): New method fills static table with exported types
17355 from all referenced assemblies.
17356 (Modules): New property returns all assembly modules.
17358 2004-03-30 Miguel de Icaza <miguel@ximian.com>
17360 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
17361 throwing a parser error.
17363 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
17364 which removes the hardcoded get_/set_ prefixes for properties, as
17365 IL allows for the properties to be named something else.
17369 * expression.cs: Do not override operand before we know if it is
17370 non-null. Fix 56207
17372 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17374 * typemanager.cs: support for pinned variables.
17376 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17378 * decl.cs, typemanager.cs: Avoid using an arraylist
17379 as a buffer if there is only one result set.
17381 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17383 * expression.cs: Make sure you cant call a static method
17384 with an instance expression, bug #56174.
17386 2004-03-29 Miguel de Icaza <miguel@ximian.com>
17388 * class.cs (IsDuplicateImplementation): Improve error reporting to
17389 flag 663 (method only differs in parameter modifier).
17391 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
17392 in preprocessor directives.
17394 * location.cs (LookupFile): Allow for the empty path.
17396 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
17397 better approach for some of that patch, but its failing with the
17398 CharSet enumeration. For now try/catch will do.
17400 * typemanager.cs: Do not crash if a struct does not have fields.
17403 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17405 * expression.cs: cs0213, cant fix a fixed expression.
17408 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17410 * cs-parser.jay: detect invalid embeded statements gracefully.
17413 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17415 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
17418 the invocation type may not be a subclass of the tye of the item/
17419 The type of the item must be a subclass of the invocation item.
17424 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
17426 * attribute.cs: Added methods to get a string and a bool from an
17427 attribute. Required to information from AssemblyKeyFileAttribute,
17428 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
17429 * codegen.cs: Modified AssemblyName creation to include support for
17430 strongnames. Catch additional exceptions to report them as CS1548.
17431 * compiler.csproj: Updated include CryptoConvert.cs.
17432 * compiler.csproj.user: Removed file - user specific configuration.
17433 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
17434 Mono.Security assembly. The original class is maintained and tested in
17435 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
17436 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
17437 like CSC 8.0 (C# v2) supports.
17438 * Makefile: Added CryptoConvert.cs to mcs sources.
17439 * rootcontext.cs: Added new options for strongnames.
17441 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
17443 * driver.cs: For --expect-error, report error code `2'
17444 if the program compiled with no errors, error code `1' if
17445 it compiled with an error other than the one expected.
17447 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
17449 * compiler.csproj: Updated for Visual Studio .NET 2003.
17450 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
17451 * compiler.sln: Updated for Visual Studio .NET 2003.
17453 2004-03-24 Ravi Pratap M <ravi@ximian.com>
17455 * expression.cs: Fix bug #47234. We basically need to apply the
17456 rule that we prefer the conversion of null to a reference type
17457 when faced with a conversion to 'object' (csc behaviour).
17459 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17461 * statement.cs: Shorter form for foreach, eliminates
17462 a local variable. r=Martin.
17464 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17466 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
17467 checks if we can use brtrue/brfalse to test for 0.
17468 * expression.cs: use the above in the test for using brtrue/brfalse.
17469 cleanup code a bit.
17471 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17473 * expression.cs: Rewrite string concat stuff. Benefits:
17475 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
17476 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
17477 rather than a concat chain.
17479 * typemanager.cs: Add lookups for more concat overloads.
17481 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17483 * expression.cs: Emit shorter il code for array init.
17500 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
17502 * statement.cs: Before, two switch blocks would be merged if the
17503 total size of the blocks (end_item - begin_item + 1) was less than
17504 two times the combined sizes of the blocks.
17506 Now, it will only merge if after the merge at least half of the
17511 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
17513 * class.cs : csc build fix for GetMethods(). See bug #52503.
17515 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
17517 * expression.cs: Make sure fp comparisons work with NaN.
17518 This fixes bug #54303. Mig approved this patch a long
17519 time ago, but we were not able to test b/c the runtime
17522 2004-03-19 Miguel de Icaza <miguel@ximian.com>
17524 * ecore.cs (TypExpr.GetHashCode): implement this overload.
17526 2004-03-19 Martin Baulig <martin@ximian.com>
17528 * class.cs (MemberCore.IsDuplicateImplementation): Report the
17529 error here and not in our caller.
17531 2004-03-19 Martin Baulig <martin@ximian.com>
17533 * interface.cs: Completely killed this file.
17534 (Interface): We're now a TypeContainer and live in class.cs.
17536 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
17537 argument; we're now also called for interfaces.
17538 (TypeContainer.DefineMembers): Allow this method being called
17540 (TypeContainer.GetMethods): New public method; formerly known as
17541 Interface.GetMethod(). This is used by PendingImplementation.
17542 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
17543 it's now private and non-static.
17544 (Interface): Moved this here; it's now implemented similar to
17546 (Method, Property, Event, Indexer): Added `bool is_interface'
17547 argument to their .ctor's.
17548 (MemberBase.IsInterface): New public field.
17550 * cs-parser.jay: Create normal Method, Property, Event, Indexer
17551 instances instead of InterfaceMethod, InterfaceProperty, etc.
17552 (opt_interface_base): Removed; we now use `opt_class_base' instead.
17553 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
17555 2004-03-19 Martin Baulig <martin@ximian.com>
17557 * class.cs (MethodCore.IsDuplicateImplementation): New private
17558 method which does the CS0111 checking.
17559 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
17560 Use IsDuplicateImplementation().
17562 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
17564 * decl.cs (FindMemberToOverride): New method to find the correct
17565 method or property to override in the base class.
17567 - Make Method/Property use the above method to find the
17568 version in the base class.
17569 - Remove the InheritableMemberSignatureCompare as it is now
17572 This patch makes large code bases much faster to compile, as it is
17573 O(n) rather than O(n^2) to do this validation.
17575 Also, it fixes bug 52458 which is that nested classes are not
17576 taken into account when finding the base class member.
17578 Reviewed/Approved by Martin.
17580 2004-03-17 Marek Safar <marek.safar@seznam.cz>
17582 * interface.cs: In all interface classes removed redundant
17583 member initialization.
17585 2004-03-16 Martin Baulig <martin@ximian.com>
17587 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
17589 2004-03-15 Miguel de Icaza <miguel@ximian.com>
17591 * decl.cs (DefineTypeAndParents): New helper method to define a
17592 type's containers before the type itself is defined; This is a
17593 bug exposed by the recent changes to Windows.Forms when an
17594 implemented interface was defined inside a class that had not been
17597 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
17599 (Check): Loop correctly to report errors modifiers
17600 (UNSAFE was not in the loop, since it was the same as TOP).
17602 * interface.cs: Every interface member now takes a ModFlags,
17603 instead of a "is_new" bool, which we set on the base MemberCore.
17605 Every place where we called "UnsafeOk" in the interface, now we
17606 call the proper member (InterfaceMethod.UnsafeOK) instead to get
17607 the unsafe settings from the member declaration instead of the
17608 container interface.
17610 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
17612 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
17613 `set_indexer_name' to the pending bits (one per type).
17615 We fixed a bug today that was picking the wrong method to
17616 override, since for properties the existing InterfaceMethod code
17617 basically ignored the method name. Now we make sure that the
17618 method name is one of the valid indexer names.
17620 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
17622 * support.cs (SeekableStreamReader): Keep track of stream byte
17623 positions and don't mix them with character offsets to the buffer.
17625 Patch from Gustavo Giráldez
17627 2004-03-15 Marek Safar <marek.safar@seznam.cz>
17629 * interface.cs (InterfaceSetGetBase): Removed double member
17630 initialization, base class does it as well.
17632 2004-03-13 Martin Baulig <martin@ximian.com>
17634 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
17635 when compiling corlib.
17637 2004-03-13 Miguel de Icaza <miguel@ximian.com>
17639 * convert.cs (ExplicitConversion): We were reporting an error on
17640 certain conversions (object_type source to a value type, when the
17641 expression was `null') before we had a chance to pass it through
17642 the user defined conversions.
17644 * driver.cs: Replace / and \ in resource specifications to dots.
17647 * class.cs: Add check for duplicate operators. Fixes 52477
17649 2004-03-11 Miguel de Icaza <miguel@ximian.com>
17651 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
17652 that are in the middle of the statements, not only at the end.
17655 * class.cs (TypeContainer.AddField): No longer set the
17656 `HaveStaticConstructor' flag, now we call it
17657 `UserDefineStaticConstructor' to diferentiate the slightly
17658 semantic difference.
17660 The situation is that we were not adding BeforeFieldInit (from
17661 Modifiers.TypeAttr) to classes that could have it.
17662 BeforeFieldInit should be set to classes that have no static
17667 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
17669 And most importantly Zoltan's comment:
17671 http://bugzilla.ximian.com/show_bug.cgi?id=44229
17673 "I think beforefieldinit means 'it's ok to initialize the type sometime
17674 before its static fields are used', i.e. initialization does not need
17675 to be triggered by the first access to the type. Setting this flag
17676 helps the JIT to compile better code, since it can run the static
17677 constructor at JIT time, and does not need to generate code to call it
17678 (possibly lots of times) at runtime. Unfortunately, mcs does not set
17679 this flag for lots of classes like String.
17681 csc sets this flag if the type does not have an explicit static
17682 constructor. The reasoning seems to be that if there are only static
17683 initalizers for a type, and no static constructor, then the programmer
17684 does not care when this initialization happens, so beforefieldinit
17687 This bug prevents the AOT compiler from being usable, since it
17688 generates so many calls to mono_runtime_class_init that the AOT code
17689 is much slower than the JITted code. The JITted code is faster,
17690 because it does not generate these calls if the vtable is type is
17691 already initialized, which is true in the majority of cases. But the
17692 AOT compiler can't do this."
17694 2004-03-10 Miguel de Icaza <miguel@ximian.com>
17696 * class.cs (MethodData.Emit): Refactor the code so symbolic
17697 information is generated for destructors; For some reasons we
17698 were taking a code path that did not generate symbolic information
17701 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
17703 * class.cs: Create a Constructor.CheckBase method that
17704 takes care of all validation type code. The method
17705 contains some code that was moved from Define.
17707 It also includes new code that checks for duplicate ctors.
17708 This fixes bug #55148.
17710 2004-03-09 Joshua Tauberer <tauberer@for.net>
17712 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
17713 a { ... }-style array creation invokes EmitStaticInitializers
17714 which is not good for reference-type arrays. String, decimal
17715 and now null constants (NullCast) are not counted toward
17716 static initializers.
17718 2004-03-05 Martin Baulig <martin@ximian.com>
17720 * location.cs (SourceFile.HasLineDirective): New public field;
17721 specifies whether the file contains or is referenced by a "#line"
17723 (Location.DefineSymbolDocuments): Ignore source files which
17724 either contain or are referenced by a "#line" directive.
17726 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
17728 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
17729 direct access to our parent, so check the method inline there.
17731 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
17733 * expression.cs (Invocation.EmitCall): Miguel's last commit
17734 caused a regression. If you had:
17739 In Foo the implict this would be null.
17741 2004-02-27 Miguel de Icaza <miguel@ximian.com>
17743 * expression.cs (Invocation.EmitCall): If the method is not
17744 virtual, do not emit a CallVirt to it, use Call.
17746 * typemanager.cs (GetFullNameSignature): Improve the method to
17747 cope with ".ctor" and replace it with the type name.
17749 * class.cs (ConstructorInitializer.Resolve): Now the method takes
17750 as an argument the ConstructorBuilder where it is being defined,
17751 to catch the recursive constructor invocations.
17753 2004-02-26 Miguel de Icaza <miguel@ximian.com>
17755 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
17756 routines to check if a type is an enumerable/enumerator allow
17757 classes that implement the IEnumerable or IEnumerator interfaces.
17759 * class.cs (Property, Operator): Implement IIteratorContainer, and
17760 implement SetYields.
17762 (Property.Define): Do the block swapping for get_methods in the
17763 context of iterators. We need to check if Properties also
17764 include indexers or not.
17766 (Operator): Assign the Block before invoking the
17767 OperatorMethod.Define, so we can trigger the Iterator code
17770 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
17771 Property and Operator classes are not created when we parse the
17772 declarator but until we have the block completed, so we use a
17773 singleton SimpleIteratorContainer.Simple to flag whether the
17774 SetYields has been invoked.
17776 We propagate this setting then to the Property or the Operator to
17777 allow the `yield' to function.
17779 2004-02-25 Marek Safar <marek.safar@seznam.cz>
17781 * codegen.cs: Implemented attribute support for modules.
17782 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
17783 Assembly/Module functionality.
17785 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
17786 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
17787 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
17789 2004-02-16 Marek Safar <marek.safar@seznam.cz>
17791 * interface.cs (FindMembers): The operation is performed on all base
17792 interfaces and not only on the first. It is required for future CLS Compliance patch.
17794 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
17796 * statement.cs, codegen.cs:
17797 This patch deals with patterns such as:
17799 public class List : IEnumerable {
17801 public MyEnumerator GetEnumerator () {
17802 return new MyEnumerator(this);
17805 IEnumerator IEnumerable.GetEnumerator () {
17809 public struct MyEnumerator : IEnumerator {
17814 Before, there were a few things we did wrong:
17815 1) we would emit callvirt on a struct, which is illegal
17816 2) we emited ldarg when we needed to emit ldarga
17817 3) we would mistakenly call the interface methods on an enumerator
17818 type that derived from IEnumerator and was in another assembly. For example:
17820 public class MyEnumerator : IEnumerator
17822 Would have the interface methods called, even if there were public impls of the
17823 method. In a struct, this lead to invalid IL code.
17825 2004-02-11 Marek Safar <marek.safar@seznam.cz>
17827 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
17830 * delegate.cs (Define): Fixed crash when delegate type is undefined.
17832 2004-02-11 Miguel de Icaza <miguel@ximian.com>
17834 * cs-parser.jay: Fix small regression: we were not testing V2
17835 compiler features correctly.
17837 * interface.cs: If the emit context is null, then create one
17839 2004-02-09 Marek Safar <marek.safar@seznam.cz>
17841 * decl.cs (GetSignatureForError): New virtual method to get full name
17842 for error messages.
17844 * attribute.cs (IAttributeSupport): New interface for attribute setting.
17845 Now it is possible to rewrite ApplyAttributes method to be less if/else.
17847 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
17848 Duplicated members and code in these classes has been removed.
17849 Better encapsulation in these classes.
17851 2004-02-07 Miguel de Icaza <miguel@ximian.com>
17853 * assign.cs (Assign.DoResolve): When dealing with compound
17854 assignments, there is a new rule in ECMA C# 2.4 (might have been
17855 there before, but it is documented here) that states that in:
17859 If b is of type int, and the `op' is a shift-operator, then the
17860 above is evaluated as:
17864 * expression.cs (Binary.ResolveOperator): Instead of testing for
17865 int/uint/long/ulong, try to implicitly convert to any of those
17866 types and use that in pointer arithmetic.
17868 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
17869 method to print information for from the type, not from the
17870 null-method we were given.
17872 2004-02-01 Duncan Mak <duncan@ximian.com>
17874 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
17875 parsing for cmd, fixes bug #53694.
17877 2004-02-04 Marek Safar <marek.safar@seznam.cz>
17879 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
17880 in the member name duplication tests. Property and operator name duplication
17881 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
17883 2004-02-03 Marek Safar <marek.safar@seznam.cz>
17885 * interface.cs (PopulateMethod): Fixed crash when interface method
17886 returns not existing type (error test cs0246-3.cs).
17888 2004-02-02 Ravi Pratap M <ravi@ximian.com>
17890 * cs-parser.jay (interface_accessors): Re-write actions to also
17891 store attributes attached to get and set methods. Fix spelling
17894 (inteface_property_declaration): Modify accordingly.
17896 (InterfaceAccessorInfo): New helper class to store information to pass
17897 around between rules that use interface_accessors.
17899 * interface.cs (Emit): Apply attributes on the get and set
17900 accessors of properties and indexers too.
17902 * attribute.cs (ApplyAttributes): Modify accordingly to use the
17903 right MethodBuilder when applying attributes to the get and set accessors.
17905 2004-01-31 Miguel de Icaza <miguel@ximian.com>
17907 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
17909 2004-01-26 Miguel de Icaza <miguel@ximian.com>
17911 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
17913 2004-01-25 Miguel de Icaza <miguel@ximian.com>
17915 * cs-parser.jay: Remove YIELD token, instead use the new grammar
17916 changes that treat `yield' specially when present before `break'
17917 or `return' tokens.
17919 * cs-tokenizer.cs: yield is no longer a keyword.
17921 2004-01-23 Marek Safar <marek.safar@seznam.cz>
17923 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
17924 setting for default constructors.
17925 For default constructors are almost every time set wrong Modifier. The
17926 generated IL code has been alright. But inside mcs this values was
17927 wrong and this was reason why several of my CLS Compliance tests
17930 2004-01-22 Martin Baulig <martin@ximian.com>
17932 * cs-parser.jay (namespace_or_type_name): Return an Expression,
17933 not a QualifiedIdentifier. This is what `type_name_expression'
17934 was previously doing.
17935 (type_name_expression): Removed; the code is now in
17936 `namespace_or_type_name'.
17937 (qualified_identifier): Removed, use `namespace_or_type_name'
17939 (QualifiedIdentifier): Removed this class.
17941 2004-01-22 Martin Baulig <martin@ximian.com>
17943 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
17944 not a string as alias name.
17946 2004-01-21 Miguel de Icaza <miguel@ximian.com>
17948 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
17949 #52730 bug, and instead compute correctly the need to use a
17950 temporary variable when requesting an address based on the
17951 static/instace modified of the field and the constructor.
17953 2004-01-21 Martin Baulig <martin@ximian.com>
17955 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
17956 class and namespace before looking up aliases. Fixes #52517.
17958 2004-01-21 Martin Baulig <martin@ximian.com>
17960 * flowanalysis.cs (UsageVector.Merge): Allow variables being
17961 assinged in a 'try'; fixes exception4.cs.
17963 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17964 * class.cs : Implemented parameter-less constructor for TypeContainer
17966 * decl.cs: Attributes are now stored here. New property OptAttributes
17968 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
17970 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
17972 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17974 * typemanager.cs (CSharpSignature): Now reports also inner class name.
17975 (CSharpSignature): New method for indexer and property signature.
17977 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17979 * pending.cs (IsVirtualFilter): Faster implementation.
17981 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17983 * typemanager.cs: Avoid inclusion of same assembly more than once.
17985 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17987 * cs-parser.jay: Fixed problem where the last assembly attribute
17988 has been applied also to following declaration (class, struct, etc.)
17990 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17992 * class.cs: Added error CS0538, CS0539 reporting.
17993 Fixed crash on Microsoft runtime when field type is void.
17995 * cs-parser.jay: Added error CS0537 reporting.
17997 * pending.cs: Added error CS0535 reporting.
17998 Improved error report for errors CS0536, CS0534.
18000 2004-01-20 Miguel de Icaza <miguel@ximian.com>
18002 Merge a few bits from the Anonymous Method MCS tree.
18004 * statement.cs (ToplevelBlock): New class for toplevel methods,
18005 will hold anonymous methods, lifted variables.
18007 * cs-parser.jay: Create toplevel blocks for delegates and for
18008 regular blocks of code.
18010 2004-01-20 Martin Baulig <martin@ximian.com>
18012 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
18013 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
18014 and `NeedExplicitReturn'; added `IsLastStatement'.
18015 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
18016 have a `ReturnLabel' or we're not unreachable.
18018 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
18019 child's reachability; don't just override ours with it. Fixes
18020 #58058 (lluis's example).
18021 (FlowBranching): Added public InTryOrCatch(), InCatch(),
18022 InFinally(), InLoop(), InSwitch() and
18023 BreakCrossesTryCatchBoundary() methods.
18025 * statement.cs (Return): Do all error checking in Resolve().
18026 Unless we are the last statement in a top-level block, always
18027 create a return label and jump to it.
18028 (Break, Continue): Do all error checking in Resolve(); also make
18029 sure we aren't leaving a `finally'.
18030 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
18031 statement in a top-level block.
18032 (Block.Flags): Added `IsDestructor'.
18033 (Block.IsDestructor): New public property.
18035 2004-01-20 Martin Baulig <martin@ximian.com>
18037 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
18039 2004-01-20 Martin Baulig <martin@ximian.com>
18041 * statement.cs (Statement.ResolveUnreachable): New public method.
18042 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
18043 (Block.Resolve): Resolve unreachable statements.
18045 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
18047 * expression.cs: We need to fix the case where we do
18048 not have a temp variable here.
18050 * assign.cs: Only expression compound assignments need
18051 temporary variables.
18053 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
18055 * flowanalysis.cs: Reduce memory allocation in a few ways:
18056 - A block with no variables should not allocate a bit
18058 - A method with no out parameters does not need any tracking
18059 for assignment of the parameters, so we need not allocate
18062 public readonly Type[] VariableTypes;
18063 public readonly string[] VariableNames;
18064 Are redundant. The data is already stored in the variable
18065 map, so we need not allocate another array for it.
18066 - We need to add alot of checks for if (params | locals) == null
18067 due to the first two changes.
18069 2004-01-18 Miguel de Icaza <miguel@ximian.com>
18071 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
18072 implement IMemoryLocation, we store a copy on a local variable and
18073 take the address of it. Patch from Benjamin Jemlich
18075 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
18076 to use a special "type_name_expression" rule which reduces the
18077 number of "QualifiedIdentifier" classes created, and instead
18078 directly creates MemberAccess expressions.
18080 2004-01-17 Miguel de Icaza <miguel@ximian.com>
18082 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
18083 that fixes #52853. Null literal assignment to ValueType
18085 * class.cs (MethodData.Emit): Instead of checking the name of the
18086 method to determine if its a destructor, create a new derived
18087 class from Method called Destructor, and test for that.
18089 * cs-parser.jay: Create a Destructor object instead of a Method.
18091 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
18095 2004-01-16 Miguel de Icaza <miguel@ximian.com>
18097 * expression.cs (Binary.ResolveOperator): Perform an implicit
18098 conversion from MethodGroups to their delegate types on the
18099 Addition operation.
18101 * delegate.cs: Introduce a new class DelegateCreation that is the
18102 base class for `NewDelegate' and `ImplicitDelegateCreation',
18103 factor some code in here.
18105 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
18106 conversion from MethodGroups to compatible delegate types.
18108 * ecore.cs (Expression.Resolve): Do not flag error 654
18109 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
18110 we allow conversions from MethodGroups to delegate types now.
18112 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
18113 assignments in v2 either.
18115 2004-01-10 Miguel de Icaza <miguel@ximian.com>
18117 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
18118 static read-only fields in ctors.
18120 Applied patch from Benjamin Jemlich
18122 * expression.cs (UnaryMutator): Avoid leaking local variables.
18124 2004-01-09 Miguel de Icaza <miguel@ximian.com>
18126 * cs-tokenizer.cs (IsCastToken): Allow the various native types
18127 here to return true, as they can be used like this:
18129 (XXX) int.MEMBER ()
18131 Fixed 49836 and all the other dups
18133 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
18135 * driver.cs: Implement /win32res and /win32icon.
18137 2004-01-08 Miguel de Icaza <miguel@ximian.com>
18139 * cs-parser.jay: Add a rule to improve error handling for the
18140 common mistake of placing modifiers after the type.
18142 2004-01-07 Miguel de Icaza <miguel@ximian.com>
18144 * cs-parser.jay (interface_event_declaration): Catch
18145 initialization of events on interfaces, and report cs0068
18147 * cs-parser.jay (interface_event_declaration): Catch
18148 initialization of events.
18150 * ecore.cs: Better report missing constructors.
18152 * expression.cs (Binary.ResolveOperator): My previous bug fix had
18153 the error reporting done in the wrong place. Fix.
18155 * expression.cs (Binary.ResolveOperator): Catch the
18156 operator + (E x, E y) error earlier, and later allow for implicit
18157 conversions in operator +/- (E e, U x) from U to the underlying
18160 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
18161 52596, if the container class is abstract, the default constructor
18162 is protected otherwise its public (before, we were always public).
18164 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
18167 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
18168 Jemlich that fixes bug #52597, MCS was generating invalid code for
18169 idisposable structs. Thanks to Ben for following up with this
18172 2004-01-06 Miguel de Icaza <miguel@ximian.com>
18174 * driver.cs: Allow assemblies without code to be generated, fixes
18177 2004-01-07 Nick Drochak <ndrochak@gol.com>
18179 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
18181 2004-01-05 Miguel de Icaza <miguel@ximian.com>
18183 * cs-parser.jay: Add rules to improve error reporting if fields or
18184 methods are declared at the namespace level (error 116)
18186 * Add rules to catch event add/remove
18188 2004-01-04 David Sheldon <dave-mono@earth.li>
18190 * expression.cs: Added matching ")" to error message for
18193 2004-01-03 Todd Berman <tberman@gentoo.org>
18195 * ecore.cs, attribute.cs:
18196 Applying fix from #52429.
18198 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18200 * ecore.cs, expression.cs, statement.cs:
18201 Total rewrite of how we handle branching. We
18202 now handle complex boolean expressions with fewer
18203 jumps. As well if (x == 0) no longer emits a ceq.
18205 if (x is Foo) is much faster now, because we generate
18208 Overall, we get a pretty big improvement on our benchmark
18209 tests. The code we generate is smaller and more readable.
18211 I did a full two-stage bootstrap. The patch was reviewed
18212 by Martin and Miguel.
18214 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18216 * cs-parser.jay: Make primary_expression not take a QI.
18217 we dont need this because the member_access rule covers
18218 us here. So we replace the rule with just IDENTIFIER.
18220 This has two good effects. First, we remove a s/r conflict.
18221 Second, we allocate many fewer QualifiedIdentifier objects.
18223 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18225 * attribute.cs: Handle MarshalAs attributes as pseudo, and
18226 set the correct information via SRE. This prevents
18227 hanging on the MS runtime. Fixes #29374.
18229 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18231 * convert.cs: correctly handle conversions to value types
18232 from Enum and ValueType as unboxing conversions.
18234 Fixes bug #52569. Patch by Benjamin Jemlich.
18236 2004-01-02 Ravi Pratap <ravi@ximian.com>
18238 * expression.cs (BetterConversion): Prefer int -> uint
18239 over int -> ulong (csc's behaviour). This fixed bug #52046.
18241 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
18243 * decl.cs (MemberCache.FindMembers): now returns a
18246 * typemanager.cs: In general, go with with ^^.
18247 (CopyNewMethods): take an IList.
18248 (RealMemberLookup): Only allocate an arraylist
18249 if we copy from two sets of methods.
18251 This change basically does two things:
18252 1) Fewer array lists allocated due to CopyNewMethods.
18253 2) the explicit cast in MemberList costed ALOT.
18255 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
18257 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
18258 a hashtable to avoid needless string allocations when an identifier is
18259 used more than once (the common case).
18261 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
18263 * pending.cs: MS's TypeBuilder.GetInterfaces ()
18264 is broken, it will not return anything. So, we
18265 have to use the information we have in mcs to
18268 * typemanager.cs: Add a cache for GetInterfaces,
18269 since this will now be used more often (due to ^^)
18271 (GetExplicitInterfaces) New method that gets the
18272 declared, not effective, interfaces on a type
18273 builder (eg, if you have interface IFoo, interface
18274 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
18277 This patch makes MCS able to bootstrap itself on
18280 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
18282 * expression.cs: Remove the Nop's that Miguel put
18285 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18287 * report.cs, codegen.cs: Give the real stack trace to
18288 the error when an exception is thrown.
18290 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18292 * decl.cs: only allocate hashtables for ifaces if
18295 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18297 * expression.cs: fix the error from cs0121-2.cs
18298 (a parent interface has two child interfaces that
18299 have a function with the same name and 0 params
18300 and the function is called through the parent).
18302 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
18304 * class.cs, rootcontext.cs, typmanager.cs: do not
18307 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
18309 * codegen.cs: remove stack for the ec flow branching.
18310 It is already a linked list, so no need.
18312 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
18314 * Makefile: Allow custom profiler here.
18316 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
18318 * typemanager.cs (LookupType):
18319 - Use a static char [], because split takes
18320 a param array for args, so it was allocating
18322 - Do not store true in a hashtable, it boxes.
18324 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
18326 * flowanalysis.cs: bytify common enums.
18328 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18330 * modifiers.cs: Add a new set of flags for the
18331 flags allowed on explicit interface impls.
18332 * cs-parser.jay: catch the use of modifiers in
18333 interfaces correctly.
18334 * class.cs: catch private void IFoo.Blah ().
18336 All related to bug #50572.
18338 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18340 * decl.cs: Rewrite the consistant accessability checking.
18341 Accessability is not linear, it must be implemented in
18342 a tableish way. Fixes #49704.
18344 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18346 * expression.cs: Handle negation in a checked context.
18347 We must use subtraction from zero. Fixes #38674.
18349 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
18351 * class.cs: Ignore static void main in DLLs.
18352 * rootcontext.cs: Handle the target type here,
18353 since we are have to access it from class.cs
18354 * driver.cs: account for the above.
18356 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
18358 * report.cs: Give line numbers and files if available.
18360 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
18362 * driver.cs: Implement /addmodule.
18364 * typemanager.cs: Change 'modules' field so it now contains Modules not
18367 2003-12-20 Martin Baulig <martin@ximian.com>
18369 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
18370 (FieldBase.IsAssigned): Removed this field.
18371 (FieldBase.SetAssigned): New public method.
18372 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
18374 2003-12-20 Martin Baulig <martin@ximian.com>
18376 * expression.cs (LocalVariableReference.DoResolve): Don't set
18377 `vi.Used' if we're called from DoResolveLValue().
18379 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
18380 returns the usage vector it just merged into the current one -
18381 pass this one to UsageWarning().
18382 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
18383 of the `EmitContext', don't call this recursively on our children.
18385 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
18387 * driver.cs: Implement /target:module.
18389 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
18391 * support.cs (CharArrayHashtable): New helper class.
18393 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
18394 char arrays, not strings, so we can avoid creating a string in
18395 consume_identifier if the identifier is a keyword.
18397 2003-12-16 Martin Baulig <martin@ximian.com>
18399 * statement.cs (LocalInfo.Assigned): Removed this property.
18400 (LocalInfo.Flags): Removed `Assigned'.
18401 (LocalInfo.IsAssigned): New public method; takes the EmitContext
18402 and uses flow analysis.
18403 (Block.UsageWarning): Made this method private.
18404 (Block.Resolve): Call UsageWarning() if appropriate.
18406 * expression.cs (LocalVariableReference.DoResolve): Always set
18407 LocalInfo.Used here.
18409 2003-12-13 Martin Baulig <martin@ximian.com>
18411 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
18412 any value here; we're now using flow analysis to figure out
18413 whether a statement/block returns a value.
18415 2003-12-13 Martin Baulig <martin@ximian.com>
18417 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
18419 (FlowBranching.MergeFinally): Don't call
18420 `branching.CheckOutParameters()' here, this is called in
18422 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
18423 when adding the `finally' vector.
18425 2003-12-13 Martin Baulig <martin@ximian.com>
18428 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
18429 actually work and also fix #48962.
18431 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
18433 * decl.cs: Do not check System.Object for nested types,
18434 since we know it does not have any. Big bang for buck:
18437 Run 1: 8.35 seconds
18438 Run 2: 8.32 seconds
18439 corlib: 17.99 seconds
18441 Run 1: 8.17 seconds
18442 Run 2: 8.17 seconds
18443 corlib: 17.39 seconds
18445 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
18447 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
18448 time we are returning 0 members, so we save alot here.
18450 2003-12-11 Martin Baulig <martin@ximian.com>
18452 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
18453 `MergeChild()', also just take the `FlowBranching' as argument;
18454 call Merge() on it and return the result.
18455 (FlowBranching.Merge): We don't need to do anything if we just
18458 2003-12-11 Martin Baulig <martin@ximian.com>
18460 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
18461 them in an `ArrayList' to reduce memory usage. Thanks to Ben
18462 Maurer for this idea.
18464 2003-12-11 Martin Baulig <martin@ximian.com>
18466 * flowanalysis.cs (MergeResult): This class is now gone; we now
18467 use the `UsageVector' for this. The reason for this is that if a
18468 branching just has one sibling, we don't need to "merge" them at
18469 all - that's the next step to do.
18470 (FlowBranching.Merge): We now return a `UsageVector' instead of a
18473 2003-12-11 Martin Baulig <martin@ximian.com>
18475 Reworked flow analyis and made it more precise and bug-free. The
18476 most important change is that we're now using a special `Reachability'
18477 class instead of having "magic" meanings of `FlowReturns'. I'll
18478 do some more cleanups and optimizations and also add some more
18479 documentation this week.
18481 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
18482 largely reworked this class.
18483 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
18484 the new `Reachability' class instead of having "magic" values here.
18485 (FlowBranching): We're now using an instance of `Reachability'
18486 instead of having separate `Returns', `Breaks' etc. fields.
18488 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
18489 based on flow analysis; ignore the return value of block.Emit ().
18491 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
18493 * driver.cs typemanager.cs: Find the mono extensions to corlib even
18494 if they are private.
18496 2003-12-09 Martin Baulig <martin@ximian.com>
18498 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
18499 call them directly on the UsageVector.
18501 2003-12-09 Martin Baulig <martin@ximian.com>
18503 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
18504 Changed return type from `FlowReturns' to `Reachability'.
18506 2003-12-09 Martin Baulig <martin@ximian.com>
18508 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
18509 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
18510 `Reachable' fields with a single `Reachability' one.
18512 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18514 * class.cs (FindMembers): Remove foreach's.
18519 Run 1: 8.74 seconds
18520 Run 2: 8.71 seconds
18523 Run 1: 8.64 seconds
18524 Run 2: 8.58 seconds
18527 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18532 This patch does a few things:
18533 1. EmptyStatement is now a singleton, so it is never reallocated.
18534 2. All blah is EmptyStatement constructs have been changed to
18535 blah == EmptyStatement.Value, which is much faster and valid
18536 now that EmptyStatement is a singleton.
18537 3. When resolving a block, rather than allocating a new array for
18538 the non-empty statements, empty statements are replaced with
18539 EmptyStatement.Value
18540 4. Some recursive functions have been made non-recursive.
18541 Mainly the performance impact is from (3), however (1) and (2) are needed for
18542 this to work. (4) does not make a big difference in normal situations, however
18543 it makes the profile look saner.
18548 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18549 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18550 Total memory allocated: 56397 KB
18553 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
18554 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
18555 Total memory allocated: 55666 KB
18557 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18559 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
18560 than the hashtable in a hashtable version
18562 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
18563 we always end up concating a string. This results in a huge perf
18564 loss, because many strings have to be tracked by the GC. In this
18565 patch, we first use a hashtable that works with two keys, so that
18566 the strings do not need to be concat'ed.
18570 Run 1: 8.74 seconds
18571 Run 2: 8.71 seconds
18574 Run 1: 8.65 seconds
18575 Run 2: 8.56 seconds
18577 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18579 * Makefile: Add a new target `do-time' that does a quick and simple
18580 profile, leaving easy to parse output.
18582 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
18584 * codegen.cs (Init): Create the dynamic assembly with
18585 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
18587 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
18589 * support.cs: Make the PtrHashtable use only one
18590 instance of its comparer.
18592 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
18594 * typemanager.cs: Fix lookup of GetNamespaces.
18596 2003-11-29 Miguel de Icaza <miguel@ximian.com>
18598 * expression.cs: Removed redundant line.
18600 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
18601 ArrayLists, use for loops with bounds.
18603 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
18606 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
18607 arraylists, use for loop with bounds.
18609 The above three changes give us a 0.071 second performance
18610 improvement out of 3.294 seconds down to 3.223. On my machine
18611 the above changes reduced the memory usage by 1,387 KB during
18612 compiler bootstrap.
18614 * cs-parser.jay (QualifiedIdentifier): New class used to represent
18615 QualifiedIdentifiers. Before we created a new string through
18616 concatenation, and mostly later on, the result would be
18617 manipulated by DecomposeQI through string manipulation.
18619 This reduced the compiler memory usage for bootstrapping from
18620 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
18621 compile times in 0.05 seconds.
18623 2003-11-28 Dick Porter <dick@ximian.com>
18625 * support.cs: Do string compares with the Invariant culture.
18633 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
18634 the comparison is done with the Invariant culture.
18636 2003-11-27 Miguel de Icaza <miguel@ximian.com>
18638 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
18639 GetEnumerator method.
18641 (ProbeCollectionType): Iterate starting at the most specific type
18642 upwards looking for a GetEnumerator
18644 * expression.cs: Shift count can be up to 31 for int/uint and 63
18647 2003-11-26 Miguel de Icaza <miguel@ximian.com>
18649 * statement.cs (Block.LookupLabel): Also look for the label on the
18650 children blocks. Use a hash table to keep track of visited
18653 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
18654 we actually did transform the other operand, otherwise fall back
18655 to the common codepath that casts to long.
18657 * cs-tokenizer.cs: Use the same code pattern as the int case.
18658 Maybe I should do the parsing myself, and avoid depending on the
18659 Parse routines to get this done.
18661 2003-11-25 Miguel de Icaza <miguel@ximian.com>
18663 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
18664 which fixes bug 51347. This time test it.
18666 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
18667 attributes for example can not tell the difference between these.
18668 The difference was only a syntax feature of the language.
18670 * attribute.cs: Apply attributes to delegates.
18672 * delegate.cs: Call the apply attributes method.
18674 2003-11-24 Miguel de Icaza <miguel@ximian.com>
18676 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
18677 comparing 0 vs Byte.MinValue, not the value
18679 (ImplicitConversionRequired): When reporting a conversion error,
18680 use error 31 to print out the constant error instead of the
18683 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
18684 which fixes bug 51347.
18686 2003-11-22 Miguel de Icaza <miguel@ximian.com>
18688 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
18689 which fixes the -warnaserror command line option.
18691 2003-11-21 Miguel de Icaza <miguel@ximian.com>
18693 * cfold.cs (DoNumericPromotions): During constant folding of
18694 additions on UIntConstant, special case intconstants with
18695 IntConstants like we do on the expression binary operator.
18697 2003-11-12 Miguel de Icaza <miguel@ximian.com>
18699 * convert.cs (ImplicitReferenceConversion): We were missing a case
18700 (System.Enum are not value types or class types, so we need to
18701 classify them separatedly).
18703 * driver.cs: We do not support error 2007.
18705 2003-11-12 Jackson Harper <jackson@ximian.com>
18707 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
18708 system directory. Also use the full file name so users can
18709 libraries names mscorlib-o-tron.dll in a non system dir.
18711 2003-11-10 Martin Baulig <martin@ximian.com>
18713 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
18714 (TypeManager.InitCoreTypes): Initialize them here, but instead of
18715 calling `ResolveType()' on them, directly assign their `Type'.
18717 2003-11-08 Martin Baulig <martin@ximian.com>
18719 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
18720 return value and the `out parent' parameter.
18721 (TypeContainer.DefineType): Moved the CS0644 check into
18722 GetClassBases(). Don't pass the interface types to the
18723 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
18724 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
18726 * ecore.cs (TypeExpr.IsAttribute): New property.
18727 (TypeExpr.GetInterfaces): New method.
18729 * interface.cs (Interface.GetInterfaceTypeByName): Return a
18730 TypeExpr instead of a Type.
18731 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
18732 (Interface.DefineType): Don't pass the interface types to the
18733 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
18734 them later and then call `TypeBulider.AddInterfaceImplementation()'.
18736 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
18737 instead of a `Type[]'.
18738 (TypeManager.RegisterBuilder): Likewise.
18739 (TypeManager.AddUserInterface): Likewise.
18740 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
18741 `Type[]' and also return a `TypeExpr[]'.
18742 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
18744 2003-11-08 Martin Baulig <martin@ximian.com>
18746 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
18749 2003-11-08 Martin Baulig <martin@ximian.com>
18751 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
18752 TypeManager.ResolveExpressionTypes().
18754 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
18755 instead of an Expression.
18756 (TypeExpr): This is now an abstract base class for `TypeExpression'.
18757 (TypeExpression): New public class; formerly known as `TypeExpr'.
18759 * expression.cs (ComposedCast): Derive from TypeExpr.
18761 * typemanager.cs (TypeManager.system_*_expr): These are now
18762 TypExpr's instead of Expression's.
18763 (TypeManager.ResolveExpressionTypes): New public static function;
18764 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
18767 2003-11-06 Miguel de Icaza <miguel@ximian.com>
18769 * expression.cs (New.DoResolve): Do not dereference value that
18770 might be a null return.
18772 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
18773 sure that the constant value has the right type. Fixes an
18774 unreported bug, similar to 50425.
18776 * const.cs (Const.LookupConstantValue): Call
18777 ImplicitStandardConversionExists before doing a conversion to
18778 avoid havng the TypeManager.ChangeType do conversions.
18780 Reduced the number of casts used
18782 (Const.ChangeType): New routine to enable reuse of the constant
18783 type changing code from statement.
18785 * typemanager.cs (ChangeType): Move common initialization to
18786 static global variables.
18790 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
18791 every value type to go through, even if it was void. Fix that.
18793 * cs-tokenizer.cs: Use is_identifier_start_character on the start
18794 character of the define, and the is_identifier_part_character for
18795 the rest of the string.
18797 2003-11-05 Miguel de Icaza <miguel@ximian.com>
18799 * expression.cs (UnaryMutator.EmitCode): When I updated
18800 LocalVariableReference.DoResolve, I overdid it, and dropped an
18801 optimization done on local variable references.
18803 2003-11-04 Miguel de Icaza <miguel@ximian.com>
18805 * ecore.cs: Convert the return from Ldlen into an int.
18807 2003-10-20 Miguel de Icaza <miguel@ximian.com>
18809 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
18810 the accessibility, this is a special case for toplevel non-public
18811 classes (internal for instance).
18813 2003-10-20 Nick Drochak <ndrochak@gol.com>
18815 * ecore.cs: Fix typo and build. Needed another right paren.
18817 2003-10-19 Miguel de Icaza <miguel@ximian.com>
18819 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
18820 `internal' case regular and protected, but not allowing protected
18821 to be evaluated later. Bug 49840
18823 2003-10-15 Miguel de Icaza <miguel@ximian.com>
18825 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
18826 to kb.Nlast, and not the kb.nFirst to isolate the switch
18829 Extract the underlying type, so enumerations of long/ulong are
18830 treated like long/ulong.
18832 2003-10-14 Miguel de Icaza <miguel@ximian.com>
18834 * expression.cs (New): Overload the meaning of RequestedType to
18835 track the possible creation of the NewDelegate type, since
18836 DoResolve is invoked more than once for new constructors on field
18839 See bugs: #48800 and #37014
18841 * cs-parser.jay (declare_local_constants): Take an arraylist
18842 instead of a single constant.
18844 (local_constant_declaration): It should take a
18845 constant_declarators, not a constant_declarator. Fixes 49487
18847 * convert.cs: Fix error report.
18849 2003-10-13 Jackson Harper <jackson@ximian.com>
18851 * typemanager.cs (TypeToCoreType): Add float and double this fixes
18854 2003-10-09 Martin Baulig <martin@ximian.com>
18856 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
18858 (MethodCore.DoDefineParameters): Removed the TypeContainer
18859 argument; use the DeclSpace which was passed to the .ctor instead.
18860 (MethodCore.CheckParameter): Take a DeclSpace instead of a
18861 TypeContainer; we only need a DeclSpace here.
18863 2003-10-09 Martin Baulig <martin@ximian.com>
18865 * class.cs (MethodData): Added additional `DeclSpace ds' argument
18867 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
18868 EmitContext's .ctor.
18870 2003-10-09 Martin Baulig <martin@ximian.com>
18872 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
18873 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
18874 AsAccessible(), moved them as well.
18876 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
18878 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
18880 * cs-parser.jay : Renamed yyName to yyNames related to jay.
18882 2003-10-07 Miguel de Icaza <miguel@ximian.com>
18884 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
18885 generation for >=, as spotted by Paolo, bug 48679.
18886 Patch from David Waite.
18888 * cs-tokenizer.cs: Add handling for #pragma.
18890 * cs-parser.jay: Allow for both yield and yield return in the
18891 syntax. The anti-cobolization of C# fight will go on!
18893 * class.cs (TypeBuilder.DefineType): Catch error condition here
18894 (Parent.DefineType erroring out and returning null).
18896 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18897 coping with enumerations variables, we were mistakenly processing
18898 them as a regular value type instead of built-in types. Fixes the
18901 * typemanager.cs (IsBuiltinOrEnum): New method.
18903 2003-09-30 Miguel de Icaza <miguel@ximian.com>
18905 * cs-parser.jay: Upgrade: yield now needs the return clause.
18907 2003-09-19 Martin Baulig <martin@ximian.com>
18909 * decl.cs (MemberCache.SetupCacheForInterface): Take a
18910 `MemberCache parent' argument. Normally, an interface doesn't
18911 have a parent type except System.Object, but we use this in gmcs
18912 for generic type parameters.
18914 2003-09-18 Martin Baulig <martin@ximian.com>
18916 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
18917 on `type.IsInterface'; don't check whether the type has a parent
18918 to determine whether it's an interface.
18920 2003-09-15 Martin Baulig <martin@ximian.com>
18922 * class.cs (TypeContainer.DefineType): Added an error flag to
18923 avoid reporting duplicate CS0146's ("class definition is
18926 * driver.cs (Driver.MainDriver): Abort if
18927 RootContext.ResolveTree() reported any errors.
18929 2003-09-07 Martin Baulig <martin@ximian.com>
18931 * report.cs (Error, Warning): Added overloaded versions which take
18932 a `params object[] args' and call String.Format().
18934 2003-09-07 Martin Baulig <martin@ximian.com>
18936 * decl.cs (DeclSpace..ctor): Don't call
18937 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
18938 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
18939 (DeclSpace.RecordDecl): New method.
18941 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
18943 2003-09-02 Ravi Pratap <ravi@ximian.com>
18945 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
18946 value attributes to be applied to ParameterBuilders.
18948 * class.cs (MethodCore.LabelParameters): Make static and more
18949 generic so that it can be used from other places - like interface
18950 methods, for instance.
18952 * interface.cs (Interface.Emit): Call LabelParameters before
18953 emitting attributes on the InterfaceMethod.
18955 2003-08-26 Martin Baulig <martin@ximian.com>
18957 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
18958 resolving aliases; fixes #47927.
18960 2003-08-26 Martin Baulig <martin@ximian.com>
18962 * statement.cs (Using.DoResolve): This is internally emitting a
18963 try/finally clause, so we need to set ec.NeedExplicitReturn if we
18964 do not always return. Fixes #47681.
18966 2003-08-26 Martin Baulig <martin@ximian.com>
18968 * decl.cs (MemberCore): Moved WarningNotHiding(),
18969 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
18971 (AdditionResult): Make this nested in DeclSpace.
18972 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
18973 argument; call NamespaceEntry.Define() unless we're nested in a
18976 * namespace.cs (Namespace.DefineName): New public function. This
18977 is called from DeclSpace's .ctor to add
18978 (Namespace.Lookup): Include DeclSpaces in the lookup.
18980 * class.cs (Operator): Derive from MemberBase, not MemberCore.
18982 * const.cs (Const): Derive from MemberBase, not MemberCore.
18984 2003-08-25 Martin Baulig <martin@ximian.com>
18986 * convert.cs (Convert.ExplicitReferenceConversion): When
18987 converting from an interface type to a class, unbox if the target
18988 type is a struct type. Fixes #47822.
18990 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18992 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
18995 2003-08-22 Martin Baulig <martin@ximian.com>
18997 * class.cs (TypeManager.DefineType): When defining a nested type,
18998 call DefineType() on our parent; fixes #47801.
19000 2003-08-22 Martin Baulig <martin@ximian.com>
19002 * class.cs (MethodData.Define): While checking if a method is an
19003 interface implementation, improve the test a bit more to fix #47654.
19005 2003-08-22 Martin Baulig <martin@ximian.com>
19007 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
19008 correctly; fixes #47722.
19010 2003-08-22 Martin Baulig <martin@ximian.com>
19012 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
19013 LocalVariableReference, ensure it's not read-only. Fixes #47536.
19015 * statement.cs (Fixed.DoResolve): Make all variables read-only.
19017 2003-08-22 Martin Baulig <martin@ximian.com>
19019 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
19020 can only be assigned in static constructors. Fixes #47161.
19022 2003-08-22 Martin Baulig <martin@ximian.com>
19024 Rewrote and improved the flow analysis code.
19026 * flowbranching.cs (FlowBranching): Make this class abstract.
19027 (FlowBranching.CreateBranching): New static function to create a
19028 new flow branching.
19029 (FlowBranchingBlock, FlowBranchingException): New classes.
19030 (FlowBranching.UsageVector.Type): New public readonly field.
19031 (FlowBranching.UsageVector.Breaks): Removed the setter.
19032 (FlowBranching.UsageVector.Returns): Removed the setter.
19033 (FlowBranching.UsageVector): Added Break(), Return(),
19034 NeverReachable() and Throw() methods to modify the reachability.
19035 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
19036 done by FlowBranching.Merge().
19037 (FlowBranching.UsageVector.MergeChild): New method; merges the
19038 merge result into the current vector.
19039 (FlowBranching.Merge): New abstract method to merge a branching.
19041 2003-08-12 Martin Baulig <martin@ximian.com>
19043 * expression.cs (Indirection.CacheTemporaries): Create the
19044 LocalTemporary with the pointer type, not its element type.
19046 2003-08-10 Miguel de Icaza <miguel@ximian.com>
19048 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
19049 token was a keyword or not.
19051 Add `error' options where an IDENTIFIER was expected; Provide
19052 CheckToken and CheckIdentifierToken convenience error reporting
19055 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
19057 * decl.cs: Rename `NamespaceEntry Namespace' public field into
19058 NameSpaceEntry NameSpaceEntry.
19060 (LookupInterfaceOrClass): Avoid creating a full qualified name
19061 from namespace and name: avoid doing lookups when we know the
19062 namespace is non-existant. Use new Tree.LookupByNamespace which
19063 looks up DeclSpaces based on their namespace, name pair.
19065 * driver.cs: Provide a new `parser verbose' to display the
19066 exception thrown during parsing. This is turned off by default
19067 now, so the output of a failure from mcs is more graceful.
19069 * namespace.cs: Track all the namespaces defined in a hashtable
19072 (IsNamespace): New method
19074 2003-08-09 Miguel de Icaza <miguel@ximian.com>
19076 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
19077 we know that we need to concatenate (full typename can never be
19082 * statement.cs: Use a bitfield; Do not initialize to null things
19083 which are done by the constructor by default.
19085 * cs-parser.jay: bug fix, parameter was 4, not 3.
19087 * expression.cs: Just use the property;
19089 * statement.cs: No need for GetVariableInfo method.
19091 2003-08-08 Martin Baulig <martin@ximian.com>
19093 * flowanalysis.cs (FlowReturns): This is now nested in the
19094 `FlowBranching' class.
19095 (MyBitVector): Moved this here from statement.cs.
19096 (FlowBranching.SiblingType): New enum type.
19097 (FlowBranching.CreateSibling): Added `SiblingType' argument.
19099 2003-08-07 Martin Baulig <martin@ximian.com>
19101 * flowanalysis.cs (FlowBranchingType): This is now nested in the
19102 `FlowBranching' class and called `BranchingType'.
19104 2003-08-07 Martin Baulig <martin@ximian.com>
19106 * flowanalysis.cs: Moved all the control flow analysis code into
19109 2003-08-07 Martin Baulig <martin@ximian.com>
19111 * assign.cs (Assign.DoResolve): `target' must either be an
19112 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
19115 2003-08-07 Miguel de Icaza <miguel@ximian.com>
19117 * expression.cs (BinaryMethod): This kind of expression is created by the
19118 Binary class if it determines that the operator has to be handled
19121 (BinaryDelegate): This kind of expression is created if we are
19122 dealing with a + or - operator on delegates.
19124 (Binary): remove method, argumetns, and DelegateOperator: when
19125 dealing with methods,
19127 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
19129 * statement.cs (Block): use bitfields for the three extra booleans
19130 we had in use. Remove unused topblock parameter.
19132 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
19134 * assign.cs: Drop extra unneeded tests.
19136 2003-08-06 Miguel de Icaza <miguel@ximian.com>
19138 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
19140 * statement.cs (Foreach): Use VariableStorage instead of
19143 * codegen.cs (VariableStorage): New class used by clients that
19144 require a variable stored: locals or fields for variables that
19145 need to live across yield.
19147 Maybe provide a convenience api for EmitThis+EmitLoad?
19149 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
19152 2003-08-05 Miguel de Icaza <miguel@ximian.com>
19154 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
19155 RemapParameterLValue): New methods that are used to turn a
19156 precomputed FieldInfo into an expression like this:
19160 The idea is to use this instead of making LocalVariableReference
19161 have more than one meaning.
19163 * cs-parser.jay: Add error production to BASE.
19165 * ecore.cs: Deal with TypeManager.GetField returning null, which
19166 is now a valid return value.
19168 (FieldExprNoAddress): New expression for Fields whose address can
19171 * expression.cs (LocalVariableReference): During the resolve
19172 phases, create new expressions if we are in a remapping context.
19173 Remove code that dealt with remapping here.
19175 (ParameterReference): same.
19177 (ProxyInstance): New expression, like the `This' expression, but
19178 it is born fully resolved. We know what we are doing, so remove
19179 the errors that are targeted to user-provided uses of `this'.
19181 * statement.cs (Foreach): our variable is now stored as an
19182 Expression; During resolution, follow the protocol, dont just
19183 assume it will return this.
19185 2003-08-06 Martin Baulig <martin@ximian.com>
19187 * support.cs (SeekableStreamReader.cs): New public class.
19189 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
19190 SeekableStreamReader instead of the normal StreamReader.
19192 2003-08-04 Martin Baulig <martin@ximian.com>
19194 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
19195 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
19196 deambiguate casts and delegate invocations.
19197 (parenthesized_expression): Use the new tokens to ensure this is
19198 not a cast of method invocation.
19200 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
19201 when reading a `)' and Deambiguate_CloseParens () was previously
19204 * expression.cs (ParenthesizedExpression): New class. This is
19205 just used for the CS0075 test.
19206 (Binary.DoResolve): Check for CS0075.
19208 2003-07-29 Ravi Pratap <ravi@ximian.com>
19210 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
19211 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
19212 reference comparison.
19214 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
19215 examine the ReturnType for equality - this is necessary in the
19216 cases of implicit and explicit operators whose signature also
19217 includes the return type.
19219 2003-07-26 Miguel de Icaza <miguel@ximian.com>
19221 * namespace.cs: Cache the result of the namespace computation,
19222 instead of computing it every time.
19224 2003-07-24 Miguel de Icaza <miguel@ximian.com>
19226 * decl.cs: Use a global arraylist that we reuse over invocations
19227 to avoid excesive memory consumption. Reduces memory usage on an
19228 mcs compile by one meg (45 average).
19230 * typemanager.cs (LookupTypeReflection): In .NET pointers are
19231 private, work around that.
19233 2003-07-23 Miguel de Icaza <miguel@ximian.com>
19235 * literal.cs (IntLiteral): Define Zero and One static literals.
19237 * cs-parser.jay (integer_literal): use static literals to reduce
19238 memory usage for the most used literals (0, 1 and -1). 211kb
19239 reduced in memory usage.
19241 Replace all calls to `new ArrayList' with `new
19242 ArrayList(4)' which is a good average number for most allocations,
19243 and also requires only 16 bytes of memory for its buffer by
19246 This reduced MCS memory usage in seven megabytes for the RSS after
19249 2003-07-28 Ravi Pratap <ravi@ximian.com>
19251 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
19252 handle params methods the correct way by forming only one
19253 applicable set with params and normal methods in them. Earlier we
19254 were looking at params methods only if we found no normal methods
19255 which was not the correct thing to do.
19257 (Invocation.BetterFunction): Take separate arguments indicating
19258 when candidate and the best method are params methods in their
19261 This fixes bugs #43367 and #46199.
19263 * attribute.cs: Documentation updates.
19265 (CheckAttribute): Rename to CheckAttributeTarget.
19266 (GetValidPlaces): Rename to GetValidTargets.
19268 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
19269 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
19273 2003-07-28 Martin Baulig <martin@ximian.com>
19275 * class.cs (TypeContainer.DefineMembers): Use the base type's full
19276 name when looking up the base class of a nested class. Fixes #46977.
19278 2003-07-26 Martin Baulig <martin@ximian.com>
19280 * expression.cs (Indexers.Indexer): New nested struct; contains
19281 getter, setter and the indexer's type.
19282 (Indexers.Properties): This is now an ArrayList of
19283 Indexers.Indexer's.
19284 (IndexerAccess.DoResolveLValue): Correctly set the type if the
19285 indexer doesn't have any getters.
19287 * assign.cs (Assign.DoResolve): Also do the implicit conversions
19288 for embedded property and indexer assignments.
19290 2003-07-26 Martin Baulig <martin@ximian.com>
19292 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
19293 preprocessor directive is not the first non-whitespace character
19296 2003-07-26 Martin Baulig <martin@ximian.com>
19298 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
19299 namespace parsing, follow the spec more closely.
19301 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
19302 NamespaceEntry.Lookup().
19304 2003-07-25 Martin Baulig <martin@ximian.com>
19306 * MethodCore.cs (OverridesSomething): New public field; it's set
19307 from TypeContainer.DefineMembers if this method overrides
19308 something (which doesn't need to be a method). Fix #39462.
19310 2003-07-25 Ravi Pratap <ravi@ximian.com>
19312 * typemanager.cs (GetMembers): Ensure that the list of members is
19313 reversed. This keeps things in sync.
19315 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
19316 find an AttributeUsage attribute.
19318 * expression.cs (Invocation.OverloadResolve): Perform the check
19319 which disallows Invoke to be directly called on a Delegate.
19321 (Error_InvokeOnDelegate): Report error cs1533.
19323 2003-07-25 Martin Baulig <martin@ximian.com>
19325 * expression.cs (Indexers.GetIndexersForType): Only look in the
19326 interface hierarchy if the requested type is already an
19327 interface. Fixes #46788 while keeping #46502 fixed.
19329 2003-07-25 Martin Baulig <martin@ximian.com>
19331 * class.cs (TypeContainer.DefineMembers): Check whether all
19332 readonly fields have been assigned and report warning CS0649 if
19335 * statement.cs (LocalInfo.IsFixed): Always return true if this is
19338 2003-07-24 Ravi Pratap <ravi@ximian.com>
19340 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
19341 returned from GetMethods to make things consistent with the
19342 assumptions MCS makes about ordering of methods.
19344 This should comprehensively fix bug #45127 and it does :-)
19346 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
19347 ordering is actually reverse.
19349 * Clean up some debug messages I left lying around.
19351 * interface.cs (Populate*): Get rid of code which emits attributes
19352 since the stage in which we emit attributes is the 'Emit' stage,
19353 not the define stage.
19355 (Emit): Move attribute emission for interface members here.
19357 2003-07-22 Ravi Pratap <ravi@ximian.com>
19359 * expression.cs (Invocation.OverloadResolve): Follow the spec more
19360 closely: we eliminate methods in base types when we have an
19361 applicable method in a top-level type.
19363 Please see section 14.5.5.1 for an exact description of what goes
19366 This fixes bug #45127 and a host of other related to corlib compilation.
19368 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
19369 array is the method corresponding to the top-level type (this is
19370 because of the changes made to icall.c) so we change this
19373 (MethodGroupExpr.Name): This too.
19375 * typemanager.cs (GetElementType): New method which does the right
19376 thing when compiling corlib.
19378 * everywhere: Make use of the above in the relevant places.
19380 2003-07-22 Martin Baulig <martin@ximian.com>
19382 * cs-parser.jay (invocation_expression): Moved
19383 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
19384 `cast_expression', but create a InvocationOrCast which later
19385 resolves to either an Invocation or a Cast.
19387 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
19388 method; call this before EmitStatement() to make sure that this
19389 expression can be used as a statement.
19391 * expression.cs (InvocationOrCast): New class; resolves to either
19392 an Invocation or a Cast.
19394 * statement.cs (StatementExpression): Call ResolveStatement() on
19395 the ExpressionStatement before emitting it.
19397 2003-07-21 Martin Baulig <martin@ximian.com>
19399 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
19400 `ref' and `out' attributes match; fixes #46220.
19401 (MemberAccess.ResolveMemberAccess): You can't reference a type
19402 through an expression; fixes #33180.
19403 (Indexers.GetIndexersForType): Don't return the indexers from
19404 interfaces the class implements; fixes #46502.
19406 2003-07-21 Martin Baulig <martin@ximian.com>
19408 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
19409 CS0661 checks; fixes bug #30442.
19411 2003-07-21 Martin Baulig <martin@ximian.com>
19413 * decl.cs (AdditionResult): Added `Error'.
19415 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
19417 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
19418 makes cs0031.cs actually work.
19420 2003-07-20 Martin Baulig <martin@ximian.com>
19422 * namespace.cs: Fixed that bug which caused a crash when compiling
19423 the debugger's GUI.
19425 2003-07-20 Miguel de Icaza <miguel@ximian.com>
19427 * typemanager.cs (LookupTypeReflection): Never expose types which
19428 are NotPublic, NestedPrivate, NestedAssembly, or
19429 NestedFamANDAssem. We used to return these, and later do a check
19430 that would report a meaningful error, but the problem is that we
19431 would not get the real match, if there was a name override.
19433 2003-07-18 Miguel de Icaza <miguel@ximian.com>
19435 * namespace.cs (Namespace, Name): Do not compute the namespace
19436 name dynamically, compute it in the constructor. This reduced
19437 memory usage by 1697 KB.
19439 * driver.cs: Use --pause to pause at the end.
19441 2003-07-17 Peter Williams <peter@newton.cx>
19443 * Makefile: Change the name of the test target so that it doesn't
19444 conflict with the recursive test target.
19446 2003-07-17 Miguel de Icaza <miguel@ximian.com>
19448 * expression.cs (LocalVariableReference.Emit, EmitAssign,
19449 AddressOf): Do not use EmitThis, that was wrong, use the actual
19452 2003-07-15 Miguel de Icaza <miguel@ximian.com>
19454 * class.cs (MethodData.Define): While checking if a method is an
19455 interface implementation, improve the test: If we are not public
19456 (use new test here: use the computed MethodAttributes directly,
19457 instead of the parsed modifier flags) check if the `implementing'
19458 method comes from an interface or not.
19460 * pending.cs (VerifyPendingMethods): Slightly better error
19463 * makefile: add test target that does the mcs bootstrap.
19465 2003-07-16 Ravi Pratap <ravi@ximian.com>
19467 * interface.cs (Define): Do nothing here since there are no
19468 members to populate etc. Move the attribute emission out of here
19469 since this was just totally the wrong place to put it. Attribute
19470 application happens during the 'Emit' phase, not in the 'Define'
19473 (Emit): Add this method and move the attribute emission here
19475 * rootcontext.cs (EmitCode): Call the Emit method on interface
19478 2003-07-14 Ravi Pratap M <ravi@ximian.com>
19480 * expression.cs (OverloadResolve): Report error only if Location
19481 is not 'Null' which means that there was a probe going on.
19483 2003-07-14 Martin Baulig <martin@ximian.com>
19485 * expression.cs (ConditionalLogicalOperator): New public class to
19486 implement user defined conditional logical operators.
19487 This is section 14.11.2 in the spec and bug #40505.
19489 2003-07-14 Martin Baulig <martin@ximian.com>
19491 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
19493 2003-07-14 Martin Baulig <martin@ximian.com>
19495 * codegen.cs (EmitContext.InFixedInitializer): New public field.
19497 * ecore.cs (IVariable.VerifyFixed): New interface method.
19499 * expression.cs (Unary.ResolveOperator): When resolving the `&'
19500 operator, check whether the variable is actually fixed. Fixes bug
19501 #36055. Set a variable definitely assigned when taking its
19502 address as required by the spec.
19504 * statement.cs (LocalInfo.IsFixed): New field.
19505 (LocalInfo.MakePinned): Set `IsFixed' to true.
19507 2003-07-14 Ravi Pratap M <ravi@ximian.com>
19509 * attribute.cs (Attribute.Resolve): While doing a Member lookup
19510 for .ctors, ensure that we only ask for members declared in the
19511 attribute type (BindingFlags.DeclaredOnly).
19515 * expression.cs (Error_WrongNumArguments): Report error 1501
19516 correctly the way CSC does.
19518 2003-07-13 Martin Baulig <martin@ximian.com>
19520 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
19521 lookup on the fully qualified name, to make things like "X.X" work
19522 where "X.X" is a fully qualified type name, but we also have a
19523 namespace "X" in the using list. Fixes #41975.
19525 2003-07-13 Martin Baulig <martin@ximian.com>
19527 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
19528 function. If we're a CompoundAssign, we need to create an embedded
19529 CompoundAssign, not an embedded Assign.
19530 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
19533 2003-07-13 Martin Baulig <martin@ximian.com>
19535 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
19536 work to fix bug #46088.
19538 2003-07-13 Ravi Pratap <ravi@ximian.com>
19540 * class.cs (Operator.Emit): Do not emit attributes here - it is
19541 taken care of by the Method class that we delegate too. This takes
19542 care of bug #45876.
19544 2003-07-10 Martin Baulig <martin@ximian.com>
19546 * expression.cs (TypeOfVoid): New class.
19547 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
19549 2003-07-10 Martin Baulig <martin@ximian.com>
19551 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
19554 2003-07-10 Martin Baulig <martin@ximian.com>
19556 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
19557 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
19559 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
19561 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
19563 2003-07-10 Martin Baulig <martin@ximian.com>
19565 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
19566 of decimal. Fixes #42850.
19568 NOTE: I also fixed the created byte blob, but this doesn't work on
19569 the MS runtime and csc never produces any byte blobs for decimal
19572 2003-07-10 Martin Baulig <martin@ximian.com>
19574 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
19575 structs; fixes #32068.
19576 (Block.AddChildVariableNames): Fixed #44302.
19578 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19580 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
19582 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19584 * attribute.cs: And this test is onger needed.
19586 2003-07-08 Martin Baulig <martin@ximian.com>
19588 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
19589 inaccessible types. Fixes #36313.
19591 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
19593 * namespace.cs (NamespaceEntry): Create implicit entries for all
19594 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
19595 implicit entries for N1.N2 and N1.
19597 2003-07-08 Martin Baulig <martin@ximian.com>
19599 Rewrote the handling of namespaces to fix a lot of the issues
19600 wrt. `using' aliases etc.
19602 * namespace.cs (Namespace): Splitted this class into a
19603 per-assembly `Namespace' and a per-file `NamespaceEntry'.
19605 * typemanager.cs (TypeManager.IsNamespace): Removed.
19606 (TypeManager.ComputeNamespaces): Only compute namespaces from
19607 loaded assemblies here, not the namespaces from the assembly we're
19608 currently compiling.
19610 2003-07-08 Martin Baulig <martin@ximian.com>
19612 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
19614 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19616 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
19619 I thought about the memory savings here, but LookupTypeReflection
19620 is used under already very constrained scenarios. Compiling
19621 corlib or mcs only exposes one hit, so it would not really reduce
19622 any memory consumption.
19624 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19626 * typemanager.cs: fixes bug #45889 by only adding public types from
19627 other assemblies to the list of known types.
19629 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19631 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
19632 on the type we resolved.
19634 2003-07-05 Martin Baulig <martin@ximian.com>
19636 * pending.cs (PendingImplementation.ParentImplements): Don't
19637 create the proxy if the parent is abstract.
19639 * class.cs (TypeContainer.DefineIndexers): Process explicit
19640 interface implementations first. Fixes #37714.
19642 2003-07-04 Miguel de Icaza <miguel@ximian.com>
19644 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
19645 defined recursively; but since we modify the input parameters
19646 (left is set to `this' temporarily), we reset this value if the
19647 left_is_explicit is false, which gives the original semantics to
19650 * literal.cs (NullPointer): new class used to represent a null
19651 literal in a pointer context.
19653 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
19654 type is a pointer, use a NullPointer object instead of a
19655 NullLiteral. Closes 43687
19657 (ExplicitConversion): Convert pointer values using
19658 the conv opcode to the proper type.
19660 * ecore.cs (New): change ValueTypeVariable property into a method,
19661 that returns whether the valuetype is suitable for being used.
19663 * expression.cs (Binary.DoNumericPromotions): Only return if we
19664 the int constant was a valid uint, and we can return both left and
19665 right as uints. If not, we continue processing, to trigger the
19666 type conversion. This fixes 39018.
19668 * statement.cs (Block.EmitMeta): During constant resolution, set
19669 the CurrentBlock property on the emitcontext, so that we resolve
19670 constants propertly.
19672 2003-07-02 Martin Baulig <martin@ximian.com>
19674 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
19675 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
19677 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
19678 than emitting it here.
19680 * statement.cs: Fixed some more flow analysis bugs.
19682 2003-07-02 Martin Baulig <martin@ximian.com>
19684 * class.cs (MethodData.Define): When implementing interface
19685 methods, set Final unless we're Virtual.
19687 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
19688 check work for interface methods.
19690 2003-07-01 Martin Baulig <martin@ximian.com>
19692 * ecore.cs (EmitContext.This): Replaced this property with a
19693 GetThis() method which takes a Location argument. This ensures
19694 that we get the correct error location for a CS0188.
19696 2003-07-01 Miguel de Icaza <miguel@ximian.com>
19698 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
19699 ImplicitStandardConversion.
19701 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
19703 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
19705 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
19708 2003-06-30 Miguel de Icaza <miguel@ximian.com>
19710 * class.cs (Constructor.Define): Turn off initlocals for unsafe
19713 (MethodData.Define): Turn off initlocals for unsafe methods.
19715 2003-06-29 Miguel de Icaza <miguel@ximian.com>
19717 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
19718 complete; Fixes #37521.
19720 * delegate.cs: Use Modifiers.TypeAttr to compute the
19721 TypeAttributes, instead of rolling our own. This makes the flags
19722 correct for the delegates.
19724 2003-06-28 Miguel de Icaza <miguel@ximian.com>
19726 * class.cs (Constructor.Define): Set the private flag for static
19727 constructors as well.
19729 * cs-parser.jay (statement_expression): Set the return value to
19730 null, to avoid a crash when we catch an error.
19732 2003-06-24 Miguel de Icaza <miguel@ximian.com>
19734 * cs-parser.jay: Applied patch from Jackson that adds support for
19735 extern and unsafe modifiers to destructor declarations.
19737 * expression.cs: Report error 21 if the user is trying to index a
19740 * driver.cs: Add an error message, suggested by the bug report.
19742 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
19743 if we do not have a ": this ()" constructor initializer. Fixes 45149
19745 2003-06-14 Miguel de Icaza <miguel@ximian.com>
19747 * namespace.cs: Add some information to reduce FAQs.
19749 2003-06-13 Miguel de Icaza <miguel@ximian.com>
19751 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
19752 underlying enumeration types. Fixes #43915.
19754 * expression.cs: Treat ushort/short as legal values to be used in
19755 bitwise operations.
19757 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
19759 * delegate.cs: transfer custom attributes for paramenters from
19760 the delegate declaration to Invoke and BeginInvoke.
19762 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
19764 * attribute.cs: handle custom marshalers and emit marshal info
19767 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
19769 * makefile.gnu: Added anonymous.cs to the compiler sources.
19771 2003-05-28 Miguel de Icaza <miguel@ximian.com>
19773 * iterators.cs: Change the name of the proxy class to include two
19776 * cs-parser.jay: Update grammar to include anonymous methods.
19778 * anonymous.cs: new file.
19780 2003-05-27 Miguel de Icaza <miguel@ximian.com>
19782 * class.cs (Field.Define): Add missing test for pointers and
19785 2003-05-27 Ravi Pratap <ravi@ximian.com>
19787 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
19788 we use the stobj opcode.
19790 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
19791 since it wasn't the correct fix.
19793 It still is puzzling that we are required to use stobj for IntPtr
19794 which seems to be a ValueType.
19796 2003-05-26 Miguel de Icaza <miguel@ximian.com>
19798 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
19799 during regular simple name resolution. Now, the trick is that
19800 instead of returning for processing the simplename, we do a
19801 TypeManager.LookupType (ie, a rooted lookup as opposed to a
19802 contextual lookup type). If a match is found, return that, if
19803 not, return for further composition.
19805 This fixes long-standing 30485.
19807 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19808 using the address to initialize an object, do an Stobj instead of
19809 using the regular Stelem.
19811 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
19812 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
19813 Because if we are a BaseIndexerAccess that value will be true.
19816 * statement.cs (GotoCase.Resolve): Return after reporting an
19817 error, do not attempt to continue.
19819 * expression.cs (PointerArithmetic.Emit): If our operand is a
19820 long, convert our constants to match the operand before
19821 multiplying. Convert to I type before adding. Fixes 43670.
19823 2003-05-14 Ravi Pratap <ravi@ximian.com>
19825 * enum.cs (ImplicitConversionExists) : Rename to
19826 ImplicitEnumConversionExists to remove ambiguity.
19828 * ecore.cs (NullCast): New type of cast expression class which
19829 basically is very similar to EmptyCast with the difference being
19830 it still is a constant since it is used only to cast a null to
19832 (eg. (string) null)
19834 * convert.cs (ImplicitReferenceConversion): When casting a null
19835 literal, we return a NullCast.
19837 * literal.cs (NullLiteralTyped): Remove - I don't see why this
19838 should be around anymore.
19840 The renaming (reported was slightly wrong). Corrections:
19842 ConvertImplicitStandard -> ImplicitConversionStandard
19843 ConvertExplicitStandard -> ExplicitConversionStandard
19845 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
19846 before passing them in !
19848 * convert.cs (ImplicitConversionStandard): When comparing for
19849 equal expr and target types, ensure that expr is not a
19852 In general, we must not be checking (expr_type ==
19853 target_type) in the top level conversion methods
19854 (ImplicitConversion, ExplicitConversion etc). This checking is
19855 done in the methods that they delegate to.
19857 2003-05-20 Miguel de Icaza <miguel@ximian.com>
19859 * convert.cs: Move Error_CannotConvertType,
19860 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
19861 ImplicitNumericConversion, ImplicitConversionExists,
19862 ImplicitUserConversionExists, StandardConversionExists,
19863 FindMostEncompassedType, FindMostSpecificSource,
19864 FindMostSpecificTarget, ImplicitUserConversion,
19865 ExplicitUserConversion, GetConversionOperators,
19866 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
19867 TryImplicitIntConversion, Error_CannotConvertImplicit,
19868 ConvertImplicitRequired, ConvertNumericExplicit,
19869 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
19870 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
19873 Perform the following renames:
19875 StandardConversionExists -> ImplicitStandardConversionExists
19876 ConvertImplicit -> ImplicitConversion
19877 ConvertImplicitStandard -> ImplicitStandardConversion
19878 TryImplicitIntConversion -> ImplicitIntConversion
19879 ConvertImplicitRequired -> ImplicitConversionRequired
19880 ConvertNumericExplicit -> ExplicitNumericConversion
19881 ConvertReferenceExplicit -> ExplicitReferenceConversion
19882 ConvertExplicit -> ExplicitConversion
19883 ConvertExplicitStandard -> ExplicitStandardConversion
19885 2003-05-19 Martin Baulig <martin@ximian.com>
19887 * statement.cs (TypeInfo.StructInfo): Made this type protected.
19888 (TypeInfo): Added support for structs having structs as fields.
19890 * ecore.cs (FieldExpr): Implement IVariable.
19891 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
19892 VariableInfo for the field.
19894 2003-05-18 Martin Baulig <martin@ximian.com>
19896 * expression.cs (This.DoResolve): Report a CS0027 if we're
19897 emitting a field initializer.
19899 2003-05-18 Martin Baulig <martin@ximian.com>
19901 * expression.cs (This.ResolveBase): New public function.
19902 (This.DoResolve): Check for CS0188.
19904 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
19907 * ecore.cs (MethodGroupExpr.DoResolve): Set the
19908 `instance_expression' to null if we don't have any non-static
19911 2003-05-18 Martin Baulig <martin@ximian.com>
19913 Reworked the way how local variables and parameters are handled by
19914 the flow analysis code.
19916 * statement.cs (TypeInfo, VariableMap): New public classes.
19917 (VariableInfo): New public class. This is now responsible for
19918 checking whether a variable has been assigned. It is used for
19919 parameters and local variables.
19920 (Block.EmitMeta): Take the InternalParameters as argument; compute
19921 the layout of the flow vectors here.
19922 (Block.LocalMap, Block.ParameterMap): New public properties.
19923 (FlowBranching): The .ctor doesn't get the InternalParameters
19924 anymore since Block.EmitMeta() now computes the layout of the flow
19926 (MyStructInfo): This class is now known as `StructInfo' and nested
19927 in `TypeInfo'; we don't access this directly anymore.
19929 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
19930 property and removed IsAssigned(), IsFieldAssigned(),
19931 SetAssigned() and SetFieldAssigned(); we now call them on the
19932 VariableInfo so we don't need to duplicate this code everywhere.
19934 * expression.cs (ParameterReference): Added `Block block' argument
19936 (LocalVariableReference, ParameterReference, This): The new
19937 VariableInfo class is now responsible for all the definite
19940 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
19941 IsParameterAssigned, SetParameterAssigned): Removed.
19943 2003-05-18 Martin Baulig <martin@ximian.com>
19945 * typemanager.cs (InitCoreTypes): Try calling
19946 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
19947 the 3-args-version. Corlib now also needs our `void_type'.
19948 (GetMethod): Added overloaded version which takes an optional
19949 `bool report_errors' to allow lookups of optional methods.
19951 2003-05-12 Martin Baulig <martin@ximian.com>
19953 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
19954 only used for locals and not for parameters.
19956 2003-05-12 Miguel de Icaza <miguel@ximian.com>
19958 * support.cs (InternalParameters.ParameterType): Return the
19959 ExternalType of the parameter.
19961 * parameter.cs (Parameter.ExternalType): drop the two arguments,
19964 2003-05-11 Miguel de Icaza <miguel@ximian.com>
19966 * class.cs (MethodData.Define): Do not set the `newslot' on
19967 interface members, if they are also flagged as "override".
19969 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
19970 better code for ++i and i++. This only works for static fields
19971 and local variables.
19973 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
19974 want to pull the DeclSpace out of the builder_to_declspace instead
19975 of the TypeBuilder (like in TypeContainer.FindMembers).
19977 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
19978 instead of LookupTypeContainer. Fixes the crash on .NET for
19979 looking up interface members.
19981 * const.cs: Create our own emit context during the Definition
19982 stage, so that constants are evaluated in the proper context, when
19983 a recursive definition happens.
19985 2003-05-11 Martin Baulig <martin@ximian.com>
19987 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
19988 new block for a switch section.
19989 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
19990 the adding/lookup in the switch block. Fixes #39828.
19992 2003-05-09 Miguel de Icaza <miguel@ximian.com>
19994 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
19995 functionality: I needed to convert the data after I had performed
19996 the add/sub operation into the operands type size.
19998 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
19999 pass the type for the box operation, otherwise the resulting
20000 object would have been of type object.
20002 (BoxedCast): Add constructor to specify the type to box as.
20004 2003-05-07 Miguel de Icaza <miguel@ximian.com>
20006 * iterators.cs: I was reusing the `count' variable inadvertently,
20007 take steps to not allow this to happen.
20009 2003-05-06 Miguel de Icaza <miguel@ximian.com>
20011 * attribute.cs (Attribute.Resolve): Params attributes are encoded
20012 by creating an array at the point where the params starts and
20013 putting all those arguments there, then adjusting the size of the
20016 2003-05-05 Miguel de Icaza <miguel@ximian.com>
20018 * expression.cs (New.AddressOf): Implement interface
20019 IMemoryLocation. This is used when the `new' operator is used in
20020 the context of an invocation to a method on a value type.
20022 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
20025 * namespace.cs: Also check the using aliases here.
20027 * driver.cs: Move the test for using validity after the types have
20028 been entered, so we do a single pass that also includes the using
20031 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
20032 in the regular case. CreateSiblingForFinally is doing extra
20035 * attribute.cs (GetAttributeArgumentExpression): Store the result
20036 on an out value, and use the return value to indicate failure
20037 instead of using null (which is a valid return for Constant.GetValue).
20039 * statement.cs: Perform the analysis flow for the increment
20040 portion after the statement, because this will be the real flow of
20041 execution. Fixes #42385
20043 * codegen.cs (EmitContext.EmitArgument,
20044 EmitContext.EmitStoreArgument): New helper functions when the
20045 RemapToProxy flag is set.
20047 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
20050 Add support for remapping parameters.
20052 * iterators.cs: Propagate parameter values; Store parameter
20053 values in the proxy classes.
20055 2003-05-04 Miguel de Icaza <miguel@ximian.com>
20057 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
20058 need a proxy reference; I do not know what I was thinking
20060 * cs-parser.jay (constructor_initializer): catch another error,
20061 and display nice message.
20063 (field_declaration): catch void field declaration
20064 to flag a better error.
20066 * class.cs (MemberBase.CheckBase): Report an error instead of a
20067 warning if a new protected member is declared in a struct.
20068 (Field.Define): catch the error of readonly/volatile.
20070 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
20072 (FieldExpr.AddressOf): ditto. Catch error where the address of a
20073 volatile variable is taken
20075 2003-05-02 Miguel de Icaza <miguel@ximian.com>
20077 * statement.cs (Fixed.Resolve): Report an error if we are not in
20080 2003-05-01 Miguel de Icaza <miguel@ximian.com>
20082 * typemanager.cs: reuse the code that handles type clashes for
20083 delegates and enumerations.
20085 * class.cs (Report28): Always report.
20087 * expression.cs (EncodeAsAttribute): Allow nulls here.
20089 2003-04-28 Miguel de Icaza <miguel@ximian.com>
20091 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
20092 the functionality for testing whether an expression is valid for
20093 an attribute here. Also handle the case of arrays of elements
20096 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
20097 encoding a linear array into an array of objects that are suitable
20098 to be passed to an CustomAttributeBuilder.
20100 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
20102 * ecore.cs: (FieldExpr): Handle field remapping here.
20104 * iteratators.cs: Pass the instance variable (if the method is an
20105 instance method) to the constructors, so we can access the field
20106 variables on the class.
20108 TODO: Test this with structs. I think the THIS variable on
20109 structs might have to be a pointer, and not a refenrece
20111 2003-04-27 Miguel de Icaza <miguel@ximian.com>
20113 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
20114 local variables to fields in a proxy class.
20116 * iterators.cs (PopulateProxy): Rename our internal fields to
20118 Create a <THIS> field if we are an instance method, so we can
20119 reference our parent container variables.
20120 (MapVariable): Called back from the EmitContext code to enter a
20121 new variable to field mapping into the proxy class (we just create
20125 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
20126 for using the remapped locals to fields.
20128 I placed the code here, because that gives the same semantics to
20129 local variables, and only changes the Emit code.
20131 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
20132 statements inside iterators.
20133 (VariableInfo): Add a FieldBuilder for the cases when we are
20134 remapping local variables to fields in a proxy class
20136 * ecore.cs (SimpleNameResolve): Avoid testing two times for
20137 current_block != null.
20139 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
20140 not cope with strings, as it has been moved to the
20141 TableSwitchEmit. Fixed bug in switch generation.
20143 * expression.cs (New.DoResolve): Provide more context for the user
20144 when reporting an error.
20146 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
20149 * expression.cs (MemberAccess.DoResolve): When we get a type back,
20150 check the permissions for it. Note than in a type-resolution
20151 context the check was already present in DeclSpace.ResolveType,
20152 but was missing from the MemberAccess.
20154 (ArrayCreation.CheckIndices): warn if the user has
20155 more nested levels of expressions, but there are no more
20156 dimensions specified. Avoids crash on bug 41906.
20158 2003-04-26 Miguel de Icaza <miguel@ximian.com>
20160 * statement.cs (Block): replace Implicit bool, for a generic
20162 New flag: `Unchecked'. This is used during the EmitMeta phase
20163 (which is out-of-line with the regular Resolve/Emit process for a
20164 statement, as this is done ahead of time, but still gets a chance
20165 to call constant resolve).
20167 (Block.Flags): new enum for adding a new flag.
20169 (Block.EmitMeta): track the state of unchecked.
20171 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
20172 to enable constant resolution to work there as well.
20174 2003-04-22 Miguel de Icaza <miguel@ximian.com>
20176 * typemanager.cs (ienumerable_type): Also look up
20177 System.Collections.IEnumerable.
20179 2003-04-21 Miguel de Icaza <miguel@ximian.com>
20181 TODO: Test more than one conditional per method.
20183 * class.cs (Indexer.Define): Report the location where the user is
20184 referencing the unsupported feature.
20186 (MethodData): Overload the use of `conditionals' to
20187 minimize the creation of needless ArrayLists. This saves roughly
20188 212kb on my machine.
20190 (Method): Implement the new IIteratorContainer interface.
20191 (Method.SetYields): Implement the method by setting the ModFlags
20192 to contain METHOD_YIELDS.
20194 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
20195 which just got set to null.
20197 * iterators.cs: New file.
20199 (Yield, YieldBreak): New statements.
20201 * statement.cs (Return.Resolve): Flag an error if we are used in
20202 an iterator method.
20204 * codegen.cs (InIterator): New flag set if the code is being
20205 compiled in an iterator method.
20207 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
20208 internal modifier, and we just use it to avoid adding extra
20209 fields, as this is seldom used.
20211 * cs-parser.jay: Add yield_statement (yield and yield break).
20213 * driver.cs: New flag -v2 to turn on version 2 features.
20215 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
20216 hashtable when v2 is enabled.
20218 2003-04-20 Miguel de Icaza <miguel@ximian.com>
20220 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
20221 there is already a namespace defined with this name.
20223 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
20224 people upgraded their corlibs.
20226 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
20227 always use fully qualified types, no need to use the compiler
20230 (TypeManager.IsNamespace): Use binarysearch.
20232 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
20233 AddDelegate): I did not quite use the new IsValid API properly: I
20234 have to pass the short-name and the fullname. I was passing only
20235 the basename instead of the fullname sometimes.
20237 (TypeContainer.DefineType): call NamespaceClash.
20239 * interface.cs (Interface.DefineType): use NamespaceClash before
20242 * delegate.cs (Delegate.DefineType): use NamespaceClash before
20245 * enum.cs: (Enum.DefineType): use NamespaceClash before
20248 * typemanager.cs (: 3-line patch that gives us some tasty 11%
20249 speed increase. First, use the negative_hits cache when we get a
20250 negative. Second, add the type with its full original name
20251 instead of the new . and + encoded name (reflection uses + to
20252 separate type from a nested type). Use LookupTypeReflection
20253 directly which bypasses the type->name hashtable (that we already
20254 know does not contain the type.
20256 * decl.cs (DeclSpace.ResolveTypeExpr): track the
20257 location/container type.
20259 * driver.cs: When passing utf8, use directly the UTF8Encoding.
20261 2003-04-19 Miguel de Icaza <miguel@ximian.com>
20263 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
20265 * delegate.cs (NewDelegate.Resolve): Test whether an instance
20266 method is being referenced in the method group from a static
20267 context, and report error 120 if so.
20269 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
20272 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
20273 is created, we create the A namespace).
20275 * cs-parser.jay: A namespace also introduces a DeclarationFound.
20278 2003-04-18 Miguel de Icaza <miguel@ximian.com>
20280 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
20281 invocation to ModuleBuilder.GetType with the same values will
20282 return a new type instance, so we need to cache its return
20285 * expression.cs (Binary.ResolveOperator): Only allow the compare
20286 operators on enums if they are of the same type.
20288 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
20289 types of ValueType on their own case. Before we were giving them
20290 the same treatment as objects.
20292 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
20293 fullname. Short name is used to compare against container name.
20294 Fullname is used to check against defined namespace names.
20296 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
20297 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
20299 (Method.CheckBase): Call parent.
20300 (MemberBase.CheckBase): Check for protected members on sealed
20302 (PropertyBase.CheckBase): Call parent.
20303 (Field.Define): Call parent.
20305 * report.cs: Negative error codes are now mapped to 8000 - code,
20306 so that the display is render more nicely.
20308 * typemanager.cs: Do not use try/catch, instead report a regular
20311 (GetPointerType, GetReferenceType): These methods provide
20312 mechanisms to obtain the T* and T& from a T. We had the code
20313 previously scattered around the code base, and it also used
20314 TypeManager.LookupType that would go through plenty of caches.
20315 This one goes directly to the type source.
20317 In some places we did the Type.GetType followed by
20318 ModuleBuilder.GetType, but not in others, so this unifies the
20319 processing as well.
20321 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
20322 statements now that we have namespace information.
20324 * typemanager.cs (IsNamespace): New method, returns whether the
20325 string presented is a namespace or not.
20327 (ComputeNamespaces): New public entry point, computes the list of
20328 available namespaces, using the GetNamespaces API call in Mono, or
20329 the slower version in MS.NET.
20331 Now before we start the semantic analysis phase, we have a
20332 complete list of namespaces including everything that the user has
20335 Deleted old code to cache namespaces in .nsc files.
20337 2003-04-17 Miguel de Icaza <miguel@ximian.com>
20339 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
20340 class/struct location definition Location for the implicit
20341 constructor location.
20343 (Operator.Define): Use the location of the operator for the
20344 implicit Method definition.
20346 (Constructor.Emit): use the constructor location for the implicit
20347 base initializer constructor.
20349 * ecore.cs: Remove ITypeExpression. This interface is now gone,
20350 and the Expression class now contains two new methods:
20352 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
20353 isolate type lookup from the rest of the resolution process.
20355 Since we use Expressions to hold type definitions due to the way
20356 we parse the input we have historically overloaded Resolve to
20357 perform the Type lookups if a special flag is passed. Now this is
20358 eliminated and two methods take their place.
20360 The differences in the two methods between xStep and xTerminal is
20361 that xStep is involved in our current lookup system that uses
20362 SimpleNames to compose a name, while xTerminal is used just to
20363 catch the case where the simplename lookup failed.
20365 2003-04-16 Miguel de Icaza <miguel@ximian.com>
20367 * expression.cs (ResolveMemberAccess): Remove redundant code.
20368 TypeExpr expressions are always born fully resolved.
20370 * interface.cs (PopulateMethod): Do not lookup the types twice.
20371 We were doing it once during SemanticAnalysis and once during
20374 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
20375 in local variable type definitions, were being returned as a
20376 SimpleName (we decomposed everything into a string), that is
20377 because primary_expression was being used instead of a type in the
20378 grammar (reduce/reduce conflicts).
20380 The part that was wrong is that we converted the expression into a
20381 string (an oversimplification in one hand, compounded with primary
20382 expressions doing string concatenation).
20388 Would return "A.B.C[]" as a SimpleName. This stopped things like
20389 using clauses from working on this particular context. And a type
20390 was being matched directly against "A.B.C[]".
20392 We now use the correct approach, and allow for ComposedCast to be
20393 part of the unary expression. So the "A.B.C []" become a composed
20394 cast of "A.B.C" (as a nested group of MemberAccess with a
20395 SimpleName at the end) plus the rank composition "[]".
20399 2003-04-10 Miguel de Icaza <miguel@ximian.com>
20401 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
20402 for the access level checking.
20404 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
20405 `TypeContainer container', because I kept getting confused when I
20406 was debugging this code.
20408 * expression.cs (Indexers): Instead of tracking getters/setters,
20409 we now track them in parallel. We create one arraylist less, but
20410 most importantly it is possible now for the LValue code to find a
20411 matching get for a set.
20413 (IndexerAccess.DoResolveLValue): Update the code.
20414 GetIndexersForType has been modified already to extract all the
20415 indexers from a type. The code assumed it did not.
20417 Also make the code set the correct return type for the indexer.
20418 This was fixed a long time ago for properties, but was missing for
20419 indexers. It used to be void_type.
20421 (Binary.Emit): Test first for doubles instead of
20422 floats, as they are more common.
20424 (Binary.EmitBranchable): Use the .un version of the branch opcodes
20425 when dealing with floats and the <=, >= operators. This fixes bug
20428 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
20429 to load the array value by emitting a load on the foreach variable
20430 type. This was incorrect.
20432 We now emit the code to load an element using the the array
20433 variable type, and then we emit the conversion operator.
20437 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
20439 * attribute.cs: Avoid allocation of ArrayLists in the common case.
20441 2003-04-09 Miguel de Icaza <miguel@ximian.com>
20443 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
20444 test for protection before we test for signatures.
20446 (MethodSignature.ToString): implement.
20448 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
20449 to the case where we reduced into a LongConstant.
20451 * decl.cs (CheckAccessLevel): If the type is an array, we can not
20452 depend on whether the information is acurrate, because the
20453 Microsoft runtime will always claim that the array type is public,
20454 regardless of the real state.
20456 If the type is a pointer, another problem happens: the type is
20457 reported as non-public in Microsoft.
20459 In both cases we have to call CheckAccessLevel recursively with
20460 the underlying type as the argument to be tested.
20462 2003-04-08 Miguel de Icaza <miguel@ximian.com>
20464 * assign.cs (Assign.Emit): If we are dealing with a compound
20465 assignment expression, we should use the code path that stores the
20466 intermediate result in a temporary value. This fixes #40903.
20468 *expression.cs (Indirection.ToString): Provide ToString method for
20471 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
20473 * class.cs: Null out fields holding references to Block objects so
20474 they can be garbage collected.
20476 * expression.cs (OverloadResolve): Remove unused local.
20478 2003-04-07 Martin Baulig <martin@ximian.com>
20480 * codegen.cs (EmitContext.CurrentFile): New public field.
20481 (EmitContext.Mark): Use the CurrentFile to check whether the
20482 location is in the correct file.
20483 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
20485 2003-04-07 Martin Baulig <martin@ximian.com>
20487 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
20489 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
20490 location. [FIXME: The location argument which gets passed to this
20491 method is sometimes wrong!]
20493 2003-04-07 Nick Drochak <ndrochak@gol.com>
20495 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
20497 2003-04-07 Miguel de Icaza <miguel@ximian.com>
20499 * expression.cs (Indirection.EmitAssign): We were using the
20500 temporary, but returning immediately instead of continuing the
20503 2003-04-06 Martin Baulig <martin@ximian.com>
20505 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
20506 if it's a nested child, but also deriving from the outer class.
20509 * typemanager.cs (IsNestedChildOf): Make this work if it's a
20510 nested child, but also deriving from the outer class. See
20512 (FilterWithClosure): We may access private members of the outer
20513 class if we're a nested child and deriving from the outer class.
20514 (RealMemberLookup): Only set `closure_private_ok' if the
20515 `original_bf' contained BindingFlags.NonPublic.
20517 2003-04-05 Martin Baulig <martin@ximian.com>
20519 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
20521 2003-04-02 Miguel de Icaza <miguel@ximian.com>
20523 * class.cs (Event.Define): Do not allow abstract events to have
20526 2003-04-01 Miguel de Icaza <miguel@ximian.com>
20528 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
20529 block in event declarations.
20531 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
20532 value type, get its address.
20534 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
20535 leaving a class on the stack instead of a boolean value (int
20536 0/1). Change the code so we compare against null, and then the
20537 result against zero.
20539 * class.cs (TypeContainer.GetClassBases): We were checking for the
20540 parent class being sealed too late.
20542 * expression.cs (Binary.Emit): For <= and >= when dealing with
20543 floating point values, use cgt.un and clt.un instead of cgt and
20546 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
20548 * statement.cs: Apply the same optimization as MS: skip the
20549 GetEnumerator returning an IEnumerator, and use the one returning a
20550 CharEnumerator instead. This allows us to avoid the try-finally block
20553 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
20555 * cs-parser.jay: Attributes cannot be applied to
20556 namespaces. Fixes #40473
20558 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20561 (Add*): check if the name is valid using the full name for constants,
20562 fields, properties and events.
20564 2003-03-28 Miguel de Icaza <miguel@ximian.com>
20566 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
20567 char constants to be part of the enumeration.
20569 * expression.cs (Conditional.DoResolve): Add support for operator
20570 true. Implements the missing functionality from 14.12
20572 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
20573 operator true/false as required by the spec.
20575 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
20576 implicit conversion to boolean.
20578 * statement.cs (Statement.ResolveBoolean): A boolean expression is
20579 also one where the type implements `operator true'.
20581 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
20582 get an expression that will invoke operator true based on an
20585 (GetConversionOperators): Removed the hack that called op_True
20588 (Expression.ResolveBoolean): Move this from Statement.
20590 2003-03-17 Miguel de Icaza <miguel@ximian.com>
20592 * ecore.cs (FieldExpr): do not allow initialization of initonly
20593 fields on derived classes
20595 2003-03-13 Martin Baulig <martin@ximian.com>
20597 * statement.cs (Block.Emit): Call ig.BeginScope() and
20598 ig.EndScope() when compiling with debugging info; call
20599 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
20601 2003-03-08 Miguel de Icaza <miguel@ximian.com>
20603 * expression.cs (Indexers): Do not construct immediately, allow
20604 for new members to be appended as we go. Fixes 38143
20606 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20608 * expression.cs: save/restore context when resolving an unchecked
20611 2003-03-05 Miguel de Icaza <miguel@ximian.com>
20613 * cfold.cs: Catch division by zero in modulus operator during
20616 2003-03-03 Miguel de Icaza <miguel@ximian.com>
20618 * interface.cs (Interface.DefineMembers): Avoid defining members
20621 2003-02-27 Miguel de Icaza <miguel@ximian.com>
20623 * driver.cs: handle the +/- options for -noconfig
20625 * statement.cs (Unckeched.Resolve): Also track the state of
20626 unchecked in the Resolve phase.
20628 2003-02-27 Martin Baulig <martin@ximian.com>
20630 * ecore.cs (Expression.MemberLookup): Don't create a
20631 MethodGroupExpr for something which is not a method. Fixes #38291.
20633 2003-02-25 Miguel de Icaza <miguel@ximian.com>
20635 * class.cs (MemberBase.CheckParameters): Also check that the type
20636 is unmanaged if it is a pointer.
20638 * expression.cs (SizeOf.Resolve): Add location information.
20640 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
20641 a managed type is declared.
20643 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
20644 parameter modifiers as well. Fixes bug 38606
20646 * class.cs: Very sad. Am backing out the speed up changes
20647 introduced by the ArrayList -> Array in the TypeContainer, as they
20648 were not actually that much faster, and introduced a bug (no error
20649 reports on duplicated methods).
20651 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
20652 source first, this will guarantee that we have a valid expression
20653 before calling in lower levels functions that will require a
20654 resolved object. Then use this original_source in the
20655 target.ResolveLValue instead of the original source that was
20658 Another change. Use target.Resolve instead of LValueResolve.
20659 Although we are resolving for LValues, we will let the Assign code
20660 take care of that (it will be called again from Resolve). This
20661 basically allows code like this:
20663 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
20664 class Y { void A (X x) { x [0] += o; }
20666 The problem was that the indexer was trying to resolve for
20667 set_Item (idx, object o) and never finding one. The real set_Item
20668 was set_Item (idx, X). By delaying the process we get the right
20673 2003-02-23 Martin Baulig <martin@ximian.com>
20675 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
20676 while calling DoEmit ().
20678 * codegen.cs (EmitContext.Mark): Don't mark locations in other
20679 source files; if you use the #line directive inside a method, the
20680 compiler stops emitting line numbers for the debugger until it
20681 reaches the end of the method or another #line directive which
20682 restores the original file.
20684 2003-02-23 Martin Baulig <martin@ximian.com>
20686 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
20688 2003-02-23 Martin Baulig <martin@ximian.com>
20690 * statement.cs (Block.AddChildVariableNames): We need to call this
20691 recursively, not just for our immediate children.
20693 2003-02-23 Martin Baulig <martin@ximian.com>
20695 * class.cs (Event.Define): Always make the field private, like csc does.
20697 * typemanager.cs (TypeManager.RealMemberLookup): Make events
20698 actually work, fixes bug #37521.
20700 2003-02-23 Miguel de Icaza <miguel@ximian.com>
20702 * delegate.cs: When creating the various temporary "Parameters"
20703 classes, make sure that we call the ComputeAndDefineParameterTypes
20704 on those new parameters (just like we do with the formal ones), to
20705 allow them to be resolved in the context of the DeclSpace.
20707 This fixes the bug that Dick observed in Bugzilla #38530.
20709 2003-02-22 Miguel de Icaza <miguel@ximian.com>
20711 * expression.cs (ResolveMemberAccess): When resolving a constant,
20712 do not attempt to pull a constant if the value was not able to
20713 generate a valid constant.
20715 * const.cs (LookupConstantValue): Do not report more errors than required.
20717 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20719 * expression.cs: fixes bug #38328.
20721 2003-02-18 Miguel de Icaza <miguel@ximian.com>
20723 * class.cs: Changed all the various members that can be part of a
20724 class from being an ArrayList to be an Array of the right type.
20725 During the DefineType type_list, interface_list, delegate_list and
20726 enum_list are turned into types, interfaces, delegates and enums
20729 And during the member population, indexer_list, event_list,
20730 constant_list, field_list, instance_constructor_list, method_list,
20731 operator_list and property_list are turned into their real arrays.
20733 Although we could probably perform this operation earlier, for
20734 good error reporting we need to keep the lists and remove the
20735 lists for longer than required.
20737 This optimization was triggered by Paolo profiling the compiler
20738 speed on the output of `gen-sample-program.pl' perl script.
20740 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
20741 not crash in methods like MemberLookupFailed that use this field.
20743 This problem arises when the compiler fails to resolve a type
20744 during interface type definition for example.
20746 2003-02-18 Miguel de Icaza <miguel@ximian.com>
20748 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
20749 inherit from System.Object, so we have to stop at null, not only
20750 when reaching System.Object.
20752 2003-02-17 Miguel de Icaza <miguel@ximian.com>
20754 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
20755 DeclaredOnly because the parent indexer might have had a different
20756 name, but did not loop until the top of the hierarchy was reached.
20758 The problem this one fixes is 35492: when a class implemented an
20759 indexer from an interface, we were getting the interface method
20760 (which was abstract) and we were flagging an error (can not invoke
20763 This also keeps bug 33089 functioning, and test-148 functioning.
20765 * typemanager.cs (IsSpecialMethod): The correct way of figuring
20766 out if a method is special is to see if it is declared in a
20767 property or event, or whether it is one of the predefined operator
20768 names. This should fix correctly #36804.
20770 2003-02-15 Miguel de Icaza <miguel@ximian.com>
20772 The goal here is to remove the dependency on EmptyCast.Peel ().
20773 Killing it completely.
20775 The problem is that currently in a number of places where
20776 constants are expected, we have to "probe" for an EmptyCast, and
20777 Peel, which is not the correct thing to do, as this will be
20778 repetitive and will likely lead to errors.
20780 The idea is to remove any EmptyCasts that are used in casts that
20781 can be reduced to constants, so we only have to cope with
20784 This bug hunt was triggered by Bug 37363 and the desire to remove
20785 the duplicate pattern where we were "peeling" emptycasts to check
20786 whether they were constants. Now constants will always be
20789 * ecore.cs: Use an enumconstant here instead of wrapping with
20792 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
20793 throwing me off. By handling this we can get rid of a few hacks.
20795 * statement.cs (Switch): Removed Peel() code.
20797 2003-02-14 Miguel de Icaza <miguel@ximian.com>
20799 * class.cs: Location information for error 508
20801 * expression.cs (New.DoResolve): Add a guard against double
20802 resolution of an expression.
20804 The New DoResolve might be called twice when initializing field
20805 expressions (see EmitFieldInitializers, the call to
20806 GetInitializerExpression will perform a resolve on the expression,
20807 and later the assign will trigger another resolution
20809 This leads to bugs (#37014)
20811 * delegate.cs: The signature for EndInvoke should contain any ref
20812 or out parameters as well. We were not doing this in the past.
20814 * class.cs (Field.Define): Do not overwrite the type definition
20815 inside the `volatile' group. Turns out that volatile enumerations
20816 were changing the type here to perform a validity test, which
20819 2003-02-12 Miguel de Icaza <miguel@ximian.com>
20821 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
20822 and structs, we do not want to load the instance variable
20824 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
20825 enum_type has to be handled like an object reference (implicit
20826 conversions exists from this to object), but the regular IsClass
20827 and IsValueType tests will never return true for this one.
20829 Also we use TypeManager.IsValueType instead of type.IsValueType,
20830 just for consistency with the rest of the code (this is only
20831 needed if we ever use the construct exposed by test-180.cs inside
20832 corlib, which we dont today).
20834 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
20836 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
20839 2003-02-09 Martin Baulig <martin@ximian.com>
20841 * namespace.cs (Namespace..ctor): Added SourceFile argument.
20842 (Namespace.DefineNamespaces): New static public method; this is
20843 called when we're compiling with debugging to add all namespaces
20844 to the symbol file.
20846 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
20847 pass it to the Namespace's .ctor.
20849 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
20850 and MethodBase arguments; pass the namespace ID to the symwriter;
20851 pass the MethodBase instead of the token to the symwriter.
20852 (SymbolWriter.DefineNamespace): New method to add a namespace to
20855 2003-02-09 Martin Baulig <martin@ximian.com>
20857 * symbolwriter.cs: New file. This is a wrapper around
20858 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
20859 methods here in near future.
20861 2003-02-09 Martin Baulig <martin@ximian.com>
20863 * codegen.cs (EmitContext.Mark): Just pass the arguments to
20864 ILGenerator.MarkSequencePoint() which are actually used by the
20867 2003-02-09 Martin Baulig <martin@ximian.com>
20869 * location.cs (SourceFile): New public sealed class. This
20870 contains the name and an index which is used in the location's token.
20871 (Location): Reserve an appropriate number of bits in the token for
20872 the source file instead of walking over that list, this gives us a
20873 really huge performance improvement when compiling with debugging.
20875 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
20876 `SourceFile' argument instead of a string.
20877 (Driver.ProcessFile): Add all the files via Location.AddFile(),
20878 but don't parse/tokenize here, we need to generate the list of all
20879 source files before we do that.
20880 (Driver.ProcessFiles): New static function. Parses/tokenizes all
20883 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
20884 instead of a string.
20886 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
20889 2003-02-09 Martin Baulig <martin@ximian.com>
20891 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
20892 filename on `#line default'.
20894 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
20896 * statement.cs: don't clear the pinned var when the fixed statement
20897 returns from the method (fixes bug#37752).
20899 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
20901 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
20904 2003-02-07 Martin Baulig <martin@ximian.com>
20906 * driver.cs: Removed the `--debug-args' command line argument.
20908 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
20909 automatically by the AsssemblyBuilder.
20910 (CodeGen.InitializeSymbolWriter): We don't need to call any
20911 initialization function on the symbol writer anymore. This method
20912 doesn't take any arguments.
20914 2003-02-03 Miguel de Icaza <miguel@ximian.com>
20916 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
20917 from referenced assemblies as well.
20919 2003-02-02 Martin Baulig <martin@ximian.com>
20921 * class.cs (MethodData.Emit): Generate debugging info for external methods.
20923 2003-02-02 Martin Baulig <martin@ximian.com>
20925 * class.cs (Constructor.Emit): Open the symbol writer before
20926 emitting the constructor initializer.
20927 (ConstructorInitializer.Emit): Call ec.Mark() to allow
20928 single-stepping through constructor initializers.
20930 2003-01-30 Miguel de Icaza <miguel@ximian.com>
20932 * class.cs: Handle error 549: do not allow virtual methods in
20935 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
20937 * decl.cs: Check access levels when resolving types
20939 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
20941 * statement.cs: Add parameters and locals set in catch blocks that might
20942 return to set vector
20944 2003-01-29 Miguel de Icaza <miguel@ximian.com>
20946 * class.cs (Operator): Set the SpecialName flags for operators.
20948 * expression.cs (Invocation.DoResolve): Only block calls to
20949 accessors and operators on SpecialName methods.
20951 (Cast.TryReduce): Handle conversions from char constants.
20954 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
20956 * statement.cs: small memory and time optimization in FlowBranching.
20958 2003-01-28 Pedro Mart <yoros@wanadoo.es>
20960 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
20961 problem that the last fix but in the other sid (Set).
20963 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
20964 access when there is no indexer in the hierarchy.
20966 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
20968 * class.cs: Combine some if statements.
20970 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20972 * driver.cs: fixed bug #37187.
20974 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
20976 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
20977 any indexer, it's needed to build a list with all the indexers in the
20978 hierarchy (AllGetters), else we have problems. Fixes #35653.
20980 2003-01-23 Miguel de Icaza <miguel@ximian.com>
20982 * class.cs (MethodData.Define): It is wrong for an interface
20983 implementation to be static in both cases: explicit and implicit.
20984 We were only handling this in one case.
20986 Improve the if situation there to not have negations.
20988 * class.cs (Field.Define): Turns out that we do not need to check
20989 the unsafe bit on field definition, only on usage. Remove the test.
20991 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20993 * driver.cs: use assembly.Location instead of Codebase (the latest
20994 patch made mcs fail when using MS assemblies).
20996 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
20998 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
20999 get the path to *corlib.dll.
21001 2003-01-21 Nick Drochak <ndrochak@gol.com>
21005 * typemanager.cs: Remove compiler warnings
21007 2003-01-20 Duncan Mak <duncan@ximian.com>
21009 * AssemblyInfo.cs: Bump the version number to 0.19.
21011 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21013 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
21015 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
21017 * class.cs (Constructor::Emit): Emit debugging info for constructors.
21019 2003-01-17 Miguel de Icaza <miguel@ximian.com>
21021 * cs-parser.jay: Small fix: we were not comparing the constructor
21022 name correctly. Thanks to Zoltan for the initial pointer.
21024 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
21026 * cs-tokenizer.cs: Set file name when specified with #line
21028 2003-01-15 Miguel de Icaza <miguel@ximian.com>
21030 * cs-parser.jay: Only perform the constructor checks here if we
21031 are named like the class; This will help provider a better
21032 error. The constructor path is taken when a type definition is
21033 not found, but most likely the user forgot to add the type, so
21034 report that rather than the constructor error.
21036 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
21038 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
21041 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21043 * cs-parser.jay: Add cleanup call.
21045 2003-01-13 Duncan Mak <duncan@ximian.com>
21047 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
21048 consistent with other methods.
21050 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21052 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
21054 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
21056 * attribute.cs: only set GuidAttr to true when we have a
21059 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21063 * typemanager.cs: fixes to allow mcs compile corlib with the new
21064 Type.IsSubclassOf fix.
21066 2003-01-08 Miguel de Icaza <miguel@ximian.com>
21068 * expression.cs (LocalVariableReference.DoResolve): Classify a
21069 constant as a value, not as a variable. Also, set the type for
21072 * cs-parser.jay (fixed_statement): take a type instead of a
21073 pointer_type, so we can produce a better error message later.
21075 * statement.cs (Fixed.Resolve): Flag types that are not pointers
21078 (For.DoEmit): Make inifinite loops have a
21079 non-conditional branch back.
21081 (Fixed.DoEmit): First populate the pinned variables, then emit the
21082 statement, then clear the variables. Before I was emitting the
21083 code once for each fixed piece.
21086 2003-01-08 Martin Baulig <martin@ximian.com>
21088 * statement.cs (FlowBranching.MergeChild): A break in a
21089 SWITCH_SECTION does not leave a loop. Fixes #36155.
21091 2003-01-08 Martin Baulig <martin@ximian.com>
21093 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
21094 lives in the same number space than `param_map'. Fixes #36154.
21096 2003-01-07 Miguel de Icaza <miguel@ximian.com>
21098 * cs-parser.jay (constructor_declaration): Set the
21099 Constructor.ModFlags before probing for it. This makes the
21100 compiler report 514, 515 and 132 (the code was there, but got
21103 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
21104 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
21105 (GotoCase.Resolve): Set `Returns' to ALWAYS.
21107 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
21109 * enum.cs: create the enum static fields using the enum type.
21111 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
21113 * class.cs: don't try to create the ParamBuilder for the return
21114 type if it's not needed (and handle it breaking for the ms runtime
21117 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
21119 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
21121 2002-12-29 Miguel de Icaza <miguel@ximian.com>
21123 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
21124 the command. This showed up while compiling the JANET source
21125 code, which used \r as its only newline separator.
21127 2002-12-28 Miguel de Icaza <miguel@ximian.com>
21129 * class.cs (Method.Define): If we are an operator (because it
21130 reuses our code), then set the SpecialName and HideBySig. #36128
21132 2002-12-22 Miguel de Icaza <miguel@ximian.com>
21134 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
21135 exception, report error 120 `object reference required'.
21137 * driver.cs: Add --pause option, used during to measure the size
21138 of the process as it goes with --timestamp.
21140 * expression.cs (Invocation.DoResolve): Do not allow methods with
21141 SpecialName to be invoked.
21143 2002-12-21 Miguel de Icaza <miguel@ximian.com>
21145 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
21146 number before adding it.
21148 2002-12-21 Ravi Pratap <ravi@ximian.com>
21150 * ecore.cs (StandardImplicitConversion): When in an unsafe
21151 context, we allow conversion between void * to any other pointer
21152 type. This fixes bug #35973.
21154 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
21156 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
21157 is not thrown when extensionless outputs are used
21159 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21161 * rootcontext.cs: fixed compilation of corlib.
21163 2002-12-19 Miguel de Icaza <miguel@ximian.com>
21165 * attribute.cs (Attributes.Contains): Add new method.
21167 * class.cs (MethodCore.LabelParameters): if the parameter is an
21168 `out' parameter, check that no attribute `[In]' has been passed.
21170 * enum.cs: Handle the `value__' name in an enumeration.
21172 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
21174 * decl.cs: Added special case to allow overrides on "protected
21177 2002-12-18 Ravi Pratap <ravi@ximian.com>
21179 * attribute.cs (Attributes.AddAttributeSection): Rename to this
21180 since it makes much more sense.
21182 (Attributes.ctor): Don't require a Location parameter.
21184 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
21186 * attribute.cs (ApplyAttributes): Remove extra Location parameters
21187 since we already have that information per attribute.
21189 * everywhere : make appropriate changes.
21191 * class.cs (LabelParameters): Write the code which actually
21192 applies attributes to the return type. We can't do this on the MS
21193 .NET runtime so we flag a warning in the case an exception is
21196 2002-12-18 Miguel de Icaza <miguel@ximian.com>
21198 * const.cs: Handle implicit null conversions here too.
21200 2002-12-17 Ravi Pratap <ravi@ximian.com>
21202 * class.cs (MethodCore.LabelParameters): Remove the extra
21203 Type [] parameter since it is completely unnecessary. Instead
21204 pass in the method's attributes so that we can extract
21205 the "return" attribute.
21207 2002-12-17 Miguel de Icaza <miguel@ximian.com>
21209 * cs-parser.jay (parse): Use Report.Error to flag errors instead
21210 of ignoring it and letting the compile continue.
21212 * typemanager.cs (ChangeType): use an extra argument to return an
21213 error condition instead of throwing an exception.
21215 2002-12-15 Miguel de Icaza <miguel@ximian.com>
21217 * expression.cs (Unary.TryReduce): mimic the code for the regular
21218 code path. Perform an implicit cast in the cases where we can
21219 implicitly convert to one of the integral types, and then reduce
21220 based on that constant. This fixes bug #35483.
21222 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21224 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
21226 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21228 * namespace.cs: fixed bug #35489.
21230 2002-12-12 Miguel de Icaza <miguel@ximian.com>
21232 * class.cs: Remove some dead code.
21234 * cs-parser.jay: Estimate the number of methods needed
21235 (RootContext.MethodCount);
21237 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
21238 numbers instead of StringBuilders.
21240 * support.cs (PtrHashtable): Add constructor with initial size;
21241 We can now reduce reallocations of the method table.
21243 2002-12-10 Ravi Pratap <ravi@ximian.com>
21245 * attribute.cs (ApplyAttributes): Keep track of the emitted
21246 attributes on a per-target basis. This fixes bug #35413.
21248 2002-12-10 Miguel de Icaza <miguel@ximian.com>
21250 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
21251 default to the Windows 1252 encoding.
21253 (UnixParseOption): Support version, thanks to Alp for the missing
21256 * AssemblyInfo.cs: Add nice assembly information.
21258 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
21261 * cs-parser.jay: Allow a trailing comma before the close bracked
21262 in the attribute_section production.
21264 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
21265 address of the instance was being taken, I will take this out,
21266 because we take the address of the object immediately here.
21268 2002-12-09 Ravi Pratap <ravi@ximian.com>
21270 * typemanager.cs (AreMultipleAllowed): Take care of the most
21271 obvious case where attribute type is not in the current assembly -
21274 2002-12-08 Miguel de Icaza <miguel@ximian.com>
21276 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
21277 definitions, instead of doing that afterwards.
21279 Also we use a nice little hack, depending on the constructor, we
21280 know if we are a "composed" name or a simple name. Hence, we
21281 avoid the IndexOf test, and we avoid
21283 * codegen.cs: Add code to assist in a bug reporter to track down
21284 the source of a compiler crash.
21286 2002-12-07 Ravi Pratap <ravi@ximian.com>
21288 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
21289 types have been emitted for a given element and flag an error
21290 if something which does not have AllowMultiple set is used more
21293 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
21294 attribute types and their corresponding AllowMultiple properties
21296 (AreMultipleAllowed): Check the property for a given type.
21298 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
21299 property in the case we have a TypeContainer.
21301 (Attributes.AddAttribute): Detect duplicates and just skip on
21302 adding them. This trivial fix catches a pretty gross error in our
21303 attribute emission - global attributes were being emitted twice!
21305 Bugzilla bug #33187 is now fixed.
21307 2002-12-06 Miguel de Icaza <miguel@ximian.com>
21309 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
21310 instead of pp_and).
21312 * expression.cs (Binary.ResolveOperator): I can only use the
21313 Concat (string, string, string) and Concat (string, string,
21314 string, string) if the child is actually a concatenation of
21317 2002-12-04 Miguel de Icaza <miguel@ximian.com>
21319 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
21320 context where we need a 2-character lookahead.
21322 * pending.cs (PendingImplementation): Rework so we can keep track
21323 of interface types all the time, and flag those which were
21324 implemented by parents as optional.
21326 2002-12-03 Miguel de Icaza <miguel@ximian.com>
21328 * expression.cs (Binary.ResolveOperator): Use
21329 String.Concat(string,string,string) or
21330 String.Concat(string,string,string,string) when possible.
21332 * typemanager: More helper methods.
21335 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
21337 * pending.cs: remove the bogus return from GetMissingInterfaces()
21338 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
21340 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21342 * namespace.cs: avoid duplicated 'using xxx' being added to
21343 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
21344 when we get more than one 'using' statement for the same namespace.
21345 Report a CS0105 warning for it.
21347 2002-11-30 Miguel de Icaza <miguel@ximian.com>
21349 * cs-tokenizer.cs (consume_identifier): use read directly, instead
21350 of calling getChar/putback, uses internal knowledge of it.
21352 (xtoken): Reorder tokenizer so most common patterns are checked
21353 first. This reduces the compilation time in another 5% (from 8.11s
21354 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
21356 The parsing time is 22% of the compilation in mcs, and from that
21357 64% is spent on the tokenization process.
21359 I tried using a binary search for keywords, but this is slower
21360 than the hashtable. Another option would be to do a couple of
21363 * Not use a StringBuilder, instead use an array of chars,
21364 with a set value. Notice that this way we could catch
21365 the 645 error without having to do it *afterwards*.
21367 * We could write a hand-parser to avoid the hashtable
21368 compares altogether.
21370 The identifier consumption process takes 37% of the tokenization
21371 time. Another 15% is spent on is_number. 56% of the time spent
21372 on is_number is spent on Int64.Parse:
21374 * We could probably choose based on the string length to
21375 use Int32.Parse or Int64.Parse and avoid all the 64-bit
21378 Another 3% is spend on wrapping `xtoken' in the `token' function.
21380 Handle 0xa0 as whitespace (#34752)
21382 2002-11-26 Miguel de Icaza <miguel@ximian.com>
21384 * typemanager.cs (IsCLRType): New routine to tell whether a type
21385 is one of the builtin types.
21387 Maybe it needs to use TypeCodes to be faster. Maybe we could use
21388 typecode in more places instead of doing pointer comparissions.
21389 We could leverage some knowledge about the way the typecodes are
21392 New code to cache namespaces in assemblies, it is currently not
21393 invoked, to be used soon.
21395 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
21397 * expression.cs (Binary.ResolveOperator): specially handle
21398 strings, and do not perform user-defined operator overloading for
21401 2002-11-24 Miguel de Icaza <miguel@ximian.com>
21403 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
21404 internalcall as it is a pretty simple operation; Avoid whenever
21405 possible to call Char.IsLetter.
21407 (consume_identifier): Cut by half the number of
21408 hashtable calls by merging the is_keyword and GetKeyword behavior.
21410 Do not short-circuit, because if we do, we
21411 report errors (ie, #if false && true would produce an invalid
21415 2002-11-24 Martin Baulig <martin@ximian.com>
21417 * expression.cs (Cast.TryReduce): If we're in checked syntax,
21418 check constant ranges and report a CS0221. Fixes #33186.
21420 2002-11-24 Martin Baulig <martin@ximian.com>
21422 * cs-parser.jay: Make this work for uninitialized variable
21423 declarations in the `for' initializer. Fixes #32416.
21425 2002-11-24 Martin Baulig <martin@ximian.com>
21427 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
21428 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
21430 2002-11-24 Martin Baulig <martin@ximian.com>
21432 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
21433 argument; if true, we also check for user-defined conversions.
21434 This is only needed if both arguments are of a user-defined type.
21435 Fixes #30443, added test-175.cs.
21436 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
21438 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
21440 2002-11-24 Martin Baulig <martin@ximian.com>
21442 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
21443 function to get the store opcode.
21444 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
21445 only emit the Ldelema if the store opcode is Stobj. You must run
21446 both test-34 and test-167 to test this. Fixes #34529.
21448 2002-11-23 Martin Baulig <martin@ximian.com>
21450 * ecore.cs (Expression.MemberLookup): Added additional
21451 `qualifier_type' argument which is used when we're being called
21452 from MemberAccess.DoResolve() and null if we're called from a
21454 (Expression.MemberLookupFailed): New method to report errors; this
21455 does the CS1540 check and reports the correct error message.
21457 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
21458 argument for the CS1540 check and redone the way how we're dealing
21459 with private members. See the comment in the source code for details.
21460 (FilterWithClosure): Reverted this back to revision 1.197; renamed
21461 `closure_start_type' to `closure_qualifier_type' and check whether
21462 it's not null. It was not this filter being broken, it was just
21463 being called with the wrong arguments.
21465 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
21466 and pass it the correct `qualifier_type'; this also does the error
21469 2002-11-22 Miguel de Icaza <miguel@ximian.com>
21471 * expression.cs (Invocation.EmitParams): If the we are dealing
21472 with a non-built-in value type, load its address as well.
21474 (ArrayCreation): Use a a pretty constant instead
21475 of the hardcoded value 2. Use 6 instead of 2 for the number of
21476 static initializers.
21478 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
21479 because they are not really value types, just glorified integers.
21481 * driver.cs: Do not append .exe, the CSC compiler does not do it.
21483 * ecore.cs: Remove redundant code for enumerations, make them use
21484 the same code path as everything else, fixes the casting issue
21485 with enumerations in Windows.Forms.
21487 * attribute.cs: Do only cast to string if it is a string, the
21488 validation happens later.
21490 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
21491 people upgrade their corlibs.
21493 * ecore.cs: Oops, enumerations were not following the entire code path
21495 2002-11-21 Miguel de Icaza <miguel@ximian.com>
21497 * typemanager.cs (FilterWithClosure): Commented out the test for
21498 1540 in typemanager.cs, as it has problems when accessing
21499 protected methods from a parent class (see test-174.cs).
21501 * attribute.cs (Attribute.ValidateGuid): new method.
21502 (Attribute.Resolve): Use above.
21504 2002-11-19 Miguel de Icaza <miguel@ximian.com>
21506 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
21508 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
21509 handling for enumerations, as we only needed the TypeContainer
21510 functionality to begin with (this is required for the fix below to
21511 work for enums that reference constants in a container class for
21514 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
21516 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
21517 a valid TypeBuilder to perform lookups on.o
21519 * class.cs (InheritableMemberSignatureCompare): Use true in the
21520 call to GetGetMethod and GetSetMethod, because we are comparing
21521 the signature, and we need to get the methods *even* if they are
21524 (PropertyBase.CheckBase): ditto.
21526 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
21527 GotoCase.Resolve): Use Peel on EmpytCasts.
21529 * ecore.cs (EmptyCast): drop child, add Peel method.
21531 2002-11-17 Martin Baulig <martin@ximian.com>
21533 * ecore.cs (EmptyCast.Child): New public property.
21535 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
21536 label resolved to an EmptyCast. Fixes #34162.
21537 (GotoCase.Resolve): Likewise.
21538 (Block.EmitMeta): Likewise.
21540 2002-11-17 Martin Baulig <martin@ximian.com>
21542 * expression.cs (Invocation.BetterConversion): Prefer int over
21543 uint; short over ushort; long over ulong for integer literals.
21544 Use ImplicitConversionExists instead of StandardConversionExists
21545 since we also need to check for user-defined implicit conversions.
21546 Fixes #34165. Added test-173.cs.
21548 2002-11-16 Martin Baulig <martin@ximian.com>
21550 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
21551 with the `true' and `false' literals. Fixes #33151.
21553 2002-11-16 Martin Baulig <martin@ximian.com>
21555 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
21556 October 22nd; don't do the cs1540 check for static members.
21558 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
21559 now using our own filter here and doing the cs1540 check again.
21561 2002-11-16 Martin Baulig <martin@ximian.com>
21563 * support.cs (InternalParameters): Don't crash if we don't have
21564 any fixed parameters. Fixes #33532.
21566 2002-11-16 Martin Baulig <martin@ximian.com>
21568 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
21569 when looking up static methods to make this work on Windows.
21572 2002-11-16 Martin Baulig <martin@ximian.com>
21574 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
21575 a setter rather than using PropertyInfo.CanWrite.
21577 2002-11-15 Nick Drochak <ndrochak@gol.com>
21579 * class.cs: Allow acces to block member by subclasses. Fixes build
21582 2002-11-14 Martin Baulig <martin@ximian.com>
21584 * class.cs (Constructor.Emit): Added the extern/block check.
21587 2002-11-14 Martin Baulig <martin@ximian.com>
21589 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
21590 iteration while looking for indexers, this is needed because the
21591 indexer may have a different name in our base classes. Fixed the
21592 error reporting (no indexers at all, not get accessor, no
21593 overloaded match). Fixes bug #33089.
21594 (IndexerAccess.DoResolveLValue): Likewise.
21596 2002-11-14 Martin Baulig <martin@ximian.com>
21598 * class.cs (PropertyBase.CheckBase): Make this work for multiple
21599 indexers. Fixes the first part of bug #33089.
21600 (MethodSignature.InheritableMemberSignatureCompare): Added support
21603 2002-11-13 Ravi Pratap <ravi@ximian.com>
21605 * attribute.cs (Attribute.Resolve): Catch the
21606 NullReferenceException and report it since it isn't supposed to
21609 2002-11-12 Miguel de Icaza <miguel@ximian.com>
21611 * expression.cs (Binary.EmitBranchable): Also handle the cases for
21612 LogicalOr and LogicalAnd that can benefit from recursively
21613 handling EmitBranchable. The code now should be nice for Paolo.
21615 2002-11-08 Miguel de Icaza <miguel@ximian.com>
21617 * typemanager.cs (LookupType): Added a negative-hit hashtable for
21618 the Type lookups, as we perform quite a number of lookups on
21619 non-Types. This can be removed once we can deterministically tell
21620 whether we have a type or a namespace in advance.
21622 But this might require special hacks from our corlib.
21626 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
21627 and double which avoids a conversion from an integer to a double.
21629 * expression.cs: tiny optimization, avoid calling IsConstant,
21630 because it effectively performs the lookup twice.
21632 2002-11-06 Miguel de Icaza <miguel@ximian.com>
21634 But a bogus return here to keep the semantics of the old code
21635 until the Mono runtime is fixed.
21637 * pending.cs (GetMissingInterfaces): New method used to remove all
21638 the interfaces that are already implemented by our parent
21639 classes from the list of pending methods.
21641 * interface.cs: Add checks for calls after ResolveTypeExpr.
21643 2002-11-05 Miguel de Icaza <miguel@ximian.com>
21645 * class.cs (Class.Emit): Report warning 67: event not used if the
21646 warning level is beyond 3.
21648 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
21649 being a NullLiteral.
21651 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
21654 * class.cs (TypeContainer.GetClassBases): Cover a missing code
21655 path that might fail if a type can not be resolved.
21657 * expression.cs (Binary.Emit): Emit unsigned versions of the
21660 * driver.cs: use error 5.
21662 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
21664 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
21666 2002-11-01 Miguel de Icaza <miguel@ximian.com>
21668 * cs-parser.jay (switch_section): A beautiful patch from Martin
21669 Baulig that fixed 33094.
21671 2002-10-31 Miguel de Icaza <miguel@ximian.com>
21673 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
21674 Check whether the base is abstract and report an error if so.
21676 * expression.cs (IndexerAccess.DoResolveLValue,
21677 IndexerAccess.DoResolve): ditto.
21679 (Invocation.DoResolve): ditto.
21681 (Invocation.FullMethodDesc): Improve the report string.
21683 * statement.cs (Block): Eliminate IsVariableDefined as it is
21684 basically just a wrapper for GetVariableInfo.
21686 * ecore.cs (SimpleName): Use new
21688 * support.cs (ReflectionParamter.ParameterType): We unwrap the
21689 type, as we return the actual parameter ref/unref state on a
21692 2002-10-30 Miguel de Icaza <miguel@ximian.com>
21694 * support.cs: Return proper flags REF/OUT fixing the previous
21697 * expression.cs: Reverted last patch, that was wrong. Is_ref is
21698 not used to mean `ref' but `ref or out' in ParameterReference
21700 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
21701 full type signature instead of calling TypeManger.CSharpName
21704 * support.cs (InternalParameters.ParameterDesc): Do not compare
21705 directly to the modflags, because REF/OUT will actually be bitsets
21708 * delegate.cs (VerifyMethod): Check also the modifiers.
21710 * cs-tokenizer.cs: Fix bug where floating point values with an
21711 exponent where a sign was missing was ignored.
21713 * driver.cs: Allow multiple assemblies to be specified in a single
21716 2002-10-28 Miguel de Icaza <miguel@ximian.com>
21718 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
21719 because identifiers after a parenthesis would end up in this kind
21720 of production, and we needed to desamiguate it for having casts
21723 (UserDefinedType *) xxx
21725 2002-10-24 Miguel de Icaza <miguel@ximian.com>
21727 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
21728 we should set on the Bindingflags.NonPublic, but not turn on
21729 private_ok. private_ok controls whether a Private member is
21730 returned (this is chekced on the filter routine), while the
21731 BindingFlags.NonPublic just controls whether private/protected
21732 will be allowed. This fixes the problem part of the problem of
21733 private properties being allowed to be used in derived classes.
21735 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
21736 so we can call the children DoResolveLValue method (this will
21737 properly signal errors on lvalue assignments to base properties)
21739 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
21740 getter are null, and we have a property info, we know that this
21741 happened because the lookup failed, so we report an error 122 for
21742 protection level violation.
21744 We also silently return if setter and getter are null in the
21745 resolve functions, this condition only happens if we have flagged
21746 the error before. This is the other half of the problem.
21748 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
21749 not have accessibility information, that is why we were returning
21750 true in the filter function in typemanager.cs.
21752 To properly report 122 (property is inaccessible because of its
21753 protection level) correctly, we report this error in ResolveAccess
21754 by failing if both the setter and the getter are lacking (ie, the
21757 DoResolve and DoLResolve have been modified to check for both
21758 setter/getter being null and returning silently, the reason being
21759 that I did not want to put the knowledge about this error in upper
21762 int old = Report.Errors;
21763 x = new PropertyExpr (...);
21764 if (old != Report.Errors)
21769 So the property expr is returned, but it is invalid, so the error
21770 will be flagged during the resolve process.
21772 * class.cs: Remove InheritablePropertySignatureCompare from the
21773 class, as we no longer depend on the property signature to compute
21774 whether it is possible to implement a method or not.
21776 The reason is that calling PropertyInfo.GetGetMethod will return
21777 null (in .NET, in Mono it works, and we should change this), in
21778 cases where the Get Method does not exist in that particular
21783 class X { public virtual int A { get { return 1; } } }
21785 class Z : Y { public override int A { get { return 2; } } }
21787 Would fail in Z because the parent (Y) would not have the property
21788 defined. So we avoid this completely now (because the alternative
21789 fix was ugly and slow), and we now depend exclusively on the
21792 (PropertyBase.CheckBase): Use a method-base mechanism to find our
21793 reference method, instead of using the property.
21795 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
21796 routines are gone now.
21798 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
21799 names, they were incorrectly named.
21801 * cs-tokenizer.cs: Return are more gentle token on failure.
21803 * pending.cs (PendingImplementation.InterfaceMethod): This routine
21804 had an out-of-sync index variable, which caused it to remove from
21805 the list of pending methods the wrong method sometimes.
21807 2002-10-22 Miguel de Icaza <miguel@ximian.com>
21809 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
21810 CanWrite, because those refer to this particular instance of the
21811 property, and do not take into account the fact that we can
21812 override single members of a property.
21814 Constructor requires an EmitContext. The resolution process does
21815 not happen here, but we need to compute the accessors before,
21816 because the resolution does not always happen for properties.
21818 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
21819 subclass, before we did not update this flag, but we did update
21822 (GetAccessors): Drop this routine, as it did not work in the
21823 presence of partially overwritten set/get methods.
21825 Notice that this broke the cs1540 detection, but that will require
21828 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21832 * driver.cs: issue a warning instead of an error if we don't support
21833 debugging for the platform. Also ignore a couple of errors that may
21834 arise when trying to write the symbols. Undo my previous patch.
21836 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21838 * driver.cs: ignore /debug switch except for Unix platforms.
21840 2002-10-23 Nick Drochak <ndrochak@gol.com>
21842 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
21844 2002-10-21 Miguel de Icaza <miguel@ximian.com>
21846 * driver.cs: Do not make mcs-debug conditional, so we do not break
21847 builds that use it.
21849 * statement.cs (UsageVector.MergeChildren): I would like Martin to
21850 review this patch. But basically after all the children variables
21851 have been merged, the value of "Breaks" was not being set to
21852 new_breaks for Switch blocks. I think that it should be set after
21853 it has executed. Currently I set this to the value of new_breaks,
21854 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
21855 conservative, but I do not understand this code very well.
21857 I did not break anything in the build, so that is good ;-)
21859 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
21861 2002-10-20 Mark Crichton <crichton@gimp.org>
21863 * cfold.cs: Fixed compile blocker. Really fixed it this time.
21865 2002-10-20 Nick Drochak <ndrochak@gol.com>
21867 * cfold.cs: Fixed compile blocker.
21869 2002-10-20 Miguel de Icaza <miguel@ximian.com>
21871 * driver.cs: I was chekcing the key, not the file.
21873 2002-10-19 Ravi Pratap <ravi@ximian.com>
21875 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
21876 message that we were generating - we just need to silently return
21879 2002-10-19 Miguel de Icaza <miguel@ximian.com>
21881 * class.cs (Event.Define): Change my previous commit, as this
21882 breaks the debugger. This is a temporary hack, as it seems like
21883 the compiler is generating events incorrectly to begin with.
21885 * expression.cs (Binary.ResolveOperator): Added support for
21886 "U operator - (E x, E y)"
21888 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
21891 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
21892 init-only variables, but this path did not take into account that
21893 there might be also instance readonly variables. Correct this
21896 This fixes bug 32253
21898 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
21901 * driver.cs: Change the extension for modules to `netmodule'
21903 * cs-parser.jay: Improved slightly the location tracking for
21904 the debugger symbols.
21906 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
21907 modifiers that were specified instead of the hardcoded value
21908 (FamAndAssem). This was basically ignoring the static modifier,
21909 and others. Fixes 32429.
21911 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
21912 fixed a bug in the process (32476)
21914 * expression.cs (ArrayAccess.EmitAssign): Patch from
21915 hwang_rob@yahoo.ca that fixes bug 31834.3
21917 2002-10-18 Miguel de Icaza <miguel@ximian.com>
21919 * driver.cs: Make the module extension .netmodule.
21921 2002-10-16 Miguel de Icaza <miguel@ximian.com>
21923 * driver.cs: Report an error if the resource file is not found
21924 instead of crashing.
21926 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
21927 false, like Emit does.
21929 2002-10-16 Nick Drochak <ndrochak@gol.com>
21931 * typemanager.cs: Remove unused private member. Also reported mcs
21932 bug to report this as a warning like csc.
21934 2002-10-15 Martin Baulig <martin@gnome.org>
21936 * statement.cs (Statement.Emit): Made this a virtual method; emits
21937 the line number info and calls DoEmit().
21938 (Statement.DoEmit): New protected abstract method, formerly knows
21939 as Statement.Emit().
21941 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
21943 2002-10-11 Miguel de Icaza <miguel@ximian.com>
21945 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
21946 have fixed a remaining problem: not every AddXXXX was adding a
21947 fully qualified name.
21949 Now everyone registers a fully qualified name in the DeclSpace as
21950 being defined instead of the partial name.
21952 Downsides: we are slower than we need to be due to the excess
21953 copies and the names being registered this way.
21955 The reason for this is that we currently depend (on the corlib
21956 bootstrap for instance) that types are fully qualified, because
21957 we dump all the types in the namespace, and we should really have
21958 types inserted into the proper namespace, so we can only store the
21959 basenames in the defined_names array.
21961 2002-10-10 Martin Baulig <martin@gnome.org>
21963 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
21964 from bug #31834, see the bug report for a testcase which is
21967 2002-10-10 Martin Baulig <martin@gnome.org>
21969 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
21970 flow analysis code for this.
21972 * statement.cs (Do, While, For): Tell the flow analysis code about
21974 (FlowBranching.UsageVector): Added support for infinite loops.
21975 (Block.Resolve): Moved the dead code elimination here and use flow
21978 2002-10-09 Miguel de Icaza <miguel@ximian.com>
21980 * class.cs (Field.Define): Catch cycles on struct type
21983 * typemanager.cs (IsUnmanagedtype): Do not recursively check
21984 fields if the fields are static. We only need to check instance
21987 * expression.cs (As.DoResolve): Test for reference type.
21989 * statement.cs (Using.ResolveExpression): Use
21990 ConvertImplicitRequired, not ConvertImplicit which reports an
21992 (Using.ResolveLocalVariableDecls): ditto.
21994 * expression.cs (Binary.ResolveOperator): Report errors in a few
21995 places where we had to.
21997 * typemanager.cs (IsUnmanagedtype): Finish implementation.
21999 2002-10-08 Miguel de Icaza <miguel@ximian.com>
22001 * expression.cs: Use StoreFromPtr instead of extracting the type
22002 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
22004 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
22005 an enumeration value to a System.Enum, but System.Enum is not a
22006 value type, but an class type, so we need to box.
22008 (Expression.ConvertExplicit): One codepath could return
22009 errors but not flag them. Fix this. Fixes #31853
22011 * parameter.cs (Resolve): Do not allow void as a parameter type.
22013 2002-10-06 Martin Baulig <martin@gnome.org>
22015 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
22016 if it's a class type and not a struct. Fixes #31815.
22018 2002-10-06 Martin Baulig <martin@gnome.org>
22020 * statement.cs: Reworked the flow analysis code a bit to make it
22021 usable for dead code elimination.
22023 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22025 * cs-parser.jay: allow empty source files. Fixes bug #31781.
22027 2002-10-04 Miguel de Icaza <miguel@ximian.com>
22029 * expression.cs (ComposedCast.DoResolveType): A quick workaround
22030 to fix the test 165, will investigate deeper.
22032 2002-10-04 Martin Baulig <martin@gnome.org>
22034 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
22035 finally blocks actually work.
22036 (Try.Resolve): We don't need to create a sibling for `finally' if
22037 there is no finally block.
22039 2002-10-04 Martin Baulig <martin@gnome.org>
22041 * class.cs (Constructor.Define): The default accessibility for a
22042 non-default constructor is private, not public.
22044 2002-10-04 Miguel de Icaza <miguel@ximian.com>
22046 * class.cs (Constructor): Make AllowedModifiers public, add
22049 * cs-parser.jay: Perform the modifiers test here, as the
22050 constructor for the Constructor class usually receives a zero
22051 because of the way we create it (first we create, later we
22052 customize, and we were never checking the modifiers).
22054 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
22055 is a version of LookupTypeReflection that includes the type-name
22056 cache. This can be used as a fast path for functions that know
22057 the fully qualified name and are only calling into *.GetType() to
22058 obtain a composed type.
22060 This is also used by TypeManager.LookupType during its type
22063 (LookupType): We now also track the real type name, as sometimes
22064 we can get a quey for the real type name from things like
22065 ComposedCast. This fixes bug 31422.
22067 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
22068 complete type fullname, it does not have to go through the type
22069 resolution system to obtain the composed version of the type (for
22070 obtaining arrays or pointers).
22072 (Conditional.Emit): Use the EmitBoolExpression to
22073 generate nicer code, as requested by Paolo.
22075 (ArrayCreation.CheckIndices): Use the patch from
22076 hwang_rob@yahoo.ca to validate the array initializers.
22078 2002-10-03 Miguel de Icaza <miguel@ximian.com>
22080 * class.cs (ConstructorInitializer.Emit): simplify code by using
22081 Invocation.EmitCall, and at the same time, fix the bugs in calling
22082 parent constructors that took variable arguments.
22084 * ecore.cs (Expression.ConvertNumericExplicit,
22085 Expression.ImplicitNumericConversion): Remove the code that
22086 manually wrapped decimal (InternalTypeConstructor call is now gone
22089 * expression.cs (Cast.TryReduce): Also handle decimal types when
22090 trying to perform a constant fold on the type.
22092 * typemanager.cs (IsUnmanagedtype): Partially implemented.
22094 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
22095 that only turned off an error report, and did nothing else.
22097 2002-10-02 Miguel de Icaza <miguel@ximian.com>
22099 * driver.cs: Handle and ignore /fullpaths
22101 2002-10-01 Miguel de Icaza <miguel@ximian.com>
22103 * expression.cs (Binary.ResolveOperator): Catch the case where
22104 DoNumericPromotions returns true,
22106 (Binary.DoNumericPromotions): Simplify the code, and the tests.
22108 2002-09-27 Miguel de Icaza <miguel@ximian.com>
22110 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
22113 2002-09-26 Miguel de Icaza <miguel@ximian.com>
22115 * ecore.cs (ConvertNumericExplicit): It is not enough that the
22116 conversion exists, but it is also required that the conversion be
22117 performed. This manifested in "(Type64Enum) 2".
22119 * class.cs (TypeManager.AddMethod): The fix is not to change
22120 AddEnum, because that one was using a fully qualified name (every
22121 DeclSpace derivative does), but to change the AddMethod routine
22122 that was using an un-namespaced name. This now correctly reports
22123 the duplicated name.
22125 Revert patch until I can properly fix it. The issue
22126 is that we have a shared Type space across all namespaces
22127 currently, which is wrong.
22129 Options include making the Namespace a DeclSpace, and merge
22130 current_namespace/current_container in the parser.
22132 2002-09-25 Miguel de Icaza <miguel@ximian.com>
22134 * cs-parser.jay: Improve error reporting when we get a different
22135 kind of expression in local_variable_type and
22136 local_variable_pointer_type.
22138 Propagate this to avoid missleading errors being reported.
22140 * ecore.cs (ImplicitReferenceConversion): treat
22141 TypeManager.value_type as a target just like object_type. As
22146 Is valid, and needs to result in the int 1 being boxed before it
22147 is assigned to the value type v.
22149 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
22150 to validate the enumeration name.
22152 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
22153 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
22154 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
22156 * ecore.cs (TryImplicitIntConversion): When doing an
22157 implicit-enumeration-conversion, check if the type is 64-bits and
22158 perform a conversion before passing to EnumConstant.
22160 2002-09-23 Miguel de Icaza <miguel@ximian.com>
22162 * decl.cs (Error_AmbiguousTypeReference); New routine used to
22163 report ambiguous type references. Unlike the MS version, we
22164 report what the ambiguity is. Innovation at work ;-)
22166 (DeclSpace.FindType): Require a location argument to
22167 display when we display an ambiguous error.
22169 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
22171 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
22173 * expression.cs (EmitDynamicInitializers): Apply patch from
22174 hwang_rob@yahoo.ca that fixes the order in which we emit our
22177 2002-09-21 Martin Baulig <martin@gnome.org>
22179 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
22180 delegate takes no arguments.
22182 2002-09-20 Miguel de Icaza <miguel@ximian.com>
22184 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
22187 * expression.cs: Extract the underlying type.
22189 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
22191 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
22193 2002-09-19 Miguel de Icaza <miguel@ximian.com>
22195 * class.cs (TypeContainer.DefineType): We can not use the nice
22196 PackingSize with the size set to 1 DefineType method, because it
22197 will not allow us to define the interfaces that the struct
22200 This completes the fixing of bug 27287
22202 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
22203 means also structs. This fixes part of the problem.
22204 (Expresion.ImplicitReferenceConversionExists): ditto.
22206 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
22207 error if there were no errors reported during the type lookup
22208 process, to avoid duplicates or redundant errors. Without this
22209 you would get an ambiguous errors plus a type not found. We have
22210 beaten the user enough with the first error.
22212 (DeclSparce.FindType): Emit a warning if we have an ambiguous
22215 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
22216 during the resolution process, stop the lookup, this avoids
22217 repeated error reports (same error twice).
22219 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
22221 * typemanager.cs (LookupType): Redo the type lookup code to match
22222 the needs of System.Reflection.
22224 The issue is that System.Reflection requires references to nested
22225 types to begin with a "+" sign instead of a dot. So toplevel
22226 types look like: "NameSpace.TopLevelClass", and nested ones look
22227 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
22230 2002-09-19 Martin Baulig <martin@gnome.org>
22232 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
22233 says that a method always returns or always throws an exception,
22234 don't report the CS0161.
22236 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
22237 set `Returns = new_returns'.
22239 2002-09-19 Martin Baulig <martin@gnome.org>
22241 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
22242 to an enum constant, check for a CS0176.
22244 2002-09-18 Miguel de Icaza <miguel@ximian.com>
22246 * class.cs (TypeContainer.CheckPairedOperators): Now we check
22247 for operators that must be in pairs and report errors.
22249 * ecore.cs (SimpleName.DoResolveType): During the initial type
22250 resolution process, when we define types recursively, we must
22251 check first for types in our current scope before we perform
22252 lookups in the enclosing scopes.
22254 * expression.cs (MakeByteBlob): Handle Decimal blobs.
22256 (Invocation.VerifyArgumentsCompat): Call
22257 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
22258 I thought we were supposed to always call this, but there are a
22259 few places in the code where we dont do it.
22261 2002-09-17 Miguel de Icaza <miguel@ximian.com>
22263 * driver.cs: Add support in -linkres and -resource to specify the
22264 name of the identifier.
22266 2002-09-16 Miguel de Icaza <miguel@ximian.com>
22268 * ecore.cs (StandardConversionExists): Sync with the conversion
22269 code: allow anything-* to void* conversions.
22271 (FindMostSpecificSource): Use an Expression argument
22272 instead of a Type, because we might be handed over a Literal which
22273 gets a few more implicit conversions that plain types do not. So
22274 this information was being lost.
22276 Also, we drop the temporary type-holder expression when not
22279 2002-09-17 Martin Baulig <martin@gnome.org>
22281 * class.cs (PropertyBase.CheckBase): Don't check the base class if
22282 this is an explicit interface implementation.
22284 2002-09-17 Martin Baulig <martin@gnome.org>
22286 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
22287 different `IndexerName' attributes.
22289 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
22290 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
22291 virtual CommonResolve().
22293 2002-09-16 Miguel de Icaza <miguel@ximian.com>
22295 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
22296 and convert that to the UnderlyingType.
22298 * statement.cs (Foreach.Resolve): Indexers are just like variables
22299 or PropertyAccesses.
22301 * cs-tokenizer.cs (consume_string): Track line numbers and columns
22302 inside quoted strings, we were not doing this before.
22304 2002-09-16 Martin Baulig <martin@gnome.org>
22306 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
22307 resolve it. This is needed for the definite assignment check of the
22308 instance expression, fixes bug #29846.
22309 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
22311 2002-09-16 Nick Drochak <ndrochak@gol.com>
22313 * parameter.cs: Fix compile error. Cannot reference static member
22314 from an instance object. Is this an mcs bug?
22316 2002-09-14 Martin Baulig <martin@gnome.org>
22318 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
22319 multiple times. Fixes bug #30295, added test-166.cs.
22321 2002-09-14 Martin Baulig <martin@gnome.org>
22323 * statement.cs (Block.Emit): Don't emit unreachable code.
22324 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
22325 `break' statements.
22326 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
22328 2002-09-14 Martin Baulig <martin@gnome.org>
22330 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
22333 2002-09-14 Martin Baulig <martin@gnome.org>
22335 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
22336 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
22337 be false on the ms runtime.
22339 2002-09-13 Martin Baulig <martin@gnome.org>
22341 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
22342 the CS0038 error message.
22344 2002-09-12 Miguel de Icaza <miguel@ximian.com>
22346 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
22347 constant inside, return it.
22349 2002-09-12 Martin Baulig <martin@gnome.org>
22351 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
22352 implicit conversion can be done between enum types.
22354 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
22355 check whether an implicit conversion to the current enum's UnderlyingType
22356 exists and report an error if not.
22358 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
22359 without debugging support.
22361 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
22362 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
22364 2002-09-12 Martin Baulig <martin@gnome.org>
22366 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
22368 * ecore.cs (IMemberExpr.DeclaringType): New property.
22369 (SimpleName.SimpleNameResolve): Check whether we're accessing a
22370 nonstatic member of an outer type (CS0038).
22372 2002-09-11 Miguel de Icaza <miguel@ximian.com>
22374 * driver.cs: Activate the using-error detector at warning level
22375 4 (at least for MS-compatible APIs).
22377 * namespace.cs (VerifyUsing): Small buglett fix.
22379 * pending.cs (PendingImplementation): pass the container pointer.
22381 * interface.cs (GetMethods): Allow for recursive definition. Long
22382 term, I would like to move every type to support recursive
22383 definitions, not the current ordering mechanism that we have right
22386 The situation is this: Attributes are handled before interfaces,
22387 so we can apply attributes to interfaces. But some attributes
22388 implement interfaces, we will now handle the simple cases
22389 (recursive definitions will just get an error).
22391 * parameter.cs: Only invalidate types at the end if we fail to
22394 2002-09-09 Martin Baulig <martin@gnome.org>
22396 * ecore.cs (PropertyExpr.Emit): Also check for
22397 TypeManager.system_int_array_get_length so this'll also work when
22398 compiling corlib. Fixes #30003.
22400 2002-09-09 Martin Baulig <martin@gnome.org>
22402 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
22403 and throw an exception if we can't get the type's size. Fixed #30040,
22406 2002-09-09 Martin Baulig <martin@gnome.org>
22408 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
22410 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
22411 context. Fixes bug #30027.
22413 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
22414 virtual functions. Fixes bug #30043, added test-164.cs.
22416 2002-09-08 Ravi Pratap <ravi@ximian.com>
22418 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
22420 2002-09-08 Nick Drochak <ndrochak@gol.com>
22422 * driver.cs: Use an object to get the windows codepage since it's not a
22425 2002-09-08 Miguel de Icaza <miguel@ximian.com>
22427 * statement.cs (For.Emit): for infinite loops (test == null)
22428 return whether there is a break inside, not always "true".
22430 * namespace.cs (UsingEntry): New struct to hold the name of the
22431 using definition, the location where it is defined, and whether it
22432 has been used in a successful type lookup.
22434 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
22439 2002-09-06 Ravi Pratap <ravi@ximian.com>
22441 * attribute.cs : Fix incorrect code which relied on catching
22442 a NullReferenceException to detect a null being passed in
22443 where an object was expected.
22445 2002-09-06 Miguel de Icaza <miguel@ximian.com>
22447 * statement.cs (Try): flag the catch variable as assigned
22449 * expression.cs (Cast): Simplified by using ResolveType instead of
22450 manually resolving.
22452 * statement.cs (Catch): Fix bug by using ResolveType.
22454 2002-09-06 Ravi Pratap <ravi@ximian.com>
22456 * expression.cs (BetterConversion): Special case for when we have
22457 a NullLiteral as the argument and we have to choose between string
22458 and object types - we choose string the way csc does.
22460 * attribute.cs (Attribute.Resolve): Catch the
22461 NullReferenceException and report error #182 since the Mono
22462 runtime no more has the bug and having this exception raised means
22463 we tried to select a constructor which takes an object and is
22466 2002-09-05 Ravi Pratap <ravi@ximian.com>
22468 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
22469 message (1502, 1503) when we can't locate a method after overload
22470 resolution. This is much more informative and closes the bug
22473 * interface.cs (PopulateMethod): Return if there are no argument
22474 types. Fixes a NullReferenceException bug.
22476 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
22477 expressions too. Previously we were checking only in one place for
22478 positional arguments leaving out named arguments.
22480 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
22481 type to the enum type is not allowed. Remove code corresponding to
22484 (ConvertNumericExplicit): Allow explicit conversions from
22485 the underlying type to enum type. This precisely follows the spec
22486 and closes a bug filed by Gonzalo.
22488 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22491 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
22493 2002-09-03 Miguel de Icaza <miguel@ximian.com>
22495 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
22496 it was important that we stored the right value after the
22497 reduction in `converted'.
22499 2002-09-04 Martin Baulig <martin@gnome.org>
22501 * location.cs (Location.SymbolDocument): Use full pathnames for the
22504 2002-08-30 Miguel de Icaza <miguel@ximian.com>
22506 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
22507 of the expression resolve mechanism, because that will catch the
22508 SimpleName error failures.
22510 (Conditional): If we can not resolve the
22511 expression, return, do not crash.
22513 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22516 (location): display token name instead of its number.
22518 2002-08-28 Martin Baulig <martin@gnome.org>
22520 * expression.cs (Binary.ResolveOperator): Don't silently return
22521 but return an error if an operator cannot be applied between two
22524 2002-08-28 Martin Baulig <martin@gnome.org>
22526 * class.cs (Constructor.Define): Set the permission attributes
22527 correctly instead of making all constructors public.
22529 2002-08-28 Martin Baulig <martin@gnome.org>
22531 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
22532 for private members before reporting a CS0103; if we find anything,
22535 2002-08-28 Martin Baulig <martin@gnome.org>
22537 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
22538 to check whether `closure_start_type == closure_invocation_type',
22539 we also need to check whether `m.DeclaringType == closure_invocation_type'
22540 before bypassing the permission checks. We might be accessing
22541 protected/private members from the base class.
22542 (TypeManager.RealMemberLookup): Only set private_ok if private
22543 members were requested via BindingFlags.NonPublic.
22545 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
22547 * expression.cs (MemberAccess.ResolveMemberAccess): Set
22548 MethodGroupExpr.IsExplicitImpl if appropriate.
22549 (Invocation.DoResolve): Don't report the CS0120 for explicit
22550 interface implementations.
22552 2002-08-27 Martin Baulig <martin@gnome.org>
22554 * expression.cs (Invocation.DoResolve): If this is a static
22555 method and we don't have an InstanceExpression, we must report
22558 2002-08-25 Martin Baulig <martin@gnome.org>
22560 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
22561 `==' between a valuetype and an object.
22563 2002-08-25 Miguel de Icaza <miguel@ximian.com>
22565 * ecore.cs (TypeExpr): Provide a ToString method.
22567 2002-08-24 Martin Baulig <martin@gnome.org>
22569 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
22570 now called proggie.dbg and it's a binary file.
22572 2002-08-23 Martin Baulig <martin@gnome.org>
22574 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
22576 2002-08-23 Martin Baulig <martin@gnome.org>
22578 * struct.cs (MyStructInfo.ctor): Make this work with empty
22579 structs; it's not allowed to use foreach() on null.
22581 2002-08-23 Martin Baulig <martin@gnome.org>
22583 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
22584 writer the full pathname of the generated assembly.
22586 2002-08-23 Martin Baulig <martin@gnome.org>
22588 * statements.cs (FlowBranching.UsageVector.MergeChildren):
22589 A `finally' block never returns or breaks; improved handling of
22592 2002-08-23 Martin Baulig <martin@gnome.org>
22594 * statement.cs (Throw.Resolve): Allow `throw null'.
22596 2002-08-23 Martin Baulig <martin@gnome.org>
22598 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
22599 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
22600 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
22601 MemberLookup would return a wrong event if this is an explicit
22602 interface implementation and the class has an event with the same
22605 2002-08-23 Martin Baulig <martin@gnome.org>
22607 * statement.cs (Block.AddChildVariableNames): New public method.
22608 (Block.AddChildVariableName): Likewise.
22609 (Block.IsVariableNameUsedInChildBlock): Likewise.
22610 (Block.AddVariable): Check whether a variable name has already
22611 been used in a child block.
22613 * cs-parser.jay (declare_local_variables): Mark all variable names
22614 from the current block as being used in a child block in the
22617 2002-08-23 Martin Baulig <martin@gnome.org>
22619 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
22620 find the symbol writer.
22622 * driver.cs: csc also allows the arguments to /define being
22623 separated by commas, not only by semicolons.
22625 2002-08-23 Martin Baulig <martin@gnome.org>
22627 * interface.cs (Interface.GetMembers): Added static check for events.
22629 2002-08-15 Martin Baulig <martin@gnome.org>
22631 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
22632 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
22634 * ecore.cs (Expression.MemberLookup): Added documentation and explained
22635 why the MethodData.EmitDestructor() change was necessary.
22637 2002-08-20 Martin Baulig <martin@gnome.org>
22639 * class.cs (TypeContainer.FindMembers): Added static check for events.
22641 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
22643 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
22644 use Type.GetEvents(), not Type.FindMembers().
22646 2002-08-20 Martin Baulig <martin@gnome.org>
22648 * decl.cs (MemberCache): Added a special method cache which will
22649 be used for method-only searched. This ensures that a method
22650 search will return a MethodInfo with the correct ReflectedType for
22653 2002-08-20 Martin Baulig <martin@gnome.org>
22655 * decl.cs (DeclSpace.FindMembers): Made this public.
22657 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22659 * delegate.cs: fixed build on windows.
22660 [FIXME: Filed as bug #29150: MCS must report these errors.]
22662 2002-08-19 Ravi Pratap <ravi@ximian.com>
22664 * ecore.cs (StandardConversionExists): Return a false
22665 if we are trying to convert the void type to anything else
22666 since that is not allowed.
22668 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
22669 we flag error 70 in the event an event is trying to be accessed
22670 directly from outside the declaring type.
22672 2002-08-20 Martin Baulig <martin@gnome.org>
22674 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
22675 MemberCache from typemanager.cs to decl.cs.
22677 2002-08-19 Martin Baulig <martin@gnome.org>
22679 * class.cs (TypeContainer): Implement IMemberContainer.
22680 (TypeContainer.DefineMembers): Create the MemberCache.
22681 (TypeContainer.FindMembers): Do better BindingFlags checking; only
22682 return public members if BindingFlags.Public was given, check
22683 whether members are static.
22685 2002-08-16 Martin Baulig <martin@gnome.org>
22687 * decl.cs (DeclSpace.Define): Splitted this in Define and
22688 DefineMembers. DefineMembers is called first and initializes the
22691 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
22692 DefineMembers() on all our DeclSpaces.
22694 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
22695 but call DefineMembers() on all nested interfaces. We call their
22696 Define() in our new Define() function.
22698 * interface.cs (Interface): Implement IMemberContainer.
22699 (Interface.Define): Moved all code except the attribute stuf to
22701 (Interface.DefineMembers): Initialize the member cache.
22703 * typemanager.cs (IMemberFinder): Removed this interface, we don't
22704 need this anymore since we can use MemberCache.FindMembers directly.
22706 2002-08-19 Martin Baulig <martin@gnome.org>
22708 * typemanager.cs (MemberCache): When creating the cache for an
22709 interface type, add all inherited members.
22710 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
22711 to `out bool used_cache' and documented it.
22712 (TypeManager.MemberLookup): If we already used the cache in the first
22713 iteration, we don't need to do the interfaces check.
22715 2002-08-19 Martin Baulig <martin@gnome.org>
22717 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
22718 here from IMemberFinder and don't implement this interface anymore.
22719 (DeclSpace.MemberCache): Moved here from IMemberFinder.
22721 * typemanager.cs (IMemberFinder): This interface is now only used by
22722 classes which actually support the member cache.
22723 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
22724 since we only put DeclSpaces into this Hashtable.
22725 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
22726 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
22728 2002-08-16 Martin Baulig <martin@gnome.org>
22730 * typemanager.cs (ICachingMemberFinder): Removed.
22731 (IMemberFinder.MemberCache): New property.
22732 (TypeManager.FindMembers): Merged this with RealFindMembers().
22733 This function will never be called from TypeManager.MemberLookup()
22734 so we can't use the cache here, just the IMemberFinder.
22735 (TypeManager.MemberLookup_FindMembers): Check whether the
22736 IMemberFinder has a MemberCache and call the cache's FindMembers
22738 (MemberCache): Rewrote larger parts of this yet another time and
22739 cleaned it up a bit.
22741 2002-08-15 Miguel de Icaza <miguel@ximian.com>
22743 * driver.cs (LoadArgs): Support quoting.
22745 (Usage): Show the CSC-like command line arguments.
22747 Improved a few error messages.
22749 2002-08-15 Martin Baulig <martin@gnome.org>
22751 * typemanager.cs (IMemberContainer.Type): New property.
22752 (IMemberContainer.IsInterface): New property.
22754 The following changes are conditional to BROKEN_RUNTIME, which is
22755 defined at the top of the file.
22757 * typemanager.cs (MemberCache.MemberCache): Don't add the base
22758 class'es members, but add all members from TypeHandle.ObjectType
22759 if we're an interface.
22760 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
22761 is the current type.
22762 (MemberCache.CacheEntry.Container): Removed this field.
22763 (TypeHandle.GetMembers): Include inherited members.
22765 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22767 * typemanager.cs: fixed compilation and added a comment on a field that
22770 2002-08-15 Martin Baulig <martin@gnome.org>
22772 * class.cs (ConstructorInitializer.Resolve): In the
22773 Expression.MemberLookup call, use the queried_type as
22776 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
22777 declared' attribute, it's always true.
22778 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
22779 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
22780 temporary wrapper for FindMembers which tells MemberLookup whether
22781 members from the base classes are included in the return value.
22782 This will go away soon.
22783 (TypeManager.MemberLookup): Use this temporary hack here; once the
22784 new MemberCache is completed, we don't need to do the DeclaredOnly
22785 looping here anymore since the MemberCache will take care of this.
22786 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
22787 (MemberCache): When creating the MemberCache for a class, get
22788 members from the current class and all its base classes.
22789 (MemberCache.CacheEntry.Container): New field. This is a
22790 temporary hack until the Mono runtime is fixed to distinguish
22791 between ReflectedType and DeclaringType. It allows us to use MCS
22792 with both the MS runtime and the unfixed Mono runtime without
22793 problems and without accecting performance.
22794 (MemberCache.SearchMembers): The DeclaredOnly looping from
22795 TypeManager.MemberLookup is now done here.
22797 2002-08-14 Martin Baulig <martin@gnome.org>
22799 * statement.cs (MyStructInfo.MyStructInfo): Don't call
22800 Type.GetFields on dynamic types but get the fields from the
22801 corresponding TypeContainer.
22802 (MyStructInfo.GetStructInfo): Added check for enum types.
22804 * typemanager.cs (MemberList.IsSynchronized): Implemented.
22805 (MemberList.SyncRoot): Implemented.
22806 (TypeManager.FilterWithClosure): No need to check permissions if
22807 closure_start_type == closure_invocation_type, don't crash if
22808 closure_invocation_type is null.
22810 2002-08-13 Martin Baulig <martin@gnome.org>
22812 Rewrote TypeContainer.FindMembers to use a member cache. This
22813 gives us a speed increase of about 35% for the self-hosting MCS
22814 build and of about 15-20% for the class libs (both on GNU/Linux).
22816 * report.cs (Timer): New class to get enhanced profiling. This
22817 whole class is "TIMER" conditional since it remarkably slows down
22820 * class.cs (MemberList): New class. This is an IList wrapper
22821 which we're now using instead of passing MemberInfo[]'s around to
22822 avoid copying this array unnecessarily.
22823 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
22824 (ICachingMemberFinder, IMemberContainer): New interface.
22825 (TypeManager.FilterWithClosure): If `criteria' is null, the name
22826 has already been checked, otherwise use it for the name comparision.
22827 (TypeManager.FindMembers): Renamed to RealMemberFinder and
22828 provided wrapper which tries to use ICachingMemberFinder.FindMembers
22829 if possible. Returns a MemberList, not a MemberInfo [].
22830 (TypeHandle): New class, implements IMemberContainer. We create
22831 one instance of this class per type, it contains a MemberCache
22832 which is used to do the member lookups.
22833 (MemberCache): New class. Each instance of this class contains
22834 all members of a type and a name-based hash table.
22835 (MemberCache.FindMembers): This is our new member lookup
22836 function. First, it looks up all members of the requested name in
22837 the hash table. Then, it walks this list and sorts out all
22838 applicable members and returns them.
22840 2002-08-13 Martin Baulig <martin@gnome.org>
22842 In addition to a nice code cleanup, this gives us a performance
22843 increase of about 1.4% on GNU/Linux - not much, but it's already
22844 half a second for the self-hosting MCS compilation.
22846 * typemanager.cs (IMemberFinder): New interface. It is used by
22847 TypeManager.FindMembers to call FindMembers on a TypeContainer,
22848 Enum, Delegate or Interface.
22849 (TypeManager.finder_to_member_finder): New PtrHashtable.
22850 (TypeManager.finder_to_container): Removed.
22851 (TypeManager.finder_to_delegate): Removed.
22852 (TypeManager.finder_to_interface): Removed.
22853 (TypeManager.finder_to_enum): Removed.
22855 * interface.cs (Interface): Implement IMemberFinder.
22857 * delegate.cs (Delegate): Implement IMemberFinder.
22859 * enum.cs (Enum): Implement IMemberFinder.
22861 * class.cs (TypeContainer): Implement IMemberFinder.
22863 2002-08-12 Martin Baulig <martin@gnome.org>
22865 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
22867 2002-08-12 Martin Baulig <martin@gnome.org>
22869 * ecore.cs (ITypeExpression): New interface for expressions which
22871 (TypeExpression): Renamed to TypeLookupExpression.
22872 (Expression.DoResolve): If we're doing a types-only lookup, the
22873 expression must implement the ITypeExpression interface and we
22874 call DoResolveType() on it.
22875 (SimpleName): Implement the new ITypeExpression interface.
22876 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
22877 hack, the situation that we're only looking up types can't happen
22878 anymore when this method is called. Moved the type lookup code to
22879 DoResolveType() and call it.
22880 (SimpleName.DoResolveType): This ITypeExpression interface method
22881 is now doing the types-only lookup.
22882 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
22883 (ResolveFlags): Added MaskExprClass.
22885 * expression.cs (MemberAccess): Implement the ITypeExpression
22887 (MemberAccess.DoResolve): Added support for a types-only lookup
22888 when we're called via ITypeExpression.DoResolveType().
22889 (ComposedCast): Implement the ITypeExpression interface.
22891 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
22892 Expression.Resolve() with ResolveFlags.Type instead.
22894 2002-08-12 Martin Baulig <martin@gnome.org>
22896 * interface.cs (Interface.Define): Apply attributes.
22898 * attribute.cs (Attribute.ApplyAttributes): Added support for
22899 interface attributes.
22901 2002-08-11 Martin Baulig <martin@gnome.org>
22903 * statement.cs (Block.Emit): Only check the "this" variable if we
22904 do not always throw an exception.
22906 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
22907 whether the property has a set accessor.
22909 2002-08-11 Martin Baulig <martin@gnome.org>
22911 Added control flow analysis support for structs.
22913 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
22914 with control flow analysis turned off.
22915 (IVariable): New interface.
22916 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
22917 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
22918 (FieldExpr.DoResolve): Resolve the instance expression with flow
22919 analysis turned off and do the definite assignment check after the
22920 resolving when we know what the expression will resolve to.
22922 * expression.cs (LocalVariableReference, ParameterReference):
22923 Implement the new IVariable interface, only call the flow analysis
22924 code if ec.DoFlowAnalysis is true.
22925 (This): Added constructor which takes a Block argument. Implement
22926 the new IVariable interface.
22927 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
22928 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
22929 This does the definite assignment checks for struct members.
22931 * class.cs (Constructor.Emit): If this is a non-static `struct'
22932 constructor which doesn't have any initializer, call
22933 Block.AddThisVariable() to tell the flow analysis code that all
22934 struct elements must be initialized before control returns from
22937 * statement.cs (MyStructInfo): New public class.
22938 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
22939 argument to this indexer. If non-zero, check an individual struct
22940 member, not the whole struct.
22941 (FlowBranching.CheckOutParameters): Check struct members.
22942 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
22943 overloaded versions of these methods which take an additional
22944 `int field_idx' argument to check struct members.
22945 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
22946 overloaded versions of these methods which take an additional
22947 `string field_name' argument to check struct member.s
22948 (VariableInfo): Implement the IVariable interface.
22949 (VariableInfo.StructInfo): New public property. Returns the
22950 MyStructInfo instance of the variable if it's a struct or null.
22951 (Block.AddThisVariable): New public method. This is called from
22952 Constructor.Emit() for non-static `struct' constructor which do
22953 not have any initializer. It creates a special variable for the
22954 "this" instance variable which will be checked by the flow
22955 analysis code to ensure that all of the struct's fields are
22956 initialized before control returns from the constructor.
22957 (UsageVector): Added support for struct members. If a
22958 variable/parameter is a struct with N members, we reserve a slot
22959 in the usage vector for each member. A struct is considered fully
22960 initialized if either the struct itself (slot 0) or all its
22961 members are initialized.
22963 2002-08-08 Martin Baulig <martin@gnome.org>
22965 * driver.cs (Driver.MainDriver): Only report an error CS5001
22966 if there were no compilation errors.
22968 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
22969 `UnsafeContext' property to determine whether the parent is in
22970 unsafe context rather than checking the parent's ModFlags:
22971 classes nested in an unsafe class are unsafe as well.
22973 2002-08-08 Martin Baulig <martin@gnome.org>
22975 * statement.cs (UsageVector.MergeChildren): Distinguish between
22976 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
22977 we return. Added test17() and test18() to test-154.cs.
22979 2002-08-08 Martin Baulig <martin@gnome.org>
22981 * typemanager.cs (TypeManager.FilterWithClosure): If we have
22982 Family access, make sure the invoking type isn't a subclass of the
22983 queried type (that'd be a CS1540).
22985 * ecore.cs (Expression.MemberLookup): Added overloaded version of
22986 this method which takes an additional `Type invocation_type'.
22988 * expression.cs (BaseAccess.DoResolve): Use the base type as
22989 invocation and query type.
22990 (MemberAccess.DoResolve): If the lookup failed and we're about to
22991 report a CS0122, try a lookup with the ec.ContainerType - if this
22992 succeeds, we must report a CS1540.
22994 2002-08-08 Martin Baulig <martin@gnome.org>
22996 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
22997 (MethodGroupExpr): Implement the IMemberExpr interface.
22999 * expression (MemberAccess.ResolveMemberAccess): No need to have
23000 any special code for MethodGroupExprs anymore, they're now
23003 2002-08-08 Martin Baulig <martin@gnome.org>
23005 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
23006 Family, FamANDAssem and FamORAssem permissions.
23007 (TypeManager.IsSubclassOrNestedChildOf): New public method.
23009 2002-08-08 Martin Baulig <martin@gnome.org>
23011 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
23012 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
23015 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
23017 * driver.cs: implemented /resource option to embed managed resources.
23019 2002-08-07 Martin Baulig <martin@gnome.org>
23021 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
23022 (FieldBase.HasFieldInitializer): New public property.
23023 (FieldBase.GetInitializerExpression): New public method. Resolves and
23024 returns the field initializer and makes sure it is only resolved once.
23025 (TypeContainer.EmitFieldInitializers): Call
23026 FieldBase.GetInitializerExpression to get the initializer, this ensures
23027 that it isn't resolved multiple times.
23029 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
23030 the resolving process (SimpleName/MemberLookup) that we're currently
23031 emitting a field initializer (which must not access any instance members,
23032 this is an error CS0236).
23034 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
23035 argument, if the `IsFieldInitializer' flag is set, we must report and
23036 error CS0236 and not an error CS0120.
23038 2002-08-07 Martin Baulig <martin@gnome.org>
23040 * ecore.cs (IMemberExpr): New public interface.
23041 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
23042 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
23043 if the expression is an IMemberExpr.
23045 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
23046 to be null, implicitly default to `this' if we're non-static in
23047 this case. Simplified the code a lot by using the new IMemberExpr
23048 interface. Also fixed bug #28176 here.
23050 2002-08-06 Martin Baulig <martin@gnome.org>
23052 * cs-parser.jay (SimpleLookup): Removed. We need to create
23053 ParameterReferences during semantic analysis so that we can do a
23054 type-only search when resolving Cast, TypeOf and SizeOf.
23055 (block): Pass the `current_local_parameters' to the Block's
23058 * class.cs (ConstructorInitializer): Added `Parameters parameters'
23059 argument to the constructor.
23060 (ConstructorInitializer.Resolve): Create a temporary implicit
23061 block with the parameters.
23063 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
23064 references here if we aren't doing a type-only search.
23066 * statement.cs (Block): Added constructor which takes a
23067 `Parameters parameters' argument.
23068 (Block.Parameters): New public property.
23070 * support.cs (InternalParameters.Parameters): Renamed `parameters'
23071 to `Parameters' and made it public readonly.
23073 2002-08-06 Martin Baulig <martin@gnome.org>
23075 * ecore.cs (Expression.Warning): Made this public as well.
23077 * report.cs (Report.Debug): Print the contents of collections.
23079 2002-08-06 Martin Baulig <martin@gnome.org>
23081 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
23082 used to tell Resolve() which kinds of expressions it may return.
23083 (Expression.Resolve): Added overloaded version of this method which
23084 takes a `ResolveFlags flags' argument. This can be used to tell
23085 Resolve() which kinds of expressions it may return. Reports a
23087 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
23088 ResolveFlags.SimpleName.
23089 (Expression.Error118): Added overloaded version of this method which
23090 takes a `ResolveFlags flags' argument. It uses the flags to determine
23091 which kinds of expressions are allowed.
23093 * expression.cs (Argument.ResolveMethodGroup): New public method.
23094 Resolves an argument, but allows a MethodGroup to be returned.
23095 This is used when invoking a delegate.
23097 * TODO: Updated a bit.
23099 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23101 Fixed compilation with csc.
23103 * ecore.cs: Expression.Error made public. Is this correct? Should
23104 Warning be made public too?
23106 * expression.cs: use ea.Location instead of ea.loc.
23107 [FIXME: Filed as bug #28607: MCS must report these errors.]
23109 2002-08-06 Martin Baulig <martin@gnome.org>
23111 * ecore.cs (Expression.loc): Moved the location here instead of
23112 duplicating it in all derived classes.
23113 (Expression.Location): New public property.
23114 (Expression.Error, Expression.Warning): Made them non-static and
23115 removed the location argument.
23116 (Expression.Warning): Added overloaded version which takes an
23117 `int level' argument.
23118 (Expression.Error118): Make this non-static and removed the
23119 expression and location arguments.
23120 (TypeExpr): Added location argument to the constructor.
23122 * expression.cs (StaticCallExpr): Added location argument to
23124 (Indirection, PointerArithmetic): Likewise.
23125 (CheckedExpr, UnCheckedExpr): Likewise.
23126 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
23127 (StringPtr): Likewise.
23130 2002-08-05 Martin Baulig <martin@gnome.org>
23132 * expression.cs (BaseAccess.DoResolve): Actually report errors.
23134 * assign.cs (Assign.DoResolve): Check whether the source
23135 expression is a value or variable.
23137 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
23138 while resolving the corresponding blocks.
23140 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
23141 an error, don't silently return null.
23143 * statement.cs (Block.AddVariable): Do the error reporting here
23144 and distinguish between CS0128 and CS0136.
23145 (Block.DoResolve): Report all unused labels (warning CS0164).
23146 (LabeledStatement): Pass the location to the constructor.
23147 (LabeledStatement.HasBeenReferenced): New property.
23148 (LabeledStatement.Resolve): Set it to true here.
23150 * statement.cs (Return.Emit): Return success even after reporting
23151 a type mismatch error (CS0126 or CS0127), this is what csc does and
23152 it avoids confusing the users with any consecutive errors.
23154 2002-08-05 Martin Baulig <martin@gnome.org>
23156 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
23158 * const.cs (Const.LookupConstantValue): Catch circular definitions.
23160 * expression.cs (MemberAccess.DoResolve): Silently return if an
23161 error has already been reported.
23163 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
23164 error has already been reported.
23166 2002-08-05 Martin Baulig <martin@gnome.org>
23168 * statement.cs (UsageVector): Only initialize the `parameters'
23169 vector if we actually have any "out" parameters.
23171 2002-08-05 Martin Baulig <martin@gnome.org>
23173 * expression.cs (Binary.ResolveOperator): When combining delegates,
23174 they must have the same type.
23176 2002-08-05 Martin Baulig <martin@gnome.org>
23178 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
23179 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
23180 work with the ms runtime and we also don't need it: if we're a
23181 PropertyBuilder and not in the `indexer_arguments' hash, then we
23182 are a property and not an indexer.
23184 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
23185 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
23186 since the latter one doesn't work with the ms runtime.
23188 2002-08-03 Martin Baulig <martin@gnome.org>
23190 Fixed bugs #27998 and #22735.
23192 * class.cs (Method.IsOperator): New public field.
23193 (Method.CheckBase): Report CS0111 if there's already a method
23194 with the same parameters in the current class. Report CS0508 when
23195 attempting to change the return type of an inherited method.
23196 (MethodData.Emit): Report CS0179 if a method doesn't have a body
23197 and it's not marked abstract or extern.
23198 (PropertyBase): New abstract base class for Property and Indexer.
23199 (PropertyBase.CheckBase): Moved here from Property and made it work
23201 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
23202 the same so we can reuse it there.
23203 (Property, Indexer): Derive from PropertyBase.
23204 (MethodSignature.inheritable_property_signature_filter): New delegate
23205 to find properties and indexers.
23207 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
23208 argument and improved error reporting.
23210 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
23211 EmptyReadOnlyParameters and made it a property.
23213 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
23214 version of this method which takes a `PropertyInfo indexer'.
23215 (TypeManager.RegisterIndexer): New method.
23217 * class.cs: Added myself as author of this file :-)
23219 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23221 * class.cs: fixed compilation on windoze.
23223 2002-08-03 Martin Baulig <martin@gnome.org>
23225 * interface.cs (Interface.GetInterfaceBases): Check whether all
23226 base interfaces are at least as accessible than the current one.
23228 * class.cs (TypeContainer.GetClassBases): Check whether base types
23229 are at least as accessible than the current type.
23230 (TypeContainer.AsAccessible): Implemented and made non-static.
23231 (MemberBase.CheckParameters): Report errors if the accessibility
23234 * delegate.cs (Delegate.Delegate): The default visibility is
23235 internal for top-level types and private for nested types.
23236 (Delegate.Define): Report errors if the accessibility checks fail.
23238 * enum.cs (Enum.Enum): The default visibility is internal for
23239 top-level types and private for nested types.
23240 (Enum.DefineType): Compute the correct visibility.
23242 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
23243 function which takes a `bool is_toplevel' instead of a TypeContainer.
23245 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
23248 2002-08-02 Martin Baulig <martin@gnome.org>
23250 * expression.cs (LocalVariableReferenc): Added constructor which
23251 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
23252 (LocalVariableReference.IsReadOnly): New property.
23253 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
23254 variable is readonly, use our own readonly flag to do this; you can
23255 use the new constructor to get a writable reference to a read-only
23258 * cs-parser.jay (foreach_statement, using_statement): Get a writable
23259 reference to the local variable.
23261 2002-08-01 Miguel de Icaza <miguel@ximian.com>
23263 * rootcontext.cs (ResolveCore): Also include System.Exception
23265 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
23266 we reach an EmptyStatement.
23268 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
23271 * expression.cs (Binary.ResolveOperator): Check error result in
23274 use brtrue/brfalse directly and avoid compares to null.
23276 2002-08-02 Martin Baulig <martin@gnome.org>
23278 * class.cs (TypeContainer.Define): Define all nested interfaces here.
23279 Fixes bug #28407, added test-155.cs.
23281 2002-08-01 Martin Baulig <martin@gnome.org>
23283 * class.cs (Event.EmitDefaultMethod): Make this work with static
23284 events. Fixes #28311, added verify-3.cs.
23286 2002-08-01 Martin Baulig <martin@gnome.org>
23288 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
23289 `is_disposable' fields.
23290 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
23291 `hm.is_disposable' if we're using the collection pattern.
23292 (Foreach.EmitCollectionForeach): Use the correct type for the
23293 enumerator's local variable, only emit the try/finally block if
23294 necessary (fixes #27713).
23296 2002-08-01 Martin Baulig <martin@gnome.org>
23298 * ecore.cs (Expression.report118): Renamed to Error118 and made
23301 * statement.cs (Throw.Resolve): Check whether the expression is of
23302 the correct type (CS0118) and whether the type derives from
23303 System.Exception (CS0155).
23304 (Catch.Resolve): New method. Do the type lookup here and check
23305 whether it derives from System.Exception (CS0155).
23306 (Catch.CatchType, Catch.IsGeneral): New public properties.
23308 * typemanager.cs (TypeManager.exception_type): Added.
23310 2002-07-31 Miguel de Icaza <miguel@ximian.com>
23312 * driver.cs: Updated About function.
23314 2002-07-31 Martin Baulig <martin@gnome.org>
23316 Implemented Control Flow Analysis.
23318 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
23319 (EmitContext.CurrentBranching): Added.
23320 (EmitContext.StartFlowBranching): Added.
23321 (EmitContext.EndFlowBranching): Added.
23322 (EmitContext.KillFlowBranching): Added.
23323 (EmitContext.IsVariableAssigned): Added.
23324 (EmitContext.SetVariableAssigned): Added.
23325 (EmitContext.IsParameterAssigned): Added.
23326 (EmitContext.SetParameterAssigned): Added.
23327 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
23328 Added control flow analysis stuff here.
23330 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
23331 resolve the expression as lvalue.
23332 (LocalVariableReference.DoResolve): Check whether the variable has
23333 already been assigned.
23334 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
23335 the parameter as assigned here.
23336 (ParameterReference.DoResolve): Check whether the parameter has already
23338 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
23339 expression as lvalue.
23341 * statement.cs (FlowBranching): New class for the flow analysis code.
23342 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
23343 (LabeledStatement.IsDefined): New public property.
23344 (LabeledStatement.AddUsageVector): New public method to tell flow
23345 analyis that the label may be reached via a forward jump.
23346 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
23348 (VariableInfo.Number): New public field. This is used by flow analysis
23349 to number all locals of a block.
23350 (Block.CountVariables): New public property. This is the number of
23351 local variables in this block (including the locals from all parent
23353 (Block.EmitMeta): Number all the variables.
23355 * statement.cs: Added flow analysis support to all classes.
23357 2002-07-31 Martin Baulig <martin@gnome.org>
23359 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
23360 To get debugging messages, compile mcs with /define:MCS_DEBUG and
23361 then use this argument.
23363 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
23365 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
23366 use this to specify /define options.
23368 2002-07-29 Martin Baulig <martin@gnome.org>
23370 * statement.cs (Fixed): Moved all code that does variable lookups
23371 and resolvings from Emit to Resolve.
23373 * statement.cs (For): Moved all code that does variable lookups
23374 and resolvings from Emit to Resolve.
23376 * statement.cs (Using): Moved all code that does variable lookups
23377 and resolvings from Emit to Resolve.
23379 2002-07-29 Martin Baulig <martin@gnome.org>
23381 * attribute.cs (Attribute.Resolve): Explicitly catch a
23382 System.NullReferenceException when creating the
23383 CustromAttributeBuilder and report a different warning message.
23385 2002-07-29 Martin Baulig <martin@gnome.org>
23387 * support.cs (ParameterData.ParameterName): Added method to
23388 get the name of a parameter.
23390 * typemanager.cs (TypeManager.IsValueType): New public method.
23392 2002-07-29 Martin Baulig <martin@gnome.org>
23394 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
23395 is a flag which specifies that it's either ref or out.
23396 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
23397 the out parameter to `out Parameter.Modifier mod', also set the
23398 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
23400 * support.cs (InternalParameters.ParameterModifier): Distinguish
23401 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23402 Parameter.Modifier.ISBYREF flag if it's either ref or out.
23404 * expression.cs (Argument.GetParameterModifier): Distinguish
23405 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23406 Parameter.Modifier.ISBYREF flag if it's either ref or out.
23408 2002-07-29 Martin Baulig <martin@gnome.org>
23410 * expression.cs (ParameterReference.ParameterReference): Added
23411 `Location loc' argument to the constructor.
23413 * cs-parser.jay: Pass location to ParameterReference.
23415 2002-07-28 Miguel de Icaza <miguel@ximian.com>
23417 * statement.cs (Try): Initialize the location.
23419 * cs-parser.jay: pass location to Try.
23421 * expression.cs (Unary.Reduce): Change the prototype to return
23422 whether a constant fold could be performed or not. The result is
23423 returned in an out parameters. In the case of Indirection and
23424 AddressOf, we want to perform the full tests.
23426 2002-07-26 Miguel de Icaza <miguel@ximian.com>
23428 * statement.cs (Statement.Emit): Flag dead code.
23430 2002-07-27 Andrew Birkett <andy@nobugs.org>
23432 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
23434 2002-07-27 Martin Baulig <martin@gnome.org>
23436 * class.cs (MethodData.Define): Put back call to
23437 TypeManager.AddMethod(), accidentally commented this out.
23439 * report.cs (Debug): New public method to print debugging information,
23440 this is `[Conditional ("DEBUG")]'.
23442 2002-07-26 Martin Baulig <martin@gnome.org>
23444 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
23445 (switch_statement): Push the current_block to the switch_stack and
23446 pop it again when we're done with the switch.
23447 (switch_section): The new block is a child of the current_block.
23448 Fixes bug #24007, added test-152.cs.
23450 2002-07-27 Martin Baulig <martin@gnome.org>
23452 * expression.cs (Invocation.EmitArguments): When calling a varargs
23453 function with only its fixed arguments, we need to pass an empty
23456 2002-07-27 Martin Baulig <martin@gnome.org>
23458 Mono 0.13 has been released.
23460 2002-07-25 Miguel de Icaza <miguel@ximian.com>
23462 * driver.cs: Rename --resource to --linkres, because that is what
23463 we do currently, we dont support --resource yet.
23465 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
23467 2002-07-25 Martin Baulig <martin@gnome.org>
23469 * class.cs (MethodData): New public class. This is a `method builder'
23470 class for a method or one accessor of a Property/Indexer/Event.
23471 (MethodData.GetMethodFlags): Moved here from MemberBase.
23472 (MethodData.ApplyAttributes): Likewise.
23473 (MethodData.ApplyObsoleteAttribute): Likewise.
23474 (MethodData.ApplyConditionalAttribute): Likewise.
23475 (MethodData.ApplyDllImportAttribute): Likewise.
23476 (MethodData.CheckAbstractAndExternal): Likewise.
23477 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
23478 (MethodData.Emit): Formerly known as Method.Emit().
23479 (MemberBase): Moved everything which was specific to a single
23480 accessor/method to MethodData.
23481 (Method): Create a new MethodData and call Define() and Emit() on it.
23482 (Property, Indexer, Event): Create a new MethodData objects for each
23483 accessor and call Define() and Emit() on them.
23485 2002-07-25 Martin Baulig <martin@gnome.org>
23487 Made MethodCore derive from MemberBase to reuse the code from there.
23488 MemberBase now also checks for attributes.
23490 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
23491 (MemberBase.GetMethodFlags): Moved here from class Method and marked
23493 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
23494 `CallingConventions cc' and `Attributes opt_attrs' arguments.
23495 (MemberBase.ApplyAttributes): New virtual method; applies the
23496 attributes to a method or accessor.
23497 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
23498 (MemberBase.ApplyConditionalAttribute): Likewise.
23499 (MemberBase.ApplyDllImportAttribute): Likewise.
23500 (MemberBase.CheckAbstractAndExternal): Likewise.
23501 (MethodCore.ParameterTypes): This is now a property instead of a
23502 method, it's initialized from DoDefineParameters().
23503 (MethodCore.ParameterInfo): Removed the set accessor.
23504 (MethodCore.DoDefineParameters): New protected virtual method to
23505 initialize ParameterTypes and ParameterInfo.
23506 (Method.GetReturnType): We can now simply return the MemberType.
23507 (Method.GetMethodFlags): Override the MemberBase version and add
23508 the conditional flags.
23509 (Method.CheckBase): Moved some code from Define() here, call
23510 DoDefineParameters() here.
23511 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
23512 here to avoid some larger code duplication.
23513 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
23514 ensure that abstract and external accessors don't declare a body.
23516 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
23517 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
23518 lookup in the attribute's parent classes, so we need to abort as soon
23519 as we found the first match.
23520 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
23521 the attribute has no arguments.
23523 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
23526 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23528 * cs-parser.jay: reverted previous patch.
23530 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23532 * cs-parser.jay: fixed bug #22119.
23534 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23536 * attribute.cs: fixed compilation. The error was:
23537 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
23538 be assigned to before control leaves the current method."
23539 [FIXME: Filed as bug #28186: MCS must report this error.]
23541 2002-07-25 Martin Baulig <martin@gnome.org>
23543 * attribute.cs (Attribute.Conditional_GetConditionName): New static
23544 method to pull the condition name ouf of a Conditional attribute.
23545 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
23546 the obsolete message and error flag out of an Obsolete attribute.
23548 * class.cs (Method.GetMethodFlags): New public method to get the
23549 TypeManager.MethodFlags for this method.
23550 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
23552 (Method.Define): Get and apply the Obsolete and Conditional attributes;
23553 if we're overriding a virtual function, set the new private variable
23554 `parent_method'; call the new TypeManager.AddMethod().
23556 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
23557 the MethodBuilder and the Method in a PtrHashtable.
23558 (TypeManager.builder_to_method): Added for this purpose.
23559 (TypeManager.MethodFlags): Added IsObsoleteError.
23560 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
23561 Obsolete and Conditional arguments in MethodBuilders. If we discover
23562 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
23563 the message from the attribute.
23565 2002-07-24 Martin Baulig <martin@gnome.org>
23567 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
23568 preprocessor directives, ensure that the argument to #define/#undef is
23569 exactly one identifier and that it's actually an identifier.
23571 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
23574 2002-07-24 Martin Baulig <martin@gnome.org>
23576 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
23577 initialize it to TypeManager.object_type in the constructor.
23578 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
23579 of the `hm.get_current' method if we're using the collection pattern.
23580 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
23581 for the explicit conversion to make it work when we're using the collection
23582 pattern and the `Current' property has a different return type than `object'.
23585 2002-07-24 Martin Baulig <martin@gnome.org>
23587 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
23588 does not match, but don't report any errors. This method is called in
23589 order for all methods in a MethodGroupExpr until a matching method is
23590 found, so we don't want to bail out if the first method doesn't match.
23591 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
23592 matches, report the 123. Fixes #28070.
23594 2002-07-24 Martin Baulig <martin@gnome.org>
23596 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
23597 TypeManager.TypeToCoreType() to the top of the method so the
23598 following equality checks will work. Fixes #28107.
23600 2002-07-24 Martin Baulig <martin@gnome.org>
23602 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
23603 operand is of type uint, and the other operand is of type sbyte,
23604 short or int, the operands are converted to type long." -
23605 Actually do what this comment already told us. Fixes bug #28106,
23608 2002-07-24 Martin Baulig <martin@gnome.org>
23610 * class.cs (MethodBase): New abstract class. This is now a base
23611 class for Property, Indexer and Event to avoid some code duplication
23612 in their Define() and DefineMethods() methods.
23613 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
23614 generic methods for Define() and DefineMethods().
23615 (FieldBase): Derive from MemberBase, not MemberCore.
23616 (Property): Derive from MemberBase, not MemberCore.
23617 (Property.DefineMethod): Moved all the code from this method to the
23618 new MethodBase.DefineAccessor(), just call it with appropriate
23620 (Property.Define): Call the new Property.DoDefine(), this does some
23621 sanity checks and we don't need to duplicate the code everywhere.
23622 (Event): Derive from MemberBase, not MemberCore.
23623 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
23624 accessors, this will also make them work with interface events.
23625 (Indexer): Derive from MemberBase, not MemberCore.
23626 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
23627 (Indexer.Define): Use the new MethodBase functions.
23629 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
23630 argument to the constructor.
23631 (Interface.FindMembers): Added support for interface events.
23632 (Interface.PopluateEvent): Implemented.
23634 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
23636 2002-07-22 Miguel de Icaza <miguel@ximian.com>
23638 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
23639 but this is required to check for a method name being the same as
23640 the containing class.
23644 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23646 * interface.cs: initialize variable.
23648 2002-07-23 Martin Baulig <martin@gnome.org>
23650 Implemented the IndexerName attribute in interfaces.
23652 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
23653 name if this is an explicit interface implementation.
23654 (Indexer.InterfaceIndexerName): New public variable. If we're
23655 implementing an interface indexer, this is the IndexerName in that
23656 interface. Otherwise, it's the IndexerName.
23657 (Indexer.DefineMethod): If we're implementing interface indexer,
23658 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
23659 and Pending.ImplementIndexer methods.
23660 (Indexer.Define): Also define the PropertyBuilder if we're
23661 implementing an interface indexer and this is neither an explicit
23662 interface implementation nor do the IndexerName match the one in
23665 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
23666 If a method is defined here, then we always need to create a proxy
23667 for it. This is used when implementing interface indexers.
23668 (Pending.IsInterfaceIndexer): New public method.
23669 (Pending.ImplementIndexer): New public method.
23670 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
23671 This is used when implementing interface indexers to define a proxy
23673 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
23674 define a proxy if necessary.
23676 * interface.cs (Interface.IndexerName): New public variable.
23677 (Interface.PopulateIndexer): Set the IndexerName.
23678 (Interface.DefineIndexers): New private method. Populate all the
23679 indexers and make sure their IndexerNames match.
23681 * typemanager.cs (IndexerPropertyName): Added support for interface
23684 2002-07-22 Martin Baulig <martin@gnome.org>
23686 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
23687 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
23688 ret if HasReturnLabel.
23689 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
23692 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
23693 and set the ec.LoopBeginTryCatchLevel.
23694 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
23695 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
23696 the current ec.TryCatchLevel, the branch goes out of an exception
23697 block. In this case, we need to use Leave and not Br.
23699 2002-07-22 Martin Baulig <martin@gnome.org>
23701 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
23702 block unless the block does not always return or it is contained in
23703 another try { ... } catch { ... } block. Fixes bug #26506.
23704 Added verify-1.cs to the test suite.
23706 2002-07-22 Martin Baulig <martin@gnome.org>
23708 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
23709 then we do not always return. Fixes bug #24985.
23711 2002-07-22 Martin Baulig <martin@gnome.org>
23713 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
23714 lookup on a per-class level; ie. walk up the class hierarchy until we
23715 found at least one applicable method, then choose the best among them.
23716 Fixes bug #24463 and test-29.cs.
23718 2002-07-22 Martin Baulig <martin@gnome.org>
23720 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
23721 return types of the methods. The return type is not part of the
23722 signature and we must not check it to make the `new' modifier work.
23723 Fixes bug #27999, also added test-147.cs.
23724 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
23726 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
23727 on the method's return type.
23729 2002-07-21 Martin Baulig <martin@gnome.org>
23731 * assign.cs: Make this work if the rightmost source is a constant and
23732 we need to do an implicit type conversion. Also adding a few more tests
23733 to test-38.cs which should have caught this.
23735 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
23736 target in the makefile for this. The makefile.gnu is primarily intended
23737 for end-users who don't want to debug the compiler.
23739 2002-07-21 Martin Baulig <martin@gnome.org>
23741 * assign.cs: Improved the Assign class so it can now handle embedded
23742 assignments (X = Y = Z = something). As a side-effect this'll now also
23743 consume less local variables. test-38.cs now passes with MCS, added
23744 a few new test cases to that test.
23746 2002-07-20 Martin Baulig <martin@gnome.org>
23748 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
23749 instructions. Fixes bug #27977, also added test-146.cs.
23751 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23753 * cs-tokenizer.cs: fixed getHex ().
23755 2002-07-19 Martin Baulig <martin@gnome.org>
23757 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
23758 not Type.GetType() to lookup the array type. This is needed when
23759 we're constructing an array of a user-defined type.
23760 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
23761 single-dimensional arrays, but also for single-dimensial arrays of
23764 2002-07-19 Martin Baulig <martin@gnome.org>
23766 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
23767 this function is called, it's not allowed to share LocalBuilders
23768 among ILGenerators.
23770 2002-07-19 Martin Baulig <martin@gnome.org>
23772 * expression.cs (Argument.Resolve): Report an error 118 when trying
23773 to pass a type as argument.
23775 2002-07-18 Martin Baulig <martin@gnome.org>
23777 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
23778 Conv_R_Un for the signed `long' type.
23780 2002-07-15 Miguel de Icaza <miguel@ximian.com>
23782 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
23783 `expr' for the temporary result, as that will fail if we do
23784 multiple resolves on the same expression.
23786 2002-07-05 Miguel de Icaza <miguel@ximian.com>
23788 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
23789 ec.TypeContainer for looking up aliases.
23791 * class.cs (TypeContainer): Remove LookupAlias from here.
23793 * decl.cs (DeclSpace); Move here.
23795 2002-07-01 Miguel de Icaza <miguel@ximian.com>
23797 * class.cs (FindMembers): Only call filter if the constructor
23798 bulider is not null.
23800 Also handle delegates in `NestedTypes' now. Now we will perform
23801 type lookups using the standard resolution process. This also
23804 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
23805 This uses Expressions (the limited kind that can be parsed by the
23806 tree) instead of strings.
23808 * expression.cs (ComposedCast.ToString): Implement, used to flag
23809 errors since now we have to render expressions.
23811 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
23814 * ecore.cs (SimpleName.ToString): ditto.
23816 * cs-parser.jay: Instead of using strings to assemble types, use
23817 Expressions to assemble the type (using SimpleName, ComposedCast,
23818 MemberAccess). This should fix the type lookups in declarations,
23819 because we were using a different code path for this.
23821 * statement.cs (Block.Resolve): Continue processing statements
23822 even when there is an error.
23824 2002-07-17 Miguel de Icaza <miguel@ximian.com>
23826 * class.cs (Event.Define): Also remove the `remove' method from
23827 the list of pending items.
23829 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
23830 generate more compact code.
23832 2002-07-17 Martin Baulig <martin@gnome.org>
23834 * const.cs (Const.LookupConstantValue): Add support for constant
23835 `unchecked' and `checked' expressions.
23836 Also adding test case test-140.cs for this.
23838 2002-07-17 Martin Baulig <martin@gnome.org>
23840 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
23841 check whether mi.ReturnType implements the IEnumerator interface; the
23842 `==' and the IsAssignableFrom() will fail in this situation.
23844 2002-07-16 Ravi Pratap <ravi@ximian.com>
23846 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
23849 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23851 * expression.cs: fixed bug #27811.
23853 2002-07-14 Miguel de Icaza <miguel@ximian.com>
23855 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
23856 Molaro: when we are a ref, the value already contains a pointer
23857 value, do not take the address of it.
23859 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23860 * removed mb-parser.jay and mb-tokenizer.cs
23862 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23864 * expression.cs: check against the building corlib void type.
23866 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
23868 * ecore.cs: fix for valuetype static readonly fields: when
23869 initializing them, we need their address, not the address of a copy.
23871 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23873 * typemanager.cs: register also enum_type in corlib.
23875 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23877 * class.cs: allow calling this (but not base) initializers in structs.
23879 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
23881 * ecore.cs: make sure we compare against the building base types
23884 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
23886 * typemanager.cs: fix TypeToCoreType() to handle void and object
23887 (corlib gets no more typerefs after this change).
23889 2002-07-12 Miguel de Icaza <miguel@ximian.com>
23891 * expression.cs (ArrayCreation.EmitArrayArguments): use
23892 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
23894 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
23895 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
23896 array indexes, the runtime actually forbids them.
23898 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
23899 for array arguments here.
23901 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
23902 instead of the default for ValueTypes.
23904 (New.DoEmit): Use IsValueType instead of
23905 IsSubclassOf (value_type)
23906 (New.DoResolve): ditto.
23907 (Invocation.EmitCall): ditto.
23909 * assign.cs (Assign): ditto.
23911 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
23912 Statements *are* currently doing part of their resolution during
23915 Expressions do always resolve during resolve, but statements are
23916 only required to propagate resolution to their children.
23918 2002-07-11 Miguel de Icaza <miguel@ximian.com>
23920 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
23922 (LoadAssembly): Do not add the dll if it is already specified
23924 (MainDriver): Add the System directory to the link path at the end,
23925 after all the other -L arguments.
23927 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
23928 wrong opcode for loading bytes and bools (ldelem.i1 instead of
23929 ldelem.u1) and using the opposite for sbytes.
23931 This fixes Digger, and we can finally run it.
23933 * driver.cs (UnixParseOption): Move the option parsing here.
23934 (CSCParseOption): Implement CSC-like parsing of options.
23936 We now support both modes of operation, the old Unix way, and the
23937 new CSC-like way. This should help those who wanted to make cross
23938 platform makefiles.
23940 The only thing broken is that /r:, /reference: and /lib: are not
23941 implemented, because I want to make those have the same semantics
23942 as the CSC compiler has, and kill once and for all the confussion
23943 around this. Will be doing this tomorrow.
23945 * statement.cs (Unsafe.Resolve): The state is checked during
23946 resolve, not emit, so we have to set the flags for IsUnsfe here.
23948 2002-07-10 Miguel de Icaza <miguel@ximian.com>
23950 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
23951 not catch the Error_ObjectRefRequired in SimpleName (as it is
23952 possible to have a class/instance variable name that later gets
23953 deambiguated), we have to check this here.
23955 2002-07-10 Ravi Pratap <ravi@ximian.com>
23957 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
23958 make static and put into Expression.
23960 (Event.Define): Register the private field of the event with the
23961 TypeManager so that GetFieldFromEvent can get at it.
23963 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
23964 keep track of the private field associated with an event which
23967 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
23970 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
23972 2002-07-10 Miguel de Icaza <miguel@ximian.com>
23974 * expression.cs (Binary.EmitBranchable): this routine emits the
23975 Binary expression in a branchable context. This basically means:
23976 we need to branch somewhere, not just get the value on the stack.
23978 This works together with Statement.EmitBoolExpression.
23980 * statement.cs (Statement.EmitBoolExpression): Use
23983 2002-07-09 Miguel de Icaza <miguel@ximian.com>
23985 * statement.cs (For): Reduce the number of jumps in loops.
23987 (For): Implement loop inversion for the For statement.
23989 (Break): We can be breaking out of a Try/Catch controlled section
23990 (foreach might have an implicit try/catch clause), so we need to
23991 use Leave instead of Br.
23993 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
23994 now). If the instace expression supports IMemoryLocation, we use
23995 the AddressOf method from the IMemoryLocation to extract the
23996 address instead of emitting the instance.
23998 This showed up with `This', as we were emitting the instance
23999 always (Emit) instead of the Address of This. Particularly
24000 interesting when This is a value type, as we dont want the Emit
24001 effect (which was to load the object).
24003 2002-07-08 Miguel de Icaza <miguel@ximian.com>
24005 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
24007 * statement.cs (Checked): Set the CheckedState during the resolve
24008 process too, as the ConvCast operations track the checked state on
24009 the resolve process, and not emit.
24011 * cs-parser.jay (namespace_member_declaration): Flag that we have
24012 found a declaration when we do. This is used to flag error 1529
24014 * driver.cs: Report ok when we display the help only.
24016 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
24018 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
24020 2002-07-04 Miguel de Icaza <miguel@ximian.com>
24022 * cs-tokenizer.cs (define): We also have to track locally the
24023 defines. AllDefines is just used for the Conditional Attribute,
24024 but we also need the local defines for the current source code.
24026 2002-07-03 Miguel de Icaza <miguel@ximian.com>
24028 * statement.cs (While, For, Do): These loops can exit through a
24029 Break statement, use this information to tell whether the
24030 statement is the last piece of code.
24032 (Break): Flag that we break.
24034 * codegen.cs (EmitContexts): New `Breaks' state variable.
24036 2002-07-03 Martin Baulig <martin@gnome.org>
24038 * class.cs (TypeContainer.MethodModifiersValid): Allow override
24039 modifiers in method declarations in structs. Otherwise, you won't
24040 be able to override things like Object.Equals().
24042 2002-07-02 Miguel de Icaza <miguel@ximian.com>
24044 * class.cs (Method, Property, Indexer): Do not allow the public
24045 modifier to be used in explicit interface implementations.
24047 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
24048 override modifiers in method declarations in structs
24050 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
24052 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
24053 integer or real overflow, report an error
24055 2002-07-02 Martin Baulig <martin@gnome.org>
24057 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
24058 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
24059 to tell the runtime about our newly created System.Object and
24060 System.ValueType types.
24062 2002-07-02 Miguel de Icaza <miguel@ximian.com>
24064 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
24065 struct instead of Ldarg/Starg.
24067 2002-07-02 Martin Baulig <martin@gnome.org>
24069 * expression.cs (Indirection.Indirection): Call
24070 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
24072 2002-07-02 Martin Baulig <martin@gnome.org>
24074 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
24075 ValueType, call TypeManager.TypeToCoreType() on it.
24076 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
24077 the OpCodes.Newarr argument.
24079 2002-07-02 Martin Baulig <martin@gnome.org>
24081 * expression.cs (Invocation.EmitCall): When compiling corlib,
24082 replace all calls to the system's System.Array type to calls to
24083 the newly created one.
24085 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
24086 System.Array methods.
24087 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
24088 from the system's System.Array type which must be replaced.
24090 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
24092 * typemanager.cs: load unverifiable_code_ctor so we can build
24093 corlib using the correct type. Avoid using GetTypeCode() with
24095 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
24096 TypeManager.object_type to allow building corlib.
24098 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24100 * ecore.cs: handle System.Enum separately in LoadFromPtr().
24102 2002-07-01 Martin Baulig <martin@gnome.org>
24104 * class.cs: Make the last change actually work, we need to check
24105 whether `ifaces != null' to avoid a crash.
24107 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24109 * class.cs: when we build structs without fields that implement
24110 interfaces, we need to add the interfaces separately, since there is
24111 no API to both set the size and add the interfaces at type creation
24114 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24116 * expression.cs: the dimension arguments to the array constructors
24117 need to be converted if they are a long.
24119 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24121 * class.cs: don't emit ldarg.0 if there is no parent constructor
24122 (fixes showstopper for corlib).
24124 2002-06-29 Martin Baulig <martin@gnome.org>
24126 MCS now compiles corlib on GNU/Linux :-)
24128 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
24129 ie. check for MethodImplOptions.InternalCall.
24131 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
24132 and TypeManager.attribute_type are null, so we must explicitly check
24133 whether parent is not null to find out whether it's an attribute type.
24134 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
24135 and SetBuilder, not only if the property is neither abstract nor external.
24136 This is necessary to set the MethodImplOptions on the accessor methods.
24137 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
24138 SetBuilder, see Property.Emit().
24140 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
24141 populate "System.Object", "System.ValueType" and "System.Attribute" since
24142 they've already been populated from BootCorlib_PopulateCoreTypes().
24144 2002-06-29 Martin Baulig <martin@gnome.org>
24146 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
24147 is the NullLiteral, we also need to make sure that target_type is not
24150 2002-06-29 Martin Baulig <martin@gnome.org>
24152 * rootcontext.cs (RootContext.ResolveCore): We must initialize
24153 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
24154 before calling BootstrapCorlib_ResolveDelegate ().
24156 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24158 * statement.cs: fixed build-breaker. All tests passed ok.
24160 2002-06-27 Martin Baulig <martin@gnome.org>
24162 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
24163 for System.Decimal when compiling corlib.
24165 2002-06-27 Martin Baulig <martin@gnome.org>
24167 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
24168 switch blocks which contain nothing but a default clause.
24170 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
24172 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
24174 2002-06-27 Martin Baulig <martin@gnome.org>
24176 * ecore.cs (PropertyExpr.PropertyExpr): Call
24177 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
24179 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
24180 is already a TypeBuilder.
24182 2002-06-27 Martin Baulig <martin@gnome.org>
24184 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
24185 `target_type == TypeManager.array_type', not IsAssignableFrom() in
24186 the "from an array-type to System.Array" case. This makes it work
24187 when compiling corlib.
24189 2002-06-27 Martin Baulig <martin@gnome.org>
24191 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
24192 non-static PropertyExpr, set its InstanceExpression. This makes
24193 the `ICollection.Count' property work in System/Array.cs.
24195 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
24197 * driver.cs: Made error handling more consistent. Errors now
24198 tracked by Report class, so many methods which used to return int
24199 now return void. Main() now prints success/failure and
24200 errors/warnings message.
24202 Renamed '--probe' compiler argument to '--expect-error'. Removed
24203 the magic number return values (123 and 124). Now, if the
24204 expected error occurs, the compiler exits with success (exit value
24205 0). If the compilation completes without seeing that particular
24206 error, the compiler exits with failure (exit value 1). The
24207 makefile in mcs/errors has been changed to handle the new behaviour.
24209 * report.cs: Made 'expected error' number a property and renamed
24210 it from 'Probe' to 'ExpectedError'.
24212 * genericparser.cs: Removed error handling support, since it is
24213 now all done by Report class.
24215 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
24216 class, so parse() no longer returns an int.
24218 * namespace.cs: Use Report.Error instead of GenericParser.error
24220 2002-06-22 Miguel de Icaza <miguel@ximian.com>
24222 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
24223 TypeContainer.AddOperator): At the front of the list put the
24224 explicit implementations, so they get resolved/defined first.
24226 2002-06-21 Miguel de Icaza <miguel@ximian.com>
24228 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
24229 interface type is implemented by this TypeContainer. Used during
24230 explicit interface implementation.
24232 (Property.Define, Indexer.Define, Method.Define): Validate that
24233 the given interface in the explicit implementation is one of the
24234 base classes for the containing type.
24236 Also if we are explicitly implementing an interface, but there is
24237 no match in the pending implementation table, report an error.
24239 (Property.Define): Only define the property if we are
24240 not explicitly implementing a property from an interface. Use the
24241 correct name also for those properties (the same CSC uses,
24242 although that is really not needed).
24244 (Property.Emit): Do not emit attributes for explicitly implemented
24245 properties, as there is no TypeBuilder.
24247 (Indexer.Emit): ditto.
24249 Hiding then means that we do not really *implement* a pending
24250 implementation, which makes code fail.
24252 2002-06-22 Martin Baulig <martin@gnome.org>
24254 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
24255 the return value of Object.GetType(). [FIXME: we need to do this whenever
24256 we get a type back from the reflection library].
24258 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24260 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
24262 2002-06-20 Miguel de Icaza <miguel@ximian.com>
24264 * attribute.cs: Return null if we can not look up the type.
24266 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
24267 the interface types found.
24269 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
24270 interface types found.
24272 * typemanager.cs (GetInterfaces): Make this routine returns alll
24273 the interfaces and work around the lame differences between
24274 System.Type and System.Reflection.Emit.TypeBuilder in the results
24275 result for GetInterfaces.
24277 (ExpandInterfaces): Given an array of interface types, expand and
24278 eliminate repeated ocurrences of an interface. This expands in
24279 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
24282 2002-06-21 Martin Baulig <martin@gnome.org>
24284 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
24287 2002-06-21 Martin Baulig <martin@gnome.org>
24289 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
24290 and called with one of the core types, return the corresponding typebuilder for
24293 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
24296 2002-06-21 Martin Baulig <martin@gnome.org>
24298 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
24299 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
24300 (Expression.ConvertReferenceExplicit): Likewise.
24302 * expression.cs (ElementAccess.DoResolve): Likewise.
24303 (ElementAccess.DoResolveLValue): Likewise.
24305 2002-06-10 Martin Baulig <martin@gnome.org>
24307 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
24308 add the "value" parameter to the parameter list.
24310 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
24313 2002-06-19 Miguel de Icaza <miguel@ximian.com>
24315 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
24316 the argument to an int, uint, long or ulong, per the spec. Also
24317 catch negative constants in array creation.
24319 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24321 * class.cs: do not allow the same interface to appear twice in
24322 the definition list.
24324 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24326 * ecore.cs: don't use ldlen with System.Array.
24328 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
24330 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
24332 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
24334 * modifiers.cs: produce correct field attributes for protected
24335 internal. Easy fix so miguel can work on ther harder stuff:-)
24337 2002-06-18 Miguel de Icaza <miguel@ximian.com>
24339 * pending.cs: New file. Move the code from class.cs here.
24340 Support clearning the pending flag for all methods (when not doing
24341 explicit interface implementation).
24343 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
24345 * rootcontext.cs: added a couple more types needed to bootstrap.
24347 2002-06-17 Miguel de Icaza <miguel@ximian.com>
24349 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
24350 constructor in the type, instead of any constructor in the type
24351 hierarchy. Thanks to Paolo for finding this bug (it showed up as
24352 a bug in the Mono runtime when applying the params attribute).
24354 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24355 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
24357 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
24359 * expression.cs (Unary.ResolveOperator): Use TypeManager
24360 to resolve the type.
24362 2002-06-13 Ravi Pratap <ravi@ximian.com>
24364 * cs-parser.jay (enum_member_declaration): Pass in the attributes
24367 * enum.cs (AddEnumMember): Add support to store the attributes associated
24368 with each member too.
24370 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
24371 field builders too - this takes care of the enum member case.
24373 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
24375 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
24376 address-of operator on both value types and pointers.
24378 2002-06-10 Martin Baulig <martin@gnome.org>
24380 * interface.cs (Interface.PopulateIndexer): Add the indexer's
24381 PropertyBuilder to the `property_builders' list.
24383 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
24384 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
24385 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
24386 find any indexers which are inherited from an interface.
24388 2002-06-09 Martin Baulig <martin@gnome.org>
24390 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
24391 the same type as the constant if necessary. There's also a test-130.cs
24394 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
24396 * typemanager.cs (TypeManager.ChangeType): Previously known as
24397 Enum.ChangeEnumType().
24399 2002-06-09 Martin Baulig <martin@gnome.org>
24401 * expression.cs (Cast.TryReduce): Added support for consts.
24403 2002-06-08 Ravi Pratap <ravi@ximian.com>
24405 * class.cs (Accessor): Hold attributes information so we can pass
24408 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
24409 Modify to pass in attributes attached to the methods.
24411 (add_accessor_declaration, remove_accessor_declaration): Ditto.
24413 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
24414 to handle the Accessor kind :-)
24416 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
24418 2002-06-08 Martin Baulig <martin@gnome.org>
24420 * expression.cs (Unary.TryReduceNegative): Added support for
24423 2002-06-08 Martin Baulig <martin@gnome.org>
24425 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
24426 name can't be found in the `defined_names' - the caller will do a
24427 MemberLookup in this case and thus find methods in System.Enum
24428 such as Enum.IsDefined().
24430 2002-06-08 Martin Baulig <martin@gnome.org>
24432 * enum.cs (Enum.ChangeEnumType): This is a custom version of
24433 Convert.ChangeType() which works with TypeBuilder created types.
24434 (Enum.LookupEnumValue, Enum.Define): Use it here.
24436 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
24437 `TypeBuilder.BaseType != null' check.
24438 (TypeContainer.FindMembers): Only lookup parent members if we
24439 actually have a parent.
24440 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
24441 (ConstructorInitializer.Resolve): Likewise.
24443 * interface.cs (Interface.FindMembers): Added
24444 `TypeBuilder.BaseType != null' check.
24446 * rootcontext.cs (RootContext.ResolveCore): Added
24447 "System.Runtime.CompilerServices.IndexerNameAttribute" to
24448 classes_second_stage.
24450 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
24451 debug_type and trace_type when compiling with --nostdlib.
24453 2002-06-07 Martin Baulig <martin@gnome.org>
24455 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
24456 (AddField): Set it to true when adding a non-static field.
24457 (DefineType): Use `have_nonstatic_fields' to find out whether we
24458 have non-static fields, not `Fields != null'.
24460 2002-06-02 Miguel de Icaza <miguel@ximian.com>
24462 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
24463 dereferencing a null on the static-field code path)
24465 2002-05-30 Martin Baulig <martin@gnome.org>
24467 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
24468 to take command line arguments. Use reflection to call the new
24469 custom `Initialize' function on the symbol writer and pass it the
24470 command line arguments.
24472 * driver.cs (--debug-args): New command line argument to pass command
24473 line arguments to the symbol writer.
24475 2002-05-28 Miguel de Icaza <miguel@ximian.com>
24477 * assign.cs (DoResolve): Forgot to do the implicit conversion to
24478 the target type for indexers and properties. Thanks to Joe for
24481 2002-05-27 Miguel de Icaza <miguel@ximian.com>
24483 * typemanager.cs (MethodFlags): returns the method flags
24484 (Obsolete/ShouldIgnore) that control warning emission and whether
24485 the invocation should be made, or ignored.
24487 * expression.cs (Invocation.Emit): Remove previous hack, we should
24488 not do this on matching a base type, we should do this based on an attribute
24490 Only emit calls to System.Diagnostics.Debug and
24491 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
24492 on the command line.
24494 * rootcontext.cs: Global settings for tracing and debugging.
24496 * cs-tokenizer.cs (define): New utility function to track
24497 defines. Set the global settings for TRACE and DEBUG if found.
24499 2002-05-25 Ravi Pratap <ravi@ximian.com>
24501 * interface.cs (Populate*): Pass in the TypeContainer as well as
24502 the DeclSpace as parameters so that we can create EmitContexts and
24503 then use that to apply attributes etc.
24505 (PopulateMethod, PopulateEvent, PopulateProperty)
24506 (PopulateIndexer): Apply attributes everywhere.
24508 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
24511 (ApplyAttributes): Update accordingly.
24513 We now apply interface attributes for all members too.
24515 2002-05-26 Miguel de Icaza <miguel@ximian.com>
24517 * class.cs (Indexer.Define); Correctly check if we are explicit
24518 implementation (instead of checking the Name for a ".", we
24519 directly look up if the InterfaceType was specified).
24521 Delay the creation of the PropertyBuilder.
24523 Only create the PropertyBuilder if we are not an explicit
24524 interface implementation. This means that explicit interface
24525 implementation members do not participate in regular function
24526 lookups, and hence fixes another major ambiguity problem in
24527 overload resolution (that was the visible effect).
24529 (DefineMethod): Return whether we are doing an interface
24532 * typemanager.cs: Temporary hack until we get attributes in
24533 interfaces (Ravi is working on that) and we get IndexerName
24534 support in interfaces.
24536 * interface.cs: Register the indexers as properties.
24538 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
24539 warning, I have verified that this is a bug in the .NET runtime
24540 (JavaScript suffers of the same problem).
24542 * typemanager.cs (MemberLookup): When looking up members for
24543 interfaces, the parent of an interface is the implicit
24544 System.Object (so we succeed in searches of Object methods in an
24545 interface method invocation. Example: IEnumerable x; x.ToString
24548 2002-05-25 Miguel de Icaza <miguel@ximian.com>
24550 * class.cs (Event): Events should also register if they do
24551 implement the methods that an interface requires.
24553 * typemanager.cs (MemberLookup); use the new GetInterfaces
24556 (GetInterfaces): The code used to lookup interfaces for a type is
24557 used in more than one place, factor it here.
24559 * driver.cs: Track the errors at the bottom of the file, we kept
24562 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
24563 instance if the method we are calling is static!
24565 2002-05-24 Miguel de Icaza <miguel@ximian.com>
24567 * attribute.cs (ApplyAttributes): Make this function filter out
24568 the IndexerName attribute (as that attribute in reality is never
24569 applied) and return the string constant for the IndexerName
24572 * class.cs (TypeContainer.Emit): Validate that all the indexers
24573 have the same IndexerName attribute, and if so, set the
24574 DefaultName attribute on the class.
24576 * typemanager.cs: The return value might contain other stuff (not
24577 only methods). For instance, consider a method with an "Item"
24578 property and an Item method.
24580 * class.cs: If there is a problem with the parameter types,
24583 2002-05-24 Ravi Pratap <ravi@ximian.com>
24585 * ecore.cs (ImplicitConversionExists): Wrapper function which also
24586 looks at user defined conversion after making a call to
24587 StandardConversionExists - we need this for overload resolution.
24589 * expression.cs : Update accordingly the various method calls.
24591 This fixes 2 bugs filed against implicit user defined conversions
24593 2002-05-22 Miguel de Icaza <miguel@ximian.com>
24595 * statement.cs: Track the result of the assignment.
24597 2002-05-21 Miguel de Icaza <miguel@ximian.com>
24599 * expression.cs (MemberAccess): Improved error reporting for
24600 inaccessible members.
24602 2002-05-22 Martin Baulig <martin@gnome.org>
24604 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
24605 itself with debugging support.
24607 2002-05-22 Martin Baulig <martin@gnome.org>
24609 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
24610 Removed, this isn't needed anymore.
24612 2002-05-20 Martin Baulig <martin@gnome.org>
24614 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
24615 be underlying type for an enum.
24617 2002-05-20 Miguel de Icaza <miguel@ximian.com>
24619 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
24620 that splits out the loading of just the core types.
24622 * rootcontext.cs (ResolveCore): Split the struct resolution in
24623 two, so we can load the enumeration underlying types before any
24626 * expression.cs (Is): Bandaid until we fix properly Switch (see
24627 bug #24985 for details).
24629 * typemanager.cs (ImplementsInterface): The hashtable will contain
24630 a null if there are no interfaces implemented.
24632 2002-05-18 Miguel de Icaza <miguel@ximian.com>
24634 * cs-parser.jay (indexer_declarator): It is fine to have array
24637 2002-05-17 Miguel de Icaza <miguel@ximian.com>
24639 * typemanager.cs: (RegisterBuilder): New function used to register
24640 TypeBuilders that implement interfaces. Since
24641 TypeBuilder.GetInterfaces (as usual) does not work with lame
24643 (AddUserType): register interfaces.
24645 (ImplementsInterface): Use the builder_to_ifaces hash if we are
24646 dealing with TypeBuilder. Also, arrays are showing up as
24647 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
24648 methods can not be invoked on them!
24650 * ecore.cs (ExplicitReferenceConversionExists): Made public.
24651 (ImplicitReferenceConversionExists): Split out from
24652 StandardConversionExists.
24654 * expression.cs (As): We were only implementing one of the three
24655 cases for the as operator. We now implement them all.
24656 (Is): Implement the various other cases for Is as well.
24658 * typemanager.cs (CACHE): New define used to control if we want or
24659 not the FindMembers cache. Seems to have a negative impact on
24660 performance currently
24662 (MemberLookup): Nested types have full acess to
24663 enclosing type members
24665 Remove code that coped with instance/static returns for events, we
24666 now catch this in RealFindMembers.
24668 (RealFindMembers): only perform static lookup if the instance
24669 lookup did not return a type or an event.
24671 2002-05-17 Miguel de Icaza <miguel@ximian.com>
24673 * assign.cs (CompoundAssign): We pass more semantic information
24674 now to Compound Assignments than we did before: now we have all
24675 the information at hand, and now we resolve the target *before* we
24676 do the expression expansion, which allows the "CacheValue" method
24677 to have the effect we intended (before, a [x] += 1 would generate
24678 two differen ArrayAccess expressions from the ElementAccess,
24679 during the resolution process).
24681 (CompoundAssign.DoResolve): Resolve target and original_source here.
24683 2002-05-16 Miguel de Icaza <miguel@ximian.com>
24685 * expression.cs (ArrayAccess): dropped debugging information.
24687 * typemanager.cs: Small bug fix: I was always returning i_members,
24688 instead of one of i_members or s_members (depending on which had
24691 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
24692 method is invoked before any code generation takes place, and it
24693 is a mechanism to inform that the expression will be invoked more
24694 than once, and that the method should use temporary values to
24695 avoid having side effects
24697 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
24699 * ecore.cs (Expression.CacheTemporaries): Provide empty default
24702 * expression.cs (Indirection, ArrayAccess): Add support for
24703 CacheTemporaries in these two bad boys.
24705 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
24706 ldobj or ldind_ref.
24707 (StoreFromPtr): Handle stobj as well.
24709 * expression.cs (UnaryMutator): Share more code.
24711 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
24712 down: I was not tracking the Filter function as well, which
24713 was affecting the results of the cache.
24715 2002-05-15 Miguel de Icaza <miguel@ximian.com>
24717 * attribute.cs: Remove the hack to handle the CharSet property on
24720 2002-05-14 Miguel de Icaza <miguel@ximian.com>
24722 * attribute.cs (DoResolve): More uglyness, we now only try to
24723 resolve the attribute partially, to extract the CharSet
24724 information (only if we are a StructLayout attribute). Otherwise
24726 (GetExtraTypeInfo): Add some code to conditionally kill in the
24727 future this. I am more and more convinced that the .NET
24728 framework has special code to handle the attribute setting on
24731 * expression.cs (IsParamsMethodApplicable): Revert my previous
24732 foreach change here, it was wrong.
24734 2002-05-13 Miguel de Icaza <miguel@ximian.com>
24736 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
24737 (pp_expr): do not abort on unknown input, just return.
24738 (eval): abort if there are pending chars.
24740 * attribute.cs (Attribute.Resolve): Positional parameters are
24741 optional. Deal with that case.
24743 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
24744 the Ansi/Unicode/Auto information for the type.
24746 (TypeContainer.DefineType): instantiate the EmitContext here, as
24747 we will be using it during the type definition (to resolve
24748 attributes) and during the emit phase.
24750 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
24751 to pull type information out of the attributes
24753 (Attribute.Resolve): track the constructor builder, and allow for
24754 multiple invocations (structs and classes will use this).
24756 * ecore.cs (MemberLookupFinal): new version with all the
24757 parameters customizable.
24759 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
24760 constructors. Return if the result value is null (as the error
24761 would have been flagged already by MemberLookupFinal)
24763 Do not allow instances of abstract classes or interfaces to be
24766 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
24767 We have to compare the assembly property here when dealing with
24768 FamANDAssem and Assembly access modifiers, because we might be
24769 creating an assembly from *modules* (that means that we are not
24770 getting TypeBuilders for types defined in other modules that are
24771 part of this assembly).
24773 (Method.Emit): If the method is marked abstract and has a body,
24776 (TypeContainer.DefineMembers): If both the defined member and the
24777 parent name match are methods, then do not emit any warnings: let
24778 the Method.Define routine take care of flagging warnings. But if
24779 there is a mismatch (method overrides something else, or method is
24780 overriwritten by something, then emit warning).
24782 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
24783 set to null, this means `do not check for the return type on the
24786 (Method.Define): set the return type for the method signature to
24787 null, so that we get methods with the same name and parameters and
24788 different return types. This is used to flag warning 114 (you are
24789 hiding a method, and you probably want to use the new/override
24792 * typemanager.cs (MemberLookup): Implemented proper access
24793 control, closing a long standing set of bug reports. The problem
24794 was that the Framework only has two bits: Public and NonPublic,
24795 and NonPublic includes private and protected methods, but we need
24796 to enforce the FamANDAssem, FamOrAssem and Family.
24798 2002-05-11 Miguel de Icaza <miguel@ximian.com>
24800 * statement.cs (GotoCase): Return true: Ammounts to giving up
24801 knowledge on whether we return or not, and letting the other case
24802 be responsible for it.
24804 2002-05-10 Miguel de Icaza <miguel@ximian.com>
24806 * driver.cs: Do not load directories for each file processed, only
24807 do it if there is a pattern.
24809 * ecore.cs: Report readonly assigns here as well, as we might have
24810 been resolved only by MemberAccess.
24812 (SimpleName.SimpleNameResolve): Also be useful for LValue
24813 resolution. We need this to propagate assign to local readonly variables
24815 * typemanager.cs: Use a ptrhashtable for the criteria, because we
24816 do not want to reuse potential criteria memory.
24818 * class.cs (MyEventBuilder): Set reflected_type;
24820 * ecore.cs (Constantify): Added support for constifying bools.
24822 (RootContext.LookupType): Added a cache for values looked up in
24823 the declaration space.
24825 * typemanager.cs (FindMembers): Now is a front-end to
24826 RealFindMembers, and provides a two-level hashtable-based cache to
24829 15% performance improvement: from 22.5 to 19.2 seconds.
24831 * expression.cs (IsParamsMethodApplicable): use foreach.
24832 (Invocation.DoResolve): ditto.
24833 (New.DoResolve): ditto.
24834 (ArrayCreation.DoResolve): ditto.
24836 * ecore.cs (FindMostEncompassingType): use foreach.
24838 * delegate.cs (NewDelegate.DoResolve): Use foreach
24840 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
24841 (RemoveMethods): use foreach.
24843 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
24844 nested foreach statements instead of for, and also break out of
24845 the inner loop once a match is found.
24847 (Invocation.OverloadResolve): Use foreach, simplify the code.
24849 2002-05-08 Miguel de Icaza <miguel@ximian.com>
24851 * cfold.cs (BinaryFold): During an enumeration evaluation context,
24852 we actually unwrap the expression to allow for extra information
24855 * expression.cs: Use Shr_Un on unsigned operations.
24857 2002-05-08 Ravi Pratap <ravi@ximian.com>
24859 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
24860 applicable operators was not being considered correctly. This closes
24861 the bug Miguel reported.
24863 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
24865 * attribute.cs: check that the type derives from System.Attribute
24866 and report the correct error in that case (moved the duplicate code to
24867 its own method, too).
24869 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
24871 * attribute.cs: lookup attribute type name as the spec says: first the
24872 bare attribute name and then name + "Attribute" (nant compiles with
24873 mcs after this fix).
24875 2002-05-07 Miguel de Icaza <miguel@ximian.com>
24877 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
24878 Because of the way we parse things, we should try to see if a
24879 UIntConstant can fit in an integer.
24881 2002-05-07 Ravi Pratap <ravi@ximian.com>
24883 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
24884 when we are in an explicit context.
24886 (ConvertReferenceExplicit): When converting from Iface type S to Class
24887 T make sure the rules are implemented as an OR.
24889 * parameter.cs (ParameterType): Make it a property for now although the
24890 purpose really isn't anything immediate.
24892 * expression.cs (Is*Applicable): Do better checking on the parameter type
24893 of a ref/out parameter. The ones from the system assemblies are already
24894 marked with the correct type so we don't need to do any correction.
24896 * ecore.cs (StandardConversionExists): Conversion from Interface types to
24897 the object type is standard too so include that.
24899 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24901 * ecore.cs (StandardConversionExists): Augment with missing code:
24902 deal with IntConstant, LongConstants and Enumerations.
24904 * assign.cs: Report the error, instead of failing silently
24906 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
24907 typecontainer that they are declared, because the
24908 typecontainer/namespace will have the list of using clauses that
24909 need to be applied.
24911 Assembly Attributes were escaping the normal registration
24914 (EmitCode): Apply attributes within an EmitContext that represents
24915 the container they were declared on.
24917 * cs-parser.jay: Track bases for structs. How did I get this wrong?
24919 2002-05-06 Ravi Pratap <ravi@ximian.com>
24921 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
24922 Revamp completely - make much cleaner as we now operate only
24925 (FindMostSpecificSource, FindMostSpecificTarget): New methods
24926 to implement the logic detailed in the spec more correctly.
24928 (UserDefinedConversion): Update accordingly.
24930 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24932 * statement.cs: Return flow analysis information up.
24934 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
24937 (token): Do not consume an extra character before calling
24940 2002-05-06 Piers Haken <piersh@friskit.com>
24942 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
24944 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24946 * class.cs (Constructor.Emit): Set the IsStatic flag in the
24947 EmitContext during the instance constructor initializer
24948 resolution, to stop access to instance variables.
24950 This is mandated by the spec, last paragraph of the `constructor
24951 initializers' section.
24953 2002-05-05 Miguel de Icaza <miguel@ximian.com>
24955 * cs-parser.jay, class.cs (Accessor): new class used to represent
24956 an accessor (get or set). In the past we used `null' to represent
24957 a missing accessor. But this is ambiguous because there was no
24958 way to tell in abstract indexers/properties if one of them was
24961 Now there is a way of addressing that.
24963 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
24964 instead of FindMembers.
24966 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
24967 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
24969 * attribute.cs: Treat indexers and properties as the same in terms
24970 of applying attributes
24972 * ecore.cs (FindMostEncompassedType): Use statically initialized
24973 EmptyExpressions()s like we do elsewhere to avoid creating useless
24974 objects (and we take this out of the tight loop).
24976 (GetConversionOperators): Move the code to extract the actual
24977 operators to a separate routine to clean things up.
24979 2002-05-04 Miguel de Icaza <miguel@ximian.com>
24981 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
24982 events are always registered FieldBuilders.
24984 * class.cs (FieldBase): New class shared by Fields
24986 * delegate.cs: If we are a toplevel delegate, use our full name.
24987 If we are a nested delegate, then only use our tail name.
24989 2002-05-02 Ravi Pratap <ravi@ximian.com>
24991 * expression.cs (IsApplicable): Ensure that we add the "&" to
24992 ref/out types before comparing it with the type of the argument.
24994 (IsParamsMethodApplicable): Ditto.
24996 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
24999 * delegate.cs : Handle the case when we have more than one applicable
25000 method. Flag an error only when we finish checking all.
25002 2002-05-02 Miguel de Icaza <miguel@ximian.com>
25004 * expression.cs: Add support for boolean static initializers.
25006 2002-05-01 Miguel de Icaza <miguel@ximian.com>
25008 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
25010 * parameter.cs (ComputeParameterTypes,
25011 ComputeAndDefineParameterTypes): Better error handling: now we
25012 clear the `types' cache if we fail during any of the type lookups.
25013 We also return the status code correctly to our caller
25015 * delegate.cs: If we fail to define a delegate, abort the extra
25018 * expression.cs (Binary.ResolveOperator): for
25019 operator==(object,object) and operator !=(object, object) we also
25020 have to verify that there is an implicit conversion from one to
25023 (ArrayAccess.DoResolve): Array Access can operate on
25026 2002-04-30 Miguel de Icaza <miguel@ximian.com>
25028 * assign.cs (CompoundAssign): A new class used as a "flag" that
25029 the assignment actually is happening as part of a compound
25030 assignment operator.
25032 During compound assignment, a few new rules exist to enable things
25039 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
25040 to the type of x) if y is implicitly convertible to the type of x,
25041 and the operator is a builtin operator and the return type of the
25042 operator is explicitly convertible to the type of x.
25044 * rootcontext.cs: Reset warning level to 2. 4 catches various
25045 "interesting" features in mcs, we must clean this up at some
25046 point, but currently am trying to kill other bugs ;-)
25048 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
25049 in container classes as well.
25051 * expression.cs (Binary.ResolveOperator): Handle string case
25052 before anything else (as operator overloading does emit an error
25053 before doing anything else).
25055 This code could go away when we move to a table driven model, but
25056 i could not come up with a good plan last night.
25058 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
25060 * typemanager.cs (CSharpName): reimplementation using regex.
25061 * class.cs: added null check for fields in Emit
25062 * rootcontext.cs: set warninglevel to 4
25064 2002-04-29 Miguel de Icaza <miguel@ximian.com>
25066 * typemanager.cs (CSharpName): reimplemented with Lupus
25069 2002-04-28 Miguel de Icaza <miguel@ximian.com>
25071 * statement.cs (If): correclty implement Resolve, because we were
25072 not catching sem errors in there. The same process is needed
25074 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
25077 (Statement.Warning_DeadCodeFound): Factorize code.
25078 (While): Report dead code here too.
25080 (Statement): Added Resolve virtual method to allow
25081 for resolution split from the emit code.
25083 2002-04-26 Miguel de Icaza <miguel@ximian.com>
25085 * statement.cs (EmitBoolExpression): No longer try to resolve the
25087 (MakeBoolean): New utility function that resolve, implicitly
25088 converts to boolean and tags the expression.
25091 (If, Do): Implement dead code elimination.
25092 (While): Implement loop inversion
25094 (Do, While, For, If): Resolve the expression prior to calling our
25097 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
25100 - added method Report28 (warning: program has more than one entry point)
25101 - added method IsEntryPoint, implements paragraph 10.1 of the spec
25102 - modified method Method.Define, the part at the end of the method
25104 * rootcontext.cs: added static public Location EntryPointLocation;
25106 * ../errors/cs0028.cs : Add test case for the above warning.
25109 - modified method CSharpName to allow arrays of primitive type to
25110 be printed nicely (e.g. instead of System.Int32[][] it now prints
25112 - added method CSharpSignature: returns the signature of a method
25113 in string format to be used in reporting errors, warnings, etc.
25115 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
25118 2002-04-26 Ravi Pratap <ravi@ximian.com>
25120 * delegate.cs (Define): Fix extremely silly bug where I was
25121 setting the type of the 'object' parameter of the BeginInvoke
25122 method to System.IAsyncResult instead of System.Object ;-)
25124 2002-04-26 Miguel de Icaza <miguel@ximian.com>
25126 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
25129 (Constructor.Emit): return if we fail to initialize the
25130 constructor. Another door closed!
25132 * expression.cs (New.DoResolve): Improve error message (from -6 to
25133 1501). Use DeclaredOnly lookup to find the exact constructor.
25135 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
25136 loop. This is useful.
25138 * cs-parser.jay: Adjust the default parameters so that destructors
25139 have the proper signature.
25141 2002-04-26 Martin Baulig <martin@gnome.org>
25143 * driver.cs (LoadAssembly): If `assembly' contains any characters
25144 which are only valid in path names and not in assembly names
25145 (currently slash, backslash and point), use Assembly.LoadFrom ()
25146 instead of Assembly.Load () on the `assembly' (before iteration
25147 over the link_paths).
25149 2002-04-26 Martin Baulig <martin@gnome.org>
25151 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
25153 2002-04-25 Miguel de Icaza <miguel@ximian.com>
25155 * class.cs (Property): use the new typemanager.MemberLookup
25157 (TypeContainer.MemberLookup): Implement using the
25158 TypeManager.MemberLookup now.
25160 * typemanager.cs: Make MemberLookup a function of the TypeManager,
25161 and return MemberInfos, so that these can be used without an
25162 EmitContext (what we had before).
25164 2002-04-24 Miguel de Icaza <miguel@ximian.com>
25166 * expression.cs: Fix the case where the argument to params if the
25167 type of the params. I omitted handling this before. Fixed
25169 2002-04-22 Miguel de Icaza <miguel@ximian.com>
25171 * driver.cs: Call BootCorlib_PopulateCoreType
25173 * class.cs (Property.CheckBase): Check for properties only, not
25176 * interface.cs: Temporary hack: try/catch around the
25177 CustomAttributeBuilder, because I am getting an exception that I
25180 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
25181 types whose definitions are required to be there (attributes are
25182 defined before standard types).
25184 Compute definitions as we boot the various types, as they are used
25185 immediately (value_type class will need object_type, but if we do
25186 not initialize object_type, we will pass a null, which will let
25187 the runtime pick the System.Object from the existing corlib, which
25188 is not what we want).
25190 2002-04-22 Patrik Torstensson <totte@labs2.com>
25192 * cs-tokenizer.cs: fixed a number of trim() issues.
25194 2002-04-22 Ravi Pratap <ravi@ximian.com>
25196 * expression.cs (Argument.Type): Ensure that we return the correct
25197 type when we have out or ref parameters [in which case we
25200 2002-04-22 Miguel de Icaza <miguel@ximian.com>
25202 * class.cs (Property, Indexer): Allow extern modifier in there.
25204 * typemanager.cs (InitBaseTypes): Initializes object_type and
25205 value_type, since those will be used early on during the bootstrap
25206 process to compile corlib.
25208 (InitCoreTypes): Move code from here to InitBaseTypes.
25210 2002-04-21 Miguel de Icaza <miguel@ximian.com>
25212 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
25213 single-dimension arrays as using the ldlen opcode.
25215 Daniel Lewis discovered this optimization.
25217 * typemanager.cs: Add signature for System.Array::get_Length
25219 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25221 * statement.cs: report the error when the foreach does not apply to an
25222 array nor a collection.
25224 2002-04-19 Miguel de Icaza <miguel@ximian.com>
25226 * expression.cs: Add implicit conversions to the operator ~.
25228 * constant.cs (DecimalConstant.Emit): Emit decimal value.
25230 * typemanager.cs: Locate the decimal constructor.
25232 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25234 * attribute.cs: use the new property of TypeOf.
25235 * expression.cs: added 'get' property around typearg.
25237 These changes fix a build breaker reported by NickD. Is this the
25238 correct way to fix? If not, please, revert my changes and make it
25241 2002-04-17 Miguel de Icaza <miguel@ximian.com>
25243 * attribute.cs: Add support for typeof in attribute invocations.
25244 I am not sure that this is right though.
25246 2002-04-14 Duncan Mak <duncan@ximian.com>
25248 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
25249 Binary.Operator.Division case.
25251 2002-04-13 Ravi Pratap <ravi@ximian.com>
25253 * class.cs (DefineType): Ensure that we do a proper check on
25254 attribute types and also register it with the TypeManager.
25256 (TypeContainer.Targets): The default for attribute types is
25257 AttributeTargets.All.
25259 * attribute.cs (ApplyAttributes): Registering the attribute type
25260 is done elsewhere, not when we discover we have a Usage attribute.
25262 2002-04-12 Ravi Pratap <ravi@ximian.com>
25264 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
25265 and get rid of is_delegate parameter.
25267 * everywhere : update.
25269 2002-04-12 Ravi Pratap <ravi@ximian.com>
25271 * cs-parser.jay (compilation_unit): Revamp completely to use
25272 some new ideas that I got from Rhys' grammar to solve the problems
25273 with assembly level attributes.
25275 (outer_declaration): New grammar production.
25277 (attribute_sections): Add.
25279 (opt_attributes): Base on attribute_sections
25281 (namespace_declaration): Allow opt_attributes to tackle the case
25282 when we have assembly level attributes - we are clever in this
25285 * attribute.cs (ApplyAttributes): Do not worry about assembly
25286 attributes in the non-global context.
25288 * rootcontext.cs (AddGlobalAttributes): Go back to using this
25289 instead of SetGlobalAttributes.
25291 * class.cs, rootcontext.cs : Ensure we define and generate
25292 attribute types before anything else.
25294 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
25295 and flag the new error -20 for the case when the attribute type
25296 does not have valid targets specified. csc does not catch this.
25298 * ../errors/errors.txt : update for error # -20
25300 2002-04-11 Ravi Pratap <ravi@ximian.com>
25302 * support.cs (InternalParameters.ParameterModifier): Do some null
25303 checking and return sane values.
25305 * class.cs (Method.Define): If we are a PInvoke method, ensure
25306 that we are static and extern. Report error # 601
25308 * ../errors/cs0601.cs : Add test case for the above error.
25310 2002-04-07 Ravi Pratap <ravi@ximian.com>
25312 * rootcontext.cs (attribute_types): We need to keep type of
25313 all attribute types separately and emit code for them first.
25315 (RegisterAttribute) : Implement.
25317 * class.cs (DefineType): Check if the current Type is a custom
25318 attribute type and register it accordingly.
25320 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
25321 adding the first attribute twice and rename to
25323 (SetGlobalAttributes): this.
25325 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
25328 * attribute.cs (ApplyAttributes): Take an additional argument telling us
25329 if we are processing global arguments. Hmm, I am unsure of this.
25331 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25333 * expression.cs: added static array of strings to avoid calling
25334 Enum.ToString () for Operator in Binary. Significant recover of
25337 2002-04-10 Miguel de Icaza <miguel@ximian.com>
25339 * class.cs (FindMembers): Allow the Builders of the various
25340 members to be null. If they are skip them. This only happens
25341 during the PInvoke declaration.
25343 2002-04-09 Miguel de Icaza <miguel@ximian.com>
25345 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
25346 failure, so we do not keep going afterwards.
25348 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
25349 wanted to pass `false' as the `is_delegate' argument. If this is
25350 the case, why not use delegate_type == null to mean `is_delegate =
25351 false' and anything else as is_delegate = true.
25353 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
25355 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
25356 code for the section, not the beginning of the tests.
25358 2002-04-08 Miguel de Icaza <miguel@ximian.com>
25360 * cfold.cs: Handle operator + (Enum x, Underlying x)
25362 * expression.cs (Binary): same. Warn about errors where we have
25363 Enum/Enum in operator + as well.
25365 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
25368 - added support for switch(bool)
25369 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
25370 - add TableSwitchEmit() to handle table-based switch statements
25372 2002-04-05 Ravi Pratap <ravi@ximian.com>
25374 * expression.cs (Invocation.OverloadResolve): Factor out code which
25375 does parameter compatibility checking with arguments so that we can
25376 re-use the code even from Delegate.VerifyApplicability
25378 (VerifyArgumentsCompat): Move above code here.
25380 * delegate.cs (VerifyApplicability): Get rid of duplicate code
25381 and instead make a call to the above method.
25383 2002-03-31 Ravi Pratap <ravi@ximian.com>
25385 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
25386 We use it to keep track of classes which are attribute types.
25388 2002-04-02 Miguel de Icaza <miguel@ximian.com>
25390 * delegate.cs (Delegate.Define): Correctly define the types in the
25391 presence of fixed and array parameters.
25393 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
25396 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
25397 include NonPublic after the first iteration.
25399 * class.cs (Indexer.CheckBase): Only check if both parents are
25402 * cs-parser.jay (accessor_body): If empty, set to null.
25404 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
25405 same code path here to resolve constants names that we did have in
25406 MemberAccess.DoResolve. There is too much code duplicated here.
25408 2002-04-01 Miguel de Icaza <miguel@ximian.com>
25410 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
25412 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
25415 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
25416 tokens, numbers and strings.
25418 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
25421 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
25422 asyncronous parameters and the regular parameters.
25424 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
25425 specify the target directory.
25427 * expression.cs: (This.DoResolve): Simplify
25428 (As.Emit): Optimize, do not generate IsInst if the expression is
25429 always of the given type.
25431 (Is.DoResolve): Bug fix, we were reporting both always/never for
25434 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
25435 creating too many unnecessary arrays.
25437 2002-03-31 Miguel de Icaza <miguel@ximian.com>
25439 * class.cs (EmitFieldInitializer): Use Assign expression to assign
25440 fields instead of rolling our own initializer. Takes care of all
25441 implicit conversions, and drops unnecessary static checks/argument.
25443 2002-03-31 Dick Porter <dick@ximian.com>
25445 * driver.cs: use the GetDirectories() return values properly, and
25446 use "/" as path separator.
25448 2002-03-30 Miguel de Icaza <miguel@ximian.com>
25450 * expression.cs (Unary): Optimize - - expr into expr.
25451 (Binary): Optimize a + (-b) into a -b.
25453 * codegen.cs (CodeGen): Made all methods static.
25455 2002-03-29 Miguel de Icaza <miguel@ximian.com>
25459 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
25460 TypeBuilder property.
25462 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
25465 * tree.cs: Removed the various RecordXXXX, and replaced with a
25466 single RecordDecl. Removed all the accessor methods, and just
25467 left a single access point Type
25469 * enum.cs: Rename DefineEnum to DefineType.
25471 * decl.cs: New abstract method `DefineType' used to unify the
25472 Defines for Enumerations, Interfaces, TypeContainers and
25475 (FindType): Moved LookupInterfaceOrClass here. Moved the
25476 LookupBaseClasses method that used to live in class.cs and
25477 interface.cs here, and renamed to FindType.
25479 * delegate.cs: Implement DefineType. Take advantage of the
25480 refactored pattern for locating the parent builder without taking
25481 the parent_builder argument (which we know does not work if we are
25482 nested, and triggering a toplevel definition).
25484 2002-03-28 Miguel de Icaza <miguel@ximian.com>
25486 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
25487 accessibility of a member has changed during override and report
25490 * class.cs (Method.Define, Property.Define): Only complain on
25491 overrides if the method is private, any other accessibility is
25492 fine (and since we just checked the permission is the same, we are
25495 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
25496 and elif are processed always. The other pre-processing
25497 directives are only processed if we are "taking" the path
25499 2002-03-29 Martin Baulig <martin@gnome.org>
25501 * class.cs (Method.Emit): Only emit symbolic debugging info if the
25502 current location is not Null.
25504 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
25505 a separate method so we can profile it.
25507 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
25508 `span.Seconds' are just seconds, but no minutes or hours.
25509 (MainDriver): Profile the CodeGen.SaveSymbols calls.
25511 2002-03-28 Miguel de Icaza <miguel@ximian.com>
25513 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
25514 Remove the gratuitous set of Final:
25516 // If an interface implementation, then we can set Final.
25517 if (((flags & MethodAttributes.Abstract) == 0) &&
25518 implementing.DeclaringType.IsInterface)
25519 flags |= MethodAttributes.Final;
25521 I do not know what I was smoking when I used that.
25524 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
25525 step into fixing the name resolution issues for delegates and
25526 unifying the toplevel name resolution.
25528 2002-03-28 Martin Baulig <martin@gnome.org>
25530 * class.cs (Method.Emit): If we have a symbol writer, call its
25531 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
25532 tell it about the current method.
25534 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
25535 writer that we're going to emit the first byte of IL code for a new
25536 statement (a new source line).
25537 (EmitContext.EmitTopBlock): If we have a symbol writer, call
25538 EmitContext.Mark() before emitting any code.
25540 * location.cs (SymbolDocument): Return null when we're Null.
25542 * statement.cs (Statement): Moved the `Location loc' variable here.
25543 (Statement.EmitBoolExpression): If we have a symbol writer, call
25544 ec.Mark() before emitting any code to tell it that we're at the
25545 beginning of a new statement.
25546 (StatementExpression): Added `Location' argument to the constructor.
25547 (Block): Added public readonly variable `StartLocation' and public
25548 variable `EndLocation'. The latter is to be set using SetEndLocation().
25549 (Block): Added constructor which takes a start and end location.
25550 (Block.SetEndLocation): New method. This sets the end location.
25551 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
25552 local variables we create.
25553 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
25554 each statement and do also mark the begin and end of the block.
25556 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
25557 tell it the current lexer.Location, use Location.Null for the end of the
25559 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
25560 current block, set its end location using SetEndLocation().
25561 (statement_expression): StatementExpression constructor now takes the
25562 lexer.Location as additional argument.
25563 (for_statement, declare_local_variables): Likewise.
25564 (declare_local_variables): When creating a new implicit block, use the
25565 new Block constructor and pass it the lexer.Location.
25567 2002-03-28 Miguel de Icaza <miguel@ximian.com>
25569 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
25570 members also on the parent interfaces recursively.
25572 2002-03-27 Miguel de Icaza <miguel@ximian.com>
25574 * report.cs: Use new formats, since Gonzalo finished the missing
25577 * expression.cs (Binary.ResolveOperator): added missing operator|
25578 operator& and operator^ for bool/bool.
25580 * cs-parser.jay: CheckDef now takes a Location argument that is
25581 used to report errors more precisly (instead of reporting the end
25582 of a definition, we try to track something which is a lot closer
25583 to the source of the problem).
25585 * cs-tokenizer.cs: Track global token use, so we can properly flag
25586 the use of #define/#undef after the first token has been seen.
25588 Also, rename the reportXXXX to Error_DescriptiveName
25590 * decl.cs (DeclSpace.IsTopLevel): Move property here from
25591 TypeContainer, so that Enum and Interface can use this too.
25593 * class.cs (TypeContainer.LookupInterfaceOrClass,
25594 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
25595 `builder' argument. Typically this was used to pass the parent
25596 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
25599 The problem is that a nested class could trigger the definition of
25600 a toplevel class, and the builder would be obviously wrong in that
25603 So we drop this argument, and we compute dynamically the
25604 TypeBuilder/ModuleBuilder (the correct information was available
25605 to us anyways from DeclSpace.Parent)
25607 * interface.cs (Interface.DefineInterface): Drop builder
25608 parameter cleanup like class.cs
25610 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
25613 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
25616 (Try.Emit): Propagate the returns value from the statement.
25618 (Return.Emit): Even if we are leavning
25620 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
25622 * modifiers.cs: Fix the computation of MethodAttributes flags.
25624 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
25626 * driver.cs: allow compilation of files that start with '/'.
25627 Add a default case when checking the argument of --target.
25629 2002-03-25 Miguel de Icaza <miguel@ximian.com>
25631 * interface.cs: Implement the same search algorithm for types in
25632 the interface code.
25634 * delegate.cs: Do not allow multiple definition.
25636 * Recovered ChangeLog that got accidentally amputated
25638 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
25640 * rootcontext.cs: Load manually enum to allow core classes to
25641 contain enumerations.
25643 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
25644 Update to new static methods in TypeManager.
25646 * typemanager.cs (GetMethod, GetConstructor): Use our
25647 implementation of FindMembers to find the members, since during
25648 corlib compilation, the types are TypeBuilders and GetMethod and
25649 GetConstructor do not work.
25651 Make all methods in TypeManager static.
25653 (InitCodeHelpers): Split the functionality from
25654 the InitCodeTypes function.
25656 * driver.cs: Call InitCodeHelpers after we have populated the
25659 * cs-parser.jay (delegate_declaration): we did not used to compute
25660 the delegate name correctly for void delegates.
25662 2002-03-24 Miguel de Icaza <miguel@ximian.com>
25664 * rootcontext.cs (RootContext): Init the interface_resolve_order
25665 and type_container_resolve_order always.
25667 (ResolveCore, BootstrapCorlib_ResolveClass,
25668 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
25669 compiler when compiling with --nostdlib
25671 * class.cs (TypeContainer.DefineType): Check that our parent is
25672 not null. This test is most important when we are bootstraping
25675 * codegen.cs: Split out the symbol writing code.
25677 2002-03-25 Martin Baulig <martin@gnome.org>
25679 * driver.cs (-g): Made -g an alias for --debug.
25681 2002-03-24 Martin Baulig <martin@gnome.org>
25683 * codegen.cs (SymbolWriter): New public variable. Returns the
25684 current symbol writer.
25685 (CodeGen): Added `bool want_debugging_support' argument to the
25686 constructor. If true, tell the ModuleBuild that we want debugging
25687 support and ask it for the ISymbolWriter.
25688 (Save): If we have a symbol writer, call it's Close() method after
25689 saving the assembly.
25691 * driver.c (--debug): New command line argument to create a
25692 debugger information file.
25694 * location.cs (SymbolDocument): New public property. Returns an
25695 ISymbolDocumentWriter object for the current source file or null
25696 if we don't have a symbol writer.
25698 2002-03-21 Miguel de Icaza <miguel@ximian.com>
25700 * driver.cs (LoadAssembly): Correctly return when all the paths
25701 have been tried and not before.
25703 * statement.cs (Switch.Emit): return the actual coverage for this
25704 statement (returns/not-returns)
25706 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
25707 switch of the statement if we are the last switch section. That
25708 kills two problems: try/catch problems (we used to emit an empty
25709 nop at the end) and switch statements where all branches would
25712 2002-03-19 Miguel de Icaza <miguel@ximian.com>
25714 * driver.cs: Add default assemblies (the equivalent to the
25715 Microsoft CSC.RSP file)
25717 * cs-tokenizer.cs: When updating `cols and setting it to zero,
25718 also update tokens_seen and set it to false.
25720 * driver.cs: Implement --recurse for Mike.
25722 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
25723 correctly splitting out the paths.
25725 2002-03-18 Miguel de Icaza <miguel@ximian.com>
25727 * interface.cs (Interface.PopulateProperty): Instead of using
25728 `parent' as the declaration space for the set parameters, use
25731 * support.cs (InternalParameters): InternalParameters constructor
25732 takes a DeclSpace instead of a TypeContainer.
25734 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
25735 types are being initialized, load the address of it before calling
25738 (New): Provide a mechanism to disable the generation of local
25739 value type temporaries when the caller will be providing us with
25740 an address to store it.
25742 (ArrayCreation.EmitDynamicInitializers): Use it.
25744 2002-03-17 Miguel de Icaza <miguel@ximian.com>
25746 * expression.cs (Invocation.EmitArguments): Only probe for array
25747 property if there is more than one argument. Sorry about that.
25749 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
25750 empty param arrays.
25752 * class.cs (Method.LabelParameters): Fix incorrect code path that
25753 prevented the `ParamArrayAttribute' from being applied to the
25756 2002-03-16 Miguel de Icaza <miguel@ximian.com>
25758 * support.cs (ReflectionParameters): Correctly compute whether the
25759 last argument is a params array. Fixes the problem with
25762 * typemanager.cs: Make the assemblies array always be non-null
25763 (empty, but non-null)
25765 * tree.cs (RecordDecl): New function that abstracts the recording
25766 of names. This reports error 101, and provides a pointer to the
25767 previous declaration. Fixes a crash in the compiler.
25769 * cs-parser.jay (constructor_declaration): Update to new grammar,
25770 and provide a constructor_body that can be empty.
25772 2002-03-15 Miguel de Icaza <miguel@ximian.com>
25774 * driver.cs: Add support for --resources.
25776 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
25777 Make all types for the various array helper methods be integer.
25779 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
25780 CheckState to ConvCast.
25782 (ConvCast): Now it takes a `checked' state argument, to avoid
25783 depending on the emit context for the conversion, and just using
25784 the resolve time setting.
25786 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
25787 instead of Invocation.EmitArguments. We do not emit the original
25788 arguments, instead we emit those which have been converted to
25789 unsigned int expressions.
25791 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
25793 * codegen.cs: ditto.
25795 * expression.cs (LocalVariableReference): Drop the use of the
25796 Store function that depended on the variable index.
25798 * statement.cs (VariableInfo): Drop the `Idx' property from this
25799 class, as this is not taking into account the indexes for
25800 temporaries tat we generate during the execution, getting the
25803 * class.cs: First emit class initializers, then call the parent
25806 * expression.cs (Binary): Fix opcode emision.
25807 (UnaryMutator.EmitCode): Support checked code generation
25809 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
25810 matches for events for both the Static and Instance scans,
25811 pointing to the same element. Fix that.
25813 2002-03-14 Miguel de Icaza <miguel@ximian.com>
25815 * rootcontext.cs (ResolveTree): Always set the
25816 interface_resolve_order, because nested interfaces will be calling
25819 * class.cs (GetInterfaceOrClass): Track the same resolution
25820 process used by TypeManager.LookupType. This fixes the nested
25821 type lookups in class declarations (separate path from
25824 (TypeContainer.DefineType): Also define nested interfaces.
25825 (TypeContainer.RegisterOrder): New public function used to
25826 register the order in which child interfaces need to be closed.
25828 Nested interfaces need to be closed after their parents have been
25831 * interface.cs (InterfaceAttr): Put all the logic for computing
25832 the interface attribute here.
25834 (DefineInterface): Register our interface order with the
25835 RootContext or with the TypeContainer depending on the case.
25837 2002-03-12 Miguel de Icaza <miguel@ximian.com>
25839 * cs-parser.jay: rework foreach statement to work with the new
25840 changes to the policy on SimpleNames.
25842 * report.cs: support Stacktrace on warnings as well.
25844 * makefile: drop --unsafe and /unsafe from the compile.
25846 2002-03-13 Ravi Pratap <ravi@ximian.com>
25848 * ecore.cs (StandardConversionExists): Modify to take an Expression
25849 as the first parameter. Ensure we do null -> reference type conversion
25852 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
25853 temporary Expression objects.
25855 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
25857 * interface.cs: workaround bug in method overloading resolution
25858 (there is already a bugzilla bug for it).
25860 2002-03-12 Miguel de Icaza <miguel@ximian.com>
25862 We could also solve this problem by having a separate path for
25863 performing type lookups, instead of DoResolve, we could have a
25864 ResolveType entry point, and only participating pieces of the
25865 production (simplename, deref, array) would implement this.
25867 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
25868 signal SimpleName to only resolve type names and not attempt to
25869 resolve anything else.
25871 * expression.cs (Cast): Set the flag.
25873 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
25875 * class.cs: Only report 108 if there is no `new' modifier.
25877 * cs-parser.jay: rework foreach statement to work with the new
25878 changes to the policy on SimpleNames.
25880 * report.cs: support Stacktrace on warnings as well.
25882 * makefile: drop --unsafe and /unsafe from the compile.
25884 2002-03-11 Miguel de Icaza <miguel@ximian.com>
25886 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25887 lookups here, instead of doing that at parse time. This means
25888 that our grammar will not introduce `LocalVariableReferences' as
25889 expressions at this point. That solves the problem of code like
25893 static void Main ()
25897 This is only half the fix. The full fix requires parameters to
25898 also be handled in this way.
25900 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
25901 makes the use more obvious of the DeclSpace. The
25902 ec.TypeContainer.TypeBuilder is now only used to pull the
25903 TypeBuilder for it.
25905 My theory is that I can get rid of the TypeBuilder completely from
25906 the EmitContext, and have typecasts where it is used (from
25907 DeclSpace to where it matters).
25909 The only pending problem is that the code that implements Aliases
25910 is on TypeContainer, and probably should go in DeclSpace.
25912 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25913 lookups here, instead of doing that at parse time. This means
25914 that our grammar will not introduce `LocalVariableReferences' as
25915 expressions at this point. That solves the problem of code like
25919 static void Main ()
25923 This is only half the fix. The full fix requires parameters to
25924 also be handled in this way.
25926 * class.cs (Property.DefineMethod): When implementing an interface
25927 method, set newslot, when implementing an abstract method, do not
25928 set the flag (before we tried never setting it, or always setting
25929 it, which is the difference).
25930 (Indexer.DefineMethod): same.
25931 (Method.DefineMethod): same.
25933 * ecore.cs: Only set the status used flag if we get back a Field.
25935 * attribute.cs: Temporary hack, so Paolo can keep working.
25937 2002-03-08 Ravi Pratap <ravi@ximian.com>
25939 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
25940 the unmanaged type in the case we have a MarshalAs attribute.
25942 (Resolve): Handle the case when we are parsing the special MarshalAs
25943 attribute [we need to store the unmanaged type to use later]
25945 * typemanager.cs (marshal_as_attr_type): Built in type for the
25946 MarshalAs Attribute.
25948 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
25949 on parameters and accordingly set the marshalling info.
25951 2002-03-09 Miguel de Icaza <miguel@ximian.com>
25953 * class.cs: Optimizing slightly by removing redundant code after
25954 we switched to the `NoTypes' return value.
25955 (Property.DefineMethod): use NoTypes here too.
25957 This fixes the bug I introduced in my last batch of changes.
25959 2002-03-05 Ravi Pratap <ravi@ximian.com>
25961 * tree.cs (RecordEnum): Add. We now keep track of enums too.
25963 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
25964 Enums since those are types too.
25966 * cs-parser.jay (enum_declaration): Record enums as we parse them.
25968 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
25969 thanks to a call during the lookup process.
25971 2002-03-07 Miguel de Icaza <miguel@ximian.com>
25973 * statement.cs (Foreach): Lots of work to accomodate a particular
25974 kind of foreach statement that I had not kept in mind. It is
25975 possible to have foreachs on classes that provide a GetEnumerator
25976 method that return objects that implement the "pattern" for using
25977 a foreach, there is no need to support GetEnumerator
25980 This is needed to compile nant.
25982 * decl.cs: Only report 114 if the member is not `Finalize' and if
25983 the warning level is at least 2.
25985 * class.cs: Moved the compare function from Method to
25988 (MethodSignature.InheritableMemberSignatureCompare): Add new
25989 filter function that is used to extract inheritable methods from a
25992 (Method.Define): Use the new `inheritable_method_signature_filter'
25995 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
25998 2002-03-06 Miguel de Icaza <miguel@ximian.com>
26000 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
26002 * cs-parser.jay: Add opt_semicolon to the interface declaration.
26004 * expression.cs: Pass location information to
26005 ConvertImplicitStandard.
26007 * class.cs: Added debugging code to track return values from
26010 2002-03-05 Miguel de Icaza <miguel@ximian.com>
26012 * expression.cs (Is.DoResolve): If either side of the `is' is an
26013 interface, do not flag the warning.
26015 * ecore.cs (ImplicitReferenceConversion): We need a separate test
26018 * report.cs: Allow for --fatal to be used with --probe.
26020 * typemanager.cs (NoTypes): Move the definition for the empty Type
26023 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
26025 (TypeContainer.DefineProxy): New function used to proxy to parent
26026 implementations when implementing interfaces.
26027 (TypeContainer.ParentImplements): used to lookup if our parent
26028 implements a public function that is required by an interface.
26029 (TypeContainer.VerifyPendingMethods): Hook this up.
26031 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
26032 `modules' and `assemblies' arraylists into arrays. We only grow
26033 these are the very early start up of the program, so this improves
26034 the speedof LookupType (nicely measured).
26036 * expression.cs (MakeByteBlob): Replaced unsafe code with
26037 BitConverter, as suggested by Paolo.
26039 * cfold.cs (ConstantFold.Binary): Special case: perform constant
26040 folding of string concatenation, but if either side is a string,
26041 and the other is not, then return null, and let the runtime use
26042 the concatenation on the string plus the object (using
26043 `Object.ToString').
26045 2002-03-04 Miguel de Icaza <miguel@ximian.com>
26047 Constant Folding has been implemented now.
26049 * expression.cs (Unary.Reduce): Do not throw an exception, catch
26050 the error instead on types that are not supported in one's
26053 * constant.cs (Constant and all children): New set of functions to
26054 perform implict and explicit conversions.
26056 * ecore.cs (EnumConstant): Implement the new functions to perform
26057 conversion by proxying to the child expression.
26059 * codegen.cs: (ConstantCheckState): Constant evaluation has its
26060 own separate setting that can not be turned off from the command
26061 line using --unchecked or --checked and is only controlled using
26062 the checked/unchecked statements and expressions. This setting is
26063 used by the constant folder to flag errors.
26065 * expression.cs (CheckedExpr, UncheckedExpr): Set the
26066 ConstantCheckState as well.
26068 During Resolve, they also have to flag the state, because the
26069 constant folder runs completely in the Resolve phase.
26071 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
26074 2002-03-01 Miguel de Icaza <miguel@ximian.com>
26076 * cfold.cs: New file, this file contains the constant folder.
26078 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
26079 argument to track whether we are using the resulting address to
26080 load or store a value and provide better error messages.
26082 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
26083 new AddressOf arguments.
26085 * statement.cs (Foreach.EmitCollectionForeach): Update
26087 * expression.cs (Argument.Emit): Call AddressOf with proper
26088 arguments to track usage.
26090 (New.DoEmit): Call AddressOf with new arguments.
26092 (Unary.Emit): Adjust AddressOf call.
26094 2002-03-01 Ravi Pratap <ravi@ximian.com>
26096 * cs-parser.jay (member_access): Change the case for pre-defined types
26097 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
26100 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
26103 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
26104 essentially like methods and apply attributes like MethodImplOptions to them too.
26106 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
26109 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
26110 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
26113 * Update code everywhere accordingly.
26115 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
26117 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
26119 2002-02-28 Ravi Pratap <ravi@ximian.com>
26121 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
26122 try performing lookups against those instead of jumping straight into using
26123 the 'using' clauses.
26125 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
26127 (LookupType): Perform lookups in implicit parents too.
26129 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
26130 sequence as RootContext.LookupType.
26132 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
26133 the various cases of namespace lookups into this method.
26135 2002-03-01 Miguel de Icaza <miguel@ximian.com>
26137 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
26138 in positional arguments)
26140 * class.cs (Operator): Update the AllowedModifiers to contain
26143 * cs-parser.jay: Update operator declaration to allow for the
26144 operator body to be empty.
26146 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
26149 2002-02-27 Miguel de Icaza <miguel@ximian.com>
26151 * class.cs (Method.Emit): Label parameters.
26153 * driver.cs: Return 1 or 0 as the program exit code.
26155 2002-02-26 Miguel de Icaza <miguel@ximian.com>
26157 * expression.cs: Special case the `null' object when trying to
26158 auto-compute the type, as anything can be explicitly converted to
26161 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
26162 spotting this Paolo.
26164 (Expression.ImplicitNumericConversion): Perform comparissions of
26165 the type using the underlying type in the case of an enumeration
26166 rather than using the enumeration type for the compare.
26168 Cope with the underlying == type case, which is not possible to
26171 (Expression.ConvertNumericExplicit): Perform comparissions of
26172 the type using the underlying type in the case of an enumeration
26173 rather than using the enumeration type for the compare.
26175 * driver.cs: If the user does not supply an extension, assume .exe
26177 * cs-parser.jay (if_statement): Rewrote so that we can track the
26178 location for the if statement.
26180 * expression.cs (Binary.ConstantFold): Only concat strings when
26181 the operation is "+", not everything ;-)
26183 * statement.cs (Statement.EmitBoolExpression): Take a location
26185 (If, While, Do): Track location.
26187 * expression.cs (Binary.ResolveOperator): In the object + string
26188 case, I was missing a call to ConvertImplicit
26190 2002-02-25 Ravi Pratap <ravi@ximian.com>
26192 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
26193 Location arguments. Ensure we use RootContext.LookupType to do our work
26194 and not try to do a direct Type.GetType and ModuleBuilder.GetType
26196 * interface.cs (PopulateMethod): Handle the type of the parameter being
26199 * expression.cs (Invocation.BetterFunction): Handle the case when we
26200 have a params method with no fixed arguments and a call is made with no
26203 2002-02-25 Miguel de Icaza <miguel@ximian.com>
26205 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
26206 the verbatim-string-literal
26208 * support.cs (InternalParameters.ParameterModifier): handle null
26210 (InternalParameters.ParameterType): ditto.
26212 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
26213 duplicating the name of the variable parameter.
26214 (GetParameterByName): Fix bug where we were not looking up array
26215 paramters if they were the only present (thanks Paolo!).
26216 (GetParameterInfo): We only have an empty set of types if both
26217 fixed and array are set to null.
26218 (GetParameterInfo-idx): Handle FixedParameter == null
26220 * cs-parser.jay: Handle the case where there is no catch
26221 statements (missing null test).
26223 2002-02-22 Miguel de Icaza <miguel@ximian.com>
26225 * driver.cs (MainDriver): Be conservative on our command line
26228 Catch DirectoryNotFoundException when calling GetFiles.
26230 (SplitPathAndPattern): Used to split the input specification into
26231 a path and a pattern that we can feed to Directory.GetFiles.
26233 2002-02-21 Miguel de Icaza <miguel@ximian.com>
26235 * statement.cs (Fixed): Implement the last case of the Fixed
26236 statement (string handling).
26238 * expression.cs (StringPtr): New class used to return a char * to
26239 a string; Used by the Fixed statement.
26241 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
26243 * expression.cs (Binary.ResolveOperator): Remove redundant
26244 MemberLookup pn parent type.
26245 Optimize union call, we do not need a union if the types are the same.
26246 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
26249 Specialize the use of MemberLookup everywhere, instead of using
26250 the default settings.
26252 (StackAlloc): Implement stackalloc keyword.
26254 * cs-parser.jay: Add rule to parse stackalloc.
26256 * driver.cs: Handle /h, /help, /?
26258 * expression.cs (MakeByteBlob): Removed the hacks we had in place
26259 before we supported unsafe code.
26261 * makefile: add --unsafe to the self compilation of mcs.
26263 2002-02-20 Miguel de Icaza <miguel@ximian.com>
26265 * expression.cs (PointerArithmetic): New class that is used to
26266 perform pointer arithmetic.
26267 (Binary.Resolve): Handle pointer arithmetic
26268 Handle pointer comparission.
26269 (ArrayPtr): Utility expression class that is used to take the
26270 address of an array.
26272 (ElementAccess): Implement array access for pointers
26274 * statement.cs (Fixed): Implement fixed statement for arrays, we
26275 are missing one more case before we are done.
26277 * expression.cs (Indirection): Implement EmitAssign and set the
26278 ExprClass to Variable. This allows pointer dereferences to be
26279 treated as variables, and to have values assigned to them.
26281 * ecore.cs (Expression.StoreFromPtr): New utility function to
26282 store values dereferencing.
26284 2002-02-20 Ravi Pratap <ravi@ximian.com>
26286 * expression.cs (Binary.ResolveOperator): Ensure that we are
26287 not trying to operate on a void type - this fixes the reported
26290 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
26291 the parent implementation is sealed.
26293 * ../errors/cs0239.cs : Add.
26295 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
26297 * typemanager.cs (unverifiable_code_type): Corresponds to
26298 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
26299 which have unsafe code in them.
26301 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
26304 2002-02-19 Miguel de Icaza <miguel@ximian.com>
26306 * cs-tokenizer.cs: Add support for @"litreal strings"
26308 Make tokenizer accept pre-processor directives
26309 on any column (remove the old C-like limitation).
26311 * rootcontext.cs (EmitCode): Emit any global attributes.
26312 (AddGlobalAttributes): Used to keep track of assembly attributes.
26314 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
26316 * cs-parser.jay: Add support for global attributes.
26318 2002-02-17 Miguel de Icaza <miguel@ximian.com>
26320 * expression.cs (Indirection): New helper class. Unary will
26321 create Indirection classes to be able to implement the
26322 IMemoryLocation interface on it.
26324 2002-02-16 Miguel de Icaza <miguel@ximian.com>
26326 * cs-parser.jay (fixed_statement): reference the right statement.
26328 * statement.cs (Fixed.Emit): Finish implementing the fixed
26329 statement for the &x case.
26331 2002-02-14 Miguel de Icaza <miguel@ximian.com>
26333 * class.cs (Property.Define, Method.Define): Remove newslot when
26336 * modifiers.cs: My use of NewSlot when `Abstract' was set was
26337 wrong. NewSlot should only be used if the `new' keyword is present.
26339 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
26340 locating our system dir. Sorry about this.
26342 2002-02-13 Miguel de Icaza <miguel@ximian.com>
26344 * driver.cs (GetSystemDir): Compute correctly the location of our
26345 system assemblies. I was using the compiler directory instead of
26346 the library directory.
26348 2002-02-13 Ravi Pratap <ravi@ximian.com>
26350 * expression.cs (BetterFunction): Put back in what Miguel commented out
26351 since it is the correct fix. The problem is elsewhere ;-)
26353 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
26354 parameters of the parms method are themselves compatible or not !
26356 (StandardConversionExists): Fix very dangerous bug where we were forgetting
26357 to check that a class implements an interface before saying that an implicit
26358 conversion was allowed. Use ImplementsInterface to do the checking.
26360 2002-02-13 Miguel de Icaza <miguel@ximian.com>
26362 * class.cs (Method.Define): Track whether we are an explicit
26363 implementation or not. And only call DefineMethodOverride if we
26364 are an explicit implementation.
26366 (Property.DefineMethod): Ditto.
26368 2002-02-11 Ravi Pratap <ravi@ximian.com>
26370 * expression.cs (BetterFunction): Catch hideous bug which was
26371 preventing us from detecting ambiguous calls due to implicit casts i.e
26374 2002-01-29 Miguel de Icaza <miguel@ximian.com>
26376 * support.cs (Pair): Remove un-needed method. I figured why I was
26377 getting the error in cs-parser.jay, the variable in a foreach loop
26378 is readonly, and the compiler does not really treat this as a variable.
26380 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
26381 instead of EQUALS in grammar.
26383 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
26385 * expression.cs (Unary.DoResolve): Check whether the argument is
26388 2002-01-28 Miguel de Icaza <miguel@ximian.com>
26390 * support.cs: Api for Pair to set a value. Despite the fact that
26391 the variables are public the MS C# compiler refuses to compile
26392 code that accesses the field if the variable is part of a foreach
26395 * statement.cs (Fixed): Begin implementation of the fixed
26398 (Block.AddVariable): Return the VariableInfo on success and null
26399 on failure instead of true/false.
26401 * cs-parser.jay (foreach): Catch errors on variables already
26402 defined (we were ignoring this value before) and properly unwind
26403 the block hierarchy
26405 (fixed_statement): grammar for the fixed statement.
26407 2002-01-25 Miguel de Icaza <miguel@ximian.com>
26409 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
26410 pointer types to be incretemented.
26412 (SizeOf): Implement.
26414 * cs-parser.jay (pointer_member_access): Implement
26415 expr->IDENTIFIER production.
26417 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
26418 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
26421 (Unary): Implement indirection.
26423 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
26424 use in non-unsafe context).
26426 (SimpleName.DoResolve): Check for pointers in field access on safe
26429 (Expression.LoadFromPtr): Factor the load-indirect code in this
26430 function. This was duplicated in UnboxCast and ParameterReference
26432 2002-01-24 Miguel de Icaza <miguel@ximian.com>
26434 * expression.cs (ComposedCast): report an error if a pointer cast
26435 is used in a safe region.
26437 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
26438 pointer type casts in unsafe context.
26440 * codegen.cs (EmitContext): Set up IsUnsafe.
26442 * cs-parser.jay (non_expression_type): Add productions for pointer
26445 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
26446 code. We should not use force into static mode if the method is
26447 not virtual. Fixes bug in MIS
26449 * statement.cs (Do.Emit, While.Emit, For.Emit,
26450 Statement.EmitBoolExpression): Add support to Do and While to
26451 propagate infinite loop as `I do return' semantics.
26453 Improve the For case to also test for boolean constants.
26455 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
26456 to the list of attributes we can add.
26458 Remove `EmitContext' argument.
26460 * class.cs (Method.Define): Apply parameter attributes.
26461 (Constructor.Define): Apply parameter attributes.
26462 (MethodCore.LabelParameters): Move here the core of labeling
26465 * support.cs (ReflectionParameters.ParameterModifier,
26466 InternalParameters.ParameterModifier): Use IsByRef on the type and
26467 only return the OUT bit for these parameters instead of in/out/ref
26470 This is because I miss-understood things. The ParameterInfo.IsIn
26471 and IsOut represent whether the parameter has the [In] and [Out]
26474 2002-01-22 Miguel de Icaza <miguel@ximian.com>
26476 * ecore.cs (FieldExpr.Emit): Release temporaries.
26478 * assign.cs (LocalTemporary.Release): new function.
26480 * codegen.cs (EmitContext.GetTemporaryStorage,
26481 EmitContext.FreeTemporaryStorage): Rework the way we deal with
26482 temporary storage. Now we can "put back" localbuilders when we
26485 2002-01-21 Miguel de Icaza <miguel@ximian.com>
26487 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
26488 need to make a copy of the variable to generate verifiable code.
26490 2002-01-19 Miguel de Icaza <miguel@ximian.com>
26492 * driver.cs: Compute dynamically the system directory.
26494 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
26495 Slower, but more generally useful. Used by the abstract
26496 registering implementation.
26498 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
26499 the rules for the special rule on Type/instances. First check if
26500 we have the same name, and if so, try that special static path
26501 rather than the instance path.
26503 2002-01-18 Miguel de Icaza <miguel@ximian.com>
26505 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
26508 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
26509 Enum, ValueType, Delegate or Array for non-corlib compiles.
26511 * cs-tokenizer.cs: Catch long identifiers (645)
26513 * typemanager.cs (IndexerPropetyName): Ravi never tested this
26516 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
26517 fix, we were returning too early, so we were not registering
26518 pending methods from abstract classes.
26520 Do not register pending methods if the class is abstract.
26522 * expression.cs (Conditional.DoResolve): Report circular implicit
26523 conversions when we neecd to compute it for conditional
26526 (Is.DoResolve): If the expression is always of the provided type,
26527 flag warning 183. If the expression can not ever be of the
26528 provided type flag warning 184.
26530 * class.cs: Catch 169 as well.
26532 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
26535 2002-01-18 Nick Drochak <ndrochak@gol.com>
26537 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
26539 2002-01-17 Miguel de Icaza <miguel@ximian.com>
26541 * interface.cs: (PopulateMethod): Check for pointers being defined
26542 only if the unsafe context is active.
26543 (PopulateProperty): ditto.
26544 (PopulateIndexer): ditto.
26546 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
26547 specified. If pointers are present, make sure that they are
26548 present in an unsafe context.
26549 (Constructor, Constructor.Define): ditto.
26550 (Field, Field.Define): ditto.
26551 (Property, Property.Define): ditto.
26552 (Event, Event.Define): ditto.
26554 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
26555 hashtable if there are classes or structs defined.
26557 * expression.cs (LocalVariableReference.DoResolve): Simplify this
26558 code, as the constant resolution moved.
26560 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
26561 the metadata, so we can flag error 133.
26563 * decl.cs (MemberCore.UnsafeOK): New function to test that a
26564 pointer is being declared in an unsafe context.
26566 2002-01-16 Miguel de Icaza <miguel@ximian.com>
26568 * modifiers.cs (Modifiers.Check): Require a Location argument.
26569 Report error 227 for Unsafe use.
26571 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
26573 * statement.cs (For.Emit): If the test is null, then report that
26574 we do `return', as we wont reach anything afterwards.
26576 (Switch.SwitchGoverningType): Track the expression that matched
26579 * driver.cs: Allow negative numbers as an error code to flag.
26581 * cs-parser.jay: Handle 1551.
26583 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
26585 2002-01-15 Miguel de Icaza <miguel@ximian.com>
26587 * cs-parser.jay: Report 1518 (type declaration can only contain
26588 class, struct, interface, enum or delegate)
26590 (switch_label): Report 1523 (keywords `case' or `default' must
26593 (opt_switch_sections): Report 1522 (empty switch)
26595 * driver.cs: Report 1515 (response file specified multiple times)
26596 Report 1516 (Source file specified multiple times).
26598 * expression.cs (Argument.Resolve): Signal 1510
26600 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
26601 access not allowed in static code)
26603 2002-01-11 Ravi Pratap <ravi@ximian.com>
26605 * typemanager.cs (IsPointerType): Utility method which we are going
26608 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
26609 the object type, so we take care of that.
26611 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
26613 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
26614 added to non-params parameters :-)
26616 * typemanager.cs (CSharpName): Include 'void' type too.
26618 (void_ptr_type): Include in the set of core types.
26620 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
26623 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
26626 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
26627 completely forgotten about it.
26629 2002-01-10 Ravi Pratap <ravi@ximian.com>
26631 * cs-parser.jay (pointer_type): Add. This begins our implementation
26632 of parsing rules for unsafe code.
26634 (unsafe_statement): Implement.
26636 (embedded_statement): Modify to include the above.
26638 * statement.cs (Unsafe): Implement new class for unsafe blocks.
26640 * codegen.cs (EmitContext.InUnsafe): Add. This determines
26641 if the current context is an unsafe one.
26643 * cs-parser.jay (local_variable_pointer_type): Since local variable types
26644 are handled differently, we need separate rules for them.
26646 (local_variable_declaration): Update to use local_variable_pointer_type
26647 to allow variable declarations of unmanaged pointer types.
26649 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
26650 in unsafe contexts.
26652 * ../errors/cs0214.cs : Add.
26654 2002-01-16 Nick Drochak <ndrochak@gol.com>
26656 * makefile: remove 'response' file when cleaning.
26658 2002-01-15 Miguel de Icaza <miguel@ximian.com>
26660 * cs-parser.jay: Report 1524.
26662 2002-01-14 Miguel de Icaza <miguel@ximian.com>
26664 * typemanager.cs (RegisterMethod): drop checking if we have
26665 registered this from here
26667 2002-01-12 Miguel de Icaza <miguel@ximian.com>
26669 * class.cs (Method.EmitDestructor): Implement calling our base
26672 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
26673 value of InFinally.
26675 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
26676 this routine and will wrap the call in a try/catch block. Deal
26679 2002-01-11 Miguel de Icaza <miguel@ximian.com>
26681 * ecore.cs (Expression.MemberLookup): instead of taking a
26682 parameter `same_type' that was used to tell whether we could
26683 access private members we compute our containing type from the
26686 (FieldExpr): Added partial support for volatile fields. This does
26687 not work for volatile fields exposed from assemblies, as I can not
26688 figure out how to extract the modreq from it.
26690 Updated all the source files to use this.
26692 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
26693 because it is referenced by MemberLookup very often.
26695 2002-01-09 Ravi Pratap <ravi@ximian.com>
26697 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
26698 TypeBuilder.GetCustomAttributes to retrieve what we need.
26700 Get rid of redundant default_member_attr_type as this is the same as
26701 default_member_type which already exists.
26703 * interface.cs, attribute.cs : Update accordingly.
26705 2002-01-08 Miguel de Icaza <miguel@ximian.com>
26707 * typemanager.cs: Enable IndexerPropertyName again. It does not
26708 work for TYpeBuilders though. Ravi, can you please fix this?
26710 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
26712 * expression.cs (Argument.Emit): Handle the case of ref objects
26713 being passed to ref functions;
26715 (ParameterReference.EmitLoad): Loads the content of the pointer
26716 without dereferencing.
26718 2002-01-07 Miguel de Icaza <miguel@ximian.com>
26720 * cs-tokenizer.cs: Implemented the pre-processing expressions.
26722 2002-01-08 Ravi Pratap <ravi@ximian.com>
26724 * class.cs (Indexer.DefineMethod): Incorporate the interface
26725 type in the name of the method if we are doing explicit interface
26728 * expression.cs (ConversionExists): Remove as it is completely obsolete.
26730 (BetterConversion): Fix extremely trivial bug where we were referring to
26731 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
26734 * ../errors/bug16.cs : Add although we have fixed it.
26736 2002-01-07 Miguel de Icaza <miguel@ximian.com>
26738 * expression.cs (BaseIndexer): Begin implementation.
26740 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
26742 * cs-parser.jay (indexer_declarator): Use qualified_identifier
26743 production directly to remove a shift/reduce, and implement
26744 explicit interface implementation.
26746 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
26747 after a floating point suffix.
26749 * expression.cs (DoNumericPromotions): Improved the conversion for
26750 uint/uint. If we have a constant, we avoid doing a typecast to a
26753 * class.cs (Indexer): Implement explicit interface implementation
26756 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
26758 * class.cs: make the default instance constructor public and hidebysig.
26760 2001-01-03 Ravi Pratap <ravi@ximian.com>
26762 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
26763 so we can call it from elsewhere.
26765 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
26766 we emit it internally if the class has a defined indexer; otherwise the user
26767 emits it by decorating the class definition with the DefaultMemberAttribute.
26769 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
26770 attribute is not used on a type which defines an indexer.
26772 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
26773 character when we skip whitespace.
26775 * ../errors/cs0646.cs : Add.
26777 2002-01-03 Miguel de Icaza <miguel@ximian.com>
26779 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
26782 * makefile: Add practical target `mcs3.exe' which builds the third
26783 generation compiler.
26785 * expression.cs (New): Fix structures constructor calling.
26787 * class.cs (Property, Method, Indexer): Emit Final flag on the
26788 method if we are an interface implementation and we are not
26791 * ecore.cs (PropertyExpr): New public field `IsBase', tells
26792 whether this property is referencing a `base' method.
26794 * expression.cs (Invocation.EmitCall): take an extra argument:
26795 is_base, this is used to determine whether the `call' or
26796 `callvirt' opcode should be used.
26799 * delegate.cs: update EmitCall.
26801 * class.cs (Method.Define): Set NewSlot for the cases where we are
26802 not implementing an interface method.
26804 (Property.Define): ditto.
26806 2002-01-02 Miguel de Icaza <miguel@ximian.com>
26808 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
26809 'r'. Allows mcs to parse itself fully.
26811 2002-01-02 Ravi Pratap <ravi@ximian.com>
26813 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
26814 of the number of initializers that require the InitializeArray method.
26816 (CheckIndices): Store the Expression in all cases - not the plain value. Also
26817 update the above field where necessary.
26819 (MakeByteBlob): Update accordingly.
26821 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
26824 (EmitDynamicInitializers): Update in accordance with the new optimization.
26826 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
26827 same OpCode applies.
26829 * cs-parser.jay : Fix some glaring errors I introduced.
26831 2002-01-01 Ravi Pratap <ravi@ximian.com>
26833 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
26834 so that we can check for name clashes there too.
26836 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
26837 for interface indexers.
26839 * interfaces.cs (Define): Emit the default member attribute.
26841 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
26842 variable was being referred to while setting the value ;-)
26844 2002-01-01 Miguel de Icaza <miguel@ximian.com>
26846 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
26847 byte-by-byte information when we know the data is zero.
26849 Make the block always a multiple of 4, because
26850 DefineInitializedData has a bug.
26852 * assign.cs: Fix, we should assign from the temporary, not from
26855 * expression.cs (MakeByteBlob): Fix my incorrect code.
26857 2001-12-31 Miguel de Icaza <miguel@ximian.com>
26859 * typemanager.cs (EnumToUnderlying): This function is used to get
26860 the underlying type from an enumeration, because it does not
26863 * constant.cs: Use the I4_S form for values between -128 and 127.
26865 * statement.cs (Block.LookupLabel): Looks up a label.
26866 (Block): Drop support for labeled blocks.
26868 (LabeledStatement): New kind of statement that represents a label
26871 (Goto): Finally implement this bad boy.
26873 * cs-parser.jay: Update to reflect new mechanism to implement
26876 2001-12-30 Miguel de Icaza <miguel@ximian.com>
26878 * codegen.cs (EmitContext.This): a codegen property that keeps the
26879 a single instance of this instead of creating many different this
26882 * delegate.cs (Delegate.DoResolve): Update to use the property;
26884 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
26886 * expression.cs (BaseAccess.DoResolve): Ditto.
26888 2001-12-29 Ravi Pratap <ravi@ximian.com>
26890 * typemanager.cs (methodimpl_attr_type): Add to hold the type
26891 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
26893 (InitCoreTypes): Update accordingly.
26895 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
26896 so we can quickly store the state.
26898 (ApplyAttributes): Set the correct implementation flags
26899 for InternalCall methods.
26901 2001-12-29 Miguel de Icaza <miguel@ximian.com>
26903 * expression.cs (EmitCall): if a method is not virtual, then do
26904 not use callvirt on it.
26906 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
26907 user defined stuff) requires the use of stobj, which takes an
26908 address on the stack instead of an array and an index. So emit
26909 the Ldelema operation for it.
26911 (EmitStoreOpcode): Use stobj for valuetypes.
26913 (UnaryMutator.EmitCode): Use the right 1 value depending on
26914 whether we are dealing with int64/uint64, float or doubles.
26916 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
26917 constructors that I implemented last night.
26919 (Constructor.IsDefault): Fix to work properly for static
26922 * cs-parser.jay (CheckDef): report method signature errors.
26923 Update error number 103 to be 132.
26925 * decl.cs: New AdditionResult enumeration value: MethodExists.
26926 Although we do this check for methods later on in the semantic
26927 analysis, catching repeated default constructors is so easy that
26928 we catch these here.
26930 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
26933 (ParameterReference.EmitAssign, Emit): handle
26936 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
26937 (ArrayAccess.EmitStoreOpcode): ditto.
26939 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
26941 * expression.cs (MakeByteBlob): Complete all the missing types
26942 (uint, short, ushort, byte, sbyte)
26944 * class.cs: Only init instance field initializers on instance
26947 Rename `constructors' to instance_constructors.
26949 (TypeContainer.AddConstructor): Only add constructors to the list
26950 if it is not static.
26952 Make sure that we handle default_static_constructor independently
26953 everywhere where we handle instance_constructors
26955 2001-12-28 Miguel de Icaza <miguel@ximian.com>
26957 * class.cs: Do not lookup or create a base initializer for a
26958 static constructor.
26960 (ConstructorInitializer.Resolve): use the proper type to lookup
26963 * cs-parser.jay: Report error 1585 (modifiers between type and name).
26965 * enum.cs, interface.cs: Remove CloseType, this is taken care by
26968 * decl.cs: CloseType is now an virtual method, the default
26969 implementation just closes this type.
26971 2001-12-28 Ravi Pratap <ravi@ximian.com>
26973 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
26974 to PreserveSig by default. Also emit HideBySig on such methods.
26976 Basically, set the defaults to standard values.
26978 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
26979 argument, if candidate is better, it can't be worse than the best !
26981 (Invocation): Re-write bits to differentiate between methods being
26982 applicable in their expanded form and their normal form - for params
26985 Get rid of use_standard everywhere as only standard conversions are allowed
26986 in overload resolution.
26988 More spec conformance.
26990 2001-12-27 Miguel de Icaza <miguel@ximian.com>
26992 * driver.cs: Add --timestamp, to see where the compiler spends
26995 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
26996 `this' in static code.
26998 (SimpleName.DoResolve): Implement in terms of a helper function
26999 that allows static-references to be passed upstream to
27002 (Expression.ResolveWithSimpleName): Resolve specially simple
27003 names when called by MemberAccess to implement the special
27006 (Expression.ImplicitReferenceConversion): Handle conversions from
27007 Null to reference types before others, as Null's type is
27010 * expression.cs (Invocation.EmitCall): Handle the special case of
27011 calling methods declared on a reference type from a ValueType
27012 (Base classes System.Object and System.Enum)
27014 (MemberAccess.Resolve): Only perform lookups on Enumerations if
27015 the left hand side is a TypeExpr, not on every enumeration.
27017 (Binary.Resolve): If types are reference types, then do a cast to
27018 object on operators != and == of both arguments.
27020 * typemanager.cs (FindMembers): Extract instance and static
27021 members if requested.
27023 * interface.cs (PopulateProperty): Use void_type instead of null
27024 as the return type for the setter method.
27026 (PopulateIndexer): ditto.
27028 2001-12-27 Ravi Pratap <ravi@ximian.com>
27030 * support.cs (ReflectionParameters): Fix minor bug where we
27031 were examining the wrong parameter for the ParamArray attribute.
27033 Cope with requests for the type of the parameter at position
27034 greater than the params parameter's. We now return the element
27035 type of the params array as that makes more sense.
27037 * expression.cs (Invocation.IsParamsMethodApplicable): Update
27038 accordingly as we no longer have to extract the element type
27041 (Invocation.OverloadResolve): Update.
27043 2001-12-27 Miguel de Icaza <miguel@ximian.com>
27045 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
27046 against IEnumerator, test whether the return value is a descendant
27047 of the IEnumerator interface.
27049 * class.cs (Indexer.Define): Use an auxiliary method to implement
27050 the other bits of the method definition. Begin support for
27051 explicit interface implementation.
27053 (Property.DefineMethod): Use TypeManager.void_type instead of null
27054 for an empty return value.
27056 2001-12-26 Miguel de Icaza <miguel@ximian.com>
27058 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
27059 dealing with a FieldExpr which is composed of a FieldBuilder, in
27060 the code path we did extract the constant, but we should have
27061 obtained the underlying value to be able to cast it (otherwise we
27062 end up in an infinite loop, this is what Ravi was running into).
27064 (ArrayCreation.UpdateIndices): Arrays might be empty.
27066 (MemberAccess.ResolveMemberAccess): Add support for section
27067 14.5.4.1 that deals with the special case of E.I when E is a type
27068 and something else, that I can be a reference to a static member.
27070 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
27071 handle a particular array type to create byte blobs, it is just
27072 something we dont generate byteblobs for.
27074 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
27077 * location.cs (Push): remove the key from the hashtable that we
27078 are about to add. This happens for empty files.
27080 * driver.cs: Dispose files after we have parsed them.
27082 (tokenize): new function that only runs the tokenizer on its
27083 input, for speed testing.
27085 2001-12-26 Ravi Pratap <ravi@ximian.com>
27087 * class.cs (Event.Define): Define the private field only if there
27088 are no accessors defined.
27090 * expression.cs (ResolveMemberAccess): If there is no associated
27091 field with the event, that means we have an event defined with its
27092 own accessors and we should flag error cs0070 since transforming
27093 ourselves into a field is not valid in that case.
27095 * ecore.cs (SimpleName.DoResolve): Same as above.
27097 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
27098 and charset to sane values.
27100 2001-12-25 Ravi Pratap <ravi@ximian.com>
27102 * assign.cs (DoResolve): Perform check on events only if they
27103 are being accessed outside the declaring type.
27105 * cs-parser.jay (event_declarations): Update rules to correctly
27106 set the type of the implicit parameter etc.
27108 (add_accessor, remove_accessor): Set current local parameters.
27110 * expression.cs (Binary): For delegate addition and subtraction,
27111 cast the return value from the method into the appropriate delegate
27114 2001-12-24 Ravi Pratap <ravi@ximian.com>
27116 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
27117 of these as the workaround is unnecessary.
27119 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
27120 delegate data - none of that is needed at all.
27122 Re-write bits to extract the instance expression and the delegate method
27125 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
27128 * attribute.cs (ApplyAttributes): New method to take care of common tasks
27129 of attaching attributes instead of duplicating code everywhere.
27131 * everywhere : Update code to do attribute emission using the above method.
27133 2001-12-23 Miguel de Icaza <miguel@ximian.com>
27135 * expression.cs (IsParamsMethodApplicable): if there are not
27136 parameters, return immediately.
27138 * ecore.cs: The 0 literal can be implicity converted to an enum
27141 (SimpleName.DoResolve): First lookup the type, then lookup the
27144 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
27145 want to get its address. If the InstanceExpression is not
27146 addressable, store the result in a temporary variable, then get
27149 * codegen.cs: Only display 219 errors on warning level or above.
27151 * expression.cs (ArrayAccess): Make it implement the
27152 IMemoryLocation interface.
27154 (Binary.DoResolve): handle the operator == (object a, object b)
27155 and operator != (object a, object b) without incurring into a
27156 BoxedCast (because 5 != o should never be performed).
27158 Handle binary enumerator operators.
27160 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
27161 value type, otherwise use Ldelem_ref.
27163 Use precomputed names;
27165 (AddressOf): Implement address of
27167 * cs-parser.jay (labeled_statement): Fix recursive block
27168 addition by reworking the production.
27170 * expression.cs (New.DoEmit): New has a special case:
27172 If we are dealing with a ValueType, we have a few
27173 situations to deal with:
27175 * The target of New is a ValueType variable, that is
27176 easy, we just pass this as the variable reference
27178 * The target of New is being passed as an argument,
27179 to a boxing operation or a function that takes a
27182 In this case, we need to create a temporary variable
27183 that is the argument of New.
27186 2001-12-23 Ravi Pratap <ravi@ximian.com>
27188 * rootcontext.cs (LookupType): Check that current_type is not null before
27189 going about looking at nested types.
27191 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
27192 not implement the IAssignMethod interface any more.
27194 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
27195 where we tranform them into FieldExprs if they are being resolved from within
27196 the declaring type.
27198 * ecore.cs (SimpleName.DoResolve): Do the same here.
27200 * assign.cs (DoResolve, Emit): Clean up code considerably.
27202 * ../errors/bug10.cs : Add.
27204 * ../errors/cs0070.cs : Add.
27206 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
27208 * assign.cs : Get rid of EventIsLocal everywhere.
27210 2001-12-23 Miguel de Icaza <miguel@ximian.com>
27212 * ecore.cs (ConvertIntLiteral): finished the implementation.
27214 * statement.cs (SwitchLabel): Convert the value we are using as a
27215 key before looking up the table.
27217 2001-12-22 Miguel de Icaza <miguel@ximian.com>
27219 * codegen.cs (EmitTopBlock): Require a Location argument now.
27221 * cs-parser.jay (constructor_declarator): We need to setup
27222 current_local_parameters before we parse the
27223 opt_constructor_initializer, to allow the variables to be bound
27224 to the constructor arguments.
27226 * rootcontext.cs (LookupType): First lookup nested classes in our
27227 class and our parents before we go looking outside our class.
27229 * expression.cs (ConstantFold): Extract/debox the values at the
27232 * rootcontext.cs (EmitCode): Resolve the constants first before we
27233 resolve the types. This is not really needed, but it helps debugging.
27235 * statement.cs: report location.
27237 * cs-parser.jay: pass location to throw statement.
27239 * driver.cs: Small bug fix.
27241 * report.cs: Updated format to be 4-zero filled digits.
27243 2001-12-22 Ravi Pratap <ravi@ximian.com>
27245 * expression.cs (CheckIndices): Fix minor bug where the wrong
27246 variable was being referred to ;-)
27248 (DoEmit): Do not call EmitStaticInitializers when the
27249 underlying type is System.Object.
27251 2001-12-21 Ravi Pratap <ravi@ximian.com>
27253 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
27254 and do the usual workaround for SRE.
27256 * class.cs (MyEventBuilder.EventType): New member to get at the type
27257 of the event, quickly.
27259 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
27261 * assign.cs (Assign.DoResolve): Handle the case when the target
27262 is an EventExpr and perform the necessary checks.
27264 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
27267 (SimpleName.MemberStaticCheck): Include check for EventExpr.
27269 (EventExpr): Set the type in the constructor itself since we
27270 are meant to be born fully resolved.
27272 (EventExpr.Define): Revert code I wrote earlier.
27274 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
27275 instance expression is null. The instance expression is a This in that case
27276 or a null, depending on whether it is a static method or not.
27278 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
27279 refers to more than one method.
27281 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
27282 and accordingly flag errors.
27284 2001-12-21 Miguel de Icaza <miguel@ximian.com>
27286 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
27288 2001-12-22 Miguel de Icaza <miguel@ximian.com>
27290 * location.cs (ToString): Provide useful rutine.
27292 2001-12-21 Miguel de Icaza <miguel@ximian.com>
27294 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
27295 objects, return the actual integral boxed.
27297 * statement.cs (SwitchLabel): define an ILLabel for each
27300 (Switch.CheckSwitch): If the value is a Literal, extract
27301 the underlying literal.
27303 Also in the unused hashtable we had, add the SwitchLabel so we can
27304 quickly look this value up.
27306 * constant.cs: Implement a bunch of new constants. Rewrite
27307 Literal based on this. Made changes everywhere to adapt to this.
27309 * expression.cs (Expression.MakeByteBlob): Optimize routine by
27310 dereferencing array only once, and also copes with enumrations.
27312 bytes are two bytes wide, not one.
27314 (Cast): Perform constant conversions.
27316 * ecore.cs (TryImplicitIntConversion): Return literals instead of
27317 wrappers to the literals here.
27319 * expression.cs (DoNumericPromotions): long literals can converted
27320 to ulong implicity (this is taken care of elsewhere, but I was
27321 missing this spot).
27323 * ecore.cs (Expression.Literalize): Make the return type Literal,
27324 to improve type checking.
27326 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
27328 2001-12-20 Miguel de Icaza <miguel@ximian.com>
27330 * literal.cs: Revert code from ravi that checked the bounds. The
27331 bounds are sane by the definition of the type itself.
27333 * typemanager.cs: Fix implementation of ImplementsInterface. We
27334 need to actually look up in our parent hierarchy for interfaces
27337 * const.cs: Use the underlying type for enumerations
27339 * delegate.cs: Compute the basename for the delegate creation,
27340 that should fix the delegate test case, and restore the correct
27341 Type Lookup semantics in rootcontext
27343 * rootcontext.cs: Revert Ravi's last patch. The correct way of
27344 referencing a nested type with the Reflection API is using the "+"
27347 * cs-parser.jay: Do not require EOF token at the end.
27349 2001-12-20 Ravi Pratap <ravi@ximian.com>
27351 * rootcontext.cs (LookupType): Concatenate type names with
27352 a '.' instead of a '+' The test suite passes again.
27354 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
27355 field of the enumeration.
27357 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
27358 the case when the member is an EventExpr.
27360 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
27361 static has an associated instance expression.
27363 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
27365 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
27367 * class.cs (Event.Define): Register event and perform appropriate checks
27370 We define the Add and Remove methods even if the use provides none because
27371 in that case, we provide default implementations ourselves.
27373 Define a private field of the type of the event. This is done by the CSC compiler
27374 and we should be doing it too ;-)
27376 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
27377 More methods we use in code we generate.
27379 (multicast_delegate_type, delegate_type): Two separate types since the distinction
27382 (InitCoreTypes): Update accordingly for the above.
27384 * class.cs (Event.Emit): Generate code for default accessors that we provide
27386 (EmitDefaultMethod): Do the job in the above.
27388 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
27391 2001-12-20 Miguel de Icaza <miguel@ximian.com>
27393 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
27394 builders even if we were missing one.
27396 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
27397 pass the Basename as our class name instead of the Name. The
27398 basename will be correctly composed for us.
27400 * parameter.cs (Paramters): Now takes a Location argument.
27402 * decl.cs (DeclSpace.LookupType): Removed convenience function and
27403 make all the code call directly LookupType in RootContext and take
27404 this chance to pass the Location information everywhere.
27406 * Everywhere: pass Location information.
27408 2001-12-19 Miguel de Icaza <miguel@ximian.com>
27410 * class.cs (Constructor.Define): Updated way of detecting the
27411 length of the parameters.
27413 (TypeContainer.DefineType): Use basename as the type name for
27416 (TypeContainer.Define): Do not recursively define types here, as
27417 definition is taken care in order by the RootContext.
27419 * tree.cs: Keep track of namespaces in a per-file basis.
27421 * parameter.cs (Parameter.ComputeSignature): Update to use
27424 (Parameters.GetSignature): ditto.
27426 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
27427 instead of a TypeContainer.
27429 (Interface.SemanticAnalysis): Use `this' instead of our parent to
27430 resolve names. Because we need to be resolve in our context, not
27433 * driver.cs: Implement response files.
27435 * class.cs (TypeContainer.DefineType): If we are defined, do not
27436 redefine ourselves.
27438 (Event.Emit): Emit the code for add/remove handlers.
27439 (Event.Define): Save the MethodBuilders for add/remove.
27441 * typemanager.cs: Use pair here too.
27443 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
27444 DictionaryEntry requires the first argument to be non-null.
27446 (enum_declaration): Compute full name for registering the
27449 (delegate_declaration): Instead of using
27450 formal_parameter_list, use opt_formal_parameter_list as the list
27453 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
27454 (EventParsing): New property that controls whether `add' and
27455 `remove' are returned as tokens or identifiers (for events);
27457 2001-12-19 Ravi Pratap <ravi@ximian.com>
27459 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
27460 use MyEventBuilder only and let it wrap the real builder for us.
27462 (MyEventBuilder): Revamp constructor etc.
27464 Implement all operations that we perform on EventBuilder in precisely the same
27467 (FindMembers): Update to use the EventBuilder member.
27469 (Event.Emit): Update accordingly.
27471 2001-12-18 Ravi Pratap <ravi@ximian.com>
27473 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
27474 by calling the appropriate methods.
27476 (GetCustomAttributes): Make stubs as they cannot possibly do anything
27479 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
27481 2001-12-17 Ravi Pratap <ravi@ximian.com>
27483 * delegate.cs (Delegate.Populate): Check that the return type
27484 and various parameters types are indeed accessible.
27486 * class.cs (Constructor.Define): Same here.
27488 (Field.Define): Ditto.
27490 (Event.Define): Ditto.
27492 (Operator.Define): Check that the underlying Method defined itself
27493 correctly - so it's MethodBuilder should not be null.
27495 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
27496 expression happens to be null.
27498 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
27499 members but as of now we don't seem to be able to do anything really useful with it.
27501 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
27502 not the EventBuilder.
27504 2001-12-18 Miguel de Icaza <miguel@ximian.com>
27506 * cs-tokenizer.cs: Add support for defines.
27507 Add support for #if, #elif, #else, #endif
27509 (eval_var): evaluates a variable.
27510 (eval): stubbed for evaluating functions.
27512 * cs-parser.jay: Pass the defines information
27514 * driver.cs: Add --define command line option.
27516 * decl.cs: Move MemberCore here.
27518 Make it the base class for DeclSpace. This allows us to catch and
27519 report 108 and 109 for everything now.
27521 * class.cs (TypeContainer.Define): Extract all the members
27522 before populating and emit the warning 108 (new keyword required
27523 to override) instead of having each member implement this.
27525 (MemberCore.Define): New abstract method, we will be using this in
27526 the warning reporting engine in Populate.
27528 (Operator.Define): Adjust to new MemberCore protocol.
27530 * const.cs (Const): This does not derive from Expression, it is a
27531 temporary object we use to create fields, it is a MemberCore.
27533 * class.cs (Method.Define): Allow the entry point to be in a
27536 * driver.cs: Rewrite the argument handler to clean it up a bit.
27538 * rootcontext.cs: Made it just an auxiliary namespace feature by
27539 making everything static.
27541 * driver.cs: Adapt code to use RootContext type name instead of
27544 * delegate.cs: Remove RootContext argument.
27546 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
27549 * class.cs (Event.Define): The lookup can fail.
27551 * cs-tokenizer.cs: Begin implementation of pre-procesor.
27553 * expression.cs: Resolve the this instance before invoking the code.
27555 2001-12-17 Miguel de Icaza <miguel@ximian.com>
27557 * cs-parser.jay: Add a production in element_access that allows
27558 the thing to become a "type" reference. This way we can parse
27559 things like "(string [])" as a type.
27561 Note that this still does not handle the more complex rules of
27565 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
27567 * ecore.cs: (CopyNewMethods): new utility function used to
27568 assemble the list of methods from running FindMembers.
27570 (MemberLookup): Rework FindMembers so that
27572 2001-12-16 Miguel de Icaza <miguel@ximian.com>
27574 * class.cs (TypeContainer): Remove Delegates who fail to be
27577 * delegate.cs (Populate): Verify that we dont get null return
27578 values. TODO: Check for AsAccessible.
27580 * cs-parser.jay: Use basename to emit error 574 (destructor should
27581 have the same name as container class), not the full name.
27583 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
27584 possible representation.
27586 Also implements integer type suffixes U and L.
27588 2001-12-15 Miguel de Icaza <miguel@ximian.com>
27590 * expression.cs (ArrayCreation.DoResolve): We need to do the
27591 argument resolution *always*.
27593 * decl.cs: Make this hold the namespace. Hold the root context as
27595 (LookupType): Move here.
27597 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
27599 * location.cs (Row, Name): Fixed the code, it was always returning
27600 references to the first file.
27602 * interface.cs: Register properties defined through interfaces.
27604 * driver.cs: Add support for globbing on the command line
27606 * class.cs (Field): Make it derive from MemberCore as well.
27609 2001-12-15 Ravi Pratap <ravi@ximian.com>
27611 * class.cs (Event::Define): Check that the type of the event is a delegate
27612 type else flag error #66.
27614 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
27617 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
27618 values of EntryPoint, CharSet etc etc.
27620 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
27622 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
27623 be null and we should ignore this. I am not sure if this is really clean. Apparently,
27624 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
27625 which needs this to do its work.
27627 * ../errors/cs0066.cs : Add.
27629 2001-12-14 Miguel de Icaza <miguel@ximian.com>
27631 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
27634 * class.cs: (MethodSignature.MethodSignature): Removed hack that
27635 clears out the parameters field.
27636 (MemberSignatureCompare): Cleanup
27638 (MemberCore): New base class used to share code between MethodCore
27641 (RegisterRequiredImplementations) BindingFlags.Public requires
27642 either BindingFlags.Instace or Static. Use instance here.
27644 (Property): Refactored code to cope better with the full spec.
27646 * parameter.cs (GetParameterInfo): Return an empty array instead
27649 * class.cs (Property): Abstract or extern properties have no bodies.
27651 * parameter.cs (GetParameterInfo): return a zero-sized array.
27653 * class.cs (TypeContainer.MethodModifiersValid): Move all the
27654 method modifier validation to the typecontainer so we can reuse
27655 this on properties.
27657 (MethodCore.ParameterTypes): return an empty sized array of types.
27659 (Property.Define): Test property modifier validity.
27661 Add tests for sealed/override too.
27663 (Method.Emit): abstract or extern methods have no bodies.
27665 2001-12-14 Ravi Pratap <ravi@ximian.com>
27667 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
27670 (Method::Define, ::Emit): Modify accordingly.
27672 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
27674 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
27676 * makefile: Pass in /unsafe.
27678 2001-12-13 Miguel de Icaza <miguel@ximian.com>
27680 * class.cs (MakeKey): Kill routine.
27682 * class.cs (TypeContainer.Define): Correctly define explicit
27683 method implementations (they require the full interface name plus
27686 * typemanager.cs: Deply the PtrHashtable here and stop using the
27687 lame keys. Things work so much better.
27689 This of course broke everyone who depended on `RegisterMethod' to
27690 do the `test for existance' test. This has to be done elsewhere.
27692 * support.cs (PtrHashtable): A hashtable that avoid comparing with
27693 the object stupid Equals method (because, that like fails all over
27694 the place). We still do not use it.
27696 * class.cs (TypeContainer.SetRequiredInterface,
27697 TypeContainer.RequireMethods): Killed these two routines and moved
27698 all the functionality to RegisterRequiredImplementations.
27700 (TypeContainer.RegisterRequiredImplementations): This routine now
27701 registers all the implementations required in an array for the
27702 interfaces and abstract methods. We use an array of structures
27703 which can be computed ahead of time to reduce memory usage and we
27704 also assume that lookups are cheap as most classes will not
27705 implement too many interfaces.
27707 We also avoid creating too many MethodSignatures.
27709 (TypeContainer.IsInterfaceMethod): Update and optionally does not
27710 clear the "pending" bit if we find that there are problems with
27713 (TypeContainer.VerifyPendingMethods): Update to report errors of
27714 methods that look like implementations but are not.
27716 (TypeContainer.Define): Add support for explicit interface method
27719 2001-12-12 Miguel de Icaza <miguel@ximian.com>
27721 * typemanager.cs: Keep track of the parameters here instead of
27722 being a feature of the TypeContainer.
27724 * class.cs: Drop the registration of parameters here, as
27725 InterfaceMethods are also interface declarations.
27727 * delegate.cs: Register methods with the TypeManager not only with
27728 the TypeContainer. This code was buggy.
27730 * interface.cs: Full registation here.
27732 2001-12-11 Miguel de Icaza <miguel@ximian.com>
27734 * expression.cs: Remove reducer for binary expressions, it can not
27737 * const.cs: Put here the code that used to go into constant.cs
27739 * constant.cs: Put here the code for constants, this is a new base
27740 class for Literals.
27742 * literal.cs: Make Literal derive from Constant.
27744 2001-12-09 Miguel de Icaza <miguel@ximian.com>
27746 * statement.cs (Return.Emit): Report error 157 if the user
27747 attempts to return from a finally block.
27749 (Return.Emit): Instead of emitting a return, jump to the end of
27752 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
27753 LocalBuilder to store the result of the function. ReturnLabel is
27754 the target where we jump.
27757 2001-12-09 Radek Doulik <rodo@ximian.com>
27759 * cs-parser.jay: remember alias in current namespace
27761 * ecore.cs (SimpleName::DoResolve): use aliases for types or
27764 * class.cs (LookupAlias): lookup alias in my_namespace
27766 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
27768 (LookupAlias): lookup alias in this and if needed in parent
27771 2001-12-08 Miguel de Icaza <miguel@ximian.com>
27775 * rootcontext.cs: (ModuleBuilder) Made static, first step into
27776 making things static. I need this to avoid passing the
27777 TypeContainer when calling ParameterType.
27779 * support.cs (InternalParameters.ParameterType): Remove ugly hack
27780 that did string manipulation to compute the type and then call
27781 GetType. Use Parameter.ParameterType instead.
27783 * cs-tokenizer.cs: Consume the suffix for floating values.
27785 * expression.cs (ParameterReference): figure out whether this is a
27786 reference parameter or not. Kill an extra variable by computing
27787 the arg_idx during emission.
27789 * parameter.cs (Parameters.GetParameterInfo): New overloaded
27790 function that returns whether a parameter is an out/ref value or not.
27792 (Parameter.ParameterType): The type of the parameter (base,
27793 without ref/out applied).
27795 (Parameter.Resolve): Perform resolution here.
27796 (Parameter.ExternalType): The full type (with ref/out applied).
27798 * statement.cs (Using.Emit, Using.EmitExpression): Implement
27799 support for expressions on the using statement.
27801 2001-12-07 Miguel de Icaza <miguel@ximian.com>
27803 * statement.cs (Using.EmitLocalVariableDecls): Split the
27804 localvariable handling of the using statement.
27806 (Block.EmitMeta): Keep track of variable count across blocks. We
27807 were reusing slots on separate branches of blocks.
27809 (Try.Emit): Emit the general code block, we were not emitting it.
27811 Check the type of the declaration to be an IDisposable or
27812 something that can be implicity converted to it.
27814 Emit conversions if required.
27816 * ecore.cs (EmptyExpression): New utility class.
27817 (Expression.ImplicitConversionExists): New utility function.
27819 2001-12-06 Miguel de Icaza <miguel@ximian.com>
27821 * statement.cs (Using): Implement.
27823 * expression.cs (LocalVariableReference): Support read only variables.
27825 * statement.cs: Remove the explicit emit for the Leave opcode.
27826 (VariableInfo): Add a readonly field.
27828 2001-12-05 Miguel de Icaza <miguel@ximian.com>
27830 * ecore.cs (ConvCast): new class used to encapsulate the various
27831 explicit integer conversions that works in both checked and
27832 unchecked contexts.
27834 (Expression.ConvertNumericExplicit): Use new ConvCast class to
27835 properly generate the overflow opcodes.
27837 2001-12-04 Miguel de Icaza <miguel@ximian.com>
27839 * statement.cs: The correct type for the EmptyExpression is the
27840 element_type, not the variable type. Ravi pointed this out.
27842 2001-12-04 Ravi Pratap <ravi@ximian.com>
27844 * class.cs (Method::Define): Handle PInvoke methods specially
27845 by using DefinePInvokeMethod instead of the usual one.
27847 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
27848 above to do the task of extracting information and defining the method.
27850 2001-12-04 Ravi Pratap <ravi@ximian.com>
27852 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
27853 of the condition for string type.
27855 (Emit): Move that here.
27857 (ArrayCreation::CheckIndices): Keep string literals in their expression
27860 (EmitDynamicInitializers): Handle strings appropriately.
27862 2001-12-04 Miguel de Icaza <miguel@ximian.com>
27864 * codegen.cs (EmitContext): Replace multiple variables with a
27865 single pointer to the current Switch statement.
27867 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
27870 2001-12-03 Miguel de Icaza <miguel@ximian.com>
27874 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
27877 (Foreach.Emit): Foreach on arrays was not setting
27878 up the loop variables (for break/continue).
27880 (GotoCase): Semi-implented.
27882 2001-12-03 Ravi Pratap <ravi@ximian.com>
27884 * attribute.cs (CheckAttribute): Handle system attributes by using
27885 Attribute.GetAttributes to examine information we need.
27887 (GetValidPlaces): Same here.
27889 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
27891 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
27893 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
27895 (Method::Define): Set appropriate flags if we have a DllImport attribute.
27897 (Method::Emit): Handle the case when we are a PInvoke method.
27899 2001-12-03 Miguel de Icaza <miguel@ximian.com>
27901 * expression.cs: Use ResolveWithSimpleName on compound names.
27903 2001-12-02 Ravi Pratap <ravi@ximian.com>
27905 * constant.cs (EmitConstant): Make sure we resolve the associated expression
27906 before trying to reduce it.
27908 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
27910 * constant.cs (LookupConstantValue): Implement.
27912 (EmitConstant): Use the above in emitting the constant.
27914 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
27915 that are user-defined by doing a LookupConstantValue on them.
27917 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
27920 2001-11-29 Miguel de Icaza <miguel@ximian.com>
27922 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
27924 (BaseAccess.DoResolve): Implement.
27926 (MemberAccess.DoResolve): Split this routine into a
27927 ResolveMemberAccess routine that can be used independently
27929 2001-11-28 Miguel de Icaza <miguel@ximian.com>
27931 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
27932 As that share bits of the implementation. Is returns a boolean,
27933 while As returns the Type that is being probed.
27935 2001-12-01 Ravi Pratap <ravi@ximian.com>
27937 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
27938 instead of a Literal - much easier.
27940 (EnumInTransit): Remove - utterly useless :-)
27942 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
27944 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
27946 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
27947 chain when we have no associated expression.
27949 2001-11-30 Ravi Pratap <ravi@ximian.com>
27951 * constant.cs (Define): Use Location while reporting the errror.
27953 Also emit a warning when 'new' is used and there is no inherited
27956 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
27959 (LookupEnumValue): Implement to lookup an enum member's value and define it
27962 (Populate): Re-write accordingly to use the above routine.
27964 2001-11-27 Miguel de Icaza <miguel@ximian.com>
27966 * expression.cs (This): Fix prototype for DoResolveLValue to
27967 override the base class DoResolveLValue.
27969 * cs-parser.cs: Report errors cs574 and cs575 (destructor
27972 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
27973 (we need to load the address of the field here). This fixes
27976 (FieldExpr.DoResolveLValue): Call the DoResolve
27977 function to initialize the Instance expression.
27979 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
27980 correctly the GetEnumerator operation on a value type.
27982 * cs-parser.jay: Add more simple parsing error catches.
27984 * statement.cs (Switch): Add support for string switches.
27985 Handle null specially.
27987 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
27989 2001-11-28 Ravi Pratap <ravi@ximian.com>
27991 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
27993 (declare_local_constant): New helper function.
27995 * statement.cs (AddConstant): Keep a separate record of constants
27997 (IsConstant): Implement to determine if a variable is a constant.
27999 (GetConstantExpression): Implement.
28001 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
28003 * statement.cs (IsVariableDefined): Re-write.
28005 2001-11-27 Ravi Pratap <ravi@ximian.com>
28007 * class.cs (TypeContainer::FindMembers): Look for constants
28008 in the case when we are looking for MemberTypes.Field
28010 * expression.cs (MemberAccess::DoResolve): Check that in the
28011 case we are a FieldExpr and a Literal, we are not being accessed
28012 by an instance reference.
28014 * cs-parser.jay (local_constant_declaration): Implement.
28016 (declaration_statement): Implement for constant declarations.
28018 2001-11-26 Miguel de Icaza <miguel@ximian.com>
28020 * statement.cs (Switch): Catch double defaults.
28022 (Switch): More work on the switch() statement
28023 implementation. It works for integral values now, need to finish
28027 2001-11-24 Miguel de Icaza <miguel@ximian.com>
28029 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
28030 integer literals into other integer literals. To be used by
28033 2001-11-24 Ravi Pratap <ravi@ximian.com>
28035 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
28038 (EmitDynamicInitializers): Cope with the above since we extract data
28039 directly from ArrayData now.
28041 (ExpectInitializers): Keep track of whether initializers are mandatory
28044 (Bounds): Make it a hashtable to prevent the same dimension being
28045 recorded for every element in that dimension.
28047 (EmitDynamicInitializers): Fix bug which prevented the Set array method
28050 Also fix bug which was causing the indices to be emitted in the reverse
28053 2001-11-24 Miguel de Icaza <miguel@ximian.com>
28055 * expression.cs (ArrayCreation): Implement the bits that Ravi left
28056 unfinished. They do not work, because the underlying code is
28059 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28061 * cs-parser.jay: Remove bogus fixme.
28063 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
28064 on Switch statement.
28066 2001-11-23 Ravi Pratap <ravi@ximian.com>
28068 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
28071 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
28072 parameter. Apparently, any expression is allowed.
28074 (ValidateInitializers): Update accordingly.
28076 (CheckIndices): Fix some tricky bugs thanks to recursion.
28078 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
28079 I was being completely brain-dead.
28081 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
28082 and re-write acordingly.
28084 (DelegateInvocation): Re-write accordingly.
28086 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
28088 (MakeByteBlob): Handle types more correctly.
28090 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
28091 initialization from expressions but it is incomplete because I am a complete
28094 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28096 * statement.cs (If.Emit): Fix a bug that generated incorrect code
28097 on If. Basically, we have to return `true' (ie, we do return to
28098 our caller) only if both branches of the if return.
28100 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
28101 short-circuit operators, handle them as short circuit operators.
28103 (Cast.DoResolve): Resolve type.
28104 (Cast.Cast): Take an expression as the target type.
28106 * cs-parser.jay (cast_expression): Remove old hack that only
28107 allowed a limited set of types to be handled. Now we take a
28108 unary_expression and we resolve to a type during semantic
28111 Use the grammar productions from Rhys to handle casts (this is
28112 not complete like Rhys syntax yet, we fail to handle that corner
28113 case that C# has regarding (-x), but we will get there.
28115 2001-11-22 Ravi Pratap <ravi@ximian.com>
28117 * class.cs (EmitFieldInitializer): Take care of the case when we have a
28118 field which is an array type.
28120 * cs-parser.jay (declare_local_variables): Support array initialization too.
28122 * typemanager.cs (MakeKey): Implement.
28124 (everywhere): Use the above appropriately.
28126 * cs-parser.jay (for_statement): Update for array initialization while
28127 declaring variables.
28129 * ecore.cs : The error message was correct, it's the variable's names that
28130 were misleading ;-) Make the code more readable.
28132 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
28133 the correct type etc.
28135 (ConvertExplicit): Handle Enum types by examining the underlying type.
28137 2001-11-21 Ravi Pratap <ravi@ximian.com>
28139 * parameter.cs (GetCallingConvention): Always return
28140 CallingConventions.Standard for now.
28142 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28144 * expression.cs (Binary.ResolveOperator): Update the values of `l'
28145 and `r' after calling DoNumericPromotions.
28147 * ecore.cs: Fix error message (the types were in the wrong order).
28149 * statement.cs (Foreach.ProbeCollectionType): Need to pass
28150 BindingFlags.Instance as well
28152 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
28153 implicit int literal conversion in an empty cast so that we
28154 propagate the right type upstream.
28156 (UnboxCast): new class used to unbox value types.
28157 (Expression.ConvertExplicit): Add explicit type conversions done
28160 (Expression.ImplicitNumericConversion): Oops, forgot to test for
28161 the target type before applying the implicit LongLiterals to ULong
28164 2001-11-21 Miguel de Icaza <miguel@ximian.com>
28166 * cs-parser.jay (for_statement): Reworked the way For works: now
28167 we declare manually any variables that are introduced in
28168 for_initializer to solve the problem of having out-of-band code
28169 emition (that is what got for broken).
28171 (declaration_statement): Perform the actual variable declaration
28172 that used to be done in local_variable_declaration here.
28174 (local_variable_declaration): Do not declare anything, just pass
28175 the information on a DictionaryEntry
28177 2001-11-20 Ravi Pratap <ravi@ximian.com>
28179 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
28180 re-write of the logic to now make it recursive.
28182 (UpdateIndices): Re-write accordingly.
28184 Store element data in a separate ArrayData list in the above methods.
28186 (MakeByteBlob): Implement to dump the array data into a byte array.
28188 2001-11-19 Ravi Pratap <ravi@ximian.com>
28190 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
28193 * constant.cs (Define): Implement.
28195 (EmitConstant): Re-write fully.
28197 Pass in location info.
28199 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
28202 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
28203 DictionaryEntry since we need location info too.
28205 (constant_declaration): Update accordingly.
28207 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
28208 code into another method : UpdateIndices.
28210 2001-11-18 Ravi Pratap <ravi@ximian.com>
28212 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
28213 some type checking etc.
28215 2001-11-17 Ravi Pratap <ravi@ximian.com>
28217 * expression.cs (ArrayCreation::ValidateInitializers): Implement
28218 bits to provide dimension info if the user skips doing that.
28220 Update second constructor to store the rank correctly.
28222 2001-11-16 Ravi Pratap <ravi@ximian.com>
28224 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
28225 and try to implement.
28227 * ../errors/cs0150.cs : Add.
28229 * ../errors/cs0178.cs : Add.
28231 2001-11-16 Miguel de Icaza <miguel@ximian.com>
28233 * statement.cs: Implement foreach on multi-dimensional arrays.
28235 * parameter.cs (Parameters.GetParameterByName): Also lookup the
28236 name of the params argument.
28238 * expression.cs: Use EmitStoreOpcode to get the right opcode while
28239 initializing the array.
28241 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
28242 we can use this elsewhere.
28244 * statement.cs: Finish implementation of foreach for single
28247 * cs-parser.jay: Use an out-of-band stack to pass information
28248 around, I wonder why I need this.
28250 foreach_block: Make the new foreach_block the current_block.
28252 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
28253 function used to return a static Parameters structure. Used for
28254 empty parameters, as those are created very frequently.
28256 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
28258 2001-11-15 Ravi Pratap <ravi@ximian.com>
28260 * interface.cs : Default modifier is private, not public. The
28261 make verify test passes again.
28263 2001-11-15 Ravi Pratap <ravi@ximian.com>
28265 * support.cs (ReflectionParameters): Fix logic to determine
28266 whether the last parameter is a params one. Test 9 passes again.
28268 * delegate.cs (Populate): Register the builders we define with
28269 RegisterParameterForBuilder. Test 19 passes again.
28271 * cs-parser.jay (property_declaration): Reference $6 instead
28272 of $$ to get at the location.
28274 (indexer_declaration): Similar stuff.
28276 (attribute): Ditto.
28278 * class.cs (Property): Register parameters for the Get and Set methods
28279 if they exist. Test 23 passes again.
28281 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
28282 call to EmitArguments as we are sure there aren't any params arguments.
28283 Test 32 passes again.
28285 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
28286 IndexOutOfRangeException.
28288 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
28289 Test 33 now passes again.
28291 2001-11-15 Miguel de Icaza <miguel@ximian.com>
28293 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
28294 broke a bunch of things. Will have to come up with a better way
28295 of tracking locations.
28297 * statement.cs: Implemented foreach for single dimension arrays.
28299 2001-11-09 Miguel de Icaza <miguel@ximian.com>
28301 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
28302 an error. This removes the lookup from the critical path.
28304 * cs-parser.jay: Removed use of temporary_loc, which is completely
28307 2001-11-14 Miguel de Icaza <miguel@ximian.com>
28309 * support.cs (ReflectionParameters.ParameterModifier): Report
28310 whether the argument is a PARAMS argument or not.
28312 * class.cs: Set the attribute `ParamArrayAttribute' on the
28313 parameter argument.
28315 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
28316 and cons_param_array_attribute (ConstructorInfo for
28317 ParamArrayAttribute).,
28319 * codegen.cs: Emit the return using the `Return' statement, that
28320 way we can report the error correctly for missing return values.
28322 * class.cs (Method.Emit): Clean up.
28324 * expression.cs (Argument.Resolve): Take another argument: the
28325 location where this argument is used. Notice that this is not
28326 part of the "Argument" class as to reduce the size of the
28327 structure (we know the approximate location anyways).
28329 Test if the argument is a variable-reference, if not, then
28330 complain with a 206.
28332 (Argument.Emit): Emit addresses of variables.
28334 (Argument.FullDesc): Simplify.
28336 (Invocation.DoResolve): Update for Argument.Resolve.
28338 (ElementAccess.DoResolve): ditto.
28340 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
28341 method should be virtual, as this method is always virtual.
28343 (NewDelegate.DoResolve): Update for Argument.Resolve.
28345 * class.cs (ConstructorInitializer.DoResolve): ditto.
28347 * attribute.cs (Attribute.Resolve): ditto.
28349 2001-11-13 Miguel de Icaza <miguel@ximian.com>
28351 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
28353 * expression.cs (ParameterReference): Drop IStackStorage and implement
28354 IAssignMethod instead.
28356 (LocalVariableReference): ditto.
28358 * ecore.cs (FieldExpr): Drop IStackStorage and implement
28359 IAssignMethod instead.
28361 2001-11-13 Miguel de Icaza <miguel@ximian.com>
28363 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
28364 enumerations that are used in heavily used structures derive from
28365 byte in a laughable and pathetic attempt to reduce memory usage.
28366 This is the kind of pre-optimzations that you should not do at
28367 home without adult supervision.
28369 * expression.cs (UnaryMutator): New class, used to handle ++ and
28370 -- separatedly from the other unary operators. Cleans up the
28371 code, and kills the ExpressionStatement dependency in Unary.
28373 (Unary): Removed `method' and `Arguments' from this class, making
28374 it smaller, and moving it all to SimpleCall, so I can reuse this
28375 code in other locations and avoid creating a lot of transient data
28376 strucutres when not required.
28378 * cs-parser.jay: Adjust for new changes.
28380 2001-11-11 Miguel de Icaza <miguel@ximian.com>
28382 * enum.cs (Enum.Populate): If there is a failure during
28385 * cs-parser.jay (opt_enum_base): we used to catch type errors
28386 here, but this is really incorrect. The type error should be
28387 catched during semantic analysis.
28389 2001-12-11 Ravi Pratap <ravi@ximian.com>
28391 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
28392 current_local_parameters as expected since I, in my stupidity, had forgotten
28395 * attribute.cs (GetValidPlaces): Fix stupid bug.
28397 * class.cs (Method::Emit): Perform check on applicability of attributes.
28399 (Constructor::Emit): Ditto.
28401 (Field::Emit): Ditto.
28403 (Field.Location): Store location information.
28405 (Property, Event, Indexer, Operator): Ditto.
28407 * cs-parser.jay (field_declaration): Pass in location for each field.
28409 * ../errors/cs0592.cs : Add.
28411 2001-11-12 Ravi Pratap <ravi@ximian.com>
28413 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
28415 (InitCoreTypes): Update accordingly.
28417 (RegisterAttrType, LookupAttr): Implement.
28419 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
28420 info about the same.
28422 (Resolve): Update to populate the above as necessary.
28424 (Error592): Helper.
28426 (GetValidPlaces): Helper to the above.
28428 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
28430 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
28432 2001-11-12 Ravi Pratap <ravi@ximian.com>
28434 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
28436 * ../errors/cs0617.cs : Add.
28438 2001-11-11 Ravi Pratap <ravi@ximian.com>
28440 * enum.cs (Emit): Rename to Populate to be more consistent with what
28441 we expect it to do and when exactly it is called.
28443 * class.cs, rootcontext.cs : Update accordingly.
28445 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
28446 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
28448 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
28450 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
28451 of a fieldinfo using the above, when dealing with a FieldBuilder.
28453 2001-11-10 Ravi Pratap <ravi@ximian.com>
28455 * ../errors/cs0031.cs : Add.
28457 * ../errors/cs1008.cs : Add.
28459 * ../errrors/cs0543.cs : Add.
28461 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
28464 (FindMembers): Implement.
28466 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
28467 enums and delegates too.
28469 (enum_types): Rename to builder_to_enum.
28471 (delegate_types): Rename to builder_to_delegate.
28473 * delegate.cs (FindMembers): Implement.
28475 2001-11-09 Ravi Pratap <ravi@ximian.com>
28477 * typemanager.cs (IsEnumType): Implement.
28479 * enum.cs (Emit): Re-write parts to account for the underlying type
28480 better and perform checking etc.
28482 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
28483 of the underlying type.
28485 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
28488 * enum.cs (error31): Helper to report error #31.
28490 * cs-parser.jay (enum_declaration): Store location of each member too.
28492 * enum.cs (member_to_location): New hashtable.
28494 (AddEnumMember): Update location hashtable.
28496 (Emit): Use the location of each member while reporting errors.
28498 2001-11-09 Miguel de Icaza <miguel@ximian.com>
28500 * cs-parser.jay: A for_initializer if is a
28501 local_variable_declaration really ammount to have an implicit
28502 block with the variable declaration and no initializer for for.
28504 * statement.cs (For.Emit): Cope with null initializers.
28506 This fixes the infinite loop on for initializers.
28508 2001-11-08 Miguel de Icaza <miguel@ximian.com>
28510 * enum.cs: More cleanup.
28512 * ecore.cs: Remove dead code.
28514 * class.cs (Property.Emit): More simplification.
28515 (Event.Emit): ditto.
28517 Reworked to have less levels of indentation.
28519 2001-11-08 Ravi Pratap <ravi@ximian.com>
28521 * class.cs (Property): Emit attributes.
28531 * enum.cs (Emit): Ditto.
28533 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
28536 * class.cs (Field, Event, etc.): Move attribute generation into the
28537 Emit method everywhere.
28539 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
28540 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
28541 as we had no way of defining nested enums !
28543 * rootcontext.cs : Adjust code accordingly.
28545 * typemanager.cs (AddEnumType): To keep track of enum types separately.
28547 2001-11-07 Ravi Pratap <ravi@ximian.com>
28549 * expression.cs (EvalConstantExpression): Move into ecore.cs
28551 * enum.cs (Enum): Rename some members and make them public and readonly
28552 according to our convention.
28554 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
28557 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
28559 (Enum::Emit): Write a simple version for now which doesn't try to compute
28560 expressions. I shall modify this to be more robust in just a while.
28562 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
28564 (TypeContainer::CloseType): Create the Enum types too.
28566 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
28568 * expression.cs (EvalConstantExpression): Get rid of completely.
28570 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
28571 user-defined values and other cases.
28573 (IsValidEnumLiteral): Helper function.
28575 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
28576 out there in the case we had a literal FieldExpr.
28578 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
28580 (Literalize): Revamp a bit to take two arguments.
28582 (EnumLiteral): New class which derives from Literal to wrap enum literals.
28584 2001-11-06 Ravi Pratap <ravi@ximian.com>
28586 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
28588 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
28590 (Resolve): Use the above to ensure we have proper initializers.
28592 2001-11-05 Ravi Pratap <ravi@ximian.com>
28594 * expression.cs (Expression::EvalConstantExpression): New method to
28595 evaluate constant expressions.
28597 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
28599 2001-11-07 Miguel de Icaza <miguel@ximian.com>
28601 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
28604 (Binary.ResolveOperator): Handle operator != (object a, object b)
28605 and operator == (object a, object b);
28607 (Binary.DoNumericPromotions): Indicate whether the numeric
28608 promotion was possible.
28610 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
28613 Made the ArrayAccess implement interface IAssignMethod instead of
28614 IStackStore as the order in which arguments are passed reflects
28617 * assign.cs: Instead of using expr.ExprClass to select the way of
28618 assinging, probe for the IStackStore/IAssignMethod interfaces.
28620 * typemanager.cs: Load InitializeArray definition.
28622 * rootcontext.cs (RootContext.MakeStaticData): Used to define
28623 static data that can be used to initialize arrays.
28625 2001-11-05 Miguel de Icaza <miguel@ximian.com>
28627 * expression.cs: Handle operator== and operator!= for booleans.
28629 (Conditioal.Reduce): Implement reducer for the ?: operator.
28631 (Conditional.Resolve): Implement dead code elimination.
28633 (Binary.Resolve): Catch string literals and return a new
28634 concatenated string.
28636 (Unary.Reduce): Implement reduction of unary expressions.
28638 * ecore.cs: Split out the expression core handling here.
28640 (Expression.Reduce): New method used to perform constant folding
28641 and CSE. This is needed to support constant-expressions.
28643 * statement.cs (Statement.EmitBoolExpression): Pass true and false
28644 targets, and optimize for !x.
28646 2001-11-04 Ravi Pratap <ravi@ximian.com>
28648 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
28649 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
28650 set custom atttributes.
28652 * literal.cs (Literal::GetValue): New abstract method to return the actual
28653 value of the literal, cast as an object.
28655 (*Literal): Implement GetValue method.
28657 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
28658 expressions to the arraylist but objects of type Argument.
28660 * class.cs (TypeContainer::Emit): Emit our attributes too.
28662 (Method::Emit, Constructor::Emit): Ditto.
28664 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
28665 to be ignoring earlier.
28667 2001-11-03 Ravi Pratap <ravi@ximian.com>
28669 * attribute.cs (AttributeSection::Define): Implement to do the business
28670 of constructing a CustomAttributeBuilder.
28672 (Attribute): New trivial class. Increases readability of code.
28674 * cs-parser.jay : Update accordingly.
28676 (positional_argument_list, named_argument_list, named_argument): New rules
28678 (attribute_arguments): Use the above so that we are more correct.
28680 2001-11-02 Ravi Pratap <ravi@ximian.com>
28682 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
28683 to perform all checks for a method with a params parameter.
28685 (Invocation::OverloadResolve): Update to use the above method and therefore
28686 cope correctly with params method invocations.
28688 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
28691 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
28692 constructors in our parent too because we can't afford to miss out on
28695 * attribute.cs (AttributeSection): New name for the class Attribute
28697 Other trivial changes to improve readability.
28699 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
28700 use the new class names.
28702 2001-11-01 Ravi Pratap <ravi@ximian.com>
28704 * class.cs (Method::Define): Complete definition for params types too
28706 (Indexer::Define): Ditto.
28708 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
28709 Cope everywhere with a request for info about the array parameter.
28711 2001-11-01 Ravi Pratap <ravi@ximian.com>
28713 * tree.cs (RecordNamespace): Fix up to check for the correct key.
28715 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
28716 local_variable_type to extract the string corresponding to the type.
28718 (local_variable_type): Fixup the action to use the new helper method.
28720 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
28723 * expression.cs : Clean out code which uses the above.
28725 2001-10-31 Ravi Pratap <ravi@ximian.com>
28727 * typemanager.cs (RegisterMethod): Check if we already have an existing key
28728 and bale out if necessary by returning a false.
28730 (RegisterProperty): Ditto.
28732 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
28733 and print out appropriate error messages.
28735 * interface.cs (everywhere): Ditto.
28737 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
28738 location to constructor.
28740 * class.cs (Property, Event, Indexer): Update accordingly.
28742 * ../errors/cs111.cs : Added.
28744 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
28745 of a method, as laid down by the spec.
28747 (Invocation::OverloadResolve): Use the above method.
28749 2001-10-31 Ravi Pratap <ravi@ximian.com>
28751 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
28752 now take a TypeContainer and a Parameters object.
28754 (ParameterData): Modify return type of ParameterModifier method to be
28755 Parameter.Modifier and not a string.
28757 (ReflectionParameters, InternalParameters): Update accordingly.
28759 * expression.cs (Argument::GetParameterModifier): Same here.
28761 * support.cs (InternalParameters::ParameterType): Find a better way of determining
28762 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
28763 symbol in it at all so maybe this is only for now.
28765 2001-10-30 Ravi Pratap <ravi@ximian.com>
28767 * support.cs (InternalParameters): Constructor now takes an extra argument
28768 which is the actual Parameters class.
28770 (ParameterDesc): Update to provide info on ref/out modifiers.
28772 * class.cs (everywhere): Update call to InternalParameters to pass in
28773 the second argument too.
28775 * support.cs (ParameterData): Add ParameterModifier, which is a method
28776 to return the modifier info [ref/out etc]
28778 (InternalParameters, ReflectionParameters): Implement the above.
28780 * expression.cs (Argument::ParameterModifier): Similar function to return
28781 info about the argument's modifiers.
28783 (Invocation::OverloadResolve): Update to take into account matching modifiers
28786 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
28787 a new SetFormalParameters object which we pass to InternalParameters.
28789 2001-10-30 Ravi Pratap <ravi@ximian.com>
28791 * expression.cs (NewArray): Merge into the ArrayCreation class.
28793 2001-10-29 Ravi Pratap <ravi@ximian.com>
28795 * expression.cs (NewArray): Merge classes NewBuiltinArray and
28796 NewUserdefinedArray into one as there wasn't much of a use in having
28799 * expression.cs (Argument): Change field's name to ArgType from Type.
28801 (Type): New readonly property which returns the proper type, taking into
28802 account ref/out modifiers.
28804 (everywhere): Adjust code accordingly for the above.
28806 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
28807 whether we are emitting for a ref or out parameter.
28809 * expression.cs (Argument::Emit): Use the above field to set the state.
28811 (LocalVariableReference::Emit): Update to honour the flag and emit the
28814 * parameter.cs (Attributes): Set the correct flags for ref parameters.
28816 * expression.cs (Argument::FullDesc): New function to provide a full desc.
28818 * support.cs (ParameterData): Add method ParameterDesc to the interface.
28820 (ReflectionParameters, InternalParameters): Implement the above method.
28822 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
28825 (Invocation::FullMethodDesc): Ditto.
28827 2001-10-29 Miguel de Icaza <miguel@ximian.com>
28829 * cs-parser.jay: Add extra production for the second form of array
28832 * expression.cs (ArrayCreation): Update to reflect the above
28835 * Small changes to prepare for Array initialization.
28837 2001-10-28 Miguel de Icaza <miguel@ximian.com>
28839 * typemanager.cs (ImplementsInterface): interface might be null;
28840 Deal with this problem;
28842 Also, we do store negative hits on the cache (null values), so use
28843 this instead of calling t.GetInterfaces on the type everytime.
28845 2001-10-28 Ravi Pratap <ravi@ximian.com>
28847 * typemanager.cs (IsBuiltinType): New method to help determine the same.
28849 * expression.cs (New::DoResolve): Get rid of array creation code and instead
28850 split functionality out into different classes.
28852 (New::FormArrayType): Move into NewBuiltinArray.
28854 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
28857 (NewBuiltinArray): New class to handle creation of built-in arrays.
28859 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
28860 account creation of one-dimensional arrays.
28862 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
28864 (NewUserdefinedArray::DoResolve): Implement.
28866 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
28868 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
28869 we maintain inside the TypeManager. This is necessary to perform lookups on the
28872 (LookupType): Update to perform GetType on the module builders too.
28874 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
28876 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
28878 2001-10-23 Ravi Pratap <ravi@ximian.com>
28880 * expression.cs (New::DoResolve): Implement guts of array creation.
28882 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
28884 2001-10-27 Miguel de Icaza <miguel@ximian.com>
28886 * expression.cs: Fix bug I introduced lsat night that broke
28889 (Expression.Resolve): Report a 246 error (can not resolve name)
28890 if we find a SimpleName in the stream.
28892 (Expression.ResolveLValue): Ditto.
28894 (Expression.ResolveWithSimpleName): This function is a variant of
28895 ResolveName, this one allows SimpleNames to be returned without a
28896 warning. The only consumer of SimpleNames is MemberAccess
28898 2001-10-26 Miguel de Icaza <miguel@ximian.com>
28900 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
28901 might arrive here. I have my doubts that this is correct.
28903 * statement.cs (Lock): Implement lock statement.
28905 * cs-parser.jay: Small fixes to support `lock' and `using'
28907 * cs-tokenizer.cs: Remove extra space
28909 * driver.cs: New flag --checked, allows to turn on integer math
28912 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
28913 Threading.Monitor.Exit
28915 2001-10-23 Miguel de Icaza <miguel@ximian.com>
28917 * expression.cs (IndexerAccess::DoResolveLValue): Set the
28918 Expression Class to be IndexerAccess.
28920 Notice that Indexer::DoResolve sets the eclass to Value.
28922 2001-10-22 Miguel de Icaza <miguel@ximian.com>
28924 * class.cs (TypeContainer::Emit): Emit code for indexers.
28926 * assign.cs (IAssignMethod): New interface implemented by Indexers
28927 and Properties for handling assignment.
28929 (Assign::Emit): Simplify and reuse code.
28931 * expression.cs (IndexerAccess, PropertyExpr): Implement
28932 IAssignMethod, clean up old code.
28934 2001-10-22 Ravi Pratap <ravi@ximian.com>
28936 * typemanager.cs (ImplementsInterface): New method to determine if a type
28937 implements a given interface. Provides a nice cache too.
28939 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
28942 (ConvertReferenceExplicit): Ditto.
28944 * delegate.cs (Delegate::Populate): Update to define the parameters on the
28945 various methods, with correct names etc.
28947 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
28948 Operator.UnaryNegation.
28950 * cs-parser.jay (operator_declarator): Be a little clever in the case where
28951 we have a unary plus or minus operator.
28953 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
28956 * everywhere : update accordingly.
28958 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
28961 * class.cs (Method::Define): For the case where we are implementing a method
28962 inherited from an interface, we need to set the MethodAttributes.Final flag too.
28963 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
28965 2001-10-21 Ravi Pratap <ravi@ximian.com>
28967 * interface.cs (FindMembers): Implement to work around S.R.E
28970 * typemanager.cs (IsInterfaceType): Implement.
28972 (FindMembers): Update to handle interface types too.
28974 * expression.cs (ImplicitReferenceConversion): Re-write bits which
28975 use IsAssignableFrom as that is not correct - it doesn't work.
28977 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
28978 and accordingly override EmitStatement.
28980 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
28981 using the correct logic :-)
28983 2001-10-19 Ravi Pratap <ravi@ximian.com>
28985 * ../errors/cs-11.cs : Add to demonstrate error -11
28987 2001-10-17 Miguel de Icaza <miguel@ximian.com>
28989 * assign.cs (Assign::Resolve): Resolve right hand side first, and
28990 then pass this as a hint to ResolveLValue.
28992 * expression.cs (FieldExpr): Add Location information
28994 (FieldExpr::LValueResolve): Report assignment to readonly
28997 (Expression::ExprClassFromMemberInfo): Pass location information.
28999 (Expression::ResolveLValue): Add new method that resolves an
29002 (Expression::DoResolveLValue): Default invocation calls
29005 (Indexers): New class used to keep track of indexers in a given
29008 (IStackStore): Renamed from LValue, as it did not really describe
29009 what this did. Also ResolveLValue is gone from this interface and
29010 now is part of Expression.
29012 (ElementAccess): Depending on the element access type
29014 * typemanager.cs: Add `indexer_name_type' as a Core type
29015 (System.Runtime.CompilerServices.IndexerNameAttribute)
29017 * statement.cs (Goto): Take a location.
29019 2001-10-18 Ravi Pratap <ravi@ximian.com>
29021 * delegate.cs (Delegate::VerifyDelegate): New method to verify
29022 if two delegates are compatible.
29024 (NewDelegate::DoResolve): Update to take care of the case when
29025 we instantiate a delegate from another delegate.
29027 * typemanager.cs (FindMembers): Don't even try to look up members
29028 of Delegate types for now.
29030 2001-10-18 Ravi Pratap <ravi@ximian.com>
29032 * delegate.cs (NewDelegate): New class to take care of delegate
29035 * expression.cs (New): Split the delegate related code out into
29036 the NewDelegate class.
29038 * delegate.cs (DelegateInvocation): New class to handle delegate
29041 * expression.cs (Invocation): Split out delegate related code into
29042 the DelegateInvocation class.
29044 2001-10-17 Ravi Pratap <ravi@ximian.com>
29046 * expression.cs (New::DoResolve): Implement delegate creation fully
29047 and according to the spec.
29049 (New::DoEmit): Update to handle delegates differently.
29051 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
29052 because of which we were printing out arguments in reverse order !
29054 * delegate.cs (VerifyMethod): Implement to check if the given method
29055 matches the delegate.
29057 (FullDelegateDesc): Implement.
29059 (VerifyApplicability): Implement.
29061 * expression.cs (Invocation::DoResolve): Update to accordingly handle
29062 delegate invocations too.
29064 (Invocation::Emit): Ditto.
29066 * ../errors/cs1593.cs : Added.
29068 * ../errors/cs1594.cs : Added.
29070 * delegate.cs (InstanceExpression, TargetMethod): New properties.
29072 2001-10-16 Ravi Pratap <ravi@ximian.com>
29074 * typemanager.cs (intptr_type): Core type for System.IntPtr
29076 (InitCoreTypes): Update for the same.
29078 (iasyncresult_type, asynccallback_type): Ditto.
29080 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
29083 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
29086 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
29087 the builders for the 4 members of a delegate type :-)
29089 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
29092 * expression.cs (New::DoResolve): Implement guts for delegate creation.
29094 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
29096 2001-10-15 Miguel de Icaza <miguel@ximian.com>
29098 * statement.cs (Break::Emit): Implement.
29099 (Continue::Emit): Implement.
29101 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
29102 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
29103 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
29104 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
29107 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
29108 properties that track the label for the current loop (begin of the
29109 loop and end of the loop).
29111 2001-10-15 Ravi Pratap <ravi@ximian.com>
29113 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
29114 use of emitting anything at all.
29116 * class.cs, rootcontext.cs : Get rid of calls to the same.
29118 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
29120 (Populate): Define the constructor correctly and set the implementation
29123 * typemanager.cs (delegate_types): New hashtable to hold delegates that
29126 (AddDelegateType): Implement.
29128 (IsDelegateType): Implement helper method.
29130 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
29132 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
29133 and accordingly handle it.
29135 * delegate.cs (Populate): Take TypeContainer argument.
29136 Implement bits to define the Invoke method. However, I still haven't figured out
29137 how to take care of the native int bit :-(
29139 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
29140 Qualify the name of the delegate, not its return type !
29142 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
29145 (StandardConversionExists): Checking for array types turns out to be recursive.
29147 (ConvertReferenceExplicit): Implement array conversion.
29149 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
29151 2001-10-12 Ravi Pratap <ravi@ximian.com>
29153 * cs-parser.jay (delegate_declaration): Store the fully qualified
29154 name as it is a type declaration.
29156 * delegate.cs (ReturnType, Name): Rename members to these. Make them
29159 (DefineDelegate): Renamed from Define. Does the same thing essentially,
29160 as TypeContainer::DefineType.
29162 (Populate): Method in which all the definition of the various methods (Invoke)
29165 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
29168 (CloseDelegate): Finally creates the delegate.
29170 * class.cs (TypeContainer::DefineType): Update to define delegates.
29171 (Populate, Emit and CloseType): Do the same thing here too.
29173 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
29174 delegates in all these operations.
29176 2001-10-14 Miguel de Icaza <miguel@ximian.com>
29178 * expression.cs: LocalTemporary: a new expression used to
29179 reference a temporary that has been created.
29181 * assign.cs: Handle PropertyAccess back here, so that we can
29182 provide the proper semantic access to properties.
29184 * expression.cs (Expression::ConvertReferenceExplicit): Implement
29185 a few more explicit conversions.
29187 * modifiers.cs: `NEW' modifier maps to HideBySig.
29189 * expression.cs (PropertyExpr): Make this into an
29190 ExpressionStatement, and support the EmitStatement code path.
29192 Perform get/set error checking, clean up the interface.
29194 * assign.cs: recognize PropertyExprs as targets, and if so, turn
29195 them into toplevel access objects.
29197 2001-10-12 Miguel de Icaza <miguel@ximian.com>
29199 * expression.cs: PropertyExpr::PropertyExpr: use work around the
29202 * typemanager.cs: Keep track here of our PropertyBuilders again to
29203 work around lameness in SRE.
29205 2001-10-11 Miguel de Icaza <miguel@ximian.com>
29207 * expression.cs (LValue::LValueResolve): New method in the
29208 interface, used to perform a second resolution pass for LValues.
29210 (This::DoResolve): Catch the use of this in static methods.
29212 (This::LValueResolve): Implement.
29214 (This::Store): Remove warning, assigning to `this' in structures
29217 (Invocation::Emit): Deal with invocation of
29218 methods on value types. We need to pass the address to structure
29219 methods rather than the object itself. (The equivalent code to
29220 emit "this" for structures leaves the entire structure on the
29221 stack instead of a pointer to it).
29223 (ParameterReference::DoResolve): Compute the real index for the
29224 argument based on whether the method takes or not a `this' pointer
29225 (ie, the method is static).
29227 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
29228 value types returned from functions when we need to invoke a
29229 method on the sturcture.
29232 2001-10-11 Ravi Pratap <ravi@ximian.com>
29234 * class.cs (TypeContainer::DefineType): Method to actually do the business of
29235 defining the type in the Modulebuilder or Typebuilder. This is to take
29236 care of nested types which need to be defined on the TypeBuilder using
29237 DefineNestedMethod.
29239 (TypeContainer::GetClassBases): Implement. Essentially the code from the
29240 methods in RootContext, only ported to be part of TypeContainer.
29242 (TypeContainer::GetInterfaceOrClass): Ditto.
29244 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
29246 * interface.cs (Interface::DefineInterface): New method. Does exactly
29247 what RootContext.CreateInterface did earlier, only it takes care of nested types
29250 (Interface::GetInterfaces): Move from RootContext here and port.
29252 (Interface::GetInterfaceByName): Same here.
29254 * rootcontext.cs (ResolveTree): Re-write.
29256 (PopulateTypes): Re-write.
29258 * class.cs (TypeContainer::Populate): Populate nested types too.
29259 (TypeContainer::Emit): Emit nested members too.
29261 * typemanager.cs (AddUserType): Do not make use of the FullName property,
29262 instead just use the name argument passed in as it is already fully
29265 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
29266 to TypeContainer mapping to see if a type is user-defined.
29268 * class.cs (TypeContainer::CloseType): Implement.
29270 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
29271 the default constructor.
29273 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
29276 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
29278 * interface.cs (CloseType): Create the type here.
29280 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
29283 Remove all the methods which are now in TypeContainer.
29285 2001-10-10 Ravi Pratap <ravi@ximian.com>
29287 * delegate.cs (Define): Re-write bits to define the delegate
29290 2001-10-10 Miguel de Icaza <miguel@ximian.com>
29292 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
29294 * expression.cs (ImplicitReferenceConversion): handle null as well
29295 as a source to convert to any reference type.
29297 * statement.cs (Return): Perform any implicit conversions to
29298 expected return type.
29300 Validate use of return statement.
29302 * codegen.cs (EmitContext): Pass the expected return type here.
29304 * class.cs (Method, Constructor, Property): Pass expected return
29305 type to EmitContext.
29307 2001-10-09 Miguel de Icaza <miguel@ximian.com>
29309 * expression.cs: Make DoResolve take an EmitContext instead of a
29312 Replaced `l' and `location' for `loc', for consistency.
29314 (Error, Warning): Remove unneeded Tc argument.
29316 * assign.cs, literal.cs, constant.cs: Update to new calling
29319 * codegen.cs: EmitContext now contains a flag indicating whether
29320 code is being generated in a static method or not.
29322 * cs-parser.jay: DecomposeQI, new function that replaces the old
29323 QualifiedIdentifier. Now we always decompose the assembled
29324 strings from qualified_identifier productions into a group of
29327 2001-10-08 Miguel de Icaza <miguel@ximian.com>
29329 * rootcontext.cs: Deal with field-less struct types correctly now
29330 by passing the size option to Define Type.
29332 * class.cs: Removed hack that created one static field.
29334 2001-10-07 Miguel de Icaza <miguel@ximian.com>
29336 * statement.cs: Moved most of the code generation here.
29338 2001-10-09 Ravi Pratap <ravi@ximian.com>
29340 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
29343 (ElementAccess): Remove useless bits for now - keep checks as the spec
29346 2001-10-08 Ravi Pratap <ravi@ximian.com>
29348 * expression.cs (ElementAccess::DoResolve): Remove my crap code
29349 and start performing checks according to the spec.
29351 2001-10-07 Ravi Pratap <ravi@ximian.com>
29353 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
29354 rank_specifiers instead.
29356 (rank_specifiers): Change the order in which the rank specifiers are stored
29358 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
29360 * expression.cs (ElementAccess): Implement the LValue interface too.
29362 2001-10-06 Ravi Pratap <ravi@ximian.com>
29364 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
29365 except that user defined conversions are not included.
29367 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
29368 perform the conversion of the return type, if necessary.
29370 (New::DoResolve): Check whether we are creating an array or an object
29371 and accordingly do the needful.
29373 (New::Emit): Same here.
29375 (New::DoResolve): Implement guts of array creation.
29377 (New::FormLookupType): Helper function.
29379 2001-10-07 Miguel de Icaza <miguel@ximian.com>
29381 * codegen.cs: Removed most of the code generation here, and move the
29382 corresponding code generation bits to the statement classes.
29384 Added support for try/catch/finalize and throw.
29386 * cs-parser.jay: Added support for try/catch/finalize.
29388 * class.cs: Catch static methods having the flags override,
29389 virtual or abstract.
29391 * expression.cs (UserCast): This user cast was not really doing
29392 what it was supposed to do. Which is to be born in fully resolved
29393 state. Parts of the resolution were being performed at Emit time!
29397 2001-10-05 Miguel de Icaza <miguel@ximian.com>
29399 * expression.cs: Implicity convert the result from UserCast.
29401 2001-10-05 Ravi Pratap <ravi@ximian.com>
29403 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
29404 prevented it from working correctly.
29406 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
29407 merely ConvertImplicit.
29409 2001-10-05 Miguel de Icaza <miguel@ximian.com>
29411 * typemanager.cs: Make the LookupTypeContainer function static,
29412 and not per-instance.
29414 * class.cs: Make static FindMembers (the one that takes a Type
29417 * codegen.cs: Add EmitForeach here.
29419 * cs-parser.jay: Make foreach a toplevel object instead of the
29420 inline expansion, as we need to perform semantic analysis on it.
29422 2001-10-05 Ravi Pratap <ravi@ximian.com>
29424 * expression.cs (Expression::ImplicitUserConversion): Rename to
29425 UserDefinedConversion.
29427 (Expression::UserDefinedConversion): Take an extra argument specifying
29428 whether we look for explicit user conversions too.
29430 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
29432 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
29434 (ExplicitUserConversion): Make it a call to UserDefinedConversion
29435 with the appropriate arguments.
29437 * cs-parser.jay (cast_expression): Record location too.
29439 * expression.cs (Cast): Record location info.
29441 (Expression::ConvertExplicit): Take location argument.
29443 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
29444 to determine if we are doing explicit conversions.
29446 (UserCast::Emit): Update accordingly.
29448 (Expression::ConvertExplicit): Report an error if everything fails.
29450 * ../errors/cs0030.cs : Add.
29452 2001-10-04 Miguel de Icaza <miguel@ximian.com>
29454 * modifiers.cs: If the ABSTRACT keyword is present, also set the
29455 virtual and newslot bits.
29457 * class.cs (TypeContainer::RegisterRequiredImplementations):
29458 Record methods we need.
29460 (TypeContainer::MakeKey): Helper function to make keys for
29461 MethodBases, since the Methodbase key is useless.
29463 (TypeContainer::Populate): Call RegisterRequiredImplementations
29464 before defining the methods.
29466 Create a mapping for method_builders_to_methods ahead of time
29467 instead of inside a tight loop.
29469 (::RequireMethods): Accept an object as the data to set into the
29470 hashtable so we can report interface vs abstract method mismatch.
29472 2001-10-03 Miguel de Icaza <miguel@ximian.com>
29474 * report.cs: Make all of it static.
29476 * rootcontext.cs: Drop object_type and value_type computations, as
29477 we have those in the TypeManager anyways.
29479 Drop report instance variable too, now it is a global.
29481 * driver.cs: Use try/catch on command line handling.
29483 Add --probe option to debug the error reporting system with a test
29486 * report.cs: Add support for exiting program when a probe
29487 condition is reached.
29489 2001-10-03 Ravi Pratap <ravi@ximian.com>
29491 * expression.cs (Binary::DoNumericPromotions): Fix the case when
29492 we do a forcible conversion regardless of type, to check if
29493 ForceConversion returns a null.
29495 (Binary::error19): Use location to report error.
29497 (Unary::error23): Use location here too.
29499 * ../errors/cs0019.cs : Check in.
29501 * ../errors/cs0023.cs : Check in.
29503 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
29504 case of a non-null MethodInfo object with a length of 0 !
29506 (Binary::ResolveOperator): Flag error if overload resolution fails to find
29507 an applicable member - according to the spec :-)
29508 Also fix logic to find members in base types.
29510 (Unary::ResolveOperator): Same here.
29512 (Unary::report23): Change name to error23 and make first argument a TypeContainer
29513 as I was getting thoroughly confused between this and error19 :-)
29515 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
29516 (::FindMostEncompassedType): Implement.
29517 (::FindMostEncompassingType): Implement.
29518 (::StandardConversionExists): Implement.
29520 (UserImplicitCast): Re-vamp. We now need info about most specific
29521 source and target types so that we can do the necessary conversions.
29523 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
29524 mathematical union with no duplicates.
29526 2001-10-03 Miguel de Icaza <miguel@ximian.com>
29528 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
29529 in order from base classes to child classes, so that we can in
29530 child classes look up in our parent for method names and
29531 attributes (required for handling abstract, virtual, new, override
29532 constructs: we need to instrospect our base class, and if we dont
29533 populate the classes in order, the introspection might be
29534 incorrect. For example, a method could query its parent before
29535 the parent has any methods and would determine that the parent has
29536 no abstract methods (while it could have had them)).
29538 (RootContext::CreateType): Record the order in which we define the
29541 2001-10-02 Miguel de Icaza <miguel@ximian.com>
29543 * class.cs (TypeContainer::Populate): Also method definitions can
29544 fail now, keep track of this.
29546 (TypeContainer::FindMembers): Implement support for
29547 DeclaredOnly/noDeclaredOnly flag.
29549 (Constructor::Emit) Return the ConstructorBuilder.
29551 (Method::Emit) Return the MethodBuilder.
29552 Check for abstract or virtual methods to be public.
29554 * rootcontext.cs (RootContext::CreateType): Register all the
29555 abstract methods required for the class to be complete and the
29556 interface methods that must be implemented.
29558 * cs-parser.jay: Report error 501 (method requires body if it is
29559 not marked abstract or extern).
29561 * expression.cs (TypeOf::Emit): Implement.
29563 * typemanager.cs: runtime_handle_type, new global type.
29565 * class.cs (Property::Emit): Generate code for properties.
29567 2001-10-02 Ravi Pratap <ravi@ximian.com>
29569 * expression.cs (Unary::ResolveOperator): Find operators on base type
29570 too - we now conform exactly to the spec.
29572 (Binary::ResolveOperator): Same here.
29574 * class.cs (Operator::Define): Fix minor quirk in the tests.
29576 * ../errors/cs0215.cs : Added.
29578 * ../errors/cs0556.cs : Added.
29580 * ../errors/cs0555.cs : Added.
29582 2001-10-01 Miguel de Icaza <miguel@ximian.com>
29584 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
29585 single integer which is really efficient
29587 2001-10-01 Ravi Pratap <ravi@ximian.com>
29589 * expression.cs (Expression::ImplicitUserConversion): Use location
29590 even in the case when we are examining True operators.
29592 * class.cs (Operator::Define): Perform extensive checks to conform
29593 with the rules for operator overloading in the spec.
29595 * expression.cs (Expression::ImplicitReferenceConversion): Implement
29596 some of the other conversions mentioned in the spec.
29598 * typemanager.cs (array_type): New static member for the System.Array built-in
29601 (cloneable_interface): For System.ICloneable interface.
29603 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
29604 we start resolving the tree and populating types.
29606 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
29608 2001-10-01 Miguel de Icaza <miguel@ximian.com>
29610 * expression.cs (Expression::ExprClassFromMemberInfo,
29611 Expression::Literalize): Create literal expressions from
29612 FieldInfos which are literals.
29614 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
29615 type casts, because they were wrong. The test suite in tests
29618 (ImplicitNumericConversion): ushort to ulong requires a widening
29621 Int32 constant to long requires widening cast as well.
29623 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
29624 for integers because the type on the stack is not i4.
29626 2001-09-30 Miguel de Icaza <miguel@ximian.com>
29628 * expression.cs (report118): require location argument.
29630 * parameter.cs: Do not dereference potential null value.
29632 * class.cs: Catch methods that lack the `new' keyword when
29633 overriding a name. Report warnings when `new' is used without
29634 anything being there to override.
29636 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
29638 * class.cs: Only add constructor to hashtable if it is non-null
29639 (as now constructors can fail on define).
29641 (TypeManager, Class, Struct): Take location arguments.
29643 Catch field instance initialization in structs as errors.
29645 accepting_filter: a new filter for FindMembers that is static so
29646 that we dont create an instance per invocation.
29648 (Constructor::Define): Catch errors where a struct constructor is
29651 * cs-parser.jay: Pass location information for various new
29654 * delegate.cs (Delegate): take a location argument.
29656 * driver.cs: Do not call EmitCode if there were problesm in the
29657 Definition of the types, as many Builders wont be there.
29659 * decl.cs (Decl::Decl): Require a location argument.
29661 * cs-tokenizer.cs: Handle properly hex constants that can not fit
29662 into integers, and find the most appropiate integer for it.
29664 * literal.cs: Implement ULongLiteral.
29666 * rootcontext.cs: Provide better information about the location of
29667 failure when CreateType fails.
29669 2001-09-29 Miguel de Icaza <miguel@ximian.com>
29671 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
29674 * expression.cs (Binary::CheckShiftArguments): Add missing type
29676 (Binary::ResolveOperator): Add type to the logical and and logical
29677 or, Bitwise And/Or and Exclusive Or code paths, it was missing
29680 (Binary::DoNumericPromotions): In the case where either argument
29681 is ulong (and most signed types combined with ulong cause an
29682 error) perform implicit integer constant conversions as well.
29684 2001-09-28 Miguel de Icaza <miguel@ximian.com>
29686 * expression.cs (UserImplicitCast): Method should always be
29688 (Invocation::BetterConversion): Simplified test for IntLiteral.
29690 (Expression::ImplicitNumericConversion): Split this routine out.
29691 Put the code that performs implicit constant integer conversions
29694 (Expression::Resolve): Become a wrapper around DoResolve so we can
29695 check eclass and type being set after resolve.
29697 (Invocation::Badness): Remove this dead function
29699 (Binary::ResolveOperator): Do not compute the expensive argumnets
29700 unless we have a union for it.
29702 (Probe::Emit): Is needs to do an isinst and then
29703 compare against null.
29705 (::CanConvert): Added Location argument. If the Location argument
29706 is null (Location.Null), then we do not report errors. This is
29707 used by the `probe' mechanism of the Explicit conversion. We do
29708 not want to generate an error for something that the user
29709 explicitly requested to be casted. But the pipeline for an
29710 explicit cast first tests for potential implicit casts.
29712 So for now, if the Location is null, it means `Probe only' to
29713 avoid adding another argument. Might have to revise this
29716 (ClassCast): New class used to type cast objects into arbitrary
29717 classes (used in Explicit Reference Conversions).
29719 Implement `as' as well.
29721 Reverted all the patches from Ravi below: they were broken:
29723 * The use of `level' as a mechanism to stop recursive
29724 invocations is wrong. That was there just to catch the
29725 bug with a strack trace but not as a way of addressing
29728 To fix the problem we have to *understand* what is going
29729 on and the interactions and come up with a plan, not
29730 just get things going.
29732 * The use of the type conversion cache that I proposed
29733 last night had an open topic: How does this work across
29734 protection domains. A user defined conversion might not
29735 be public in the location where we are applying the
29736 conversion, a different conversion might be selected
29737 (ie, private A->B (better) but public B->A (worse),
29738 inside A, A->B applies, but outside it, B->A will
29741 * On top of that (ie, even if the above is solved),
29742 conversions in a cache need to be abstract. Ie, `To
29743 convert from an Int to a Short use an OpcodeCast', not
29744 `To convert from an Int to a Short use the OpcodeCast on
29745 the variable 5' (which is what this patch was doing).
29747 2001-09-28 Ravi Pratap <ravi@ximian.com>
29749 * expression.cs (Invocation::ConversionExists): Re-write to use
29750 the conversion cache
29752 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
29753 cache all conversions done, not just user-defined ones.
29755 (Invocation::BetterConversion): The real culprit. Use ConversionExists
29756 to determine if a conversion exists instead of acutually trying to
29757 perform the conversion. It's faster too.
29759 (Expression::ConvertExplicit): Modify to use ConversionExists to check
29760 and only then attempt the implicit conversion.
29762 2001-09-28 Ravi Pratap <ravi@ximian.com>
29764 * expression.cs (ConvertImplicit): Use a cache for conversions
29765 already found. Check level of recursion and bail out if necessary.
29767 2001-09-28 Miguel de Icaza <miguel@ximian.com>
29769 * typemanager.cs (string_concat_string_string, string_concat_object_object):
29770 Export standard methods that we expect for string operations.
29772 * statement.cs (Block::UsageWarning): Track usage of variables and
29773 report the errors for not used variables.
29775 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
29778 2001-09-27 Miguel de Icaza <miguel@ximian.com>
29780 * codegen.cs: remove unnneded code
29782 * expression.cs: Removed BuiltinTypeAccess class
29784 Fix the order in which implicit conversions are
29787 The previous fixed dropped support for boxed conversions (adding a
29788 test to the test suite now)
29790 (UserImplicitCast::CanConvert): Remove test for source being null,
29791 that code is broken. We should not feed a null to begin with, if
29792 we do, then we should track the bug where the problem originates
29793 and not try to cover it up here.
29795 Return a resolved expression of type UserImplicitCast on success
29796 rather than true/false. Ravi: this is what I was talking about,
29797 the pattern is to use a static method as a "constructor" for
29800 Also, do not create arguments until the very last minute,
29801 otherwise we always create the arguments even for lookups that
29802 will never be performed.
29804 (UserImplicitCast::Resolve): Eliminate, objects of type
29805 UserImplicitCast are born in a fully resolved state.
29807 * typemanager.cs (InitCoreTypes): Init also value_type
29808 (System.ValueType).
29810 * expression.cs (Cast::Resolve): First resolve the child expression.
29812 (LValue): Add new method AddressOf to be used by
29815 Change the argument of Store to take an EmitContext instead of an
29816 ILGenerator, because things like FieldExpr need to be able to call
29817 their children expression to generate the instance code.
29819 (Expression::Error, Expression::Warning): Sugar functions for
29822 (Expression::MemberLookup): Accept a TypeContainer instead of a
29823 Report as the first argument.
29825 (Expression::ResolvePrimary): Killed. I still want to improve
29826 this as currently the code is just not right.
29828 (Expression::ResolveMemberAccess): Simplify, but it is still
29831 (Unary::Resolve): Catch errors in AddressOf operators.
29833 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
29834 index to a byte for the short-version, or the compiler will choose
29835 the wrong Emit call, which generates the wrong data.
29837 (ParameterReference::Emit, ::Store): same.
29839 (FieldExpr::AddressOf): Implement.
29841 * typemanager.cs: TypeManager: made public variable instead of
29844 * driver.cs: document --fatal.
29846 * report.cs (ErrorMessage, WarningMessage): new names for the old
29847 Error and Warning classes.
29849 * cs-parser.jay (member_access): Turn built-in access to types
29850 into a normal simplename
29852 2001-09-27 Ravi Pratap <ravi@ximian.com>
29854 * expression.cs (Invocation::BetterConversion): Fix to cope
29855 with q being null, since this was introducing a bug.
29857 * expression.cs (ConvertImplicit): Do built-in conversions first.
29859 2001-09-27 Ravi Pratap <ravi@ximian.com>
29861 * expression.cs (UserImplicitCast::Resolve): Fix bug.
29863 2001-09-27 Ravi Pratap <ravi@ximian.com>
29865 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
29866 I had introduced long ago (what's new ?).
29868 * expression.cs (UserImplicitCast::CanConvert): Static method to do
29869 the work of all the checking.
29870 (ConvertImplicit): Call CanConvert and only then create object if necessary.
29871 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
29873 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
29874 that is the right way.
29876 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
29877 overloading resolution. Use everywhere instead of cutting and pasting code.
29879 (Binary::ResolveOperator): Use MakeUnionSet.
29881 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
29882 we have to convert to bool types. Not complete yet.
29884 2001-09-27 Miguel de Icaza <miguel@ximian.com>
29886 * typemanager.cs (TypeManager::CSharpName): support ushort.
29888 * expression.cs (Expression::TryImplicitIntConversion): Attempts
29889 to provide an expression that performsn an implicit constant int
29890 conversion (section 6.1.6).
29891 (Expression::ConvertImplicitRequired): Reworked to include
29892 implicit constant expression conversions.
29894 (Expression::ConvertNumericExplicit): Finished.
29896 (Invocation::Emit): If InstanceExpression is null, then it means
29897 that we perform a call on this.
29899 2001-09-26 Miguel de Icaza <miguel@ximian.com>
29901 * expression.cs (Unary::Emit): Remove some dead code.
29902 (Probe): Implement Resolve and Emit for `is'.
29903 (Expression::ConvertImplicitRequired): Attempt to do constant
29904 expression conversions here. Maybe should be moved to
29905 ConvertImplicit, but I am not sure.
29906 (Expression::ImplicitLongConstantConversionPossible,
29907 Expression::ImplicitIntConstantConversionPossible): New functions
29908 that tell whether is it possible to apply an implicit constant
29909 expression conversion.
29911 (ConvertNumericExplicit): Started work on explicit numeric
29914 * cs-parser.jay: Update operator constants.
29916 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
29917 (Parameters::GetSignature): Hook up VerifyArgs here.
29918 (Parameters::VerifyArgs): Verifies that no two arguments have the
29921 * class.cs (Operator): Update the operator names to reflect the
29922 ones that the spec expects (as we are just stringizing the
29925 * expression.cs (Unary::ResolveOperator): Fix bug: Use
29926 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
29927 previous usage did only work for our methods.
29928 (Expression::ConvertImplicit): Handle decimal implicit numeric
29929 conversions as well.
29930 (Expression::InternalTypeConstructor): Used to invoke constructors
29931 on internal types for default promotions.
29933 (Unary::Emit): Implement special handling for the pre/post
29934 increment/decrement for overloaded operators, as they need to have
29935 the same semantics as the other operators.
29937 (Binary::ResolveOperator): ditto.
29938 (Invocation::ConversionExists): ditto.
29939 (UserImplicitCast::Resolve): ditto.
29941 2001-09-26 Ravi Pratap <ravi@ximian.com>
29943 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
29944 operator, return after emitting body. Regression tests pass again !
29946 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
29947 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
29948 (Invocation::OverloadResolve): Ditto.
29949 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
29951 * everywhere : update calls to the above methods accordingly.
29953 2001-09-26 Miguel de Icaza <miguel@ximian.com>
29955 * assign.cs (Assign): Make it inherit from ExpressionStatement.
29957 * expression.cs (ExpressionStatement): New base class used for
29958 expressions that can appear in statements, so that we can provide
29959 an alternate path to generate expression that do not leave a value
29962 (Expression::Emit, and all the derivatives): We no longer return
29963 whether a value is left on the stack or not. Every expression
29964 after being emitted leaves a single value on the stack.
29966 * codegen.cs (EmitContext::EmitStatementExpression): Use the
29967 facilties of ExpressionStatement if possible.
29969 * cs-parser.jay: Update statement_expression.
29971 2001-09-25 Miguel de Icaza <miguel@ximian.com>
29973 * driver.cs: Change the wording of message
29975 2001-09-25 Ravi Pratap <ravi@ximian.com>
29977 * expression.cs (Binary::ResolveOperator): Had forgottten to set
29978 the type of the expression to the return type of the method if
29979 we have an overloaded operator match ! The regression tests pass again !
29980 (Unary::ResolveOperator): Ditto.
29982 * expression.cs (Invocation::ConversionExists): Correct the member lookup
29983 to find "op_Implicit", not "implicit" ;-)
29984 (UserImplicitCast): New class to take care of user-defined implicit conversions.
29985 (ConvertImplicit, ForceConversion): Take TypeContainer argument
29987 * everywhere : Correct calls to the above accordingly.
29989 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
29990 (ConvertImplicit): Do user-defined conversion if it exists.
29992 2001-09-24 Miguel de Icaza <miguel@ximian.com>
29994 * assign.cs: track location.
29995 (Resolve): Use implicit conversions on assignment.
29997 * literal.cs: Oops. Not good, Emit of short access values should
29998 pass (Bytes) or the wrong argument will be selected.
30000 * expression.cs (Unary::Emit): Emit code for -expr.
30002 (Unary::ResolveOperator): Handle `Substract' for non-constants
30003 (substract from zero from the non-constants).
30004 Deal with Doubles as well.
30006 (Expression::ConvertImplicitRequired): New routine that reports an
30007 error if no implicit conversion exists.
30009 (Invocation::OverloadResolve): Store the converted implicit
30010 expressions if we make them
30012 2001-09-24 Ravi Pratap <ravi@ximian.com>
30014 * class.cs (ConstructorInitializer): Take a Location argument.
30015 (ConstructorBaseInitializer): Same here.
30016 (ConstructorThisInitializer): Same here.
30018 * cs-parser.jay : Update all calls accordingly.
30020 * expression.cs (Unary, Binary, New): Take location argument.
30021 Update accordingly everywhere.
30023 * cs-parser.jay : Update all calls to the above to take a location
30026 * class.cs : Ditto.
30028 2001-09-24 Ravi Pratap <ravi@ximian.com>
30030 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
30031 (Invocation::BetterConversion): Same here
30032 (Invocation::ConversionExists): Ditto.
30034 (Invocation::ConversionExists): Implement.
30036 2001-09-22 Ravi Pratap <ravi@ximian.com>
30038 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
30039 Also take an additional TypeContainer argument.
30041 * All over : Pass in TypeContainer as argument to OverloadResolve.
30043 * typemanager.cs (CSharpName): Update to check for the string type and return
30046 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
30049 2001-09-21 Ravi Pratap <ravi@ximian.com>
30051 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
30052 (Invocation::BetterFunction): Implement.
30053 (Invocation::BetterConversion): Implement.
30054 (Invocation::ConversionExists): Skeleton, no implementation yet.
30056 Okay, things work fine !
30058 2001-09-21 Miguel de Icaza <miguel@ximian.com>
30060 * typemanager.cs: declare and load enum_type, delegate_type and
30063 * expression.cs (Expression::Emit): Now emit returns a value that
30064 tells whether a value is left on the stack or not. This strategy
30065 might be reveted tomorrow with a mechanism that would address
30066 multiple assignments.
30067 (Expression::report118): Utility routine to report mismatches on
30070 (Unary::Report23): Report impossible type/operator combination
30073 (Unary::IsIncrementableNumber): Whether the type can be
30074 incremented or decremented with add.
30075 (Unary::ResolveOperator): Also allow enumerations to be bitwise
30077 (Unary::ResolveOperator): Implement ++, !, ~,
30079 (Invocation::Emit): Deal with new Emit convetion.
30081 * All Expression derivatives: Updated their Emit method to return
30082 whether they leave values on the stack or not.
30084 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
30085 stack for expressions that are statements.
30087 2001-09-20 Miguel de Icaza <miguel@ximian.com>
30089 * expression.cs (LValue): New interface. Must be implemented by
30091 (LocalVariableReference, ParameterReference, FieldExpr): Implement
30094 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
30095 interface for generating code, simplifies the code.
30097 2001-09-20 Ravi Pratap <ravi@ximian.com>
30099 * expression.cs (everywhere): Comment out return statements in ::Resolve
30100 methods to avoid the warnings.
30102 2001-09-20 Miguel de Icaza <miguel@ximian.com>
30104 * driver.cs (parse): Report error 2001 if we can not open the
30107 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
30110 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
30113 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
30114 otherwise nested blocks end up with the same index.
30116 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
30118 * expression.cs: Instead of having FIXMEs in the Resolve
30119 functions, throw exceptions so it is obvious that we are facing a
30122 * cs-parser.jay (invocation_expression): Pass Location information.
30124 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
30125 Use a basename for those routines because .NET does not like paths
30128 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
30131 2001-09-19 Miguel de Icaza <miguel@ximian.com>
30133 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
30134 are loading the correct data types (throws an exception if not).
30135 (TypeManager::InitCoreTypes): Use CoreLookupType
30137 * expression.cs (Unary::ResolveOperator): return the child
30138 expression for expressions which are just +expr.
30139 (Unary::ResolveOperator): Return negative literals for -LITERAL
30140 expressions (otherwise they are Unary {Literal}).
30141 (Invocation::Badness): Take into account `Implicit constant
30142 expression conversions'.
30144 * literal.cs (LongLiteral): Implement long literal class.
30145 (IntLiteral): export the `Value' of the intliteral.
30147 2001-09-19 Ravi Pratap <ravi@ximian.com>
30149 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
30151 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
30152 instead of 'Operator'
30154 * expression.cs (Binary::ResolveOperator): Update accordingly.
30155 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
30158 * cs-parser.jay (unary_expression): Update to use the new names.
30160 * gen-treedump.cs (GetUnary): Same here.
30162 * expression.cs (Unary::Resolve): Implement.
30163 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
30164 operators are found instead of making noise ;-)
30165 (Unary::ResolveOperator): New method to do precisely the same thing which
30166 Binary::ResolveOperator does for Binary expressions.
30167 (Unary.method, .Arguments): Add.
30168 (Unary::OperName): Implement.
30169 (Unary::ForceConversion): Copy and Paste !
30171 * class.cs (Operator::Define): Fix a small bug for the case when we have
30174 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
30175 for the inbuilt operators. Only overloading works for now ;-)
30177 2001-09-18 Miguel de Icaza <miguel@ximian.com>
30179 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
30180 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
30182 * expression.cs (This::Emit): Implement.
30183 (This::Resolve): Implement.
30184 (TypeOf:Resolve): Implement.
30185 (Expression::ResolveSimpleName): Add an implicit this to instance
30187 (MemberAccess::Resolve): Deal with Parameters and Fields.
30188 Bind instance variable to Field expressions.
30189 (FieldExpr::Instance): New field used to track the expression that
30190 represents the object instance.
30191 (FieldExpr::Resolve): Track potential errors from MemberLookup not
30193 (FieldExpr::Emit): Implement.
30195 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
30196 the last instruction contains a return opcode to avoid generating
30197 the last `ret' instruction (this generates correct code, and it is
30198 nice to pass the peverify output).
30200 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
30201 initializer for static and instance variables.
30202 (Constructor::Emit): Allow initializer to be null in the case of
30203 static constructors. Only emit initializer for instance
30206 (TypeContainer::FindMembers): Return a null array if there are no
30209 Also fix the code for the MemberTypes.Method branch, as it was not
30210 scanning that for operators (or tried to access null variables before).
30212 * assign.cs (Assign::Emit): Handle instance and static fields.
30216 * driver.cs: Stop compilation if there are parse errors.
30218 * cs-parser.jay (constructor_declaration): Provide default base
30219 initializer for non-static constructors.
30220 (constructor_declarator): Do not provide a default base
30221 initializers if none was specified.
30222 Catch the fact that constructors should not have parameters.
30224 * class.cs: Do not emit parent class initializers for static
30225 constructors, that should be flagged as an error.
30227 2001-09-18 Ravi Pratap <ravi@ximian.com>
30229 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
30230 Move back code into TypeContainer::Populate.
30232 2001-09-18 Ravi Pratap <ravi@ximian.com>
30234 * class.cs (TypeContainer::AddConstructor): Fix the check to
30235 compare against Name, not Basename.
30236 (Operator::OpType): Change Plus and Minus to Add and Subtract.
30238 * cs-parser.jay : Update accordingly.
30240 * class.cs (TypeContainer::FindMembers): For the case where we are searching
30241 for methods, don't forget to look into the operators too.
30242 (RegisterMethodBuilder): Helper method to take care of this for
30243 methods, constructors and operators.
30244 (Operator::Define): Completely revamp.
30245 (Operator.OperatorMethod, MethodName): New fields.
30246 (TypeContainer::Populate): Move the registering of builders into
30247 RegisterMethodBuilder.
30248 (Operator::Emit): Re-write.
30250 * expression.cs (Binary::Emit): Comment out code path to emit method
30251 invocation stuff for the case when we have a user defined operator. I am
30252 just not able to get it right !
30254 2001-09-17 Miguel de Icaza <miguel@ximian.com>
30256 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
30259 (Expression::MemberLookup): Provide a version that allows to
30260 specify the MemberTypes and BindingFlags.
30262 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
30263 so it was not fetching variable information from outer blocks.
30265 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
30266 Beforefieldinit as it was buggy.
30268 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
30269 that Ravi put here.
30271 * class.cs (Constructor::Emit): Only emit if block is not null.
30272 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
30273 deal with this by semantically definining it as if the user had
30276 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
30277 constructors as we now "emit" them at a higher level.
30279 (TypeContainer::DefineDefaultConstructor): Used to define the
30280 default constructors if none was provided.
30282 (ConstructorInitializer): Add methods Resolve and Emit.
30284 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
30286 2001-09-17 Ravi Pratap <ravi@ximian.com>
30288 * class.cs (TypeContainer::EmitDefaultConstructor): Register
30289 the default constructor builder with our hashtable for methodbuilders
30292 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
30293 and argument_count is 0 in which case we have a match.
30294 (Binary::ResolveOperator): More null checking and miscellaneous coding
30297 2001-09-17 Ravi Pratap <ravi@ximian.com>
30299 * rootcontext.cs (IsNameSpace): Compare against null.
30301 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
30303 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
30304 and Unary::Operator.
30306 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
30309 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
30310 we have overloaded operators.
30311 (Binary::ResolveOperator): Implement the part which does the operator overload
30314 * class.cs (Operator::Emit): Implement.
30315 (TypeContainer::Emit): Emit the operators we have too.
30317 * expression.cs (Binary::Emit): Update to emit the appropriate code for
30318 the case when we have a user-defined operator.
30320 2001-09-17 Miguel de Icaza <miguel@ximian.com>
30322 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
30324 2001-09-16 Ravi Pratap <ravi@ximian.com>
30326 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
30327 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
30328 (Constructor::Emit): Implement.
30329 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
30330 if we have no work to do.
30331 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
30334 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
30335 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
30337 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
30340 2001-09-15 Ravi Pratap <ravi@ximian.com>
30342 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
30344 (Tree::RecordNamespace): Method to do what the name says ;-)
30345 (Tree::Namespaces): Property to get at the namespaces hashtable.
30347 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
30350 * rootcontext.cs (IsNamespace): Fixed it :-)
30352 2001-09-14 Miguel de Icaza <miguel@ximian.com>
30354 * class.cs (TypeContainer::FindMembers): Add support for
30356 (MethodCore): New class that encapsulates both the shared aspects
30357 of a Constructor and a Method.
30358 (Method, Constructor): Factored pieces into MethodCore.
30360 * driver.cs: Added --fatal which makes errors throw exceptions.
30361 Load System assembly as well as part of the standard library.
30363 * report.cs: Allow throwing exceptions on errors for debugging.
30365 * modifiers.cs: Do not use `parent', instead use the real type
30366 container to evaluate permission settings.
30368 * class.cs: Put Ravi's patch back in. He is right, and we will
30369 have to cope with the
30371 2001-09-14 Ravi Pratap <ravi@ximian.com>
30373 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
30374 FamORAssem, not FamANDAssem.
30376 2001-09-14 Miguel de Icaza <miguel@ximian.com>
30378 * driver.cs: Added --parse option that only parses its input files
30381 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
30382 incorrect. IsTopLevel is not used to tell whether an object is
30383 root_types or not (that can be achieved by testing this ==
30384 root_types). But to see if this is a top-level *class* (not
30385 necessarly our "toplevel" container).
30387 2001-09-14 Ravi Pratap <ravi@ximian.com>
30389 * enum.cs (Enum::Define): Modify to call the Lookup method on the
30390 parent instead of a direct call to GetType.
30392 2001-09-14 Ravi Pratap <ravi@ximian.com>
30394 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
30395 Modifiers.TypeAttr. This should just be a call to that method.
30397 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
30398 object so that we can determine if we are top-level or not.
30400 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
30403 * enum.cs (Enum::Define): Ditto.
30405 * modifiers.cs (FieldAttr): Re-write.
30407 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
30408 (TypeContainer::HaveStaticConstructor): New property to provide access
30409 to precisely that info.
30411 * modifiers.cs (MethodAttr): Re-write.
30412 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
30414 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
30415 of top-level types as claimed.
30417 2001-09-13 Miguel de Icaza <miguel@ximian.com>
30419 * expression.cs (MemberLookup): Fruitless attempt to lookup
30420 constructors. Maybe I need to emit default constructors? That
30421 might be it (currently .NET emits this for me automatically).
30422 (Invocation::OverloadResolve): Cope with Arguments == null.
30423 (Invocation::EmitArguments): new function, shared by the new
30424 constructor and us.
30425 (Invocation::Emit): Handle static and instance methods. Emit
30426 proper call instruction for virtual or non-virtual invocations.
30427 (New::Emit): Implement.
30428 (New::Resolve): Implement.
30429 (MemberAccess:Resolve): Implement.
30430 (MethodGroupExpr::InstanceExpression): used conforming to the spec
30431 to track instances.
30432 (FieldExpr::Resolve): Set type.
30434 * support.cs: Handle empty arguments.
30436 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
30437 SimpleLookup): Auxiliary routines to help parse a qualifier
30440 Update qualifier_identifier rule.
30442 * codegen.cs: Removed debugging messages.
30444 * class.cs: Make this a global thing, this acts just as a "key" to
30445 objects that we might have around.
30447 (Populate): Only initialize method_builders_to_methods once.
30449 * expression.cs (PropertyExpr): Initialize type from the
30452 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
30453 Resolve pattern. Attempt to implicitly convert value to boolean.
30456 * expression.cs: Set the type for the int32/int32 argument case.
30457 (Binary::ResolveOperator): Set the return type to boolean for
30458 comparission operators
30460 * typemanager.cs: Remove debugging print code.
30462 (Invocation::Resolve): resolve type.
30464 * class.cs: Allocate a MemberInfo of the correct size, as the code
30465 elsewhere depends on the test to reflect the correct contents.
30467 (Method::) Keep track of parameters, due to System.Reflection holes
30469 (TypeContainer::Populate): Keep track of MethodBuilders to Method
30472 (TypeContainer::FindMembers): Use ArrayList and then copy an array
30473 of the exact size and return that.
30475 (Class::LookupMethodByBuilder): New function that maps
30476 MethodBuilders to its methods. Required to locate the information
30477 on methods because System.Reflection bit us again.
30479 * support.cs: New file, contains an interface ParameterData and
30480 two implementations: ReflectionParameters and InternalParameters
30481 used to access Parameter information. We will need to grow this
30484 * expression.cs (Invocation::GetParameterData): implement a cache
30485 and a wrapper around the ParameterData creation for methods.
30486 (Invocation::OverloadResolve): Use new code.
30488 2001-09-13 Ravi Pratap <ravi@ximian.com>
30490 * class.cs (TypeContainer::EmitField): Remove and move into
30491 (Field::Define): here and modify accordingly.
30492 (Field.FieldBuilder): New member.
30493 (TypeContainer::Populate): Update accordingly.
30494 (TypeContainer::FindMembers): Implement.
30496 2001-09-13 Miguel de Icaza <miguel@ximian.com>
30498 * statement.cs: (VariableInfo::VariableType): New field to be
30499 initialized with the full type once it is resolved.
30501 2001-09-12 Miguel de Icaza <miguel@ximian.com>
30503 * parameter.cs (GetParameterInfo): Use a type cache to compute
30504 things only once, and to reuse this information
30506 * expression.cs (LocalVariableReference::Emit): Implement.
30507 (OpcodeCast::Emit): fix.
30509 (ParameterReference::Resolve): Implement.
30510 (ParameterReference::Emit): Implement.
30512 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
30513 that are expressions need to stay as Expressions.
30515 * typemanager.cs (CSharpName): Returns the C# name of a type if
30518 * expression.cs (Expression::ConvertImplicit): New function that
30519 implements implicit type conversions.
30521 (Expression::ImplicitReferenceConversion): Implements implicit
30522 reference conversions.
30524 (EmptyCast): New type for transparent casts.
30526 (OpcodeCast): New type for casts of types that are performed with
30527 a sequence of bytecodes.
30529 (BoxedCast): New type used for casting value types into reference
30530 types. Emits a box opcode.
30532 (Binary::DoNumericPromotions): Implements numeric promotions of
30533 and computation of the Binary::Type.
30535 (Binary::EmitBranchable): Optimization.
30537 (Binary::Emit): Implement code emission for expressions.
30539 * typemanager.cs (TypeManager): Added two new core types: sbyte
30542 2001-09-12 Ravi Pratap <ravi@ximian.com>
30544 * class.cs (TypeContainer::FindMembers): Method which does exactly
30545 what Type.FindMembers does, only we don't have to use reflection. No
30546 implementation yet.
30548 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
30549 typecontainer objects as we need to get at them.
30550 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
30552 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
30553 typecontainer object.
30555 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
30556 of just a Report object.
30558 2001-09-11 Ravi Pratap <ravi@ximian.com>
30560 * class.cs (Event::Define): Go back to using the prefixes "add_" and
30562 (TypeContainer::Populate): Now define the delegates of the type too.
30563 (TypeContainer.Delegates): Property to access the list of delegates defined
30566 * delegates.cs (Delegate::Define): Implement partially.
30568 * modifiers.cs (TypeAttr): Handle more flags.
30570 2001-09-11 Ravi Pratap <ravi@ximian.com>
30572 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
30574 (Operator::Define): Re-write logic to get types by using the LookupType method
30575 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
30576 (Indexer::Define): Ditto.
30577 (Event::Define): Ditto.
30578 (Property::Define): Ditto.
30580 2001-09-10 Ravi Pratap <ravi@ximian.com>
30582 * class.cs (TypeContainer::Populate): Now define operators too.
30583 (TypeContainer.Operators): New property to access the list of operators
30585 (Operator.OperatorMethodBuilder): New member to hold the method builder
30586 for the operator we are defining.
30587 (Operator::Define): Implement.
30589 2001-09-10 Ravi Pratap <ravi@ximian.com>
30591 * class.cs (Event::Define): Make the prefixes of the accessor methods
30592 addOn_ and removeOn_
30594 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
30595 of the location being passed in too. Ideally, this should go later since all
30596 error reporting should be done through the Report object.
30598 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
30599 (Populate): Iterate thru the indexers we have and define them too.
30600 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
30601 for the get and set accessors.
30602 (Indexer::Define): Implement.
30604 2001-09-09 Miguel de Icaza <miguel@ximian.com>
30606 * expression.cs (Binary::Resolve): Beginning of it. I scratched
30607 my previous implementation, did not work.
30609 * typemanager.cs: Add a couple of missing types (the longs).
30611 * literal.cs: Use TypeManager.bool_type instead of getting it.
30613 * expression.cs (EventExpr): New kind of expressions.
30614 (Expressio::ExprClassFromMemberInfo): finish
30616 2001-09-08 Miguel de Icaza <miguel@ximian.com>
30618 * assign.cs: Emit stores to static fields differently.
30620 2001-09-08 Ravi Pratap <ravi@ximian.com>
30622 * Merge in changes and adjust code to tackle conflicts. Backed out my
30623 code in Assign::Resolve ;-)
30625 2001-09-08 Ravi Pratap <ravi@ximian.com>
30627 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
30628 instead Report.Error and also pass in the location.
30629 (CSharpParser::Lexer): New readonly property to return the reference
30630 to the Tokenizer object.
30631 (declare_local_variables): Use Report.Error with location instead of plain
30635 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
30636 (Operator.CheckBinaryOperator): Ditto.
30638 * cs-parser.jay (operator_declarator): Update accordingly.
30640 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
30641 (CheckBinaryOperator): Same here.
30643 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
30644 on the name without any prefixes of namespace names etc. This is because we
30645 already might have something already fully qualified like
30646 'System.Console.WriteLine'
30648 * assign.cs (Resolve): Begin implementation. Stuck ;-)
30650 2001-09-07 Ravi Pratap <ravi@ximian.com>
30652 * cs-tokenizer.cs (location): Return a string which also contains
30655 * expression.cs (ElementAccess): New class for expressions of the
30656 type 'element access.'
30657 (BaseAccess): New class for expressions of the type 'base access.'
30658 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
30661 * cs-parser.jay (element_access): Implement action.
30662 (base_access): Implement actions.
30663 (checked_expression, unchecked_expression): Implement.
30665 * cs-parser.jay (local_variable_type): Correct and implement.
30666 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
30668 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
30670 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
30671 name and the specifiers.
30673 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
30675 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
30676 making them all public ;-)
30678 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
30681 2001-09-07 Miguel de Icaza <miguel@ximian.com>
30683 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
30685 (FieldExpr, PropertyExprs): New resolved expressions.
30686 (SimpleName::MemberStaticCheck): Perform static checks for access
30687 to non-static fields on static methods. Maybe this should be
30688 generalized for MemberAccesses.
30689 (SimpleName::ResolveSimpleName): More work on simple name
30692 * cs-parser.jay (primary_expression/qualified_identifier): track
30693 the parameter index.
30695 * codegen.cs (CodeGen::Save): Catch save exception, report error.
30696 (EmitContext::EmitBoolExpression): Chain to expression generation
30697 instead of temporary hack.
30698 (::EmitStatementExpression): Put generic expression code generation.
30700 * assign.cs (Assign::Emit): Implement variable assignments to
30701 local variables, parameters and fields.
30703 2001-09-06 Miguel de Icaza <miguel@ximian.com>
30705 * statement.cs (Block::GetVariableInfo): New method, returns the
30706 VariableInfo for a variable name in a block.
30707 (Block::GetVariableType): Implement in terms of GetVariableInfo
30709 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
30710 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
30712 2001-09-06 Ravi Pratap <ravi@ximian.com>
30714 * cs-parser.jay (operator_declaration): Continue on my quest : update
30715 to take attributes argument.
30716 (event_declaration): Ditto.
30717 (enum_declaration): Ditto.
30718 (indexer_declaration): Ditto.
30720 * class.cs (Operator::Operator): Update constructor accordingly.
30721 (Event::Event): Ditto.
30723 * delegate.cs (Delegate::Delegate): Same here.
30725 * enum.cs (Enum::Enum): Same here.
30727 2001-09-05 Ravi Pratap <ravi@ximian.com>
30729 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
30731 * ../tests/cs0658.cs : New file to demonstrate error 0658.
30733 * attribute.cs (Attributes): New class to encapsulate all attributes which were
30734 being passed around as an arraylist.
30735 (Attributes::AddAttribute): Method to add attribute sections.
30737 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
30738 (struct_declaration): Update accordingly.
30739 (constant_declaration): Update.
30740 (field_declaration): Update.
30741 (method_header): Update.
30742 (fixed_parameter): Update.
30743 (parameter_array): Ditto.
30744 (property_declaration): Ditto.
30745 (destructor_declaration): Ditto.
30747 * class.cs (Struct::Struct): Update constructors accordingly.
30748 (Class::Class): Ditto.
30749 (Field::Field): Ditto.
30750 (Method::Method): Ditto.
30751 (Property::Property): Ditto.
30752 (TypeContainer::OptAttribute): update property's return type.
30754 * interface.cs (Interface.opt_attributes): New member.
30755 (Interface::Interface): Update to take the extra Attributes argument.
30757 * parameter.cs (Parameter::Parameter): Ditto.
30759 * constant.cs (Constant::Constant): Ditto.
30761 * interface.cs (InterfaceMemberBase): New OptAttributes field.
30762 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
30763 the attributes as a parameter.
30764 (InterfaceProperty): Update constructor call.
30765 (InterfaceEvent): Ditto.
30766 (InterfaceMethod): Ditto.
30767 (InterfaceIndexer): Ditto.
30769 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
30770 pass the attributes too.
30771 (interface_event_declaration): Ditto.
30772 (interface_property_declaration): Ditto.
30773 (interface_method_declaration): Ditto.
30774 (interface_declaration): Ditto.
30776 2001-09-05 Miguel de Icaza <miguel@ximian.com>
30778 * class.cs (Method::Define): Track the "static Main" definition to
30779 create an entry point.
30781 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
30782 EntryPoint if we find it.
30784 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
30785 (EmitContext::ig): Make this variable public.
30787 * driver.cs: Make the default output file be the first file name
30788 with the .exe extension.
30790 Detect empty compilations
30792 Handle various kinds of output targets. Handle --target and
30793 rename -t to --dumper.
30795 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
30796 methods inherited from Expression return now an Expression. This
30797 will is used during the tree rewriting as we resolve them during
30800 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
30801 the spec. Missing entirely is the information about
30802 accessability of elements of it.
30804 (Expression::ExprClassFromMemberInfo): New constructor for
30805 Expressions that creates a fully initialized Expression based on
30806 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
30809 (Invocation::Resolve): Begin implementing resolution of invocations.
30811 * literal.cs (StringLiteral): Implement Emit.
30813 2001-09-05 Ravi Pratap <ravi@ximian.com>
30815 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
30818 2001-09-04 Ravi Pratap <ravi@ximian.com>
30820 * cs-parser.jay (attribute_arguments): Implement actions.
30821 (attribute): Fix bug in production. Implement action.
30822 (attribute_list): Implement.
30823 (attribute_target): Implement.
30824 (attribute_target_specifier, opt_target_specifier): Implement
30825 (CheckAttributeTarget): New method to check if the attribute target
30827 (attribute_section): Implement.
30828 (opt_attributes): Implement.
30830 * attribute.cs : New file to handle attributes.
30831 (Attribute): Class to hold attribute info.
30833 * cs-parser.jay (opt_attribute_target_specifier): Remove production
30834 (attribute_section): Modify production to use 2 different rules to
30835 achieve the same thing. 1 s/r conflict down !
30836 Clean out commented, useless, non-reducing dimension_separator rules.
30838 * class.cs (TypeContainer.attributes): New member to hold list
30839 of attributes for a type.
30840 (Struct::Struct): Modify to take one more argument, the attribute list.
30841 (Class::Class): Ditto.
30842 (Field::Field): Ditto.
30843 (Method::Method): Ditto.
30844 (Property::Property): Ditto.
30846 * cs-parser.jay (struct_declaration): Update constructor call to
30847 pass in the attributes too.
30848 (class_declaration): Ditto.
30849 (constant_declaration): Ditto.
30850 (field_declaration): Ditto.
30851 (method_header): Ditto.
30852 (fixed_parameter): Ditto.
30853 (parameter_array): Ditto.
30854 (property_declaration): Ditto.
30856 * constant.cs (Constant::Constant): Update constructor similarly.
30857 Use System.Collections.
30859 * parameter.cs (Parameter::Parameter): Update as above.
30861 2001-09-02 Ravi Pratap <ravi@ximian.com>
30863 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
30864 (TypeContainer.delegates): New member to hold list of delegates.
30866 * cs-parser.jay (delegate_declaration): Implement the action correctly
30867 this time as I seem to be on crack ;-)
30869 2001-09-02 Miguel de Icaza <miguel@ximian.com>
30871 * rootcontext.cs (RootContext::IsNamespace): new function, used to
30872 tell whether an identifier represents a namespace.
30874 * expression.cs (NamespaceExpr): A namespace expression, used only
30875 temporarly during expression resolution.
30876 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
30877 utility functions to resolve names on expressions.
30879 2001-09-01 Miguel de Icaza <miguel@ximian.com>
30881 * codegen.cs: Add hook for StatementExpressions.
30883 * class.cs: Fix inverted test for static flag in methods.
30885 2001-09-02 Ravi Pratap <ravi@ximian.com>
30887 * class.cs (Operator::CheckUnaryOperator): Correct error number used
30888 to make it coincide with MS' number.
30889 (Operator::CheckBinaryOperator): Ditto.
30891 * ../errors/errors.txt : Remove error numbers added earlier.
30893 * ../errors/cs1019.cs : Test case for error # 1019
30895 * ../errros/cs1020.cs : Test case for error # 1020
30897 * cs-parser.jay : Clean out commented cruft.
30898 (dimension_separators, dimension_separator): Comment out. Ostensibly not
30899 used anywhere - non-reducing rule.
30900 (namespace_declarations): Non-reducing rule - comment out.
30902 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
30903 with TypeContainer::AddEnum.
30905 * delegate.cs : New file for delegate handling classes.
30906 (Delegate): Class for declaring delegates.
30908 * makefile : Update.
30910 * cs-parser.jay (delegate_declaration): Implement.
30912 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
30914 * class.cs (Event::Define): Implement.
30915 (Event.EventBuilder): New member.
30917 * class.cs (TypeContainer::Populate): Update to define all enums and events
30919 (Events): New property for the events arraylist we hold. Shouldn't we move to using
30920 readonly fields for all these cases ?
30922 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
30924 * class.cs (Property): Revamp to use the convention of making fields readonly.
30925 Accordingly modify code elsewhere.
30927 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
30928 the Define method of the Property class.
30930 * class.cs : Clean up applied patch and update references to variables etc. Fix
30932 (TypeContainer::Populate): Update to define all the properties we have. Also
30933 define all enumerations.
30935 * enum.cs (Define): Implement.
30937 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
30939 * cs-parser.jay (overloadable_operator): The semantic value is an
30940 enum of the Operator class.
30941 (operator_declarator): Implement actions.
30942 (operator_declaration): Implement.
30944 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
30945 validity of definitions.
30946 (Operator::CheckBinaryOperator): Static method to check for binary operators
30947 (TypeContainer::AddOperator): New method to add an operator to a type.
30949 * cs-parser.jay (indexer_declaration): Added line to actually call the
30950 AddIndexer method so it gets added ;-)
30952 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
30953 already taken care of by the MS compiler ?
30955 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
30957 * class.cs (Operator): New class for operator declarations.
30958 (Operator::OpType): Enum for the various operators.
30960 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
30962 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
30963 ostensibly handle this in semantic analysis.
30965 * cs-parser.jay (general_catch_clause): Comment out
30966 (specific_catch_clauses, specific_catch_clause): Ditto.
30967 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
30968 (catch_args, opt_catch_args): New productions.
30969 (catch_clause): Rewrite to use the new productions above
30970 (catch_clauses): Modify accordingly.
30971 (opt_catch_clauses): New production to use in try_statement
30972 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
30973 and re-write the code in the actions to extract the specific and
30974 general catch clauses by being a little smart ;-)
30976 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
30977 Hooray, try and catch statements parse fine !
30979 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30981 * statement.cs (Block::GetVariableType): Fix logic to extract the type
30982 string from the hashtable of variables.
30984 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
30985 I end up making that mistake ;-)
30986 (catch_clauses): Fixed gross error which made Key and Value of the
30987 DictionaryEntry the same : $1 !!
30989 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30991 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
30993 * cs-parser.jay (event_declaration): Correct to remove the semicolon
30994 when the add and remove accessors are specified.
30996 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30998 * cs-parser.jay (IndexerDeclaration): New helper class to hold
30999 information about indexer_declarator.
31000 (indexer_declarator): Implement actions.
31001 (parsing_indexer): New local boolean used to keep track of whether
31002 we are parsing indexers or properties. This is necessary because
31003 implicit_parameters come into picture even for the get accessor in the
31004 case of an indexer.
31005 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
31007 * class.cs (Indexer): New class for indexer declarations.
31008 (TypeContainer::AddIndexer): New method to add an indexer to a type.
31009 (TypeContainer::indexers): New member to hold list of indexers for the
31012 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
31014 * cs-parser.jay (add_accessor_declaration): Implement action.
31015 (remove_accessor_declaration): Implement action.
31016 (event_accessors_declaration): Implement
31017 (variable_declarators): swap statements for first rule - trivial.
31019 * class.cs (Event): New class to hold information about event
31021 (TypeContainer::AddEvent): New method to add an event to a type
31022 (TypeContainer::events): New member to hold list of events.
31024 * cs-parser.jay (event_declaration): Implement actions.
31026 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
31028 * cs-parser.jay (dim_separators): Implement. Make it a string
31029 concatenating all the commas together, just as they appear.
31030 (opt_dim_separators): Modify accordingly
31031 (rank_specifiers): Update accordingly. Basically do the same
31032 thing - instead, collect the brackets here.
31033 (opt_rank_sepcifiers): Modify accordingly.
31034 (array_type): Modify to actually return the complete type string
31035 instead of ignoring the rank_specifiers.
31036 (expression_list): Implement to collect the expressions
31037 (variable_initializer): Implement. We make it a list of expressions
31038 essentially so that we can handle the array_initializer case neatly too.
31039 (variable_initializer_list): Implement.
31040 (array_initializer): Make it a list of variable_initializers
31041 (opt_array_initializer): Modify accordingly.
31043 * expression.cs (New::NType): Add enumeration to help us
31044 keep track of whether we have an object/delegate creation
31045 or an array creation.
31046 (New:NewType, New::Rank, New::Indices, New::Initializers): New
31047 members to hold data about array creation.
31048 (New:New): Modify to update NewType
31049 (New:New): New Overloaded contructor for the array creation
31052 * cs-parser.jay (array_creation_expression): Implement to call
31053 the overloaded New constructor.
31055 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
31057 * class.cs (TypeContainer::Constructors): Return member
31058 constructors instead of returning null.
31060 2001-08-26 Miguel de Icaza <miguel@ximian.com>
31062 * typemanager.cs (InitCoreTypes): Initialize the various core
31063 types after we have populated the type manager with the user
31064 defined types (this distinction will be important later while
31065 compiling corlib.dll)
31067 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
31068 on Expression Classification. Now all expressions have a method
31069 `Resolve' and a method `Emit'.
31071 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
31072 generation from working. Also add some temporary debugging
31075 2001-08-24 Miguel de Icaza <miguel@ximian.com>
31077 * codegen.cs: Lots of code generation pieces. This is only the
31078 beginning, will continue tomorrow with more touches of polish. We
31079 handle the fundamentals of if, while, do, for, return. Others are
31080 trickier and I need to start working on invocations soon.
31082 * gen-treedump.cs: Bug fix, use s.Increment here instead of
31085 * codegen.cs (EmitContext): New struct, used during code
31086 emission to keep a context. Most of the code generation will be
31089 * cs-parser.jay: Add embedded blocks to the list of statements of
31090 this block. So code generation proceeds in a top down fashion.
31092 2001-08-23 Miguel de Icaza <miguel@ximian.com>
31094 * statement.cs: Add support for multiple child blocks.
31096 2001-08-22 Miguel de Icaza <miguel@ximian.com>
31098 * codegen.cs (EmitCode): New function, will emit the code for a
31099 Block of code given a TypeContainer and its ILGenerator.
31101 * statement.cs (Block): Standard public readonly optimization.
31102 (Block::Block constructors): Link children.
31103 (Block::Child): Child Linker.
31104 (Block::EmitVariables): Emits IL variable declarations.
31106 * class.cs: Drop support for MethodGroups here, delay until
31108 (Method::): Applied the same simplification that I did before, and
31109 move from Properties to public readonly fields.
31110 (Method::ParameterTypes): Returns the parameter types for the
31111 function, and implements a cache that will be useful later when I
31112 do error checking and the semantic analysis on the methods is
31114 (Constructor::GetCallingConvention): Renamed from CallingConvetion
31115 and made a method, optional argument tells whether this is a class
31116 or a structure to apply the `has-this' bit.
31117 (Method::GetCallingConvention): Implement, returns the calling
31119 (Method::Define): Defines the type, a second pass is performed
31120 later to populate the methods.
31122 (Constructor::ParameterTypes): implement a cache similar to the
31123 one on Method::ParameterTypes, useful later when we do semantic
31126 (TypeContainer::EmitMethod): New method. Emits methods.
31128 * expression.cs: Removed MethodGroup class from here.
31130 * parameter.cs (Parameters::GetCallingConvention): new method.
31132 2001-08-21 Miguel de Icaza <miguel@ximian.com>
31134 * class.cs (TypeContainer::Populate): Drop RootContext from the
31137 (Constructor::CallingConvention): Returns the calling convention.
31138 (Constructor::ParameterTypes): Returns the constructor parameter
31141 (TypeContainer::AddConstructor): Keep track of default constructor
31142 and the default static constructor.
31144 (Constructor::) Another class that starts using `public readonly'
31145 instead of properties.
31147 (Constructor::IsDefault): Whether this is a default constructor.
31149 (Field::) use readonly public fields instead of properties also.
31151 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
31152 track of static constructors; If none is used, turn on
31153 BeforeFieldInit in the TypeAttributes.
31155 * cs-parser.jay (opt_argument_list): now the return can be null
31156 for the cases where there are no arguments.
31158 (constructor_declarator): If there is no implicit `base' or
31159 `this', then invoke the default parent constructor.
31161 * modifiers.cs (MethodAttr): New static function maps a set of
31162 modifiers flags into a MethodAttributes enum
31163 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
31164 MethodAttr, TypeAttr to represent the various mappings where the
31165 modifiers are used.
31166 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
31168 2001-08-19 Miguel de Icaza <miguel@ximian.com>
31170 * parameter.cs (GetParameterInfo): Fix bug where there would be no
31173 * interface.cs (PopulateIndexer): Implemented the code generator
31174 for interface indexers.
31176 2001-08-17 Miguel de Icaza <miguel@ximian.com>
31178 * interface.cs (InterfaceMemberBase): Now we track the new status
31181 (PopulateProperty): Implement property population. Woohoo! Got
31182 Methods and Properties going today.
31184 Removed all the properties for interfaces, and replaced them with
31185 `public readonly' fields.
31187 2001-08-16 Miguel de Icaza <miguel@ximian.com>
31189 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
31190 initialize their hashtables/arraylists only when they are needed
31191 instead of doing this always.
31193 * parameter.cs: Handle refs and out parameters.
31195 * cs-parser.jay: Use an ArrayList to construct the arguments
31196 instead of the ParameterCollection, and then cast that to a
31199 * parameter.cs: Drop the use of ParameterCollection and use
31200 instead arrays of Parameters.
31202 (GetParameterInfo): Use the Type, not the Name when resolving
31205 2001-08-13 Miguel de Icaza <miguel@ximian.com>
31207 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
31208 and instead use public readonly fields.
31210 * class.cs: Put back walking code for type containers.
31212 2001-08-11 Miguel de Icaza <miguel@ximian.com>
31214 * class.cs (MakeConstant): Code to define constants.
31216 * rootcontext.cs (LookupType): New function. Used to locate types
31219 2001-08-08 Miguel de Icaza <miguel@ximian.com>
31221 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
31222 this System.Reflection code is. Kudos to Microsoft
31224 * typemanager.cs: Implement a type cache and avoid loading all
31225 types at boot time. Wrap in LookupType the internals. This made
31226 the compiler so much faster. Wow. I rule!
31228 * driver.cs: Make sure we always load mscorlib first (for
31229 debugging purposes, nothing really important).
31231 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
31232 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
31234 * rootcontext.cs: Lookup types on their namespace; Lookup types
31235 on namespaces that have been imported using the `using' keyword.
31237 * class.cs (TypeContainer::TypeAttr): Virtualize.
31238 (Class::TypeAttr): Return attributes suitable for this bad boy.
31239 (Struct::TypeAttr): ditto.
31240 Handle nested classes.
31241 (TypeContainer::) Remove all the type visiting code, it is now
31242 replaced with the rootcontext.cs code
31244 * rootcontext.cs (GetClassBases): Added support for structs.
31246 2001-08-06 Miguel de Icaza <miguel@ximian.com>
31248 * interface.cs, statement.cs, class.cs, parameter.cs,
31249 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
31250 Drop use of TypeRefs, and use strings instead.
31252 2001-08-04 Miguel de Icaza <miguel@ximian.com>
31256 * class.cs (Struct::Struct): set the SEALED flags after
31257 checking the modifiers.
31258 (TypeContainer::TypeAttr): new property, returns the
31259 TypeAttributes for a class.
31261 * cs-parser.jay (type_list): Oops, list production was creating a
31262 new list of base types.
31264 * rootcontext.cs (StdLib): New property.
31265 (GetInterfaceTypeByName): returns an interface by type name, and
31266 encapsulates error handling here.
31267 (GetInterfaces): simplified.
31268 (ResolveTree): Encapsulated all the tree resolution here.
31269 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
31272 * driver.cs: Add support for --nostdlib, to avoid loading the
31273 default assemblies.
31274 (Main): Do not put tree resolution here.
31276 * rootcontext.cs: Beginning of the class resolution.
31278 2001-08-03 Miguel de Icaza <miguel@ximian.com>
31280 * rootcontext.cs: Provide better error reporting.
31282 * cs-parser.jay (interface_base): set our $$ to be interfaces.
31284 * rootcontext.cs (CreateInterface): Handle the case where there
31285 are no parent interfaces.
31287 (CloseTypes): Routine to flush types at the end.
31288 (CreateInterface): Track types.
31289 (GetInterfaces): Returns an array of Types from the list of
31290 defined interfaces.
31292 * typemanager.c (AddUserType): Mechanism to track user types (puts
31293 the type on the global type hash, and allows us to close it at the
31296 2001-08-02 Miguel de Icaza <miguel@ximian.com>
31298 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
31299 RecordInterface instead.
31301 * cs-parser.jay: Updated to reflect changes above.
31303 * decl.cs (Definition): Keep track of the TypeBuilder type that
31304 represents this type here. Not sure we will use it in the long
31305 run, but wont hurt for now.
31307 * driver.cs: Smaller changes to accomodate the new code.
31309 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
31312 * rootcontext.cs (CreateInterface): New method, used to create
31313 the System.TypeBuilder type for interfaces.
31314 (ResolveInterfaces): new entry point to resolve the interface
31316 (CodeGen): Property, used to keep track of the code generator.
31318 2001-07-26 Miguel de Icaza <miguel@ximian.com>
31320 * cs-parser.jay: Add a second production for delegate_declaration
31323 (enum_body): Put an opt_comma here instead of putting it on
31324 enum_body or enum_member_declarations so we can handle trailing
31325 commas on enumeration members. Gets rid of a shift/reduce.
31327 (type_list): Need a COMMA in the middle.
31329 (indexer_declaration): Tell tokenizer to recognize get/set
31331 * Remove old targets.
31333 * Re-add the parser target.
31335 2001-07-13 Simon Cozens <simon@simon-cozens.org>
31337 * cs-parser.jay: Add precendence rules for a number of operators
31338 ot reduce the number of shift/reduce conflicts in the grammar.
31340 2001-07-17 Miguel de Icaza <miguel@ximian.com>
31342 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
31345 Get rid of old crufty code.
31347 * rootcontext.cs: Use this to keep track of the parsed
31348 representation and the defined types available to the program.
31350 * gen-treedump.cs: adjust for new convention.
31352 * type.cs: Split out the type manager, and the assembly builder
31355 * typemanager.cs: the type manager will live here now.
31357 * cil-codegen.cs: And the code generator here.
31359 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
31361 * makefile: Fixed up for easy making.
31363 2001-07-13 Simon Cozens <simon@simon-cozens.org>
31365 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
31368 (unary_expression): Expand pre_increment_expression and
31369 post_decrement_expression to reduce a shift/reduce.
31371 2001-07-11 Simon Cozens
31373 * cs-tokenizer.cs: Hex numbers should begin with a 0.
31375 Improve allow_keyword_as_indent name.
31377 2001-06-19 Miguel de Icaza <miguel@ximian.com>
31379 * Adjustments for Beta2.
31381 2001-06-13 Miguel de Icaza <miguel@ximian.com>
31383 * decl.cs: Added `Define' abstract method.
31384 (InTransit): new property, used to catch recursive definitions.
31386 * interface.cs: Implement `Define'.
31388 * modifiers.cs: Map Modifiers.constants to
31389 System.Reflection.TypeAttribute flags.
31391 * class.cs: Keep track of types and user-defined types.
31392 (BuilderInit): New method for creating an assembly
31393 (ResolveType): New function to launch the resolution process, only
31394 used by interfaces for now.
31396 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
31397 that are inserted into the name space.
31399 2001-06-08 Miguel de Icaza <miguel@ximian.com>
31401 * ARGH. I have screwed up my tree so many times due to the use of
31402 rsync rather than using CVS. Going to fix this at once.
31404 * driver.cs: Objetify driver. Load assemblies, use assemblies to
31407 2001-06-07 Miguel de Icaza <miguel@ximian.com>
31409 * Experiment successful: Use System.Type rather that our own
31412 2001-05-25 Miguel de Icaza <miguel@ximian.com>
31414 * cs-parser.jay: Removed nsAliases from here.
31416 Use new namespaces, handle `using XXX;'
31418 * namespace.cs: Reimplemented namespace handling, use a recursive
31419 definition of the class. Now we can keep track of using clauses
31420 and catch invalid using clauses.
31422 2001-05-24 Miguel de Icaza <miguel@ximian.com>
31424 * gen-treedump.cs: Adapted for all the renaming.
31426 * expression.cs (Expression): this class now has a Type property
31427 which returns an expression Type.
31429 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
31430 `Type', as this has a different meaning now in the base
31432 2001-05-22 Miguel de Icaza <miguel@ximian.com>
31434 * interface.cs, class.cs: Removed from all the sources the
31435 references to signature computation, as we can not do method
31436 signature computation during the parsing time, as we are not
31437 trying to solve at that point distinguishing:
31441 void a (NS.Blah x) {}
31444 Which depending on the context might be valid or not, as we do not
31445 know if Blah is the same thing as NS.Blah at that point.
31447 * Redid everything so the code uses TypeRefs now instead of
31448 Types. TypeRefs are just temporary type placeholders, that need
31449 to be resolved. They initially have a pointer to a string and the
31450 current scope in which they are used. This is used later by the
31451 compiler to resolve the reference to an actual Type.
31453 * DeclSpace is no longer a CIR.Type, and neither are
31454 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
31455 are all DeclSpaces, but no Types.
31457 * type.cs (TypeRefManager): This implements the TypeRef manager,
31458 which keeps track of all the types that need to be resolved after
31459 the parsing has finished.
31461 2001-05-13 Miguel de Icaza <miguel@ximian.com>
31463 * ARGH. We are going to have to store `foreach' as a class rather
31464 than resolving it, as we need to verify error 1579 after name
31465 resolution. *OR* we could keep a flag that says `This request to
31466 IEnumerator comes from a foreach statement' which we can then use
31467 to generate the error.
31469 2001-05-10 Miguel de Icaza <miguel@ximian.com>
31471 * class.cs (TypeContainer.AddMethod): we now add methods to the
31472 MethodGroup instead of the method hashtable.
31474 * expression.cs: Add MethodGroup abstraction, which gets us one
31475 step closer to the specification in the way we handle method
31478 * cs-parser.jay (primary_expression): qualified_identifier now
31479 tried to match up an identifier to a local variable reference or
31480 to a parameter reference.
31482 current_local_parameters is now a parser global variable that
31483 points to the current parameters for the block, used during name
31486 (property_declaration): Now creates an implicit `value' argument to
31489 2001-05-09 Miguel de Icaza <miguel@ximian.com>
31491 * parameter.cs: Do not use `param' arguments as part of the
31492 signature, per the spec.
31494 2001-05-08 Miguel de Icaza <miguel@ximian.com>
31496 * decl.cs: Base class for classes, structs and interfaces. This
31497 is the "Declaration Space"
31499 * cs-parser.jay: Use CheckDef for checking declaration errors
31500 instead of having one on each function.
31502 * class.cs: Factor out some code for handling error handling in
31503 accordance to the "Declarations" section in the "Basic Concepts"
31504 chapter in the ECMA C# spec.
31506 * interface.cs: Make all interface member classes derive from
31507 InterfaceMemberBase.
31509 2001-05-07 Miguel de Icaza <miguel@ximian.com>
31511 * Many things: all interfaces are parsed and generated in
31512 gen-treedump. Support for member variables, constructors,
31513 destructors, properties, constants is there.
31515 Beginning of the IL backend, but very little done, just there for
31518 2001-04-29 Miguel de Icaza <miguel@ximian.com>
31520 * cs-parser.jay: Fix labeled statement.
31522 * cs-tokenizer.cs (escape): Escape " and ' always.
31523 ref_line, ref_name: keep track of the line/filename as instructed
31524 by #line by the compiler.
31527 2001-04-27 Miguel de Icaza <miguel@ximian.com>
31529 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
31530 to match the values in System.CodeDOM.
31532 Divid renamed to Divide.
31534 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
31536 (Statements.set): remove.
31538 * System.CodeDOM/CodeCatchClause.cs: always have a valid
31541 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
31542 falseStatements always have valid values.
31544 * cs-parser.jay: Use System.CodeDOM now.