1 2009-01-28 Marek Safar <marek.safar@gmail.com>
4 * cs-tokenizer.cs: Remove too agressive parser optimization.
6 2009-01-28 Marek Safar <marek.safar@gmail.com>
9 * class.cs: Remove too early base type resolve.
11 2009-01-27 Marek Safar <marek.safar@gmail.com>
14 * ecore.cs: Explicitly type null when assigning to type argument to
15 make pass verifier check.
17 2009-01-27 Marek Safar <marek.safar@gmail.com>
19 * anonymous.cs: Fixed recent regression when initializing captured
22 2009-01-26 Marek Safar <marek.safar@gmail.com>
25 * anonymous.cs: Use all parent type parameters when instantiating
26 nested generic storey.
28 2009-01-26 Marek Safar <marek.safar@gmail.com>
30 * expression.cs: Check for null instance methodgroup expression.
32 2009-01-26 Marek Safar <marek.safar@gmail.com>
35 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
36 instance inside a conditional expression.
38 2009-01-23 Marek Safar <marek.safar@gmail.com>
40 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
41 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
42 GetElementType and HasElementType. IsValueType clean up.
44 2009-01-23 Marek Safar <marek.safar@gmail.com>
46 * nullable.cs: Use common EmitCall.
48 * expression.cs: Emit constraint. for virtual calls only.
50 2009-01-23 Marek Safar <marek.safar@gmail.com>
52 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
53 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
54 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
57 2009-01-22 Jb Evain <jbevain@novell.com>
59 * anonymous.cs: make anonymous types' ToString implementation
60 match what csc outputs.
62 2009-01-21 Marek Safar <marek.safar@gmail.com>
64 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
67 2009-01-17 Marek Safar <marek.safar@gmail.com>
69 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
72 2009-01-16 Marek Safar <marek.safar@gmail.com>
74 * nullable.cs (LiftedBinaryOperator): Check for all possible null
77 2009-01-15 Marek Safar <marek.safar@gmail.com>
80 * statement.cs: Add reference for nested storey when only this
83 2009-01-15 Marek Safar <marek.safar@gmail.com>
86 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
89 2009-01-15 Marek Safar <marek.safar@gmail.com>
91 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
92 Fixed nested stories parent referencing process. Also fixes #463985.
94 2009-01-06 Marek Safar <marek.safar@gmail.com>
96 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
97 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
98 implementation. Also fixes #463108.
100 2009-01-05 Marek Safar <marek.safar@gmail.com>
102 A fix for bug #416109
103 * decl.cs: Issue correct CLSAttribute warning location.
105 2009-01-05 Marek Safar <marek.safar@gmail.com>
107 A fix for bug #456775
108 * attribute.cs: Use attribute owner scope when resolving attribute
111 2009-01-05 Marek Safar <marek.safar@gmail.com>
113 A fix for bug #457257
114 * decl.cs: Fixed incorrect member declaring type comparison.
116 2009-01-05 Marek Safar <marek.safar@gmail.com>
118 A fix for bug #460896
119 * driver.cs: Handle /RES resources as embeddable.
121 2009-01-05 Marek Safar <marek.safar@gmail.com>
123 A fix for bug #462515
124 * ecore.cs: Report inacessible members upwards.
126 2009-01-05 Marek Safar <marek.safar@gmail.com>
128 A fix for bug #463190, #463192
129 * decl.cs, namespace.cs: Also import internal extension classes.
131 2009-01-04 Marek Safar <marek.safar@gmail.com>
133 A fix for bug #463415
134 * generic.cs: Use right index for RemoveDependentTypes.
136 2009-01-02 Marek Safar <marek.safar@gmail.com>
138 A fix for bug #463196
139 * expression.cs: Fixed enum to null comparison.
141 2009-01-02 Marek Safar <marek.safar@gmail.com>
143 A fix for bug #463121
144 * nullable.cs: Fixed nullable user equality operator comparison.
146 2009-01-02 Marek Safar <marek.safar@gmail.com>
148 A fix for bug #462950
149 * class.cs, decl.cs: Use full explicit name when defining automatic
150 property backing field.
152 2009-01-02 Marek Safar <marek.safar@gmail.com>
154 A fix for bug #462592
155 * pending.cs: Emit type arguments for generic proxy method.
157 2008-12-30 Marek Safar <marek.safar@gmail.com>
159 * expression.cs (As): Mutate all type arguments.
161 2008-12-29 Marek Safar <marek.safar@gmail.com>
163 A fix for bug #462622
164 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
167 2008-12-29 Marek Safar <marek.safar@gmail.com>
169 A fix for bug #450782
170 * ecore.cs: Consider more variables of form V.I to be fixed.
172 2008-12-29 Marek Safar <marek.safar@gmail.com>
174 A fix for bug #460712
175 * typemanager.cs: Core types could be imported.
177 2008-12-28 Marek Safar <marek.safar@gmail.com>
179 A fix for bugs #460847, #460772, #458049, #457339, #447807
180 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
181 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
182 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
183 user lambdas used inside query clauses.
185 2008-12-18 Marek Safar <marek.safar@gmail.com>
187 A fix for bug #460229
188 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
190 2008-12-18 Marek Safar <marek.safar@gmail.com>
192 A fix for bug #459952
193 * decl.cs, namespace.cs: Use common CheckAccessLevel.
195 2008-12-18 Marek Safar <marek.safar@gmail.com>
197 A fix for bug #459630
198 * convert.cs: Enum to valuetype conversion is not allowed.
200 2008-12-18 Marek Safar <marek.safar@gmail.com>
202 A fix for bug #457087
203 * generic.cs: Don't crash when constraint comes from type
206 2008-12-16 Marek Safar <marek.safar@gmail.com>
208 A fix for bug #459221
209 * anonymous.cs, statement.cs: Delay only captured this
212 2008-12-12 Marek Safar <marek.safar@gmail.com>
214 A fix for bug #457489
215 * anonymous.cs, statement.cs: Split anonymous storey instantiation
216 and initialization to capture scope initializers correctly.
218 2008-12-11 Marek Safar <marek.safar@gmail.com>
220 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
221 ParameterReference refactoring.
223 2008-12-03 Marek Safar <marek.safar@gmail.com>
225 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
226 to be imported from any assembly.
228 2008-12-03 Marek Safar <marek.safar@gmail.com>
230 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
231 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
232 from anonymous method and lambda expression.
234 2008-12-01 Marek Safar <marek.safar@gmail.com>
236 A fix for bug #448560
237 * expression.cs (As): Box any generic type arguments to be
240 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
242 Add tripwire for implicit conversion bugs
243 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
245 (MethodGroupExpr.OverloadResolve): Add sanity check between
246 IsApplicable and VerifyArgumentsCompat.
247 (VerifyArgumentsCompat): Report CS1501 where appropriate.
249 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
251 Fix build break in System.Data_test
252 * convert.cs (ImplicitConversionExists): Move NullLiteral
254 (ImplicitStandardConversionExists): ... here.
256 2008-11-28 Marek Safar <marek.safar@gmail.com>
258 * literal.cs: Emit correctly explicit null to nullable cast.
260 2008-11-28 Marek Safar <marek.safar@gmail.com>
262 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
265 2008-11-28 Marek Safar <marek.safar@gmail.com>
267 A fix for bug #449005
268 * convert.cs, nullable.cs: Use only one implicit nullable
271 2008-11-27 Marek Safar <marek.safar@gmail.com>
273 * convert.cs, literal.cs: More Convert cleanup is needed.
275 2008-11-27 Marek Safar <marek.safar@gmail.com>
277 * decl.cs, class.cs: Fixed misleading error message.
279 2008-11-26 Marek Safar <marek.safar@gmail.com>
281 A fix for bug #449005
282 * nullable.cs (EmitEquality): Disable optimization for user operator
285 2008-11-25 Marek Safar <marek.safar@gmail.com>
287 A fix for bug #447027
288 * anonymous.cs (HoistedVariable): Cache also outer access to deal
289 with context variables stored as expression instances.
291 2008-11-25 Marek Safar <marek.safar@gmail.com>
293 A fix for bug #447027
294 * delegate.cs: Fixed delegate VerifyMethod logic.
296 2008-11-24 Marek Safar <marek.safar@gmail.com>
298 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
301 2008-11-21 Marek Safar <marek.safar@gmail.com>
303 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
304 member type resolve to follow normal flow, instead of random
307 2008-11-21 Marek Safar <marek.safar@gmail.com>
309 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
312 2008-11-21 Marek Safar <marek.safar@gmail.com>
314 * const.cs: Emit decimal array constant as literal.
316 2008-11-20 Marek Safar <marek.safar@gmail.com>
318 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
320 2008-11-19 Marek Safar <marek.safar@gmail.com>
322 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
323 into real property (saves 8 MB for corlib compilation).
325 2008-11-19 Marek Safar <marek.safar@gmail.com>
327 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
328 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
329 generic-mcs.cs: Small cleanup of TypeArguments.
331 2008-11-18 Marek Safar <marek.safar@gmail.com>
333 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
334 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
335 of ConstructedType expression, renamed to GenericTypeExpr.
337 2008-11-17 Marek Safar <marek.safar@gmail.com>
339 A fix for bug #445303
340 * location.cs (IsConditionalDefined): Handle undefined global
343 2008-11-17 Marek Safar <marek.safar@gmail.com>
345 A fix for bug #444678
346 * expression.cs (TryReduceConstant): Always create new constant
349 2008-11-17 Marek Safar <marek.safar@gmail.com>
351 A fix for bug #444673
352 * ecore.cs: Ignore open generic types when used as generic type
355 2008-11-17 Marek Safar <marek.safar@gmail.com>
357 A fix for bug #445458
358 * expression.cs, cs-parser.jay: Don't crash when an expression
361 2008-11-17 Marek Safar <marek.safar@gmail.com>
363 A fix for bug #445464
364 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
367 2008-11-14 Jb Evain <jbevain@novell.com>
369 * driver.cs: ignore empty -nowarn argument such as
370 the one in -nowarn:12,13,,.
372 2008-11-13 Marek Safar <marek.safar@gmail.com>
374 A fix for bug #444271
375 * anonymous.cs: Rescan parent storeys when best candidate was
378 2008-11-13 Marek Safar <marek.safar@gmail.com>
380 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
381 useless UnboundTypeExpression.
383 * attribute.cs: Do check obsolete attribute on generic types.
385 2008-11-12 Marek Safar <marek.safar@gmail.com>
387 A fix for bugs #425680, #400139
388 * ecore.cs, expression.cs: Trying to do some almost_matched_members
391 2008-11-11 Marek Safar <marek.safar@gmail.com>
393 A fix for bug #435747
394 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
395 compound value types assignment. Few micro optimizations added.
397 2008-11-10 Marek Safar <marek.safar@gmail.com>
399 A fix for bug #442610
400 * anonymous.cs (MutateConstructor): More SRE hacking.
402 2008-11-10 Marek Safar <marek.safar@gmail.com>
404 A fix for bug #442579
405 * ecore.cs: Also initialize expanded form of a method with 1 params
408 2008-11-06 Marek Safar <marek.safar@gmail.com>
410 * expression.cs (UnaryMutator): Do early l-side check.
412 2008-11-05 Miguel de Icaza <miguel@novell.com>
414 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
415 Init, otherwise we would crash later on when checking for friend
418 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
419 Otherwise we never get any meaningful information as to what
422 2008-11-05 Marek Safar <marek.safar@gmail.com>
424 A fix for bug #436318
425 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
427 2008-11-05 Miguel de Icaza <miguel@novell.com>
429 * namespace.cs: Turns out that it was a really bad idea to hide
430 the errors for namespaces not found here in eval mode.
432 * eval.cs: When we process using clauses, only enter those into
433 the list of valid using clauses after they have been validated.
435 The above change gives the proper semantics: it does not
436 senselessly report the same errors with broken using statements by
437 never storing them in the first place when they are invalid.
439 2008-11-05 Marek Safar <marek.safar@gmail.com>
441 A fix for bug #421839
442 * cs-parser.jay: Remove expression from coalesce rule to force lower
443 priority than the assignment operator.
445 2008-11-05 Marek Safar <marek.safar@gmail.com>
447 A fix for bug #437875
448 * nullable.cs: Compile correctly method group operand used with null
451 2008-11-04 Marek Safar <marek.safar@gmail.com>
453 A fix for bug #434589
454 * expression.cs (Binary): Ignore lifted conversions when at least
455 one operand is of reference type.
457 2008-11-04 Marek Safar <marek.safar@gmail.com>
459 * cs-parser.jay: Better syntax error report.
461 2008-11-03 Marek Safar <marek.safar@gmail.com>
463 A fix for bug #436792
464 * cs-parser.jay: Use GetLocation to access location.
466 2008-11-03 Marek Safar <marek.safar@gmail.com>
468 A fix for bug #440774
469 * cs-parser.jay: Also set current_array_type when parsing local
472 2008-11-03 Marek Safar <marek.safar@gmail.com>
474 A fix for bug #440785
475 * expression.cs (As): Don't resolve self modifing expression
478 2008-11-03 Marek Safar <marek.safar@gmail.com>
480 A fix for bug #439447
481 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
483 2008-11-03 Marek Safar <marek.safar@gmail.com>
485 A fix for bug #437571
486 * cs-parser.jay: Fixes internal error for invalid expression
489 2008-10-17 Marek Safar <marek.safar@gmail.com>
491 * ecore.cs: Resolve correctly ambiguous params delegate methods.
493 2008-10-17 Marek Safar <marek.safar@gmail.com>
495 * generic.cs, anonymous.cs: Simplified GetDeclarations.
497 2008-10-17 Marek Safar <marek.safar@gmail.com>
499 * cs-tokenizer.cs: More precise cast parsing.
501 2008-10-16 Martin Baulig <martin@ximian.com>
503 * anonymous.cs (AnonymousMethodStorey): Put back the
504 `hoisted_locals' hashtable and use it in EmitType().
506 2008-10-15 Marek Safar <marek.safar@gmail.com>
508 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
509 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
512 2008-10-14 Marek Safar <marek.safar@gmail.com>
514 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
516 2008-10-14 Marek Safar <marek.safar@gmail.com>
518 * statement.cs: Mutate scope initializers.
520 2008-10-14 Marek Safar <marek.safar@gmail.com>
522 * expression.cs: Use typeless value for This constant.
524 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
526 2008-10-14 Marek Safar <marek.safar@gmail.com>
528 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
531 2008-10-13 Marek Safar <marek.safar@gmail.com>
533 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
536 2008-10-13 Marek Safar <marek.safar@gmail.com>
538 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
539 parser and tokenizer. Fixes many ambiguities including #433258.
541 2008-10-10 Marek Safar <marek.safar@gmail.com>
543 * cs-parser.jay: Fixed missing accessor recovery.
545 2008-10-10 Marek Safar <marek.safar@gmail.com>
547 A fix for bug #433701
548 * expression.cs: Better error message.
550 2008-10-10 Marek Safar <marek.safar@gmail.com>
552 * cs-parser.jay, expression.cs: Start reporting real parser errors.
554 * Makefile: Disabled unused debug symbols.
556 Also fixes: #320556, #321097, #321656, #321876, #351316
558 2008-10-09 Miguel de Icaza <miguel@novell.com>
560 * eval.cs: rename "<interactive>" to "{interactive}", to work
561 around a requirement in the compiler that this be a valid
562 filename, and in Windows it is not (433886).
564 2008-10-09 Marek Safar <marek.safar@gmail.com>
566 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
568 2008-10-08 Marek Safar <marek.safar@gmail.com>
570 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
571 cs-parser.jay: Generic type declaration and type arguments cleanup.
573 2008-10-05 Marek Safar <marek.safar@gmail.com>
575 * cs-parser.jay: Allow parsing weird array creation construct.
577 2008-10-05 Marek Safar <marek.safar@gmail.com>
579 * cs-parser.jay: Conflicts reduction.
581 2008-10-04 Marek Safar <marek.safar@gmail.com>
583 * cs-parser.jay: Conflicts reduction.
585 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
588 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
589 property. Add a 'count' hint about the use of the shared vector.
590 Ensure that we don't leak out dirty bits.
591 (UsageVector.MergeChild): Throw away information about variables
593 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
595 2008-10-03 Marek Safar <marek.safar@gmail.com>
597 A fix for bug #431746
598 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
599 parameters when iterator is created.
601 2008-10-03 Marek Safar <marek.safar@gmail.com>
603 A fix for bug #431827
604 * expression.cs: Fixed right based pointer arithmetic operations
607 2008-10-03 Marek Safar <marek.safar@gmail.com>
609 A fix for bug #353779
610 * assign.cs, expression.cs: Fixed compound assignment conversions.
612 2008-10-02 Marek Safar <marek.safar@gmail.com>
614 A fix for bug #375262
615 * statement.cs: Refactor ArrayForeach to be usable with string
616 indexer. Optimized single dimentional arrays foreach.
618 2008-10-02 Marek Safar <marek.safar@gmail.com>
620 A fix for bug #431255
621 * anonymous.cs, expression.cs: Removed broken optimization.
623 2008-10-01 Marek Safar <marek.safar@gmail.com>
625 * anonymous.cs: Use full type parameters of parent generic
626 containers. Removed unnecessary AddParentStoreyReference call.
628 2008-10-01 Marek Safar <marek.safar@gmail.com>
630 A fix for bug #324702
631 * class.cs: Use better shorter names for explicit interface member
634 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
636 2008-10-01 Marek Safar <marek.safar@gmail.com>
638 * expression.cs: Use new interface to check fixed expression.
640 2008-10-01 Marek Safar <marek.safar@gmail.com>
642 A fix for bug #421101
643 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
644 interface to check for fixed fixed-buffers.
646 2008-10-01 Marek Safar <marek.safar@gmail.com>
648 A fix for bug #429264
649 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
651 * delegate.cs: Removed unnecessary casts.
653 2008-09-30 Marek Safar <marek.safar@gmail.com>
655 A fix for bug #352151
656 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
657 class.cs: Fixed already defined explicit interface members check.
659 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
661 cs-tokenizer.cs: Fix typo.
663 2008-09-28 Miguel de Icaza <miguel@novell.com>
665 * eval.cs (InteractiveBase): The quit command now just sets a
666 flag, instead of calling Environment.Exit(), it is milder on
669 CompiledMethod is now in Mono.CSharp, not nested inside
670 the Evaluator, it was inconvenient to use.
672 2008-09-27 Miguel de Icaza <miguel@novell.com>
674 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
675 code to be invoked without having to reparse.
677 2008-09-27 Miguel de Icaza <miguel@novell.com>
679 * ecore.cs: The recent changes to FieldExpr broke this as well.
680 Fixes LINQ queries in the interactive shell.
682 * Multiple files: indentation fixing for the Mono coding
683 guidelines for the switch statement.
685 * eval.cs: Make the Evaluator API thread safe.
687 2008-09-26 Marek Safar <marek.safar@gmail.com>
689 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
692 2008-09-26 Marek Safar <marek.safar@gmail.com>
694 A fix for bug #325326
695 * statement.cs: Check possible mistaken empty statement using
696 explicit blocks only.
698 2008-09-25 Miguel de Icaza <miguel@novell.com>
700 * eval.cs (LoadAssembly, ReferenceAssembly): Call
701 RootNamespace.ComputeNamespaces to update the internal list of
702 namespaces, this is no longer done for us.
704 (InteractiveBase): Use the Evaluator APIs instead of calling into
707 2008-09-25 Marek Safar <marek.safar@gmail.com>
709 A fix for bug #429264
710 * expression.cs: Missing mutator for access to multidimensional
713 2008-09-25 Marek Safar <marek.safar@gmail.com>
715 * class.cs, statement: Emit DebuggerHidden attribute for iterator
718 * driver.cs: Missing input argument check.
720 2008-09-25 Marek Safar <marek.safar@gmail.com>
722 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
723 expression.cs, statement.cs, rootcontext.cs, class.cs,
724 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
727 2008-09-24 Miguel de Icaza <miguel@novell.com>
729 * ecore.cs (FieldExpr): Only initialize eclass when we return a
730 fully constructed FieldExpr, fixes the regression introduced in
733 * ecore.cs, expression.cs: Plug back the eclass initialization as
734 otherwise it regresses `csharp'.
736 2008-09-24 Marek Safar <marek.safar@gmail.com>
738 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
739 ecore.cs, attribute.cs: Moved obsolete method checks from emit
740 phase to resolve phase. It resolves problems with expression trees
741 and fixes bugs #323796, #325156.
743 2008-09-23 Marek Safar <marek.safar@gmail.com>
745 * codegen.cs: Report better error when symbol writer is missing.
747 2008-09-23 Marek Safar <marek.safar@gmail.com>
749 * codegen.cs: Set .NET symbol writer.
751 * decl.cs: Guard against null generic arguments.
753 * report.cs: Don't report exactly same additional details.
755 2008-09-22 Marek Safar <marek.safar@gmail.com>
757 A fix for bug #324917
758 * cs-parser.jay: Add missing multidimensional non-expression type
761 2008-09-22 Marek Safar <marek.safar@gmail.com>
763 A fix for bug #428191
764 * anonymous.cs: Create an outer generic fields also for non-storey
767 2008-09-22 Marek Safar <marek.safar@gmail.com>
769 A fix for bug #378294
770 * class.cs: Make fixed size buffers gmcs feature only.
772 2008-09-22 Marek Safar <marek.safar@gmail.com>
774 A fix for bug #355622, #324993
775 * assign.cs, const.cs, class.cs: Create new EmitContext for each
778 2008-09-19 Marek Safar <marek.safar@gmail.com>
780 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
783 2008-09-19 Marek Safar <marek.safar@gmail.com>
785 A fix for bug #416110
786 * generic.cs: Struct constraint results in default ctor and
787 ValueType base type constraint to be set.
789 2008-09-19 Marek Safar <marek.safar@gmail.com>
791 A fix for bug #423791
792 * generic.cs: Fixed params output type type-inference.
794 2008-09-19 Marek Safar <marek.safar@gmail.com>
796 * cs-parser.jay, expression.cs: Fixed few expression crashes.
798 2008-09-19 Marek Safar <marek.safar@gmail.com>
800 * cs-tokenizer.cs: Don't break on extra partial modifier.
802 2008-09-19 Marek Safar <marek.safar@gmail.com>
804 A fix for bug #427592
805 * generic.cs: Use common parameter resolve method.
807 2008-09-18 Marek Safar <marek.safar@gmail.com>
809 A fix for bug #414758
810 * expression.cs, ecore.cs: Fixed crash when accessing non-static
813 2008-09-18 Marek Safar <marek.safar@gmail.com>
815 * driver.cs, namespace.cs: Read types and namespaces after all
816 requested assemblies are loaded, fixes issues with System.Core
817 auto-reference, and #419888.
819 2008-09-18 Marek Safar <marek.safar@gmail.com>
821 A fix for bug #417705
822 * cs-parser.jay: Fixed as/is operator expression split.
824 2008-09-18 Marek Safar <marek.safar@gmail.com>
826 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
827 Fixed expression tree representation of empty new expression and
828 new initializer expression.
830 2008-09-18 Miguel de Icaza <miguel@novell.com>
832 * eval.cs: Remove warning, keep reference to driver around.
834 * Hide fields that do not need to be public.
836 2008-09-17 Marek Safar <marek.safar@gmail.com>
838 A fix for bug #426385
839 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
840 conversion for array elements.
842 2008-09-17 Marek Safar <marek.safar@gmail.com>
844 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
845 void parsing conflicts.
847 2008-09-15 Marek Safar <marek.safar@gmail.com>
849 A fix for bug #425601
850 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
851 System.Core only when there is no custom ExtensionAttribute
854 2008-09-15 Miguel de Icaza <miguel@novell.com>
856 * namespace.cs: Do not report CS0246 (name
858 2008-09-12 Marek Safar <marek.safar@gmail.com>
860 A fix for bug #425669
861 * generic.cs: Don't cache generic static anonymous method
864 2008-09-12 Marek Safar <marek.safar@gmail.com>
866 * generic.cs, class.cs, delegate.cs: Check recursive inherited
867 conflicting constraints.
869 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
871 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
874 2008-09-12 Marek Safar <marek.safar@gmail.com>
876 * literal.cs, convert.cs, expression.cs, statement.cs: More null
877 to null pointer conversion fixes.
879 2008-09-11 Marek Safar <marek.safar@gmail.com>
881 * cs-parser.jay, expression.cs: An implicitly typed local variable
882 declarator cannot use an array initializer.
884 2008-09-11 Marek Safar <marek.safar@gmail.com>
886 * cs-parser.jay: Reduced number of printed tokens, add sorting.
888 2008-09-11 Marek Safar <marek.safar@gmail.com>
890 * generic.cs (InflatedConstraints): Don't crash when constraints
893 * cs-parser.jay: const_declarator is a block.
895 * constant.cs: Check for not allowed NaN conversions.
897 2008-09-10 Miguel de Icaza <miguel@novell.com>
899 * driver.cs: Drop --shell argument, the compiler is no longer a
902 * eval.cs: Move most of the code that deals with evaluation into
903 this file and document the public API from repl.cs
905 * repl.cs: Remove from here.
907 2008-09-10 Marek Safar <marek.safar@gmail.com>
909 A fix for bug #424684
910 * generic.cs: Generic class constraints must come first.
912 2008-09-09 Miguel de Icaza <miguel@novell.com>
914 * cs-parser.jay: Improve error reporting for syntax errors in
915 statements and expressions, we now report the expected tokens
916 instead of reporting the useless "; expected".
918 Drop the strings from the token declaration, it turns out that
919 they did not do what I thought they did. Instead they were adding
920 two sets of tokens to the tables.
922 2008-09-09 Marek Safar <marek.safar@gmail.com>
924 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
925 delegate.cs: Share special type check.
927 2008-09-09 Marek Safar <marek.safar@gmail.com>
929 A fix for bug #423981
930 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
932 2008-09-09 Marek Safar <marek.safar@gmail.com>
934 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
937 2008-09-09 Marek Safar <marek.safar@gmail.com>
939 A fix for bugs: #324750, #335946
940 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
941 lookup rule to determine ?-based tokens.
943 2008-09-08 Miguel de Icaza <miguel@novell.com>
945 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
946 expressions (like event adding or removing) end up here, so we
947 need to treat those as statements.
949 Add LoadAssembly method.
951 2008-09-04 Miguel de Icaza <miguel@novell.com>
953 * repl.cs: Add Time method.
955 2008-09-05 Marek Safar <marek.safar@gmail.com>
957 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
959 2008-09-05 Miguel de Icaza <miguel@novell.com>
961 * repl.cs: Add workaround for old compilers.
963 2008-09-04 Jb Evain <jbevain@novell.com>
965 * repl.cs (PrettyPrint): pretty print everything that
966 implements IDictionary, as well as IEnumerables. Also,
967 add a quit helper property.
969 2008-09-04 Marek Safar <marek.safar@gmail.com>
971 * constant.cs: Better error reporting for decimal literals.
973 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
976 2008-09-04 Marek Safar <marek.safar@gmail.com>
977 Miguel de Icaza <miguel@novell.com>
979 A fix for bug #422951
980 * assign.cs (Assign.DoResolve): Perform the type conversions
981 checks before we attempt to initialize `New' initializers.
983 2008-09-04 Marek Safar <marek.safar@gmail.com>
985 A fix for bug #422853
986 * delegate.cs (DelegateCreation): Add special handling for
987 EmptyExpression.Null instance expression which is just another
988 hack for undecided member instance exression.
990 2008-09-04 Marek Safar <marek.safar@gmail.com>
992 * expression.cs, ecore.cs: Emit full expression tree for reduced
995 2008-09-04 Marek Safar <marek.safar@gmail.com>
997 * expression.cs (This): Guard against multi-resolving.
999 * ecore.cs, statement.cs (Throw): Simplified.
1001 * flowanalysis.cs: Also verify event fields.
1003 2008-09-04 Miguel de Icaza <miguel@novell.com>
1005 * assign.cs (Assign.DoResolve): Perform the type conversions
1006 checks before we attempt to initialize `New' initializers.
1008 * repl.cs (PrettyPrint): Add Hashtable prettyprint
1010 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
1013 * repl.cs: Update help.
1015 2008-09-03 Miguel de Icaza <miguel@novell.com>
1017 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
1018 handling of the default config handling, including the special
1019 treatment of System.Core assembly.
1021 Fixes the REPL processing for LINQ.
1023 2008-09-03 Marek Safar <marek.safar@gmail.com>
1025 A fix for bug #422507
1026 * expression.cs (UnboxCast): Add missing child expression mutator.
1028 2008-09-03 Marek Safar <marek.safar@gmail.com>
1030 * driver.cs: Don't self reference System.Core assembly.
1032 2008-09-03 Marek Safar <marek.safar@gmail.com>
1034 A fix for bug #422507
1035 * expression.cs (StringConcat): Add missing type mutator.
1037 2008-09-03 Marek Safar <marek.safar@gmail.com>
1039 * generic.cs (TypeInferenceContext): Follow equality rule for
1040 constructed type lower bound type inference.
1042 2008-09-02 Miguel de Icaza <miguel@novell.com>
1044 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
1045 <dblank@cs.brynmawr.edu> which updates the cursor position on
1048 2008-09-02 Marek Safar <marek.safar@gmail.com>
1050 A fix for bug #367145
1051 * driver.cs: Fixed import of extension methods when using -noconfig
1054 2008-09-02 Marek Safar <marek.safar@gmail.com>
1056 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
1057 version from non-generic implementation instead.
1059 2008-09-01 Marek Safar <marek.safar@gmail.com>
1061 A fix for bug #418908
1062 * class.cs: Use AddScopeStatement for field initializers.
1064 2008-09-01 Marek Safar <marek.safar@gmail.com>
1066 A fix for bug #415385
1067 * ecore.cs, convert.cs: Do method group conversion for equal group types.
1069 2008-09-01 Marek Safar <marek.safar@gmail.com>
1071 A fix for bug #421736
1072 * iterators.cs: Don't crash on unreachable iterators.
1074 2008-09-01 Marek Safar <marek.safar@gmail.com>
1076 A fix for bug #421628
1077 * parameter.cs, attribute.cs: Clone also parameter attributes.
1079 2008-08-30 Miguel de Icaza <miguel@novell.com>
1081 * namespace.cs (LookupType): In EvalMode, try to replace
1082 the TypeBuilder from our cache with a Type as Reflection.Emit does
1083 not like to mix code from older assemblies emitted and new
1086 This sounds like a serious Mono bug that prevents multiple
1087 assemblies to be generated and consumed at the same time.
1089 * cs-parser.jay (push_current_class): Do not make interactive
1090 classes internal or private, make them public as we currently
1091 generate each new class in a new assembly.
1093 2008-08-29 Miguel de Icaza <miguel@novell.com>
1095 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
1096 remove types that are entered into the global namespace during
1097 parsing so that we can remove them on failure.
1099 * cs-parser.jay: Parsing: we now keep track of types that are
1100 entered into global variables and queue those in case the parsing
1103 This happens in a few situations: during partial-input, we invoke
1104 the parser repeatedly for example with the string "class X", this
1105 would cause X to be registed, and we need to remove this
1106 registration so that another parse attempt later with say "class X {"
1107 would actually work.
1109 Additionally, if there is an error in the resolution phase, for
1110 example: "class X : NonExistant {}" th
1112 * cs-parser.jay: Be more precise with the errors being raised,
1113 instead of flagging all exceptions during parsing to be attributed
1114 to the parsing process, distinguish those from errors happening in
1115 the actions and hint that using -v would produce the actual
1118 * repl.cs: Do not load all compiler references on each reset,
1119 doing the partial reset takes care of this.
1121 2008-08-28 Miguel de Icaza <miguel@novell.com>
1123 * repl.cs: Add support for loading all the files from
1124 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
1127 Introduce a micro-parser that is able to deambiguate on its input
1128 whether we are dealing with a compilation unit (namespace, class,
1129 interface, struct, delegate) declaration or a statement. This
1130 allows both declarations and statements to be entered.
1132 Set history size by default to 300 lines.
1134 Instead of distinguishing based on the parser.InteractiveResult,
1135 have only two cases: statements were parsed, or a compilation unit
1136 was. Always pull the Using statement additions from the
1137 compilation unit parse.
1139 * cs-tokenizer.cs: Rename tokens to better describe their intent
1140 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
1142 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
1143 EvalMode is used to trigger the lookup of global variables while
1144 StatementMode is used turn variable declarations into static
1147 * getline.cs: Allow history size to be set.
1149 2008-08-29 Marek Safar <marek.safar@gmail.com>
1151 A fix for bug #360755
1152 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
1154 2008-08-29 Marek Safar <marek.safar@gmail.com>
1156 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
1158 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
1159 member name, it is too confusing
1161 * decl.cs, class.cs: Don't report unused fields with attached attribute.
1163 * rootcontext.cs: Finally default to warning level 4.
1165 2008-08-28 Marek Safar <marek.safar@gmail.com>
1167 * class.cs (CheckBase): Ignore overloaded operators.
1169 2008-08-28 Marek Safar <marek.safar@gmail.com>
1171 A fix for bug #420830
1172 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
1174 2008-08-28 Marek Safar <marek.safar@gmail.com>
1176 A fix for bug #420832
1177 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
1179 2008-08-28 Marek Safar <marek.safar@gmail.com>
1181 A fix for bug #420386
1182 * nullables.cs: Fixed logic of nullable user comparison operators involving
1185 2008-08-28 Marek Safar <marek.safar@gmail.com>
1187 * attribute (IsClsCompliant): Use FALSE value for pointer types.
1189 2008-08-27 Miguel de Icaza <miguel@novell.com>
1191 * repl.cs: Add support for aborting the running code with C-c.
1193 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
1195 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
1197 2008-08-27 Miguel de Icaza <miguel@novell.com>
1199 * cs-parser.jay (interactive_statement_list): A new set of rules
1200 for hosting statements that uses the "interactive_" prefix.
1202 * repl.cs: Add support for parsing `using' as a statement or as a
1203 directive. Deambiguating before passing this to the parser.
1205 We need to distinguish statement_expressions that occur at the
1206 toplevel vs those that occur embedded into expressions.
1208 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
1209 that fixes the cursor key handling, and a history bug.
1211 2008-08-26 Miguel de Icaza <miguel@novell.com>
1213 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
1214 limitations in Console, instead the 2.0 bootstrap libraries now
1215 include the Console bits.
1217 Also, remove the use of Nullables from getline.cs
1221 Interactive support for the C# compiler. Use gmcs --shell to
1222 enter a read-eval-print loop shell.
1224 Docs: http://www.mono-project.com/CsharpRepl
1226 * sources: include repl.cs here and getline.cs for gmcs.exe,
1227 everything else is getline.cs impaired.
1229 * Makefile: when bootstrapping pass a special flag
1230 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
1231 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
1232 This distinguishes those two cases.
1234 * repl.cs: Support for a read-eval-print loop. Will be soon
1235 refactored into eval support and then REPL on top of it.
1237 * ecore.cs: If a simplename lookup fails, before erroring out,
1238 if we are in EvalMode to resolve the name to a declaration in the
1241 This means that variable declarations that happened in previous
1242 classes (as repl puts every statement in a separate class) are
1243 made visible in this way.
1245 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
1246 triggered an error due to the end of file being reached. This is
1247 used to do multi-line input, and notify the caller that the user
1248 needs to provide more text before a successful parse.
1250 Add new grammar rules after the INTERACTIVE_PARSER token is seen
1251 to drive the evaluation with a custom wrapper.
1253 * driver.cs: Add support for --shell, and refactor some code to be
1256 * namespace.cs: Add support for serializing the contents of the
1257 namespaces and reloading them.
1259 * getline.cs: A managed implementation of ReadLine under
1260 X11/Apache2 license terms. Easy to embed in other applications as
1263 * namespace.cs: Add some functions to save and restore the
1266 * rootcontext.cs: New public field.
1268 * cs-tokenizer.cs: Add support for one of the possible characters
1269 we introduce into the token stream.
1271 This patch does not affect the regular tokenization process, the
1272 only performance hit would happen if there is an invalid character
1273 on the input string.
1275 * support.cs: Move isatty helper routine here.
1277 * codegen.cs: Small cleanup, and add a mechanism to initialize the
1278 code generator for in-memory assemblies.
1280 2008-08-26 Marek Safar <marek.safar@gmail.com>
1282 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
1283 parameter cannot be always used as a type.
1285 2008-08-21 Marek Safar <marek.safar@gmail.com>
1287 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
1289 2008-08-21 Marek Safar <marek.safar@gmail.com>
1291 * convert.cs: Implement explicit array to IList<T> conversion.
1293 2008-08-20 Marek Safar <marek.safar@gmail.com>
1295 A fix for bug #362740
1296 * cs-tokenizer.cs: Handle UTF-16 surrogates.
1298 2008-08-20 Marek Safar <marek.safar@gmail.com>
1300 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
1301 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
1302 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
1303 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
1304 handling to use just one type of infrastructure and deal with generics
1307 2008-07-23 Martin Baulig <martin@ximian.com>
1309 *** Merged this from trunk revision 108527 ***
1312 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
1313 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
1316 2008-08-15 Marek Safar <marek.safar@gmail.com>
1318 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
1321 2008-08-15 Marek Safar <marek.safar@gmail.com>
1323 * delegate.cs: Fixed compiler crash when creating delegate using partial
1326 * typemanager.cs: MulticastDelegate is not a delegate.
1328 2008-08-14 Marek Safar <marek.safar@gmail.com>
1330 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
1333 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
1335 * cs-parser.jay (type): Allow 'var' in mcs too.
1336 (local_variable_type): Likewise.
1338 2008-08-14 Marek Safar <marek.safar@gmail.com>
1340 * driver.cs: Removed broken -noconfig variants.
1342 2008-08-14 Marek Safar <marek.safar@gmail.com>
1344 A fix for bug #417078
1345 * expression.cs: Emit correctly left side pointer operators.
1347 2008-08-13 Marek Safar <marek.safar@gmail.com>
1349 * generic.cs, lambda.cs: Inflate method generic arguments only.
1351 2008-08-12 Marek Safar <marek.safar@gmail.com>
1353 * class.cs: Fixed struct layout check regression.
1355 2008-08-12 Marek Safar <marek.safar@gmail.com>
1357 * cs-parser.jay, enum.cs: Simplified enum parsing.
1359 * decl.cs: Check all type parameters conflicts.
1361 * expression.cs, statement.cs, attribute.cs: More expression checks.
1363 2008-08-11 Marek Safar <marek.safar@gmail.com>
1365 * generic.cs: Add type inference types restriction.
1367 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
1368 anonymous.cs, expression.cs: Allocate less accessor parameters.
1370 2008-08-08 Marek Safar <marek.safar@gmail.com>
1372 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
1375 2008-08-08 Marek Safar <marek.safar@gmail.com>
1377 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
1379 2008-08-07 Marek Safar <marek.safar@gmail.com>
1381 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
1382 Also fixes #362146 and #381592.
1384 2008-08-07 Marek Safar <marek.safar@gmail.com>
1386 * ecore.cs: Reduced constant cannot be used as an attribute value.
1388 * cs-parser.jay: Base expression has to be a type.
1390 * expression.cs (Conditional): Uses ReducedExpression.
1392 2008-08-06 Marek Safar <marek.safar@gmail.com>
1394 A fix for bug #376826
1395 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
1396 address of hoisted local variable or parameter cannot be taken.
1398 2008-08-05 Marek Safar <marek.safar@gmail.com>
1400 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
1401 anonymous method inside checked/unchecked expression.
1403 2008-08-05 Marek Safar <marek.safar@gmail.com>
1405 * typemanager.cs (IsEqual): Guard against null.
1407 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
1408 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
1409 routine. Fixed few misleading conversion errors.
1411 2008-08-04 Marek Safar <marek.safar@gmail.com>
1413 * class.cs: Consider generics when checking cycles in struct layout.
1415 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
1417 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
1419 2008-08-04 Marek Safar <marek.safar@gmail.com>
1421 A fix for bug #414165
1422 * anonymous.cs: Use same anonymous implementation method for all anonymous
1425 2008-08-04 Marek Safar <marek.safar@gmail.com>
1427 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
1430 2008-08-04 Marek Safar <marek.safar@gmail.com>
1432 * cs-parser.jay: Typeof argument has to be a type expression.
1434 * namespace.cs: Check alias and namespace definitions collisions.
1436 * class.cs, pending.cs: Moved explicit interface accessor implementation
1439 * delegate.cs, expression.cs: Verify special name invocations.
1441 2008-08-01 Marek Safar <marek.safar@gmail.com>
1443 * cs-parser.jay: Don't choke on empty generic type arguments.
1445 * cs-tokenizer.cs: Handle escaped preprocessor directives.
1447 * expression.cs, ecore.cs: Minor expressions bugs.
1449 2008-08-01 Marek Safar <marek.safar@gmail.com>
1451 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
1452 and added more error handling.
1454 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
1456 * modifiers.cs, enum.cs: Fixed.
1458 2008-07-31 Jb Evain <jbevain@novell.com>
1460 * driver.cs: remove -pkg ability of smcs.
1462 2008-07-30 Marek Safar <marek.safar@gmail.com>
1464 * statement.cs (Switch): Correctly set empty default target for single
1467 2008-07-30 Marek Safar <marek.safar@gmail.com>
1469 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
1470 string switch statement implementation to use string dictionary which
1471 significantly (2-8x) improves performance of generated code.
1473 2008-07-29 Marek Safar <marek.safar@gmail.com>
1475 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
1476 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
1478 2008-07-29 Marek Safar <marek.safar@gmail.com>
1480 A fix for bug #412595
1481 * typemanager.cs, convert.cs, expression.cs: Some types are never
1482 convertible to each other.
1484 2008-07-29 Marek Safar <marek.safar@gmail.com>
1486 * nullable.cs (CreateNullConstant): An error messages update.
1488 2008-07-29 Marek Safar <marek.safar@gmail.com>
1490 A fix for bug #412595
1491 * cfold.cs: Don't cast undefined bool constant.
1493 2008-07-29 Martin Baulig <martin@ximian.com>
1496 (SymbolWriter.Reset): New public static method.
1499 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
1501 2008-07-28 Marek Safar <marek.safar@gmail.com>
1503 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
1505 * expression.cs (ElementAccess): Exact size allocation.
1507 2008-07-26 Marek Safar <marek.safar@gmail.com>
1509 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
1511 2008-07-25 Marek Safar <marek.safar@gmail.com>
1513 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
1515 * class.cs: Removed $PRIVATE$ field hack which caused problems during
1518 2008-07-25 Marek Safar <marek.safar@gmail.com>
1520 A fix for bug #412217
1521 * assign.cs: Mutate also assignment type.
1523 2008-07-25 Marek Safar <marek.safar@gmail.com>
1525 A fix for bug #323644
1526 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
1529 2008-07-25 Marek Safar <marek.safar@gmail.com>
1531 A fix for bug #412134
1532 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
1533 non-enumerable operands when overloading equality or bitwise operators.
1535 2008-07-25 Marek Safar <marek.safar@gmail.com>
1537 * anonymous.cs: Cache closed generic anonymous method delegates.
1539 2008-07-24 Marek Safar <marek.safar@gmail.com>
1541 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
1542 anonymous.cs, statement.cs: Always emit anonymous method as static method
1543 when is instance free. Use nesting for nested anynomous methods blocks.
1545 2008-07-23 Marek Safar <marek.safar@gmail.com>
1547 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
1550 2008-07-23 Marek Safar <marek.safar@gmail.com>
1552 * expression.cs: Removed MakeSimpleCall.
1554 2008-07-23 Marek Safar <marek.safar@gmail.com>
1556 A fix for bug #323012
1557 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
1558 Base method implementing interface has to be public.
1560 2008-07-23 Marek Safar <marek.safar@gmail.com>
1562 * cs-parser.jay: Don't break on missing argument.
1564 2008-07-22 Marek Safar <marek.safar@gmail.com>
1566 A fix for bug #320993
1567 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
1568 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
1570 2008-07-22 Marek Safar <marek.safar@gmail.com>
1572 A fix for bug #320748
1573 * convert.cs: Implicit user operators cannot convert to interfaces
1575 2008-07-22 Marek Safar <marek.safar@gmail.com>
1577 A fix for bug #312686
1578 * driver.cs: Ignore empty assembly references.
1580 2008-07-22 Marek Safar <marek.safar@gmail.com>
1582 A fix for bug #387040
1583 * ecore.cs: Skip constrains check for an explicit implementation.
1585 2008-07-21 Marek Safar <marek.safar@gmail.com>
1587 A fix for bug #409045
1588 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
1589 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
1590 identifiers are file specific unless passed as input arguments.
1592 2008-07-21 Marek Safar <marek.safar@gmail.com>
1594 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
1595 to emit UnmanagedMarshal data under 2.0 profile.
1597 2008-07-21 Marek Safar <marek.safar@gmail.com>
1599 A fix for bug #410369
1600 * parameter.cs: Clone correctly ParamsParameter.
1602 2008-07-21 Marek Safar <marek.safar@gmail.com>
1604 * expression.cs (Argument): Always report type for type based expressions
1607 2008-07-18 Marek Safar <marek.safar@gmail.com>
1609 A fix for bug #410666
1610 * anonymous.cs: Correctly initialize generic storey reference.
1612 2008-07-18 Marek Safar <marek.safar@gmail.com>
1614 * convert.cs: Don't box same type arguments.
1616 2008-07-18 Marek Safar <marek.safar@gmail.com>
1618 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
1619 Finished missing generic type mutators.
1621 2008-07-18 Marek Safar <marek.safar@gmail.com>
1623 * iterators.cs, statement.cs: Finished statements CloneTo.
1625 2008-07-18 Marek Safar <marek.safar@gmail.com>
1627 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
1629 * expression.cs: Emit optimized default value expressions in expression tree
1632 2008-07-18 Marek Safar <marek.safar@gmail.com>
1634 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
1636 2008-07-17 Marek Safar <marek.safar@gmail.com>
1638 A fix for bug #367536
1639 * cs-parser.jay: Check static constructor of generic types for an access
1642 2008-07-17 Marek Safar <marek.safar@gmail.com>
1644 A fix for bug #353800
1645 * lambda.cs: Emit ret for contextual statements.
1647 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
1648 up emitting redundant ret for all anonymous methods with return.
1650 2008-07-17 Marek Safar <marek.safar@gmail.com>
1652 A fix for bug #365188
1653 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
1654 create anonymous method storey in unreachable block.
1656 2008-07-17 Marek Safar <marek.safar@gmail.com>
1658 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
1659 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
1660 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
1661 statement.cs: Fixed relevant defects found by Gendarme.
1663 2008-07-17 Marek Safar <marek.safar@gmail.com>
1665 A fix for bug #325291
1666 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
1667 statement.cs: Replaced IAnonymousHost with top level block flag.
1669 2008-07-17 Marek Safar <marek.safar@gmail.com>
1671 * cs-parser.jay: Clean up unused open_parens.
1673 2008-07-17 Marek Safar <marek.safar@gmail.com>
1675 * ecore.cs: Custom error message for a range variable assignment.
1677 2008-07-16 Marek Safar <marek.safar@gmail.com>
1679 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
1682 2008-07-16 Marek Safar <marek.safar@gmail.com>
1684 * literal.cs: Null literal is of object type.
1686 2008-07-16 Marek Safar <marek.safar@gmail.com>
1688 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
1689 expression of nullable equality comparison.
1691 2008-07-15 Marek Safar <marek.safar@gmail.com>
1693 * expression.cs(PointerArithmetic): Removed redundant assignment.
1695 2008-07-15 Marek Safar <marek.safar@gmail.com>
1697 * decl.cs (GetSignatureForError): Report full namespace name for containers.
1699 2008-07-14 Marek Safar <marek.safar@gmail.com>
1701 A fix for bug #408361
1702 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
1703 they are replaced by GetMethod.
1705 2008-07-14 Marek Safar <marek.safar@gmail.com>
1707 A fix for bug #408721 by jeremie.laval@gmail.com
1708 * expression.cs (Indirection): Implemented CloneTo.
1710 2008-07-14 Marek Safar <marek.safar@gmail.com>
1712 * statement.cs (AssignableSlots): Temporary disabled variable initialization
1715 2008-07-14 Marek Safar <marek.safar@gmail.com>
1717 * report.cs (EnableReporting): Don't reinitialize 0-based values.
1719 2008-07-11 Marek Safar <marek.safar@gmail.com>
1721 * linq.cs: Reset tranparent parameter counter in probing mode.
1723 2008-07-11 Marek Safar <marek.safar@gmail.com>
1725 * anonymous.cs: Mutate anonymous method type.
1727 2008-07-11 Marek Safar <marek.safar@gmail.com>
1729 * ecore.cs, anonymous.cs: Mutate field expressions.
1731 2008-07-10 Marek Safar <marek.safar@gmail.com>
1733 A fix for bug #369670
1734 * linq.cs, statement.cs: Use explicit block for query expressions variables.
1736 2008-07-10 Marek Safar <marek.safar@gmail.com>
1738 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
1740 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
1743 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
1744 only one '>', and finds a '>>', abort the generic lookahead.
1746 2008-07-10 Marek Safar <marek.safar@gmail.com>
1748 A fix for bug #319902
1749 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
1751 2008-07-10 Marek Safar <marek.safar@gmail.com>
1753 A fix for bug #406371
1754 * statement.cs: Moved EmitSymbolInfo to Block.
1756 2008-07-09 Marek Safar <marek.safar@gmail.com>
1758 * ecore.cs: Report better error for extension method overload failures.
1760 2008-07-09 Marek Safar <marek.safar@gmail.com>
1762 * expression.cs (Is): No need to box reference values.
1764 2008-07-09 Marek Safar <marek.safar@gmail.com>
1766 * class.cs: Use event resolve context when initializing CreateEmitContext.
1768 2008-07-09 Marek Safar <marek.safar@gmail.com>
1770 A fix for bug #394436
1771 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
1772 method used inside expression trees. Added more LINQ to expression tree
1775 2008-07-08 Marek Safar <marek.safar@gmail.com>
1777 A fix for bug #378189, #370577
1778 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
1781 2008-07-08 Marek Safar <marek.safar@gmail.com>
1783 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
1786 2008-07-08 Marek Safar <marek.safar@gmail.com>
1788 A fix for bug #406702
1789 * anonymous.cs: Always park anonymous method in the nearest parent storey.
1791 2008-07-07 Marek Safar <marek.safar@gmail.com>
1793 A fix for bug #406648
1794 * cs-parser.jay: Report nullable use in mcs for some cases.
1796 2008-07-07 Marek Safar <marek.safar@gmail.com>
1798 * ecore.cs: Improved argument mismatch error messages.
1800 2008-07-07 Marek Safar <marek.safar@gmail.com>
1802 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
1804 2008-07-07 Marek Safar <marek.safar@gmail.com>
1806 * expression.cs (TypeOf): Mutate type argument.
1808 2008-07-04 Marek Safar <marek.safar@gmail.com>
1810 * class.cs: Report missing partial modifier for correct type.
1812 2008-07-04 Marek Safar <marek.safar@gmail.com>
1814 * ecore.cs, expression.cs (VariableReference): Variable property is
1817 2008-07-04 Marek Safar <marek.safar@gmail.com>
1819 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
1821 2008-07-04 Marek Safar <marek.safar@gmail.com>
1823 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
1826 2008-07-04 Marek Safar <marek.safar@gmail.com>
1828 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
1829 anonymous method storey to an instance method when only "this" is hoisted.
1831 2008-07-03 Marek Safar <marek.safar@gmail.com>
1833 A fix for bug #321615
1834 * expression.cs: Pointer comparisons use unsigned operator.
1836 2008-07-03 Marek Safar <marek.safar@gmail.com>
1838 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
1840 2008-07-02 Marek Safar <marek.safar@gmail.com>
1842 A fix for bug #404905
1843 * class.cs: Always initialize local unsafe variables.
1845 2008-06-30 Marek Safar <marek.safar@gmail.com>
1847 A fix for bug #396987
1848 * expression.cs (NewInitialize): Clear local temporary variable for next run
1850 2008-06-27 Marek Safar <marek.safar@gmail.com>
1852 A fix for bug #401020
1853 * ecore.cs: Both types and modifiers have to match for ref and out arguments
1855 2008-06-27 Marek Safar <marek.safar@gmail.com>
1857 A fix for bug #398319
1858 * cs-parser.jay: Implemented undocumented base access expression inside
1861 2008-06-26 Marek Safar <marek.safar@gmail.com>
1863 A fix for bug #404227
1864 * cs-parser.jay: Parse namespace declaration using qualified identifier.
1866 2008-06-26 Marek Safar <marek.safar@gmail.com>
1868 A fix for bug #404227
1869 * convert.cs: Fixed explicit array to interface cast.
1871 2008-06-26 Marek Safar <marek.safar@gmail.com>
1873 A fix for bug #403894
1874 * delegate.cs: Mutate DelegateInvocation type.
1876 2008-06-26 Marek Safar <marek.safar@gmail.com>
1878 A fix for bug #379348
1879 * delegate.cs: Box a load of generic parameters.
1881 2008-06-26 Marek Safar <marek.safar@gmail.com>
1883 * expression.cs: Add an array creation arguments mutate.
1885 2008-06-26 Marek Safar <marek.safar@gmail.com>
1887 A fix for bug #386068
1888 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
1891 2008-06-25 Marek Safar <marek.safar@gmail.com>
1893 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
1896 2008-06-25 Marek Safar <marek.safar@gmail.com>
1898 A fix for bug #403518
1899 * delegate.cs: Type correctly anonymous method new invocation.
1901 2008-06-24 Marek Safar <marek.safar@gmail.com>
1903 A fix for bug #394826
1904 * anonymous.cs: Fully qualify members when resolving anonymous type internal
1907 2008-06-24 Marek Safar <marek.safar@gmail.com>
1909 A fix for bug #394826
1910 * anonymous.cs, iterators.cs: Construct generic storey only when is really
1913 2008-06-24 Marek Safar <marek.safar@gmail.com>
1915 * class.cs: Clone indexer parameters for localized capturing.
1917 2008-06-24 Marek Safar <marek.safar@gmail.com>
1919 A fix for bug #402379
1920 * expression.cs: Don't crash when an object initializer resolve fails.
1922 2008-06-24 Marek Safar <marek.safar@gmail.com>
1924 A fix for bug #402888
1925 * expression.cs: Mutate conditional expression.
1927 2008-06-24 Marek Safar <marek.safar@gmail.com>
1929 A fix for bug #401012
1930 * class.cs: Keep StructLayout in shared container.
1932 2008-06-24 Marek Safar <marek.safar@gmail.com>
1934 A fix for bug #400438
1935 * decl.cs, class.cs: Only properties can be automatically implemented.
1937 2008-06-24 Marek Safar <marek.safar@gmail.com>
1939 * statement.cs (ChangeToIterator): Copy also labels.
1941 2008-06-23 Marek Safar <marek.safar@gmail.com>
1943 * ecore.cs: Pass type argument details to parent extension method.
1945 2008-06-23 Marek Safar <marek.safar@gmail.com>
1947 A fix for bug #375966
1948 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
1950 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
1952 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
1954 2008-06-22 Marek Safar <marek.safar@gmail.com>
1956 A fix for bug #394347
1957 * anonymous.cs: Cache compatible delegates as compatibility check produces
1958 a new method every time.
1960 2008-06-20 Marek Safar <marek.safar@gmail.com>
1962 * anonymous.cs: Propagate storey reference for single references.
1964 2008-06-20 Marek Safar <marek.safar@gmail.com>
1966 A fix for bug #387615
1967 * assign.cs, expression.cs: Correctly clone compound assignment.
1969 2008-06-19 Marek Safar <marek.safar@gmail.com>
1971 A fix for bug #359611, #359604
1972 * anonymous.cs: Mutate all types of hoisted parameters.
1974 2008-06-19 Marek Safar <marek.safar@gmail.com>
1976 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
1977 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
1978 expression.cs, codegen.cs, statement.cs
1980 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
1981 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
1983 ** Anonymous methods, lambda expressions rewrite **
1985 Anonymous expressions are now resolved when an explicit block is resolved
1986 and they don't require any registration procedure anymore. Further,
1987 anonymous methods are defined when explicit block is emitted which allows
1988 better control of whole process and opens possibilities for more
1989 optimizations as well as alternative to reverse whole process.
1991 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
1992 process consistent and to correctly emit hoisted generic methods when they
1993 have at least 1 hoisted variable.
1995 2008-06-17 Martin Baulig <martin@ximian.com>
1997 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
1999 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
2000 virtual property; check it in Emit().
2001 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
2003 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
2005 (Indexer.Define): Likewise.
2007 2008-06-17 Marek Safar <marek.safar@gmail.com>
2009 * convert.cs: Don't use IsInterface on type arguments.
2011 * delegate.cs: DelegateInvocation uses MethodInfo.
2013 * parameter.cs: Removed IsTypeParameter.
2015 * generic-mcs.cs: More missing stuff.
2017 2008-06-16 Martin Baulig <martin@ximian.com>
2020 (Modifiers.DEBUGGER_HIDDEN): New public const.
2023 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
2026 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
2027 (AbstractPropertyEventMethod): Likewise.
2028 (Constructor.Emit): Likewise.
2029 (SourceMethod.SetCompilerGenerated): Removed.
2031 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
2035 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
2036 if we're an `IteratorHost'.
2037 (AnonymousMethodMethod..ctor): Don't set
2038 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
2041 2008-06-16 Marek Safar <marek.safar@gmail.com>
2043 * statement.cs: Clean-up foreach statements.
2045 2008-06-12 Marek Safar <marek.safar@gmail.com>
2047 * class.cs: Stop using public method which should not exist
2048 (MethodBuilder.SetGenericMethodSignature).
2050 2008-06-11 Martin Baulig <martin@ximian.com>
2053 (Location.LookupFile): Add `CompilationUnit' argument; when given
2054 a relative file name, make it relative to the directory the .cs
2055 file is located in instead of using the current directory.
2057 2008-06-11 Martin Baulig <martin@ximian.com>
2060 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
2061 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
2062 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
2063 (SourceMethod.SetCompilerGenerated): Likewise.
2065 2008-06-11 Marek Safar <marek.safar@gmail.com>
2067 * codegen.cs, driver: Only write symbol file when it's asked for.
2069 2008-06-11 Marek Safar <marek.safar@gmail.com>
2071 * codegen.cs: Don't use assembly writer error handling for symbol writer.
2073 2008-06-10 Martin Baulig <martin@ximian.com>
2075 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
2077 2008-06-09 Marek Safar <marek.safar@gmail.com>
2079 A fix for bug #316290
2080 * expression.cs: Include decimal operators in predefined table.
2082 * parameters.cs: More readonlyness.
2084 2008-06-09 Marek Safar <marek.safar@gmail.com>
2086 A fix for bug #397213
2087 * cs-parser.jay: One more missing current_local_parameters reset.
2089 2008-06-09 Marek Safar <marek.safar@gmail.com>
2091 A fix for bug #396633
2092 * class.cs: Host backing field in partial container.
2094 2008-06-09 Marek Safar <marek.safar@gmail.com>
2096 A fix for bug #397068
2097 * expression.cs: Check both operand types when predefined operator is used.
2099 2008-06-05 Martin Baulig <martin@ximian.com>
2101 Merged the `debugger-kahalo' branch.
2104 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
2105 we're an iterator method.
2106 (SourceMethod): Reflect latest symbol writer changes;
2107 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
2108 now `start_row' and `end_row'.
2109 (Constructor.Emit): Fix the logic whether to emit symbol information.
2111 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
2115 (CompilationUnit): New public class; derives from `SourceFile'.
2116 (SourceFileEntry.DefineSymbolInfo): New public method.
2117 (SourceFileEntry.SetChecksum): New public method.
2118 (Location): Encode hidden line numbers by using `column == 255';
2119 the .ctor now accepts `column == -1' to mark a hidden line number.
2120 (Location.Hidden): New public property.
2121 (Location.CheckPoint): Add `CompilationUnit'.
2122 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
2123 (Location.Push): Add `CompilationUnit compile_unit' argument.
2124 (Location.CompilationUnit): New public property.
2127 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
2129 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
2131 * driver.cs: `SourceFile' -> `CompilationUnit'.
2133 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
2135 * namespace.cs: `SourceFile' -> `CompilationUnit'.
2137 * cs-tokenizer.cs: Add support for `#pragma checksum' and
2141 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
2142 new symbol writer API to also pass the file.
2144 2008-06-05 Marek Safar <marek.safar@gmail.com>
2146 * statement.cs: Emit catch variable assignment using variable expression.
2148 2008-06-05 Marek Safar <marek.safar@gmail.com>
2150 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
2151 with other variable types.
2153 2008-06-04 Marek Safar <marek.safar@gmail.com>
2155 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
2156 GetLength method emit, it breaks resolve rules.
2158 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
2159 Marek Safar <marek.safar@gmail.com>
2161 A fix for bug #395542
2162 * cs-parser.jay: The trailing comma is allowed in anonymous type member
2165 2008-06-02 Marek Safar <marek.safar@gmail.com>
2167 A fix for bug #395287
2168 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
2170 2008-05-31 Marek Safar <marek.safar@gmail.com>
2172 A fix for bug #395845
2173 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
2174 non-nullable parameter type.
2176 2008-05-31 Marek Safar <marek.safar@gmail.com>
2178 * class.cs: Handle contructor initializer as a statement in top-level block.
2180 2008-05-30 Marek Safar <marek.safar@gmail.com>
2182 * attribute.cs: Don't mix old and new corlib types when emitting corlib
2183 security attributes.
2185 2008-05-24 Marek Safar <marek.safar@gmail.com>
2187 * ecore.cs, expression.cs: Small IVariable refactoring.
2189 2008-05-22 Marek Safar <marek.safar@gmail.com>
2191 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
2193 2008-05-21 Marek Safar <marek.safar@gmail.com>
2195 * cs-parser.jay: Removed redundant catch type check.
2197 2008-05-21 Marek Safar <marek.safar@gmail.com>
2199 A fix for bug #390372
2200 * nullable.cs: Set correct return type.
2202 2008-05-21 Marek Safar <marek.safar@gmail.com>
2204 A fix for bug #391062
2205 * typemanager.cs: Fixed crash when comparing null types.
2207 2008-05-21 Marek Safar <marek.safar@gmail.com>
2209 A fix for bug #391871
2210 * cs-parser.jay: Better error handling for invalid catch type.
2212 2008-05-20 Marek Safar <marek.safar@gmail.com>
2214 A fix for bug #392155
2215 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
2217 2008-05-15 Marek Safar <marek.safar@gmail.com>
2219 A fix for bug #390666
2220 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
2223 2008-05-15 Marek Safar <marek.safar@gmail.com>
2225 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
2228 2008-05-13 Marek Safar <marek.safar@gmail.com>
2230 A fix for bug #389625
2231 * delegate.cs, generic.cs: Some progress on method group return type
2234 2008-05-13 Marek Safar <marek.safar@gmail.com>
2236 A fix for bug #378419
2237 * namespace.cs: Inspect also parent namespaces not only namespace entries.
2239 2008-05-12 Marek Safar <marek.safar@gmail.com>
2241 * class.cs (Constructor): Added IsCompilerGenerated.
2243 2008-05-12 Marek Safar <marek.safar@gmail.com>
2245 * expression.cs: Enum binary operators can accept non-enum operand only when
2246 is implicitly convertible to underlying type.
2248 2008-05-12 Marek Safar <marek.safar@gmail.com>
2250 A fix for bug #389272
2251 * support.cs: Workaround System.InvalidOperationException for enums.
2253 2008-05-12 Marek Safar <marek.safar@gmail.com>
2255 A fix for bug #389073
2256 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
2258 2008-05-10 Marek Safar <marek.safar@gmail.com>
2260 * driver.cs: Split Parse.
2262 * location.cs (LookupFile): Uses string.Empty.
2264 2008-05-07 Marek Safar <marek.safar@gmail.com>
2266 * expression.cs, parameter.cs: Small ParameterReference clean up.
2268 2008-05-07 Marek Safar <marek.safar@gmail.com>
2270 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
2271 hack. Fixes #387502.
2273 2008-05-06 Martin Baulig <martin@ximian.com>
2275 * class.cs (Constructor.Emit): Fix the logic whether to emit
2278 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
2281 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
2282 InvalidOperationException when the iterator is before the start or
2285 2008-05-06 Marek Safar <marek.safar@gmail.com>
2287 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
2288 when left is nullable type.
2290 2008-05-06 Marek Safar <marek.safar@gmail.com>
2292 A fix for bug #386628
2293 * expression.cs (LocalVariableReference): Continue in resolving when
2294 variable is not assigned.
2296 2008-05-05 Marek Safar <marek.safar@gmail.com>
2298 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
2299 nullable operations.
2301 2008-05-04 Marek Safar <marek.safar@gmail.com>
2303 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
2304 it saves many redundant temporary variables for nullable operations.
2306 2008-05-03 Marek Safar <marek.safar@gmail.com>
2308 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
2310 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
2313 * nullable.cs: Constant coalescing operator optimizations.
2315 2008-05-03 Marek Safar <marek.safar@gmail.com>
2317 * constant.cs: Use unsigned conversion for values which are unsigned only.
2319 2008-05-03 Marek Safar <marek.safar@gmail.com>
2321 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
2322 coalescing operator as it should be.
2324 2008-05-02 Marek Safar <marek.safar@gmail.com>
2326 A fix for bug #371016
2327 * expression.cs: All predefined delegate operators require implicit method
2330 2008-05-02 Marek Safar <marek.safar@gmail.com>
2332 * constant.cs: Emit long constant as uint when fits the range.
2334 * convert.cs, expression.cs: Fixed few unsafe conversions.
2336 2008-05-02 Marek Safar <marek.safar@gmail.com>
2338 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
2340 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
2343 * convert.cs (ImplicitNumericConversion): Don't modify the type of
2345 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
2347 2008-05-01 Marek Safar <marek.safar@gmail.com>
2349 * constant.cs, literal.cs: IsLiteral property for error reporting.
2351 * ecore.cs, expression.cs: Implemented Property expression.
2353 2008-05-01 Marek Safar <marek.safar@gmail.com>
2355 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
2357 * nullable.cs: Implemented nullable coalescing null operator.
2359 * ecore.cs, expression.cs: Expression trees work.
2361 2008-05-01 Marek Safar <marek.safar@gmail.com>
2363 * ecore.cs: CreateExpressionTree is finally abstract.
2365 * expression.cs, linq.cs: Updated.
2367 2008-05-01 Marek Safar <marek.safar@gmail.com>
2369 * expression.cs, ecore.cs: Block base access expression inside expression
2372 2008-05-01 Marek Safar <marek.safar@gmail.com>
2374 A fix for bug #385058
2375 * expression.cs: User-defined operator implementations always take
2376 precedence over predefined operator implementations.
2378 2008-04-30 Marek Safar <marek.safar@gmail.com>
2380 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
2381 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
2382 expression tree conversions.
2384 2008-04-30 Marek Safar <marek.safar@gmail.com>
2386 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
2387 operators method details to Operator class.
2389 2008-04-30 Marek Safar <marek.safar@gmail.com>
2391 * anonymous.cs: Pass unsafe flags to anonymous container.
2393 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
2394 inside expression tree.
2396 2008-04-29 Martin Baulig <martin@ximian.com>
2398 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
2399 (Tokenizer.PopPosition): Also restore the `line'.
2401 2008-04-29 Marek Safar <marek.safar@gmail.com>
2403 * delegate.cs: Implemented Invoke expression.
2405 2008-04-29 Marek Safar <marek.safar@gmail.com>
2407 * expression.cs: Fixed equality reference comparison regression.
2409 2008-04-29 Marek Safar <marek.safar@gmail.com>
2411 * ecore.cs: Clean up EmptyCast hack.
2413 * expression.cs, nullable.cs: Implemented enum binary and unary operations
2414 using correct conversion rules. Also fixes #383993.
2416 2008-04-28 Martin Baulig <martin@ximian.com>
2418 * class.cs (Constructor.Emit): Don't emit debugging information
2419 for generated default .ctor's.
2421 2008-04-28 Marek Safar <marek.safar@gmail.com>
2423 * convert.cs: Empty-cast ushort to int conversion.
2425 2008-04-28 Marek Safar <marek.safar@gmail.com>
2427 A fix for bug #384191
2428 * ecore.cs, expression.cs: Fixed expression cloning.
2430 2008-04-28 Marek Safar <marek.safar@gmail.com>
2432 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
2434 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
2436 Fix #381559, test-638.cs, test-639.cs
2437 * assign.cs (CompoundAssign.Helper): New wrapper.
2438 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
2440 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
2441 Pass unconverted expressions to the params array creation expression.
2442 (FieldExpr.EmitAssign): Don't special-case StringConcat.
2443 (PropertyExpr.EmitAssign): Likewise.
2444 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
2445 element if it is of kind CompoundAssign.Helper.
2446 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
2447 first before anything else.
2448 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
2449 (ArrayAccess.LoadArrayAndArguments): Simplify.
2451 2008-04-27 Marek Safar <marek.safar@gmail.com>
2453 * expression.cs: Fixed cloning of typeof(void).
2455 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
2457 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
2458 (Assign.Emit): Likewise. Move it to ...
2459 (CompoundAssign.DoResolve): ... here and ...
2460 (CompoundAssign.Emit): ... here.
2461 (EventAddOrRemove): New helper to handle += and -= on events, and
2462 avoid the use of BinaryDelegates.
2463 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
2464 (EventExpr.EmitAddOrRemove): Improve.
2465 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
2467 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
2468 create VarExprs for 'foo.bar.var'.
2469 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
2470 is a highly inappropriate name for its functionality.
2472 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
2474 Simplify handling of multiple assignments
2475 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
2477 (SimpleAssign): New. Class to be used for normal assignments.
2478 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
2479 * expression.cs, parameter.cs, statement.cs: Likewise.
2481 2008-04-25 Marek Safar <marek.safar@gmail.com>
2483 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
2484 for incompatible underlying types, more to come, uff.
2486 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
2489 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
2490 Handle 'leave_copy'.
2492 2008-04-25 Marek Safar <marek.safar@gmail.com>
2494 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
2496 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
2498 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
2499 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
2500 * statement.cs (While, Do, For): Allow test to have side effects.
2501 (For.DoEmit): Always emit InitStatement.
2504 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
2505 Always create SideEffectConstant.
2506 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
2507 of type EnumConstant.
2509 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2510 Handle 'right' being SideEffectConstant of type 'bool'.
2512 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2513 Use left.EmitBranchable instead of open coding it, so as to
2514 improve optimization opportunities.
2516 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
2518 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
2520 (Expression.EmitSideEffect): Document.
2522 2008-04-23 Marek Safar <marek.safar@gmail.com>
2524 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
2526 2008-04-23 Marek Safar <marek.safar@gmail.com>
2528 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
2530 2008-04-23 Marek Safar <marek.safar@gmail.com>
2532 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
2533 conversion to expression tree.
2535 2008-04-23 Marek Safar <marek.safar@gmail.com>
2537 * ecore.cs: Removed unused expression.
2539 2008-04-22 Marek Safar <marek.safar@gmail.com>
2541 * expression.cs: Implemented NegateChecked and New expressions.
2543 2008-04-22 Marek Safar <marek.safar@gmail.com>
2545 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
2547 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
2550 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
2551 needing final 'ret' instruction.
2553 2008-04-22 Marek Safar <marek.safar@gmail.com>
2555 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
2557 2008-04-21 Marek Safar <marek.safar@gmail.com>
2559 * expression.cs: Emit ldnull and not null expression as an instance argument
2560 of static method expression calls.
2562 2008-04-21 Marek Safar <marek.safar@gmail.com>
2564 A fix for bug #378200
2565 * expression.cs: Fixed crash when creating parameterless expression tree
2568 2008-04-21 Marek Safar <marek.safar@gmail.com>
2570 A fix for bug #375297
2571 * anonymous.cs: Fixed crash when inferring from null argument anonymous
2574 2008-04-21 Marek Safar <marek.safar@gmail.com>
2576 A fix for bug #377596
2577 * decl.cs, class.cs: Emit delegate type argument attributes.
2579 2008-04-21 Marek Safar <marek.safar@gmail.com>
2581 A fix for bug #365314
2582 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
2584 2008-04-21 Marek Safar <marek.safar@gmail.com>
2586 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
2589 2008-04-21 Marek Safar <marek.safar@gmail.com>
2591 * generic.cs (TypeParameter): Removed redundant location.
2593 2008-04-19 Marek Safar <marek.safar@gmail.com>
2595 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
2596 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
2597 FullNamedExpression in all declaration type expression, statements will come
2600 2008-04-18 Marek Safar <marek.safar@gmail.com>
2602 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
2603 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
2605 2008-04-18 Marek Safar <marek.safar@gmail.com>
2607 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
2610 2008-04-17 Marek Safar <marek.safar@gmail.com>
2612 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
2615 2008-04-17 Marek Safar <marek.safar@gmail.com>
2617 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
2621 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
2623 Hook up 'EmitSideEffect'
2624 * constant.cs (Constant.EmitSideEffect): New.
2625 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
2626 (SideEffectConstant.EmitSideEffect): New.
2627 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
2628 unconditional branch in EmitBranchable.
2629 (FieldExpr.EmitBranchable): New.
2630 * expression.cs (Unary.EmitSideEffect): New.
2631 (Binary.EmitSideEffect): New.
2632 (VariableReference.EmitSideEffect): New. Do nothing.
2634 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
2636 Introduce 'EmitSideEffect'
2637 * ecore.cs (Expression.EmitSideEffect): New.
2638 (TypeCast): Rename from EmptyCast.
2640 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
2641 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
2642 * convert.cs, nullable.cs: Update to changes.
2644 2008-04-16 Marek Safar <marek.safar@gmail.com>
2646 * class.cs, cs-parser.jay: Early check for base types expression.
2648 2008-04-16 Marek Safar <marek.safar@gmail.com>
2650 * decl.cs (MemberName): Declare PrettyName as obsolete.
2652 2008-04-16 Marek Safar <marek.safar@gmail.com>
2654 * namespace.cs: Use MemberName comparison.
2656 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
2659 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
2661 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
2662 (MemberName.FullyQualifiedName): New. Provides the functionality
2663 that users assume FullName would have.
2664 * ecore.cs, namespace.cs: Update to changes.
2666 * statement.cs (Using.assign): Make into ExpressionStatement.
2667 (Using.EmitPreTryBody): Simplify.
2669 2008-04-16 Marek Safar <marek.safar@gmail.com>
2671 * report.cs: ColorFormat is protected.
2673 * rootcontext.cs: Unused fields clean-up.
2675 * namespace.cs: Made UsingEntry name private.
2677 2008-04-16 Marek Safar <marek.safar@gmail.com>
2679 * cs-tokenizer.cs, location.cs: Removed unused field.
2681 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
2682 Raja R Harinath <harinath@hurrynot.org>
2685 * constant.cs (SideEffectConstant.value): Rename from 'left'.
2686 (SideEffectConstant.side_effect): Rename from 'right'.
2687 (SideEffectConstant..ctor): Normalize 'side_effect'.
2688 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
2689 value of this constant.
2690 * cfold.cs: Update to changes.
2692 2008-04-15 Marek Safar <marek.safar@gmail.com>
2694 * cs-paser.jay: Removed unused variable.
2696 * driver.cs: Made Compile instance method.
2698 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
2700 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
2702 2008-04-15 Marek Safar <marek.safar@gmail.com>
2704 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
2706 2008-04-13 Jb Evain <jbevain@novell.com>
2708 * namespace.cs: update the System.Core fullname for 2.1
2709 * driver.cs: update the list of required assemblies for 2.1.
2710 Merged from the Moonlight 2 branch.
2712 2008-04-11 Marek Safar <marek.safar@gmail.com>
2714 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
2715 types and user defined operators. User operators arguments has to be checked
2716 for null value before invocation, which also means no operator is called
2717 when any argument is not convertible to unwrapped nullable type.
2719 2008-04-09 Marek Safar <marek.safar@gmail.com>
2721 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
2722 of Unary expressions to follow operator overloading rules precisely.
2723 Also fixes #321794, #323794
2725 2008-04-08 Marek Safar <marek.safar@gmail.com>
2727 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
2730 2008-04-08 Marek Safar <marek.safar@gmail.com>
2732 * expression.cs, ecore.cs: Implemented MemberInit expression.
2734 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
2736 Fix mono/tests/exception4.cs
2737 * statement.cs (ExceptionStatement, TryCatch): Revert to using
2738 ec.NeedReturnLabel () rather emitting a 'nop'.
2740 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
2742 (TryCatch.SomeCodeFollows): Likewise.
2743 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
2744 for 'break', 'continue' and 'return' statements inside a try.
2745 We're fairly sure that the generated IL stream will have more
2746 instructions textually following the try.
2747 (FlowBranchingTryCatch): Likewise.
2749 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
2750 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
2753 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
2754 wrapper -- forward everything to CollectionForeach.
2755 (CollectionForeach.NonDisposableWrapper): New.
2756 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
2757 instead of a pop + branch to end.
2759 2008-04-07 Marek Safar <marek.safar@gmail.com>
2761 A fix for bug #377485
2762 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
2763 Propagate location for extension method groups. Report conversion failure at
2766 2008-04-07 Marek Safar <marek.safar@gmail.com>
2768 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
2769 ListInit and Field expressions.
2771 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
2773 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
2774 Since $PC is always -1 inside the body of MoveNext, the fault
2776 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
2777 * statement.cs (ExceptionStatement.emit_finally): Likewise.
2778 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
2780 The denouement! Fix #324708
2781 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
2782 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
2783 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
2784 'finally' inside the finally clause.
2786 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
2787 inside an iterator. Don't emit the body of the 'finally' inside
2788 the finally clause yet.
2790 Use the ResumableStatement infrastructure for MoveNext ()
2791 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
2792 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
2793 'old_resume_points'. Move dispatcher upfront.
2794 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
2795 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
2796 in an enumerator. This encodes the main fix in this patch series
2797 -- we can only jump into the first instruction of a try from the
2798 outside, but we want to emit try/finally regions in iterators and
2799 resume in the middle of them.
2801 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
2803 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
2804 of NeedReturnLabel here.
2806 Introduce a common point for emitting try/finally to IL
2807 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
2808 features of the various subclasses, which are now driven by ...
2809 (ExceptionStatement.EmitPreTryBody): ... this and ...
2810 (ExceptionStatement.EmitTryBody): ... this and the original
2812 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
2813 Remove DoEmit and update to follow above protocol.
2815 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
2816 of the dispatcher are the same, skip emitting the 'switch'.
2817 * iterator.cs (Iterator.EmitDispose): Update to changes.
2819 Clean up handling of 'using' statement
2820 * statement.cs (UsingTemporary): New. Carved out of ...
2821 (Using): ... this. Simplify drastically. Handle exactly
2823 * cs-parser.jay (using_statement): Split. Create UsingTemporary
2824 or Using as appropriate. If there are multiple variable declared,
2825 create nested Using statements.
2826 (resource_acquisition): Kill.
2828 * statement.cs (ExceptionStatement.EmitForDispose): Use
2829 EmitFinallyBody, not EmitFinally.
2831 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
2832 * iterator.cs: Update to changes.
2834 Start using the ResumableStatement infrastructure
2835 * statement.cs (ResumeableStatement.PrepareForDispose): New.
2836 (ResumableStatement.EmitForDispose): New.
2837 (ExceptionStatement): Override them.
2838 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
2839 EmitForDispose to create the body of the Dispose method. Don't
2842 * iterator.cs (Iterator.AddResumePoint): Move here from ...
2843 * statement.cs (Toplevel.AddResumePoint): ... here.
2844 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
2845 * flowanalysis.cs (FlowBranchingIterator): New.
2846 * codegen.cs (EmitContext): Update to changes.
2848 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
2849 (Iterator.old_resume_points): Rename from 'resume_points'.
2850 (Iterator.MoveNextStatement): Remove unused class.
2852 New infrastructure for try/finally in iterators (still unused)
2853 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
2854 (FlowBranchingToplevel.AddResumePoint): Hook into
2855 ToplevelBlock.AddResumePoint.
2856 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
2857 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
2858 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
2859 resume points and assign program-counter values.
2860 (ExceptionBlock.AddResumePoint): Collect resume points for
2861 de-muxer at the top of try block.
2862 * iterators.cs (Yield.CheckContext): Simplify.
2863 (Yield.Resolve): Use FlowBranching.AddResumePoint.
2865 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
2867 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
2868 argument to an ExitStatement.
2869 (FlowBranchingException): Refactor saved origins code.
2870 * statement.cs (ExitStatement): Update to cahges.
2871 * iterator.cs (YieldBreak): Likewise.
2873 * statement.cs (ResumableStatement): New. Common base class for
2874 YieldReturn and ExceptionStatement.
2875 (ExitStatement): New. Common base class for Return and YieldBreak.
2876 (Return): Update to changes.
2877 * iterator.cs (YieldBreak): Likewise.
2878 * lambda.cs (ContextualReturn): Likewise.
2881 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
2882 emit a meaningful error message.
2884 Fix #324765, #319508
2885 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
2886 (VariableInfo.SetAssigned): Set it.
2887 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
2888 determine if CS0219 or CS0168 is appropriate. Don't use
2889 flow-analysis information.
2890 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
2891 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
2892 (EmitContext.EndFlowBranching): ... this.
2894 2008-04-03 Marek Safar <marek.safar@gmail.com>
2896 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
2898 2008-04-03 Marek Safar <marek.safar@gmail.com>
2900 A fix for bug #376508
2901 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
2902 ImplicitConversionExists.
2904 2008-04-03 Marek Safar <marek.safar@gmail.com>
2906 * expression.cs (Binary): Added remaining binary operators to expression
2909 * nullable.cs: Optimize shift with null argument.
2911 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
2913 Fix minor IL regression
2914 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
2915 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
2916 * cs-parser.jay (try_statement): Update to changes.
2918 * statement.cs (TryFinally.need_exc_block): Delete.
2919 (TryFinally): Update to changes.
2921 Now all ExceptionStatements are unconditional
2922 * statement.cs (CollectionForeach.DisposableWrapper): New.
2923 Extract out the try/finally code into a new wrapper.
2924 (CollectionForeach.Resolve): Use it to simplify the code.
2926 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
2928 Start at simplifying ExceptionStatement semantics a bit
2929 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
2930 * cs-parser.jay (try_statement): Update to changes.
2931 (opt_catch_clauses): Remove.
2932 * flowanalysis.cs: Update to changes.
2933 (FlowBranching.BranchingType.TryCatch): New.
2934 (FlowBranchingTryCatch): New.
2936 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
2937 (FlowBranching.CreateBranching): Update to changes.
2938 (FlowBranchingBlock.AddSibling): Add sanity check.
2939 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
2942 * iterators.cs (Iterator.MarkFinally): Remove.
2943 * statement.cs (ExceptionStatement): Update to changes.
2945 Add support for skipping over finally blocks at runtime. First
2946 in a series to fix #324708
2947 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
2948 (Iterator.EmitMoveNext): Initialize it.
2949 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
2950 branch over the body of the 'finally' clause.
2952 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
2954 Avoid lopsided use of Foo/DoFoo names
2955 * statement.cs (ExpressionStatement.EmitFinallyBody):
2956 Rename from EmitFinally.
2957 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
2958 * iterator.cs: Update to changes.
2960 2008-04-02 Marek Safar <marek.safar@gmail.com>
2962 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
2963 based on UserOperatorCall. More binary nullable operators clean up.
2965 2008-04-02 Martin Baulig <martin@ximian.com>
2967 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
2969 2008-04-02 Marek Safar <marek.safar@gmail.com>
2971 * nullable.cs: Merge user and empty conversions when lifting expression
2974 * expression.cs (StringConcat): Implemented expression tree representation.
2976 2008-04-01 Marek Safar <marek.safar@gmail.com>
2978 * nullable.cs: When lifting null literal and a user operator exists, no call
2981 2008-04-01 Marek Safar <marek.safar@gmail.com>
2983 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
2986 2008-04-01 Marek Safar <marek.safar@gmail.com>
2988 * nullable.cs, expression.cs: Use namespace instead heavily nested
2989 monster abstract class.
2991 2008-04-01 Marek Safar <marek.safar@gmail.com>
2993 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
2994 lifting of null literal and user operators. Clean up of some temporary
2997 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
2999 Fix #368224, test-629.cs
3000 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
3001 if it crossed an unwind-protect boundary.
3002 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
3003 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
3004 inside an unwind-protected region.
3005 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
3006 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
3007 'leave' instead of a 'br' if unwind-protected.
3008 (Iterator.EmitYieldBreak): Likewise.
3010 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
3012 * driver.cs: Only define versioninfo resources if no win32 resource
3015 2008-03-28 Marek Safar <marek.safar@gmail.com>
3017 A fix for bug #372375
3018 * convert.cs: Fixed boxing of nullable types.
3020 2008-03-28 Marek Safar <marek.safar@gmail.com>
3022 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
3025 2008-03-28 Marek Safar <marek.safar@gmail.com>
3027 A fix for bug #374619
3028 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
3030 2008-03-27 Marek Safar <marek.safar@gmail.com>
3032 * lambda.cs: Check return type only for invocation.
3034 2008-03-27 Marek Safar <marek.safar@gmail.com>
3036 A fix for bug #374214
3037 * ecore.cs: Correctly report argument type mismatch.
3039 2008-03-27 Marek Safar <marek.safar@gmail.com>
3041 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
3042 and not rely on broken IsEnum.
3044 2008-03-27 Marek Safar <marek.safar@gmail.com>
3046 * nullable.cs: New file, extracted from generic.cs.
3048 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
3050 2008-03-27 Marek Safar <marek.safar@gmail.com>
3052 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
3053 predefined comparison operators and null literals.
3055 * report.cs: New warning ID.
3057 2008-03-25 Marek Safar <marek.safar@gmail.com>
3059 A fix for bug #370577
3060 * lambda.cs: Check return type too.
3062 2008-03-25 Marek Safar <marek.safar@gmail.com>
3064 A fix for bug #372846
3065 * class.cs: Automatic properties can be declared as unsafe.
3067 2008-03-20 Marek Safar <marek.safar@gmail.com>
3069 * location.cs: Use string based concatenation.
3071 * expression.cs: LiftedBinaryOperator is gmcs only.
3073 2008-03-20 Marek Safar <marek.safar@gmail.com>
3075 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
3076 conversions rules and expression trees.
3078 2008-03-19 Marek Safar <marek.safar@gmail.com>
3080 * delegate.cs: Use extension method source as delegate target.
3082 2008-03-19 Marek Safar <marek.safar@gmail.com>
3084 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
3085 binary operations to be purely based on binary operations and optimized
3086 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
3087 and other ET refactoring.
3089 * typemanager.cs: Fixed warning.
3091 2008-03-17 Marek Safar <marek.safar@gmail.com>
3093 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
3095 * symbolwriter.cs: Fixed.
3097 2008-03-17 Marek Safar <marek.safar@gmail.com>
3099 * anonymous.cs, driver.cs: Reset anonymous types counters.
3101 2008-03-17 Marek Safar <marek.safar@gmail.com>
3103 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
3105 * class.cs: Use fullname for all type member definitions.
3107 2008-02-19 Martin Baulig <martin@ximian.com>
3110 (IMethodData.EmitExtraSymbolInfo): New interface method.
3111 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
3112 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
3113 interface method here as an empty public virtual method.
3116 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
3117 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
3118 CodeGen.SymbolWriter.SetRealMethodName().
3120 2008-02-18 Martin Baulig <martin@ximian.com>
3123 (ScopeInfo.EmitType): Override this and emit debugging
3124 information for captured variables.
3125 (RootScopeInfo.EmitType): Override this and emit symbol
3126 information for a captured `this'.
3128 2008-02-15 Martin Baulig <martin@ximian.com>
3130 * iterators.cs: Emit debugging info.
3133 (EmitContext.Flags): Add `OmitDebuggingInfo'.
3134 (EmitContext.OmitDebuggingInfo): New public property.
3137 (While): Override Emit() and don't emit symbol info there; do it
3138 inside DoEmit() instead.
3139 (Block.Emit): Omit symbol information while emitting the scope
3140 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
3142 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
3143 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
3144 .ctor to make `IsIterator' work.
3146 2008-03-14 Martin Baulig <martin@ximian.com>
3148 * symbolwriter.cs: Added the new symbol writer function from the
3149 debugger's `terrania' branch; temporarily enclose them inside
3150 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
3153 2008-03-14 Martin Baulig <martin@ximian.com>
3156 (SymbolWriter): Make this a public static class.
3159 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
3160 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
3162 2008-03-14 Marek Safar <marek.safar@gmail.com>
3164 A fix for bug #370577
3165 * statement.cs, lambda.cs: Added extra limitations when dealing with void
3168 2008-03-14 Marek Safar <marek.safar@gmail.com>
3170 * typemanager.cs (CSharpName): Made 250 times faster.
3172 2008-03-13 Marek Safar <marek.safar@gmail.com>
3174 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
3176 2008-03-12 Marek Safar <marek.safar@gmail.com>
3178 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
3179 crash when predefined field does not exist.
3181 2008-03-12 Marek Safar <marek.safar@gmail.com>
3183 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
3185 2008-03-12 Marek Safar <marek.safar@gmail.com>
3187 * class.cs (FixedField): Don't crash when contructors are missing.
3189 2008-03-11 Marek Safar <marek.safar@gmail.com>
3191 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
3192 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
3193 check internal types accessibility for internal and external types.
3194 Replaced EnumToUnderlying by GetEnumUnderlyingType.
3196 2008-03-11 Marek Safar <marek.safar@gmail.com>
3198 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
3199 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
3200 attribute.cs, statement: Use corect instance of predefined types (work
3201 related to #364674).
3203 2008-03-07 Marek Safar <marek.safar@gmail.com>
3205 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
3207 2008-03-07 Marek Safar <marek.safar@gmail.com>
3209 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
3210 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
3211 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
3212 predefined types clean up, delayed predefined types members initialization
3213 (work related to #364674).
3215 2008-03-05 Marek Safar <marek.safar@gmail.com>
3217 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
3219 2008-03-05 Marek Safar <marek.safar@gmail.com>
3221 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
3222 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
3223 predefined types clean up (work related to #364674).
3225 2008-03-04 Marek Safar <marek.safar@gmail.com>
3227 * ecore.cs: Print an error message instead of throwing exception.
3229 2008-03-04 Marek Safar <marek.safar@gmail.com>
3231 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
3232 expression.cs, statement.cs: Unififed null literal representation.
3234 2008-03-03 Marek Safar <marek.safar@gmail.com>
3236 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
3237 expression.cs: Refactored binary operators resolve phase and improved speed.
3238 The nullable code is still missing and won't work correctly, more fixes
3241 It also fixes #323726, #324312, #324248, and many other unreported issues.
3243 2008-02-29 Zoltan Varga <vargaz@gmail.com>
3245 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
3248 2008-02-27 Marek Safar <marek.safar@gmail.com>
3250 * ecore.cs: Clean-up and split BetterConversion.
3252 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
3255 * enum.cs (EnumMember.Value): Only access 'value' if
3256 ResolveValue says it's ok.
3257 (EnumMember.DoResolveValue): Don't set prev_member.value.
3258 (Enum.GetDefinition): Reverse arguments of Equals --
3259 EnumMember.Value can return 'null'.
3261 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
3263 2008-02-22 Marek Safar <marek.safar@gmail.com>
3265 * generic.cs, expression.cs: More ongoing work on expression trees.
3267 2008-02-21 Marek Safar <marek.safar@gmail.com>
3269 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
3270 handle missing matches when mutiple operators exist.
3272 2008-02-20 Marek Safar <marek.safar@gmail.com>
3274 A fix for bug #363218
3275 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
3278 2008-02-20 Marek Safar <marek.safar@gmail.com>
3280 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
3281 update. This time to deal correctly with SideEffectConstant expression used
3282 as an argument for another constant folding.
3284 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
3286 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
3289 2008-02-19 Marek Safar <marek.safar@gmail.com>
3291 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
3293 2008-02-19 Marek Safar <marek.safar@gmail.com>
3295 A fix for bug #328136
3296 * expression.cs: Do not fold immediately LogicalAnd operators when the left
3297 side is a false constant, because we still need to evaluate the right-hand
3300 * statement.cs (If): Emit two types of boolean constants (simple constant,
3301 side-effect constant).
3303 2008-02-19 Marek Safar <marek.safar@gmail.com>
3305 * constant.cs (SideEffectConstant): Don't emit boolean constant.
3307 * expression.cs: Fold immediately LogicalAnd operators when both sides are
3310 2008-02-18 Marek Safar <marek.safar@gmail.com>
3312 A fix for bug #361457
3313 * ecore.cs (IsApplicable): Params methods have lower priority.
3315 * support.cs: Return correct parameter modifier for params types.
3317 2008-02-18 Marek Safar <marek.safar@gmail.com>
3319 * generic.cs (TypeParameter): Cache attribute target name.
3321 * support.cs: Removed unused variable.
3323 * typemanager.cs: Removed debugging leftover.
3325 * ecore.cs: Use local type instead of a property;
3327 * class.cs (VerifyMembers): Consider also parent to test whether type member
3330 * expression.cs (FullMethodDesc): Removed.
3332 * attribute.cs (IsValidArgumentType): Made static.
3334 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
3336 Cleanup to be more readable.
3337 * Makefile (GMCS_PROFILE): Remove.
3338 (COMPILER_NAME): New helper.
3340 2008-02-15 Miguel de Icaza <miguel@novell.com>
3342 * cs-tokenizer.cs: if a conditional expression happens inside a
3343 (...) this also means that we do not need to de-ambiguate between
3344 an parenthesized expression and a cast.
3348 * constant.cs (SideEffectConstant): a constant value that happens
3349 to have a side effect.
3351 Fixes the build regressions introduced by the fix for #359789
3353 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
3355 * expression.cs (Conditional.Emit): when emitting the ternary
3356 operator, use local variables to generate code verifiable code.
3358 The verifier cannot infer that the type on stack before the
3359 stloc.0 is executed is of type ParentB. This happens because the
3360 stack merge algorithm uses only parent types when deciding which
3361 is the common type. This is described in Part III 1.8.1.3 of ECMA
3364 This code compiled with mcs is not verifiable under MS. The MS
3365 verifier picks the first common interface of Foo and Bar, which is
3366 wrong, but doesn't use a full join type of the 2 interfaces.
3368 CSC uses a clever hack to compile such code in a verifiable
3369 way. It stores the intermediate values in a local variable with
3374 2008-02-14 Miguel de Icaza <miguel@novell.com>
3376 * expression.cs: Do not fold BitwiseAnd operators when the left
3377 side is a false constant, because we still need to evaluate the
3382 * support.cs: Instead of throwing an InternalErrorException when
3383 the position of the stream is outside the boundary of our buffer,
3384 reset the state of the reader, and restart the reading from the
3385 beginning of the file.
3387 2008-02-14 Marek Safar <marek.safar@gmail.com>
3389 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
3391 2008-02-14 Marek Safar <marek.safar@gmail.com>
3393 A fix for bug #361686
3394 * decl.cs: A protected types used inside a private class which parents
3395 derives from the protected class are accessible.
3397 2008-02-13 Marek Safar <marek.safar@gmail.com>
3399 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
3400 the parameterless constructor.
3402 2008-02-13 Marek Safar <marek.safar@gmail.com>
3404 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
3405 lookup methods to use standard member cache when doing member lookup.
3407 2008-02-12 Marek Safar <marek.safar@gmail.com>
3409 * driver.cs: Don't report full path for referenced module as assembly error.
3411 2008-02-12 Marek Safar <marek.safar@gmail.com>
3413 * Makefile: Fixed `qh' target to work on all machines.
3415 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
3416 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
3417 and HasElementType with TypeManager implementation.
3419 2008-02-08 Marek Safar <marek.safar@gmail.com>
3421 A fix for bugs #325134, #359749
3422 * expression.cs, ecore.cs: Try to resolve an extension method even if the
3423 first binds point to non-method member expression.
3425 2008-02-08 Marek Safar <marek.safar@gmail.com>
3427 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
3429 2008-02-08 Marek Safar <marek.safar@gmail.com>
3431 A fix for bugs #321394, #323028
3432 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
3433 Reworked naive IsAccessibleAs implementation to handle nested types.
3435 2008-02-05 Jb Evain <jbevain@novell.com>
3437 * class.cs: use generic type comparison for parameters
3440 2008-02-05 Marek Safar <marek.safar@gmail.com>
3442 A fix for bug #325372
3443 * class.cs: Use generic type comparison when testing method signatures.
3445 2008-02-05 Marek Safar <marek.safar@gmail.com>
3447 A fix for bug #357047
3448 * ecore.cs: Applied C# 3.0 changes to better conversion.
3450 2008-02-05 Marek Safar <marek.safar@gmail.com>
3452 A fix for bug #358374
3453 * cs-parser.jay: Correctly set modifiers for all constructor types.
3455 2008-02-04 Marek Safar <marek.safar@gmail.com>
3457 A fix for bug #355251
3458 * generic.cs: Added base class constraint based type inference.
3460 2008-02-01 Marek Safar <marek.safar@gmail.com>
3462 A fix for bug #357255
3463 * decl.cs: One more missing visibility check.
3465 2008-02-01 Marek Safar <marek.safar@gmail.com>
3467 * support.cs: Fixed broken return.
3469 2008-01-25 Marek Safar <marek.safar@gmail.com>
3471 * report.cs: Correctly reset warnings count after probing.
3473 2008-01-25 Martin Baulig <martin@ximian.com>
3476 (NamespaceEntry.SymbolFileID): Make this work again after
3477 MemberName.ToString() is gone.
3479 2008-01-25 Marek Safar <marek.safar@gmail.com>
3481 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
3484 2008-01-25 Marek Safar <marek.safar@gmail.com>
3486 * generic.cs: Use full implicit conversion for type inference fixing.
3488 2008-01-24 Marek Safar <marek.safar@gmail.com>
3490 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
3491 Fixed user operator conversions.
3493 2008-01-24 Marek Safar <marek.safar@gmail.com>
3495 * generic.cs: Do nullable type to null comparison optimization during
3498 2008-01-24 Marek Safar <marek.safar@gmail.com>
3500 A fix for bug #355163
3501 * generic.cs: Enabled l-value resolve on nullable expressions.
3503 2008-01-24 Marek Safar <marek.safar@gmail.com>
3505 A fix for bug #353986
3506 * class.cs: Ingore static ctors with parameters for any further checks.
3508 2008-01-24 Marek Safar <marek.safar@gmail.com>
3510 A fix for bug #354310
3511 * namespace.cs: Removed redundant check.
3513 2008-01-24 Marek Safar <marek.safar@gmail.com>
3515 A fix for bug #354928
3516 * expression.cs: ElementInitializers can be resolved only once.
3518 2008-01-24 Marek Safar <marek.safar@gmail.com>
3520 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
3521 Condition expressions.
3523 2008-01-23 Marek Safar <marek.safar@gmail.com>
3525 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
3527 2008-01-22 Marek Safar <marek.safar@gmail.com>
3529 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
3532 * generic.cs: Implemented coalesce expression.
3534 2008-01-22 Marek Safar <marek.safar@gmail.com>
3536 A fix for bug #355145
3537 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
3538 expression tree type inference.
3540 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
3543 * expression.cs (Binary.IsUnsignedType): Fix typo.
3545 2008-01-22 Marek Safar <marek.safar@gmail.com>
3547 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
3549 2008-01-22 Marek Safar <marek.safar@gmail.com>
3551 A fix for bug #355161
3552 * ecore.cs, expression.cs: Wider range of extension method supported
3555 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
3557 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
3558 AssemblyBuilder to operate in compiler context. Fixes mcs part of
3561 2008-01-22 Marek Safar <marek.safar@gmail.com>
3563 A fix for bug #355148
3564 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
3566 2008-01-22 Miguel de Icaza <miguel@novell.com>
3568 * expression.cs (CreateExpressionTree): Add support for or and
3569 logical or, and indent following the coding conventions.
3571 * typemanager.cs (LinqExpression): renamed from
3572 ExpressionTreeManager, for a shorter name.
3574 Use TypeManager.CoreLookupType to lookup types from our core
3575 assemblies and turn those into "Type" variables.
3577 Consumers that previously used "Namespace" and "Type" from this
3578 class should instead use the TypeExpression which is a type that
3579 is fully resolved (without involving the regular C# resolution
3582 This typically looks like this:
3584 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
3585 new MemberAccess (texpr, name, type_arguments, loc)
3587 This avoids the problem in: #355178
3589 2008-01-21 Marek Safar <marek.safar@gmail.com>
3591 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
3592 feature in parser only as we do in other cases.
3594 2008-01-21 Marek Safar <marek.safar@gmail.com>
3596 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
3597 typemanager.cs: A refactoring of params arguments to reuse existing
3598 expressions (params -> array initializer) to emit params argument instead
3599 of specialized handling.
3600 It was required by expression tree implementation and it has other benefits
3601 as well, we now apply same optimization for params arguments as we do for
3604 2008-01-18 Marek Safar <marek.safar@gmail.com>
3606 A fix for bug #353526
3607 * generic.cs: A type inference of params arguments may not required any
3608 temporary array creation.
3610 2008-01-18 Marek Safar <marek.safar@gmail.com>
3612 A fix for bug #353534
3613 * generic.cs, ecore.cs, expression.cs: A method group type inference is
3614 supported for delegates only.
3616 2008-01-18 Marek Safar <marek.safar@gmail.com>
3618 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
3619 type for more than 1 candidates.
3621 2008-01-18 Marek Safar <marek.safar@gmail.com>
3623 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
3626 2008-01-16 Marek Safar <marek.safar@gmail.com>
3628 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
3629 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
3630 operator) expressions.
3632 2008-01-16 Zoltan Varga <vargaz@gmail.com>
3634 * statement.cs: Avoid declaring an IL variable for this_variable since it is
3635 not accessed from the generated IL.
3637 2008-01-14 Marek Safar <marek.safar@gmail.com>
3639 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
3640 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
3641 statement.cs: The first expression tree implementation drop, mostly
3642 infrastructure work.
3644 2008-01-14 Marek Safar <marek.safar@gmail.com>
3646 * ecore.cs (IsNestedChild): Refactored.
3648 2008-01-11 Marek Safar <marek.safar@gmail.com>
3650 * lambda.cs: Don't use a cast on unknown expression statement.
3652 2008-01-10 Geoff Norton <gnorton@novell.com>
3654 * cs-tokenizer.cs: One more token to distinguish between method and lambda
3657 2008-01-09 Marek Safar <marek.safar@gmail.com>
3659 * doc.cs: Report better /doc crash details.
3661 2008-01-09 Marek Safar <marek.safar@gmail.com>
3663 A fix for bug #352536
3664 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
3666 2008-01-08 Marek Safar <marek.safar@gmail.com>
3668 A fix for bug #352287
3669 * ecore.cs, expression.cs: Do `this' access checking in all member access
3672 2008-01-08 Marek Safar <marek.safar@gmail.com>
3674 * rootcontext.cs, driver.cs: Switch to linq mode by default.
3676 * report.cs: Reset message stacks.
3678 2008-01-08 Marek Safar <marek.safar@gmail.com>
3680 * generic.cs (InferInPhases): Correctly calculate params position.
3682 2008-01-08 Marek Safar <marek.safar@gmail.com>
3684 * cs-tokenizer.cs: No need to parse full string when parsing lambda
3687 2008-01-07 Marek Safar <marek.safar@gmail.com>
3689 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
3691 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
3693 * driver.cs: Updated --help option.
3695 2008-01-07 Marek Safar <marek.safar@gmail.com>
3697 * generic.cs (InferParamsTypeArguments): Removed.
3698 (InferInPhases): Add params type inference.
3699 (LowerBoundInference): Fixed scoring mechanism.
3701 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
3703 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
3705 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
3706 byte array for unsigned "baked" assemblies.
3708 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
3710 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
3711 array for assemblies that are not strongnamed.
3713 2008-01-04 Marek Safar <marek.safar@gmail.com>
3715 A fix for bug #351481
3716 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
3717 declaring type for nested generic types.
3719 2008-01-04 Marek Safar <marek.safar@gmail.com>
3721 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
3722 instead of ToString.
3724 2008-01-03 Marek Safar <marek.safar@gmail.com>
3726 A fix for bug #351047
3727 * expression.cs (Binary.ResolveOperator): Allow equality operators between
3728 null and structs only when equality and inequality operators are defined
3729 either as an user-operators or predefined operators.
3731 2008-01-03 Marek Safar <marek.safar@gmail.com>
3733 A fix for bug #351047
3734 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
3736 2008-01-03 Marek Safar <marek.safar@gmail.com>
3738 A fix for bug #351257
3739 * cs-tokenizer.cs: Advance line number for '\r' correctly.
3741 2008-01-03 Marek Safar <marek.safar@gmail.com>
3743 A fix for bug #351157
3744 * class.cs (Using): Fixed yet another broken cloning.
3746 (Block): Put back more sensible default value for statements.
3748 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
3750 * codegen.cs: Allow AssemblyVersion with only major version component.
3753 2007-12-29 Marek Safar <marek.safar@gmail.com>
3755 A fix for bug #324654
3756 * class.cs: Use FullName property as member name.
3758 2007-12-28 Marek Safar <marek.safar@gmail.com>
3760 A fix for bug #342117
3761 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
3762 constructor constraint.
3764 2007-12-28 Marek Safar <marek.safar@gmail.com>
3766 A fix for bug #338273
3767 * class.cs (ProbertyBase): Access modifier checks are required for overrides
3770 2007-12-28 Marek Safar <marek.safar@gmail.com>
3772 A fix for bug #350839
3773 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
3775 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
3777 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3780 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
3782 * statement.cs: Changed some Hashtables to use HybridDictionaries
3783 instead. It was observed that some HashTables only contained a few
3784 items in the vast majority of cases. Since HybridDictionary is
3785 more efficient on small sets (<10 elements), "known_variables"
3786 from class ExplicitBlock as well as "labels" and "constants " from
3787 class Block were changed to HybridDictionaries.
3789 Atsai results: (56216kb->54987kb)
3791 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
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 * expression.cs: foreach loop to for loop, saved on allocation of
3802 enumerator (59333kb->59141kb)
3804 * statement.cs. Changed foreach loops to for loops, saved on
3805 allocation of enumerator (59141kb->59006kb)
3807 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
3808 when constructed with no specified capacity. This was causing a
3809 few ArrayLists to allocate more memory than they would potentially
3810 need in the Block class and MemberCache class. Setting the
3811 ArrayLists to construct with a capacity of 1 saves some
3812 memory. (56216kb->55585kb)
3814 2007-12-27 Marek Safar <marek.safar@gmail.com>
3816 A fix for bug #347189 (2nd issue)
3817 * expression.cs (MemberAccess): Nested type can be found in base non-generic
3820 2007-12-27 Miguel de Icaza <miguel@novell.com>
3822 * report.cs: Do not use colors if stdout and stderr are not a
3825 2007-12-27 Marek Safar <marek.safar@gmail.com>
3827 A fix for bug #346998
3828 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
3831 2007-12-27 Marek Safar <marek.safar@gmail.com>
3833 A fix for bug #343465
3834 * class.cs: Explicit method name for nested types uses dots only.
3836 2007-12-27 Marek Safar <marek.safar@gmail.com>
3838 A fix for bug #343707
3839 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
3841 2007-12-27 Marek Safar <marek.safar@gmail.com>
3843 * ecore.cs: Report type inference errors only when arguments count matches
3846 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
3848 * expression.cs, report.cs: New warning.
3850 * typemanager.cs: Catch anonymous method type too.
3852 2007-12-23 Marek Safar <marek.safar@gmail.com>
3854 A fix for bug #346379
3855 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
3857 2007-12-23 Marek Safar <marek.safar@gmail.com>
3859 A fix for bug #347359
3860 * expression.cs (Invocation): Don't resolve already resolved expression.
3862 2007-12-23 Marek Safar <marek.safar@gmail.com>
3864 A fix for bug #347189
3865 * class.cs (FixedField): Use non-dependent code only in the define phase.
3867 2007-12-23 Marek Safar <marek.safar@gmail.com>
3869 A fix for bug #348076
3870 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
3872 2007-12-22 Marek Safar <marek.safar@gmail.com>
3874 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
3875 discovered extension methods.
3877 2007-12-22 Marek Safar <marek.safar@gmail.com>
3879 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
3882 2007-12-21 Miguel de Icaza <miguel@novell.com>
3884 * report.cs (ErrorMessage): Add support for using colors on
3885 terminals that support it.
3887 2007-12-21 Marek Safar <marek.safar@gmail.com>
3889 * ecore.cs: Use information about expanded params for error reporting.
3891 2007-12-21 Marek Safar <marek.safar@gmail.com>
3893 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
3894 and logic for params overloads.
3896 2007-12-15 Miguel de Icaza <miguel@novell.com>
3898 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
3899 as this is also created from the parser. Fixes #349034
3901 2007-12-12 Miguel de Icaza <miguel@novell.com>
3903 * statement.cs (Throw.CloneTo): it is valid to have empty
3904 expressions for throw.
3906 2007-12-03 Marek Safar <marek.safar@gmail.com>
3908 * cs-parser.jay: Set delegate constraint parsing region correctly.
3910 2007-12-03 Marek Safar <marek.safar@gmail.com>
3912 A fix for bug #345467
3913 * typemanager.cs (IsEqual): Compare generic parameters position only.
3915 2007-11-28 Marek Safar <marek.safar@gmail.com>
3917 * expression.cs (BaseAccess): Type arguments can be null.
3919 2007-11-27 Raja R Harinath <harinath@gmail.com>
3921 * statement.cs (Block.Resolve): Ensure flow-branching tree is
3922 consistent even when an error has occured.
3923 (Switch.Resolve): Likewise.
3925 2007-11-22 Marek Safar <marek.safar@gmail.com>
3927 A fix for bug #334505
3928 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
3931 2007-11-22 Marek Safar <marek.safar@gmail.com>
3933 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
3934 refactorings required to resolve extension methods correctly when mixing
3935 generics and non-generics members.
3937 2007-11-20 Marek Safar <marek.safar@gmail.com>
3939 A fix for bug #342584
3940 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
3943 2007-11-19 Marek Safar <marek.safar@gmail.com>
3945 A fix for bug #342512
3946 * delegate.cs: Use delegate argument expression when is available. Don't
3947 emit virtual call when class is sealed.
3949 2007-11-16 Marek Safar <marek.safar@gmail.com>
3951 A fix for bug #325423
3952 * assign.cs (FieldInitializer): Use resolved expression for emit.
3954 * class.cs: Print less confusing error message.
3956 2007-11-16 Marek Safar <marek.safar@gmail.com>
3958 * cs-tokenizer.cs: Removed GMCS ifdefs.
3960 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
3963 * cs-parser.jay: Disabled nullable check.
3965 * generic-mcs: Copied more generic stuff.
3967 2007-11-16 Marek Safar <marek.safar@gmail.com>
3969 * gcs-parser.jay: Merged to cs-parser.jay.
3971 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
3972 * *.csproj, *.sources: Updated to use only jay parser file.
3974 2007-11-16 Marek Safar <marek.safar@gmail.com>
3976 * gcs-parser.jay: Added nullable and default expression feature checks.
3978 2007-11-16 Marek Safar <marek.safar@gmail.com>
3980 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
3981 it fixes many TODOs and hidden bugs.
3983 * expression: Removed duplicate error check.
3985 2007-11-15 Marek Safar <marek.safar@gmail.com>
3987 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
3988 implicitly type local variable only when it is used in a declaration.
3990 2007-11-15 Marek Safar <marek.safar@gmail.com>
3992 * attribute.cs: Use CS0612 for empty strings.
3994 2007-11-14 Marek Safar <marek.safar@gmail.com>
3996 * lambda.cs, statement.cs: Contextual return may act as a statement.
3998 2007-11-14 Marek Safar <marek.safar@gmail.com>
4000 A fix for a regression cause by #324222
4001 * class.cs: Don't report unused even when it implements an interface.
4003 2007-11-13 Marek Safar <marek.safar@gmail.com>
4005 A fix for bug #341205
4006 * ecore.cs, expression.cs: Method group expression cannot do static
4007 method access with an instance reference check before overloading takes
4010 2007-11-13 Marek Safar <marek.safar@gmail.com>
4012 A fix for bug #325359
4013 * class.cs: Use predictable name for automatically generated property.
4015 2007-11-12 Marek Safar <marek.safar@gmail.com>
4017 A fix for bug #324996
4018 * expression.cs (Is): Handle case where D is nullable and T is not
4021 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
4023 2007-11-12 Marek Safar <marek.safar@gmail.com>
4025 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
4026 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
4027 Flush small error reporting changes.
4029 2007-11-09 Marek Safar <marek.safar@gmail.com>
4031 A fix for bug #324996
4032 * expression.cs: Rewrote Is expression implementation to work with
4033 generics, nullable types, anonymous method. A const result expression
4034 uses existing infrastructure instead of custom not fully-featured one.
4036 2007-11-08 Marek Safar <marek.safar@gmail.com>
4038 A fix for bug #340202
4039 * class.cs: Consider generics for volatile field.
4041 2007-11-08 Marek Safar <marek.safar@gmail.com>
4043 A fix for bug #335594
4044 * expression.cs: Use conversion rules when handling string addition.
4046 2007-11-07 Marek Safar <marek.safar@gmail.com>
4048 A fix for bug #336651
4049 * expression.cs: Fixed a crash when probing is on.
4051 2007-11-07 Marek Safar <marek.safar@gmail.com>
4053 A fix for bug #324242
4054 * covert.cs: Added a conversion from any nullable-type with an
4055 underlying enum-type to the type System.Enum.
4057 2007-11-07 Marek Safar <marek.safar@gmail.com>
4059 A fix for bug #324222
4060 * class.cs: Report all non-used event fields.
4062 2007-11-07 Marek Safar <marek.safar@gmail.com>
4064 A fix for bug #325161
4065 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
4066 qualifier for generic types.
4068 2007-11-07 Marek Safar <marek.safar@gmail.com>
4070 A fix for bug #322971
4071 * expression.cs, ecore.cs: Added intermediate result value check for
4074 2007-11-07 Marek Safar <marek.safar@gmail.com>
4076 A fix for bug #324754
4077 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
4078 when it was requested.
4080 2007-11-07 Marek Safar <marek.safar@gmail.com>
4082 A fix for bug #325101
4083 * expression.cs: Do type not value comparison for `is' expression.
4085 2007-11-07 Marek Safar <marek.safar@gmail.com>
4087 A fix for bug #320236
4088 * convert.cs: Don't apply user conversion on underlying target type.
4090 2007-11-06 Marek Safar <marek.safar@gmail.com>
4092 * expression.cs: Don't use unresolved expression for error reporting.
4094 2007-11-06 Marek Safar <marek.safar@gmail.com>
4096 A fix for bugs #337712, #324490
4097 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
4098 overloading resolution too.
4100 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
4101 the process consistent and more robust.
4103 * expression.cs, linq.cs, report.cs: Update.
4105 2007-11-02 Marek Safar <marek.safar@gmail.com>
4107 A fix for bug #332909
4108 * attribute.cs: Resolve attributes in correct context using error
4111 * rootcontext.cs: Define Obsolete attribute members as core members.
4113 2007-11-02 Marek Safar <marek.safar@gmail.com>
4115 * statement.cs: Removed unused methods.
4117 2007-10-31 Wade Berrier <wberrier@novell.com>
4119 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
4120 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
4123 2007-10-31 Marek Safar <marek.safar@gmail.com>
4125 A fix for bug #338102
4126 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
4127 methods registered as non-generics.
4129 2007-10-31 Marek Safar <marek.safar@gmail.com>
4131 A fix for bugs #337712, #324490
4132 * delegate.cs: Delegate covariance and contravariance is not allowed for
4135 2007-10-31 Marek Safar <marek.safar@gmail.com>
4137 A fix for bug #337719
4138 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
4141 2007-10-30 Marek Safar <marek.safar@gmail.com>
4143 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
4145 2007-10-29 Marek Safar <marek.safar@gmail.com>
4147 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
4150 2007-10-29 Raja R Harinath <rharinath@novell.com>
4152 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
4154 2007-10-29 Marek Safar <marek.safar@gmail.com>
4156 A fix for bug #334652
4157 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
4158 extension methods when we have not found the best candidate in normal
4161 2007-10-27 Marek Safar <marek.safar@gmail.com>
4163 * AssemblyInfo.cs: Keep up-to-date.
4165 2007-10-27 Marek Safar <marek.safar@gmail.com>
4167 * Makefile: Fixed generics compiler name.
4169 2007-10-27 Marek Safar <marek.safar@gmail.com>
4171 * lambda.test: removed, lambda parsing is done differently.
4173 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
4175 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
4177 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
4179 2007-10-27 Marek Safar <marek.safar@gmail.com>
4181 * Makefile, *.sources : All C# compilers are in mcs folder.
4183 * *.cs: Use existing 2_1 define for smcs.
4185 2007-10-26 Marek Safar <marek.safar@gmail.com>
4187 A fix for bug #335847
4188 * assign.cs, expression.cs: Couple of changes to avoid creating a
4189 temporary variable for each object initializer assignment statement. It
4190 simplifies struct initialization too, otherwise two temporary variables
4192 Implemented optimization of redundant default element initializers.
4194 2007-10-25 Marek Safar <marek.safar@gmail.com>
4196 A fix for bug #336766
4197 * expression.cs (Class.CheckBase): Use generic name when method is
4200 2007-10-25 Marek Safar <marek.safar@gmail.com>
4202 A fix for bug #334737
4203 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
4204 variable and not variable argument for prepared copies.
4206 2007-10-24 Marek Safar <marek.safar@gmail.com>
4208 A fix for bug #325110
4209 * class.cs, expression.cs, attribute.cs: Use open generic method when
4210 checking conditional attribute.
4212 2007-10-24 Marek Safar <marek.safar@gmail.com>
4214 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
4215 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
4216 FeatureIsNotAvailable.
4218 2007-10-24 Marek Safar <marek.safar@gmail.com>
4220 ** C# 3.0 Partial methods
4222 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
4223 methods support. Because of member cache issue with generics only
4224 non-generics partial methods are fully supported.
4226 2007-10-23 Marek Safar <marek.safar@gmail.com>
4228 * class.cs, decl.cs: Rewrote member overloads check to cope with
4229 generics and to use member cache for member checking. It also improves
4230 performance and fixes remaining overloads issues.
4232 2007-10-20 Marek Safar <marek.safar@gmail.com>
4234 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
4235 roottypes.cs, typemanager.cs:
4237 A member cache creation logic changed to add members immediately and
4238 not rely on fallback. The member cache is now only prefered way
4239 how to access and find type declaration members. It saves 5 MB of memory
4240 during MWF compilation and makes code ready for more optimizations and
4241 clean-ups, it's also a pre-requirement for partial methods.
4243 2007-10-18 Raja R Harinath <harinath@gmail.com>
4245 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
4246 handling for generic parameters.
4248 2007-10-15 Marek Safar <marek.safar@gmail.com>
4250 * class.cs (FixedField): Removed redundant volatile check.
4252 2007-10-15 Marek Safar <marek.safar@gmail.com>
4254 * class.cs, decl.cs: Fixed overload members verification to do only one
4255 check per possible collision.
4257 2007-10-13 Marek Safar <marek.safar@gmail.com>
4259 A fix for bug #325478
4260 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
4261 and create only one disposable flags container.
4263 2007-10-12 Marek Safar <marek.safar@gmail.com>
4265 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
4266 * statement.cs (Fixed): Fixed variables cloning.
4268 2007-10-12 Marek Safar <marek.safar@gmail.com>
4270 A fix for bug #333342
4271 * class.cs (EventField): Don't mark value type event as synchronized.
4273 2007-10-12 Marek Safar <marek.safar@gmail.com>
4275 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
4276 inference to identify best candidate method correctly.
4277 (ProperyExpr): A range variable is read only and cannot be modified.
4279 2007-10-11 Marek Safar <marek.safar@gmail.com>
4281 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
4282 logic to identify best candidate method correctly.
4284 2007-10-11 Marek Safar <marek.safar@gmail.com>
4286 * location.cs (Equals, GetHashCode): Removed.
4288 2007-10-11 Marek Safar <marek.safar@gmail.com>
4290 * report.cs: Implemented message recorder. It is used mainly for lambda
4291 expressions to capture otherwise swallowed error messages.
4293 * anonymous.cs, lambda.cs.cs: Do full parameters check.
4295 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
4297 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
4299 * expression.cs (MemberAccess): Always report lookup failure.
4301 * location.cs: Implemented Equals, GetHashCode.
4303 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
4305 2007-10-10 Jb Evain <jbevain@novell.com>
4307 * codegen.cs: re-enable assembly version check.
4309 2007-10-09 Marek Safar <marek.safar@gmail.com>
4311 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
4314 * namespace.cs (UsingAlias): Do correct version check.
4316 2007-10-08 Marek Safar <marek.safar@gmail.com>
4318 * expresison.cs, ecore.cs: Issue extension method error message when
4321 * rootcontext.cs: Added ISO_2 compiler mode option.
4323 2007-10-08 Marek Safar <marek.safar@gmail.com>
4325 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
4328 2007-10-08 Marek Safar <marek.safar@gmail.com>
4330 * attribute.cs (GetString, GetBoolean): Work with both literal and
4333 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
4334 Moved method overload specific methods to MethodGroupExpr.
4336 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
4337 it should be less memory consuming.
4339 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
4341 * codegen.cs: remove the assembly version check until the buildbot is
4344 2007-10-07 Jb Evain <jbevain@novell.com>
4346 * attribute.cs (Attribute.GetString): if the value
4347 expression is a StringConstant, return its string value.
4349 2007-10-07 Jb Evain <jbevain@novell.com>
4351 * typemanager.cs: add `assembly_version_attribute_type`.
4352 * codegen.cs: on attribute emission, check that the
4353 AssemblyVersionAttribute doesn't overflow.
4355 2007-10-05 Marek Safar <marek.safar@gmail.com>
4357 A fix for bug #324677
4358 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
4359 parent container of a scope container with currently resolved one.
4361 2007-10-05 Marek Safar <marek.safar@gmail.com>
4363 A fix for bug #325534
4364 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
4367 2007-10-05 Marek Safar <marek.safar@gmail.com>
4369 A fix for bug #327504
4370 * class.cs (Operator.Define): Refactored implicit and explicit user
4371 operator conversion rules.
4373 2007-10-05 Marek Safar <marek.safar@gmail.com>
4375 A fix for bug #327520
4376 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
4378 2007-10-04 Marek Safar <marek.safar@gmail.com>
4380 A fix for bug #328022
4381 * class.cs (MethodData.Define): Use correct method to check whether
4382 a method implementents an accessor.
4384 2007-10-04 Marek Safar <marek.safar@gmail.com>
4386 A fix for bug #330069
4387 * statement.cs (Fixed.Resolve): Read the first array element only when
4388 an array is instantiated.
4390 2007-10-04 Marek Safar <marek.safar@gmail.com>
4392 * expression.cs, assign.cs, generics.cs: Print correct operator when
4393 compound assignment is used.
4395 2007-10-04 Marek Safar <marek.safar@gmail.com>
4397 A fix for bug #325841
4398 * expression.cs (ArrayAccess): Use full argument cloning only for
4399 string compound concatenation.
4401 2007-10-03 Marek Safar <marek.safar@gmail.com>
4403 A fix for bug #328774
4404 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
4406 (PropertyExpr.EmitAssign): Fixed string concatenation compound
4409 2007-10-03 Raja R Harinath <rharinath@novell.com>
4412 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
4413 Event accessibility checks here. Remove some bogus code that
4414 accidently made GenericMethods work.
4415 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
4417 2007-09-25 Marek Safar <marek.safar@gmail.com>
4419 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
4421 * statement.cs (Block): Refactored AddVariable to allow error handling
4424 * generic.cs: New stub.
4426 2007-09-23 Marek Safar <marek.safar@gmail.com>
4428 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
4431 2007-09-17 Marek Safar <marek.safar@gmail.com>
4433 * class.cs: Use partial container to record whether any partial part
4434 contains static field initializer and therefore default contructor has
4437 2007-09-14 Marek Safar <marek.safar@gmail.com>
4439 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
4440 mono-list when only one of two partial parts has defined accessibility
4443 2007-09-14 Marek Safar <marek.safar@gmail.com>
4445 A fix for bug #82845
4447 * class.cs (TypeContainer): Set correct resolve context for all field
4450 2007-09-13 Marek Safar <marek.safar@gmail.com>
4452 * assign.cs: Fixed a crash when field is resolved twice with an error.
4454 * codegen.cs: Changed InFieldInitializer to be flag.
4456 * anonymous.cs, ecore.cs, expression.cs: Update after
4457 IsInFieldInitializer rename.
4459 * const.cs: Removed unused parameter.
4461 * class.cs: Changed the way how we resolve and emit field initializers.
4462 The field initilizers have to have access to contructor block to emit
4463 compiler generated code.
4465 2007-09-13 Marek Safar <marek.safar@gmail.com>
4467 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
4468 generics use TypeContainer instead.
4470 2007-09-12 Marek Safar <marek.safar@gmail.com>
4472 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
4474 * lambda.cs (ResolveParameters): Use more powerful
4475 InflateGenericArgument.
4477 * parameters.cs: Better exception message.
4479 2007-09-10 Marek Safar <marek.safar@gmail.com>
4481 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
4482 correct expression block type.
4484 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
4486 * expression.cs (Invocation): Extracted method group resolve to
4489 2007-09-07 Marek Safar <marek.safar@gmail.com>
4491 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
4492 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
4494 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
4495 generic extension methods.
4497 2007-09-06 Marek Safar <marek.safar@gmail.com>
4499 A fix for bug #82676 (Do I get it right now?)
4500 * convert.cs (Binary.ResolveOperator): An interface is converted to the
4501 object before a standard conversion is applied.
4503 2007-09-06 Marek Safar <marek.safar@gmail.com>
4505 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
4508 2007-09-05 Marek Safar <marek.safar@gmail.com>
4510 A fix for bug #82676
4511 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
4512 non-generic interface types.
4514 2007-09-05 Marek Safar <marek.safar@gmail.com>
4516 A fix for bug #82690
4517 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
4519 2007-09-05 Marek Safar <marek.safar@gmail.com>
4521 A fix for bug #82571
4522 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
4523 modifier for container based methods.
4525 2007-09-05 Marek Safar <marek.safar@gmail.com>
4527 A fix for bug #82676
4528 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
4529 any interface-type T means to any of interface type T.
4531 2007-09-04 Marek Safar <marek.safar@gmail.com>
4533 * namespace.cs: We have 2 versions of System.Core assembly.
4535 2007-09-04 Marek Safar <marek.safar@gmail.com>
4537 A fix for bug #82652
4538 * class.cs (Class.GetClassBases): Compare types and not expressions.
4540 2007-09-04 Marek Safar <marek.safar@gmail.com>
4542 A fix for bug #82620
4543 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
4544 actually never worked before.
4545 (IndexerAccess): Emit prepared arguments before they are modified.
4547 2007-09-04 Marek Safar <marek.safar@gmail.com>
4549 A fix for bug #82563
4550 * assign.cs: Revert wrong fix.
4552 * expression.cs (VariableReference.EmitAssign): Handle ref reference
4554 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
4555 Instead of ldelema/stdind we have to use temporary variables to handle
4556 cases like String.Concat (params string[]).
4558 2007-08-31 Marek Safar <marek.safar@gmail.com>
4560 * class.cs: EmitAttributes to Emit rename.
4562 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
4564 (MemberCore.HasClsCompliantAttribute): Don't depend on
4565 GetClsCompliantAttributeValue execution.
4567 2007-08-31 Marek Safar <marek.safar@gmail.com>
4569 * anonymous.cs: Use shorter type prefix.
4571 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
4574 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
4575 variables when probing is on.
4577 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
4578 unresolved variables.
4579 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
4580 handle transparent identifiers.
4582 2007-08-26 Marek Safar <marek.safar@gmail.com>
4584 * attribute.cs (IsClsCompliant): Add nullable types test.
4586 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
4588 * doc.cs : catch other types of exception than XmlException to
4589 report CS1570. Fixed bug #82565.
4591 2007-08-23 Marek Safar <marek.safar@gmail.com>
4593 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
4594 The number of delegate parameters has to match.
4595 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
4598 2007-08-21 Marek Safar <marek.safar@gmail.com>
4600 * anonymous.cs (AnonymousMethod): Generate private anonymous method
4601 to fix problem with private arguments.
4603 2007-08-20 Marek Safar <marek.safar@gmail.com>
4605 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
4607 * decl.cs (MemberName): Ignore generic type with no generic arguments.
4609 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
4610 empty. Add cloning suport.
4612 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
4614 2007-08-20 Marek Safar <marek.safar@gmail.com>
4616 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
4617 to create EmptyCast. It handles EmptyConstantCast specialization for
4620 2007-08-18 Marek Safar <marek.safar@gmail.com>
4622 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
4623 (EmitArrayArgument): One routine for array arguments.
4624 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
4626 2007-08-17 Marek Safar <marek.safar@gmail.com>
4628 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
4630 2007-08-17 Marek Safar <marek.safar@gmail.com>
4632 * anonymous.cs: MemberLookupFinal update.
4634 * class.cs (ConstructorInitializer): Is expression based.
4636 * delegate.cs: MethodGroupExpr update.
4638 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
4640 (Error_MemberLookupFailed): Customizable error override.
4641 (MethodGroupExpr): Keep queried type for later usage.
4642 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
4645 * expression.cs: Error_MemberLookupFailed refactoring.
4646 (New.DoResolve): Resolve as much as possible.
4647 (ElementInitializer.Error_MemberLookupFailed): Object initializer
4648 customization for invalid member types.
4650 * statement.cs: MethodGroupExpr update.
4652 2007-08-16 Marek Safar <marek.safar@gmail.com>
4654 * modifier.cs (Check): Check all modifiers and not only accessibility
4657 2007-08-16 Marek Safar <marek.safar@gmail.com>
4659 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
4660 type and not an expression.
4662 2007-08-16 Marek Safar <marek.safar@gmail.com>
4664 * statement.cs (Catch.Clone): Type and variable can be null.
4666 2007-08-16 Marek Safar <marek.safar@gmail.com>
4668 A fix for bug #81979
4669 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
4670 I am really not sure whether this is the best fix.
4672 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
4675 2007-08-14 Marek Safar <marek.safar@gmail.com>
4677 ** C# 3.0 Object and collection initializers (major re-write)
4679 * assign.cs (DoResolve): Initializers are not assign related.
4681 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
4682 used during collection or object initialization.
4684 * expression.cs (Error_InvalidArguments): Add initializers specific
4685 messages. More will come later because it requires some general
4687 (New.DoResolve): Better error handling for unsafe types.
4688 (EmptyExpressionStatement): New class.
4689 (ElementInitializer): An object initializer expression.
4690 (CollectionElementInitializer): A collection initializer expression.
4691 (CollectionOrObjectInitializers): A block of object or collection
4693 (NewInitialize): New expression with element/object initializers.
4695 * statement.cs: Reverted object/collection initializer hacks.
4697 * typemanager.cs (CSharpName): Filter __arglist type.
4699 2007-08-09 Marek Safar <marek.safar@gmail.com>
4701 ** C# 3.0 Anonymous Types (update to the latest standard)
4703 * expression.cs (Binary.ResolveOperator): Threat all null based types
4705 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
4706 (AnonymousTypeParameter): Updated.
4708 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
4709 (AnonymousTypeClass): New anonymous type container.
4711 * class.cs (AddField): Return operation result.
4713 * generic.cs: Another empty TypeArguments overload.
4715 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
4716 are stored at top of normal hierarchy.
4718 * typemanager.cs (CSharpName): Filter anonymous types.
4720 2007-08-09 Marek Safar <marek.safar@gmail.com>
4722 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
4723 as single Concat call. How could we miss that :-(
4725 2007-08-08 Marek Safar <marek.safar@gmail.com>
4727 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
4729 2007-08-07 Miguel de Icaza <miguel@novell.com>
4731 * expression.cs: Fix the previous commit, the creation of the
4732 arguments array list needs also to be conditional on the arguments
4735 * class.cs: Add a little bit of help to help narrow down problems.
4737 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
4738 not try to copy in that case.
4740 * driver.cs: When building SMCS, include a new different set of
4741 default assemblies here. Do this here so we can control whether
4742 to include the default assemblies with /noconfig.
4744 2007-08-03 Marek Safar <marek.safar@gmail.com>
4746 A fix for bug #81979
4747 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
4750 2007-08-03 Marek Safar <marek.safar@gmail.com>
4752 A fix for bug #82300
4754 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
4755 we are in probing scope.
4757 2007-08-03 Marek Safar <marek.safar@gmail.com>
4759 A fix for bug #82301
4761 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
4762 (Statement.CloneTo): Clone and not map children blocks.
4764 2007-08-03 Marek Safar <marek.safar@gmail.com>
4766 A fix for bug #82299
4768 * expression.cs (LocalVariableReference.CloneTo): Remap local info
4771 * statement.cs (Statement.CloneTo): Clone variables before statements
4772 to allow remaping of local variables.
4774 2007-08-03 Marek Safar <marek.safar@gmail.com>
4776 A fix for bug #82296
4779 * report.cs: Log crash details for future clone problems.
4781 * statement.cs (Return.Clone): Don't clone non-existent expression.
4783 2007-08-03 Raja R Harinath <harinath@gmail.com>
4785 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
4786 (Class.AddBasesForPart): Move CS0537 check here from ...
4787 * cs-parser.jay (class_declaration): ... here. Move calling of
4788 'AddBasesForPart' to ...
4789 (class_bases): ... here.
4790 (struct_declaration, interface_declaration): Update to changes.
4792 2007-08-02 Marek Safar <marek.safar@gmail.com>
4794 A fix for bug #81923
4796 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
4797 conversion is allowed.
4799 2007-08-02 Marek Safar <marek.safar@gmail.com>
4801 A fix for bug #81564
4803 * ecore.cs (EventExpr): Add IsBase handling.
4805 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
4808 2007-08-02 Raja R Harinath <harinath@gmail.com>
4810 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
4811 * cs-parser.jay: Some whitespace cleanups.
4812 (current_delegate): New.
4814 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
4815 a dummy code block, and use 'type_name' instead of 'member_name'.
4816 (interface_declaration, class_declaration): Likewise.
4817 (delegate_declaration): Likewise. Rearrange slightly and use
4819 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
4820 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
4822 2007-08-02 Marek Safar <marek.safar@gmail.com>
4824 A fix for bug #82039
4826 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
4829 * typemanager.cs (CSharpName): Split to string overload.
4831 2007-08-02 Marek Safar <marek.safar@gmail.com>
4834 * report.cs: Updated warning CS0472.
4836 2007-08-01 Marek Safar <marek.safar@gmail.com>
4838 A fix for bug #82181
4840 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
4842 2007-08-01 Marek Safar <marek.safar@gmail.com>
4844 A fix for bug #82277
4845 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
4847 2007-08-01 Marek Safar <marek.safar@gmail.com>
4849 ** C# 3.0 Type Inference (major bits are working)
4851 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
4852 (.ImplicitStandardConversionExists): Uses compatible.
4853 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
4854 (.InferReturnType): New method.
4855 (.Compatible): Refactored.
4856 (.ResolveParameters): Uses factory to create resolved parameters.
4857 (.CompatibleMethod): Add probing mode support.
4858 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
4859 clearly distinguish between 2 different operations.
4860 (LambdaMethod): Moved to lambda.cs.
4861 (AnonymousMethod): Removed unused fields and methods.
4862 (AnonymousDelegate): Simplified.
4864 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
4866 * convert. cs (ImplicitConversionStandard): Compatible works differently.
4868 * delegate.cs (Delegate): New mehods to reduce code duplication.
4869 (.GetConstructor): New method.
4870 (.GetInvokeMethod): New method.
4871 (DelegateCreation): Updated.
4873 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
4875 (OverloadResolve): Made probing little bit faster.
4877 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
4880 * generic.cs (TypeInferenceContext): Dummy implementation.
4882 * iterators.cs: Updated after Resolve/Define rename.
4884 * lambda.cs (LambdaExpression)
4885 (.ResolveParameters): Handles both type of arguments and type inference too.
4887 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
4888 (InflateTypes): Updated.
4890 * support.cs (InflateTypes): Changed signature and updated.
4892 * typemanager.cs (LookupMemberCache): Better dynamic type check.
4893 (MemberLookup_FindMembers): More MS tricks.
4894 (GetParameterData): Ditto.
4895 (GetDelegateParameters): Uses quick path for dynamic types.
4897 2007-08-01 Marek Safar <marek.safar@gmail.com>
4899 * class.cs (MethodData.Define): EmitContext is required for generic stuff
4902 2007-07-31 Marek Safar <marek.safar@gmail.com>
4904 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
4907 2007-07-26 Jb Evain <jbevain@novell.com>
4909 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
4910 which takes a boolean 'report_errors', similar to the GetMethod.
4911 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
4912 in .net 2.1, do not report errors here.
4914 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
4915 System.Runtime.CompilerServices.RequiredAttributeAttribute and
4916 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
4919 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
4920 of the type InternalsVisibleToAttribute before the first call
4921 to CoreLookupType which is allowed to fail (third boolean parameter
4922 to true). Because, during the resolution for a type that is not
4923 immediately found, we try to check if the type is not defined in
4924 a friend assembly, and to do so, we need the
4925 InternalVisibleToAttribute.
4927 2007-07-23 Miguel de Icaza <miguel@novell.com>
4929 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
4930 feature that allows structs to be compared against null and inline
4931 the result as true or false.
4933 Notice that the same code is not permitted inside a generic block
4934 of code that would do:
4936 class Foo<T> where T : struct {
4943 It is only allowed if the type of T is not bound (no where
4944 clause). In my opinion, this CSC 2 behavior is broken but people
4945 seem to be using it (IronRuby does, a few bug reports on bugzilla
4946 have it and some people have complained about it).
4948 All of the users that depend on this behavior have code that is
4951 * report.cs (Warning, Error): make these take object arguments,
4952 not strings, as that allows us to take advantage of Format.
4954 2007-07-20 William Holmes <billholmes54@gmail.com>
4956 * decl.cs: Changed MemberName.CountTypeArguments to also check the
4957 Left member variable for the Count.
4958 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
4959 MemberName.CountTypeArguments to avoid a NRE.
4961 This code is contributed under the MIT X11 license
4963 2007-07-18 Marek Safar <marek.safar@gmail.com>
4965 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
4967 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
4969 * doc.cs : generic method arguments are written as ``x while generic
4970 type arguments are `x. Combined with the previous change, fixed bug
4973 2007-07-18 Raja R Harinath <rharinath@novell.com>
4976 * expression.cs (Binary.ResolveOperator): When converting
4977 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
4979 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
4981 * doc.cs : when T: or whatever x: is specified, it does not really
4982 check the doc comment's syntax correctness. Fixed bug #82006.
4984 2007-07-18 Marek Safar <marek.safar@gmail.com>
4986 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
4987 LambdaExpression better.
4989 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
4991 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
4993 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
4994 as it can be generated.
4996 * expression.cs (Invocation.Error_InvalidArguments): Show correct
4999 * lambda.cs (LambdaExpression): Refactored to share same code with
5000 AnonymousMethodExpression.
5002 2007-07-17 Marek Safar <marek.safar@gmail.com>
5004 * anonymous.cs (MakeName): Include host name for easier debugging.
5005 (LambdaMethod): New class for lambda spcecific stuff.
5007 * attribute.cs: Set EmitContext return type.
5009 * class.cs: Set EmitContext return type.
5011 * codegen.cs (EmitContext): Return type cannot be null to stop messing
5012 with null/void meaning.
5014 * iterators.cs (ContainerType): Implemented.
5016 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
5018 * statement.cs (Return): Updated to lambda expressions.
5019 (Block.CloneTo): Parent can be null.
5021 2007-07-13 Marek Safar <marek.safar@gmail.com>
5023 A fix for bug #81917
5024 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
5026 * class.cs (FixedField): Check whether field is in unsafe scope.
5028 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
5029 (FieldExpr.Emit): Fixed buffers cannot be volatile.
5031 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
5034 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
5036 2007-07-13 Marek Safar <marek.safar@gmail.com>
5038 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
5039 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
5042 2007-07-13 Marek Safar <marek.safar@gmail.com>
5044 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
5046 2007-07-13 Marek Safar <marek.safar@gmail.com>
5048 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
5049 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
5051 * codegen.cs(EmitContext): Add ProbingMode flag.
5053 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
5055 * driver.cs: For now set both warning values.
5057 * ecore.cs (SimpleName): Name is readonly.
5058 (MethodGroup.OverloadResolve): One quick path for probing.
5060 * expression.cs (Unary): Set Oper r/o.
5061 (Binary): Set Oper r/o.
5062 (ParameterReference): Set few instance variables as r/o.
5063 (ParameterReference.DoResolveBase): Don't capture aruments when
5065 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
5066 (Arglist): arguments are private.
5067 (SizeOf): type is private and r/o.
5068 (MemberAccess): arguments are private.
5070 * report.cs: Enhanced reporting on/off capabilities.
5072 * lambda.cs: Uses ec.IsInProbingMode.
5073 (ContextualReturn): Derives from return.
5075 * rootcontext.cs: For now set both warning values.
5077 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
5079 (Return.Resolve): Don't die immediately.
5080 (Block.Resolve): Speed-up probing.
5081 (Block.CloneTo): Clone only child blocks.
5083 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
5085 * iterators.cs: reverted Miguel's latest change (r81925) as it
5086 breaks the build in System.
5088 2007-07-13 Miguel de Icaza <miguel@novell.com>
5090 * iterators.cs (Yield.CheckContext): Check for the iterator type
5091 also here as we can call into Yield even in codepaths that are not
5093 (MethodOrOperator is the only path that was checked).
5095 In addition to the standard check, use a more specific check for
5096 constructors to report a more verbose error.
5098 2007-07-12 Miguel de Icaza <miguel@novell.com>
5100 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
5101 report the warning and continue
5103 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
5104 values on the stack on the call to Emit. Use EmitStatement if
5105 possible, or using Emit + Pop if not possible. Fixes #82064
5107 2007-07-12 Raja R Harinath <rharinath@novell.com>
5109 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
5110 avoid try...finally in some cases.
5112 2007-07-10 Marek Safar <marek.safar@gmail.com>
5114 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
5116 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
5117 instead of method. Re-use standard error handling.
5118 (ConstructorInitializer.Emit): Simplified.
5120 * delegate.cs: Updated after Invocation.EmitCall change.
5122 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
5123 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
5124 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
5125 method and don't permanently changing input arguments.
5126 (MethodGroupExpr): Introduced resolved best_candidate, when method group
5127 is resolved it has one of the candidates is the best one which is later
5128 used to emit. Removed a few unused method.
5129 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
5131 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
5132 (Binary.ResolveOperator): Ditto.
5133 (ConditionalLogicalOperator.DoResolve): Ditto.
5134 (Invocation): Uses method group.
5135 (Invocation.DoResolve): Simplified.
5136 (Invocation.EmitCall): Removed useless is_static.
5137 (Invocation.Emit): Delegate to method group.
5138 (Invocation.EmitStatement): Simplified.
5139 (New): Uses method group.
5140 (MemberAccess.DoResolve): Don't destroy original expression.
5142 * statement.cs (ForEach.Resolve): Use null for no method arguments.
5144 2007-07-04 Marek Safar <marek.safar@gmail.com>
5146 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
5149 * lambda.cs: Add custom error message type.
5151 2007-07-03 Marek Safar <marek.safar@gmail.com>
5153 * lambda.cs: Simplified little bit.
5155 * parameter.cs: Introduced ImplicitLambdaParameter.
5156 (Parameters.CreateFullyResolved): New factory instead of ctor.
5160 * delegate.cs: Updated parameter creation.
5162 2007-07-03 Marek Safar <marek.safar@gmail.com>
5164 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
5167 * generic.cs: Synchronized with gmcs.
5169 2007-07-03 Marek Safar <marek.safar@gmail.com>
5171 * class.cs (Indexer): Check return type as soon as possible.
5173 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
5176 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
5178 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
5180 * parameter.cs (Parameter): Use expression type when it is available.
5182 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
5183 method modifier for the first parameter only.
5185 2007-06-24 Marek Safar <marek.safar@gmail.com>
5187 A fix for bug #81938
5188 * typemanager.cs (ChangeType): Fixed couple of char conversions.
5190 * constant.cs: Tide up an exception message.
5192 2007-06-22 Marek Safar <marek.safar@gmail.com>
5194 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
5195 an uninitialized variable is used.
5197 * expression.cs (LocalVariableReference.DoResolve): Ditto.
5199 2007-06-22 Marek Safar <marek.safar@gmail.com>
5201 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
5202 not found error handling.
5204 * expression.cs (ArrayCreation): Removed redundant fields and little bit
5206 (ArrayCreation.ResolveArrayElement): To be ready to customization.
5207 (ArrayCreation.DoResolve): Simplified.
5208 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
5209 its own resolve process.
5210 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
5212 2007-06-20 Marek Safar <marek.safar@gmail.com>
5214 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
5217 2007-06-20 Marek Safar <marek.safar@gmail.com>
5219 * cs-tokenizer.cs: Removed var related stuff.
5221 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
5222 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
5223 a type and a keyword at same time.
5225 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
5228 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
5229 implicitly typed arrays, more changes will follow.
5231 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
5233 2007-06-19 Marek Safar <marek.safar@gmail.com>
5235 * ecore.cs (VarExpr): Removed Handled field.
5237 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
5238 build-in assign functionality.
5239 (ForEach.Resolve): Removed all implicitly typed local variable code and
5241 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
5242 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
5244 2007-06-18 Marek Safar <marek.safar@gmail.com>
5246 * assign.cs: Removed implicitly typed local variable check.
5248 * expression.cs (LocalVariableReference.DoResolve): Add check for self
5249 referencing implicitly typed local variable.
5250 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
5253 * statement.cs (Fixed): Removed unsupported implicitly typed local
5256 2007-06-15 Marek Safar <marek.safar@gmail.com>
5258 * decl.cs (MemberName): Moved all Unbound stuff to parser.
5260 2007-06-14 Marek Safar <marek.safar@gmail.com>
5262 A fix for bugs #81855 and #76274
5263 * attribute.cs (AttachTo): Always set owner for global attributes to
5266 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
5269 * cs-parser.jay: Assembly and module attributes must precede all other
5270 elements except using clauses and extern alias declarations.
5272 2007-06-13 Marek Safar <marek.safar@gmail.com>
5274 A fix for bug #81748
5276 * expression.cs: More checks for non ISO-1 features.
5278 2007-06-12 Marek Safar <marek.safar@gmail.com>
5280 A fix for bug #81807
5281 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
5282 present inside switch statement and it is required by nullable check.
5284 2007-06-12 Marek Safar <marek.safar@gmail.com>
5286 A fix for bug #81840
5287 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
5288 when type matching fails.
5290 * namespace.cs: Tiny error message change.
5292 2007-06-12 Marek Safar <marek.safar@gmail.com>
5294 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
5295 reporting. Added automatic property check.
5297 * class.cs: Updated after CheckAbstractAndExtern relocation.
5298 (AEventPropertyAccessor.GetSignatureForError): Customized.
5300 2007-06-11 Marek Safar <marek.safar@gmail.com>
5302 * class.cs (DefineBaseTypes): Base type can be undefined.
5304 * ecore.cs (TypeLookup): Minor refactoring.
5305 (DoResolveAsTypeStep): Removed redundant check.
5307 * namespace.cs (Lookup): Removed redundant check.
5309 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
5310 ResolveAsTypeTerminal step.
5311 (BootstrapCorlib_*): Simplified.
5312 (PopulateCoreType): Core types can be now external.
5314 2007-06-07 Marek Safar <marek.safar@gmail.com>
5316 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
5318 (InferTypeArguments): Infers anonymous expression type arguments.
5319 (Compatible): Split to Compatible and InferTypeArguments.
5321 * lambda.cs: Updated.
5323 2007-06-08 Marek Safar <marek.safar@gmail.com>
5325 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
5327 2007-06-07 Raja R Harinath <harinath@gmail.com>
5329 Fix #80477, cs0135-2.cs, cs0135-3.cs
5330 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
5331 names to the "known" variables list.
5332 (Block.CheckInvariantMeaningInBlock): Handle the fact the
5333 parameter names are also "known".
5334 (Block.CheckError136): Remove.
5335 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
5338 2007-06-07 Marek Safar <marek.safar@gmail.com>
5340 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
5342 2007-06-06 Marek Safar <marek.safar@gmail.com>
5344 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
5345 internal error not an user error.
5347 * expression.cs (IsApplicable): Refactored to make debugging easier.
5349 * support.cs: More tricks for non-mono runtimes.
5351 * typemanager.cs (CoreLookupType): Made public.
5352 (InitSystemCore): All linq specific stuff moved to linq.cs
5354 2007-06-05 Marek Safar <marek.safar@gmail.com>
5356 * typemanager.cs (CSharpSignature): One more missing build-in types
5358 More tricks for non-mono runtime.
5360 2007-06-05 Raja R Harinath <harinath@gmail.com>
5362 * statement.cs (Block.CheckError136_InParents): Remove.
5363 (Block.AddVariable): Use GetParameterInfo instead.
5364 (ToplevelBlock.ProcessArguments): Likewise.
5366 2007-06-04 Raja R Harinath <rharinath@novell.com>
5368 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
5370 (ToplevelBlock.GetParameterInfo): Split out of ...
5371 (ToplevelBlock.GetParameterRefernce): ... this.
5372 (ToplevelBlock.ParameterMap): Remove.
5373 * expression.cs (ParameterReference): Update to use
5374 ToplevelParameterInfo.
5376 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
5379 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
5380 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
5382 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
5383 (ToplevelBlock.ProcessParameters) ... here.
5384 (ToplevelBlock..ctor): Invoke it.
5386 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
5389 * statement.cs (IKnownVariable): New interface.
5390 (LocalInfo): Implement it.
5391 (ToplevelParameterInfo): New class.
5392 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
5393 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
5394 GetKnownVariableInfo.
5396 2007-06-03 Raja R Harinath <harinath@gmail.com>
5398 Partly speed up CS0136 error checks.
5399 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
5400 'recurse' parameter.
5401 (Block.DoCheckError136): Only check errors in parameters. Move
5402 local variable checks ...
5403 (Block.AddVariable): ... here, and ...
5404 (ToplevelBlock.ResolveMeta): ... here.
5406 2007-06-02 Raja R Harinath <harinath@gmail.com>
5408 * statement.cs (Block.IsChildOf): Remove.
5410 * statement.cs (Statement.Clone): Move special case code ...
5411 (Block.CloneTo): ... here.
5413 2007-05-29 Raja R Harinath <rharinath@novell.com>
5415 * statement.cs (ToplevelBlock.container): Remove field. It's
5416 redundant with 'Parent'.
5417 (ToplevelBlock.ContainerBlock): Remove accessor.
5418 (ToplevelBlock..ctor): Update to changes. Register anonymous
5419 child with parent here, ...
5420 * cs-parser.jay (end_anonymous): ... not here. Don't modify
5422 (start_anonymous): Don't save current_block.
5423 (top_current_block): Remove.
5425 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
5426 (Block.Resolve): Update to changes.
5427 (Block..ctor): Move setting of "correct" 'Toplevel'
5428 and 'Explicit' fields to ...
5429 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
5431 2007-05-27 Raja R Harinath <harinath@gmail.com>
5434 * statement.cs (Block.Implicit): Remove.
5435 (Block): Update to changes.
5436 * flowanalysis.cs: Likewise.
5438 Mildly speed up CheckInvariantMeaningInBlock
5439 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
5440 Recursively call AddKnownVariable to all enclosing blocks.
5441 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
5442 Remove recursive calls.
5443 (Block): Update to changes.
5445 New ExplicitBlock invariants
5446 * statement.cs (Block.Explicit): New field. It points to the
5447 immediately enclosing non-implicit block.
5448 (Block..ctor): Maintain the invariant.
5449 * cs-parser.jay: Take advantage of invariant.
5451 Introduce ExplicitBlock
5452 * statement.cs (ExplicitBlock): New.
5453 (ToplevelBlock): Derive from it.
5454 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
5456 (Block.Implicit): Update to changes.
5457 * cs-parser.jay: Update to changes.
5460 * codegen.cs (EmitContext.IsLastStatement): Remove.
5461 * statement.cs (Block.DoEmit): Update to changes.
5463 2007-05-25 Raja R Harinath <rharinath@novell.com>
5465 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
5466 modifying current_block directly.
5468 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
5470 * class.cs: Implemented automatic properties (C# 3.0)
5471 Thanks to Marek for the help.
5473 2007-05-23 Raja R Harinath <rharinath@novell.com>
5475 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
5476 variable as assigned, note also that all its components are
5478 (MyBitVector.SetRange): New. Function to set multiple bits to true.
5480 2007-05-19 Marek Safar <marek.safar@gmail.com>
5482 * anonymous.cs, class.cs: Emit Compiler generated attribute when
5483 member is marked as compiler generated.
5485 * decl.cs (MemberCore): Refactored ModFlags into property.
5487 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
5488 (Check): Check only accessibility modifiers.
5490 2007-05-18 Raja R Harinath <rharinath@novell.com>
5492 Track all assignable slots in one bit array
5493 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
5494 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
5495 logic from VariableMap constructor here. Use the same 'offset'
5496 variable that's later used for computing offsets of local
5498 * flowanalysis.cs (UsageVector.parameters): Remove.
5499 (UsageVector): Update to changes.
5500 (VariableMap): Remove.
5502 Avoid creating ParameterMap in every block
5503 * statement.cs (Block.ParameterMap): Move ...
5504 (ToplevelBlock.ParameterMap): ... here.
5505 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
5507 * flowanalysis.cs (FlowBranching.param_map): Remove.
5508 (FlowBranching.UsageVector): Update to changes.
5509 (FlowBranchingToplevel.CheckOutParameters): Likewise.
5511 * statement.cs (Block.CloneTo): Clone Toplevel field too.
5513 * expression.cs (ParameterReference): Distinguish between block
5514 where parameter was referenced and declared.
5516 2007-05-18 Marek Safar <marek.safar@gmail.com>
5518 * flowanalysis.cs, statement.cs: Put back improved error handling.
5520 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
5524 Imporved object and collection initialization (C# 3.0).
5526 2007-05-15 Marek Safar <marek.safar@gmail.com>
5528 A fix for bug #81380
5529 * expression.cs (Is.DoResolve): Only value types have constant `is'
5532 2007-05-15 Raja R Harinath <rharinath@novell.com>
5534 * statement.cs (ToplevelBlock.child): Remove.
5536 2007-05-15 Raja R Harinath <harinath@gmail.com>
5538 Rationalize ResolveMeta: refactoring
5539 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
5540 out constant handling code into ...
5541 (Block.DoResolveConstants): ... this.
5543 Rationalize ResolveMeta: kill local_map
5544 * statement.cs (Block.local_map, Block.LocalMap): Remove.
5545 (Block.AssignableSlots): New.
5546 (Block.ResolveMeta): Make protected. Don't create a VariableMap
5547 for locals -- move code from VariableMap here. Avoid unnecessary
5549 * flowanalysis.cs (FlowBranching.local_map): Remove.
5550 (FlowBranching..ctor): Use Block.AssignableSlots.
5551 (VariableMap): Remove unused constructors.
5553 2007-05-11 Raja R Harinath <rharinath@novell.com>
5555 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
5557 2007-05-11 Marek Safar <marek.safar@gmail.com>
5559 * typemanager.cs (IsFriendAssembly): Should not be called for building
5562 2007-05-09 Marek Safar <marek.safar@gmail.com>
5564 * literal.cs (NullConstant): Print null in all cases.
5566 * expression.cs (Binary.ResolveOperator): Implemented delegate
5567 comparison based on C# 2.0 changes.
5569 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
5571 This code is contributed under the MIT X11 license
5573 The following enables support for several C# 3.0 language features:
5575 * cs-tokenizer.cs: Added support for the "var" keyword.
5577 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
5578 Added VarExpr class to facilitate type inferencing.
5580 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
5581 to support anonymous types.
5583 * assign.cs: Added support for type inferencing and initialization.
5585 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
5587 * expression.cs: Added implicit array support to ArrayCreation.
5588 Added 5 types and 1 interface:
5590 IInitializable Implementing classes can inject initializing
5591 statements after object instantiation.
5593 Initializer Stores data for object initialization.
5595 AnonymousType An expression for anonymous types.
5597 AnonymousTypeParameter Stores data about an anonymous type's field.
5599 NewInitialize An expression for object initialization.
5601 CollectionInitialize An expression for collection initialization.
5603 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
5606 2007-05-06 Marek Safar <marek.safar@gmail.com>
5608 A fix for bug #81500
5609 * cs-tokenizer.cs: Add special handling for coalescing operator.
5611 2007-05-06 Marek Safar <marek.safar@gmail.com>
5613 A fix for bug #81529
5614 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
5615 its value from base class until it is redefined.
5617 2007-05-02 Raja R Harinath <rharinath@novell.com>
5619 Fix regression in cs0631-3.cs
5620 * cs-parser.jay (operator_declarator): Add opt_attributes to error
5621 fallback. Make error fallback catch more cases.
5623 2007-05-01 Miguel de Icaza <miguel@novell.com>
5625 * cs-parser.jay: Allow parameters in operator declarations to have
5628 2007-04-27 Miguel de Icaza <miguel@novell.com>
5630 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
5633 * lambda.cs (ContextualReturn.Resolve): An expression is valid
5634 inside the ContextualReturn, it does not have to be an
5635 ExpressionStatement.
5637 2007-04-24 Miguel de Icaza <miguel@novell.com>
5639 * lambda.cs (ContextualReturn.Resolve): if the return type is not
5642 2007-04-23 Miguel de Icaza <miguel@novell.com>
5644 * anonymous.cs (AnonymousContainer): split the virtual Resolve
5645 method in two methods: ResolveNoDefine and Resolve.
5647 ResolveNoDefine will stop just after ResolveTopBlock has been
5650 Resolve will then continue by creating a method and issuing the
5651 call to method.Define ().
5653 (AnonymousMethod): Split and implement the new Resolve and
5654 ResolveNoDefine as well.
5656 * lambda.cs (LambdaExpression): Split the anonymous method
5657 resolution code into a separate routine (CoreCompatibilityTest)
5658 from DoCompatibleTest.
5660 (LambdaExpression.TryBuild): New method, this method tries to
5661 build the LambdaExpression with the given set of types to be used
5662 as the types for the various parameters of the lambda expression.
5664 If the compilation succeed with the given types, the infered type
5665 of the Anonymous method is returned, otherwise null is returned.
5667 2007-04-23 Marek Safar <marek.safar@gmail.com>
5669 A fix for bug #81414
5670 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
5672 2007-04-22 Miguel de Icaza <miguel@novell.com>
5674 * cs-tokenizer.cs: Change various identifiers here from the
5675 camelCasing to the recommended Linux-like style for instance
5676 variables from the Coding Guidelines.
5678 2007-04-19 Martin Baulig <martin@ximian.com>
5681 (Convert.ImplicitReferenceConversionCore): Allow conversions from
5682 System.Enum to System.ValueType.
5684 2007-04-13 Martin Baulig <martin@ximian.com>
5686 Rewrote implicit reference conversions. We need to distinguish
5687 between implicit reference conversions (13.1.4) and implicit
5688 boxing conversions (13.1.5).
5690 According to the spec, there's an an implicit conversion
5691 "From a one-dimensional array-type S[] to IList<T> and base
5692 interfaces of this interface, provided there is an implicit
5693 reference conversion from S to T." Note that this does not
5694 include boxing conversions.
5697 (Convert.ImplicitTypeParameterBoxingConversion): New method.
5698 (Convert.ImplicitReferenceConversion): Split into
5699 ImplicitReferenceConversionCore() and
5700 ImplicitBoxingConversionExist().
5701 (Convert.ImplicitReferenceConversionExists): Use the new
5702 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
5704 2007-04-12 Martin Baulig <martin@ximian.com>
5706 * convert.cs (Convert.ImplicitReferenceConversion): Move the
5707 `TypeManager.null_type' checks up to the top of the method.
5709 2007-04-11 Marek Safar <marek.safar@gmail.com>
5711 A fix for bug #81350
5712 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
5715 2007-04-11 Martin Baulig <martin@ximian.com>
5717 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
5718 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
5719 to make this work for generic classes; fixes #79561.
5721 2007-04-11 Martin Baulig <martin@ximian.com>
5723 * expression.cs (As): Add support for nullable types; fixes #79371.
5725 2007-04-11 Martin Baulig <martin@ximian.com>
5727 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
5728 `type.FullName' is null; fixes #80243.
5730 2007-04-11 Martin Baulig <martin@ximian.com>
5732 * expression.cs (Invocation.IsApplicable): Don't modify the method
5733 if type inference succeeded, but the method was not applicable.
5736 2007-04-10 Marek Safar <marek.safar@gmail.com>
5738 A fix for bug #81324
5739 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
5740 internal and external namespaces containers.
5742 2007-04-10 Martin Baulig <martin@ximian.com>
5744 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
5745 TypeManager.DropGenericMethodArguments() so we also call
5746 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
5748 2007-04-10 Martin Baulig <martin@ximian.com>
5750 * iterators.cs (Iterator.CreateIterator): Don't crash if
5751 `method.ReturnType' is null. This happens if something went wrong
5752 while resolving that typ (we already reported an error in this case).
5754 2007-04-10 Martin Baulig <martin@ximian.com>
5756 * expression.cs (New.DoResolve): Don't call CheckComImport() on
5757 generic interfaces; report the CS0144 directly.
5759 2007-04-10 Martin Baulig <martin@ximian.com>
5761 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
5762 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
5764 2007-04-10 Martin Baulig <martin@ximian.com>
5766 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
5768 2007-04-09 Raja R Harinath <rharinath@novell.com>
5771 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
5772 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
5775 * statement.cs (For.Resolve): If resolution fails, use
5778 2007-04-08 Marek Safar <marek.safar@gmail.com>
5780 * anonymous.cs (MakeName): Make faster and zero-based.
5781 (VerifyExplicitParameterCompatibility): Back to mode where generic
5782 parameter is ignored.
5783 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
5785 * class.cs (EmitType): Method can emit another new method.
5787 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
5789 * driver.cs: Updated.
5791 * lambda.cs: Reuse predefined empty parameters.
5793 * parameter.cs: Updated
5795 * support.cs: Implemented InflateTypes.
5797 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
5798 (InitSystemCore): Introduced to isolate 3.0 dependencies.
5800 2007-04-03 Martin Baulig <martin@ximian.com>
5804 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
5805 version of TypeManager.IsOverride() which also works with generic
5808 2007-04-03 Martin Baulig <martin@ximian.com>
5813 (Convert.ExplicitReferenceConversion): We need to cast when
5814 converting from IList<T> to S[].
5816 2007-04-01 Marek Safar <marek.safar@gmail.com>
5818 * decl.cs (FindExtensionMethods): Consider all candidates with same name
5821 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
5823 2007-03-31 Marek Safar <marek.safar@gmail.com>
5825 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
5826 argument and return type inferring.
5828 * codegen.cs (InferReturnType): Flag whether return can be inferred.
5829 (ReturnType): Turned to property.
5831 * statement.cs (Return): Implemented return type inferring.
5833 * support.cs (ReflectionParameters): Use local types if possible.
5835 2007-03-30 Raja R Harinath <rharinath@novell.com>
5837 * flowanalysis.cs (FlowBranching.Reachability): Remove.
5838 (FlowBranching.UsageVector): Update to changes.
5840 Prepare to kill 'Reachability'
5841 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
5842 argument of constructor.
5844 2007-03-29 Raja R Harinath <rharinath@novell.com>
5846 Prepare to kill 'Reachability'
5847 * flowanalysis.cs (UsageVector.is_unreachable): New.
5848 (UsageVector): Update to maintain 'is_unreachable' in parallel to
5849 'reachability', and verify they're consistent.
5852 * expression.cs (New.EmitStatement): Handle type parameters here too.
5854 2007-03-29 Martin Baulig <martin@ximian.com>
5859 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
5860 CompilerGeneratedClass.
5861 (ScopeInfo.EmitScopeInstance): Make this protected.
5862 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
5863 `ec.CurrentAnonymousMethod.Scope == Scope'.
5865 * statement.cs (Block.ScopeInfo): Make this a property.
5867 2007-03-27 Raja R Harinath <harinath@gmail.com>
5869 Prepare to kill 'Reachability'
5870 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
5871 (FlowBranching.UsageVector.Reachability): Remove property.
5872 (FlowBranching.UsageVector.IsUnreachable): New property.
5873 (FlowBranching.UsageVector.ResetBarrier): New.
5874 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
5875 * codegen.cs, statement.cs: Update to changes.
5877 2007-03-27 Martin Baulig <martin@ximian.com>
5882 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
5885 2007-03-26 Raja R Harinath <rharinath@novell.com>
5887 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
5888 instead of TriState. Remove all mention of TriState.
5890 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
5891 replaced by a boolean. Add boolean 'is_unreachable' field, check
5892 and maintain invariants.
5894 2007-03-25 Marek Safar <marek.safar@gmail.com>
5896 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
5898 2007-03-25 Marek Safar <marek.safar@gmail.com>
5900 * expression.cs: Stop using obsolete 2.0 opcodes.
5902 2007-03-25 Marek Safar <marek.safar@gmail.com>
5904 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
5905 one of the latests Martin's fixes.
5907 2007-03-23 Miguel de Icaza <miguel@novell.com>
5909 * expression.cs: On BigEndian systems, swap the bytes, temporary
5910 solution until we get a new bitconverter class.
5912 2007-03-23 Martin Baulig <martin@ximian.com>
5916 * decl.cs (MemberCache.AddMembers): Add generic methods both as
5917 "Method" and "Method`1". Normally, a cache lookup is done on the
5918 "Method" form (ie. without the generic arity), but this one makes
5919 lookups on the full form work as well.
5921 2007-03-22 Raja R Harinath <rharinath@novell.com>
5923 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
5926 2007-03-20 Bill Holmes <billholmes54@gmail.com>
5928 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
5929 ordered_member_list, to TypeBuilder to store members to be defined
5930 in the order they were parsed in.
5931 - ordered_explicit_member_list contains all properties indexers
5932 and methods that are defined as explicit implementation of an
5933 interface or base class.
5934 - ordered_member_list contains all properties indexers and methods
5935 that are not defined as explicit implementation of an interface
5938 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
5939 functionality in these removed classes has been replaced with
5940 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
5941 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
5943 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
5944 to CheckForDuplications inside GetMethod and SetMethod Define Method
5945 to handle method property and indexer name conflicts.
5949 All code is contributed under the MIT/X11 license.
5951 2007-03-20 Martin Baulig <martin@ximian.com>
5953 * class.cs (TypeContainer.Interfaces): Removed; they're now
5954 included in `TypeContainer.Types'.
5956 2007-03-20 Martin Baulig <martin@ximian.com>
5958 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
5960 * class.cs (TypeContainer.CreateType): New public method. This is
5961 now called before DefineType() to create the TypeBuilders.
5962 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
5963 has already been created by CreateType().
5964 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
5965 don't resolve our base classes here; this has been moved into
5966 DefineBaseTypes(). We're now called from CreateType().
5967 (TypeContainer.DefineBaseTypes): New private method; resolve our
5968 base classes here. We're now called from DefineType().
5971 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
5972 our types first to create all the TypeBuilders. After that, call
5973 TypeContainer.DefineType() on all the types which'll resolve their
5974 base classes and setup the resolve order.
5976 2007-03-20 Martin Baulig <martin@ximian.com>
5978 * class.cs (TypeContainer.Enums): Removed; they're now included in
5979 `TypeContainer.Types'.
5981 2007-03-20 Martin Baulig <martin@ximian.com>
5984 (TypeContainer.DefineType): Don't call ResolveMembers() here.
5985 (TypeContainer.DoResolveMembers): Call DefineType() on our
5986 `compiler_generated' classes; moved here from DefineNestedTypes().
5989 (RootContext.ResolveTree): Call ResolveMembers() on all
5990 TypeContainer's in the `type_container_resolve_order'.
5992 2007-03-19 Marek Safar <marek.safar@gmail.com>
5994 * class.cs: Use corlib to handle InternalMethodImplAttribute.
5996 2007-03-17 Marek Safar <marek.safar@gmail.com>
5998 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
5999 implementation flags.
6001 2007-03-17 Marek Safar <marek.safar@gmail.com>
6003 * class.cs: More optimizations for type parameters.
6005 2007-03-15 Marek Safar <marek.safar@gmail.com>
6007 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
6009 * ecore.cs, parameter.cs: More common code for both corlibs.
6011 * typemanager.cs (IsGenericMethod): Simplified.
6013 2007-03-15 Raja R Harinath <rharinath@novell.com>
6015 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6017 * statement.cs, iterators.cs, lambda.cs: Update to changes.
6019 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
6020 unconditionally. Simplify explanation.
6021 (Try.Resolve, Using.Resolve): Likewise.
6023 2007-03-15 Martin Baulig <martin@ximian.com>
6027 * decl.cs (DeclSpace): If we're a partial class, use our
6028 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
6030 2007-03-15 Raja R Harinath <rharinath@novell.com>
6032 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6034 (FlowBranching.UsageVector): Update to changes.
6035 (FlowBranching.MergeSiblings): Likewise.
6036 * statement.cs: Likewise.
6038 2007-03-15 Martin Baulig <martin@ximian.com>
6043 (MemberCache): Added a special .ctor for type parameters.
6046 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
6049 2007-03-09 Martin Baulig <martin@ximian.com>
6051 * enum.cs (Enum): Make this a TypeContainer.
6052 (EnumMember): Derive from `Const'.
6055 (Const.DoResolveValue): New protected virtual method; move most of
6056 the functionality of ResolveValue() here so we can override it in
6058 (Const.CreateConstantReference): Make this virtual.
6060 * class.cs (Kind): Add `Kind.Enum'.
6061 (TypeContainer.Emit): Don't emit the enums here; they're already
6062 in the `RootContext.typecontainer_resolve_order'.
6064 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
6065 here; they're already in the `typecontainer_resolve_order'.
6067 * ecore.cs (EnumConstant.ConvertImplicitly): Add
6068 TypeManager.DropGenericTypeArguments().
6071 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
6072 (TypeManager.IsEnumType): Likewise.
6073 (TypeManager.EnumToUnderlying): Likewise.
6074 (TypeManager.IsEqual): Add support for enums.
6076 2007-03-12 Raja R Harinath <rharinath@novell.com>
6078 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
6079 DefaultParameterValueAttribute to be undefined, say if System.dll
6082 2007-03-11 Marek Safar <marek.safar@gmail.com>
6084 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
6087 2007-03-10 Marek Safar <marek.safar@gmail.com>
6089 * class.cs, parameter.cs: Unified parameters verification.
6091 2007-03-08 Martin Baulig <martin@ximian.com>
6093 * cs-parser.jay (constructor_header): Pass the location to the
6094 newly created TopLevelBlock.
6096 2007-03-07 Martin Baulig <martin@ximian.com>
6098 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
6100 2007-03-06 Miguel de Icaza <miguel@novell.com>
6102 * convert.cs (ExplicitReferenceConversionExists): Sync this method
6103 with the changes from David, fixes the build.
6105 2007-03-05 David Mitchell <dmitchell@logos.com>
6107 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
6108 and its base interfaces to a one-dimensional array type S[],
6109 provided there is an implicit or explicit reference conversion
6112 2007-03-03 Marek Safar <marek.safar@gmail.com>
6114 * cs-tokenizer.cs: Implemented basic linq grammar.
6116 * driver.cs: Set linq lang version on demand.
6118 2007-02-26 Marek Safar <marek.safar@gmail.com>
6120 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
6122 2007-02-25 Marek Safar <marek.safar@gmail.com>
6124 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
6127 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
6129 Check property and event extern attributes.
6131 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
6134 2007-02-24 Marek Safar <marek.safar@gmail.com>
6136 A fix for bug #80407
6137 * ecore.cs: Don't report ambiguity error when methods have same parent.
6139 2007-02-23 Marek Safar <marek.safar@gmail.com>
6141 A fix for bug #80878
6142 * class.cs, cs-parser.jay: Event property can host anonymous methods.
6144 2007-02-22 Marek Safar <marek.safar@gmail.com>
6146 * attribute.cs: Enable ExtensionAttribute presence test.
6148 2007-02-22 Marek Safar <marek.safar@gmail.com>
6150 * class.cs: Warn about missing GetHashCode only when Equals is override.
6152 * decl.cs: Check accessibility of type arguments.
6154 * typemanager.cs: Correctly report nullable array.
6156 2007-02-20 Marek Safar <marek.safar@gmail.com>
6158 * class.cs, report.cs: Capture more details when things go wrong.
6160 2007-02-20 Marek Safar <marek.safar@gmail.com>
6162 A fix for bug #80650
6163 * cs-parser.jay: Anonymous container starts at constructor declaration
6164 and not at block beginning because it has to be usable in constructor
6167 * statement.cs: Use context location and not block one for error reporting.
6169 2007-02-18 Marek Safar <marek.safar@gmail.com>
6171 A fix for bug #78712
6172 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
6175 2007-02-18 Marek Safar <marek.safar@gmail.com>
6177 A fix for bug #80493 by Atsushi Enomoto
6178 * cs-parser.jay: Ignore invalid attribute target.
6180 2007-02-18 Marek Safar <marek.safar@gmail.com>
6182 * cs-tokenizer.cs: Ignore '\0' as white space character.
6184 2007-02-17 Miguel de Icaza <miguel@novell.com>
6186 * cs-parser.jay: Add support for lambda expressions to the mcs
6189 * lambda.cs: Only clone when we are probing, not on the final call
6190 (Compatible is the final call).
6192 * statement.cs (CloneContext): Introduce class to provide block
6193 remapping during clone.
6195 All statements Clone themselves now.
6197 (Clone): special handling for blocks, when we clone a block, we
6198 register the block inside this routine, as children of the block
6199 might trigger a lookup.
6201 * expression.cs: Add support for CloneContext in all expressions.
6203 2007-02-17 Marek Safar <marek.safar@gmail.com>
6205 A fix for bug #80493
6206 * statement.cs: Report ambiguous warning when interfaces are not related.
6208 2007-02-15 Marek Safar <marek.safar@gmail.com>
6210 C# 3.0 extension methods.
6212 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
6213 cannot be used directly.
6215 * class.cs (Class.Emit): Emit extension attribute if any class method
6216 is extension method.
6217 (Method.Define): Add basic extension method validation conditions.
6218 (Method.Emit): Emit extension attribute for method.
6220 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
6221 extension method exists. Currently we follow same approach as Microsoft
6222 does, emit even if a method or a class are private but this can change
6225 * cs-parser.jay: Add handling of `this' keyword in method parameters
6228 * decl.cs (DeclSpace.IsStaticClass): New property.
6229 (MemberCache.FindExtensionMethods): Looks for extension methods with
6230 defined name and extension type.
6232 * doc.cs: Updated after OverloadResolve changes.
6234 * driver.cs: Add new soft reference to System.Core.dll.
6236 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
6237 (ExtensionMethodGroupExpr): Represents group of extension methods.
6239 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
6240 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
6241 to MethodGroupExpr and made non-static for easier customization.
6242 (Invocation.DoResolve): Add extension method lookup when no standard
6244 (MemberAccess.DoResolve): Try extension methods if no member exists.
6246 * modifiers.cs: Add METHOD_EXTENSION modifier.
6248 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
6249 as well as candidate extension type.
6250 (ComputeNamespaces): When assembly constains extension methods registers
6252 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
6253 extension method lookup.
6254 (Namespace.LookupExtensionMethod): Looks for extension method in this
6256 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
6257 find a method which matches name and extensionType.
6259 * parameter.cs (Parameter): Add This modifer.
6260 (HasExtensionMethodModifier): New property.
6261 (Resolve): Add extension parameter check.
6262 (ModFlags): turned to property to exclude this modifier as it is not real
6264 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
6266 * support.cs (ParameterData): Add ExtensionMethodType.
6267 (ReflectionParameters): Implemented ExtensionMethodType interface property.
6269 * typemanager.cs: Add type and ctor extension attribute type.
6271 2007-02-15 Miguel de Icaza <miguel@novell.com>
6273 * report.cs (DisableErrors, EnableErrors): used to prevent error
6274 output when we are "trying" to compile various methods with
6277 * ecore.cs (Expression): Add Clone method that calls the virtual
6278 CloneTo method. The current CloneTo method in Expression throws
6279 an exception so we can track down all the places where this must
6280 be implemented (not using abstract, because that would be a lot of
6281 up-front-work before we can start testing the implementation
6284 Important: we only need Clone capabilities for expressions created
6285 by the parser, as the expressions we will be cloning are
6286 expressions in the pre-resolved state. This vastly simplifies
6289 (SimpleName): Add CloneTo that does nothing.
6290 (EmptyCast): Add CloneTo.
6292 * expression.cs (Binary): Implement CloneTo.
6293 (Invocation.IsApplicable): Store the current ec in
6294 EmitContext.TempEc and restore it on return. This is used so we
6295 do not have to sprinkle hundres of methods with an extra
6296 EmitContext, we know that the only user is the lambda expression
6297 ImplicitConversionExists code.
6299 (Argument): Add Cloning capabilities.
6300 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
6301 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
6302 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
6303 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
6304 IndexerAccess): Add Clone capability.
6306 (LocalVariableReference, This): TODO: needs cloned Block mapping.
6308 (Argument): Add cloning capability.
6310 * assign.cs (Assign): Implement CloneTo.
6312 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
6314 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
6315 version by calling Convert with the EmitContext (that we are
6316 currently storing in ec, this is not great, but will do for now,
6317 to avoid passing EmitContext parameters to hundreds of functions
6318 that do not need them now).
6320 (SetExpression): Remove, it is not needed.
6322 (ContextualReturn): Implement CloneTo.
6324 * statement.cs (Statement): Implement cloning infrastructure,
6325 similar to expressions.
6327 (Block): Partial implementation of Clone for statements.
6329 (Return): Implement clone.
6331 * constant.cs (Constant.CloneTo): New method, does nothing.
6333 * codegen.cs (TempEc): Add a static EmitContext as a temporary
6334 solution, until we decide how to exactly do this.
6336 2007-02-14 Marek Safar <marek.safar@gmail.com>
6338 A fix for bug #80493
6339 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
6340 a property is override we need to use second accessor.
6342 2007-02-13 Marek Safar <marek.safar@gmail.com>
6344 A fix for bug #80418
6345 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
6348 2007-02-13 Marek Safar <marek.safar@gmail.com>
6350 Another fix for bug #80749
6351 * pending.cs: Abstract class has priority over interfaces.
6353 2007-02-13 Marek Safar <marek.safar@gmail.com>
6355 Another fix for bug #80749
6356 * pending.cs: Abstract class has priority over interfaces.
6358 2007-02-13 Marek Safar <marek.safar@gmail.com>
6360 Another fix for bug #80749
6361 * pending.cs: Abstract class has priority over interfaces.
6363 2007-02-13 Marek Safar <marek.safar@gmail.com>
6365 Another fix for bug #80749
6366 * pending.cs: Abstract class has priority over interfaces.
6368 2007-02-13 Marek Safar <marek.safar@gmail.com>
6370 * class.cs Better error message.
6372 * driver.cs: Add shorter versions of -optimize option.
6374 2007-02-13 Martin Baulig <martin@ximian.com>
6376 * class.cs (Constructor.Emit): Check the return value of
6377 ec.ResolveTopBlock() and return on error.
6379 2007-02-13 Raja R Harinath <rharinath@novell.com>
6381 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
6382 message to fix error message regression.
6384 2007-02-12 Marek Safar <marek.safar@gmail.com>
6386 * delegate.cs: Delegate creation expression cannot be of Nullable type.
6388 2007-02-12 Marek Safar <marek.safar@gmail.com>
6390 A fix for bug #80749
6391 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
6392 its parent container.
6394 * class.cs (DefineFieldInitializers): Each initializer can has different
6397 * const.cs: Updated.
6399 2007-02-11 Miguel de Icaza <miguel@novell.com>
6401 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
6402 now all the heavy lifting to check that embedded statements or
6403 expressions have the right form is done in the ContextualReturn.
6405 (ContextualReturn): New class.
6407 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
6408 method that can be invoked to report 201, so we do not replicate
6411 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
6413 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
6414 treating tabs as spaces.
6416 2007-02-09 Marek Safar <marek.safar@gmail.com>
6418 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
6419 * assign.cs: Use full implicit conversion for right side check.
6421 2007-02-09 Marek Safar <marek.safar@gmail.com>
6423 * statement.cs (Switch): Switch over boolean type is not standardized.
6425 2007-02-08 Marek Safar <marek.safar@gmail.com>
6427 A fix for bug #80755
6428 * decl.cs (FindBaseEvent): Don't use method cache for events.
6430 2007-02-07 Marek Safar <marek.safar@gmail.com>
6432 * cs-parser.jay: Better syntax error handling.
6434 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
6435 instead of underlying type value.
6437 2007-02-06 Marek Safar <marek.safar@gmail.com>
6439 * driver.cs: Check define identifier before is registered.
6441 * namespace.cs: Use existing error message.
6443 * report.cs: New warning.
6445 2007-02-06 Marek Safar <marek.safar@gmail.com>
6447 A fix for bug #80742
6448 * expression.cs: Delegate Invoke method can be called directly.
6450 2007-02-06 Marek Safar <marek.safar@gmail.com>
6452 A fix for bug #80676
6453 * class.cs (IsEntryPoint): The Main method can have params modifier.
6455 2007-02-04 Miguel de Icaza <miguel@novell.com>
6457 * parameter.cs (Parameter, Parameters): Add Clone method.
6459 * anonymous.cs (Compatible): Turn method into virtual method, so
6460 LambdaExpression can implement a different behavior.
6462 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
6463 out the basic checking here, so it can be used by
6466 * lambda.cs: Introduce "Compatible" function that will do the
6469 2007-02-02 Marek Safar <marek.safar@gmail.com>
6471 * attribute.cs: Unified one error message.
6473 * class.cs (Class): Use type attributes and not properties to test static
6475 (IsEntryPoint): Don's pass local variable.
6477 * convert.cs: Removed duplicate check.
6479 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
6481 * driver.cs: Don't crash when soft reference does not exist.
6483 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
6484 (UsingEntry): Removed redundant allocation.
6486 * parameter.cs: Add fast path for type parameters.
6488 * support.cs: Don't allocate attribute when it's not used.
6490 2007-01-30 Miguel de Icaza <miguel@novell.com>
6493 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
6494 this into a virtual method, so we can override it in LambdaExpression.
6496 * driver.cs: Improve diagnostics in case of failure.
6498 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
6499 write a function that is slightly more complex and that parses:
6501 type identifier [, type identifier]* )
6503 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
6506 (canEmpty ? i >= 0 : i > 0)
6508 2007-01-30 Raja R Harinath <rharinath@novell.com>
6510 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
6511 exception on possibly valid code.
6513 2007-01-29 Raja R Harinath <rharinath@novell.com>
6515 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
6517 (parse_opt_type_arguments): Remove. It's almost the same as
6519 (parse_namespace_or_typename): Use parse_less_than.
6521 2007-01-28 Miguel de Icaza <miguel@novell.com>
6523 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
6524 this bug took a few hours to find, because the state saved and
6525 restored by PushPosition and PopPosition was ignoring the state of
6526 parse_generic_less_than.
6528 I can also now remove the handling of OP_LT and OP_GT, this solves
6531 * cs-tokenizer.cs: store the location for the ARROW token, we use
6534 (PushPosition, PopPosition): save/restore also `current_token',
6535 restore `parse_generic_less_than' (was missing).
6537 (parse_opt_type_arguments): use parse_type, not
6538 parse_namespace_or_typename to parse types.
6540 * lambda.cs: Empty new file, will eventually have the lambda
6541 expression implementation.
6543 * lambda.test: used to test the internal tokenizer.
6545 * report.cs (FeatureIsNotISO1): Rename from
6546 FeatureIsNotStandardized, because it was about the language level
6547 (1 vs 2) it was not about standarization.
6549 (FeatureRequiresLINQ): New.
6551 * support.cs (SeekableStreamReader): Only require that the reader
6552 is a TextReader, not a StreamReader, so we can plug StringReader.
6554 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
6555 given position in the input stream the following tokens can be
6556 parsed as a type followed by an identifier.
6558 (is_punct): after a '(' if parse_type_and_parameter returns true,
6559 then return a special token OPEN_PARENS_LAMBDA which is used to
6560 avoid reduce/reduce errors in the grammar for the
6561 lambda_expression rules.
6563 (parse_type): implement a type parser inside the
6564 tokenizer, the parser only returns true or false depending on
6565 whether the input at a given position can be parsed as a type.
6567 (peek_token): new method used during type parsing.
6569 2007-01-28 Raja R Harinath <rharinath@novell.com>
6572 * anonymous.cs (ScopeInfo.InflateParameters): New.
6573 (AnonymousContainer.Resolve): Use it to redirect types of
6574 delegate parameters.
6576 2007-01-27 Raja R Harinath <rharinath@novell.com>
6579 * expression.cs (Error_InvalidArguments): Don't use two different
6580 messages for CS1503. Use ExtraInformation and
6581 SymbolRelatedToPreviousError instead.
6584 * decl.cs (DeclSpace.initialize_type_params): Don't access
6585 'type_params' of a partial class directly.
6587 2007-01-26 Miguel de Icaza <miguel@novell.com>
6589 * constant.cs: Removed a handful of out-of-range checks that were
6592 2007-01-25 Marek Safar <marek.safar@gmail.com>
6594 * expression.cs (CheckUselessComparison): Add additional check for char
6597 * namespace.cs: Fixed typo.
6599 2007-01-23 Miguel de Icaza <miguel@novell.com>
6601 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
6602 gone, instead we inline the test, preventing the needless casts to
6603 longs, ulongs and doubles for the parameters, avoiding calls to
6604 methods that overchecked stuff, and instead inlined things
6607 2007-01-20 Marek Safar <marek.safar@gmail.com>
6609 * cs-parser.jay: Better parameter error handling.
6611 2007-01-17 Marek Safar <marek.safar@gmail.com>
6613 A fix for bug #80368, #80522
6614 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
6615 whether array initializer contains constants only.
6616 (ArrayCreation.Emit): Use better formula to decide when
6617 are array initializers for static initialization.
6618 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
6619 have to emit even constants otherwise they are pre-initialized.
6621 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
6622 Raja R Harinath <rharinath@novell.com>
6624 Fix emit order of 'get' vs. 'set'.
6625 * support.cs (Accessors): New.
6626 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
6627 Note the order in which accessors are declared in the source.
6628 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
6629 Refactored from Property.Define and Indexer.Define.
6630 (PropertyBase.DefineAccessors): New helper that calls the above in
6631 appropriate order as noted by the parser.
6632 (Property.Define, Indexer.Define): Update to changes.
6633 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
6635 2007-01-17 Raja R Harinath <rharinath@novell.com>
6637 Fix cs0029-6.cs and gcs0029-2.cs (regression)
6638 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
6639 there's an implicit conversion from the current type to the target
6640 type before converting the underlying constant.
6642 2007-01-16 Marek Safar <marek.safar@gmail.com>
6644 * const.cs (ResolveValue): Updated after constant conversion was made more
6647 * constant.cs (GetAttributableValue): constant to object conversion is
6648 used for attributes only.
6649 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
6650 constant conversions.
6651 (LongConstant.ConvertImplicitly): Ditto.
6653 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
6654 (ImplicitConversionStandard): Handle constant conversion as extra step.
6655 It solves the issue when constant conversion was called indirectly like
6656 inside array initializer and constant folding was skipped.
6658 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
6661 * statement.cs(ImplicitConversionStandard): Updated after constant
6662 conversion was made more generic.
6664 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
6666 * expression.cs (As.DoResolve): Use GenericConstraints instead of
6667 Constraints, solves the problem where the compiler incorrectly
6668 reported that a type parameter was not constrained to a class (Bug
6671 2007-01-14 Marek Habersack <grendello@gmail.com>
6673 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
6675 2007-01-14 Marek Safar <marek.safar@gmail.com>
6677 A fix for bug #80368
6678 * assign.cs (FieldInitializer): New class implements field
6679 initializer statement.
6681 * attribute.cs: Update after FieldMember rename.
6683 * class.cs (PropertyBasedMember): New common class for property based
6685 (InterfaceMemberBase): New base class for all members which can be used as
6686 an interface members.
6687 (MethodCore): Moved really common code to InterfaceMemberBase.
6688 (Method.Define): Equal and GetHasCode detection is relevant for methods
6690 (MethodData.Define): Don't assume that public event implements an
6691 interface automatically.
6692 (MethodData.DefineMethodBuilder): Issue an error even if only extern
6694 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
6695 (FieldMember): Merged with FieldBase.
6696 (EventProperty.AEventPropertyAccessor): New specialization to check whether
6697 event extern modifier can be used.
6698 (EventField.EventFieldAccessor): Moved event field specific code here.
6699 (Event.AllowedModifiers): Even event can be extern.
6700 (Event.FindOutBaseMethod): New override specific to events.
6701 (Indexer.parameters): Reintroduce parameters because base class holds
6702 only properties common data.
6703 (Indexer.CheckForDuplications): Indexers are threated as methods so we
6704 need do extra parameters check.
6706 * const.cs: Update after FieldMember rename.
6708 * decl.cs (MemberCache.FindBaseEvent): New method.
6710 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
6711 to reflect that indexer is now derived from PropertyBased.
6713 * ecore.cs (GetMemberType): Made public.
6714 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
6717 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
6719 * typemanager.cs (CSharpSignature): Correctly print event accessors.
6720 (RegisterEvent): Removed.
6721 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
6722 (GetPrivateFieldOfEvent): Renamed to GetEventField.
6724 2007-01-11 Raja R Harinath <rharinath@novell.com>
6727 * statement.cs (CollectionForeach.TryType): Prefer generic
6728 GetEnumerator over non-generic variant. Fix code to follow comments.
6730 2007-01-09 Raja R Harinath <rharinath@novell.com>
6733 * support.cs (ReflectionParameter): Don't use an invalid index on
6734 the generic parameter data.
6736 2007-01-08 Miguel de Icaza <miguel@novell.com>
6738 * driver.cs: Just add a tiny bit of infrastructure.
6740 2007-01-02 Marek Safar <marek.safar@gmail.com>
6742 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
6743 where field type is struct from current assembly.
6745 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
6748 2007-01-02 Marek Safar <marek.safar@gmail.com>
6750 A fix for bug #80381
6751 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
6754 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
6756 (Namespace.LookupType): Always use core types from corlib when speficied.
6758 * report.cs: A new warning.
6760 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
6761 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
6762 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
6764 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
6765 (InitCoreTypes): Set expression type of object_type and value_type
6766 immediately after lookup.
6768 2007-01-01 Miguel de Icaza <miguel@novell.com>
6770 * cs-tokenizer.cs: Accept Pc class characters (Connector
6771 Punctuation) as valid identifiers. Fixes #78259
6773 * expression.cs (Invocation.DoResolve): Moved the check for the
6774 use of `this' for doing method calls to the Invocation resolution
6775 step, after overload resolution has taken place instead of doing
6776 the check at the low-level `This.DoResolve' level.
6778 The `This.DoResolve'(appens before overload resolution, so it has
6779 no way of knowing if the method that will be called will be
6780 instace or static, triggering an erroneous report for cs0188 (Bug
6783 We now do the check for instance method invocations after we know
6784 what method will be called.
6786 (This.CheckThisUsage): Move the actual use of this structure
6787 checking into its own method and expose it.
6789 * Everywhere that called Error_ValueCannotBeConverted: pass a new
6792 Exceptions: Null.ConvertImplicitly,
6793 Constant.ImplicitConversionRequired as there are too many call
6794 sites for passing the ec.
6796 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
6797 EmitContext, if the value is null, then we do not try to provide
6798 the extra information from the error (If a userdefined conversion
6799 exists, as UserDefinedConversion requires a non null-EmitContext).
6803 2006-12-30 Raja R Harinath <rharinath@novell.com>
6805 * flowanalysis.cs (MyBitVector): Document some invariants.
6806 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
6807 introduced below, and add a couple of others,
6809 2006-12-30 Marek Safar <marek.safar@gmail.com>
6811 * attribute.cs (GetMethodObsoleteAttribute): Uses new
6812 GetPropertyFromAccessor and GetEventFromAccessor.
6814 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
6815 overrides non-obsolete one.
6816 (Indexer.Define): Error message has been moved to the parser.
6818 * cs-parser.jay: Better syntax errors handling.
6820 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
6821 when an invocation has no arguments.
6823 * ecore.cs: Removed not used caching.
6825 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
6828 * report.cs: Add a new warning.
6830 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
6832 * typemanager.cs (enumeration_type): Removed.
6833 (CSharpSignature): Reuses IsSpecialMethod.
6834 (IsEqual): Hack for MS BCL.
6835 (GetPropertyFromAccessor): New method.
6836 (GetEventFromAccessor): New method.
6837 (IsSpecialMethod): Fixed to handle more cases.
6839 2006-12-30 Marek Safar <marek.safar@gmail.com>
6841 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
6842 Made white spaces array static.
6844 * ecore.cs (RemoveGenericArity): Optimized.
6846 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
6848 (MyBitVector.initialize_vector): Simplified.
6850 2006-12-22 Miguel de Icaza <miguel@novell.com>
6852 * ecore.cs: Am not entirely happy with this hack, but it seems to
6853 address the issue in 80257 (a small test case for
6856 I set the MethodGroupExpr.Type to an internal compiler type
6857 (itself in this case) to force the resolution to take place. Why
6858 it does not take place with a null is beyond me.
6860 2006-12-20 Marek Safar <marek.safar@gmail.com>
6862 A fix for bug #80288
6863 * expression.cs (ResolveOperator): Consider user defined conversion for
6864 logical and operator too.
6865 (EmitBranchable): Optimization for logical and when full constant folding
6866 could not be applied but one operand is constant.
6868 2006-12-19 Marek Safar <marek.safar@gmail.com>
6870 * class.cs (GetClassBases): Write 5 times every day, will never use
6871 FullName for error reporting.
6873 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
6875 2006-12-19 Martin Baulig <martin@ximian.com>
6877 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
6878 the symbol file info here.
6880 2006-12-18 Marek Safar <marek.safar@gmail.com>
6882 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
6883 of `elseif' is taking then following sections are not taking.
6884 Fixes an issue reported on mono mailing list.
6886 2006-12-18 Marek Safar <marek.safar@gmail.com>
6888 A fix for bug #80300
6889 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
6890 a caller is not taking.
6892 2006-12-18 Raja R Harinath <rharinath@novell.com>
6894 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
6895 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
6896 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
6897 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
6898 * class.cs: Update to changes.
6900 2006-12-17 Marek Safar <marek.safar@gmail.com>
6902 A fix for bug #79934
6903 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
6906 * class.cs (ResolveMembers): Register an iterator in current container and
6909 2006-12-16 Raja R Harinath <rharinath@novell.com>
6912 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
6913 satisfy a params annotated parameter.
6915 2006-12-16 Marek Safar <marek.safar@gmail.com>
6917 A fix for bug #77014
6918 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
6919 paramters correctly and not rely on hacks in Parameters class.
6920 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
6922 (Invocation.VerifyArgumentsCompat): Ditto.
6923 (Invocation.EmitArguments): Changed to correctly emit params arguments at
6926 * parameter.cs (HasParams): Don't assume that params is the last one.
6928 * support.cs (ReflectionParameters.ctor): Look for params attribute
6930 (ReflectionParameters.ParameterType): Removed hack when we returned last
6931 parameter for out of range parameters.
6932 (ParameterName, ParameterModifier): Ditto.
6934 2006-12-14 Marek Safar <marek.safar@gmail.com>
6936 A fix for bug #79987
6937 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
6938 when assembly is not CLS compliant but type is. I have no idea why is this
6941 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
6943 2006-12-13 Miguel de Icaza <miguel@novell.com>
6945 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
6946 in struct constructors, they are basically no-ops.
6948 2006-12-12 Marek Safar <marek.safar@gmail.com>
6950 * cs-tokenizer.cs (Position): Save preprocessor status too.
6952 2006-12-12 Marek Safar <marek.safar@gmail.com>
6954 A fix for bug #77794
6955 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
6957 2006-12-12 Marek Safar <marek.safar@gmail.com>
6959 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
6961 (pp_expr): Report error for an invalid expression.
6962 (handle_preprocessing_directive): Simplified; add more error checking.
6964 2006-12-11 Marek Safar <marek.safar@gmail.com>
6966 A fix for bug #74939
6967 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
6968 directives handling.
6970 2006-12-10 Marek Safar <marek.safar@gmail.com>
6972 A fix for bugs #80093, and #75984
6973 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
6974 logic, it seems to me as it worked before "by coincidence".
6975 (xtoken): Simplified to use reworked handle_preprocessing_directive.
6976 (cleanup): Enabled endif check.
6978 2006-12-09 Marek Safar <marek.safar@gmail.com>
6980 A fix for bug #80162
6981 * statement.cs (CollectionForeach.TryType): Generics and non-generics
6982 enumerators are never ambiguous.
6984 2006-12-08 Raja R Harinath <rharinath@novell.com>
6987 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
6989 2006-12-06 Marek Safar <marek.safar@gmail.com>
6991 A fix for bug #80144
6992 * class.cs (EventProperty.Define): Explicit implementation means
6993 that an even is used.
6995 2006-12-06 Marek Safar <marek.safar@gmail.com>
6997 Fixes the operators implementation (part II)
6999 * cfold.cs (DoConstantNumericPromotions): Renamed to
7000 DoBinaryNumericPromotions and simplified.
7001 (BinaryFold): Couple of conversion fixes; simplified.
7003 * constant.cs, ecore.cs, literal.cs
7004 (ToType): Renamed to ConvertImplicitly.
7005 (Reduce): Renamed to ConvertExplicitly.
7007 * class.cs, convert.cs: Updated.
7009 * expression.cs: TryReduce doesn't throw an exception.
7011 2006-12-01 Marek Safar <marek.safar@gmail.com>
7013 A fix for bug #80108
7014 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
7017 2006-11-30 Marek Safar <marek.safar@gmail.com>
7019 Fixes unary operators implementation (part I)
7022 * cfold.cs (Error_CompileTimeOverflow): Made internal
7024 * const.cs (IConstant): Changed to use reference to constant and
7025 not constant itself.
7026 Updated IConstant implementations.
7028 * constant.cs (CreateConstant): New factory method.
7029 Updated IConstant implementation.
7031 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
7033 * ecore.cs: Updated to use CreateConstantReference.
7035 * enum.cs: Reflects IConstant changes.
7037 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
7039 * literal.cs (NullConstant): Change to be independently usable.
7041 2006-11-29 Martin Baulig <martin@ximian.com>
7043 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
7044 we need to emit the scope initializer before calling the base .ctor.
7046 * anonymous.cs: Merged back from the new anonymous methods branch.
7047 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
7049 * expression.cs (ParameterReference.DoResolveBase): Create a
7050 "normal" ScopeInfo when capturing parameters rather than using the
7051 root scope; this makes things work with anonymous methods having
7055 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
7057 2006-11-22 Marek Safar <marek.safar@gmail.com>
7059 A fix for bug #79987
7060 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
7061 check to a base class.
7062 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
7063 only when assembly has missing attribute.
7064 * report.cs: Update.
7066 2006-11-21 Marek Safar <marek.safar@gmail.com>
7068 * cs-tokenizer.cs: Merged with gmcs version.
7070 2006-11-20 Marek Safar <marek.safar@gmail.com>
7073 * cs-parser.jay: Better error message when partial keyword is misplaced.
7075 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
7077 A fix for bug #79810
7078 report.cs: CS1058 only applies to 2.0 profile (gmcs).
7079 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
7080 a RuntimeWrappedException by default.
7082 2006-11-18 Marek Safar <marek.safar@gmail.com>
7084 A fix for bug #79843
7085 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
7087 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
7089 2006-11-18 Marek Safar <marek.safar@gmail.com>
7091 * driver.cs, namespace.cs: Uses faster IndexOf version.
7093 2006-11-17 Marek Safar <marek.safar@gmail.com>
7095 A fix for bug #79941
7096 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
7098 (Operator.Define): Implicit/Explicit operator of same type is duplicate
7099 even if internal name is different.
7100 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
7101 (UserDefinedConversion): Simplified as the operators cannot be internal.
7102 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
7104 (MethodLookup): Replaced EmitContext with parentType.
7105 * expression.cs: Updated.
7107 2006-11-09 Raja R Harinath <rharinath@novell.com>
7109 * driver.cs (BadAssembly): Handle all the ugliness of
7110 DefineDynamicAssembly.
7112 2006-11-08 Raja R Harinath <rharinath@novell.com>
7114 Address parts of #58244 -- most of what's left is in the runtime
7115 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
7116 CS1509 error checks, and handle them for all assembly loads, not
7117 just the first invocation.
7118 (LoadModule): Likewise. Move handling of 'adder_method' ...
7119 * codegen.cs (AssemblyClass.AddModule): ... here.
7121 2006-11-02 Marek Safar <marek.safar@gmail.com>
7123 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
7124 IEnumerable<T> is ambiguous.
7126 2006-10-31 Marek Safar <marek.safar@gmail.com>
7128 A fix for bug #67689
7129 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
7130 GetEnumerator is ambiguous.
7132 * report.cs: Add new warning.
7134 2006-10-29 Marek Safar <marek.safar@gmail.com>
7136 A fix for bug #78602
7137 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7138 to protected member can be nested type.
7140 2006-10-28 Marek Safar <marek.safar@gmail.com>
7142 A fix for bug #78965
7143 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7144 to protected member must derive from current type.
7146 2006-10-27 Marek Safar <marek.safar@gmail.com>
7148 assign.cs: Reuses error method.
7150 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
7151 instead of type for constants.
7152 (Expression.Error_ValueAssignment): Common error method.
7154 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
7157 2006-10-27 Marek Safar <marek.safar@gmail.com>
7159 A fix for bug #79081
7160 * expression.cs (MemberAccess.DoResolve): Check nested type
7163 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
7165 * doc.cs : nested delegates were not handled. Fixed bug #79754.
7167 2006-10-26 Marek Safar <marek.safar@gmail.com>
7169 A fix for bug #76591
7170 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
7172 2006-10-26 Marek Safar <marek.safar@gmail.com>
7174 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
7175 type forwarder of the same type multiple times.
7177 2006-10-26 Raja R Harinath <rharinath@novell.com>
7180 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
7181 instance as an rvalue, even when we later resolve as an lvalue.
7183 2006-10-25 Martin Baulig <martin@ximian.com>
7185 * anonymous.cs: Fix #79673.
7187 2006-10-24 Marek Safar <marek.safar@seznam.cz>
7189 A fix for bug #79666
7190 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
7191 ignored when is optimized (= default value) as its value is already set.
7193 2006-10-23 Marek Safar <marek.safar@seznam.cz>
7195 A fix for bug #79724
7196 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
7197 TypeContainer for type lookup.
7199 2006-10-23 Marek Safar <marek.safar@seznam.cz>
7201 A fix for bug #79231
7202 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
7203 * expression.cs (OverloadResolve): Always convert type name for
7205 (ResolveNamespaceOrType): Don't confuse a nested type with any
7208 2006-10-18 Martin Baulig <martin@ximian.com>
7210 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
7212 2006-10-17 Miguel de Icaza <miguel@novell.com>
7214 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
7215 an int32, but requesting an int64 from the conversion
7217 2006-10-12 Martin Baulig <martin@ximian.com>
7220 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
7222 2006-10-12 Martin Baulig <martin@ximian.com>
7225 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
7227 2006-10-11 Miguel de Icaza <miguel@novell.com>
7229 * convert.cs: Remove broken code: I was doing the "Existance"
7230 tests for Implicit conversions.
7232 2006-10-10 Miguel de Icaza <miguel@novell.com>
7234 * convert.cs: Added one missing case in
7235 ImplicitStandardConversionExists uint64 to intptr.
7239 * typemanager.cs (uintptr_type): another core known type.
7241 * ecore.cs (OperatorCast): routine used to do cast operations that
7242 depend on op_Explicit. We could change some of the Decimal
7243 conversions to use this.
7245 This one has a probe mechanism that checks both types for an op_
7246 which it coudl be used to eliminate two classes: CastToDecimal
7247 and CastFromDecimal.
7249 * convert.cs: Implement the conversions documented in #59800
7251 2006-10-10 Martin Baulig <martin@ximian.com>
7253 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
7254 before RootScope.ResolveMembers().
7256 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
7257 `CurrentType' if appropriate.
7259 2006-10-09 Marek Safar <marek.safar@seznam.cz>
7261 A fix for bug #78568
7262 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
7263 when contains binary operators.
7264 * cs-parser.jay: Updated.
7266 2006-10-09 Martin Baulig <martin@ximian.com>
7269 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
7270 moved that into Define() and also do the other type parameter
7271 checks there. Fixes #79094. Added gtest-292.cs.
7274 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
7275 since that doesn't include type parameters; don't use `Ldelema'
7276 for type parameters. Fixes #78980. Added gtest-293.cs.
7278 2006-10-08 Marek Safar <marek.safar@seznam.cz>
7281 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
7282 conversion is allowed.
7284 2006-10-06 Marek Safar <marek.safar@seznam.cz>
7286 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
7287 error reporting when no error occurs.
7289 2006-10-06 Marek Safar <marek.safar@seznam.cz>
7291 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
7294 2006-10-06 Raja R Harinath <rharinath@novell.com>
7297 * class.cs (DefineTypeBuilder): Check circular dependencies before
7298 setting the parent of the TypeBuilder.
7299 (CheckRecursiveDefinition): Don't use 'BaseType', since
7300 it may not be valid until after DefineTypeBuilder. Use
7301 'base_type' instead.
7303 2006-10-04 Martin Baulig <martin@ximian.com>
7305 Merged the Anonymous Methods patch.
7307 * anonymous.cs, iterators.cs: The new anonymous methods code.
7309 * statement.cs (Variable): New public abstract class.
7310 (LocalInfo.Variable): New public property.
7311 (LocalInfo.ResolveVariable): New public method.
7312 (Block.Flags): Add `IsIterator'.
7313 (Block.AddVariable): Improved the CS0136 check.
7314 (Block.AnonymousChildren): New public property.
7315 (Block.AddAnonymousChild): New public method.
7316 (ToplevelBlock): Update to use the new anonymous method framework.
7317 (ToplevelBlock.ctor): `container' is now a `Block' and not a
7318 `ToplevelBlock'; this is required to correctly implement the
7320 (Fixed, Using): Use `TemporaryVariable' instead of directly
7321 creating the `LocalBuilder'.
7323 * parameter.cs (Parameter.ResolveVariable): New public method.
7324 (Parameters.ResolveVariable): Likewise.
7326 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
7328 * class.cs (TypeContainer): Replaced the `iterators' list and
7329 corresponding methods with a list of `CompilerGeneratedClass'es.
7330 (TypeContainer.ResolveMembers): New public method.
7331 (Method): `IIteratorContainer' has been replaced by
7334 * expression.cs (VariableReference): New public abstract base
7335 class for `LocalVariableReference', `ParameterReference' and
7338 * codegen.cs (EmitContext): Removed `capture_context',
7339 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
7340 (EmitContext.EmitThis): Removed.
7342 * cs-parser.jay: Replace `iterator_container' with
7345 2006-10-04 Martin Baulig <martin@ximian.com>
7347 * generic.cs (GenericMethod): Don't make this abstract.
7348 (Constraints.Clone): Added dummy implementation.
7350 2006-10-04 Raja R Harinath <harinath@gmail.com>
7353 * namespace.cs (LookForAnyGenericType): Avoid nullref on
7354 'declspaces'. Avoid allocating arrays willy-nilly.
7357 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
7358 cases out of the switch.
7360 2006-09-28 Marek Safar <marek.safar@seznam.cz>
7362 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
7363 message when non-generic type is used with the type arguments.
7364 * expression.cs: Updated.
7366 2006-09-28 Raja R Harinath <rharinath@novell.com>
7369 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
7370 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7371 Change semantics slightly. Don't insist on having only one
7372 temporary EmptyExpression -- just throttle the creation of new ones.
7375 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
7376 non-interfaces too. If no methods are found, don't try to create
7379 2006-09-28 Marek Safar <marek.safar@seznam.cz>
7381 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
7384 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
7385 us produce better error message.
7387 2006-09-27 Marek Safar <marek.safar@seznam.cz>
7389 * expression.cs (Binary.ResolveOperator): Warn about a side effect
7390 of the `|' operator.
7392 * report.cs: A new warning added.
7394 2006-09-27 Martin Baulig <martin@ximian.com>
7396 * generic.cs (GenericMethod): Don't make this abstract.
7398 2006-09-27 Martin Baulig <martin@ximian.com>
7401 (InternalErrorException): Added overloaded ctor taking a params array.
7403 2006-09-26 Marek Safar <marek.safar@seznam.cz>
7405 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
7406 Fixed the cases when same error was reported twice.
7408 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
7409 now report symbol information.
7411 2006-09-25 Martin Baulig <martin@ximian.com>
7413 * class.cs: Completely unified with the gmcs version.
7415 2006-09-25 Martin Baulig <martin@ximian.com>
7417 * typemanager.cs (TypeManager.IsNullableType): New public function.
7418 (TypeManager.IsNullableTypeOf): Likewise.
7419 (TypeManager.IsNullableValueType): Likewise.
7421 * class.cs (MethodCore): Added the `GenericMethod' argument from
7422 gmcs and also unified all classes derived from `MethodCore' with gmcs.
7424 2006-09-24 Raja R Harinath <harinath@gmail.com>
7426 * convert.cs: Unify with gmcs version.
7428 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7430 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
7431 verify them as well.
7433 * report.cs: New warning.
7435 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7437 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
7438 for anonymous block with out argument.
7440 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7442 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
7443 not used private events only.
7445 2006-09-23 Marek Safar <marek.safar@seznam.cz>
7447 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
7449 * const.cs (Const.Define): Check for constant type.
7450 (Const.IsConstantTypeValid): Looks for valid constant types.
7452 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
7454 * ecore.cs (EmptyConstantCast): New common class for all constant based
7457 * expression.cs (Is.DoResolve): Handle null constant especially.
7458 (New.DoResolve): Check for new void().
7459 (MemberAccess.DoResolve): Cope with all kind of nulls.
7461 * literal.cs (NullConstant): Uses EmptyConstantCast.
7462 (NullDefault): Based on EmptyConstantCast.
7463 (NullLiteral): Uses EmptyConstantCast.
7465 * statement.cs (Block.ResolveMeta): Check for constant type.
7467 2006-09-22 Martin Baulig <martin@ximian.com>
7469 * delegate.cs, attribute.cs: Merged with the gmcs versions.
7471 2006-09-22 Raja R Harinath <rharinath@novell.com>
7473 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
7477 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
7478 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
7481 2006-09-22 Martin Baulig <martin@ximian.com>
7483 * ecore.cs: Merged with the gmcs version.
7485 * generic.cs (ConstructedType): New dummy class.
7486 (TypeArguments): Don't make this abstract.
7489 (TypeManager.IsGenericTypeDefinition): New method.
7490 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
7492 2006-09-22 Raja R Harinath <rharinath@novell.com>
7494 * expression.cs (ComposedCast): Check for arrays of TypedReference
7495 before creating the type, not after.
7497 2006-09-21 Marek Safar <marek.safar@seznam.cz>
7499 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
7500 after ToType change.
7502 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
7503 when constant must be implicitly convertible.
7505 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
7507 * ecore.cs (NullCast): Derives from NullConstant.
7509 * expression.cs (Is.DoResolve): Removed useless variables.
7510 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
7511 (New.Constantify): Add enum support.
7512 (MemberAccess.DoResolve): Add warning when accessing null constant or
7515 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
7518 * literal.cs (NullConstant): New abstract class with common
7519 functionality for all null specializations.
7520 (NullDefault): Represents default(X) when result can be
7522 (NullLiteral): Updated.
7524 * report.cs: Add new warning.
7526 2006-09-21 Martin Baulig <martin@ximian.com>
7528 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
7530 2006-09-21 Martin Baulig <martin@ximian.com>
7532 * generic.cs (GenericConstraints): New dummy class.
7533 (Constraints): Likewise.
7534 (TypeParameter): Likewise.
7535 (TypeParameterName): Likewise.
7536 (GenericMethod): Likewise.
7538 * typemanager.cs (TypeManager.GetGenericArguments): New method.
7540 * decl.cs: Merged with the gmcs version.
7542 2006-09-21 Raja R Harinath <rharinath@novell.com>
7544 * generic.cs (TypeParameter): Implement IMemberContainer.
7545 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
7547 * rootcontext.cs: Unify with gmcs version.
7549 * report.cs: Unify with gmcs version.
7550 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
7551 from gmcs/generics.cs.
7552 * generics.cs (TypeParameter): New dummy class.
7554 * support.cs: Unify with gmcs version.
7556 2006-09-20 Raja R Harinath <rharinath@novell.com>
7558 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
7559 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
7561 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
7562 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
7563 * mcs.exe.sources: Add generic.cs.
7565 * codegen.cs: Unify with gmcs version.
7567 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
7568 (EmitContext): Add GenericDeclContainer implementation.
7569 * decl.cs (MemberCore, DeclSpace): Likewise.
7570 * namespace.cs: Remove #ifdef GMCS_SOURCE.
7572 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
7573 MCS TypeManager has a corresponding dummy method.
7575 2006-09-19 Martin Baulig <martin@ximian.com>
7577 * expression.cs: Completely merged with the gmcs version.
7579 2006-09-19 Martin Baulig <martin@ximian.com>
7581 * expression.cs (Invocation): Merged with the gmcs version.
7582 (ArrayAccess.GetStoreOpcode): Likewise.
7584 2006-09-19 Martin Baulig <martin@ximian.com>
7587 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
7588 (TypeManager.IsGenericMethodDefinition): Likewise.
7590 2006-09-19 Martin Baulig <martin@ximian.com>
7593 (TypeManager.IsEqual): Moved the gmcs implementation here.
7594 (TypeManager.DropGenericTypeArguments): Likewise.
7595 (TypeManager.DropGenericMethodArguments): Likewise.
7596 (TypeManager.GetTypeArguments): Moved here from gmcs.
7597 (TypeManager.HasGenericArguments): Likewise.
7599 2006-09-19 Martin Baulig <martin@ximian.com>
7601 * expression.cs (Binary): Merged with the gmcs version.
7603 2006-09-19 Martin Baulig <martin@ximian.com>
7605 * expression.cs (Probe, As, Is): Merged with the gmcs version.
7607 2006-09-19 Martin Baulig <martin@ximian.com>
7609 * typemanager.cs: Merged with the gmcs version.
7611 2006-09-16 Raja R Harinath <rharinath@novell.com>
7613 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
7614 * driver.cs: Likewise.
7616 2006-09-16 Marek Safar <marek.safar@seznam.cz>
7619 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
7620 only if parent type is class.
7621 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
7624 2006-09-15 Marek Safar <marek.safar@seznam.cz>
7627 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
7629 * typemanager.cs(CSharpName): Converts NullType to null.
7631 2006-09-15 Martin Baulig <martin@ximian.com>
7634 (TypeManager.GetMethodName): Added mcs implementation.
7635 (TypeManager.IsEqual): Likewise.
7638 (SimpleName.RemoveGenericArity): Added dummy implementation.
7640 * pending.cs: Merged with the gmcs version.
7642 2006-09-15 Martin Baulig <martin@ximian.com>
7644 * statement.cs: Merge with the gmcs version.
7646 2006-09-15 Martin Baulig <martin@ximian.com>
7648 * statement.cs (Switch): Merge with the gmcs implementation
7649 (without nullables), which is newer.
7651 2006-09-15 Martin Baulig <martin@ximian.com>
7653 * statement.cs (Block.Variables): Make this public.
7654 (ToplevelBlock.Parameters): Make this a property.
7655 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
7657 2006-09-15 Martin Baulig <martin@ximian.com>
7659 * namespace.cs: Merge with the gmcs version.
7661 2006-09-15 Martin Baulig <martin@ximian.com>
7663 * decl.cs (MemberName): Minor code cleanups.
7665 2006-09-15 Martin Baulig <martin@ximian.com>
7667 * parameter.cs: Merge with the gmcs version.
7669 2006-09-15 Martin Baulig <martin@ximian.com>
7671 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
7672 and an error in mcs.
7674 2006-09-15 Martin Baulig <martin@ximian.com>
7676 * flowanalysis.cs: Merged from GMCS; added the generics code into
7677 a `GMCS_SOURCE' conditional so we can share this file.
7679 2006-09-08 Martin Baulig <martin@ximian.com>
7681 * typemanager.cs (TypeManager.interlocked_type): New public field.
7682 (TypeManager.int_interlocked_compare-exchange): New public field.
7683 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
7684 enumerator types here and call InitGenericCoreTypes().
7685 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
7686 after calling InitEnumUnderlyingTypes().
7689 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
7690 `classes_second_stage'.
7692 2006-09-14 Marek Safar <marek.safar@seznam.cz>
7694 * assign.cs, ecore.cs, expression.cs: Share error message text.
7695 * class.cs (FieldMember.Define): Check for varible of static type.
7696 * driver.cs (LoadAssembly): Uses error output for errors.
7697 * statement.cs: Updated.
7699 2006-09-08 Marek Safar <marek.safar@seznam.cz>
7701 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
7704 2006-09-07 Martin Baulig <martin@ximian.com>
7707 (MainDriver): Revert r62663 from Marek; see #70506 for details.
7709 2006-08-29 Miguel de Icaza <miguel@novell.com>
7711 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
7713 2006-08-17 Miguel de Icaza <miguel@novell.com>
7715 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
7716 #52019 and #79064, the use of the \uXXXX sequence in source code
7717 to represent unicode characters.
7719 2006-08-15 Marek Safar <marek.safar@seznam.cz>
7721 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
7723 * class.cs, ecore.cs, statement.cs: Merged to one error message.
7725 2006-08-13 Miguel de Icaza <miguel@novell.com>
7727 * assign.cs: Catch attempts to assign to a method groups in += and
7730 2006-08-13 Marek Safar <marek.safar@seznam.cz>
7733 * cs-parser.jay: Don't destroy current array type by typeof of array's.
7735 2006-08-12 Marek Safar <marek.safar@seznam.cz>
7737 * class.cs (Method.Define): Issue a warning when generic method looks like
7739 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
7742 2006-08-09 Marek Safar <marek.safar@seznam.cz>
7744 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
7746 * decl.cs (MemberCache.FindMembers): When container is interface we need to
7747 search all base interfaces as a member can be ambiguous.
7748 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
7749 Constructor member type filter.
7750 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
7751 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
7752 reporting for returned memberinfos.
7753 * report.cs: Updated.
7754 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
7755 version to work on all runtimes.
7756 (TypeManager.RealMemberLookup): Removed members filtering.
7758 2006-08-08 Raja R Harinath <rharinath@novell.com>
7760 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
7761 (PropertyExpr.EmitAssign): Likewise.
7762 * expression.cs (Indirection.EmitAssign): Likewise.
7763 (LocalVariableReference.EmitAssign): Likewise.
7764 (ParameterReference.EmitAssign): Likewise.
7765 (Invocation.EmitArguments): Likewise.
7766 (ArrayAccess.EmitAssign): Likewise.
7767 (IndexerAccess.EmitAssign): Likewise.
7768 (This.EmitAssign): Likewise.
7769 (ConditionalLogicalOperator.Emit): Likewise.
7772 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
7773 instead of ArrayList. If the hashtable has a LocalBuilder, don't
7774 leave it in after returning it.
7775 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
7777 2006-08-06 Marek Safar <marek.safar@seznam.cz>
7779 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
7782 2006-08-03 Raja R Harinath <rharinath@novell.com>
7784 Fix cs0146-3.cs and cs0146-4.cs.
7785 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
7786 enclosing types don't depend on the current type.
7788 2006-08-02 Raja R Harinath <rharinath@novell.com>
7791 * class.cs (TypeContainer.DoDefineMembers): Use
7792 FindBaseMemberWithSameName on Parent, since we're interested in
7793 whether we hide inherited members or not.
7794 (FindBaseMemberWithSameName): Make slightly more robust.
7796 Fix the non-generic testcase from #77396
7797 * decl.cs (DeclSpace.DeclContainer): Remove override.
7799 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
7800 declspaces for doppelgangers too.
7801 (UsingEntry): Implement IResolveContext.
7802 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
7803 'this' as the resolve context.
7804 (LocalAliasEntry): Likewise.
7806 Implement parts of #77403
7807 * roottypes.cs (RootDeclSpace): New. Used to represent the
7808 toplevel declaration space. Each namespace declaration introduces
7809 a "partial" root declaretion space.
7810 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
7811 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
7812 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
7813 from 'current_namespace.SlaveDeclSpace'.
7814 (namespace_declaration): Likewise.
7815 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
7816 check. It can't happen now.
7817 * decl.cs (DeclSpace.LookupType): Likewise.
7818 * driver.cs (MainDriver): Sanity check.
7820 2006-08-01 Raja R Harinath <rharinath@novell.com>
7822 * decl.cs (DeclSpace.FindNestedType): Remove.
7823 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
7824 LookupTypeContainer to get the container of the nested type.
7825 * class.cs (TypeContainer.FindNestedType): Make non-override.
7827 2006-07-31 Raja R Harinath <rharinath@novell.com>
7829 * decl.cs (DeclSpace.PartialContainer): Move field from ...
7830 * class.cs (TypeContainer.PartialContainer): ... here.
7831 (TypeContainer.AddBasesForPart): New helper.
7832 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
7834 * cs-parser.jay (current_class): Convert to DeclSpace.
7835 (struct_declaration, interface_declaration, class_declaration):
7836 Use AddBasesForPart instead of .Bases directly.
7837 * const.cs, iterators.cs: Update to changes.
7839 2006-07-28 Raja R Harinath <rharinath@novell.com>
7841 * class.cs (TypeContainer.AddMemberType): Rename from
7843 (TypeContainer.AddMember): Rename from AddToMemberContainer.
7844 (AddTypeContainer): New. Combine AddClassOrStruct and
7846 (AddPartial): Update. Add 'is_partial' argument.
7847 * roottypes.cs: Update to changes.
7848 * cs-parser.jay (push_current_class): New helper for handling
7849 current_container and current_class.
7850 (struct_declaration, interface_declaration, class_declaration):
7853 2006-07-26 Raja R Harinath <rharinath@novell.com>
7855 * roottypes.cs: Rename from tree.cs.
7857 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
7858 * tree.cs (Tree, ITreeDump): Remove types.
7859 * rootcontext.cs (tree, Tree): Remove fields.
7860 (root, ToplevelTypes): New.
7861 * *.cs: Update to rename.
7863 * tree.cs (Tree.RecordDecl): Remove.
7864 (RootTypes.AddToTypeContainer): Record the toplevel type in its
7866 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
7868 2006-07-23 Raja R Harinath <harinath@gmail.com>
7870 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
7871 DoFlowAnalysis and OmitStructFlowAnalysis here.
7872 (ec.With): Rename from WithUnsafe and generalize.
7873 (ec.WithCheckState): Remove. All users can be handled by 'With'.
7874 (ec.WithFlowAnalyis): New.
7875 * ecore.cs, expression.cs, statement.cs: Update.
7877 2006-07-22 Raja R Harinath <harinath@gmail.com>
7879 * statement.cs (Block.ResolveMeta): Simplify slightly.
7881 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
7882 multiple boolean fields. Convert InUnsafe, constant_check_state,
7883 check_state to flags.
7884 (CheckState, ConstantCheckState): Update.
7885 (InUnsafe): New read-only property.
7886 (FlagsHandle): Rename from CheckStateHandle and convert to handle
7888 (WithUnsafe): New helper similar to WithCheckState.
7889 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
7890 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
7892 2006-07-21 Raja R Harinath <rharinath@novell.com>
7894 Make comparisons use the same IL irrespective of whether they're
7895 in a 'checked' or 'unchecked' context: one of the issues in #78899
7896 * codegen.cs (EmitContext.CheckState): Make read-only property.
7897 (EmitContext.ConstantCheckState): Likewise.
7898 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
7899 helper that implement a save/restore stack for CheckState
7900 values. This is the only way to change check-state.
7901 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
7902 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
7903 (CheckedExpr.EmitBranchable): New forwarding method.
7904 (UnCheckedExpr): Likewise.
7905 * statement.cs (Block.ResolveMeta): Use WithCheckState.
7906 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
7907 (Checked.Resolve, checked.DoEmit): Likewise.
7909 2006-07-20 Miguel de Icaza <miguel@novell.com>
7911 * anonymous.cs: Cache the resolved anonymous delegate, and return
7912 this so that the ResolveTopBlock is only triggered once, not
7915 Currently we trigger ResolvetopBlock twice due to a first pass of
7916 argument check compatibility, and a second pass that does the
7919 2006-07-15 Marek Safar <marek.safar@seznam.cz>
7921 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
7923 * rootcontext.cs (Reset): Add helper_classes.
7925 2006-07-15 Marek Safar <marek.safar@seznam.cz>
7928 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
7931 2006-07-13 Miguel de Icaza <miguel@novell.com>
7933 * statement.cs (Lock): Handle expressions of type
7934 TypeManager.null_type specially. Fixes #78770
7936 2006-07-08 Marek Safar <marek.safar@seznam.cz>
7938 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
7941 2006-07-08 Marek Safar <marek.safar@seznam.cz>
7943 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
7944 for accessors as well.
7945 * ecore.cs (EventExpr): Add AccessorTable.
7947 2006-07-01 Marek Safar <marek.safar@seznam.cz>
7950 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
7951 for CS0122 where appropriate.
7952 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
7954 (Filter): Assembly can be null in the case of top level attributes.
7956 2006-06-25 Marek Safar <marek.safar@seznam.cz>
7960 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
7961 is done at global level.
7963 2006-06-24 Marek Safar <marek.safar@seznam.cz>
7965 A fix for #77002, Implemented TypeForwarder support.
7967 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
7968 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
7969 * typemanager.cs (): Add type_forwarder_attr_type.
7971 2006-06-24 Marek Safar <marek.safar@seznam.cz>
7973 * report.cs: Add CS0469 warning.
7975 2006-06-21 Martin Baulig <martin@ximian.com>
7977 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
7978 the `try'-block, so we also report CS0016 etc. there.
7980 2006-06-21 Martin Baulig <martin@ximian.com>
7983 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
7985 2006-06-21 Martin Baulig <martin@ximian.com>
7987 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
7988 also report CS1686 for parameters.
7990 2006-06-21 Martin Baulig <martin@ximian.com>
7992 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
7993 instead of an error if the value is not implicitly convertible to
7994 the switch types; fixes #77964.
7996 2006-06-21 Raja R Harinath <rharinath@novell.com>
7999 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
8000 FieldBuilder is null.
8003 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
8004 'left' and 'right' before error-checking.
8006 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
8008 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
8010 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
8011 (FieldExpr.DoResolve): likewise.
8012 (PropertyExpr.InstanceResolve): likewise.
8013 (EventExpr.InstanceResolve): likewise.
8015 2006-06-04 Marek Safar <marek.safar@seznam.cz>
8017 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
8018 attribute applicable tests for attribute argument.
8020 2006-06-02 Raja R Harinath <rharinath@novell.com>
8023 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
8024 (Binary.OverloadResolve_PredefinedIntegral): New.
8025 (Binary.OverloadResolve_PredefinedFloating): New.
8026 (Binary.OverloadResolve_PredefinedString): New.
8027 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
8028 Follow the standard more closely, and treat numeric promotions in
8029 terms of overload resolution.
8030 (Binary.CheckShiftArguments): Simplify.
8032 2006-06-01 Raja R Harinath <rharinath@novell.com>
8034 * flowanalysis.cs (MyBitVector): Simplify representation.
8035 (MyBitVector.Clone): Avoid allocating BitArray.
8036 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
8037 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
8038 (*): Update. Change all references to MyBitVector.And and
8039 MyBitVector.Or to &= and |=.
8041 2006-05-29 Raja R Harinath <rharinath@novell.com>
8044 * cs-parser.jay (formal_parameter_list): Extend the pattern below
8045 to param arguments too.
8047 2006-05-26 Miguel de Icaza <miguel@novell.com>
8049 * cs-parser.jay: Catch another parsing form for arglist being
8050 followed by other arguments. Fixes #78313.
8052 2006-05-24 Raja R Harinath <rharinath@novell.com>
8054 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
8055 checking of out parameters to ...
8056 (FlowBranchingToplevel.Merge): ... here.
8057 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
8058 set, propagate the origin upward, and only complain if there was
8060 (FlowBranchingException.AddContinueOrigin): Likewise.
8061 (FlowBranchingException.AddReturnOrigin): Likewise.
8062 (FlowBranchingException.AddGotoOrigin): Likewise.
8064 2006-05-23 Raja R Harinath <rharinath@novell.com>
8066 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
8067 unreachable, skip it.
8068 (FlowBranchingException.Merge): Always propagate jumps, even if
8069 the finally block renders subsequent code unreachable.
8071 2006-05-18 Raja R Harinath <rharinath@novell.com>
8074 * statement.cs (Goto.Resolve): Move responsibility for resolving
8075 'goto' to FlowBranching.AddGotoOrigin.
8076 (Goto.SetResolvedTarget): New. Callback to set the
8077 LabeledStatement that's the target of the goto.
8078 (Goto.DoEmit): Use Leave instead of Br when crossing an
8079 unwind-protect boundary.
8080 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
8081 LookupLabel and adjust to new semantics.
8082 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
8083 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
8084 Goto.SetResolvedTarget to update target.
8085 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
8086 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
8087 AddBreakOrigin & co. Delay propagation until ...
8088 (FlowBranchingException.Merge): ... this.
8090 * statement.cs (Block.Resolve): Always depend on flow-branching to
8091 determine unreachability. Kill workaround that originally emitted
8092 only one statement after an "unreachable" label (see infloop in
8095 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
8096 This is still "wrong", but anything better would probably need a
8097 multi-pass algorithm.
8098 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
8099 usage vector. Force current usage vector to be reachable, to
8100 optimistically signify backward jumps.
8101 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
8103 (FlowBranchingLabeled.Merge): New. If no backward jump was
8104 detected, return the original salted-away usage vector instead,
8105 updated with appropriate changes. Print unreachable warning if
8107 * statement.cs (Block.Resolve): Don't print unreachable warning on
8108 a labeled statement.
8110 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
8112 * driver.cs: Pass filename without path to AssemblyBuilder's
8113 AddResourceFile. Fixes bug #78407.
8115 2006-05-17 Raja R Harinath <rharinath@novell.com>
8117 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
8118 * flowanalysis.cs (FlowBranchingLabeled): ... here.
8119 (FlowBranching.MergeChild): Overwrite
8120 reachability information from Labeled branchings too.
8122 2006-05-16 Raja R Harinath <rharinath@novell.com>
8124 * statement.cs (Goto.Resolve): Merge jump origins here ...
8125 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
8127 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
8128 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
8129 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
8130 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
8132 * statement.cs (Goto.Resolve): ... not here.
8133 (Goto.Emit): Remove CS1632 check.
8135 2006-05-14 Marek Safar <marek.safar@seznam.cz>
8137 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
8140 2006-05-11 Raja R Harinath <rharinath@novell.com>
8142 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
8143 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
8144 (FlowBranchingException.Label): Likewise.
8146 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
8148 (MyBitVector.Or): Use it to avoid losing information (Count).
8149 (FlowBranching.MergeOrigins): Likewise.
8151 * flowanalysis.cs (UsageVector.IsDirty): Remove.
8152 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
8153 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
8154 (UsageVector.ToString): Simplify.
8155 (UsageVector.MergeSiblings): Move here from ...
8156 (FlowBranching.Merge): ... here.
8157 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
8160 2006-05-10 Raja R Harinath <rharinath@novell.com>
8162 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
8163 null bitvector is treated as all-true.
8165 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
8166 (MyBitVector): Rationalize invariants. 'vector != null' implies
8167 that we have our own copy of the bitvector. Otherwise,
8168 'InheritsFrom == null' implies all inherited bits are true.
8170 2006-05-09 Marek Safar <marek.safar@seznam.cz>
8172 * statement.cs (LocalInfo): Add IsConstant.
8173 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
8174 local variable for constants.
8176 2006-05-09 Raja R Harinath <rharinath@novell.com>
8178 * flowanalysis.cs (MyBitVector.Empty): New.
8179 (MyBitVector): Don't allow InheritedFrom to be null.
8180 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
8181 (UsageVector, FlowBranching): Update to changes.
8183 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
8184 recursion. The 'Parent == null' condition isn't sufficient for
8186 (FlowBranching.AddBreakOrigin): Likewise.
8187 (FlowBranching.AddContinueOrigin): Likewise.
8188 (FlowBranching.AddReturnOrigin): Likewise.
8189 (FlowBranching.StealFinallyClauses): Likewise.
8190 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
8191 (FlowBranching.CheckOutParameters): Likewise.
8192 (FlowBranchingToplevel): Terminate all the above recursions here.
8193 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
8194 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
8196 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
8198 (FlowBranchingToplevel): New. Empty for now.
8199 (FlowBranching.MergeTopBlock): Update.
8200 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
8201 branching for the anonymous delegate.
8202 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
8204 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
8205 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
8206 information at the start of the merge. Reorganize.
8208 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8210 * class.cs (MethodData.Define): Method cannot implement interface accessor.
8212 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8214 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
8215 to newly introduced ctor.
8217 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
8218 message to one place.
8219 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
8222 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8224 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
8226 * ecore.cs (Expression.ResolveAsConstant): Updated.
8228 * statement.cs (ResolveMeta): Updated.
8230 2006-05-06 Marek Safar <marek.safar@seznam.cz>
8232 * cs-parser.jay: __arglist cannot be used in initializer.
8234 2006-05-06 Marek Safar <marek.safar@seznam.cz>
8237 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
8240 2006-05-05 Raja R Harinath <rharinath@novell.com>
8242 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
8243 (LabeledStatement): Add 'name' parameter.
8244 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
8245 (Block.AddLabel): Update to changes.
8246 * cs-parser.jay (labeled_statement): Likewise.
8248 * flowanalysis.cs (BranchingType.Labeled): New.
8249 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
8250 (FlowBranchingLabeled): New. Does nothing for now, but will
8251 eventually handle 'goto' flows.
8252 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8253 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
8254 that's terminated ...
8255 (Block.Resolve): ... here.
8257 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
8258 (UsageVector.MergeFinallyOrigins): Likewise.
8259 (FlowBranching.InTryOrCatch): Likewise.
8260 (FlowBranching.AddFinallyVector): Likewise.
8261 (FlowBranchingException): Update to changes.
8264 * statement.cs (Return.Resolve): Move error checking to ...
8265 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
8266 (FlowBranchingException): Handle return origins like break and
8268 (FlowBranching.UsageVector.CheckOutParameters): Remove.
8270 2006-05-04 Marek Safar <marek.safar@seznam.cz>
8273 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
8276 2006-05-04 Marek Safar <marek.safar@seznam.cz>
8279 * class.cs (MethodData.Define): Do public accessor check only when method
8280 implements an interface.
8282 2006-05-04 Raja R Harinath <rharinath@novell.com>
8284 Remove special handling of 'break'
8285 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
8286 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
8287 (UsageVector.Break): Remove.
8288 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
8290 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
8292 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
8293 UsageVector.Breaks (). Don't set NeedsReturnLabel.
8295 2006-05-03 Marek Safar <marek.safar@seznam.cz>
8298 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
8299 be the interface member.
8301 2006-05-03 Marek Safar <marek.safar@seznam.cz>
8304 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
8305 for emitting small (int) values.
8307 2006-05-03 Raja R Harinath <rharinath@novell.com>
8310 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
8311 control-flow passes through the 'finally' after merging-in all the
8312 control-flows from 'try' and the 'catch' clauses.
8314 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
8315 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
8316 always true at the only non-recursive entry point.
8317 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
8318 FlowBranchingBreakable.
8319 (FlowBranchingLoop): Remove.
8320 * statement.cs (Return.DoResolve): Update to changes.
8323 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
8324 (FlowBranching.CreateBranching): Handle it: create a
8325 FlowBranchingContinuable.
8326 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
8327 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
8328 except that it handles the 'continue' command.
8329 (FlowBranching.UsageVector.MergeOrigins): Rename from
8331 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
8332 except that it overrides AddContinueOrigin.
8333 (FlowBranchingException): Override AddContinueOrigin, similar to
8335 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
8336 Create a new branching around the embedded statement.
8337 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
8338 control flow after the embedded statement.
8339 (Continue.Resolve): Move all error checking to AddContinueOrigin.
8341 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
8342 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
8343 FlowBranchingBreakable.
8344 (FlowBranchingSwitch): Remove.
8347 * statement.cs (Break.Resolve): Simplify. Move responsibility for
8348 error reporting to ...
8349 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
8350 Rename from 'AddBreakVector'. Add new location argument. Return
8351 a bool indicating whether the 'break' crosses an unwind-protect.
8352 (FlowBranchingException.AddBreakOrigin): Add.
8353 (FlowBranchingException.Merge): Propagate 'break's to surrounding
8354 flowbranching after updating with the effects of the 'finally'
8356 (FlowBranchingBreakable): New common base class for
8357 FlowBranchingLoop and FlowBranchingSwitch.
8359 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
8361 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
8363 2006-05-02 Raja R Harinath <rharinath@novell.com>
8365 * statement.cs (Do.Resolve): If the loop is infinite, set the
8367 (While.Resolve, For.Resolve): Set a barrier after the embedded
8368 statement. There's no direct control flow that goes from the end
8369 of the embedded statement to the end of the loop.
8370 * flowanalysis.cs (FlowBranching.Infinite): Remove.
8371 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
8372 above ensure that the reachability is correctly computed.
8374 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
8375 (UsageVector.MergeBreakOrigins): If the current path is
8376 unreachable, treat it as if all parameters/locals are initialized.
8377 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
8378 infinite loops before merging-in break origins.
8380 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
8381 (Reachability.Reachable): Split part into ...
8382 (Reachability.Unreachable): ... this. Simplify.
8383 (Reachability.IsUnreachable): Use 'Unreachable' instead.
8385 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
8386 (Reachability.SetThrowsSometimes): Likewise.
8387 (FlowBranchingBlock.MergeTopBlock): Don't compare against
8388 TriState.Always, use corresponding property.
8389 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
8390 (Block.Resolve): Likewise. Remove some redundant checks.
8392 2006-05-02 Raja R Harinath <harinath@gmail.com>
8394 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
8395 (Reachability.Meet): Don't bother checking AlwaysThrows --
8396 barrier is always set.
8397 (FlowBranchingBlock.Merge): Likewise.
8399 2006-05-01 Raja R Harinath <harinath@gmail.com>
8401 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
8402 checks for unreachable.
8404 2006-05-01 Marek Safar <marek.safar@seznam.cz>
8407 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
8409 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
8410 whether field is really assigned.
8412 2006-04-30 Raja R Harinath <harinath@gmail.com>
8414 * flowanalysis.cs (Reachability): Make 4-argument constructor
8416 (Reachability.Meet): Rename from 'And'. Remove static variant.
8417 (Reachability.Always): Rename from the highly misleading
8418 'Reachability.Never'.
8419 (FlowBranching.Merge): Update to changes. Mark an impossible
8420 situation with a 'throw'.
8421 (*): Update to changes.
8423 2006-04-29 Raja R Harinath <harinath@gmail.com>
8425 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
8427 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
8428 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
8429 (*): Update to changes.
8430 * statement.cs: Update to changes.
8432 2006-04-28 Marek Safar <marek.safar@seznam.cz>
8435 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
8437 2006-04-28 Raja R Harinath <harinath@gmail.com>
8439 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
8442 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
8443 argument to two arguments: an usage-vector and a bool. Move call
8444 to FlowBranching.Merge () ...
8445 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
8447 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
8448 handling of loop and switch reachability to ...
8449 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
8451 2006-04-27 Raja R Harinath <harinath@gmail.com>
8453 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
8454 handling to FlowBranchingLoop.InLoop.
8455 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
8457 2006-04-26 Marek Safar <marek.safar@seznam.cz>
8460 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
8461 anonymous method is allowed from AnonymousContainer here.
8463 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
8465 2006-04-24 Raja R Harinath <rharinath@novell.com>
8468 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
8470 2006-04-23 Marek Safar <marek.safar@seznam.cz>
8473 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
8474 (DoubleConstant.Reduce): Ditto.
8476 2006-04-23 Raja R Harinath <rharinath@novell.com>
8478 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
8479 Remove 'lvalue_right_side' argument. Move parts to ...
8480 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
8481 (LocalVariable.DoResolveLValue): ... these.
8483 2006-04-21 Raja R Harinath <rharinath@novell.com>
8486 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
8487 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
8488 (LocalVariableReference.DoResolveBase): Use it to implement new
8490 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
8491 (Argument.Resolve): Simplify. Move CS1510 check ...
8492 * ecore.cs (Expression.ResolveLValue): ... here.
8493 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
8494 (PropertyExpr.DoResolveLValue): Likewise.
8495 (FieldExpr.Report_AssignToReadonly): Likewise.
8496 (FieldExpr.DoResolve): Add 'out_access' argument. Use
8497 LValueMemberAccess or LValueMemberOutAccess on instance depending
8499 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
8500 DoResolve as appropriate.
8502 2006-04-20 Raja R Harinath <rharinath@novell.com>
8505 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
8506 implicit conversions on 'out' and 'ref' arguments.
8508 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
8509 improve clarity. Remove dead code.
8512 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
8513 (Catch.Resolve): Resolve VarBlock if it exists.
8515 2006-04-19 Miguel de Icaza <miguel@novell.com>
8517 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
8518 twice, this was some residual code, the enumerator was emitted
8519 properly in the two branche of if later.
8521 2006-04-19 Raja R Harinath <rharinath@novell.com>
8523 * expression.cs (Cast.ResolveLValue): Remove. The result of a
8524 cast is never an lvalue.
8525 (Cast.DoResolve, Cast.ResolveRest): Combine.
8526 (Argument.Emit): Simplify slightly. Move 'Expr is
8527 IMemoryLocation' check ...
8528 (Argument.Resolve): ... here.
8529 (Argument.Error_LValueRequired): Remove. Inline into only user.
8531 Simplifications. Fix cs0191-2.cs
8532 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
8533 CS1649 and CS1651 to ...
8534 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
8535 the actual selection of the error code and message to a lookup
8536 table. Add a dummy return value to simplify callsites.
8537 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
8538 readonly fields of other instances of the same type. Move CS0197
8540 * expression.cs (Argument.Resolve): ... here. Simplify code.
8541 Ensure that ec.InRefOutArgumentResolving is only set during LValue
8542 resolution of an out or ref argument. The code simplification
8543 above uses this invariant.
8545 2006-04-18 Raja R Harinath <rharinath@novell.com>
8547 Possibly fix #77752. Fix cs1690-[4-7].cs.
8548 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
8549 CheckMarshallByRefAccess. Drop parameter.
8550 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
8552 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
8554 * report.cs (AllWarnings): Add CS1690.
8555 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
8557 (LocalVariableReference.DoResolveBase): Update.
8559 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8561 * class.cs (MethodOrOperator): Moved common parts from method class.
8562 detect obsolete attributes.
8563 (Method.Define): Simplified as it reuses code from base.
8564 (Constructor.ValidAttributeTargets): Fixed issue found during
8566 (Destructor.ValidAttributeTargets): Fixed issue found during
8568 (Operator): Finished refactoring set off by #78020. Operator class is now
8569 ordinary method class.
8571 * anonymous.cs: Updated.
8573 * decl.cs (DeclSpace): Add IsGeneric
8575 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8577 * class.cs (Constructor.Emit): Don't emit the attributes twice.
8579 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8581 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
8582 detect obsolete attributes.
8583 (Method.CreateEmitContext): Moved to MethodOrOperator.
8585 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8588 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
8589 customized exception to make crash detection easier.
8590 (MethodOrOperator): Started to work on new base class for methods and
8592 (Method): Derives from MethodOrOperator.
8593 (Constructor.Emit): Emits its own attributes.
8594 (AbstractPropertyEventMethod.Emit): Ditto.
8595 (Operator): Derives from MethodOrOperator, will refactor fully in extra
8597 (Operator.Emit): It's temporary more tricky than should be.
8599 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
8601 * report.cs (InternalErrorException): Add ctor with inner exception.
8603 2006-04-08 Marek Safar <marek.safar@seznam.cz>
8606 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
8609 2006-04-07 Marek Safar <marek.safar@seznam.cz>
8612 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
8615 2006-04-06 Marek Safar <marek.safar@seznam.cz>
8617 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
8618 attribute is present and Guid not.
8619 (Interface.ApplyAttributeBuilder): Ditto.
8621 * attribute.cs: Add error message.
8623 2006-04-06 Marek Safar <marek.safar@seznam.cz>
8627 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
8628 sources (it's composite) so hold them in extra array as they are used in
8629 Emit phase only. It worked in the previous versions by mistake.
8630 (Attribute.Emit): Emit attribute for more owners when exist.
8632 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
8633 it has now different behaviour.
8635 2006-04-04 Marek Safar <marek.safar@seznam.cz>
8637 * constant.cs (Constant.IsDefaultInitializer): New method.
8639 * class.cs: Updated.
8641 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
8642 re-initialize default values. It saves KBs almost for every assembly.
8643 Thanks Zoltan for the idea.
8644 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
8645 (ArrayCreation.DoResolve): Resolve only once.
8646 (ArrayCreation.Emit): Emit static initializer only when it is faster.
8647 (ArrayCreation.GetAttributableValue): Cope with optimized values.
8649 2006-04-03 Zoltan Varga <vargaz@gmail.com>
8651 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
8654 2006-04-01 Marek Safar <marek.safar@seznam.cz>
8656 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
8657 in an embedded statement too.
8659 2006-04-01 Raja R Harinath <rharinath@novell.com>
8662 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
8664 2006-04-01 Marek Safar <marek.safar@seznam.cz>
8668 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
8671 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
8673 2006-03-31 Marek Safar <marek.safar@seznam.cz>
8675 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
8678 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
8679 LocalTemporary change.
8681 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
8683 (ClassOrStruct.DefineFieldInitializers): Implemented static field
8684 initializers optimization.
8685 (ClassOrStruct.TypeAttr): Moved from modifiers.
8686 (Constructor.CheckBase): Don't crash when static ctor has parameters.
8687 (FieldBase.ResolveInitializer): Resolves initializer.
8688 (FieldBase.HasDefaultInitializer): New property.
8690 * cs-parser.jay: Removed message.
8692 * expression.cs (CompilerGeneratedThis): New specialization.
8694 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
8696 2006-03-28 Marek Safar <marek.safar@seznam.cz>
8698 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
8700 2006-03-27 Marek Safar <marek.safar@seznam.cz>
8702 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
8703 be now EnumConstants only.
8705 2006-03-27 Marek Safar <marek.safar@seznam.cz>
8707 * attribute.cs, driver.cs: Reset more caches.
8709 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8711 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
8713 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8715 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
8716 for easier reuse. Updated all overrides.
8717 (IntegralConstant): New base class for all integral constants.
8718 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
8719 of the constant range, report custom error.
8720 (UIntConstant.Reduce): Fixed uint conversion.
8722 * ecore.cs, literal.cs: Reduce updates.
8724 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8728 * class.cs (Constructor.Define): Removed extra if for default ctors.
8729 A patch from Atsushi Enomoto.
8731 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8733 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
8734 GetAttributableValue.
8736 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
8739 * convert.cs (ImplicitConversionRequired): Error message moved to
8742 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
8743 automatic implicit conversion of an output value.
8744 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
8746 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
8748 (TypeOf.GetAttributableValue): Add extra handling for object type.
8750 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
8751 special error message.
8753 2006-03-25 Marek Safar <marek.safar@seznam.cz>
8755 * class.cs (Constructor.Emit): Don't crash when struct ctor is
8757 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
8758 compatible with MS runtime.
8760 2006-03-23 Marek Safar <marek.safar@seznam.cz>
8762 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
8763 attribute arguments here.
8765 * class.cs (Indexer.Define): The check was moved to attribute class.
8767 2006-03-22 Marek Safar <marek.safar@seznam.cz>
8769 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
8770 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
8773 2006-03-22 Raja R Harinath <rharinath@novell.com>
8775 Support ParameterDefaultValueAttribute in gmcs. Also applied to
8776 mcs to keep code differences small.
8777 * attribute.cs (Attribute.GetParameterDefaultValue): New.
8778 * typemanager.cs (parameter_default_value_attribute_type): New.
8779 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
8782 2006-03-21 Marek Safar <marek.safar@seznam.cz>
8784 * expression.cs (StringConcat.Append): Reverted back to no warning state.
8786 2006-03-21 Marek Safar <marek.safar@seznam.cz>
8788 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
8790 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
8793 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
8795 * doc-bootstrap.cs : fix build.
8797 2006-03-20 Marek Safar <marek.safar@seznam.cz>
8799 * expression.cs (StringConcat.Append): Issue a warning when empty string
8802 2006-03-20 Marek Safar <marek.safar@seznam.cz>
8804 * assign.cs (CompoundAssign.ResolveSource): Removed.
8806 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
8809 * class.cs (TypeContainer.FindMethods): Removed.
8810 (TypeContainer.CheckMemberUsage): Made static.
8812 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
8814 * constant.cs (CheckRange): Removed unused type argument.
8815 (CheckUnsigned): Removed unused type argument.
8817 * cs-parser.jay: Updated after MemberAccess clean up.
8818 Uses Length for empty string test.
8820 * cs-tokenizer.cs: Uses Length for empty string test.
8821 (IsCastToken): Made static.
8822 (is_hex): Made static.
8823 (real_type_suffix): Made static.
8825 * decl.cs (SetupCache): Made static.
8826 (OnGenerateDocComment): Removed unused ds argument.
8828 * delegate.cs (VerifyDelegate): Removed unused argument.
8830 * doc.cs: Uses Length for empty string test.
8832 * driver.cs: Uses Length for empty string test.
8834 * enum.cs (IsValidEnumType): Made static
8836 * expression.cs (EnumLiftUp): Removed unused argument.
8837 (ResolveMethodGroup): Ditto.
8838 (BetterConversion): Ditto.
8839 (GetVarargsTypes): Ditto.
8840 (UpdateIndices): Ditto.
8841 (ValidateInitializers): Ditto.
8842 (MemberAccess.ctor): Ditto.
8843 (GetIndexersForType): Ditto.
8845 * flowanalysis.cs: (MergeFinally): Removed unused argument.
8847 * iterators.cs: Updated after MemberAccess clean up.
8849 * location.cs: Uses Length for empty string test.
8851 * namespace.cs: Uses Length for empty string test.
8853 * report.cs (CheckWarningCode): Made static.
8855 * statement.cs (LabeledStatement): Removed unused argument.
8857 * typemanager.cs (FilterNone): Removed.
8859 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8861 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
8864 * class.cs: Updated.
8866 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8868 * cs-parser.jay.cs: __arglist is not allowed for delegates.
8870 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8874 * expression.cs (VerifyArgumentsCompat): Reverted to double error
8875 reporting, it's more tricky than I thought.
8877 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8881 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
8883 (AnonymousMethod.ImplicitStandardConversionExists): New method.
8884 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
8885 Add more error reporting; Fixed issue with params.
8887 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
8889 * cs-parser.jay: AnonymousMethod requires host container.
8891 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
8893 2006-03-18 Raja R Harinath <harinath@gmail.com>
8895 * class.cs: Change 'TypeContainer ds' constructor argument to
8896 'DeclSpace parent'. Some classes were missed below due to
8897 different naming convention.
8899 * class.cs (MemberCore.Parent): Delete. This makes the
8900 ParentContainer changes below enforceable by the compiler.
8902 Treat pointers to enclosing declaration space as 'DeclSpace', not
8904 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
8905 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
8907 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
8909 (Block.AddThisVariable): Likewise.
8910 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
8911 (AbstractPropertyEventMethod.Emit): Likewise.
8912 (AbstractPropertyEventMethod.EmitMethod): Likewise.
8913 (GetMethod.Define, SetMethod.Define): Likewise.
8914 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
8915 (DelegateMethod.EmitMethod): Likewise.
8917 Fix regression test-partial-13.cs.
8918 Rationalize use of PartialContainer. Ensure that the partial
8919 class semantics can be tied to type-correctness, i.e., any
8920 violation will cause a compile error.
8921 * class.cs, const.cs: Access all fields that belong to class
8922 TypeContainer via ParentContainer. Arguments of EmitContexts and
8923 Resolve()-like functions still use 'Parent'.
8925 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
8926 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
8927 (PropertyMethod.CheckModifiers): Remove unused argument.
8928 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
8931 2006-03-17 Raja R Harinath <harinath@gmail.com>
8933 Make semantics of PartialContainer simpler.
8934 * decl.cs (DeclSpace.IsPartial): Remove.
8935 * class.cs (TypeContainer.IsPartial): Likewise.
8936 (TypeContainer..ctor): Set PartialContainer to point to self.
8937 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
8938 (TypeContainer.FindNestedType): Likewise.
8939 (MemberCore.ParentContainer): Simplify. Remove deprecation.
8941 2006-03-17 Marek Safar <marek.safar@seznam.cz>
8943 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
8945 2006-03-15 Marek Safar <marek.safar@seznam.cz>
8947 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
8950 2006-03-15 Marek Safar <marek.safar@seznam.cz>
8952 * class.cs (Operator.Define): An error for base conversion was not
8955 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
8957 * iterator.cs : yield break is allowed in try statement which has
8958 catch clauses. Fixed bug #77767.
8960 2006-03-13 Marek Safar <marek.safar@seznam.cz>
8962 A fix for #77593, #77574.
8964 * class.cs (MethodCore.CheckBase): Another if for operator.
8966 2006-03-09 Marek Safar <marek.safar@seznam.cz>
8968 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
8971 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
8972 (DelegateCreation.ImplicitStandardConversionExists): New method for just
8975 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
8978 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
8979 Updated after another emitcontext usage was clean up. It should help us to
8980 synchronize with gmcs easier.
8982 2006-03-04 Marek Safar <marek.safar@seznam.cz>
8986 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
8987 (Event.Define): ditto
8988 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
8990 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
8991 Removed redundant code and set NewSlot for Invoke method too.
8993 * parameter.cs (Parameters.ctor): Add custom, type ctor.
8994 (Parameters.MergeGenerated): New method. Use this method when you merge
8995 compiler generated argument with user arguments.
8997 2006-03-03 Marek Safar <marek.safar@seznam.cz>
8999 * attribute.cs (ResolveAsTypeTerminal): Removed.
9001 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
9002 specialization for predefined types; 30% speed up.
9003 Finally placed obsolete check to right place.
9004 (Expression.ResolveType): Removed.
9006 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
9007 Updated after ResolveType was removed.
9009 * expression.cs (Cast.ctor): Check void cast.
9010 (Binary.ResolveAsTypeTerminal): Is never type.
9011 (Conditional.ResolveAsTypeTerminal): Is never type.
9013 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
9015 2006-03-01 Raja R Harinath <rharinath@novell.com>
9018 * expression.cs (ParameterReference.DoResolveBase): Change return
9020 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
9024 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
9027 * typemanager.cs (GetFullNameSignature): Don't nullref on
9028 protected accessors.
9030 2006-02-27 Marek Safar <marek.safar@seznam.cz>
9032 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
9033 these two separated members to simplify the code.
9034 (Attribute.Resolve): Refactored to use new fields and methods.
9035 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
9036 implemented obsolete attribute checking.
9037 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
9038 implemented obsolete checking again. It look line never ending quest ;-)
9039 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
9041 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
9043 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
9045 *class.cs (Property.Define): Add RegisterProperty call.
9047 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
9048 argument groups (only 2).
9050 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
9051 encoding expression to arguments.
9052 (Expression.ExprClassToResolveFlags): Just turned to property.
9054 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
9055 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
9056 optimized as well as implemented support for zero-length attributes.
9058 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
9059 Add caching of PropertyInfo's.
9061 2006-02-25 Marek Safar <marek.safar@seznam.cz>
9063 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
9064 error multiple times.
9066 2006-02-25 Marek Safar <marek.safar@seznam.cz>
9068 New partial class implementation.
9069 A fix for #77027, #77029, #77403
9071 * attribute.cs (Attributable): Made attributes protected.
9073 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
9074 the replacements of ClassPart and PartialContainer.
9075 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
9076 (TypeContainer.AddInterface): Ditto.
9077 (TypeContainer.AddPartial): The main method for partial classes. It checks
9078 for errors and merges ModFlags and attributes. At the end class is added to
9080 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
9082 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
9083 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
9084 from the rest of partial classes.
9085 (TypeContainer.GetClassBases): Simplified.
9086 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
9088 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
9089 (TypeContainer.HasExplicitLayout): Uses Flags now.
9090 (PartialContainer): Removed.
9091 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
9092 (StaticClass): Was merged with Class.
9093 (Class.GetClassBases): class and static class bases are verified here.
9094 (Class.TypeAttr): Added static attributes when class is static.
9095 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
9096 (MemberBase): In some cases we need to call parent container for partial
9097 class. It should be eliminated but it's not easy now.
9099 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
9101 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
9102 partial classed to accumulate class comments.
9103 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
9105 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
9107 * driver.cs (MainDriver): Tree.GetDecl was removed.
9109 * modifiers.cs (Modifiers): Add partial modifier.
9111 * tree.cs (Tree.decl): Removed.
9112 (RootTypes): Started to use this class more often for root types
9115 2006-02-22 Marek Safar <marek.safar@seznam.cz>
9119 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
9120 external interface does not have an attribute.
9122 2006-02-22 Marek Safar <marek.safar@seznam.cz>
9124 Another prerequisites for new partial classs implementation.
9126 * attribute.cs (Attribute.Equal): Implemented.
9127 (Attribute.Emit): Changed as attributes can be applied more than twice.
9128 (Attributes.Emit): Check for duplicate attributes here.
9130 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
9131 as a parameter, clean-up.
9133 2006-02-11 Marek Safar <marek.safar@seznam.cz>
9137 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
9138 contains obsolete attribute check which can in some cases look for base
9139 type of current class which is not initialized yet.
9140 (TypeContainer.BaseType): Replacement of ptype.
9142 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
9144 2006-02-11 Marek Safar <marek.safar@seznam.cz>
9146 First of prerequisites for new partial classs implemention.
9148 * attribute.cs (Attributable): Extended by ResolveContext;
9149 Attributes finally have correct context for resolving in all cases.
9150 (AttachTo): Attribute owner is assigned here.
9152 * codegen.cs (IResolveContext): Introduce new interface to hold
9153 all information needed in resolving phase.
9154 (EmitContext): Implements IResolveContext; more clean-up needed here.
9156 * decl.cs (MemberCore): Implemented IResolveContext.
9158 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
9159 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
9160 parameter.cs, statement.cs, tree.cs, typemanager.cs:
9161 Refactored to use new IResolveContext instead of EmitContext; cleanup
9163 2006-02-06 Miguel de Icaza <miguel@novell.com>
9165 * codegen.cs (EmitScopeInitFromBlock): check here the
9166 capture_context, there is no need to make two calls to the
9169 * anonymous.cs: Add some debugging messages that might help me
9170 track other instances of this problem in the future (the
9171 regression of test 467).
9173 * cs-parser.jay: track the variable block, as we need to initalize
9174 any captured variables declared in this block for the "catch"
9175 portion of the "Try" statement.
9177 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
9178 scope initialization for captured variables.
9180 Also, move the emit for the variables after the block location has
9183 2006-02-06 Marek Safar <marek.safar@seznam.cz>
9185 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
9187 2006-02-02 Miguel de Icaza <miguel@novell.com>
9189 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
9190 commit yesterday, the initialization for the roots is necessary.
9191 What is not necessary is the scope activation.
9193 2006-02-02 Raja R Harinath <rharinath@novell.com>
9195 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
9196 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
9198 (Argument.Resolve): Remove CS0206 checks.
9200 2006-02-01 Miguel de Icaza <miguel@novell.com>
9202 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
9203 scopes for all the roots, the scopes will now be emitted when the
9204 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
9206 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
9207 code. This reduces a lot of existing cruft.
9209 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
9210 that the ScopeInfo is generated as we enter the scope, not at the
9211 time of use, which is what we used to do before.
9213 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
9214 every time a Block is about to be emitted if we have a
9217 2006-02-01 Raja R Harinath <rharinath@novell.com>
9219 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
9221 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
9223 * typemanager.cs (cons_param_array_attribute): Make private.
9224 (Reset): Set it to null.
9225 (InitCoreHelpers): Don't initialize it.
9226 (ConsParamArrayAttribute): New. Initialize it as needed.
9227 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
9229 2006-01-31 Miguel de Icaza <miguel@novell.com>
9231 * expression.cs: There might be errors reported during the
9232 selection of applicable methods. If there are errors, do not
9233 continue execution as it will lead the compiler to crash.
9235 2006-01-30 Miguel de Icaza <miguel@novell.com>
9237 * expression.cs: Member access is not allowed on anonymous
9238 methods. Fixes #77402.
9240 2006-01-30 Raja R Harinath <rharinath@novell.com>
9243 * cs-parser.jay (VariableDeclaration): Don't set
9244 current_array_type to null.
9245 (field_declaration, event_declaration, declaration_statement):
9246 Set it to null here.
9248 2006-01-28 Raja R Harinath <harinath@gmail.com>
9250 * typemanager.cs (GenericParameterPosition): New.
9253 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
9255 * doc.cs : To process "include" elements, first we should create
9256 another list than XmlNodeList, because it could result in node
9257 removal, which could result in that the XmlNodeList gives up
9260 (Also made code identical to gmcs again.)
9262 2006-01-25 Miguel de Icaza <miguel@novell.com>
9264 * ecore.cs: Introduce an error report that we were not catching
9265 before, if not silent, we must report the error. Gonzalo ran into
9268 2006-01-23 Miguel de Icaza <miguel@novell.com>
9270 A fix for bug: #76957
9272 * iterators.cs (MoveNextMethod.CreateMethodHost): call
9273 ComputeMethodHost before creating the method, this is a new
9276 * anonymous.cs (AnonymousContainer): Now we track all the scopes
9277 that this method references (RegisterScope). The actual scope
9278 where the method is hosted is computed with the ComputeMethodHost
9279 before we create the method.
9281 Moved the Deepest routine here.
9283 (AnonymousContainer.ComputeMethodHost): New routine used to
9284 compute the proper ScopeInfo that will host the anonymous method.
9286 (ScopeInfo): Deal with multiple roots. The problem was that we
9287 did not have a unique root where all ScopeInfos could be hanged
9288 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
9291 Remove AdjustMethodScope which is now computed at the end. Remove
9292 LinkScope which did a partial link, instead link all ScopeInfos
9293 before code generation from the new "LinkScopes" routine.
9295 Simplify all the Add* routines as they no longer need to maintain
9296 the tree, they just need to record that they are using variables
9299 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
9300 routines to produce the forest of ScopeInfo trees.
9302 * class.cs (TypeContainer.AppendMethod): This is just like
9303 AddMethod, but ensures that an interface implementation method
9304 (IEnumerable.XXX) is not inserted at the beginning of the queue of
9305 methods, but at the end.
9307 We use this functionality to ensure that the generated MoveNext
9308 method in the iterator class is resolved/emitted before the
9309 enumerator methods created.
9311 This is required because the MoveNext method computes the right
9312 ScopeInfo for the method. And the other methods will eventually
9313 need to resolve and fetch information computed from the anonymous
9316 2006-01-21 Raja R Harinath <harinath@gmail.com>
9317 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9320 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
9322 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
9323 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
9325 2006-01-18 Raja R Harinath <rharinath@novell.com>
9327 Fix #76656, cs0231-2.cs.
9328 * cs-parser.jay (formal_parameter_list): Make error case catch
9330 (parenthesized_expression_0): Add CS1026 check.
9331 (invocation_expression): Remove unused { $$ = lexer.Location }.
9333 2006-01-17 Raja R Harinath <rharinath@novell.com>
9336 * cs-parser.jay (statement_expression): Don't list out the
9337 individual statement-expressions. Convert syntax error into
9340 2006-01-16 Raja R Harinath <rharinath@novell.com>
9343 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
9344 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
9345 CheckIntermediateModification.
9346 (FieldExpr.DoResolve): Add new two-argument version that
9347 allows us to resolve the InstanceExpression as an lvalue.
9348 The one-argument variant is now just a wrapper.
9349 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
9350 Resolve the lhs as an lvalue if the it has a value type.
9351 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
9352 from Assign.DoResolve.
9353 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
9354 resolved as an lvalue.
9355 (PropertyExpr.DoResolve): Update.
9356 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
9357 has a value type. Move CS1612 check here from
9358 CheckIntermediateModification.
9359 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
9360 * expression.cs (EmptyExpression.OutAccess): New. Used as the
9361 'right_side' of a ResolveLValue on an 'out' argument.
9362 (EmptyExpression.LValueMemberAccess): New. Used as the
9363 'right_side' of a propagated ResolveLValue on a value type.
9364 (LocalVariableReference.DoResolveBase): Recognize
9365 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
9367 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
9368 EmptyExpression.Null.
9370 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
9372 * typemanager.cs : added IsGenericParameter(). In mcs it always
9374 * doc.cs : for generic parameters, use GenericParameterPosition,
9377 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
9379 * expression.cs: Fix Console.WriteLine ((this = x).foo);
9381 2006-01-12 Miguel de Icaza <miguel@novell.com>
9383 This fixes the problem where we used ldfld instead of ldflda to
9384 load the "THIS" pointer on captured parameters, when THIS is a
9385 value type. See bug #77205.
9387 * iterators.cs (CapturedThisReference.Emit): Pass false to
9388 EmitThis (we do not need the address).
9390 * codegen.cs (EmitThis): it needs to know whether we need the
9391 address of `this' or not. This is used by value types.
9393 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
9394 every other call passes false.
9396 2006-01-12 Raja R Harinath <rharinath@novell.com>
9399 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
9401 * expression.cs (Invocation.OverloadResolve): Update.
9402 (Invocation.DoResolve): Avoid double resolution of invocation.
9404 2006-01-11 Raja R Harinath <rharinath@novell.com>
9407 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
9408 unary negation of floating point types as 0-expr; negation cannot
9409 overflow in floating point types.
9412 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
9413 on operands of 'void' type.
9416 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
9417 and ExclusiveOr for boolean constants too.
9419 2006-01-09 Raja R Harinath <rharinath@novell.com>
9422 * expression.cs (Invocation.OverloadResolve): Replace reflected
9423 override methods with their base virtual methods, rather than
9425 * typemanager.cs (TypeManager.GetOverride): New.
9427 2006-01-05 Jb Evain <jbevain@gmail.com>
9429 * class.cs (Property.Define, Indexer.Define): do not tag the
9430 properties as SpecialName | RTSpecialName.
9432 2006-01-04 Miguel de Icaza <miguel@novell.com>
9434 * class.cs (MethodCore.IsDuplicateImplementation): This method was
9435 doing a low-level comparission of parameter types. It was lacking
9436 a check for __argslist.
9438 2005-12-30 Miguel de Icaza <miguel@novell.com>
9440 * expression.cs (ParameterReference.DoResolveBase): Allow
9441 reference parameters if they are local to this block.
9443 This allows the ref and out parameters of a delegate to be used in
9444 an anonymous method, for example:
9446 delegate void set (out int x);
9448 set s = delegate (out int x){
9452 This is used by functionality introduced late in the C# language.
9454 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
9455 method that take ref and out parameters.
9457 Fixes #77119 which was a late change in the spec.
9459 2005-12-23 Miguel de Icaza <miguel@novell.com>
9461 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
9462 parent if its the same scope. Fixes #77060.
9464 2005-12-21 Miguel de Icaza <miguel@novell.com>
9466 * driver.cs: Report the case of no source files and no -out:
9469 2005-12-20 Raja R Harinath <rharinath@novell.com>
9472 * expression.cs (ComposedCast.GetSignatureForError): Define.
9474 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9478 * namespace.cs (NamespaceEntry): Add extern_aliases as a
9479 ListDictionary, to contain the ExternAliasEntry entries (in
9480 addition to the NamespaceEntry.aliases hashtable). This field is
9481 shared between the original entry and its doppelganger (bodyless
9483 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
9484 extern_aliases field.
9485 (NamespaceEntry.Lookup): Move the IsImplicit check after the
9486 lookup in extern_aliases.
9488 2005-12-16 Raja R Harinath <rharinath@novell.com>
9491 * class.cs (TypeContainer.Mark_HasEquals): New.
9492 (TypeContainer.Mark_HasGetHashCode): New.
9493 (ClassPart): Override them.
9494 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
9497 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
9498 'parent' argument to the base constructor.
9500 Remove all mention of TypeContainer from decl.cs.
9501 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
9502 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
9503 (DeclSpace.DeclSpace): Likewise.
9504 (DeclSpace.DefineMembers): Remove unused argument.
9505 * cs-parser.jay (pop_current_class): Update to changes. Simplify
9506 debugging check -- we don't care if the debug code throws an
9507 InvalidCastException instead of an InternalErrorException.
9508 * class.cs (TypeContainer.DefineMembers): Update to changes.
9509 (TypeContainer.DoDefineMembers): Likewise.
9510 (TypeContainer.GetMethods): Likewise.
9511 (PropertyMember.Define): Likewise.
9512 (MemberBase.Parent): New property that forwards to
9513 MemberCore.Parent, but ensures that we get a TypeContainer.
9514 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
9515 (RootContext.PopulateTypes): Likewise. Remove special case code
9516 for !RootContext.StdLib: DefineMembers is idempotent.
9518 2005-12-14 Miguel de Icaza <miguel@novell.com>
9520 * convert.cs (ExplicitConversionCore): Check the return value from
9521 ExplicitConversionCore which can return null on failure. Fixes #76914
9523 2005-12-13 Marek Safar <marek.safar@seznam.cz>
9525 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
9527 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
9529 * doc.cs : The search for referenced namespace was insufficient to
9530 get global one as it used to do. Fixed bug #76965.
9532 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
9534 * doc.cs : check name in cref in the last phase that whether it is
9537 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
9539 * cs-tokenizer.cs : reverted the latest change: it somehow broke
9542 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
9544 * doc.cs : so it turned out that we cannot skip override check for
9545 interface members. Fixed bug #76954.
9547 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
9549 * cs-tokenizer.cs : fixed bug #75984:
9550 - #warning and #error should not be handled when the source line
9552 - #line is not checked strictly when the source line is disabled.
9553 - #define and #undef is on the other hand checked strictly at any
9556 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
9558 * cs-tokenizer.cs : missing Location (actually, filename) in one of
9561 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9563 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
9565 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
9567 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
9568 (FieldBase.Initializer): Initializer is now optional.
9569 (EventField.Define): Only event field can have initializer.
9571 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
9573 * const.cs (Const): Reuse initializer.
9575 * cs-parser.jay: Updated after FieldBase changes.
9576 Added current_array_type to simplify array initializers.
9578 * ecore.cs (NullCast.IsDefaultValue): Implemented.
9580 * expression.cs, iterators.cs: Updated.
9582 * namespace.cs (NamespaceEntry): Made UsingFound private.
9584 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9586 * parameterCollection.cs: Obsolete, removed.
9587 * parser.cs: Obsolete, removed.
9589 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9592 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
9594 * enum.cs (Enum.Define): Set obsolete context here.
9596 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
9599 - FindDocumentedMember() now expects 1) paramList as null
9600 when "we don't have to check the number of parameters" and
9601 2) Type.EmptyTypes when "there is no arguments".
9602 - Introduced FoundMember struct to hold the exact type which was
9603 used to find the documented member (the above change broke
9604 test-xml-044; it might be better just to use DeclaringType than
9605 what MS does, like this change does, but it depends on usage.)
9607 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
9609 * doc.cs : documented member might be from DeclaringType for nested
9610 types. Fixed bug #76782.
9612 2005-12-03 Ben Maurer <bmaurer@ximian.com>
9614 * anonymous.cs: Have the param code handle leaving copies on the
9615 stack etc. Allows anonymous params to take part in the assignment
9616 code (++, +=, etc). Fixes bug #76550
9618 * expression.cs: Handle the prepare_for_load/leave_copy by passing
9619 it down to the anon code.
9621 * iterators.cs: Use dummy var here
9623 * codegen.cs: Handle new vars
9625 2005-12-01 Marek Safar <marek.safar@seznam.cz>
9628 * class.cs (MethodData.Define): Set proper Obsolete context.
9630 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
9632 (FieldExpr.DoResolve): Ditto.
9634 2005-12-01 Marek Safar <marek.safar@seznam.cz>
9637 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
9638 parent is not obsolete.
9640 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
9642 * doc.cs : (FindDocumentedMember) find parameterless members first
9643 and get CS0419 in the early stage. Fixed first case of bug #76727.
9645 2005-11-30 Marek Safar <marek.safar@seznam.cz>
9648 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
9649 no error was reported.
9651 *expression.cs (Binary.DoResolve): left can be null.
9653 2005-11-22 Marek Safar <marek.safar@seznam.cz>
9656 * class.cs (MethodData.Emit): Parameters should be labeled first.
9658 2005-11-21 Marek Safar <marek.safar@seznam.cz>
9661 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
9663 2005-11-18 Marek Safar <marek.safar@seznam.cz>
9665 * attribute.cs (AreParametersCompliant): Moved to Parameter.
9667 * class.cs (MethodCore): Parameter clean up.
9668 (IMethodData): Added ParameterInfo.
9669 (MethodData): Parameter clean up.
9670 (Indexer.Define): Parameter clean up.
9682 * typemanager.cs: Parameter clean up.
9684 * delegate.cs (Define): Get rid of duplicated code.
9686 * expression.cs (ParameterReference): Removed useless parameters
9688 (Invocation): Ditto.
9690 * parameter.cs (ParamsParameter): New class, params specialization.
9691 (ArglistParameter): Attemp to separate arglist.
9692 (Parameter): Refactored to be reusable and faster.
9693 (Parameter.Modifier): Made understandable.
9694 (Parameters): Changed to be used as a class for `this' assembly
9695 parameters. Refactored to use new specialized classes.
9697 * support.cs (ParameterData): Added Types property.
9698 (InternalParameters): Deleted.
9700 2005-08-20 Martin Baulig <martin@ximian.com>
9702 Merging this patch from GMCS to fix #75867.
9704 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9705 scope if we don't already have it.
9707 2005-11-17 Martin Baulig <martin@ximian.com>
9710 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
9711 inherit the scope from our parent. Fixes #76653.
9713 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9715 * doc.cs : the previous patch does not actually fix the bug.
9716 PropertyInfo override check is now implemented and really fixed it.
9717 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
9719 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9721 * doc.cs : apply "override filter" also to properties.
9724 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9726 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
9727 no need to check overrides. For classes, omit those results from
9728 interfaces since they must exist in the class. Fixed bug #76726.
9730 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9732 * typemanager.cs : (GetFullNameSignature) differentiate indexers
9733 with different parameters. Fixed the second problem in #76685.
9735 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9737 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
9738 get expected 'protected' access in CheckValidFamilyAccess()).
9741 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9743 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
9744 Fixed bug #76705. CS1569 was incorrectly commented out.
9746 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
9748 * doc.cs : use Invocation.IsOverride() to do real override check.
9749 * expression.cs : made Invocation.IsOverride() internal.
9751 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
9753 * doc.cs : use TypeManager.FindMembers() instead of (possible)
9754 TypeBuilder.FindMembers() and filter overriden base members out.
9757 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9759 * doc.cs : ref/out parameters are represented as '@' (instead of
9760 '&' in type FullName). Fixed bug #76630 (additionally crefs).
9762 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9764 * doc.cs : when there was no '.' in cref to methods in doc comment,
9765 then parameters were missing in the output. Fixed bug #76691.
9767 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9769 * driver.cs : don't output docs when there is an error.
9772 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9775 Now it should detect indexers. Fixed primary concern in bug #76685.
9776 Fixed CS0419 message to not show the identical member signature in
9779 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9781 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
9782 instead of Type.FindMembers() since it does not handle events.
9785 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
9787 * codegen.cs: Fixed typo (speficied -> specified).
9789 2005-11-11 Marek Safar <marek.safar@seznam.cz>
9792 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
9794 2005-11-11 Marek Safar <marek.safar@seznam.cz>
9796 * attribute.cs: Changed error message.
9798 * cs-tokenizer.cs: One more check.
9800 2005-11-10 Marek Safar <marek.safar@seznam.cz>
9802 * statement.cs (Block.Resolve): Ignore empty statement.
9804 2005-11-10 Marek Safar <marek.safar@seznam.cz>
9806 * report.cs: Made error/warning methods more strict to avoid
9809 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
9810 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
9811 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
9812 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
9814 2005-11-08 Marek Safar <marek.safar@seznam.cz>
9816 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
9817 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
9819 * class.cs (TypeContainer.IsComImport): New property.
9820 (Constructor.Define): Create proper ctor for ComImport types.
9822 * expression.cs (New.CheckComImport): Fixed.
9824 2005-11-07 Miguel de Icaza <miguel@novell.com>
9826 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
9827 that a parameter has been captured does not mean that we do not
9828 have to do the rest of the processing. This fixes the second part
9829 of #76592. If there was another anonymous method capturing
9830 values in the past, the Scope would never be set for the second
9831 method that captured the same parameter.
9833 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
9834 properly manipulate the stack. Second part of fix for #76592.
9836 * expression.cs (New): Add support for invoking "new" on
9837 interfaces that have been flagged with the ComImport attribute and
9838 the CoClass. Fixes #76637
9840 * statement.cs (Try.DoEmit): When a variable is captured, do not
9841 try to emit the vi.LocalBuilder variable as it has been captured.
9842 Create a temporary variable and store the results on the
9843 FieldBuilder. Fixes #76642
9845 2005-11-07 Marek Safar <marek.safar@seznam.cz>
9847 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
9849 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
9851 * expression.cs (Binary.DoResolve): Added && optimalization.
9853 * typemanager.cs (AddUserType): Removed useless argument.
9855 2005-11-04 Marek Safar <marek.safar@seznam.cz>
9857 * statement.cs (Block.variables): Uses ListDictionary.
9859 2005-11-03 Marek Safar <marek.safar@seznam.cz>
9862 * class.cs (PartialContainer.EmitType): Customized to emit
9863 security attributes.
9864 (ClassPart.ApplyAttributeBuilder): Transform security attribute
9865 for partial classes.
9867 2005-11-03 Marek Safar <marek.safar@seznam.cz>
9870 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
9871 access has to be fixed.
9873 * typemanager.cs (IsUnmanagedType): Wrong common field type.
9875 2005-11-01 Marek Safar <marek.safar@seznam.cz>
9878 * ecore.cs (NullCast.Reduce): Implemented.
9880 * expression.cs (ArrayCreation.CheckIndices): Correcly check
9883 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
9885 (Foreach.Resolve): Catch null properly.
9887 2005-10-29 Marek Safar <marek.safar@seznam.cz>
9889 * cs-tokenizer.cs: Warning text fix.
9891 * driver.cs: AllWarningNumbers exposed on public interface.
9893 * report.cs (): Reviewed warning numbers.
9894 (IsValidWarning): Use binary search.
9896 2005-10-29 Marek Safar <marek.safar@seznam.cz>
9898 * driver.cs: Implemeted resource visibility.
9899 (Resources): New class for code sharing between /res: and
9902 2005-10-28 Marek Safar <marek.safar@seznam.cz>
9905 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
9908 * convert (Convert.ImplicitReferenceConversion): NullCast holds
9911 * ecore.cs (NullCast): Child is contant only.
9913 * literal.cs (NullLiteral.Reduce): null can be converted to any
9916 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
9918 * driver.cs: Use Encoding.Default as default code page instead
9921 2005-10-27 Raja R Harinath <rharinath@novell.com>
9924 * expression.cs (Invocation.Error_InvalidArguments): Handle
9925 __arglist parameters.
9926 (Invocation.VerifyArgumentsCompat): Likewise.
9927 * support.cs (ReflectionParameters.GetSignatureForError): Print
9928 __arglist parameters.
9929 (InternalParamters.GetSignatureForError): Likewise.
9930 * parameter.cs (Parameters.GetSignatureForError): Likewise.
9932 2005-10-26 Marek Safar <marek.safar@seznam.cz>
9934 * attribute.cs (GetPropertyValue): Made public.
9936 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
9938 Add new property WrapNonExceptionThrows to handle 2.0 assembly
9940 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
9943 * driver.cs: Reflect method name change.
9945 * statement.cs (Try.Resolve): Warn when try has both general
9948 * typemanager.cs: runtime_compatibility_attr_type new predefined
9951 2005-10-26 Raja R Harinath <harinath@gmail.com>
9954 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
9955 treat it as an empty parameter list.
9957 2005-10-26 Raja R Harinath <rharinath@novell.com>
9960 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
9961 ResolveAsTypeStep silent.
9962 * statement.cs (Block.AddConstant): Mark block as used.
9963 (Block.ResolveMeta): Avoid piling on error messages
9964 if a constant initializer resolution fails.
9966 2005-10-25 Raja R Harinath <rharinath@novell.com>
9968 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
9970 (NamespaceEntry.VerifyAllUsing): New.
9971 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
9972 behaviour. Delegates actual resolution of alias to ...
9973 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
9974 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
9976 * driver.cs (Driver.MainDriver): Update.
9978 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
9979 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
9981 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
9983 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
9984 RootNamespace.DefineNamespacesForAll.
9986 2005-10-24 Raja R Harinath <harinath@gmail.com>
9988 * typemanager.cs (assemblies, external_aliases, modules)
9989 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
9990 (ComputeNamespaces, GetRootNamespace): Remove extra staging
9991 overhead. Move resposibility ...
9992 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
9993 * driver.cs, attribute.cs, codegen.cs: Update to changes.
9995 2005-10-23 Raja R Harinath <harinath@gmail.com>
9997 * namespace.cs (RootNamespace.all_namespaces): Renamed from
9998 cached_namespaces. Improve usage.
9999 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
10000 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
10001 Move from GlobalRootNamespace and simplify.
10002 (RootNamespace.Global): Make instance variable.
10003 (RootNamespace.RootNamespace): Add "alias name" parameter.
10004 (GlobalRootNamespace): Simplify drastically.
10005 (Namespace.Lookup): Don't use GetNamespace.
10006 * typemanager.cs (GetRootNamespace): Rename from
10007 ComputeNamespaceForAlias.
10008 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
10010 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10012 * anonymous.cs (AnonymousContainer): Don't crash when container
10015 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10017 * expression.cs (Binary.DoResolve): Warn when comparing same
10020 2005-10-23 Marek Safar <marek.safar@seznam.cz>
10023 * expression.cs (Binary.DoResolve): It looks like there are no
10024 convetsion rules in enum context.
10026 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10028 Add support for extern alias qualifiers.
10029 * typemanager.cs: Move some LookupTypeReflection code
10030 to namespace.cs, to have cleaner code. Added some methods
10031 to help us keep track of the extern aliased references.
10032 * driver.cs: Add suport for extern alias assemblies on command
10033 line and check for their warnings/errors. Also keep track of the
10034 extern aliased assemblies.
10035 * namespace.cs: Move the global functionality of Namespace
10036 to GlobalRootNamespace/RootNamespace. Now the global namespace
10037 is GlobalRootNamespace.Globa. Also the code moved from
10038 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
10039 Finally added LocalAliasEntry (AliasEntry before) and
10040 ExternAliasEntry, to handle alias statements.
10041 * cs-parser.jay: Add support in the grammar for extern alias
10043 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
10044 Update callings to Namespace (now in GlobalRootNamespace).
10046 2005-10-18 Raja R Harinath <rharinath@novell.com>
10049 * class.cs (TypeContainer.DefineType): Move updating of
10050 topological sort earlier in the code.
10051 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
10053 2005-10-18 Marek Safar <marek.safar@seznam.cz>
10056 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
10058 * constant.cs (Constant.TryReduce): Moved from Cast class.
10059 (Reduce): Made little bit more OO and fixed missing conversions.
10061 * ecore.cs (Reduce): Implemented.
10062 (Binary.EnumLiftUp): New method to upgrade values to enum values.
10064 * literal.cs (Reduce): Implemented.
10066 * class.cs: Reverted Miguel's wrong commit.
10068 2005-10-14 Miguel de Icaza <miguel@novell.com>
10070 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
10072 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
10074 * cs-parser.jay, expression.cs : CS0214 was missing error location
10075 for constants. Fixed bug #76404.
10077 2005-10-11 Marek Safar <marek.safar@seznam.cz>
10080 * convert.cs (ExplicitConversionCore): Fixed object->enum
10083 2005-10-10 Raja R Harinath <rharinath@novell.com>
10085 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
10086 InstanceExpression.
10087 (PropertyExpr.EmitCall): Likewise.
10088 * expression.cs (Invocation.EmitArguments): Handle case where
10090 (Invocation.EmitCall): Avoid allocating temporary variable if
10091 there are no arguments.
10093 2005-10-07 Raja R Harinath <rharinath@novell.com>
10096 * convert.cs (ImplicitConversionStandard): Move conversion of
10097 void* to arbitrary pointer types ...
10098 (ExplicitConversionStandard): .. here.
10099 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
10100 error to always print typenames.
10102 2005-10-07 Raja R Harinath <rharinath@novell.com>
10104 * convert.cs (GetConversionOperator): Rename from
10105 GetConversionOperators. Move operator selection code from ...
10106 (UserDefinedConversion): ... here.
10108 2005-10-06 Marek Safar <marek.safar@seznam.cz>
10110 * convert.cs (ExplicitConversionCore): Removed duplicate enum
10113 2005-10-05 Marek Safar <marek.safar@seznam.cz>
10115 * assign.cs (Assign.DoResolve): Error method changed.
10117 * cfold.cs (DoConstantNumericPromotions): Error method changed.
10119 * const.cs (ResolveValue): Reset in_transit immediately.
10121 * constant.cs: Error method changed.
10123 * convert.cs: Removed useless location parameter.
10124 (ExplicitNumericConversion): Don't do double enum check.
10125 (ExplicitConversionCore): Renamed from ExplicitConversion.
10126 (ExplicitUnsafe): Extracted from ExplicitConversion.
10127 (ExplicitConversion): Uses for error reporting.
10129 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
10131 (ResolveBoolean): Uses common error method.
10132 (CastToDecimal): Get rid of ec.
10133 (CastFromDecimal): Optimized.
10134 (ConvCast): Get rid of ec.
10136 * enum.cs (ResolveValue): Reset in_transit immediately.
10137 (Emit): Return after first error.
10139 * expression.cs: Convert changes.
10141 * literal.cs: Error method changed.
10143 * statement.cs: Error method changed.
10145 2005-10-03 Raja R Harinath <rharinath@novell.com>
10147 * support.cs (SeekableStreamReader.Position): Don't error out when
10148 the requested position is just beyond the end of the current
10151 2005-09-28 Raja R Harinath <rharinath@novell.com>
10153 * support.cs (SeekableStreamReader): Simplify drastically. Don't
10154 try to keep in sync with the byte count of the underlying Stream.
10155 However, this limits us to a window size of 2048 characters: i.e.,
10156 the maximum lookahead of our lexer/parser can be 2048 characters.
10158 2005-09-28 Marek Safar <marek.safar@seznam.cz>
10161 * driver.cs: Fix compilation files with full root path.
10163 2005-09-25 Miguel de Icaza <miguel@novell.com>
10165 * report.cs (SymbolRelatedToPreviousError): Format the output so
10166 it does not use an open parenthesis that is never closed.
10168 * driver.cs: Follow coding guidelines
10170 2005-09-27 Marek Safar <marek.safar@seznam.cz>
10173 * const.cs (Const.ResolveValue): Check for assigning non-null
10174 value to reference type.
10176 2005-09-27 Marek Safar <marek.safar@seznam.cz>
10178 * anonymous.cs: Implemented ExprClassName.
10180 * assign.cs (Assign.DoResolve): Don't chrash when type is not
10183 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
10186 * class.cs (StaticClass.DefineContainerMembers): Report protected
10189 * codegen.cs: if(ed) PRODUCTION.
10191 * convert.cs (Error_CannotImplicitConversion): Better error
10194 * cs-parser.jay: More error checks.
10196 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
10198 * driver.cs (CSCParseOption): Enabled wrong option check.
10200 * ecore.cs (Expression.ExprClassName): Turned to property.
10201 (MemberExpr.CheckIntermediateModification): For checking boxed
10202 value types modification.
10204 * statement.cs (Fixed.Resolve): Expression type must be
10205 convertible to fixed type.
10206 (CollectionForeach.GetEnumeratorFilter,TryType):
10207 Small refactoring for easier error checking.
10209 2005-09-26 Marek Safar <marek.safar@seznam.cz>
10211 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
10214 * class.cs (GeneratedBaseInitializer): New class for customization
10215 compiler generated initializers.
10216 (MemberBase.DoDefine): Check Obsolete attribute here.
10217 (FieldMember.DoDefine): Ditto.
10219 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
10222 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
10223 (MemberCore.GetObsoleteAttribute): Removed argument.
10224 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
10225 (MemberCore.CheckObsoleteType): New helper.
10229 * statement.cs: Updates after MemberCore changes.
10231 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
10232 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
10234 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
10235 obsolete attribute for compiler construct.
10236 (As.DoResolve): Cache result.
10238 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
10240 2005-09-26 Raja R Harinath <rharinath@novell.com>
10243 * expression.cs (This.VerifyFixed): In a value type T, the type of
10244 'this' is T&, iow, 'this' is either an out or ref parameter. In a
10245 value type R, 'this' is treated as a value parameter.
10247 2005-09-22 Miguel de Icaza <miguel@novell.com>
10249 * statement.cs (Lock): Use the TemporaryVariable class instead of
10250 manually using local variables as those do not work when variables
10253 * ecore.cs: Moved the TemporaryVariable class from being a nested
10254 class inside Foreach to be a public class that can be employed in
10257 2005-09-19 Marek Safar <marek.safar@seznam.cz>
10259 * cs-parser.jay: interface_accessors replaced by
10260 accessor_declarations.
10262 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
10265 * statement.cs (GotoCase.Resolve): Convert null constant to
10267 (SwitchLabel.ResolveAndReduce): Ditto.
10268 (SwitchLabel.NullStringCase): Custom null stamp.
10269 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
10271 typemanager.cs (CSharpSignature): Don't skip first argument
10274 2005-09-18 Miguel de Icaza <miguel@novell.com>
10276 * driver.cs: Set InEmacs based on the environment variable EMACS.
10278 * location.cs (InEmacs): in this mode, do not report column
10279 location as it confuses Emacs.
10281 2005-09-16 Marek Safar <marek.safar@seznam.cz>
10283 * cfold.cs, constant.cs, convert.cs, ecore.cs,
10284 expression.cs, iterators.cs, literal.cs: Store constants and
10287 * class.cs (MemberBase.ShortName): Pass location.
10289 * cs-parser.jay: Some location fixes.
10291 * ecore.cs (Expression.Location): Made virtual.
10293 2005-09-05 Miguel de Icaza <miguel@novell.com>
10295 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
10296 if the underlying types are the same, otherwise we need to produce
10297 code that will do the proper cast.
10299 This was exposed by Marek's constant rewrite which produced
10300 invalid code for the call site:
10302 enum X : long { a }
10303 void Method (X v) {}
10307 This fixes test-49.cs
10309 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
10311 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
10312 Type/Object should be allowed as well. Fixed bug #75968.
10314 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
10316 * expression.cs : (Binary.DoResolve): when one is enum constant and
10317 another is constant 0, then return enum one *as enum type*.
10320 2005-09-02 Raja R Harinath <rharinath@novell.com>
10322 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
10326 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
10327 flow-branching for LocalVariableReferences in case we were invoked
10328 from a MemberAccess.
10329 * expression.cs (LocalVariableReference.VerifyAssigned): New.
10331 (LocalVariableReference.DoResolveBase): ... this.
10332 (MemberAccess.Resolve): Do the check that was disabled during
10335 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
10338 (PartialContainer.Create): check abstract/sealed/static strictly
10339 but abstract/sealed can exist only at one side. Fixed bug #75883.
10341 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
10344 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
10345 specified, don't default to UnmanagedType.I4.
10347 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
10349 * expression.cs : conditional operator should check possibly
10350 incorrect assign expression. Fixed bug #75946.
10352 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
10354 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
10355 Reverting the change. gmcs is much complex than mcs on this matter.
10357 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
10359 * cs-tokenizer.cs : To read another token ahead of the actual
10360 consumption, use new SavedToken and cache token instead of moving
10361 back the stream with SeekableStreamReader (it seemed problematic).
10363 driver.cs : Thus use StreamReader directly.
10364 * support.cs : Thus removed SeekableStreamReader.
10366 2005-08-30 Raja R Harinath <rharinath@novell.com>
10369 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
10370 (ScopeInfo.EmitScopeType): Use it to construct field names from
10371 names of captured locals.
10374 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
10375 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
10376 Pass 'target_type' to BoxedCast. Don't default to 'object'.
10377 (ExplicitConversion): Remove enum cases already handled by
10378 implicit conversion. Move implicit conversion check to the beginning.
10379 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
10380 * expression.cs (ArrayCreation.EmitDynamicInitializers):
10381 Don't treat System.Enum as a struct.
10383 2005-08-30 Jb Evain <jbevain@gmail.com>
10385 * attribute.cs: handles as expression in parameters.
10387 2005-08-30 Raja R Harinath <rharinath@novell.com>
10390 * class.cs (TypeContainer.VerifyClsName): Don't use a
10391 PartialContainer when verifying CLS compliance.
10392 (AbstractPropertyEventMethod): Set Parent here, ...
10393 (PropertyMethod): ... not here.
10395 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
10397 * attribute.cs : escaped attribute name should not be allowed to be
10398 resolved (e.g. @class as classAttribute). Fixed bug #75930.
10400 2005-08-29 Raja R Harinath <rharinath@novell.com>
10403 * convert.cs (ImplicitStandardConversionExists): Allow zero also
10404 when converting a long constant to unsigned long.
10405 * expression.cs (Invocation.OverloadResolve): Add sanity check to
10406 detect where IsApplicable and VerifyArgumentsCompat disagree.
10408 2005-08-29 Raja R Harinath <rharinath@novell.com>
10409 and Carlos Alberto Cortez <carlos@unixmexico.org>
10412 * class.cs (TypeContainer.CanElideInitializer): New helper.
10413 (TypeContainer.EmitFieldInitializers): Use it to determine if we
10414 can safely emitting the initializer of a field.
10416 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10418 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
10419 allowed inside a switch (without loop). Fixed bug #75433.
10421 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
10423 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
10424 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
10426 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10428 * driver.cs : kinda reverting the default encoding changes (not exact
10429 revert since I noticed that "codepage:reset" might not work fine).
10431 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10433 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
10434 Location. Now getter and setter store location correctly.
10435 (errors/cs0111-12.cs now reports the expected location.)
10437 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10439 * driver.cs : Use default encoding on the environment.
10440 Removed (now that) extra parameter for SeekableStreamReader.
10441 * support.cs : (SeekableStreamReader) third .ctor() argument for
10442 StreamReader is not required (always true). preamble size could
10443 be acquired in simpler and safe way.
10445 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
10447 * cs-parser.jay: report CS0642 at warning level 3
10448 and report CS0642 for an if else statement also
10449 fixes bug #74745. Patch by John Luke (and a bit
10451 Removed extra CS0642 warning check for "while",
10453 * statement.cs: In Block.Resolve(), CS0642 check
10454 is reimplemented to check a sequence of an empty
10455 statement and a block.
10457 Both fix bug #66777.
10459 2005-08-24 Marek Safar <marek.safar@seznam.cz>
10461 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
10462 detection until I fix it.
10464 * cs-tokenizer.cs: Changed error message.
10466 * cs-parser.jay: Fixed 2 error locations.
10468 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
10469 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
10472 * enum.cs (GetSignatureForError): Fixed.
10474 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
10478 * typemanager.cs (RegisterProperty): Removed.
10480 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
10482 2005-08-24 Raja R Harinath <rharinath@novell.com>
10485 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
10486 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
10488 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10490 * expression.cs : tiny fix is required for not warning positive ulong.
10493 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10495 * expression.cs : add CS0652 check for constant and integral
10496 expression. Fixed bug #53974.
10498 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10500 * expression.cs : in DoNumericPromotions(), check if there is implicit
10501 conversion overload for string (to check CS0034). Fixed bug #52492.
10503 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10505 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
10507 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10509 * ecore.cs : report location when it is *not* Null.
10511 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10517 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
10518 correctly. Fixed bug #75721.
10520 2005-08-23 Raja R Harinath <rharinath@novell.com>
10522 * support.cs (SeekableStreamReader.Position): Avoid an expensive
10523 loop that performs 'min (pos, char_count)'.
10526 * expression.cs (Unary.ResolveOperator): Don't discard implicit
10527 converted value in Operator.OnesComplement.
10529 2005-08-22 Ben Maurer <bmaurer@ximian.com>
10531 * anonymous.cs: If the anon method is pulled into a helper class,
10532 it needs to be `internal' not `private'. Fixes runtime behavior on
10535 2005-08-20 Martin Baulig <martin@ximian.com>
10537 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10538 scope if we don't already have it.
10540 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
10541 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
10544 2005-08-17 Marek Safar <marek.safar@seznam.cz>
10547 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
10548 is a partial class.
10550 2005-08-16 Marek Safar <marek.safar@seznam.cz>
10552 The big constants rewrite
10553 Fix #75746, #75685 and more
10554 As a side effect saved 1MB for MWF ;-)
10556 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
10557 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
10558 enum based for corlib compilation.
10560 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
10563 * class.cs (FixedField.Define): Use ResolveAsConstant.
10565 * const.cs (IConstant): Interface constants and enums.
10566 (Const.ResolveValue): New method for constant resolvning.
10567 (ExternalConstant): Constants from imported assemblies.
10569 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
10570 conversion; like enums.
10571 (Constant.ToType): Converts this constant to different type.
10572 (Constant.Increment): Adds 1.
10574 * convert.cs (ImplicitConversionRequired): Simplified.
10576 * cs-parser.jay: Create EnumMember directly.
10578 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
10580 * doc.cs (GenerateEnumDocComment): Removed.
10582 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
10583 (ConvertIntLiteral): Removed.
10584 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
10586 * enum.cs (EnumMember): Implement IConstant.
10587 (Enum.IsValidEnumConstant): Removed.
10588 (Enum.GetNextDefaultValue): Removed.
10589 (Enum.FindMembers): Updated.
10590 (Enum.GenerateDocComment): Iterate enum members.
10592 * expression.cs (Cast.TryReduce): Handle enums correctly.
10593 (New.Constantify): Made public.
10594 (MemberAccess.DoResolve): Removed contant specific if(s).
10596 * literal.cs (NullLiteral): Implement new abstract methods.
10598 * statement.cs (GotoCase.Resolve): Use new constant methods.
10599 (SwitchLabel.ResolveAndReduce): Use new constant methods.
10601 * typemanager.cs (LookupEnum): Removed.
10602 (IsEnumType): Fixed to work with corlib.
10603 (RegisterConstant): Removed.
10604 (LookupConstant): Removed.
10605 (GetConstant): Changed to work with IConstant.
10607 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
10609 * location.cs : Fixed overflown (>255) column number.
10611 2005-08-03 Raja R Harinath <rharinath@novell.com>
10613 First cut of the qualified-alias-member feature.
10614 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
10616 * cs-parser.jay (DOUBLE_COLON): New token.
10617 (namespace_or_type_name): Add rule for recognizing
10618 qualified-alias-members.
10619 (primary_expression): Likewise.
10620 (element_access): Allow QualifiedAliasMember as a possible
10621 type-bearing expression.
10622 (local_variable_type, local_variable_pointer_type): Likewise.
10623 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
10624 aliases in the current and enclosing namespace declarations.
10625 (NamespaceEntry.UsingAlias): Add CS0440 warning.
10626 * decl.cs (MemberName.is_double_colon): New.
10627 (MemberName.MemberName): Add new constructor for alias-member.
10628 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
10629 * expression.cs (QualifiedAliasMember): New expression type.
10631 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10633 * location.cs : it borked when no argument was specified.
10635 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10637 * location.cs : tiny ToString() format fix.
10639 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10641 * statement.cs : oops, it was missing.
10643 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10645 A set of fixes for precise line/column location.
10648 "token" field now holds a file/line "delta", a line number offset
10649 from the segment, and a column number. See also:
10650 http://lists.ximian.com/pipermail/mono-devel-list/2004-
10651 December/009508.html
10652 Removed static IsNull. Use instance IsNull property instead.
10653 * cs-tokenizer.cs :
10654 For some tokens it stores Location. For Identifier it stores
10655 LocatedToken which is a pair of string name and location.
10656 Column numbers are adjusted only at getChar().
10658 Use Location.ToString() for reporting (it now contains column).
10660 Largely modified to use LocatedToken instead of
10661 string (IDENTIFIER), and to acquire Location from some tokens.
10662 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
10663 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
10665 Now MemberName holds Location. DeclSpace.ctor() receives Location
10666 as a parameter. Removed extra parameters to all derived classes.
10667 Replaced Location.IsNull() with instance property.
10668 * assign.cs, expression.cs :
10669 Added .ctor() overload that omits Location.
10671 Added "nameEscaped" flag that indicates the identifier was escaped
10672 in the source file. This fixes bug #57047.
10674 2005-08-02 Marek Safar <marek.safar@seznam.cz>
10676 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
10677 New method, looking for lo-case imported cls type.
10679 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
10682 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10684 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
10686 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
10687 all_imported_types.
10688 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
10690 Optimized to save 3.5 MB for SWF compilation.
10692 2005-08-01 Marek Safar <marek.safar@seznam.cz>
10694 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
10695 (PartialContainer.Create): Moved logic AddToContainer.
10696 (PartialContainer.MarkForDuplicationCheck): Shares name.
10698 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
10701 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
10703 (Namespace.GetSignatureForError): New method.
10705 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
10706 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
10708 2005-08-01 Raja R Harinath <rharinath@novell.com>
10711 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
10712 member lookup rather than qualifier_type, since qualifier_type can
10715 2005-08-01 Marek Safar <marek.safar@seznam.cz>
10717 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
10720 2005-07-31 Miguel de Icaza <miguel@novell.com>
10722 * statement.cs: Copy the local exception into the exception
10723 captured local. Fixes 75674
10725 2005-07-31 Raja R Harinath <harinath@gmail.com>
10728 * expression.cs (Invocation.OverloadResolve): Don't report error
10729 CS1501 if error CS1502 has been reported.
10730 (New.DoResolve): Delegate CS1501 reporting to
10731 Invocation.OverloadResolve.
10734 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
10735 invariant-meaning-in-block property in an enclosing block if
10738 2005-07-29 Marek Safar <marek.safar@seznam.cz>
10740 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
10741 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
10742 (Switch.CheckSwitch): Just save 50kb for SWF.
10744 2005-07-27 Martin Baulig <martin@ximian.com>
10746 * anonymous.cs (CaptureContext.AddField): Added
10747 `AnonymousContainer am' argument; compute its toplevel scope if
10748 it's not already computed. Fixes #75649.
10750 2005-07-26 Raja R Harinath <rharinath@novell.com>
10753 * class.cs (Constructor.Emit): Reset block to null if the block
10756 2005-07-25 Marek Safar <marek.safar@seznam.cz>
10758 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
10760 2005-07-25 Marek Safar <marek.safar@seznam.cz>
10762 * class.cs (MethodData.Define): Check whether accessor implementing
10763 interface is public.
10765 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
10767 2005-07-22 Marek Safar <marek.safar@seznam.cz>
10770 * namespace.cs (LookupType): Moved same type check to...
10772 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
10773 with the same name.
10775 2005-07-21 Raja R Harinath <rharinath@novell.com>
10777 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
10778 already found a typebuilder.
10779 * class.cs (MethodCore.IsDuplicateImplementation): Compare
10780 MemberNames, not strings.
10782 * const.cs (Error_ExpressionMustBeConst):
10783 Rename from Error_EpressionMustBeConst.
10784 * const.cs, class.cs, statement.cd: Update.
10786 2005-07-21 Marek Safar <marek.safar@seznam.cz>
10790 * const.cs (Const.LookupConstantValue): Report missing contant expression
10792 (Error_EpressionMustBeConstant): Only one error method.
10794 * class.cs, statement.c: Updated.
10796 2005-07-20 Raja R Harinath <rharinath@novell.com>
10798 * statement.cs (Block.Flags): Add back HasVarargs.
10799 (Block.flags): Make protected.
10800 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
10802 * typemanager.cs (types, typecontainers, user_types): Remove.
10803 (UserTypes, TypeContainers): Likewise.
10804 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
10805 (CleanUp, Reset): Update.
10806 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
10807 (GetNestedType): Use Type.GetNestedType.
10808 (CoreLookupType): Take two arguments, the namespace and the
10809 basename of the type. Update to use the Namespace.Lookup
10811 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
10812 (RealMemberLookup): Use IsNestedChildOf instead of playing with
10813 string concatenation and substring matches.
10814 * class.cs, enum.cs, delegate.cs: Update to changes.
10816 2005-07-20 Marek Safar <marek.safar@seznam.cz>
10818 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
10819 Expression and made virtual.
10821 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
10822 (ImplicitStandardConversionExists): Fixed `byte' typo ?
10824 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
10826 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
10829 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
10832 2005-07-18 Marek Safar <marek.safar@seznam.cz>
10835 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
10836 AssemblyCultureAttribute is not used on executable.
10839 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
10841 2005-07-16 Raja R Harinath <rharinath@novell.com>
10844 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
10845 New. Reports CS0252/CS0253.
10846 Mostly taken from preliminary patch by Duncak Mak.
10847 (Binary.DoResolveOperator): Store results of operator lookup.
10848 Use them to detect if we need to warn about unintended reference
10851 2005-07-15 Raja R Harinath <rharinath@novell.com>
10854 * namespace.cs (Namespace.Lookup): Add back location parameter.
10855 (Namespace.LookupType): Add CS0436 report. Add location parameter.
10856 * delegate.cs, ecore.cs, expression.cs: Update to changes.
10858 * codegen.cs (EmitContext.DeclSpace): Make readonly.
10859 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
10860 (Namespace.LookupType): ... this.
10861 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
10863 * typemanager.cs (LookupTypeReflection): Remove buggy code that
10864 purported to handle pointers.
10865 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
10868 2005-07-15 Marek Safar <marek.safar@seznam.cz>
10870 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
10873 2005-07-15 Raja R Harinath <rharinath@novell.com>
10875 * namespace.cs (Namespace.Lookup): Drop location parameter.
10876 (NamespaceEntry.LookupAlias): Remove. Merge into ...
10877 (NamespaceEntry.Lookup): ... this.
10878 (NamespaceEntry.Error_AmbiguousTypeReference):
10879 Move here from DeclSpace.
10880 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
10882 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
10883 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
10884 Move to NamespaceEntry.
10885 * delegate.cs, expression.cs: Update to changes.
10887 2005-07-14 Marek Safar <marek.safar@seznam.cz>
10889 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
10890 CheckAttributeType and refactored.
10891 (Attribute.ResolvePossibleAttributeType): Changed to reuse
10892 ResolveAsTypeTerminal error handling.
10893 (ResolveAsTypeTerminal): Introduced because of global attributes extra
10895 (GetSignatureForError): Print errors in same way.
10898 * codegen.cs: Reflect attribute GetSignatureForError change.
10901 * expression.cs: Add silent parameter to ResolveAsTypeStep.
10903 * namespace.cs (UsingEntry): Refactored to make fields private.
10906 statement.cs: Error_UnexpectedKind has extra parameter.
10908 2005-07-14 Raja R Harinath <rharinath@novell.com>
10910 * ecore.cs (IAlias): Remove.
10911 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
10912 that implement the interface.
10913 * namespace.cs (Namespace): Likewise.
10914 (Namespace.declspaces): Renamed from 'defined_names'.
10915 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
10916 DeclSpace instead of an IAlias.
10917 * tree.cs (Tree.AddDecl): Update.
10919 2005-07-12 Raja R Harinath <rharinath@novell.com>
10921 * statement.cs (Block.Flags); Remove HasVarargs.
10922 (Block.HasVarargs): Move to ToplevelBlock.
10923 (Block.ThisVariable, Block.AddThisVariable): Likewise.
10924 (Block.Variables): Make protected. Initialize variable hashtable
10926 (Block.AddVariable): Update.
10927 (Block.Resolve): Update to changes.
10928 (ToplevelBlock.HasVarargs): New boolean.
10929 (ToplevelBlock.ThisVariable): Move here from Block.
10930 (ToplevelBlock.AddThisVariable): Likewise.
10931 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
10932 * expression.cs (This.ResolveBase): Update to changes.
10933 (ArglistAccess.DoResolve): Likewise.
10935 2005-07-11 Marek Safar <marek.safar@seznam.cz>
10938 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
10940 * class.cs (TypeContainer.VerifyMembers): Distinguish between
10941 not used and not used & assigned.
10942 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
10944 2005-07-11 Marek Safar <marek.safar@seznam.cz>
10947 * expression.cs (Is.DoResolve): null is never provided type.
10949 2005-07-08 Marek Safar <marek.safar@seznam.cz>
10952 * cs-parser.jay: Less strict event error rule to catch more errors.
10954 2005-07-08 Martin Baulig <martin@ximian.com>
10956 Fix test-iter-10.cs - distinguish whether we `yield' in a property
10957 gettter (allowed) or setter (not allowed).
10959 * class.cs (Accessor): Implement IIteratorContainer.
10960 (Accessor.Yields): New public field.
10961 (PropertyBase.PropertyMethod.Define): Handle iterators on a
10962 per-accessor basis.
10965 (get_accessor_declaration, set_accessor_declaration): Set the
10966 `yields' flag on the accessor, not the property.
10967 (property_declaration): Do the iterators check on a per-accessor
10968 basis and not for the whole property.
10970 2005-07-08 Martin Baulig <martin@ximian.com>
10972 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
10973 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
10975 2005-07-07 Marek Safar <marek.safar@seznam.cz>
10978 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
10979 (ExtractSecurityPermissionSet): Cope with self referencing security
10980 attributes properly.
10982 * driver.cs (SetOutputFile): Made public property OutputFile.
10984 2005-07-07 Raja R Harinath <rharinath@novell.com>
10987 * class.cs (TypeContainer.first_nonstatic_field): Rename from
10988 has_nonstatic_fields. Make into a FieldBase pointer.
10989 (TypeContainer.AddField): Add CS0282 check.
10990 (TypeContainer.EmitType): Update.
10992 2005-07-06 Miguel de Icaza <miguel@novell.com>
10994 * cs-tokenizer.cs (consume_identifier): Do not create strings to
10995 compare if they start with __.
10997 2005-07-06 Raja R Harinath <rharinath@novell.com>
10999 * statement.cs (Switch.SwitchGoverningType): Only look at
11000 UserCasts that don't need implicit standard conversions to one of
11001 the allowed switch types (Fixes test-322.cs).
11002 (LocalInfo.Resolve): Re-enable sanity-test.
11004 2005-07-06 Marek Safar <marek.safar@seznam.cz>
11006 * cs-tokenizer.cs (consume_identifier): Detect double undescores
11008 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
11010 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
11012 2005-07-06 Raja R Harinath <rharinath@novell.com>
11015 * ecore.cs (SimpleName.GetSignatureForError): Add.
11016 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
11017 (MemberAccess.GetSignatureForError): Add.
11019 2005-07-05 Marek Safar <marek.safar@seznam.cz>
11021 The big error and warning messages review.
11051 * typemanager.cs: Updated.
11053 * class.cs: (MethodCore.SetYields): Moved here to share.
11054 (PropertyMethod.Define): Moved iterator setup here.
11056 * iterators.cs: Add orig_method to have full access to parent
11059 2005-07-05 Raja R Harinath <rharinath@novell.com>
11061 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
11062 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
11063 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
11064 variable of struct type.
11065 * expression.cs (Unary.ResolveOperator): Update to change.
11066 (Indirection.VerifyFixed): Likewise.
11067 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
11068 (ParameterReference.VerifyFixed): Value parameters are fixed.
11069 (This.VerifyFixed): Treat 'this' as a value parameter.
11070 * statement.cs (LocalInfo.IsFixed): Remove.
11072 2005-07-01 Martin Baulig <martin@ximian.com>
11074 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
11075 `ec.EmitThis ()' to get the correct scope.
11077 2005-07-01 Martin Baulig <martin@ximian.com>
11079 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
11080 instance is a ParameterReference; fixes #75299.
11082 2005-07-01 Martin Baulig <martin@ximian.com>
11084 Reverted Marek's latest patch (r46725):
11085 - it contains structural changes which are neither mentioned in
11086 the ChangeLog nor explained anywhere; for example the additional
11087 argument of EmitContext's and Iterator's .ctor's and the
11088 TypeContainer.DefineMembers() change.
11089 - structural changes like this should go in in seperate patches
11090 and not be hidden in a huge patch which just seems to affect
11091 warnings and errors.
11092 a big and hard to understand patch.
11093 - it breaks iterators and causes regressions, for instance in
11096 2005-06-30 Raja R Harinath <rharinath@novell.com>
11099 * expression.cs (Indexers.map): Remove.
11100 (Indexers.Append): Filter out inaccessible setters and getters.
11101 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
11104 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
11105 Refactored from ...
11106 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
11107 (FieldExpr.Emit, PropertyExpr.Emit): Update.
11108 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
11109 * expression.cs (Invocation.EmitCall): Add CS0120 check.
11111 2005-06-30 Marek Safar <marek.safar@seznam.cz>
11114 * class.cs (FieldBase.GetInitializerExpression): One more field
11117 2005-06-28 Miguel de Icaza <miguel@novell.com>
11119 * pending.cs: Do not define a proxy if the base method is virtual,
11120 it will be picked up by the runtime (bug 75270).
11122 2005-06-08 Martin Baulig <martin@ximian.com>
11124 The big Iterators rewrite :-)
11126 * iterators.cs: Rewrite this to use the anonymous methods framework.
11128 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
11129 before the TypeContainers; see 2test-21.cs.
11132 (TypeContainer.DefineType): Don't create a new EmitContext if we
11133 already have one (this only happens if we're an Iterator).
11134 (TypeContainer.Define): Also call Define() on all our iterators.
11135 (Method.CreateEmitContext): Added support for iterators.
11138 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
11139 (AnonymousContainer.CreateMethodHost): Moved here from
11140 AnonymousMethod and made abstract.
11141 (AnonymousContainer.CreateScopeType): New abstract method.
11142 (AnonymousContainer.IsIterator): New public property.
11143 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
11144 get the ScopeTypeBuilder rather than manually defining it here.
11145 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
11148 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
11149 before RootContext.DefineTypes().
11151 * codegen.cs (EmitContext.RemapToProxy): Removed.
11152 (EmitContext.CurrentAnonymousMethod): Changed type from
11153 AnonymousMethod -> AnonymousContainer.
11154 (EmitContext.ResolveTopBlock): Protect from being called twice.
11155 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
11156 (EmitContext.EmitThis): Removed the iterators hacks; use the
11157 anonymous methods framework for that.
11160 (ToplevelBlock.Container): Make this a property, not a field.
11161 (ToplevelBlock.ReParent): New public method; move the
11162 ToplevelBlock into a new container.
11163 (Foreach.TemporaryVariable): Simplify.
11165 2005-06-05 Martin Baulig <martin@ximian.com>
11167 * statement.cs (LocalInfo.CompilerGenerated): New flag.
11168 (Block.AddTemporaryVariable): New public method; creates a new
11169 `LocalInfo' for a temporary variable.
11170 (Block.EmitMeta): Create the LocalBuilders for all the temporary
11172 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
11173 non-iterator variables.
11175 2005-06-05 Martin Baulig <martin@ximian.com>
11177 * statement.cs (Foreach.TemporaryVariable): Create the
11178 LocalBuilder in the Emit phase and not in Resolve since in some
11179 situations, we don't have an ILGenerator during Resolve; see
11180 2test-19.cs for an example.
11182 2005-06-04 Martin Baulig <martin@ximian.com>
11184 **** Merged r45395 from GCS ****
11186 The big Foreach rewrite - Part II.
11188 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
11189 with `PropertyInfo ienumerator_getcurrent'.
11191 * codegen.cs (VariableStorage): Removed.
11194 (Foreach): Derive from Statement, not ExceptionStatement.
11195 (Foreach.CollectionForeach): New nested class. Moved all the code
11196 dealing with collection foreach here.
11197 (Foreach.ForeachHelperMethods): Removed.
11198 (Foreach.TemporaryVariable): Implement IMemoryLocation.
11200 2005-05-23 Martin Baulig <martin@ximian.com>
11202 * statement.cs (Try.DoResolve): Don't create a `finally' if we
11203 don't need to. Fix #75014.
11205 2005-05-20 Martin Baulig <martin@ximian.com>
11207 Merged r44808 from GMCS.
11209 * class.cs (TypeContainer.CircularDepException): Removed.
11210 (TypeContainer.DefineType): Removed the `InTransit' stuff.
11211 (TypeContainer.CheckRecursiveDefinition): Check for circular class
11212 (CS0146) and interface (CS0529) dependencies here.
11214 2005-06-21 Raja R Harinath <rharinath@novell.com>
11216 * expression.cs (Invocation.EmitCall): Fix initialization
11217 'this_call' to reflect current behaviour. Fix indentation.
11219 * convert.cs (FindMostEncompassedType): Add two trivial special
11220 cases (number_of_types == 0 || number_of_types == 1).
11221 (FindMostEncompasingType): Likewise.
11223 2005-06-17 Raja R Harinath <rharinath@novell.com>
11225 Some cleanups preparing for the fix of #75283.
11226 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
11228 (EventExpr.InstanceResolve): Likewise.
11229 (EventExpr.DoResolve): Remove redundant checks.
11231 2005-06-10 Duncan Mak <duncan@novell.com>
11233 * cs-tokenizer.cs (process_directives): New flag for controlling
11234 the processing of preprocessor directives.
11235 (x_token): After seeing a '#', return Token.NONE instead of going
11236 to handle_preprocessing_directive() when not processing
11237 directives. This avoids unnecessary processing during the token peek in
11242 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
11243 the existing error reporting methods instead of Report.Error.
11245 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
11246 after Raja's rewrite.
11248 2005-06-08 Miguel de Icaza <miguel@novell.com>
11250 * class.cs: Small fix.
11252 2005-06-08 Raja R Harinath <rharinath@novell.com>
11255 * class.cs (GetPartialBases): Fix return value check of
11256 part.GetClassBases.
11258 2005-06-07 Raja R Harinath <rharinath@novell.com>
11260 Ensure that partial classes are registered in their enclosing
11261 namespace. Initial part of fix of #75160.
11262 * tree.cs (Tree.RecordDecl): Add new namespace argument.
11263 Register declspace with namespace here, not in
11264 DeclSpace.RecordDecl.
11265 * cs-parser.jay: Pass namespace to RecordDecl.
11266 * class.cs (PartialContainer.Create): Likewise.
11267 (ClassPart.DefineType): New sanity-check. Throws an exception if
11269 * decl.cs (Declspace.RecordDecl): Remove.
11270 * namespace.cs (NamespaceEntry.DefineName): Remove.
11272 2005-06-06 Marek Safar <marek.safar@seznam.cz>
11274 * rootcontext.cs: Reset TargetExt as well.
11276 2005-06-03 Raja R Harinath <rharinath@novell.com>
11278 * ecore.cs (Expression.Resolve): Emit CS0654 error when
11279 -langversion:ISO-1.
11281 2005-06-02 Raja R Harinath <rharinath@novell.com>
11283 Fix #75080, cs0119.cs.
11284 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
11286 (Expression.Resolve): ... this. Use it. Remove bogus code
11287 allowing ExprClass.Type and ExprClass.Namespace for
11288 ResolveFlags.VariableOrValue.
11289 (Expression.Resolve) [1-argument variant]: Change default resolve
11290 flags based on language version.
11291 (Expression.Error_UnexpectedKind): Use a simple string array
11292 rather than an ArrayList.
11293 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
11294 not ExprClass.Type.
11295 (TypeOfVoid.DoResolve): Likewise.
11296 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
11297 flags argument -- it always has the same value.
11299 2005-05-31 Raja R Harinath <rharinath@novell.com>
11302 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
11303 Use it in the error message.
11304 * assign.cs, expression.cs, statement.cs: Update.
11306 2005-05-30 Raja R Harinath <rharinath@novell.com>
11309 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
11310 the "almostMatchedMember" case too.
11311 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
11312 that failed the accessibility checks to 'almost_match'.
11314 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
11316 * attribute.cs: Use internal MethodBuilder methods to set
11317 ExactSpelling and SetLastError on PInvoke methods, instead
11318 of passing them via charset. Fixes #75060.
11320 2005-05-27 Raja R Harinath <rharinath@novell.com>
11322 * parameter.cs (Parameter): Remove TODO comment.
11323 (Parameter.DefineParameter): Remove Location parameter.
11324 (Parameters.LabelParameters): Likewise.
11325 * class.cs (Constructor.Emit): Update to change.
11326 (MethodData.Emit): Likewise.
11327 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
11328 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
11330 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
11333 Removed Parameters.Location and added Parameter.Location instead.
11334 Removed Location parameter from Emit() and GetSignature().
11341 Modified all related calls.
11343 2005-05-26 Raja R Harinath <rharinath@novell.com>
11345 Improve user-defined conversion handling.
11346 * convert.cs (GetConversionOperators): Rewrite. Return only the
11347 applicable operators.
11348 (AddConversionOperators): New. Helper for GetConversionOperators.
11349 (FindMostEncompassedType, FindMostEncompassingType): Verify that
11350 there is only one most encompassed/encompassing type.
11351 (FindMostSpecificSource, FindMostSpecificTarget): Remove
11352 "applicable operator" handling.
11353 (UserConversion): Move cache here from GetConversionOperators.
11354 Directly cache the chosen operator, rather than the whole
11356 (ExplicitNumericConversion): Fix buggy implementation of Decimal
11357 case. Allow conversion of decimal to sbyte and byte too.
11358 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
11359 New static methods. Used to avoid allocating EmptyExpressions in
11362 2005-05-24 Duncan Mak <duncan@novell.com>
11364 * ecore.cs (CastFromDecimal): New class for casting a decimal to
11365 another class, used in Convert.ExplicitNumericConversion.
11366 (CastToDecimal): New class, similar to above, but casts to
11367 System.Decimal, used in Convert.ImplicitNumericConversion and also
11368 in explicit convesion from double/float to decimal.
11370 * convert.cs (ImplicitNumericConversion): Handle implicit
11371 conversions to System.Decimal.
11372 (ExplicitNumericConversion): handle explicit conversions to
11377 2005-05-20 Miguel de Icaza <miguel@novell.com>
11379 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
11380 know the type at this stage, just break through. Fixes #75008
11382 2005-05-19 Martin Baulig <martin@ximian.com>
11385 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
11386 to disable error reporting.
11388 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
11389 here since we don't want to report an error; see the new test-336.cs.
11391 2005-05-19 Raja R Harinath <rharinath@novell.com>
11393 * statement.cs (ToplevelBlock.GetParameterReference)
11394 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
11395 Move here from class Block.
11396 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
11397 * expression.cs (ParameterReference.DoResolveBase): Likewise.
11399 2005-05-18 Martin Baulig <martin@ximian.com>
11404 (FlowBranching.Reachability): Add non-static public And() and Or()
11406 (FlowBranchingSwitch): New class; do the `break_origins' thing
11407 like in FlowBranchingLoop.
11408 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
11409 reachability, not just locals and parameters.
11410 (FlowBranching.MergeChild): Remove some of the hacks for loop and
11411 switch; MergeBreakOrigins() now takes care of that.
11413 2005-05-18 Martin Baulig <martin@ximian.com>
11415 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11416 a loop and may leave it, reset the barrier; fixes #74974.
11418 2005-05-17 Marek Safar <marek.safar@seznam.cz>
11420 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
11423 * cs-parser.jay: Catch more lexical errors.
11425 * report.cs: Add one more Error method.
11428 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
11430 2005-05-17 Martin Baulig <martin@ximian.com>
11432 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
11435 2005-05-16 Raja R Harinath <rharinath@novell.com>
11437 Fix test-382.cs. Emit values of decimal constants.
11438 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
11440 (TypeContainer.AddField): ... this.
11441 (TypeContainer.EmitFieldInitializers): Allow the list of fields
11442 with initializers to include 'Const's.
11443 (ClassPart.RegisterFieldForInitialization): Forward to
11445 * const.cs (Const.Const): Pass initializer to base class.
11446 (Const.Define): In case of decimal constants, register them for
11447 initialization in a static constructor.
11449 2005-05-14 Martin Baulig <martin@ximian.com>
11451 * statement.cs (Block.Resolve): Correctly handle unreachable code;
11452 do not call ResolveUnreachable() on unreachable statements in
11453 here, see the comment in the source code.
11455 2005-05-13 Raja R Harinath <rharinath@novell.com>
11458 * expression.cs (BinaryResolveOperator): If one of the operands of
11459 an equality comparison is 'null' and the other is a pointer type,
11460 convert the null to a NullPointer.
11461 * convert.cs (ImplicitReferenceConversion): If the expression is a
11462 NullLiteral and the target type is a pointer type, return a
11463 NullPointer instead.
11464 (ImplicitConversionStandard): Likewise.
11466 2005-05-13 Marek Safar <marek.safar@seznam.cz>
11468 * cs-parser.jay: Set readonly context based on special constructs.
11470 * expression.cs (LocalVariableReference.DoResolveBase): Improved
11471 readonly variable error handling.
11473 * rootcontext.cs (EmitCode): Don't verify members when error
11476 * statement.cs (LocalInfo): Add reaodnly context information.
11477 (SetReadOnlyContext, GetReadOnlyContext): New methods.
11479 2005-05-13 Raja R Harinath <rharinath@novell.com>
11481 * statement.cs (Block.Resolve): Revert change below. Modify fix
11482 for #74041 to initialize 'resolved' to false only for explicit
11483 blocks. Fixes #74873.
11485 2005-05-12 Raja R Harinath <harinath@gmail.com>
11488 * typemanager.cs (unmanaged_enclosing_types): New.
11489 (IsUnmanagedType): Avoid infloops by using
11490 'unmanaged_enclosing_types' to talk with recursive invocations.
11492 2005-05-13 Martin Baulig <martin@ximian.com>
11494 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
11495 instance variable, not a local. Fix #74873.
11496 (Block.ResolveUnreachable): Set it to true here.
11498 2005-05-11 Duncan Mak <duncan@novell.com>
11500 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
11501 continuing to process for 'arg'.
11502 (handle_preprocessing_directive): Check the argument of the #endif
11503 directive and report error CS1025 if there are any trailing
11506 According to the C# spec, having even whitespace after the #endif
11507 directive is illegal; however, because we call arg.TrimEnd ()
11508 beforehand, we have the same behavior as csc, allowing whitespace
11509 after the directive.
11513 2005-05-11 Marek Safar <marek.safar@seznam.cz>
11517 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
11518 (Constructor.GetObsoleteAttribute): Implemented correctly.
11520 2005-05-10 Martin Baulig <martin@ximian.com>
11522 * support.cs (ReflectionParameters.ParameterModifier): Use
11523 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
11524 and `ParameterAttributes.In'. Fixes #74884.
11526 2005-05-10 Marek Safar <marek.safar@seznam.cz>
11528 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
11530 * expression.cs (Argument.GetParameterModifier): Turned to property.
11531 (Invocation.Error_InvalidArguments): Add more descriptive errors.
11533 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
11536 2005-05-09 Raja R Harinath <rharinath@novell.com>
11539 * decl.cs (MemberCache.AddMethods): Register override methods,
11540 rather than non-override methods.
11541 * typemanager.cs (RegisterOverride): New.
11542 (IsOverride): Update.
11544 2005-05-09 Marek Safar <marek.safar@seznam.cz>
11548 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
11549 recursive declaration.
11551 * statement.cs (Block.ResolveMeta): Report any error in resolving.
11553 2005-05-06 Marek Safar <marek.safar@seznam.cz>
11555 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
11557 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
11559 2005-05-05 Raja R Harinath <rharinath@novell.com>
11562 * decl.cs (DeclSpace.FamilyAccessible):
11563 Use TypeManager.IsNestedFamilyAccessible.
11565 Fix reopened #64812.
11566 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
11569 2005-05-04 Raja R Harinath <rharinath@novell.com>
11570 Abin Thomas <projectmonokochi@rediffmail.com>
11571 Anoob V E <projectmonokochi@rediffmail.com>
11572 Harilal P R <projectmonokochi@rediffmail.com>
11575 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
11576 allow access to all static members.
11578 2005-05-04 Martin Baulig <martin@ximian.com>
11580 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
11582 2005-05-04 Martin Baulig <martin@ximian.com>
11586 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
11587 section at the end; make things work if `default' is not the last
11590 2005-05-04 Martin Baulig <martin@ximian.com>
11594 * statement.cs (Switch): Replaced the `got_default' field with a
11595 `default_section' one.
11596 (Switch.CheckSwitch): Set `default_section' here.
11597 (Switch.Resolve): If we're a constant switch and the constant is
11598 not found, use the default section.
11600 2005-05-03 Martin Baulig <martin@ximian.com>
11602 * expression.cs (ArrayAccess.EmitGetLength): New public method.
11604 * statement.cs (Foreach.ArrayForeach): New nested class.
11605 (Foreach.TemporaryVariable): New nested class.
11606 (Foreach.EmitArrayForeach): Removed; this is now in the new
11607 ArrayForeach class.
11609 2005-05-03 Raja R Harinath <rharinath@novell.com>
11611 * pending.cs (BaseImplements): Move the #74773 fix here. This is
11613 (VerifyPendingMethods): Revert change below.
11615 * typemanager.cs (IsOverride, RegisterNonOverride): New.
11616 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
11617 that used to trigger warning -28. Remove warning -28.
11618 * expression.cs (Invocation.OverloadResolve): Use
11619 TypeManager.IsOverride to distinguish override methods.
11622 * pending.cs (VerifyPendingMethods): If a base type implements the
11623 requested interface, don't bother checking individual methods of
11624 the base type. As a side-effect, this prevents the creation of
11625 unnecessary proxies.
11627 2005-05-02 Martin Baulig <martin@ximian.com>
11631 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11632 Also `And' the locals if the old vector is null.
11633 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
11634 null; in this case we basically reset all the variables.
11636 2005-05-02 Martin Baulig <martin@ximian.com>
11640 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
11641 Added `FlowBranching branching' argument; always `and' the
11642 variables instead of `or'ing them unless we're an infinite loop.
11644 * statement.cs (While.Resolve): Create a new sibling unless we're
11647 2005-05-02 Martin Baulig <martin@ximian.com>
11651 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
11652 arguments; use it instead of creating a new TopLevelBlock.
11653 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
11654 our ConstructorInitializer.
11657 (TopLevelBlock.TopLevelBranching): New public property.
11658 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
11659 and create our `TopLevelBranching'.
11661 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
11662 anonymous method host, use `block.TopLevelBranching' rather than
11663 creating a new branching.
11665 2005-04-20 Miguel de Icaza <miguel@novell.com>
11667 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
11668 a ScopeInfo, if any of the current children is a child of the new
11669 entry, move those children there.
11671 2005-04-30 Martin Baulig <martin@ximian.com>
11673 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
11674 at the beginning of a SwitchSection. Fix #73335.
11676 2005-04-27 Marek Safar <marek.safar@seznam.cz>
11679 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
11681 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
11682 (FieldExpr.DoResolve): Obsolete members are ignored for field
11685 2005-04-26 Marek Safar <marek.safar@seznam.cz>
11687 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
11688 of arrays detection.
11690 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
11692 (Field.VerifyClsCompliance): Volatile fields are not compliant.
11694 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
11697 2005-04-25 Ben Maurer <bmaurer@ximian.com>
11699 * cs-parser.jay: Use the prefered version of -unsafe in error
11702 2005-04-22 Marek Safar <marek.safar@seznam.cz>
11704 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
11707 2005-04-20 John Luke <john.luke@gmail.com>
11709 * driver.cs: fix typo in error message, --outout to --output
11711 2005-04-20 Marek Safar <marek.safar@seznam.cz>
11713 * codegen.cs (InRefOutArgumentResolving): New field.
11715 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
11716 fields outside contructor.
11718 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
11720 2005-04-19 Miguel de Icaza <miguel@novell.com>
11722 * anonymous.cs (CaptureContext.EmitParameterInstance): The
11723 parameter code was not completed ever, so it was not as up-to-date
11724 as local variables. Must finish it.
11726 The bug fix was to compare the Toplevel of the block, not the
11727 current block. Thanks for Ben for pointing this out.
11729 2005-04-19 Raja R Harinath <rharinath@novell.com>
11731 * decl.cs (AddMethods): Use the declaring type of the problem
11732 method to determine if we want to squash a warning.
11734 2005-04-19 Marek Safar <marek.safar@seznam.cz>
11736 * attribute.cs: Removed debug output.
11738 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
11740 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
11743 2005-04-18 Raja R Harinath <rharinath@novell.com>
11746 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
11747 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
11748 all null comparisons against reference types.
11750 2005-04-18 Marek Safar <marek.safar@seznam.cz>
11753 * class.cs (TypeContainer.CircularDepException) New nested
11755 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
11756 (TypeContainer.DefineType): Removed error, reset InTransit before
11758 (Class.DefineType): Throw exception when is in Transit.
11759 Catch exception and report error.
11760 (Struct.DefineType): Throw exception when is in Transit.
11761 Catch exception and report error.
11762 (Interface.DefineType): Throw exception when is in Transit.
11763 Catch exception and report error.
11765 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
11766 handle nested exception handlers.
11768 * flowanalysis.cs (InTryWithCatch): New method, search for try with
11771 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
11772 InFinally and InCatch storage.
11774 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
11775 (Catch.Resolve): Set and Restore ec.InCatch.
11776 (Try.Resolve): Set and Restore ec.InFinally.
11777 (Try.HasCatch): True when try has catch.
11779 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
11781 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
11782 for the same event member, so exclude such cases from warning 419.
11785 2005-04-16 Miguel de Icaza <miguel@novell.com>
11787 * expression.cs (Binary.ResolveOperator): Apply patch from John
11788 Luke to fix bug 59864: operators &, | and ^ on enumerations
11789 require that the same enum type on both sides.
11791 * driver.cs: Add warnings to old flag usage, this is to assist
11792 people who produce Makefiles and hope that the Makefiles will be
11795 * class.cs (TypeContainer.EmitType): Moved the definition of the
11796 special $PRIVATE$ field from the resolve phase to the Emit phase.
11797 During resolve we do not know if we are a struct with
11798 HasExplicitLayout, we know this only after the attributes for the
11801 Set the FieldOffset to zero on the dummy field that we create for
11802 the class. Fixes 74590.
11804 2005-04-16 Raja R Harinath <rharinath@novell.com>
11807 * ecore.cs (PropertyExpr.resolved): New.
11808 (DoResolve): Use it to handle a case of double resolution here.
11809 Handle a case of identical-name-and-type-name.
11810 * expression.cs (ArrayCreation.CheckIndices): Avoid double
11811 resolution by storing the results of expression resolution back
11812 into the "probes" array.
11814 2005-04-15 Raja R Harinath <rharinath@novell.com>
11816 Fix cs0208-7.cs and cs0208-8.cs.
11817 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
11818 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
11819 error reporting to point out the reason a struct is not unmanaged.
11821 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11823 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
11824 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
11826 2005-04-13 Raja R Harinath <rharinath@novell.com>
11829 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
11830 IdenticalNameAndTypeName here.
11831 (EventExpr.InstanceResolve): Likewise.
11833 2005-04-13 Marek Safar <marek.safar@seznam.cz>
11835 C# 2.0 DefaultCharSetAttribute implementation
11837 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
11838 which allows us to set GlobalNamespace for every resolve.
11839 (Attribute.ResolveArguments): Cut from Resolve.
11840 (Attribute.GetCharSetValue): Returns CharSet named argument.
11841 (Attribute.DefinePInvokeMethod): Gets default charset from
11843 (GlobalAttribute.ResolveAsTypeStep): Override.
11844 (GlobalAttribute.ResolveArguments): Override.
11846 * class.cs (TypeAttr): Is protected.
11848 * codegen.cs (ModuleClass.DefaultCharSet): New member.
11849 (ModuleClass.DefaultCharSetType): New memeber.
11850 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
11852 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
11853 charset from module.
11855 * delegate.cs (TypeAttr): Override.
11856 (Delegate.DefineType): Use this TypeAttr.
11858 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
11859 at very early stage (before types are defined) to resolve model
11860 module attributes. It will probably not work with corlib but it
11863 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
11864 charset from module.
11866 * typemanager.cs (default_charset_type): New type.
11868 2005-04-13 Raja R Harinath <rharinath@novell.com>
11870 * decl.cs (MemberCache.AddMethods): Don't warn if
11871 System.Object.Finalize has buggy MethodAttributes.
11873 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
11876 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11878 * doc.cs : detect ambiguous reference to overloaded members.
11879 Fixed bug #71603. MS 1.1 csc does not detect it.
11881 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11883 * doc.cs : delegates must not be referenced with parameters.
11886 2005-04-12 Miguel de Icaza <miguel@novell.com>
11888 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
11890 2005-04-10 Miguel de Icaza <miguel@novell.com>
11892 * driver.cs (MainDriver): Stop processing if the CLS stage found
11895 (CompilerCallableEntryPoint.InvokeCompiler): Always
11896 reset after execution; Take a TextWriter argument for the
11899 * report.cs: Use the error stream instead of hardcoding stderr.
11901 2005-04-09 Miguel de Icaza <miguel@novell.com>
11903 * class.cs: Reduce code paths to test, too small of an
11904 optimization to make it worth the extra testing. Always perform
11907 2005-04-08 Raja R Harinath <rharinath@novell.com>
11910 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
11911 operators that had errors reported on them.
11913 2005-04-08 Marek Safar <marek.safar@seznam.cz>
11915 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
11917 (Attribute.Resolve): Add named argument type checking.
11919 * class.cs (FixedField.Define): Use IsPrimitiveType
11921 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
11923 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
11924 unsafe parameter types.
11926 * statement.cs (Using.ResolveExpression): Add better error description.
11928 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
11930 2005-04-08 Raja R Harinath <rharinath@novell.com>
11933 * attribute.cs (Attribute.GetAttributeUsage): Resolve
11934 AttributeUsageAttribute in the emitcontext of the attribute class,
11935 not in the emitcontext of the attributable entity it was attached to.
11936 * cs-parser.jay: Use 'current_class', not 'current_container',
11937 when creating a GlobalAttribute.
11939 2005-04-08 Alp Toker <alp@atoker.com>
11941 * pending.cs: The fix to #58413 failed to compile methods implementing
11942 interfaces with/without params modifiers and vice versa, even though
11943 params modifiers aren't part of the signature. Make the modifier check
11944 less strict as in csc.
11946 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
11947 Anoob V E <projectmonokochi@rediffmail.com>
11948 Harilal P R <projectmonokochi@rediffmail.com>
11951 * pending.cs (TypeAndMethods.mods): New. Store the parameter
11952 modifiers of pending methods.
11953 (PendingImplementation.PendingImplementation): Initialize it.
11954 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
11955 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
11956 with ParameterData. Add check for modifiers.
11957 * class.cs (MethodData.Define): Update to changes.
11959 2005-04-07 Raja R Harinath <rharinath@novell.com>
11961 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
11963 2005-04-07 Marek Safar <marek.safar@seznam.cz>
11965 * class.cs (PropertyMethod.Define): Check private accessor in abstract
11968 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
11971 * typemanager.cs: Registered RequiredAttributeAttribute.
11973 2005-04-06 Marek Safar <marek.safar@seznam.cz>
11975 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
11976 Warning CS0169 is back at level 3.
11977 (IMethodData.SetMemberIsUsed): New method.
11979 * decl.cs (IsUsed): New value; moved from FieldBase.Status
11980 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
11982 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
11984 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
11986 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
11989 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
11992 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
11993 to avoid the problems with nested types.
11995 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
11996 Anoob V.E <projectmonokochi@rediffmail.com>
11997 Harilal P.R <projectmonokochi@rediffmail.com>
11998 Raja R Harinath <rharinath@novell.com>
12001 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
12003 * typemanager (GetConstructor): Make public.
12005 2005-04-05 John Luke <john.luke@gmail.com>
12006 Raja R Harinath <rharinath@novell.com>
12009 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
12010 struct too. Return false quicker in a few cases.
12011 (VerifyUnManaged): Use it.
12013 2005-04-05 Raja R Harinath <rharinath@novell.com>
12016 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
12017 not 'unreachable_seen'.
12019 2005-04-04 Marek Safar <marek.safar@seznam.cz>
12021 * attribute.cs (Attribute.GetValue): Removed unused.
12023 * codegen.cs (CodeGen.TrimExt): Removed unused.
12025 * cs-parser.jay (output): Removed unused.
12027 * cs-tokenizer.cs (hex_digits): Removed unused.
12029 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
12031 * expression.cs (Indirection.LoadExprValue): Removed unused.
12032 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
12034 * iterators.cs (Iterator.param_types): Removed unused.
12036 * statement.cs (Goto.block): Removed unused.
12037 (ToplevelBlock.did): Removed unused.
12038 (Switch.ResolveConstantSwitch): Removed unused.
12040 2005-04-01 Ben Maurer <bmaurer@ximian.com>
12042 * rootcontext.cs: Allow mcs to bootstrap with the compilation
12045 2005-04-01 Raja R Harinath <rharinath@novell.com>
12047 Fix #74232 and cs0208-3.cs.
12048 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
12049 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
12050 unmanaged type. Don't use FieldBuilders when 't' is a
12051 TypeBuilder. Use ModFlags and MemberType fields.
12052 * class.cs (MemberBase.member_type): Rename from MemberType.
12053 (MemberBase.MemberType): New property. Determines member_type on
12055 (MemberBase.DoDefine): Don't initialize MemberType here.
12056 (FieldMember.Define): Likewise.
12058 2005-04-01 Marek Safar <marek.safar@seznam.cz>
12061 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
12062 Attributes are emitted there.
12064 2005-04-01 Raja R Harinath <rharinath@novell.com>
12066 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
12067 keyword in 'partial enum' too.
12068 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
12070 Report from Kamil Skalski <nazgul@omega.pl>.
12073 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
12074 have partial containers too.
12076 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
12077 in block' checks to Block.CheckInvariantMeaningInBlock.
12078 * statement.cs (Block.GetKnownVariableInfo): Make private.
12079 (Block.IsVariableUsedInChildBlock): Remove.
12080 (Block.IsVariableUsedInBlock): Likewise.
12081 (Block.CheckInvariantMeaningInBlock): New. Show location of
12082 conflicting declaration.
12083 (Block.AddVariable): Make error messages less long-winded and more
12084 specific. Show location of conflicting declaration.
12085 * parameter.cs (Parameters.Location): New readonly property.
12087 2005-03-31 Raja R Harinath <rharinath@novell.com>
12089 Clean up semantics of invoking ResolveMemberAccess.
12090 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
12091 can have an instance, ensure that we pass in a non-TypeExpression
12092 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
12093 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
12094 argument. Update to changes and simplify.
12095 (FieldExpr.Emitinstance): Remove CS0120 check.
12096 (PropertyExpr.EmitInstance): Likewise.
12097 * expression.cs (Argument.Resolve): Likewise.
12098 (Invocation.DoResolve): Update to changes in semantics of
12099 InstanceExpression.
12101 2005-03-31 Marek Safar <marek.safar@seznam.cz>
12104 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
12107 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
12109 2005-03-31 Raja R Harinath <rharinath@novell.com>
12111 Fix difference in behaviour with commandline invocation.
12112 * driver.cs (Driver.Reset): New.
12113 (CompilerCallableEntryPoint): Call it.
12115 * statement.cs (If.Resolve): Avoid spurious "uninitialized
12116 variable" warnings if the boolean expression failed to resolve.
12118 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
12120 * attribute.cs: Fix the union of several permissions when some of them
12121 are unrestricted (so the result isn't an unrestricted permission set).
12124 2005-03-30 Raja R Harinath <rharinath@novell.com>
12126 * ecore.cs (MemberExpr): New class. Convert from interface
12128 (MemberExpr.ResolveMemberAccess): Refactor and move here from
12129 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
12131 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
12132 (MethodGroupExpr.IsExplicitImpl): Remove.
12133 (Expression.GetFieldFromEvent): Remove.
12134 (SimpleName.MemberStaticCheck): Remove.
12135 (SimpleName.DoSimpleNameResolve): Update to changes.
12136 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
12137 (MemberAccess.IdenticalNameAndTypeName): Remove.
12138 (MemberAccess.error176): Move to MemberExpr.
12139 (MemberAccess.DoResolve): Update to changes.
12140 (BaseAccess.DoResolve): Likewise.
12142 2005-03-30 Marek Safar <marek.safar@seznam.cz>
12144 C# 2.0 Conditional attribute class implementation
12146 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
12147 Analyzes class whether it has attribute which has ConditionalAttribute
12148 and its condition is not defined.
12150 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
12151 (Class.IsExcluded): New method. Search for at least one defined
12152 condition in ConditionalAttribute of attribute class.
12154 2005-03-30 Raja R Harinath <rharinath@novell.com>
12156 * ecore.cs (PropertyExpr): Derive from Expression, not
12157 ExpressionStatement.
12158 (PropertyExpr.EmitStatement): Remove.
12160 2005-03-29 Raja R Harinath <rharinath@novell.com>
12163 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
12164 internal field "value__" of an enum be private. The examples for
12165 "value__" that I found on MSDN all used FieldAttributes.Private.
12167 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
12168 Don't mention IL method attribute names.
12170 Fix #47991. Remove a TODO.
12171 * statement.cs (Block.Toplevel): Make into a field.
12172 (Block.Parameters): Move into ToplevelBlock.
12173 (Block.known_variables): Rename from child_variable_names.
12174 (Block.Block): Remove variants that take Parameters. Initialize
12175 'Toplevel' with the immediately surrounding toplevel block.
12176 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
12177 LocalInfo parameter.
12178 (Block.GetKnownVariableInfo): New.
12179 (Block.IsVariableNameUsedInChildBlock): Update.
12180 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
12181 the block, even though it may not be in scope.
12182 (Block.AddVariable): Remove Parameters parameter. Use
12183 Toplevel.Parameters instead.
12184 (Block.AddConstant): Remove Parameters parameter.
12185 (Block.GetParameterReference): Update to use Toplevel.Parameters.
12186 (Block.IsParamaterReference): Likewise.
12187 (Block.IsLocalParameter): Likewise. Simplify a lot.
12188 (ToplevelBlock.Parameters): New. Moved from Block.
12189 (ToplevelBlock.ToplevelBlock): Update to changes. Always
12190 initialize Parameters to a non-null value.
12191 * cs-parser.jay: Update to changes.
12192 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
12193 simple names that mean different things in the same block. Use
12194 Block.IsVariableNameUsedInBlock.
12196 2005-03-28 Raja R Harinath <rharinath@novell.com>
12198 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
12199 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
12200 GetTypeHandle. It is possible for a reflected type to derive from
12201 a TypeBuilder (e.g., int[] derives from the TypeBuilder
12202 System.Array during mscorlib compilation).
12203 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
12204 contain a method_hash, don't create one either. Don't create a
12205 deep copy of the base cache's method_hash.
12206 (MemberCache.SetupCache): Rename back from DeepCopy.
12207 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
12208 already initialized. If we see an override function, add its
12209 underlying base virtual function to the member_hash too.
12211 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
12213 2005-03-26 Raja R Harinath <harinath@acm.org>
12216 * assign.cs (Assign.DoResolve): When the RHS of an assignment
12217 fails to resolve, ensure that the LHS is still resolved as an
12220 2005-03-25 Raja R Harinath <harinath@acm.org>
12222 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
12224 (Enum.current_ec): Remove.
12225 (Enum.LookupEnumValue): Remove EmitContext argument.
12226 Just uses the one created during DefineType.
12227 (Enum.FindMembers): Update.
12228 * expression.cs (MemberAccess.DoResolve): Update.
12230 2005-03-22 Marek Safar <marek.safar@seznam.cz>
12232 * assign.cs (Assign.DoResolve): Check for CS1717 when
12233 source and target are same (uses Equals).
12235 * expression.cs (LocalVariableReference, ParameterReference,
12236 This): Implemented Equals, GetHashCode.
12238 * statement.cs (Block.GetParameterReference): Removed useless
12241 2005-03-22 Raja R Harinath <rharinath@novell.com>
12244 * statement.cs (Block.AddVariable): Ensure that we skip implicit
12245 blocks before deciding whether the error is cs0136 or cs0128.
12247 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
12248 (using_alias_directive, using_namespace_directive): Pass
12249 MemberName, not an expression to Namespace.UsingAlias and
12251 (MakeName): Use the MemberName of the namespace.
12252 * namespace.cs (Namespace.MemberName): New.
12253 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
12254 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
12256 * decl.cs (MemberName.Name): Make readonly.
12257 (MemberName.FromDotted): New "constructor".
12258 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
12259 (MemberCore.Name): Compute from MemberName on demand.
12260 (MemberCore.SetMemberName): Provide a way to change the
12262 (MemberCore.AddToContainer): Don't take a fullname parameter.
12263 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
12264 fully qualified name of the container to the member name.
12265 (TypeContainer.AddToTypeContainer): Use a fully qualified name
12266 only if the type is a member of the root container.
12267 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
12268 MemberName.Left rather than searching for an embedded ".".
12269 (PartialContainer.CreatePart): Update to changes in RootContext.
12270 (MemberBase.ShortName): Turn into a property. Use
12271 MemberCore.SetMemberName.
12272 (MemberBase.ExplicitInterfaceName): Remove.
12273 (MemberBase.UpdateMemberName): Remove.
12274 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
12275 (PropertyBase.SetMemberName): New override.
12276 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
12277 (Tree.GetDecl): New.
12278 (Tree.AllDecls): Rename from Decls.
12279 * attribute.cs, enum.cs, report.cs: Update to changes.
12280 * driver.cs (MainDriver): Use MemberName.FromDotted on
12281 RootContext.MainClass.
12283 2005-03-21 Marek Safar <marek.safar@seznam.cz>
12285 * class.cs (FixedField.Define): Check for CS1664 and more sanity
12288 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
12290 2005-03-18 Marek Safar <marek.safar@seznam.cz>
12292 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
12293 property accessor modifiers.
12295 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
12296 fixed buffer attribute (CS1716).
12297 (PropertyMethod.HasCustomAccessModifier): When property accessor
12298 has custom modifier.
12300 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
12302 (PropertyExpr.DoResolveLValue): Add CS0272.
12304 2005-03-17 Miguel de Icaza <miguel@novell.com>
12306 * convert.cs: When converting to a pointer, use the proper Conv.U
12307 or Conv.I depending on the source data type.
12309 * cs-tokenizer.cs: Make the size for large decimal constants,
12312 2005-03-17 Martin Baulig <martin@ximian.com>
12314 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
12315 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
12317 2005-03-17 Martin Baulig <martin@ximian.com>
12319 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
12320 to bool so we can return an error condition.
12321 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
12324 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
12326 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
12329 2005-03-16 Raja R Harinath <rharinath@novell.com>
12331 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
12332 Refactor to avoid traversing the list of assemblies, and to avoid
12333 string concatenation.
12334 * typemanager.cs (guid_attr_type): Remove.
12335 (negative_hits, pointers, references): Remove hashes.
12337 (GetConstructedType): New. Uses type_hash to handle constructed
12338 types (arrays, references, pointers).
12339 (GetReferenceType, GetPointerType): Use it.
12340 (GetNestedType): New. Uses type_hash to handle nested types of
12342 (LookupType, LookupTypeDirect): Remove.
12343 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
12344 'types' hash and LookupTypeReflection directly.
12345 (params_string, params_object): Use GetConstructedType.
12346 * namespace.cs (Namespace.cached_types): New. Cache of reflected
12348 (Namespace.Lookup): Use cached_types.
12349 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
12350 provided by old TypeManager.LookupType.
12351 * rootcontext.cs (MakeFQN): Remove.
12352 * decl.cs (DeclSpace.MakeFQN): Likewise.
12353 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
12354 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12355 TypeManager.GetConstructedType.
12356 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
12358 2005-03-15 Marek Safar <marek.safar@seznam.cz>
12360 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
12363 * cs-parser.jay: Reports CS1527 for any namespace element.
12365 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
12368 * expression.cs (ParameterReference.IsAssigned): Changed error to
12370 (Error_WrongNumArguments): Moved CS0245 detection here.
12372 * statement.cs (Return.Resolve): Add CS1622 report.
12374 2005-03-11 Marek Safar <marek.safar@seznam.cz>
12376 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
12378 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
12380 * attribute.cs expression.cs: Get rid of some allocations.
12382 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
12384 * doc.cs : just eliminate the latest change.
12386 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12388 * doc.cs : commented out the latest change. It breaks xml-030.cs
12390 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12392 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
12393 fail. So invoke CreateType() in FindDocumentedType().
12395 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12397 * cs-tokenizer.cs : added IsKeyword().
12398 * doc.cs : Detect keyword incorrectly used as identifier.
12399 Allow identifiers prefixed by @.
12401 2005-03-10 Marek Safar <marek.safar@seznam.cz>
12403 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
12404 It caused exception in namespace resolving (again!).
12406 * class.cs (Class.ctor): Removed exit.
12407 (PropertyMethod.ctor): ditto.
12409 * codegen.cs (Codegen.Reset): Reset static data.
12410 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
12412 * cs-tokenizer.cs (Cleanup): Removed.
12414 * driver.cs (GetSystemDir): Rewrote to one line command.
12415 It caused problem with unloaded dynamic modules.
12416 (UnixParseOption): Removed Exit.
12417 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
12418 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
12419 Now can be mcs used as library.
12421 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
12424 * location.cs (Reset): Reset static data.
12426 * namespace.cs (Reset): Reset static data.
12428 * report.cs (Report.Reset): Reset static data.
12430 * rootcontext.cs (RootContext.Reset): Reset static data.
12432 * tree.cs (RootTypes.ctor): Use Location.Null
12434 * typemanager.cs (TypeManager.Reset): Reset static data.
12435 (CoreLookupType): Removed Exit.
12436 (TypeHandle.Reset): Reset static data.
12438 2005-03-10 Raja R Harinath <rharinath@novell.com>
12441 * typemanager.cs (ComputeNamespaces): Import namespaces from
12442 referenced modules too.
12444 2005-03-09 Raja R Harinath <rharinath@novell.com>
12446 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
12449 2005-03-09 Raja R Harinath <rharinath@novell.com>
12451 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
12452 enclosing DeclSpace. This ensures that a name-lookup populates
12453 more caches and there are fewer 'TypeExpression's. Carve out
12454 nested type lookup into ...
12455 (LookupNestedTypeInHierarchy): ... this.
12457 2005-03-09 Raja R Harinath <rharinath@novell.com>
12459 Clean up a few partial-class semantics.
12460 Fixes test-357.cs and cs1618-2.cs.
12461 * cs-parser.jay (struct_declaration): Use 'current_class' as
12462 parent of newly-created struct. Remove call to Register ().
12463 Use 'pop_current_class' to complete handing the current struct.
12464 (interface_declaration): Likewise.
12465 (class_declaration): Likewise.
12466 (enum_declaration): Use 'current_class' as parent of newly created
12468 (delegate_declaration): Likewise.
12469 (pop_current_class): New function. This is used to handle closing
12470 up the 'current_class' and 'current_container', and pointing them
12471 to the enclosing class/container.
12472 (CSharpParser): Initialize 'current_class' too.
12473 * decl.cs (MemberCore): Add check for invariant: a partial
12474 container is not a parsed entity, and thus does not enclose any
12476 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
12477 (DeclSpace.BaseTypeExpr): Use it.
12478 (DeclSpace.LookupType): Add check for invariant.
12479 * class.cs (TypeContainer): Add check for invariant: a nested
12480 class should have the same NamespaceEntry as its enclosing class.
12481 (TypeContainer.EmitFieldInitializers): Make virtual.
12482 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
12484 (TypeContainer.Register): Remove.
12485 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
12486 null. Use TypeResolveEmitContext for resolving base types and
12487 interfaces. Move initialization of Parts.TypeBuilder here from
12489 (TypeContainer.DefineNestedTypes): ... here.
12490 (PartialContainer): Take a Namespace not a NamespaceEntry.
12491 (PartialContainer.Create): Don't use Register. Call the
12492 appropriate Add... function directly.
12493 (ClassPart): Take both the PartialContainer and the enclosing
12494 class as constructor arguments.
12495 (ClassPart.EmitFieldInitializers): Override.
12496 (ClassPart.PartFindNestedTypes): Remove.
12497 (FieldBase.GetInitializerExpression): Resolve the initializer
12498 expression in the emit context of the enclosing class.
12499 * tree.cs (RootTypes): Remove Register ().
12501 2005-03-08 Marek Safar <marek.safar@seznam.cz>
12503 * cs-parser.jay: Removed CS0134.
12505 * driver.cs: Removed CS1901.
12507 * expression.cs (SizeOf.DoResolve): Don't report CS0233
12508 for predefined types.
12510 2005-03-07 Duncan Mak <duncan@novell.com>
12512 * codegen.cs (Save): Catch UnauthorizedAccessException as
12513 well. Fixes bug #73454.
12515 2005-03-07 Marek Safar <marek.safar@seznam.cz>
12517 * cs-tokenizer.cs (xtoken): Add CS1035.
12519 * class.cs (MethodData.Define): Add CS0683.
12520 (FieldMember.ctor): Add CS0681.
12522 2005-03-07 Raja R Harinath <rharinath@novell.com>
12524 * ecore.cs (SimpleName.DoResolve): Rename from
12525 SimpleName.DoResolveAllowStatic.
12526 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
12527 Pass 'intermediate' flag to MemberStaticCheck.
12528 (SimpleName.MemberStaticCheck): Skip "static check" only in case
12529 of "intermediate" lookups via MemberAccess.
12530 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
12531 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
12533 2005-03-07 Raja R Harinath <rharinath@novell.com>
12536 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
12537 slipped in because of variable names that are identical to a
12538 builtin type's BCL equivalent ('string String;', 'int Int32;').
12539 (PropertyExpr.EmitInstance): Likewise.
12541 2005-03-04 Marek Safar <marek.safar@seznam.cz>
12543 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
12545 * report.cs (warning_ignore_table): Made public.
12547 2005-03-04 Raja R Harinath <rharinath@novell.com>
12550 * class.cs (MethodData.Emit): Pass 'container' to
12551 container.GetObsoleteAttribute instead of 'container.Parent'.
12553 2005-03-03 Marek Safar <marek.safar@seznam.cz>
12555 * cs-parser.jay: Add 1534 error test.
12557 * iterators.cs (Yield.CheckContext): Add error 1629.
12558 (Iterator.ctor): Save unsafe modifier.
12559 (MoveNextMethod.DoEmit): Restore unsafe context.
12561 * namespace.cs (UsingAlias): Better error message.
12563 2005-03-03 Dan Winship <danw@novell.com>
12565 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
12566 the warning message [#73219]
12568 2005-03-03 Raja R Harinath <rharinath@novell.com>
12570 Fix compile with MCS 1.0.0.0.
12571 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
12572 w_restore to not depend on string constant folding.
12574 2005-03-03 Raja R Harinath <rharinath@novell.com>
12576 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
12577 CS0246 check to users who passed 'silent = false'.
12578 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
12580 (SimpleName.SimpleNameResolve): Update.
12581 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
12582 (MemberAccess.IdenticalNameAndTypeName): Update.
12583 * doc.cs (FindDocumentedTypeNonArray): Update.
12585 2005-03-03 Raja R Harinath <rharinath@novell.com>
12587 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
12588 * parameters.cs (ComputeAndDefineParameters): Remove.
12589 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
12590 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
12591 Use GetParameterInfo.
12593 2005-03-02 Marek Safar <marek.safar@seznam.cz>
12595 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
12597 2005-03-02 Raja R Harinath <rharinath@novell.com>
12599 Unify DeclSpace.LookupType and DeclSpace.FindType.
12600 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
12601 is in charge of defining nested types on demand.
12602 (DeclSpace.LookupType): Use it when the current_type is a
12603 TypeBuilder. Use LookupTypeDirect for reflected types.
12604 (DeclSpace.FindType): Remove.
12605 (DeclSpace.LookupInterfaceOrClass): Likewise.
12606 (DeclSpace.DefineTypeAndParents): Likewise.
12607 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
12608 DeclSpace.LookupType.
12609 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
12610 * typemanager.cs (LookupType): Simplify.
12611 (AddUserType): Remove type from negative_hits.
12612 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
12613 * class.cs (TypeContainer.FindMembers): Move handling of nested
12615 (TypeContainer.FindMembers_NestedTypes): ... here.
12616 (TypeContainer.FindNestedType): Implement override.
12617 (ClassPart.FindNestedType): Delegate to PartialContainer.
12618 (ClassPart.PartFindNestedType): Looks up the nested types of the
12621 2005-03-02 Martin Baulig <martin@ximian.com>
12623 * class.cs (TypeContainer.DoDefineMembers): We also need a default
12624 static constructor in static classes.
12626 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
12628 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
12629 sizeParamIndex is not specified.
12631 2005-03-01 Marek Safar <marek.safar@seznam.cz>
12634 * report.cs (WarningMessage.IsEnabled): Missing null check.
12636 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12638 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
12639 in the fields and not in the properties.
12641 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
12643 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
12646 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12648 * attribute.cs: Small refactoring (improved robustness).
12649 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
12650 (ValidateGuid): Removed.
12651 (Resolve): Removed referenced to above mentioned.
12652 (GetAttributeUsage): Made private and changed to work without
12654 (GetIndexerAttributeValue): Don't crash.
12655 (GetConditionalAttributeValue): Ditto.
12656 (GetClsCompliantAttributeValue): Ditto.
12657 (ExtractSecurityPermissionSet): All attributes exceptions are
12659 (GetPropertyValue): New helper.
12660 (GetMethodImplOptions): New method.
12661 (DefinePInvokeMethod): Reuse common code. Implemented handling of
12662 some missing properties.
12664 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
12665 (Method.ApplyAttributeBuilder): Updated.
12667 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
12670 2005-02-28 Raja R Harinath <rharinath@novell.com>
12673 * report.cs (Report.SymbolRelatedToPreviousError): Handle
12674 non-simple types (array, pointer, reference).
12676 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12678 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
12680 * class.cs (MethodCore.IsDuplicateImplementation): Special error
12682 (Method.CheckBase): Catch wrong destructor here.
12683 (MethodData.Define): Add errors 550, 668.
12685 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
12687 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
12689 * pending.cs (VerifyPendingMethods): Add error 551.
12691 * typemanager.cs (CSharpName): Next error report helper.
12693 2005-02-25 Marek Safar <marek.safar@seznam.cz>
12695 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
12696 attributes. Removed useless attribute double check.
12697 It saves almost 2MBs for corlib.
12699 2005-02-25 Raja R Harinath <rharinath@novell.com>
12702 * statement.cs (ExpressionStatement.Resolve): Make robust to being
12703 called twice in case of error.
12705 2005-02-23 Chris Toshok <toshok@ximian.com>
12707 Fix compiler portions of #72827.
12708 * statement.cs (Block.Emit): call Begin/EndScope on the
12709 EmitContext instead of the ILGenerator.
12711 * codegen.cs (EmitContext.BeginScope): new method, call
12712 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
12714 (EmitContext.BeginScope): same, but EndScope and CloseScope
12716 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
12717 offset and call the superclass's OpenScope(int) with it.
12718 (SymbolWriter.CloseScope): get the current il
12719 offset and call superclass's CloseScope(int) with it.
12721 2005-02-23 Marek Safar <marek.safar@seznam.cz>
12723 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
12724 CS1677 for out and ref as well.
12726 * class.cs (Method.Define): Add error CS1599 detection.
12728 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
12730 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
12732 * delegate.cs (Delegate.Define): Add error CS1599 detection.
12734 * support.cs.cs (ModifierDesc): New helper method.
12736 2005-02-23 Raja R Harinath <rharinath@novell.com>
12737 Abin Thomas <projectmonokochi@rediffmail.com>
12738 Anoob V E <projectmonokochi@rediffmail.com>
12739 Harilal P R <projectmonokochi@rediffmail.com>
12741 Fix #57851, #72718.
12742 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
12743 MemberLookup (used for error reporting) actually returns a result.
12744 Fix error report number (122, not 112).
12746 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
12747 Anoob V E <projectmonokochi@rediffmail.com>
12748 Harilal P R <projectmonokochi@rediffmail.com>
12751 * pending.cs (PendingImplementation.GetAbstractMethods):
12752 Find NonPublic members too.
12754 2005-02-22 Marek Safar <marek.safar@seznam.cz>
12756 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
12759 * class.cs (MethodCore.CheckMethodAgainstBase):
12760 Add error 239 report.
12762 2005-02-21 Raja R Harinath <rharinath@novell.com>
12765 * expression.cs (Invocation.IsApplicable): Make public.
12766 (Invocation.IsParamsMethodApplicable): Likewise.
12767 * delegate.cs (Delegate.VerifyApplicability): Don't use
12768 Invocation.VerifyArgumentCompat for parameter applicability
12769 testing. Use Invocation.IsApplicable and
12770 Invocation.IsParamsMethodApplicable.
12772 2005-02-21 Marek Safar <marek.safar@seznam.cz>
12774 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
12776 * class.cs (Operator.Define): Add error 217 report.
12778 2005-02-21 Raja R Harinath <rharinath@novell.com>
12780 * namespace.cs (UsingEntry.Resolve): Undo change below.
12782 2005-02-21 Raja R Harinath <rharinath@novell.com>
12785 * ecore.cs (Expression.MemberLookupFailed): Add argument to
12786 disable the error message when the extended MemberLookup also
12788 (Expression.MemberLookupFinal): Update.
12789 (SimpleName.DoSimpleNameResolve): Update.
12790 * expression.cs (MemberAccess.ResolveNamespaceOrType):
12791 Don't use MemberLookupFinal.
12792 (New.DoResolve): Update.
12793 (BaseAccess.CommonResolve): Update.
12795 2005-02-21 Raja R Harinath <rharinath@novell.com>
12798 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
12799 occured previously, don't resolve again.
12801 2005-02-21 Marek Safar <marek.safar@seznam.cz>
12804 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
12805 argument. Call ResolveAttributeUsage for unresolved.
12806 when types doesn't match ctor arguments.
12808 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
12809 for nested attribute classes.
12810 (Class.attribute_usage): Removed.
12811 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
12812 for attribute class.
12814 * ecore.cs (IsAttribute): Removed.
12816 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
12818 * rootcontext.cs (RegisterAttribute): Removed, attributes are
12820 (attribute_types): Removed.
12821 (EmitCode): Global attributes are emited as the latest.
12823 2005-02-18 Marek Safar <marek.safar@seznam.cz>
12825 * class.cs (EmitFieldInitializers): Don't emit field initializer
12826 for default values when optimilization is on.
12828 * constant.cs (Constant.IsDefaultValue): New property.
12830 * driver.cs: Add /optimize handling.
12834 * literal.cs: Implement new IsDefaultValue property.
12836 * rootcontext.cs (Optimize): New field, holds /optimize option.
12838 2005-02-18 Raja R Harinath <rharinath@novell.com>
12840 Fix crasher in re-opened #72347.
12841 * namespace.cs (Namespace.Lookup): Return null if
12842 DeclSpace.DefineType returns null.
12845 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
12847 2005-02-18 Raja R Harinath <rharinath@novell.com>
12849 Fix remainder of #63202. Change semantics of DoResolveLValue: it
12850 now returns null if it cannot resolve to an lvalue.
12851 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
12852 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
12853 returned null. Remove check for SimpleName.
12854 (EventExpr.DoResolveLValue): New.
12855 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
12856 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
12858 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
12859 avoid CS0131 error.
12860 (Unary.ResolveOperator): Move CS0211 check ...
12861 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
12863 (Unary.DoResolveLValue): Simplify.
12864 (AddressOf.DoResolveLValue): New.
12865 (ArrayAccess.DoResolveLValue): New.
12867 2005-02-16 Marek Safar <marek.safar@seznam.cz>
12869 * attribute.cs (Attribute.Resolve): Add arguments casting for
12870 when types doesn't match ctor arguments.
12872 2005-02-16 Raja R Harinath <rharinath@novell.com>
12874 Fix parts of #63202.
12875 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
12876 lookup of operator in base type. Ensure that all checks happen
12877 when the operator resolves to an "op_..." method.
12879 2005-02-15 Raja R Harinath <rharinath@novell.com>
12882 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
12883 'ignore_cs0104' parameter. Pass it to ...
12884 (NamespaceEntry.Lookup): ... this.
12885 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
12886 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
12887 (TypeLookupExpression.DoResolveAsTypeStep): Update.
12888 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
12889 Update. Request that cs0104 errors be ignored.
12890 (ComposedCast.ResolveAsTypeStep): Update.
12892 2005-02-14 Raja R Harinath <rharinath@novell.com>
12895 * expression.cs (Invocation.BetterFunction): Remove support for
12896 comparing virtual functions and their overrides.
12897 (Invocation.IsOverride): New.
12898 (Invocation.OverloadResolve): Don't consider 'override' functions
12899 during candidate selection. Store them in a lookaside list.
12900 If the selected method is a 'virtual' function, use the list to
12901 find any overrides that are closer to the LHS type.
12903 2005-02-14 Marek Safar <marek.safar@seznam.cz>
12905 * expression.cs (New.DoResolve): Add complex core type reduction.
12906 (New.Constantify): Converts complex core type syntax like 'new int ()'
12907 to simple constant.
12909 2005-02-14 Raja R Harinath <rharinath@novell.com>
12911 * decl.cs (EntryType.EntryType): New constructor to create an
12912 updated copy of a cache entry.
12913 (MemberCache.AddMethods): Use it.
12914 (MemberCache.ClearDeclaredOnly): Remove.
12915 (MemberCache.MemberCache): Update.
12917 2005-02-11 Miguel de Icaza <miguel@novell.com>
12919 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
12920 variable. This one is represents the actual low-level declaration
12921 of the method, as opposed to the semantic level `IsStatic'.
12923 An anonymous method which is hosted into a static method might be
12924 actually an instance method. IsStatic would reflect the
12925 container, while MethodIsStatic represents the actual code
12928 * expression.cs (ParameterReference): Use the new MethodIsStatic
12929 instead of IsStatic.
12931 * anonymous.cs (AnonymousMethod.Compatible): Pass the
12932 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
12933 set on the current EmitContext.
12935 * expression.cs (Cast): Overload DoResolveLValue so we can pass
12936 resolve our casted expression as an LValue. This triggers the
12937 proper LValue processing that is later required by Assign.
12941 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
12943 2005-02-11 Marek Safar <marek.safar@seznam.cz>
12945 C# 2.0 Fixed buffer implementation
12947 * anonymous.cs: Update after RegisterHelperClass renaming.
12949 * attribute.cs (AttributeTester.fixed_buffer_cache):
12950 Cache of external fixed buffers.
12951 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
12952 implementation if field is fixed buffer else null.
12955 (TypeContainer.AddField): Accept FieldMember instead of Field.
12956 (FieldBase.IsFieldClsCompliant): Extracted code from
12957 VerifyClsCompliance descendant customization.
12958 (FixedField): New class handles fixed buffer fields.
12959 (FixedFieldExternal): Keeps information about imported fixed
12961 (IFixedField): Make access to internal or external fixed buffer
12964 * cs-parser.jay: Add fixed buffer parsing.
12966 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
12969 * expression.cs (Indirection): Extended implementation to accept
12970 fixed buffer field.
12971 (PointerArithmetic.Emit): Get element from fixed buffer as well.
12972 (ElementAccess.MakePointerAccess): Get type as parameter.
12973 (DoResolve): Add fixed buffer field expression conversion.
12974 (DoResolveLValue): Ditto.
12975 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
12976 (ArrayPtr): Derives from FixedBufferPtr.
12977 (ArrayPtr.Emit): Add extra emit for array elements.
12979 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
12981 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
12982 for compiler generated types.
12983 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
12985 * statement.cs (Fixed): Refactored to be easier add fixed buffer
12986 and consume less memory.
12987 (Fixed.Resolve): Add fixed buffer case.
12989 * typemanager.cs (compiler_generated_attr_ctor,
12990 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
12991 (HasElementType): Add our own implementation to work on every
12994 2005-02-11 Miguel de Icaza <miguel@novell.com>
12996 * anonymous.cs (CaptureContext): Track whether `this' has been
12999 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
13000 only captured `this' if it was implicitly done (instance
13001 methods/variables were used).
13003 * codegen.cs (EmitContext.CaptureThis): New method to flag that
13004 `this' must be captured.
13006 2005-01-30 Miguel de Icaza <miguel@novell.com>
13008 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
13009 is null it means that there has been no need to capture anything,
13010 so we just create a sibling.
13012 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
13014 Just a partial fix. The other half is fairly elusive.
13016 2005-02-10 Raja R Harinath <rharinath@novell.com>
13018 Fix #52586, cs0121-4.cs.
13019 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
13020 and return a hashtable.
13021 (MemberCache.ClearDeclaredOnly): New.
13022 (MemberCache.MemberCache): Update to change. Make a deep copy of
13023 the method_hash of a base type too.
13024 (MemberCache.AddMethods): Adapt to having a deep copy of the base
13025 type methods. Overwrite entries with the same MethodHandle so
13026 that the ReflectedType is correct. The process leaves in base
13027 virtual functions and their overrides as distinct entries.
13028 (CacheEntry): Now a class instead of a struct. It shouldn't alter
13029 matters since it was boxed in a ArrayList before.
13030 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
13032 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
13033 case of a virtual function and its override (choose the overload
13035 (Invocation.OverloadResolve): Avoid 'override' members during
13036 'applicable_type' calculation.
13038 2005-02-09 Raja R Harinath <rharinath@novell.com>
13040 Combine two near-redundant caches.
13041 * typemanager.cs (method_params): Rename from method_internal_params.
13042 (TypeManager.GetParameterData): New. Replace
13043 Invocation.GetParameterData.
13044 (TypeManager.LookupParametersByBuilder): Remove.
13045 * expression.cs (Invocation.method_parameter_cache): Remove.
13046 (Invocation.GetParameterData): Remove.
13048 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
13051 2005-02-08 Raja R Harinath <rharinath@novell.com>
13054 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
13055 TypeManager.multicast_delegate_type is null, resolve it by looking
13056 up "System.MulticastDelegate".
13057 * rootcontext.cs (RootContext.ResolveCore): Simplify.
13059 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
13060 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
13061 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
13064 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
13065 (LabeledStatement.AddReference): New. Set 'referenced'.
13066 (Goto.Resolve): Use it.
13068 2005-02-05 John Luke <john.luke@gmail.com>
13070 * driver.cs: remove duplicate -doc line in Usage ()
13072 2005-02-04 Raja R Harinath <rharinath@novell.com>
13074 * location.cs (Location.AddFile): Fix CS2002 error report.
13076 2005-02-02 Martin Baulig <martin@ximian.com>
13078 * delegate.cs (Delegate.DefineType): Report an internal error if
13079 TypeManager.multicast_delegate_type is null. See bug #72015 for
13082 2005-02-02 Raja R Harinath <rharinath@novell.com>
13084 Fix a crasher in a variant of #31984.
13085 * const.cs (Constant.CheckBase): New override that defers the
13086 new-or-override check in case the base type hasn't been populated
13088 (Constant.Define): Ensure the new-or-override check is performed.
13090 2005-02-01 Duncan Mak <duncan@ximian.com>
13092 * const.cs (LookupConstantValue): Check that `ce' is not null
13093 before calling GetValue ().
13095 2005-02-01 Raja R Harinath <rharinath@novell.com>
13097 Fix test-334.cs (#69519).
13098 * cs-parser.jay (using_alias_directive): Pass in an expression to
13099 NamespaceEntry.UsingAlias.
13100 (using_namespace_directive): Pass in an expression to
13101 NamespaceEntry.Using.
13102 (namespace_name): Don't flatten to a string.
13103 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
13104 (NamespaceEntry.AliasEntry.Resolve): Lookup using
13106 (NamespaceEntry.UsingEntry): Likewise.
13107 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
13109 (NamespaceEntry.LookupForUsing): Remove.
13110 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
13112 (NamespaceEntry.Lookup): Remove support for dotted names.
13114 2005-02-01 Raja R Harinath <rharinath@novell.com>
13116 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
13118 (NamespaceEntry.ImplicitParent): Compute on demand.
13119 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
13120 parallels the current.
13121 (NamespaceEntry.LookupForUsing): Use it.
13122 (NamespaceEntry.Lookup): If the current namespace-entry is
13123 implicit, don't search aliases and using tables.
13125 2005-02-01 Raja R Harinath <rharinath@novell.com>
13128 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
13130 (TypeContainer.BaseCache): Compute on demand.
13131 (TypeContainer.FindMembers): Define constants and types if they're
13132 not already created.
13133 (FieldMember.Define): Move resetting of ec.InUnsafe before error
13135 * const.cs (Constant.Define): Make idempotent.
13137 2005-01-29 Miguel de Icaza <miguel@novell.com>
13139 * pending.cs: Produce better code (no nops produced by using Ldarg
13142 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
13143 i - 1' it should be arg + 1.
13147 2005-01-28 Raja R Harinath <rharinath@novell.com>
13149 * attribute.cs (Attribute.CheckAttributeType): Make private
13151 (Attribute.ResolveType): Make virtual.
13152 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
13153 handling of RootContext.Tree.Types.
13155 2005-01-27 Raja R Harinath <rharinath@novell.com>
13157 Update attribute-handling to use the SimpleName/MemberAccess
13159 * cs-parser.jay (attribute): Pass in an expression to the
13160 constructors of Attribute and GlobalAttribute.
13161 * attribute.cs (Attribute): Take an expression for the name.
13162 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
13163 passed in attribute name expression.
13164 (Attribute.CheckAttributeType): Use it.
13165 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
13166 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
13167 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
13168 argument to prevent error messages if the lookup fails.
13170 2005-01-27 Marek Safar <marek.safar@seznam.cz>
13172 * expression.cs (Indirection): Implemented IVariable interface
13173 to support indirection in AddressOf operator.
13174 (PointerArithmetic.Emit): Add optimalization for case where
13175 result can be precomputed.
13177 2005-01-26 Martin Baulig <martin@ximian.com>
13179 * class.cs (TypeContainer.AttributeTargets): Return the correct
13180 AttributeTargets depending on our `Kind' instead of throwing an
13181 exception; fixes #71632.
13183 2005-01-26 Marek Safar <marek.safar@seznam.cz>
13186 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
13189 2005-01-25 Raja R Harinath <rharinath@novell.com>
13192 * expression.cs (MemberAccess.DoResolve): Don't complain with
13193 cs0572 when the LHS of a member access has identical name and type
13196 2005-01-25 Marek Safar <marek.safar@seznam.cz>
13199 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
13201 Create custom PermissionSet only for PermissionSetAttribute.
13203 2005-01-24 Marek Safar <marek.safar@seznam.cz>
13206 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
13207 delegates in static class.
13209 2005-01-24 Martin Baulig <martin@ximian.com>
13211 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13212 merging an implicit block, just use its reachability.
13214 * statement.cs (Block.Resolve): Make the unreachable code check
13215 work wrt. implicit blocks; see test-337 from #63842.
13217 2005-01-21 Alp Toker <alp@atoker.com>
13219 * cs-parser.jay: destructor_declaration's container is PartialContainer
13220 not Class when partial types are used, so use Kind prop instead of
13223 2005-01-22 Miguel de Icaza <miguel@ximian.com>
13225 * cs-parser.jay: Improve error reporting when an interface
13226 declares new types.
13228 2005-01-20 Dick Porter <dick@ximian.com>
13230 * support.cs: SeekableStreamReader fix from Sandor Dobos
13231 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
13232 chars are read. Fixes bug 70369.
13234 2005-01-20 Raja R Harinath <rharinath@novell.com>
13236 * cs-parser.jay (catch_clause): Simplify current_block handling
13239 2005-01-17 Miguel de Icaza <miguel@ximian.com>
13241 * convert.cs (ImplicitStandardConversionExists): Synchronize the
13242 code with ImplicitStandardConversion to handle the implicit
13243 conversion of method groups into valid delegate invocations.
13245 The problem is that in parameter handling we were using this code
13246 path. Fixes bug #64698
13248 2005-01-19 Raja R Harinath <rharinath@novell.com>
13250 * cs-parser.jay: Fix several infelicities.
13251 - Avoid assigning to the parser value stack. Code like
13252 '$3 = null' is unclean. Synthesize a value for the code block
13254 - Avoid using oob_stack for storing location information. Use ...
13255 (_mark_): ... this. New (empty) rule. Saves the current location
13257 (foreach_statement): Avoid using oob_stack for current_block
13258 handling. Use technique used in for_statement and
13259 using_statement. Synthesize a value for the code block to store
13260 additional intermediate information.
13262 2005-01-13 Miguel de Icaza <miguel@ximian.com>
13264 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
13265 of a different type is only allowed to private fields of a
13266 containing type, not on fields of a base class.
13268 See test-174.cs and error cs0122-9.cs
13270 2005-01-13 Raja R Harinath <rharinath@novell.com>
13272 Fix test-335.cs (bug #58126).
13273 * cs-parser.jay (argument): Split out non-expression parts of the
13274 rule into 'non_simple_argument'.
13275 (invocation_expression): Support parenthesized invocations with
13276 multiple arguments, and with single non-simple arguments.
13278 2005-01-13 Raja R Harinath <rharinath@novell.com>
13280 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
13283 2005-01-12 Raja R Harinath <rharinath@novell.com>
13285 Fix cs0038-1.cs, cs1640-6.cs.
13286 * ecore.cs (Expression.Resolve): Remove special-case for
13287 SimpleName in error-handling.
13288 (Expression.almostMatchedMembers): Relax access permission to
13290 (Expression.MemberLookupFailed): Handle duplicates in
13291 almostMatchedMembers list.
13292 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
13293 * expression.cs (New.DoResolve): Report CS1540 for more cases.
13294 * typemanager.cs (GetFullNameSignature): Use the MethodBase
13295 overload if the passed in MemberInfo is a MethodBase.
13297 2005-01-12 Marek Safar <marek.safar@seznam.cz>
13300 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
13301 for non-CAS & merge permission sets properly.
13303 2005-01-11 Raja R Harinath <rharinath@novell.com>
13305 Improve standard-compliance of simple name and member access
13306 resolution. Fixes bugs #52697, #57200, #67520, #69519.
13307 * ecore.cs (FullNamedExpression): New abstract base class
13308 for Namespaces and TypeExpressions.
13309 (ResolveFlags.SimpleName): Remove.
13310 (SimpleName): Remove support for dotted names.
13311 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
13312 DeclSpace.FindType and DeclSpace.LookupType.
13313 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
13314 (Expression.ExprClassName): Make member function.
13315 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
13316 a namespace. Remove creation of dotted "SimpleName"s.
13317 (MemberAccess.DoResolve): Likewise.
13318 * decl.cs (DeclSpace.Cache): Make private.
13319 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
13320 (DeclSpace.FindType): Update.
13321 (DeclSpace.LookupType): Move here from RootContext. Return a
13322 FullNamedExpression.
13323 * namespace.cs (Namespace): Derive from FullNamedExpression
13324 so that it can be part of expression resolution.
13325 (Namespace.Lookup): Return an FullNamedExpression.
13326 (NamespaceEntry.LookupAlias): Lookup aliases only in current
13328 * rootcontext.cs (NamespaceLookup): Remove.
13329 (LookupType): Move to DeclSpace.
13330 * attribute.cs (CheckAttributeType): Update.
13331 * doc.cs (FindDocumentedType): Remove allowAlias argument.
13332 (FindDocumentedTypeNonArray): Likewise.
13334 2005-01-11 Raja R Harinath <rharinath@novell.com>
13336 Fix cs0509.cs, cs1632.cs.
13337 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
13338 is the same as IsInterface.
13339 (TypeContainer.GetClassBases): Likewise.
13340 * statement.cs (LabeledStatement.ig): New field.
13341 (LabeledStatement.LabelTarget): Save ILGenerator which created the
13343 (LabeledStatement.DoEmit): Check that the label was created with
13344 the same ILGenerator.
13346 2005-01-10 Marek Safar <marek.safar@seznam.cz>
13349 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
13350 accessors to its properties.
13352 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
13353 from accessors to property.
13355 2005-01-10 Marek Safar <marek.safar@seznam.cz>
13358 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
13359 only for overrides.
13361 2005-01-08 Miguel de Icaza <miguel@ximian.com>
13363 * attribute.cs: Check for null and empty strings.
13365 I have lost another battle to Paolo.
13367 2005-01-07 Marek Safar <marek.safar@seznam.cz>
13370 * class.cs (PropertyMethod): Set Parent field in ctors.
13371 (SetMethod.InternalParameters): Add unsafe switch hack.
13372 Override MarkForDuplicationCheck where it is appropriate.
13374 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
13375 It says whether container allows members with the same name.
13376 Base default is no.
13377 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
13378 Removed is_method parameter.
13380 2005-01-06 Duncan Mak <duncan@ximian.com>
13382 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
13383 because the previous change led to incorrect reporting of CS1032
13384 ("Cannot define/undefine preprocessor symbols after first token in
13385 file"). Instead of using `tokens_seen' as the only flag that
13386 triggers CS1040, introduce `comments_seen'. This new flag is used
13387 to signify having seen comments on the current line, so it is
13388 unset after a newline.
13390 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
13392 * doc.cs : When searching for a type, find nested type too.
13393 This fixes bug #71040.
13395 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
13398 - Warn missing member comment on those classes which also does not
13399 have doc comments. Fixed bug #71041.
13400 - Don't warn missing doc comment on default constructor.
13403 2005-01-06 Duncan Mak <duncan@ximian.com>
13405 * cs-tokenizer.cs (xtoken): After handling traditional C-style
13406 comments, set `tokens_seen' to true. This allows us to detect
13407 misplaced preprocessor directives (i.e. not at the beginning of
13408 the a line, nor after whitespaces). In that case, report error
13409 CS1040. This fixes bug #56460.
13411 * cs-parser.jay (interface_member_declaration): Add checks for
13412 IsExplicitImpl, and report CS0541 error if an interface member is
13413 defined as an explicit interface declaration.
13415 2005-01-06 Marek Safar <marek.safar@seznam.cz>
13418 * class.cs (PropertyMethod): Set Parent field in ctors.
13419 (SetMethod.InternalParameters): Add unsafe switch hack.
13421 * decl.cs (MemberCore.Parent): Cannot be readonly.
13423 2005-01-06 Raja R Harinath <rharinath@novell.com>
13425 * decl.cs (DeclSpace.ResolveType): Remove.
13426 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
13427 Merge in code from ...
13428 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
13429 * class.cs, enum.cs: Update to changes.
13431 2005-01-06 Miguel de Icaza <miguel@ximian.com>
13433 * anonymous.cs: Ensure that we init the scope of our parent if it
13434 has not been initialized yet.
13436 2004-12-30 Duncan Mak <duncan@ximian.com>
13438 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
13439 if field.FieldBuilder is null. Fixes #70758.
13441 * convert.cs: Fixed some typos and updated some of the comments.
13442 (ImplicitStandardConversionExists):
13443 (TryImplicitIntConversion): If `target_type' is an interface and
13444 the type of `ic' implements this interface, return true or a new
13445 BoxedCast instead of null. This fixes #70468.
13447 2004-12-29 Duncan Mak <duncan@ximian.com>
13449 * expression.cs (Argument.Emit): Check that Expr is
13450 IMemoryLocation before casting to it, and report CS1510 otherwise.
13454 2004-12-21 Ben Maurer <bmaurer@ximian.com>
13456 * statement.cs (Block.ThisVariable): remove the recursion here, to
13457 make the --profile more sane.
13459 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
13461 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
13462 assembly, by JB Evain.
13464 2004-12-17 Raja R Harinath <rharinath@novell.com>
13466 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
13467 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
13468 "parent" refers to enclosing type/class. "base" refers to superclass.
13470 2004-12-17 Raja R Harinath <rharinath@novell.com>
13472 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13473 Ensure that we only have GlobalAttributes.
13474 * attribute.cs (Attribute.Emit): Make non-virtual.
13475 (GlobalAttribute.Emit): Remove.
13476 (Attribute.Resolve): Make virtual.
13477 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
13478 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
13479 the argument. Don't create one.
13480 (Attribute.GetObsoleteAttribute): Likewise.
13481 (Attribute.GetClsCompliantAttributeValue): Likewise.
13482 * class.cs, decl.cs: Update to changes.
13484 2004-12-17 Marek Safar <marek.safar@seznam.cz>
13486 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
13488 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
13490 * statement.cs (Foreach.Resolve): Add error 186 report.
13492 2004-12-16 Marek Safar <marek.safar@seznam.cz>
13494 * expression.cs (Conditional.DoResolve): Add warning 429.
13496 * statement.cs (If.Resolve): Add warning 665.
13498 2004-12-16 Raja R Harinath <rharinath@novell.com>
13500 New invariant: RootContext.Tree.Types.NamespaceEntry == null
13501 except when in the parser, and in GlobalAttribute.
13502 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
13503 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
13504 RootContext.Tree.Types.NamespaceEntry once work is done.
13505 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
13506 and resets RootContext.Tree.Types.NamespaceEntry.
13508 2004-12-15 Marek Safar <marek.safar@seznam.cz>
13510 * cs-parser.jay: Don't create a block for every variable.
13512 2004-12-14 Miguel de Icaza <miguel@ximian.com>
13514 * location.cs: Provide extra information.
13516 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
13517 variables from the captured environment, it is the ldarg_0.
13519 2004-12-14 Marek Safar <marek.safar@seznam.cz>
13521 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
13524 * class.cs: Changed warning level for 169 to avoid developer
13525 displeasure from warning flooding. It will be changed back when they
13526 fix most of current BCL warnings.
13528 * RootContext.cs: Pushed default WarningLevel to 3.
13530 * statement.cs: Removed unused variable.
13532 2004-12-14 Marek Safar <marek.safar@seznam.cz>
13534 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
13535 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
13536 Add error 502 report.
13537 (StaticClass.DefineType): Add error 441 report.
13538 (Class.AllowedModifiersProp): New virtual property as temporary
13539 extension to AllowedModifiers.
13540 (Class.DefineType): Add error 418 report. Moved ModFlags check here
13541 to share implementation with StaticClass and don't call virtual
13544 * driver.cs (MainDriver): Add error 1558 test.
13546 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
13547 report. Moved error 36 test here.
13549 * statement.cs (Throw.Resolve): Add error 724 report.
13551 * typemanager.cs: Add out_attribute_type core type.
13553 2004-12-13 Marek Safar <marek.safar@seznam.cz>
13555 * class.cs (TypeContainer.VerifyClsCompliance): Add error
13557 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
13559 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
13562 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
13564 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
13565 Add error 3023 report.
13566 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
13568 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
13571 2004-12-12 John Luke <john.luke@gmail.com>
13573 * driver.cs (AddArgs): take -- into account when
13574 adding arguments, fixes bug 65710
13576 2004-12-12 Martin Baulig <martin@ximian.com>
13578 * expression.cs (Unary.TryReduceNegative): Added support for
13579 SByteConstant and ByteConstant.
13580 (Unary.Reduce): Check error values from TryReduceNegative().
13582 2004-12-10 Marek Safar <marek.safar@seznam.cz>
13584 * attributes.cs (Attribute.Resolve): Avoid multiple error report
13585 and report exception as error 182.
13587 2004-12-10 Raja R Harinath <rharinath@novell.com>
13589 * driver.cs (Main): Fix message when there are warnings.
13591 2004-12-09 Miguel de Icaza <miguel@ximian.com>
13593 * delegate.cs: Fixed my fix from yesterday, sorry about that.
13595 2004-12-09 Marek Safar <marek.safar@seznam.cz>
13597 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
13598 Reduced number of warnings.
13600 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
13602 2004-12-08 Miguel de Icaza <miguel@ximian.com>
13604 * driver.cs: Removed message.
13606 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
13608 2004-12-08 <vargaz@freemail.hu>
13610 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
13612 2004-12-08 Martin Baulig <martin@ximian.com>
13614 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
13615 instead of a CS3002 for properties and indexer.
13617 2004-12-08 Martin Baulig <martin@ximian.com>
13619 * decl.cs (MemberName.ToString): Make this work again.
13621 2004-12-08 Marek Safar <marek.safar@seznam.cz>
13623 * attribute.cs (Resolve): Add error 591 detection.
13625 * class.cs (FieldMember.Define): Add error 1547 detection.
13626 (Indexer.Define): Add error 620 detection.
13627 (Operator.Define): Add error 590 detection.
13629 * ecore.cs: Missing argument for error 79.
13631 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
13634 2004-12-07 Marek Safar <marek.safar@seznam.cz>
13637 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
13640 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
13642 * cs-parser.jay : handle doc comments on implicit/explicit operators.
13643 Some operator comments were suppressed.
13644 * doc.cs : Implicit/explicit operator name in doc comments are like
13645 "op_Explicit(type)~returnType", so added suffix handling.
13647 2004-12-07 Martin Baulig <martin@ximian.com>
13650 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
13651 (MemberCore.GetClsCompliantAttributeValue): Likewise.
13652 (DeclSpace.ec): New protected field; store the EmitContext here.
13653 (DeclSpace.EmitContext): New public property; moved here from
13655 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
13658 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
13659 (Enum.Emit): Don't create a new EmitContext.
13661 * delegate.cs (Delegate.DefineType): Always create the
13664 * iterators.cs (Iterators.DefineIterator): Create a new
13665 EmitContext and store it in `ec'.
13667 2004-08-24 Martin Baulig <martin@ximian.com>
13670 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
13671 this for accessibility checks.
13672 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
13673 IsNestedFamilyAccessible.
13674 (TypeManager.IsSubclassOf): New method, do what the name actually
13677 2004-12-06 Raja R Harinath <rharinath@novell.com>
13679 Fix crash on cs0657-17.cs.
13680 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13681 Use RootContext.Tree.Types, not 'new RootTypes ()'.
13682 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
13683 the case where the NamespaceEntry gets overwritten.
13685 2004-12-06 Marek Safar <marek.safar@seznam.cz>
13687 Fixed #69195, #56821
13688 * ecore.cs (ResolveBoolean): Tiny refactoring.
13690 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
13691 of right expression resolving when left is false constant and
13692 operator is LogicalAnd OR true constant and operator is LogicalOr.
13694 * statement.cs (ResolveUnreachable): Always reports warning.
13696 2004-12-05 Miguel de Icaza <miguel@ximian.com>
13698 * class.cs: Distinguish between 1721 and 1722 (just a little help
13699 for the programmer).
13701 2004-12-03 Miguel de Icaza <miguel@ximian.com>
13703 * delegate.cs: Only allow this on new versions of the language.
13705 2004-12-02 Duncan Mak <duncan@ximian.com>
13707 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
13709 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
13710 here as a static method. Take an additional bool out parameter
13711 `must_do_cs1540_check' for signaling to InstanceResolve.
13712 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
13713 member field from PropertyExpr class and made it an argument of
13714 the method instead.
13715 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
13716 check for MarshalByRefObject, and report CS0122 instead of CS1540.
13717 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
13718 and `remove_accessor' as well as InstanceResolve: report CS0122
13723 2004-12-03 Raja R Harinath <rharinath@novell.com>
13725 Fix test-327.cs, test-328.cs, and put in early infrastructure
13726 for eventually fixing #52697.
13727 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
13728 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
13729 from other methods.
13730 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
13731 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
13732 (VerifyUsing, error246): Update.
13733 * rootcontext.cs (RootContext.NamespaceLookup): Just use
13734 'NamespaceEntry.LookupNamespaceOrType'.
13736 2004-12-03 Martin Baulig <martin@ximian.com>
13738 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13739 method as our child, call AnonymousMethod.Compatible() on it.
13741 2004-12-03 Raja R Harinath <rharinath@novell.com>
13743 Disable XML documentation support in 'basic' profile.
13744 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
13745 Redirect XmlElement to System.Object.
13746 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
13747 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
13748 * mcs.exe.sources: Add doc-bootstrap.cs.
13749 * doc-bootstrap.cs: New file. Contains empty stub implementation
13752 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
13754 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
13755 comments are allowed.
13757 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
13759 * delegate.cs: Add checks for subtypes in paramaters and return values
13760 in VerifyMethod () to add support for Covariance/Contravariance
13763 2004-12-02 Miguel de Icaza <miguel@ximian.com>
13765 * report.cs: Remove extra closing parenthesis.
13767 * convert.cs (Error_CannotImplicitConversion): If the name of the
13768 types are the same, provide some extra information.
13770 * class.cs (FieldBase): Use an unused bit field from the field to
13771 encode the `has_offset' property from the FieldMember. This saves
13772 a couple of Ks on bootstrap compilation.
13774 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13775 method as our child, return the AnonymousMethod resolved
13778 * expression.cs (New.DoResolve): Allow return values from
13779 NewDelegate to also include AnonymousMethods.
13783 2004-12-02 Marek Safar <marek.safar@seznam.cz>
13786 * attribute.cs (Resolve): Improved implementation of params
13787 attribute arguments.
13789 * support.cs (ParameterData): Add HasParams to be faster.
13791 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
13793 all things are for /doc support:
13795 * doc.cs: new file that supports XML documentation generation.
13796 * mcs.exe.sources: added doc.cs.
13798 Handle /doc command line option.
13799 Report error 2006 instead of 5 for missing file name for /doc.
13800 Generate XML documentation when required, after type resolution.
13802 Added support for picking up documentation (/// and /** ... */),
13803 including a new XmlCommentState enumeration.
13805 Added lines to fill Documentation element for field, constant,
13806 property, indexer, method, constructor, destructor, operator, event
13807 and class, struct, interface, delegate, enum.
13808 Added lines to warn incorrect comment.
13810 Added Documentation field (passed only when /doc was specified).
13812 Added DocComment, DocCommentHeader, GenerateDocComment() and
13813 OnGenerateDocComment() and some supporting private members for
13814 /doc feature to MemberCore.
13816 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
13818 Added overriden DocCommentHeader.
13820 Added overriden DocCommentHeader and GenerateDocComment().
13822 2004-12-01 Miguel de Icaza <miguel@ximian.com>
13824 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
13825 unwrapping the enumeration values, chain to
13826 DoConstantNumericPromotions again, so we can promote things to the
13827 fundamental types (takes care of enums that are bytes, sbytes).
13831 2004-12-01 Raja R Harinath <rharinath@novell.com>
13833 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
13834 Fix long-standing bug in type-lookup. Use FindType instead of
13835 LookupType when ec.ResolvingTypeTree.
13836 (Attribute.ResolveType, Attribute.Resolve)
13837 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
13839 (Attributes.Search): Remove internal version. Update.
13840 (Attributes.SearchMulti): Update.
13841 (Attributes.GetClsCompliantAttribute): Remove.
13842 (Attributes.GetIndexerNameAttribute): Remove.
13843 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
13844 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
13845 * class.cs (Indexer.Define): Likewise.
13847 2004-12-01 Marek Safar <marek.safar@seznam.cz>
13850 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
13851 MarshallByReference members access.
13853 * expression.cs: Use CheckMarshallByRefAccess;
13854 Better error CS0197 message.
13856 * report.cs: Print whole related error message.
13858 2004-11-30 Raja R Harinath <rharinath@novell.com>
13860 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
13861 the current directory to help debugging.
13863 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13865 * class (GetClassBases): Better error 60 report.
13866 (EventProperty): Disabled warning 67 detection.
13868 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13871 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
13873 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
13876 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13879 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
13881 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
13883 2004-11-26 Miguel de Icaza <miguel@ximian.com>
13885 * attribute.cs (Attribute.Resolve): Refine error reporting and
13886 report a cs0117 if the identifier does not exist, to distinguish
13887 from 0617 which is a miss-use of the actual identifier.
13889 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
13890 between cs0070 and cs0079.
13892 * class.cs (MemberBase.DoDefine): When reporting a wrong
13893 accessibility level, we use MethodCore to compare instead of
13894 Method (this was a regression in some refactoring effort).
13896 So now we correctly report cs0056 again.
13898 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
13899 testing the target_type (which was known to be object_type) and
13900 not the source type (which is anonymous_method).
13902 Fixed reporting of error cs1660.
13904 * expression.cs (UserCast.Source): Expose the underlying cast.
13906 * statement.cs (Switch.SwitchGoverningType): Sort the list of
13907 allowed types to find a match to int32 first (most common).
13909 In addition, it ignores any ImplicitUserConversions that did an
13910 internal implicit conversion (as the switch statement allows only
13911 one integral conversion to exist).
13913 * class.cs (PartialContainer.Create): rename `name' to
13914 `member_name' for clarity. Then replace the string calls with a
13915 call to MemberName.GetPartialName, as now using
13916 MemberName.ToString is an error (this is due to the side effects
13917 it had, that were fixed in the past).
13919 This will restore the error reporting on a number of partial class
13920 errors that were missusing this (and getting an exception as a
13921 results, which is now just a plain textual warning, because
13922 yyparse debug output would crash otherwise).
13924 2004-11-26 Raja R Harinath <rharinath@novell.com>
13926 * Makefile (PROGRAM_INSTALL_DIR): Remove.
13928 2004-11-25 Ben Maurer <bmaurer@ximian.com>
13930 * rootcontext.cs (LookupType): Make sure to cache lookups that
13931 don't give us a negative result. This saves about 5% of corlib
13934 2004-11-25 Miguel de Icaza <miguel@ximian.com>
13936 * report.cs (AbstractMessage.Print): messages are sent to stderr
13938 * class.cs (TypeContainer.GetClassBases): It is an error to have a
13939 non-interface in the list of interfaces (at this point, either
13940 parent was properly set, or a base class is being listed in the
13941 interfaces section).
13943 This flags error 1722, and resolves the crash from bug 69259.
13945 2004-11-25 Ben Maurer <bmaurer@ximian.com>
13947 * statement.cs (Using.EmitExpressionFinally): make this work right
13948 for valuetypes. Fixes 69926.
13950 2004-11-25 Miguel de Icaza <miguel@ximian.com>
13952 * const.cs (Const.ChangeType): Cope with the "0 literal can be
13953 converted to an enum" here, before we try to change the underlying
13954 type. This code exists, but it is a different code path than the
13955 one used while encoding constants.
13957 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
13958 old bug: when converting from the null literal to a pointer,
13959 return an EmptyCast, not the NullLiteral.
13961 This fixes #69921, the recent null_type changes probably made this
13962 bug more prominent.
13964 (ImplicitReferenceConversionExists): In addition, resynchronized
13965 the code here, so it matches the same code in
13966 ImplicitReferenceConversionExists for the `from any class-type S
13967 to any interface-type T'.
13970 2004-11-25 Marek Safar <marek.safar@seznam.cz>
13972 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
13974 2004-11-24 Miguel de Icaza <miguel@ximian.com>
13976 * cs-parser.jay: Use verbosity accordingly.
13978 2004-11-24 Marek Safar <marek.safar@seznam.cz>
13980 * expression.cs (Unary.ResolveOperator): Do not report warning;
13981 AddressOf reads from variable.
13983 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
13985 2004-11-24 Marek Safar <marek.safar@seznam.cz>
13989 * attribute.cs (Attributable): Removed CheckTargets.
13990 (Attributes.Emit): Explicit attribute targets are tested here.
13992 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
13993 not enabled for interfaces.
13995 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
13996 (GetAssemblyName): Ouch next bug there.
13998 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
14000 * expression.cs: Error 275 added.
14002 2004-11-23 Marek Safar <marek.safar@seznam.cz>
14004 Fix bug #69177 (Implemented decimal constant support)
14006 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
14007 (BinaryFold): Add DecimalConstant.
14009 * const.cs (Define): Decimal constant
14011 (ChangeType): Add decimal type handling.
14012 (LookupConstantValue): Don't set value for decimal type but
14013 emit DecimalConstantAttribute. Needed for constant optimization.
14015 * constant.cs (ToDecimal): New method.
14016 (ConvertToDecimal): New method.
14017 (IntConstant): Implemented ConvertToDecimal.
14018 (DecimalConstant.Emit): Emit optimized version for decimals in
14021 * expression.cs (ResolveOperator): Changed order of constant
14022 reduction to work correctly with native types which have
14023 overloaded operators.
14024 (ResolveMemberAccess): Extract constant value from attribute
14027 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
14029 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
14030 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
14031 (ChangeType): Decimal is special.
14032 (TypeToCoreType): Add decimal type.
14034 2004-11-22 Marek Safar <marek.safar@seznam.cz>
14036 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
14039 2004-11-22 Marek Safar <marek.safar@seznam.cz>
14041 * class.cs (EventField.ApplyAttributeBuilder): Fix error
14044 2004-11-19 Marek Safar <marek.safar@seznam.cz>
14046 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
14048 * pending.cs (PendingImplementation): Grab only interfaces.
14050 2004-11-19 Marek Safar <marek.safar@seznam.cz>
14052 * statement.cs (ForeachHelperMethods): Add location member and
14053 error 202 detection.
14055 2004-11-19 Raja R Harinath <rharinath@novell.com>
14057 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
14058 automatically handled by executable.make.
14059 (PROGRAM): Make profile-specific.
14061 2004-11-18 Marek Safar <marek.safar@seznam.cz>
14063 * expression.cs (DoResolveBase): Fixed wrong warning for out
14066 2004-11-18 Martin Baulig <martin@ximian.com>
14068 Merged latest changes into gmcs. Please keep this comment in
14069 here, it makes it easier for me to see what changed in MCS since
14070 the last time I merged.
14072 2004-11-17 Raja R Harinath <rharinath@novell.com>
14074 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
14075 (TypeHandle.GetMemberCache): New.
14076 (TypeHandle.TypeHandle): Update.
14077 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
14078 (TypeManager.LookupParentInterfacesCache):
14079 Rename from LookupInterfaceCache. Optimize slightly.
14080 (TypeManager.MemberLookup_FindMembers): Update.
14081 * decl.cs (MemberCache.MemberCache): Set Container to null in the
14082 multi-type variant.
14083 (AddCacheContents): Rename from AddHashtable.
14084 * class.cs (TypeContainer.parent_container): Remove.
14085 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
14086 (TypeContainer.DoDefineMembers): Don't initialize it.
14087 Update to name changes.
14089 2004-11-17 Miguel de Icaza <miguel@ximian.com>
14091 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
14092 that factors the code to check access modifiers on override.
14094 (PropertyBase): Use the code here.
14096 Patch from Lluis S'anchez, fixes bug #69361.
14098 2004-11-15 Miguel de Icaza <miguel@ximian.com>
14100 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
14101 routine that is used to report the use of a captured variable
14102 whose address has been taken.
14104 There are two checks: one when variables are being captured and
14105 the other check is when the address of a variable is taken.
14107 (because an anonymous methods might be resolved before *or* after
14108 the address has been taken) and
14110 * expression.cs (Conditional.DoResolve): Remove the special
14111 casing that Martin added to trueExpr and falseExpr being both
14112 NullLiteral. We get the right behavior now just by introducing
14113 the null_type into the compiler.
14115 * convert.cs (ExplicitConversion): Change the code to use
14116 null_type instead of testing `expr is NullLiteral'.
14117 (ImplicitConversionStandard): use null_type too.
14118 (ImplicitReferenceConversionExists): use null_type too.
14119 (ImplicitReferenceConversion): use null_type too.
14121 * literal.cs: The type of `NullLiteral' is now null_type instead
14123 (Resolve): Set the type here.
14125 * typemanager.cs: Introduce null_type.
14127 2004-11-17 Martin Baulig <martin@ximian.com>
14129 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
14130 direction, like FindMembers() does. Fixes #69546, testcase is in
14133 2004-11-16 Martin Baulig <martin@ximian.com>
14135 This is based on a patch from Marek Safar, see bug #69082.
14136 Fixes bugs #63705 and #67130.
14138 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
14139 method; create a MemberCache for an interface type and cache the
14142 * decl.cs (IMemberContainer.ParentContainer): Removed.
14143 (IMemberContainer.ParentCache): New property.
14144 (MemberCache.SetupCacheForInterface): Removed.
14145 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
14146 to create a cache for an interface's "parent".
14148 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
14151 2004-11-16 Martin Baulig <martin@ximian.com>
14153 Merged back from gmcs; these changes already went into gmcs a
14154 couple of weeks ago.
14157 (TypeManager.AddUserType): Removed the `ifaces' argument.
14158 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
14160 (TypeManager.AddUserInterface): Removed.
14161 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
14163 (TypeManager.GetInterfaces): Likewise.
14164 (TypeManager.GetExplicitInterfaces): Likewise.
14166 * ecore.cs (TypeExpr.GetInterfaces): Removed.
14168 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
14169 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
14171 2004-11-14 Ben Maurer <bmaurer@ximian.com>
14173 * statement.cs: Avoid adding bools to a hashtable.
14175 2004-11-07 Miguel de Icaza <miguel@ximian.com>
14177 * expression.cs (Invocation.OverloadResolve): Flag error if we are
14178 calling an unsafe method from a safe location.
14180 2004-11-06 Marek Safar <marek.safar@seznam.cz>
14183 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
14185 2004-11-06 Miguel de Icaza <miguel@ximian.com>
14187 * namespace.cs (VerifyUsing): use GetPartialName instead of
14190 2004-11-05 Miguel de Icaza <miguel@ximian.com>
14192 * statement.cs (Return.Resolve): Fix regression in typo: if
14193 `in_exc', we have to request a NeedReturnLabel, this was a typo
14194 introduced in the anonymous method check-in. Fixes #69131.
14196 * Indexers were using the ShortName when defining themselves,
14197 causing a regression in the compiler bootstrap when applying the
14198 patch from 2004-11-02 (first part), now they use their full name
14199 and the bug is gone.
14201 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
14203 * driver.cs: Strip the path from the names of embedded resources. Fixes
14206 2004-11-04 Raja R Harinath <rharinath@novell.com>
14208 Fix error message regression: cs0104-2.cs.
14209 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
14210 (AliasEntry.Resolve): Update.
14211 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
14213 (RootContext.LookupType): Update.
14215 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
14217 * cs-parser.jay: Add support for handling accessor modifiers
14218 * class: Add support port accessor modifiers and error checking,
14219 define PropertyMethod.Define as virtual (not abstract anymore)
14220 * ecore.cs: Add checking for proeprties access with access modifiers
14221 * iterators.cs: Modify Accessor constructor call based in the modified
14223 2004-11-02 Ben Maurer <bmaurer@ximian.com>
14225 * expression.cs (StringConcat): Handle being called twice,
14226 as when we have a concat in a field init with more than two
14229 2004-11-02 Miguel de Icaza <miguel@ximian.com>
14231 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
14232 special case explicit implementations, we should always produce
14233 the .property or .event declaration.
14235 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
14236 since it will not return correct data if people use this
14237 unresolved in the presence of using statements (see test-313).
14239 * class.cs (MethodData.Define): If we are an explicit interface
14240 implementation, set the method name to the full name of the
14241 interface plus the name of the method.
14243 Notice that using the method.MethodName.GetFullName() does not
14244 work, as it will only contain the name as declared on the source
14245 file (it can be a shorthand in the presence of using statements)
14246 and not the fully qualifed type name, for example:
14250 class D : ICloneable {
14251 object ICloneable.Clone () {
14255 Would produce a method called `ICloneable.Clone' instead of
14256 `System.ICloneable.Clone'.
14258 * namespace.cs (Alias.Resolve): Use GetPartialName.
14260 2004-11-01 Marek Safar <marek.safar@seznam.cz>
14262 * cs-parser.jay: Add error 1055 report.
14264 2004-11-01 Miguel de Icaza <miguel@ximian.com>
14266 * assign.cs (Assign.DoResolve): Only do the transform of
14267 assignment into a New if the types are compatible, if not, fall
14268 through and let the implicit code deal with the errors and with
14269 the necessary conversions.
14271 2004-11-01 Marek Safar <marek.safar@seznam.cz>
14273 * cs-parser.jay: Add error 1031 report.
14275 * cs-tokenizer.cs: Add location for error 1038.
14277 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14279 * cs-parser.jay: Add error 1016 report.
14281 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14283 * cs-parser.jay: Add errors 1575,1611 report.
14285 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14287 * cs-parser.jay: Add error 1001 report.
14289 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14292 * attribute.cs (GetMarshal): Add method argument for
14293 caller identification.
14295 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
14296 agument for GetMarshal and RuntimeMissingSupport.
14298 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14300 * attribute.cs (ExtractSecurityPermissionSet): Removed
14301 TypeManager.code_access_permission_type.
14303 * typemanager.cs: Removed TypeManager.code_access_permission_type.
14305 2004-10-27 Miguel de Icaza <miguel@ximian.com>
14307 * expression.cs (LocalVariableReference.DoResolveLValue): Check
14308 for obsolete use of a variable here. Fixes regression on errors
14309 cs0619-25 and cs0619-26.
14311 2004-10-27 Marek Safar <marek.safar@seznam.cz>
14313 Fix #62358, implemented security attribute encoding.
14315 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
14316 Tests permitted SecurityAction for assembly or other types.
14317 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
14318 data from SecurityPermissionAttribute to PermisionSet class.
14320 * class.cs (ApplyAttributeBuilder): Added special handling
14321 for System.Security.Permissions.SecurityAttribute based types.
14323 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
14324 special handling for System.Security.Permissions.SecurityAttribute
14327 * enum.cs (ApplyAttributeBuilder): Added special handling
14328 for System.Security.Permissions.SecurityAttribute based types.
14330 * parameter.cs (ApplyAttributeBuilder): Added special handling
14331 for System.Security.Permissions.SecurityAttribute based types.
14333 * rootcontext.cs: Next 2 core types.
14335 * typemanager.cs (TypeManager.security_permission_attr_type):
14336 Built in type for the SecurityPermission Attribute.
14337 (code_access_permission_type): Build in type.
14339 2004-10-17 Miguel de Icaza <miguel@ximian.com>
14341 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
14342 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
14343 all of this information into
14344 EmitContext.EmitCapturedVariableInstance.
14346 * codegen.cs (EmitCapturedVariableInstance): move here the
14347 funcionality of emitting an ldarg.0 in the presence of a
14348 remapping. This centralizes the instance emit code.
14350 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
14351 then emit a load of this: it means that we have reached the
14352 topmost ScopeInfo: the one that contains the pointer to the
14353 instance of the class hosting the anonymous method.
14355 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
14356 captures to the topmost CaptureContext.
14358 2004-10-12 Miguel de Icaza <miguel@ximian.com>
14360 * expression.cs (LocalVariableReference): Move the knowledge about
14361 the iterators into codegen's EmitCapturedVariableInstance.
14363 2004-10-11 Miguel de Icaza <miguel@ximian.com>
14365 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
14366 all code paths return a value from an anonymous method (it is the
14367 same as the 161 error, but for anonymous methods).
14369 2004-10-08 Miguel de Icaza <miguel@ximian.com>
14371 The introduction of anonymous methods in the compiler changed
14372 various ways of doing things in the compiler. The most
14373 significant one is the hard split between the resolution phase
14374 and the emission phases of the compiler.
14376 For instance, routines that referenced local variables no
14377 longer can safely create temporary variables during the
14378 resolution phase: they must do so from the emission phase,
14379 since the variable might have been "captured", hence access to
14380 it can not be done with the local-variable operations from the runtime.
14384 (Block.Flags): New flag `IsTopLevel' to indicate that this block
14385 is a toplevel block.
14387 (ToplevelBlock): A new kind of Block, these are the blocks that
14388 are created by the parser for all toplevel method bodies. These
14389 include methods, accessors and anonymous methods.
14391 These contain some extra information not found in regular blocks:
14392 A pointer to an optional CaptureContext (for tracking captured
14393 local variables and parameters). A pointer to the parent
14396 (Return.Resolve): Catch missmatches when returning a value from an
14397 anonymous method (error 1662).
14398 Invoke NeedReturnLabel from the Resolve phase instead of the emit
14401 (Break.Resolve): ditto.
14403 (SwitchLabel): instead of defining the labels during the
14404 resolution phase, we now turned the public ILLabel and ILLabelCode
14405 labels into methods called GetILLabelCode() and GetILLabel() that
14406 only define the label during the Emit phase.
14408 (GotoCase): Track the SwitchLabel instead of the computed label
14409 (its contained therein). Emit the code by using
14410 SwitchLabel.GetILLabelCode ().
14412 (LocalInfo.Flags.Captured): A new flag has been introduce to track
14413 whether the Local has been captured or not.
14415 (LocalInfo.IsCaptured): New property, used to tell whether the
14416 local has been captured.
14418 * anonymous.cs: Vastly updated to contain the anonymous method
14421 The main classes here are: CaptureContext which tracks any
14422 captured information for a toplevel block and ScopeInfo used to
14423 track the activation frames for various local variables.
14425 Each toplevel block has an optional capture context associated
14426 with it. When a method contains an anonymous method both the
14427 toplevel method and the anonymous method will create a capture
14428 context. When variables or parameters are captured, they are
14429 recorded on the CaptureContext that owns them, for example:
14433 MyDelegate d = delegate {
14438 Here `a' will be recorded as captured on the toplevel
14439 CapturedContext, the inner captured context will not have anything
14440 (it will only have data if local variables or parameters from it
14441 are captured in a nested anonymous method.
14443 The ScopeInfo is used to track the activation frames for local
14444 variables, for example:
14446 for (int i = 0; i < 10; i++)
14447 for (int j = 0; j < 10; j++){
14448 MyDelegate d = delegate {
14453 At runtime this captures a single captured variable `i', but it
14454 captures 10 different versions of the variable `j'. The variable
14455 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
14456 recorded on a child.
14458 The toplevel ScopeInfo will also track information like the `this'
14459 pointer if instance variables were referenced (this is necessary
14460 as the anonymous method lives inside a nested class in the host
14461 type of the method).
14463 (AnonymousMethod): Expanded to track the Toplevel, implement
14464 `AnonymousMethod.Compatible' to tell whether an anonymous method
14465 can be converted to a target delegate type.
14467 The routine now also produces the anonymous method content
14469 (AnonymousDelegate): A helper class that derives from
14470 DelegateCreation, this is used to generate the code necessary to
14471 produce the delegate for the anonymous method that was created.
14473 * assign.cs: API adjustments for new changes in
14474 Convert.ImplicitStandardConversionExists.
14476 * class.cs: Adjustments to cope with the fact that now toplevel
14477 blocks are of type `ToplevelBlock'.
14479 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
14480 insteda of standard blocks.
14482 Flag errors if params arguments are passed to anonymous methods.
14484 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
14485 `CurrentAnonymousMethod' which points to the current Anonymous
14486 Method. The variable points to the AnonymousMethod class that
14487 holds the code being compiled. It is set in the new EmitContext
14488 created for the anonymous method.
14490 (EmitContext.Phase): Introduce a variable and an enumeration to
14491 assist in enforcing some rules about when and where we are allowed
14492 to invoke certain methods (EmitContext.NeedsReturnLabel is the
14493 only one that enfonces this right now).
14495 (EmitContext.HaveCaptureInfo): new helper method that returns
14496 whether we have a CapturedContext initialized.
14498 (EmitContext.CaptureVariable): New method used to register that a
14499 LocalInfo must be flagged for capturing.
14501 (EmitContext.CapturedParameter): New method used to register that a
14502 parameters must be flagged for capturing.
14504 (EmitContext.CapturedField): New method used to register that a
14505 field must be flagged for capturing.
14507 (EmitContext.HaveCapturedVariables,
14508 EmitContext.HaveCapturedFields): Return whether there are captured
14509 variables or fields.
14511 (EmitContext.EmitMethodHostInstance): This is used to emit the
14512 instance for the anonymous method. The instance might be null
14513 (static methods), this (for anonymous methods that capture nothing
14514 and happen to live side-by-side with the current method body) or a
14515 more complicated expression if the method has a CaptureContext.
14517 (EmitContext.EmitTopBlock): Routine that drives the emission of
14518 code: it will first resolve the top block, then emit any metadata
14519 and then emit the code. The split is done so that we can extract
14520 any anonymous methods and flag any captured variables/parameters.
14522 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
14523 during this phase, the ILGenerator should not be used as labels
14524 and local variables declared here might not be accessible to any
14525 code that is part of an anonymous method.
14527 Exceptions to this include the temporary variables that are
14528 created by some statements internally for holding temporary
14531 (EmitContext.EmitMeta): New routine, in charge of emitting all the
14534 (EmitContext.TemporaryReturn): This method is typically called
14535 from the Emit phase, and its the only place where we allow the
14536 ReturnLabel to be defined other than the EmitMeta. The reason is
14537 that otherwise we would have to duplicate a lot of logic in the
14538 Resolve phases of various methods that today is on the Emit
14541 (EmitContext.NeedReturnLabel): This no longer creates the label,
14542 as the ILGenerator is not valid during the resolve phase.
14544 (EmitContext.EmitThis): Extended the knowledge in this class to
14545 work in anonymous methods in addition to iterators.
14547 (EmitContext.EmitCapturedVariableInstance): This emits whatever
14548 code is necessary on the stack to access the instance to a local
14549 variable (the variable will be accessed as a field).
14551 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
14552 EmitContext.EmitAddressOfParameter): Routines to support
14553 parameters (not completed at this point).
14555 Removals: Removed RemapLocal and RemapLocalLValue. We probably
14556 will also remove the parameters.
14558 * convert.cs (Convert): Define a `ConstantEC' which points to a
14559 null. This is just to prefity some code that uses
14560 ImplicitStandardConversion code and do not have an EmitContext
14563 The idea is to flag explicitly that at that point in time, it is
14564 known that the conversion will not trigger the delegate checking
14565 code in implicit conversions (which requires a valid
14568 Everywhere: pass new EmitContext parameter since
14569 ImplicitStandardConversionExists now requires it to check for
14570 anonymous method conversions.
14572 (Convert.ImplicitStandardConversionExists): If the type of an
14573 expression is the anonymous_method_type, and the type is a
14574 delegate, we invoke the AnonymousMethod.Compatible method to check
14575 whether an implicit conversion is possible.
14577 (Convert.ImplicitConversionStandard): Only do implicit method
14578 group conversions if the language level is not ISO_1.
14580 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
14581 MethodInfo for the Invoke method. used by Delegate and
14584 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
14585 method conversions if the target type is a delegate.
14587 Removed extra debugging nops.
14589 (LocalVariableReference): Turn the `local_info' into a public
14592 Add `prepared' field, the same hack used for FieldExprs to cope
14593 with composed assignments, as Local variables do not necessarily
14594 operate purely on the stack as they used to: they can be captured
14597 Add `temp' for a temporary result, like fields.
14599 Refactor DoResolve and DoResolveLValue into DoResolveBase.
14601 It now copes with Local variables that are captured and emits the
14602 proper instance variable to load it from a field in the captured
14605 (ParameterReference.DoResolveBase): During the resolve phase,
14606 capture parameters if we are in an anonymous method.
14608 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
14609 anonymous method, use the EmitContext helper routines to emit the
14610 parameter reference.
14612 * iterators.cs: Set RemapToProxy to true/false during the
14615 * parameters.cs (GetParameterByName): New helper method.
14617 * typemanager.cs (anonymous_method_type) a new type that
14618 represents an anonyous method. This is always an internal type,
14619 used as a fencepost to test against the anonymous-methodness of an
14622 2004-10-20 Marek Safar <marek.safar@seznam.cz>
14624 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
14626 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
14628 2004-10-18 Martin Baulig <martin@ximian.com>
14630 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
14631 `Type' directly, but call ResolveType() on it.
14632 (Catch.Resolve): Likewise.
14633 (Foreach.Resolve): Likewise.
14635 2004-10-18 Martin Baulig <martin@ximian.com>
14637 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
14638 `Type' directly, but call ResolveType() on it.
14639 (Probe.DoResolve): Likewise.
14640 (ArrayCreation.LookupType): Likewise.
14641 (TypeOf.DoResolve): Likewise.
14642 (SizeOf.DoResolve): Likewise.
14644 2004-10-18 Martin Baulig <martin@ximian.com>
14646 * expression.cs (Invocation.BetterFunction): Put back
14647 TypeManager.TypeToCoreType().
14649 2004-10-18 Raja R Harinath <rharinath@novell.com>
14651 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
14654 2004-10-18 Martin Baulig <martin@ximian.com>
14656 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
14657 `Type' directly, but call ResolveType() on it.
14659 2004-10-18 Martin Baulig <martin@ximian.com>
14661 * class.cs (FieldMember.Define): Don't access the TypeExpr's
14662 `Type' directly, but call ResolveType() on it.
14663 (MemberBase.DoDefine): Likewise.
14665 * expression.cs (New.DoResolve): Don't access the TypeExpr's
14666 `Type' directly, but call ResolveType() on it.
14667 (ComposedCast.DoResolveAsTypeStep): Likewise.
14669 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
14670 `Type' directly, but call ResolveType() on it.
14672 2004-10-17 John Luke <john.luke@gmail.com>
14674 * class.cs (Operator.GetSignatureForError): use CSharpName
14676 * parameter.cs (Parameter.GetSignatureForError): Returns
14677 correct name even if was not defined.
14679 2004-10-13 Raja R Harinath <rharinath@novell.com>
14682 * class.cs (TypeContainer.EmitContext): New property.
14683 (DefineNestedTypes): Create an emitcontext for each part.
14684 (MethodCore.DoDefineParameters): Use container's emitcontext.
14685 Pass type array to InternalParameters.
14686 (MemberBase.DoDefine): Use container's emitcontext.
14687 (FieldMember.Define): Likewise.
14688 (Event.Define): Likewise.
14689 (SetMethod.GetParameterInfo): Change argument to EmitContext.
14690 Pass type array to InternalParameters.
14691 (SetIndexerMethod.GetParameterInfo): Likewise.
14692 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
14693 * delegate.cs (Define): Pass emitcontext to
14694 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
14695 array to InternalParameters.
14696 * expression.cs (ParameterReference.DoResolveBase): Pass
14697 emitcontext to GetParameterInfo.
14698 (ComposedCast.DoResolveAsTypeStep): Remove check on
14699 ec.ResolvingTypeTree.
14700 * parameter.cs (Parameter.Resolve): Change argument to
14701 EmitContext. Use ResolveAsTypeTerminal.
14702 (Parameter.GetSignature): Change argument to EmitContext.
14703 (Parameters.ComputeSignature): Likewise.
14704 (Parameters.ComputeParameterTypes): Likewise.
14705 (Parameters.GetParameterInfo): Likewise.
14706 (Parameters.ComputeAndDefineParameterTypes): Likewise.
14707 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
14708 * support.cs (InternalParameters..ctor): Remove variant that takes
14710 * typemanager.cs (system_intptr_expr): New.
14711 (InitExpressionTypes): Initialize it.
14713 2004-10-12 Chris Toshok <toshok@ximian.com>
14715 * cs-parser.jay: fix location for try_statement and catch_clause.
14717 2004-10-11 Martin Baulig <martin@ximian.com>
14719 * report.cs: Don't make --fatal abort on warnings, we have
14720 -warnaserror for that.
14722 2004-10-07 Raja R Harinath <rharinath@novell.com>
14724 More DeclSpace.ResolveType avoidance.
14725 * decl.cs (MemberCore.InUnsafe): New property.
14726 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
14727 with newly created EmitContext.
14728 (FieldMember.Define): Likewise.
14729 * delegate.cs (Delegate.Define): Likewise.
14730 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
14731 only if normal name-lookup fails.
14732 (TypeExpr.DoResolve): Enable error-checking.
14733 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
14734 (SizeOf.DoResolve): Likewise.
14735 (ComposedCast.DoResolveAsTypeStep): Likewise.
14736 (StackAlloc.DoResolve): Likewise.
14737 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
14738 (Block.Unsafe): New property.
14739 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
14740 (Unsafe): Set 'unsafe' flag of contained block.
14741 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
14742 (Fixed.Resolve): Likewise.
14743 (Catch.Resolve): Likewise.
14744 (Using.ResolveLocalVariableDecls): Likewise.
14745 (Foreach.Resolve): Likewise.
14747 2004-10-05 John Luke <john.luke@gmail.com>
14749 * cs-parser.jay: add location to error CS0175
14751 2004-10-04 Miguel de Icaza <miguel@ximian.com>
14753 * ecore.cs (Expression.Constantity): Add support for turning null
14756 * const.cs (Const.Define): Allow constants to be reference types
14757 as long as the value is Null.
14759 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
14761 * namespace.cs (NamespaceEntry.Using): No matter which warning
14762 level is set, check if this namespace name has already been added.
14764 2004-10-03 Ben Maurer <bmaurer@ximian.com>
14766 * expression.cs: reftype [!=]= null should always use br[true,false].
14769 2004-10-03 Marek Safar <marek.safar@seznam.cz>
14772 * attribute.cs: Enum conversion moved to
14773 GetAttributeArgumentExpression to be applied to the all
14776 2004-10-01 Raja R Harinath <rharinath@novell.com>
14778 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
14779 * class.c (TypeContainer.DefineType): Flag error if
14780 base types aren't accessible due to access permissions.
14781 * decl.cs (DeclSpace.ResolveType): Move logic to
14782 Expression.ResolveAsTypeTerminal.
14783 (DeclSpace.ResolveTypeExpr): Thin layer over
14784 Expression.ResolveAsTypeTerminal.
14785 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
14786 Refactor code into NestedAccess. Use it.
14787 (DeclSpace.NestedAccess): New.
14788 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
14789 argument to silence errors. Check access permissions.
14790 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
14791 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
14792 (Cast.DoResolve): Likewise.
14793 (New.DoResolve): Likewise.
14794 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
14795 (TypeOf.DoResolve): Likewise.
14797 * expression.cs (Invocation.BetterConversion): Return the Type of
14798 the better conversion. Implement section 14.4.2.3 more faithfully.
14799 (Invocation.BetterFunction): Make boolean. Make correspondence to
14800 section 14.4.2.2 explicit.
14801 (Invocation.OverloadResolve): Update.
14802 (Invocation): Remove is_base field.
14803 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
14804 (Invocation.Emit): Likewise.
14806 2004-09-27 Raja R Harinath <rharinath@novell.com>
14808 * README: Update to changes.
14810 2004-09-24 Marek Safar <marek.safar@seznam.cz>
14812 * cs-parser.jay: Reverted 642 warning fix.
14814 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14817 * decl.cs (FindMemberWithSameName): Indexer can have more than
14820 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14822 * expression.cs (LocalVariableReference.DoResolveLValue):
14823 Do not report warning 219 for out values.
14824 (EmptyExpression.Null): New member to avoid extra allocations.
14826 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14828 * cs-parser.jay: Fix wrong warning 642 report.
14830 * cs-tokenizer.cs (CheckNextToken): New helper;
14831 Inspect next character if is same as expected.
14833 2004-09-23 Martin Baulig <martin@ximian.com>
14835 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
14836 (Convert.ImplicitReferenceConversionExists): Likewise.
14838 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14840 * class.cs (Operator.Define): Add error 448 and 559 report.
14842 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14844 * class.cs (MemberBase.IsTypePermitted): New protected
14845 method for checking error CS0610.
14847 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14849 * class.cs (TypeContainer.HasExplicitLayout): New property
14850 Returns whether container has StructLayout attribute set Explicit.
14851 (FieldMember): New abstract class for consts and fields.
14852 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
14853 (Field): Reuse FieldMember.
14855 * const.cs (Const): Reuse FieldMember.
14857 * rootcontext.cs: EmitConstants call moved to class.
14859 2004-09-22 Martin Baulig <martin@ximian.com>
14861 Thanks to Peter Sestoft for this bug report.
14863 * expression.cs (Conditional): If both the `trueExpr' and the
14864 `falseExpr' is a NullLiteral, return a NullLiteral.
14866 2004-09-22 Martin Baulig <martin@ximian.com>
14868 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
14869 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
14870 for the "get_Current" call.
14872 2004-09-22 Martin Baulig <martin@ximian.com>
14874 Marek and me just fixed one of our oldest bugs: #28562 :-)
14876 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
14878 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
14879 we're an EnumConstant, just return that.
14880 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
14881 an EnumConstant. In this case, we need to use GetValueAsEnumType()
14882 to get the value which'll actually be written into the attribute.
14883 However, we have to use GetValue() to access the attribute's value
14886 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14888 * constant.cs (Constant.IsNegative): New abstract property
14891 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
14892 (StackAlloc.DoResolve): Reused IsNegative.
14894 2004-09-21 Martin Baulig <martin@ximian.com>
14896 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
14897 if we're used in an iterator, we may be called from different
14900 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
14901 we actually have an exception block.
14903 2004-09-20 John Luke <jluke@cfl.rr.com>
14905 * class.cs, cs-parser.jay: Improve the error report for 1520:
14906 report the actual line where the error happens, not where the
14907 class was declared.
14909 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
14910 Pass location information that was available elsewhere.
14912 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
14914 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
14915 runtime to delay sign assemblies.
14917 2004-09-19 Miguel de Icaza <miguel@ximian.com>
14919 * cs-parser.jay: Do not report the stack trace, this is barely
14922 2004-08-22 John Luke <john.luke@gmail.com>
14924 * driver.cs : check that a resource id is not already used
14925 before adding it, report CS1508 if it is, bug #63637
14927 2004-09-19 Miguel de Icaza <miguel@ximian.com>
14929 * ecore.cs: Removed dead code.
14931 2004-09-18 Marek Safar <marek.safar@seznam.cz>
14933 * class.cs: Do not report warning CS0067 on the interfaces.
14935 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14937 * cs-parser.jay: Add error 504 report.
14939 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14941 * rootcontext.cs: WarningLevel is 4 by default now.
14943 * statement.cs (Fixed.Resolve): Do not null
14946 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14949 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
14950 deep search when property is not virtual.
14951 (PropertyExpr.ResolveAccessors): Make one call for both
14954 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14957 * statement.cs: Error 152 report constains also location.
14959 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14962 * const.cs: Explicitly set constant as static.
14964 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14967 * cs-parser.jay: Add error 1017 report.
14969 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14971 Fixed bug #59980, #64224
14972 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
14974 * typemanager.cs (IsSpecialMethod): Simplified
14976 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14978 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
14979 condition with better params.
14981 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14984 * attribute.cs (Resolve): Property has to have both
14987 2004-09-14 Martin Baulig <martin@ximian.com>
14989 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
14991 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14994 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
14995 called and is obsolete then this member suppress message
14996 when call is inside next [Obsolete] method or type.
14998 * expression.cs: Use TestObsoleteMethodUsage member.
15000 2004-09-14 Martin Baulig <martin@ximian.com>
15002 * cs-parser.jay: Sync a bit with the GMCS version.
15004 2004-09-14 Martin Baulig <martin@ximian.com>
15006 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
15007 (CSharpParser.yacc_verbose_flag): New public field.
15009 * genericparser.cs: Removed.
15011 2004-09-14 Raja R Harinath <rharinath@novell.com>
15013 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
15015 2004-09-13 Marek Safar <marek.safar@seznam.cz>
15017 * class.cs (MethodCore.CheckBase): Fix bug #65757.
15019 2004-09-10 Martin Baulig <martin@ximian.com>
15021 Backported my MemberName changes from GMCS into MCS.
15023 - we are now using a special `MemberName' class instead of using
15024 strings; in GMCS, the `MemberName' also contains the type
15027 - changed the grammar rules a bit:
15028 * the old `member_name' is now a `namespace_or_type_name':
15029 The rule is that we use `namespace_or_type_name' everywhere
15030 where we expect either a "member name" (GetEnumerator) or a
15031 "member name" with an explicit interface name
15032 (IEnumerable.GetEnumerator).
15033 In GMCS, the explicit interface name may include type arguments
15034 (IEnumerable<T>.GetEnumerator).
15035 * we use `member_name' instead of just `IDENTIFIER' for
15037 The rule is that we use `member_name' wherever a member may
15038 have type parameters in GMCS.
15040 * decl.cs (MemberName): New public class.
15041 (MemberCore.MemberName): New public readonly field.
15042 (MemberCore.ctor): Take a `MemberName' argument, not a string.
15043 (DeclSpace): Likewise.
15045 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
15046 * enum.cs (Enum.ctor): Likewise.
15048 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
15050 (AliasEntry.ctor): Take a MemberName, not an Expression.
15051 (AliasEntry.UsingAlias): Likewise.
15053 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
15054 (IMethodData.MemberName): Changed type from string to MemberName.
15055 (MemberBase.ExplicitInterfaceName): Likewise.
15056 (AbstractPropertyEventMethod.SetupName): Make this private.
15057 (AbstractPropertyEventMethod.ctor): Added `string prefix'
15058 argument; compute the member name here.
15059 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
15060 on the `member.MemberName' and the `prefix'.
15062 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
15064 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
15065 thus, we get a `MemberName' instead of a `string'. These
15066 declarations may have type parameters in GMCS.
15067 (interface_method_declaration, delegate_declaration): Likewise.
15068 (class_declaration, interface_declaration): Likewise.
15069 (method_header): Use `namespace_or_type_name' instead of
15070 `member_name'. We may be an explicit interface implementation.
15071 (property_declaration, event_declaration): Likewise.
15072 (member_name): This is now just an `IDENTIFIER', not a
15073 `namespace_or_type_name'.
15074 (type_name, interface_type): Removed.
15075 (namespace_or_type_name): Return a MemberName, not an Expression.
15076 (primary_expression): Use `member_name' instead of `IDENTIFIER';
15077 call GetTypeExpression() on the MemberName to get an expression.
15078 (IndexerDeclaration.interface_type): Changed type from string to
15080 (MakeName): Operate on MemberName's instead of string's.
15082 2004-09-13 Raja R Harinath <rharinath@novell.com>
15085 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
15086 (NamespaceEntry.Lookup): Add new argument to flag if we want the
15087 lookup to avoid symbols introduced by 'using'.
15088 * rootcontext.cs (NamespaceLookup): Update.
15090 2004-09-12 Marek Safar <marek.safar@seznam.cz>
15092 * class.cs (TypeContainer.DoDefineMembers): Do not call
15093 DefineDefaultConstructor for static classes.
15095 2004-09-12 Marek Safar <marek.safar@seznam.cz>
15097 * attribute.cs (Attribute.Resolve): Add error 653 report.
15099 * class.cs (Class.ApplyAttributeBuilder): Add error 641
15101 (Method.ApplyAttributeBuilder): Add error 685 report.
15102 (Operator.Define): Add error 564 report.
15104 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15106 * expression.cs (Invocation.DoResolve): Add error
15107 245 and 250 report.
15109 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
15112 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15114 * class.cs (ConstructorInitializer.Resolve):
15115 Wrong error number (515->516).
15117 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15119 * class.cs (Indexer.Define): Add error 631 report.
15121 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15123 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
15125 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15127 * expression.cs (Probe.DoResolve): Add error CS0241 report.
15129 2004-09-10 Marek Safar <marek.safar@seznam.cz>
15131 * cs-parser.jay: Added error CS0241 report.
15133 2004-09-10 Raja R Harinath <rharinath@novell.com>
15135 * cs-parser.jay (fixed_statement): Introduce a scope for the
15136 declaration in the 'fixed' statement.
15138 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15140 * cs-parser.jay: Added CS0230 error report.
15142 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15144 * cs-parser.jay: Added errors CS0231 and CS0257 report.
15146 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15148 * expression.cs (Argument.Resolve): Added error CS0192 and
15151 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15153 C# 2.0 #pragma warning feature
15155 * cs-tokenizer.cs (PreProcessPragma): New method;
15156 Handles #pragma directive.
15158 * report.cs (WarningRegions): New class; Support
15159 class for #pragma warning directive. It tests whether
15160 warning is enabled for a given line.
15162 2004-09-08 Miguel de Icaza <miguel@ximian.com>
15164 * const.cs: Add more descriptive error report, tahnks to
15167 2004-09-08 Marek Safar <marek.safar@seznam.cz>
15169 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
15171 2004-09-07 Miguel de Icaza <miguel@ximian.com>
15173 * expression.cs: Apply patch from Ben: Remove dead code from
15174 ArrayCreation, and remove the TurnintoConstant call in const.cs,
15175 as that code just threw an exception anwyays.
15177 * const.cs: Remove the call to the turnintoconstant, for details
15180 * literal.cs: The type of the null-literal is the null type; So
15181 we use a placeholder type (literal.cs:System.Null, defined here)
15184 * expression.cs (Conditional.DoResolve): Remove some old code that
15185 is no longer needed, conversions have been fixed.
15187 (ArrayCreationExpression.DoResolve): Return false if we fail to
15188 resolve the inner expression.
15190 2004-09-07 Raja R Harinath <rharinath@novell.com>
15193 * cs-parser.jay (delegate_declaration): Record a delegate
15194 declaration as a type declaration.
15195 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
15197 2004-09-06 Miguel de Icaza <miguel@ximian.com>
15199 * parameter.cs: Do not crash if the type can not be resolved.
15201 * expression.cs: Report errors with unsafe pointers, fixes #64896
15203 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
15205 * expression.cs: Pointer arith always needs to do a conv.i
15206 if the operand is a long. fix 65320
15208 2004-09-04 Marek Safar <marek.safar@seznam.cz>
15210 Fixed cs0619-37.cs, cs0619-38.cs
15212 * enum.cs (GetObsoleteAttribute): Removed.
15214 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
15215 on Enum member is double staged. The first is tested member
15218 2004-09-04 Marek Safar <marek.safar@seznam.cz>
15220 Fixed #56986, #63631, #65231
15222 * class.cs: (TypeContainer.AddToMemberContainer): New method,
15223 adds member to name container.
15224 (TypeContainer.AddToTypeContainer): New method, adds type to
15226 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
15227 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
15228 AddOperator): Simplified by reusing AddToMemberContainer.
15229 (TypeContainer.UserDefinedStaticConstructor): Changed to property
15231 (Method.CheckForDuplications): Fixed implementation to test all
15233 (MemberBase): Detection whether member is explicit interface
15234 implementation is now in constructor.
15235 (MemberBase.UpdateMemberName): Handles IndexerName.
15236 (Accessor): Changed to keep also location information.
15237 (AbstractPropertyEventMethod): Is derived from MemberCore.
15238 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
15239 will be emited or not.
15240 (PropertyBase.AreAccessorsDuplicateImplementation):
15241 Tests whether accessors are not in collision with some method.
15242 (Operator): Is derived from MethodCore to simplify common
15245 * decl.cs (Flags.TestMethodDuplication): Test for duplication
15247 (DeclSpace.AddToContainer): Adds the member to defined_names
15248 table. It tests for duplications and enclosing name conflicts.
15250 * enum.cs (EnumMember): Clean up to reuse the base structures
15252 2004-09-03 Martin Baulig <martin@ximian.com>
15254 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
15255 into TypeContainer, to make partial classes work again.
15257 2004-09-03 Martin Baulig <martin@ximian.com>
15259 * rootcontext.cs (RootContext.V2): Removed.
15261 2004-03-23 Martin Baulig <martin@ximian.com>
15263 * expression.cs (Invocation.OverloadResolve): Added `bool
15264 may_fail' argument and use it instead of the Location.IsNull() hack.
15266 2004-09-03 Martin Baulig <martin@ximian.com>
15268 Merged latest changes into gmcs. Please keep this comment in
15269 here, it makes it easier for me to see what changed in MCS since
15270 the last time I merged.
15272 2004-09-03 Raja R Harinath <rharinath@novell.com>
15275 * expression.cs (BetterConversion): Don't allow either conversion
15276 to be null. Remove redundant implicit conversion test when 'q ==
15277 null' -- when this function is invoked, we already know that the
15278 implicit conversion exists.
15279 (BetterFunction): Assume that 'best' is non-null. Remove
15280 redundant reimplementation of IsApplicable when 'best' is null.
15281 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
15282 number of arguments.
15283 (IsAncestralType): Extract from OverloadResolve.
15284 (OverloadResolve): Make robust to the MethodGroupExpr being
15285 unsorted. Implement all the logic of Section 14.5.5.1, and
15286 support overloading of methods from multiple applicable types.
15287 Clean up logic somewhat. Don't pass null methods to BetterFunction.
15289 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
15290 (RealError, Warning): Append type of report to related symbol.
15292 2004-09-03 Marek Safar <marek.safar@seznam.cz>
15294 * enum.cs: Fixed CLS-Compliance checks for enum members.
15295 Error tests cs3008-8.cs, cs3014-8.cs
15297 2004-09-02 Marek Safar <marek.safar@seznam.cz>
15299 Fixed bug #62342, #63102
15300 * class.cs: ImplementIndexer uses member.IsExplicitImpl
15301 like ImplementMethod.
15303 2004-09-02 Marek Safar <marek.safar@seznam.cz>
15305 * attribute.cs (Attribute.GetAttributeArgumentExpression):
15308 2004-09-02 Martin Baulig <martin@ximian.com>
15310 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
15311 TypeManager.GetArgumentTypes() rather than calling GetParameters()
15314 2004-09-01 Marek Safar <marek.safar@seznam.cz>
15316 C# 2.0 Static classes implemented
15318 * class.cs (TypeContainer): instance_constructors,
15319 initialized_fields, initialized_static_fields,
15320 default_constructor, base_inteface_types are protected to be
15321 accessible from StaticClass.
15322 (TypeContainer.DefineDefaultConstructor): New virtual method
15323 for custom default constructor generating
15324 (StaticClass): New class to handle "Static classes" feature.
15326 * cs-parser.jay: Handle static keyword on class like instance
15329 * driver.cs: Added "/langversion" command line switch with two
15330 options (iso-1, default).
15332 2004-08-31 Marek Safar <marek.safar@seznam.cz>
15334 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
15336 2004-08-31 Miguel de Icaza <miguel@ximian.com>
15338 * delegate.cs: Style.
15340 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
15342 * delegate.cs: Add seperate instance expr field for miguel.
15344 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
15346 * PointerArithmetic (Resolve): make sure we are not doing
15347 pointer arith on void*. Also, make sure we are resolved
15348 by not setting eclass until resolve.
15350 All callers: Make sure that PointerArithmetic gets resolved.
15352 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
15354 * ArrayCreation (LookupType): If the type does not resolve
15355 to an array, give an error.
15357 2004-08-27 Marek Safar <marek.safar@seznam.cz>
15359 * statement.cs (Try.Resolve): Fixed bug #64222
15361 2004-08-27 Martin Baulig <martin@ximian.com>
15364 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
15367 2004-08-26 Marek Safar <marek.safar@seznam.cz>
15369 * ecore.cs (Constantify): Get underlying type via
15370 System.Enum.GetUnderlyingType to avoid StackOverflow on the
15371 Windows in special cases.
15373 2004-08-26 Marek Safar <marek.safar@seznam.cz>
15375 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
15376 for obtaining also private methods.
15377 (GetRemoveMethod): Used GetRemoveMethod (true)
15378 for obtaining also private methods.
15380 2004-08-24 Martin Baulig <martin@ximian.com>
15382 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
15383 MethodAttributes.HideBySig for operators.
15385 2004-08-23 Martin Baulig <martin@ximian.com>
15387 Back to the old error reporting system :-)
15389 * report.cs (Message): Removed.
15390 (Report.MessageData, ErrorData, WarningData): Removed.
15391 (Report.Error, Warning): Back to the old system.
15393 2004-08-23 Martin Baulig <martin@ximian.com>
15395 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
15397 * class.cs (TypeContainer.ParentContainer): New public virtual
15398 method; replaces the explicit interface implementation.
15399 (ClassPart.ParentContainer): Override.
15401 2004-08-23 Martin Baulig <martin@ximian.com>
15403 * statement.cs (Switch): Added support for constant switches; see
15404 #59428 or test-285.cs.
15406 2004-08-22 Marek Safar <marek.safar@seznam.cz>
15409 * statement.cs (GetEnumeratorFilter): Removed useless
15410 logic because C# specs is strict. GetEnumerator must be
15413 2004-08-22 Martin Baulig <martin@ximian.com>
15415 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15416 a switch and may break, reset the barrier. Fixes #59867.
15418 2004-08-22 Marek Safar <marek.safar@seznam.cz>
15420 CLS-Compliance speed up (~5% for corlib)
15422 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
15423 New method. Tests container for CLS-Compliant names
15425 * class.cs (TypeContainer.VerifyClsName): New method.
15426 Checks whether container name is CLS Compliant.
15427 (Constructor): Implements IMethodData.
15429 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
15430 low-case table for CLS Compliance test.
15431 (MemberCache.VerifyClsParameterConflict): New method.
15432 Checks method parameters for CS3006 error.
15434 * enum.cs (EnumMember): Is derived from MemberCore.
15435 (Enum.VerifyClsName): Optimized for better performance.
15437 2004-08-06 Marek Safar <marek.safar@seznam.cz>
15439 * report.cs: Renamed Error_T to Error and changed all
15442 2004-08-06 Marek Safar <marek.safar@seznam.cz>
15444 * class.cs (TypeContainer.IndexerArrayList): New inner class
15445 container for indexers.
15446 (TypeContainer.DefaultIndexerName): New constant for default
15447 indexer name. Replaced all "Item" with this constant.
15448 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
15450 * typemanager.cs (TypeManager.default_member_ctor): Cache here
15451 DefaultMemberAttribute constructor.
15453 2004-08-05 Martin Baulig <martin@ximian.com>
15455 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
15458 2004-08-05 Marek Safar <marek.safar@seznam.cz>
15460 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
15461 multi platforms problem.
15463 * compiler.csproj: Included shared files.
15465 2004-08-04 Marek Safar <marek.safar@seznam.cz>
15467 Fix bug 60333, 55971 in the more general way
15468 * attribute.cs (Attribute.GetAttributeArgumentExpression):
15469 Added arg_type argument for constant conversion.
15470 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
15472 2004-08-04 Marek Safar <marek.safar@seznam.cz>
15475 * class.cs (TypeContainer ): New inner classes MethodArrayList,
15476 OperatorArrayList, MethodCoreArrayList for typecontainer
15477 containers. Changed class member types to these new types.
15478 (MethodArrayList.DefineMembers): Added test for CS0659.
15480 2004-08-04 Miguel de Icaza <miguel@ximian.com>
15482 * cfold.cs: Synchronize the folding with the code in expression.cs
15483 Binary.DoNumericPromotions for uint operands.
15485 * attribute.cs: Revert patch from Raja, it introduced a regression
15486 while building Blam-1.2.1 (hard to isolate a test case).
15488 2004-08-04 Marek Safar <marek.safar@seznam.cz>
15492 (TypeContainer.Define): Renamed to DefineContainerMembers because of
15494 (MethodCore.parent_method): New member. The method we're overriding
15495 if this is an override method.
15496 (MethodCore.CheckBase): Moved from Method class and made common.
15497 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
15499 (MethodCore.CheckForDuplications): New abstract method. For custom
15500 member duplication search in a container
15501 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
15502 method and its return type.
15503 (Event.conflict_symbol): New member. Symbol with same name in the
15507 (MemberCache.FindMemberWithSameName): New method. The method
15508 is looking for conflict with inherited symbols.
15510 2004-08-04 Martin Baulig <martin@ximian.com>
15512 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
15514 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
15516 2004-08-03 Marek Safar <marek.safar@seznam.cz>
15518 * report.cs (Message): New enum for better error, warning reference in
15520 (MessageData): New inner abstract class. It generally handles printing of
15521 error and warning messages.
15522 Removed unused Error, Warning, Message methods.
15524 2004-08-03 Marek Safar <marek.safar@seznam.cz>
15526 Fix for cs0592-8.cs test
15528 (Attributable.ValidAttributeTargets): Made public.
15529 (Attribute.ExplicitTarget): New member for explicit target value.
15530 (Attribute.CheckTargets): Now we translate explicit attribute
15531 target to Target here.
15533 2004-08-03 Ben Maurer <bmaurer@ximian.com>
15535 * ecore.cs (MethodGroupExpr): new IsBase property.
15537 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
15539 * delegate.cs (DelegateCreation): store a MethodGroupExpr
15540 rather than an instance expr.
15542 (DelegateCreation.Emit): Use the method group rather than
15543 the instance expression. Also, if you have base.Foo as the
15544 method for a delegate, make sure to emit ldftn, not ldftnvirt.
15546 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
15548 (NewDelegate.DoResolve): Only check for the existance of Invoke
15549 if the method is going to be needed. Use MethodGroupExpr.
15551 (NewDelegate.Emit): Remove, DelegateCreation implements this.
15553 * expression.cs: For pointer arith., make sure to use
15554 the size of the type, not the size of the pointer to
15557 2004-08-03 Marek Safar <marek.safar@seznam.cz>
15560 * class.cs (Class): Added error CS0502 test.
15562 2004-08-03 John Luke <jluke@cfl.rr.com>
15563 Raja R Harinath <rharinath@novell.com>
15566 * attribute.cs (Attribute.complained_before): New flag.
15567 (Attribute.ResolveType, Attribute.Resolve),
15568 (Attribute.DefinePInvokeMethod): Set it.
15569 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
15571 2004-08-03 Martin Baulig <martin@ximian.com>
15573 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
15574 use a user-defined operator; we still need to do numeric
15575 promotions in case one argument is a builtin type and the other
15576 one has an implicit conversion to that type. Fixes #62322.
15578 2004-08-02 Martin Baulig <martin@ximian.com>
15580 * statement.cs (LocalInfo.Flags): Added `IsThis'.
15581 (LocalInfo.IsThis): New public property.
15582 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
15584 2004-08-01 Martin Baulig <martin@ximian.com>
15586 * class.cs (TypeContainer.GetClassBases): Don't set the default
15587 here since we may get called from GetPartialBases().
15588 (TypeContainer.DefineType): If GetClassBases() didn't return a
15589 parent, use the default one.
15591 2004-07-30 Duncan Mak <duncan@ximian.com>
15593 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
15595 2004-07-30 Martin Baulig <martin@ximian.com>
15597 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
15599 * class.cs (SourceMethod): New public class, derive from the
15600 symbol writer's ISourceMethod.
15601 (Method): Use the new symbol writer API.
15603 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
15604 as argument and use the new symbol writer.
15607 (SourceFile): Implement the symbol writer's ISourceFile.
15608 (Location.SymbolDocument): Removed.
15609 (Location.SourceFile): New public property.
15611 * symbolwriter.cs: Use the new symbol writer API.
15613 2004-07-30 Raja R Harinath <rharinath@novell.com>
15615 * Makefile (install-local): Remove. Functionality moved to
15618 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
15620 * Makefile: Install mcs.exe.config file together with mcs.exe.
15621 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
15622 correct runtime version.
15624 2004-07-25 Martin Baulig <martin@ximian.com>
15627 (TypeContainer.RegisterOrder): Removed, this was unused.
15628 (TypeContainer, interface_order): Removed.
15629 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
15630 TypeContainer as argument since we can also be called with a
15631 `PartialContainer' for a partial class/struct/interface.
15632 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
15633 of checking whether we're an `Interface' - we could be a
15634 `PartialContainer'.
15635 (PartialContainer.Register): Override; call
15636 AddClass()/AddStruct()/AddInterface() on our parent.
15638 * cs-parser.jay (interface_member_declaration): Add things to the
15639 `current_container', not the `current_class'.
15641 * rootcontext.cs (RegisterOrder): The overloaded version which
15642 takes an `Interface' was unused, removed.
15644 * typemanager.cs (TypeManager.LookupInterface): Return a
15645 `TypeContainer', not an `Interface'.
15646 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
15647 contain a `PartialContainer' for an interface, so check it's
15648 `Kind' to figure out what it is.
15650 2004-07-25 Martin Baulig <martin@ximian.com>
15652 * class.cs (Class.DefaultTypeAttributes): New public constant.
15653 (Struct.DefaultTypeAttributes): Likewise.
15654 (Interface.DefaultTypeAttributes): Likewise.
15655 (PartialContainer.TypeAttr): Override this and add the
15656 DefaultTypeAttributes.
15658 2004-07-25 Martin Baulig <martin@ximian.com>
15660 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
15661 we can just use the `Parent' field instead.
15663 2004-07-25 Martin Baulig <martin@ximian.com>
15665 * class.cs (TypeContainer.Emit): Renamed to EmitType().
15667 2004-07-25 Martin Baulig <martin@ximian.com>
15669 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
15670 our parts before defining any methods.
15671 (TypeContainer.VerifyImplements): Make this virtual.
15672 (ClassPart.VerifyImplements): Override and call VerifyImplements()
15673 on our PartialContainer.
15675 2004-07-25 Martin Baulig <martin@ximian.com>
15677 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
15679 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
15680 argument, we can just use the `Parent' field instead.
15683 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
15684 (MemberBase.DoDefine): Likewise.
15686 2004-07-24 Martin Baulig <martin@ximian.com>
15688 * decl.cs (MemberCore.Parent): New public field.
15689 (DeclSpace.Parent): Moved to MemberCore.
15691 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
15692 (MemberBase.ctor): Added TypeContainer argument, pass it to our
15694 (FieldBase, Field, Operator): Likewise.
15695 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
15696 (EventField, Event): Likewise.
15698 2004-07-23 Martin Baulig <martin@ximian.com>
15700 * class.cs (PartialContainer): New public class.
15701 (ClassPart): New public class.
15702 (TypeContainer): Added support for partial classes.
15703 (TypeContainer.GetClassBases): Splitted some of the functionality
15704 out into GetNormalBases() and GetPartialBases().
15706 * cs-tokenizer.cs (Token.PARTIAL): New token.
15707 (Tokenizer.consume_identifier): Added some hacks to recognize
15708 `partial', but only if it's immediately followed by `class',
15709 `struct' or `interface'.
15711 * cs-parser.jay: Added support for partial clases.
15713 2004-07-23 Martin Baulig <martin@ximian.com>
15715 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
15716 a `DeclSpace' and also made it readonly.
15717 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
15718 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
15719 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
15721 * cs-parser.jay: Pass the `current_class', not the
15722 `current_container' (at the moment, this is still the same thing)
15723 to a new Method, Property, Event, Indexer or Constructor.
15725 2004-07-23 Martin Baulig <martin@ximian.com>
15727 * cs-parser.jay (CSharpParser): Added a new `current_class' field
15728 and removed the `current_interface' one.
15729 (struct_declaration, class_declaration, interface_declaration):
15730 Set `current_class' to the newly created class/struct/interface;
15731 set their `Bases' and call Register() before parsing their body.
15733 2004-07-23 Martin Baulig <martin@ximian.com>
15735 * class.cs (Kind): New public enum.
15736 (TypeContainer): Made this class abstract.
15737 (TypeContainer.Kind): New public readonly field.
15738 (TypeContainer.CheckDef): New public method; moved here from
15740 (TypeContainer.Register): New public abstract method.
15741 (TypeContainer.GetPendingImplementations): New public abstract
15743 (TypeContainer.GetClassBases): Removed the `is_class' and
15744 `is_iface' parameters.
15745 (TypeContainer.DefineNestedTypes): Formerly known as
15747 (ClassOrStruct): Made this class abstract.
15749 * tree.cs (RootTypes): New public type.
15751 2004-07-20 Martin Baulig <martin@ximian.com>
15753 * tree.cs (Tree.RecordNamespace): Removed.
15754 (Tree.Namespaces): Removed.
15756 * rootcontext.cs (RootContext.IsNamespace): Removed.
15758 * cs-parser.jay (namespace_declaration): Just create a new
15759 NamespaceEntry here.
15761 2004-07-20 Martin Baulig <martin@ximian.com>
15763 * statement.cs (ExceptionStatement): New abstract class. This is
15764 now used as a base class for everyone who's using `finally'.
15765 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
15766 our local variables before using them.
15768 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
15769 virtual method. This is used by Yield.Resolve() to "steal" an
15770 outer block's `finally' clauses.
15771 (FlowBranchingException): The .ctor now takes an ExceptionStatement
15774 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
15775 version which takes an ExceptionStatement. This version must be
15776 used to create exception branchings.
15779 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
15780 (Iterator.EmitMoveNext): Added exception support; protect the
15781 block with a `fault' clause, properly handle 'finally' clauses.
15782 (Iterator.EmitDispose): Run all the `finally' clauses here.
15784 2004-07-20 Martin Baulig <martin@ximian.com>
15786 * iterator.cs: This is the first of a set of changes in the
15787 iterator code. Match the spec more closely: if we're an
15788 IEnumerable, then GetEnumerator() must be called. The first time
15789 GetEnumerator() is called, it returns the current instance; all
15790 subsequent invocations (if any) must create a copy.
15792 2004-07-19 Miguel de Icaza <miguel@ximian.com>
15794 * expression.cs: Resolve the constant expression before returning
15797 2004-07-19 Martin Baulig <martin@ximian.com>
15799 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
15800 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
15801 the return type of the new EmitContext.
15803 2004-07-18 Martin Baulig <martin@ximian.com>
15805 * class.cs (Property.Define): Fix iterators.
15807 * iterators.cs (Iterator.Define): Moved the
15808 `container.AddInterator (this)' call here from the .ctor; only do
15809 it if we resolved successfully.
15811 2004-07-17 Miguel de Icaza <miguel@ximian.com>
15813 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
15814 `true' for preprocessing directives that we parse. The return
15815 value indicates whether we should return to regular tokenizing or
15816 not, not whether it was parsed successfully.
15818 In the past if we were in: #if false ... #line #endif, we would
15819 resume parsing after `#line'. See bug 61604.
15821 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
15822 building: IsEnumType should return true only for enums, not for
15823 enums or System.Enum itself. This fixes #61593.
15825 Likely what happened is that corlib was wrong: mcs depended on
15826 this bug in some places. The bug got fixed, we had to add the
15827 hack, which caused bug 61593.
15829 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
15830 that was a workaround for the older conditions.
15832 2004-07-16 Ben Maurer <bmaurer@ximian.com>
15834 * assign.cs: IAssignMethod has a new interface, as documented
15835 inline. All assignment code now uses this new api.
15837 * ecore.cs, expression.cs: All classes which implement
15838 IAssignMethod now use the new interface.
15840 * expression.cs (Invocation): add a hack to EmitCall so that
15841 IndexerAccess can be the target of a compound assignment without
15842 evaluating its arguments twice.
15844 * statement.cs: Handle changes in Invocation api.
15846 2004-07-16 Martin Baulig <martin@ximian.com>
15848 * iterators.cs: Rewrote this. We're now using one single Proxy
15849 class for both the IEnumerable and the IEnumerator interface and
15850 `Iterator' derives from Class so we can use the high-level API.
15852 * class.cs (TypeContainer.AddIterator): New method.
15853 (TypeContainer.DoDefineType): New protected virtual method, which
15854 is called from DefineType().
15855 (TypeContainer.DoDefineMembers): Call DefineType() and
15856 DefineMembers() on all our iterators.
15857 (TypeContainer.Emit): Call Emit() on all our iterators.
15858 (TypeContainer.CloseType): Call CloseType() on all our iterators.
15860 * codegen.cs (EmitContext.CurrentIterator): New public field.
15862 2004-07-15 Martin Baulig <martin@ximian.com>
15865 (TypeManager.not_supported_exception_type): New type.
15867 2004-07-14 Martin Baulig <martin@ximian.com>
15869 * iterators.cs: Use real error numbers.
15871 2004-07-14 Martin Baulig <martin@ximian.com>
15873 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
15874 requires this to be a System.Collection.IEnumerable and not a
15875 class implementing that interface.
15876 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
15878 2004-07-13 Marek Safar <marek.safar@seznam.cz>
15880 * class.cs: Fixed previous fix, it broke some error tests.
15882 2004-07-12 Martin Baulig <martin@ximian.com>
15884 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
15887 2004-07-09 Miguel de Icaza <miguel@ximian.com>
15889 * assign.cs (LocalTemporary): Add new argument: is_address,If
15890 `is_address' is true, then the value that we store is the address
15891 to the real value, and not the value itself.
15893 * ecore.cs (PropertyExpr): use the new local temporary
15894 stuff to allow us to handle X.Y += z (where X is a struct)
15896 2004-07-08 Martin Baulig <martin@ximian.com>
15898 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
15899 not always return, just like we're doing in Using.Resolve().
15901 2004-07-07 Miguel de Icaza <miguel@ximian.com>
15903 * cs-parser.jay (fixed_statement): flag this as Pinned.
15905 2004-07-06 Miguel de Icaza <miguel@ximian.com>
15907 * typemanager.cs (TypeManager): Removed MakePinned method, this
15908 mechanism is replaced with the .NET 2.x compatible mechanism of
15909 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
15911 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
15912 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
15913 `IsFixed' property which has a different meaning.
15915 2004-07-02 Raja R Harinath <rharinath@novell.com>
15917 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
15918 visible from inside a nested class, not just the names of the
15919 immediately enclosing class.
15920 Fix for bug #60730.
15922 2004-06-24 Raja R Harinath <rharinath@novell.com>
15924 * expression.cs (BetterConversion): Remove buggy special-case
15925 handling of "implicit constant expression conversions". At this
15926 point, we already know that the conversion is possible -- we're
15927 only checking to see which is better.
15929 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15931 * cs-parser.jay: Added error CS0210 test.
15933 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15935 * cs-parser.jay: Added error CS0134 test.
15937 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15940 * cs-parser.jay: Added error CS0145 test.
15942 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15944 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
15946 2004-06-23 Ben Maurer <bmaurer@ximian.com>
15948 * expression.cs (StackAlloc.Resolve): The argument may not
15949 be a constant; deal with this case.
15951 2004-06-23 Marek Safar <marek.safar@seznam.cz>
15953 * attribute.cs (IndexerName_GetIndexerName): Renamed to
15954 GetIndexerAttributeValue.
15955 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
15957 * class.cs (Indexer.Define): Added error tests for CS0415,
15960 2004-06-23 Miguel de Icaza <miguel@ximian.com>
15962 * attribute.cs (Attribute.Resolve): Keep field code in sync with
15965 2004-06-23 Martin Baulig <martin@ximian.com>
15967 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
15968 neither return nor throw, reset the barrier as well. Fixes #60457.
15970 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
15972 * class.cs : EventAttributes is now set to None by default.
15973 This fixes bug #60459.
15975 2004-06-18 Marek Safar <marek.safar@seznam.cz>
15978 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15979 Don't throw exception but return null (it's sufficient now).
15981 2004-06-18 Marek Safar <marek.safar@seznam.cz>
15983 * typemanager.cs (GetArgumentTypes): Faster implementation.
15985 2004-06-18 Martin Baulig <martin@ximian.com>
15987 * attribute.cs (Attribute.Resolve): Check whether we're an
15988 EmptyCast which a Constant child. Fixes #60333.
15990 2004-06-17 Ben Maurer <bmaurer@ximian.com>
15992 * statement.cs (EmitCollectionForeach): Account for the fact that
15993 not all valuetypes are in areas which we can take the address of.
15994 For these variables, we store to a temporary variable. Also, make
15995 sure that we dont emit a `callvirt' on a valuetype method.
15997 2004-06-15 Marek Safar <marek.safar@seznam.cz>
15999 * expression.cs (StackAlloc.DoReSolve): Added test for
16000 negative parameter (CS0247).
16002 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16005 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
16007 2004-06-15 Marek Safar <marek.safar@seznam.cz>
16010 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
16013 2004-06-14 Marek Safar <marek.safar@seznam.cz>
16015 Fix bug #58254 & cs1555.cs, cs1556.cs
16016 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
16018 2004-06-14 Marek Safar <marek.safar@seznam.cz>
16020 * cs-parser.jay: Added error CS1669 test for indexers.
16022 2004-06-11 Martin Baulig <martin@ximian.com>
16024 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
16025 call this twice: for params and varargs methods.
16027 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16030 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
16032 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16034 * attribute.cs (Attribute.GetValidTargets): Made public.
16037 (AbstractPropertyEventMethod): New class for better code sharing.
16038 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
16040 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
16042 2004-06-11 Raja R Harinath <rharinath@novell.com>
16045 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
16046 that the call to Resolve is part of a MemberAccess.
16047 (Expression.Resolve): Use it for SimpleName resolution.
16048 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
16049 Add 'intermediate' boolean argument.
16050 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
16051 error message when the SimpleName can be resolved ambiguously
16052 between an expression and a type.
16053 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
16055 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
16056 call on the left-side.
16058 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16061 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
16063 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16065 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
16067 2004-06-11 Martin Baulig <martin@ximian.com>
16069 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
16070 varargs methods if applicable.
16072 2004-06-11 Martin Baulig <martin@ximian.com>
16074 * expression.cs (Invocation.EmitCall): Don't use
16075 `method.CallingConvention == CallingConventions.VarArgs' since the
16076 method could also have `CallingConventions.HasThis'.
16078 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16080 * class.cs (Event.GetSignatureForError): Implemented.
16081 Fixed crash in error test cs3010.cs
16083 2004-06-10 Miguel de Icaza <miguel@ximian.com>
16085 * cs-tokenizer.cs: Change the way we track __arglist to be
16086 consistent with the other keywords.
16088 2004-06-09 Miguel de Icaza <miguel@ximian.com>
16090 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
16093 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
16095 * codegen.cs: Check that all referenced assemblies have a strongname
16096 before strongnaming the compiled assembly. If not report error CS1577.
16097 Fix bug #56563. Patch by Jackson Harper.
16098 * typemanager.cs: Added a method to return all referenced assemblies.
16099 Fix bug #56563. Patch by Jackson Harper.
16101 2004-06-08 Marek Safar <marek.safar@seznam.cz>
16104 (Method.ApplyAttributeBuilder): Moved and added conditional
16105 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
16108 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
16110 2004-06-08 Marek Safar <marek.safar@seznam.cz>
16113 * class.cs: (EventField.attribute_targets): Changed default target.
16115 2004-06-08 Martin Baulig <martin@ximian.com>
16117 * expression.cs (Invocation.EmitCall): Enable varargs methods.
16119 2004-06-08 Martin Baulig <martin@ximian.com>
16121 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
16123 2004-06-07 Martin Baulig <martin@ximian.com>
16125 Added support for varargs methods.
16127 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
16130 * cs-parser.jay: Added support for `__arglist'.
16132 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
16134 * expression.cs (Argument.AType): Added `ArgList'.
16135 (Invocation): Added support for varargs methods.
16136 (ArglistAccess): New public class.
16137 (Arglist): New public class.
16139 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
16141 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
16142 a method's top-level block if the method has varargs.
16144 * support.cs (ReflectionParameters, InternalParameters): Added
16145 support for varargs methods.
16147 2004-06-07 Miguel de Icaza <miguel@ximian.com>
16149 * class.cs: Provide location in indexer error report.
16151 * driver.cs: Use standard names.
16153 * namespace.cs: Catch the use of using after a namespace has been
16154 declared also on using aliases.
16156 2004-06-03 Raja R Harinath <rharinath@novell.com>
16159 * typemanager.cs (closure_private_ok, closure_invocation_type)
16160 (closure_qualifier_type, closure_invocation_assembly)
16161 (FilterWithClosure): Move to ...
16162 (Closure): New internal nested class.
16163 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
16164 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
16165 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
16166 (MemberLookup, MemberLookupFailed): Use it.
16167 * expression.cs (New.DoResolve): Treat the lookup for the
16168 constructor as being qualified by the 'new'ed type.
16169 (Indexers.GetIndexersForTypeOrInterface): Update.
16171 2004-06-03 Marek Safar <marek.safar@seznam.cz>
16174 (GetConditionalAttributeValue): New method. Returns
16175 condition of ConditionalAttribute.
16176 (SearchMulti): New method. Returns all attributes of type 't'.
16177 Use it when attribute is AllowMultiple = true.
16178 (IsConditionalMethodExcluded): New method.
16181 (Method.IsExcluded): Implemented. Returns true if method has conditional
16182 attribute and the conditions is not defined (method is excluded).
16183 (IMethodData): Extended interface for ConditionalAttribute support.
16184 (PropertyMethod.IsExcluded): Implemented.
16187 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
16190 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
16193 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
16195 * expression.cs (ArrayCreationExpression): Make this just an
16196 `expression'. It can't be a statement, so the code here was
16199 2004-06-02 Marek Safar <marek.safar@seznam.cz>
16202 * typemanager.cs (GetFullNameSignature): New method for
16205 2004-06-02 Marek Safar <marek.safar@seznam.cz>
16208 * class.cs (MemberBase.GetSignatureForError): New virtual method.
16209 Use this method when MethodBuilder is null.
16210 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
16211 Added test for error CS0626 (MONO reports error for this situation).
16212 (IMethodData.GetSignatureForError): Extended interface.
16214 2004-06-01 Marek Safar <marek.safar@seznam.cz>
16217 (AttributeTester.GetObsoleteAttribute): Returns instance of
16218 ObsoleteAttribute when type is obsolete.
16221 (TypeContainer.VerifyObsoleteAttribute): Override.
16222 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
16223 (MethodCode.VerifyObsoleteAttribute): Override.
16224 (MemberBase.VerifyObsoleteAttribute): Override.
16227 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
16228 and report proper error.
16231 Delegate.VerifyObsoleteAttribute): Override.
16234 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
16235 and report proper error.
16236 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
16239 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
16243 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
16244 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
16245 Added test for ObsoleteAttribute.
16248 (Catch): Derived from Statement.
16250 2004-06-01 Marek Safar <marek.safar@seznam.cz>
16252 Fixed bug #59071 & cs0160.cs
16254 * statement.cs (Try.Resolve): Check here whether order of catch
16255 clauses matches their dependencies.
16257 2004-05-31 Miguel de Icaza <miguel@ximian.com>
16259 * Reverted patch to namespace.cs (Use lookuptypedirect). This
16260 caused a regression: #59343. Referencing nested classes from an
16261 assembly stopped working.
16263 2004-05-31 Martin Baulig <martin@ximian.com>
16265 MCS is now frozen for beta 2.
16267 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16269 * convert.cs: add a trivial cache for overload operator resolution.
16271 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16273 * decl.cs: If possible, use lookuptypedirect here. We can only do
16274 this if there is no `.' after the namespace. Avoids using
16275 LookupType, which does lots of slow processing.
16276 (FindNestedType) New method, does what it says :-).
16277 * namespace.cs: use LookupTypeDirect.
16278 * rootcontext.cs: use membercache, if possible.
16279 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
16281 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16284 According to the spec,
16286 In a member access of the form E.I, if E is a single identifier,
16287 and if the meaning of E as a simple-name (§7.5.2) is a constant,
16288 field, property, localvariable, or parameter with the same type as
16289 the meaning of E as a type-name (§3.8), then both possible
16290 meanings of E are permitted.
16292 We did not check that E as a simple-name had the same type as E as
16295 This trivial check gives us 5-7% on bootstrap time.
16297 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16299 * expression.cs (Invocation.OverloadResolve): Avoid the
16300 use of hashtables and boxing here by allocating on demand.
16302 2004-05-30 Martin Baulig <martin@ximian.com>
16304 * rootcontext.cs (RootContext.LookupType): Don't cache things if
16305 we're doing a silent lookup. Don't try to lookup nested types in
16306 TypeManager.object_type (thanks to Ben Maurer).
16308 2004-05-30 Martin Baulig <martin@ximian.com>
16310 Committing a patch from Ben Maurer.
16312 * rootcontext.cs (RootContext.LookupType): Cache negative results.
16314 2004-05-29 Martin Baulig <martin@ximian.com>
16316 * class.cs (IMethodData.ShouldIgnore): New method.
16318 * typemanager.cs (TypeManager.MethodFlags): Don't take a
16319 `Location' argument, we don't need it anywhere. Use
16320 `IMethodData.ShouldIgnore ()' instead of
16321 `MethodData.GetMethodFlags ()'.
16322 (TypeManager.AddMethod): Removed.
16323 (TypeManager.AddMethod2): Renamed to AddMethod.
16325 2004-05-29 Martin Baulig <martin@ximian.com>
16327 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
16329 * convert.cs (Convert.ImplicitReferenceConversion): If we're
16330 converting from a class type S to an interface type and we already
16331 have an object on the stack, don't box it again. Fixes #52578.
16333 2004-05-29 Martin Baulig <martin@ximian.com>
16335 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16336 Added support for `params' parameters. Fixes #59267.
16338 2004-05-29 Martin Baulig <martin@ximian.com>
16340 * literal.cs (NullPointer): Provide a private .ctor which sets
16341 `type' to TypeManager.object_type. Fixes #59048.
16343 2004-05-29 Martin Baulig <martin@ximian.com>
16345 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
16346 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
16348 * ecore.cs (EventExpr.instance_expr): Make the field private.
16350 2004-05-26 Marek Safar <marek.safar@seznam.cz>
16352 Fixed bug #50080 & cs0214-2.cs
16353 * expression.cs (Cast.DoResolve): Check unsafe context here.
16355 * statement.cs (Resolve.DoResolve): Likewise.
16357 2004-05-26 Martin Baulig <martin@ximian.com>
16359 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
16361 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
16362 (RootContext.LookupType): Pass down the `silent' flag.
16364 2004-05-25 Martin Baulig <martin@ximian.com>
16367 (MethodGroupExpr.IdenticalTypeName): New public property.
16368 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
16369 expression actually refers to a type.
16371 2004-05-25 Martin Baulig <martin@ximian.com>
16373 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
16374 for #56176 and made it actually work.
16376 2004-05-25 Martin Baulig <martin@ximian.com>
16378 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
16379 (FieldExpr, PropertyExpr): Override and implement
16380 CacheTemporaries. Fixes #52279.
16382 2004-05-25 Miguel de Icaza <miguel@ximian.com>
16384 * location.cs: In the new compiler listing a file twice is a
16385 warning, not an error.
16387 2004-05-24 Martin Baulig <martin@ximian.com>
16389 * enum.cs (Enum.DefineType): For the `BaseType' to be a
16390 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
16392 2004-05-24 Martin Baulig <martin@ximian.com>
16394 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
16395 walking the `using' list. Fixes #53921.
16397 2004-05-24 Martin Baulig <martin@ximian.com>
16399 * const.cs (Const.LookupConstantValue): Added support for
16400 EmptyCast's; fixes #55251.
16402 2004-05-24 Martin Baulig <martin@ximian.com>
16404 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
16405 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
16406 which does the CS0135 check. The reason is that we first need to
16407 check whether the variable actually exists.
16409 2004-05-24 Martin Baulig <martin@ximian.com>
16411 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
16412 than RootContext.LookupType() to find the explicit interface
16413 type. Fixes #58584.
16415 2004-05-24 Raja R Harinath <rharinath@novell.com>
16417 * Makefile: Simplify. Use executable.make.
16418 * mcs.exe.sources: New file. List of sources of mcs.exe.
16420 2004-05-24 Anders Carlsson <andersca@gnome.org>
16424 Use the invariant culture when doing String.Compare for CLS case
16427 2004-05-23 Martin Baulig <martin@ximian.com>
16429 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
16430 don't have any dots. Fixes #52622, added cs0246-8.cs.
16432 * namespace.cs (NamespaceEntry.Lookup): Likewise.
16434 2004-05-23 Marek Safar <marek.safar@seznam.cz>
16436 * class.cs (MemberBase.Define): Reuse MemberType member for
16437 resolved type. Other methods can use it too.
16439 2004-05-23 Martin Baulig <martin@ximian.com>
16441 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
16442 the variable also exists in the current block (otherwise, we need
16443 to report a CS0103). Fixes #58670.
16445 2004-05-23 Martin Baulig <martin@ximian.com>
16447 * flowanalysis.cs (Reachability.Reachable): Compute this
16448 on-the-fly rather than storing it as a field.
16450 2004-05-23 Martin Baulig <martin@ximian.com>
16452 * flowanalysis.cs (Reachability.And): Manually compute the
16453 resulting `barrier' from the reachability.
16455 2004-05-23 Marek Safar <marek.safar@seznam.cz>
16458 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
16459 instance of ObsoleteAttribute when symbol is obsolete.
16462 (IMethodData): Extended interface for ObsoleteAttribute support.
16464 2004-05-22 Marek Safar <marek.safar@seznam.cz>
16466 * attribute.cs: Fix bug #55970
16468 2004-05-22 Marek Safar <marek.safar@seznam.cz>
16472 (GetObsoleteAttribute): New method. Creates the instance of
16474 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
16475 ObsoleteAttribute when member is obsolete.
16476 (AttributeTester.Report_ObsoleteMessage): Common method for
16477 Obsolete error/warning reporting.
16480 (TypeContainer.base_classs_type): New member for storing parent type.
16483 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
16484 for this MemberCore.
16486 2004-05-21 Marek Safar <marek.safar@seznam.cz>
16488 * attribute.cs, const.cs: Fix bug #58590
16490 2004-05-21 Martin Baulig <martin@ximian.com>
16492 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
16493 out parameters if the end of the method is unreachable. Fixes
16496 2004-05-21 Marek Safar <marek.safar@seznam.cz>
16498 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
16499 Hari was right, why extra method.
16501 2004-05-21 Marek Safar <marek.safar@seznam.cz>
16503 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
16505 2004-05-20 Martin Baulig <martin@ximian.com>
16507 Merged this back from gmcs to keep the differences to a minumum.
16509 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
16510 instead of a Declspace.
16511 (Attribute.ResolveType): Likewise.
16512 (Attributes.Search): Likewise.
16513 (Attributes.Contains): Likewise.
16514 (Attributes.GetClsCompliantAttribute): Likewise.
16516 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
16518 (MethodData.ApplyAttributes): Take an EmitContext instead of a
16521 2004-05-19 Marek Safar <marek.safar@seznam.cz>
16523 Fix bug #58688 (MCS does not report error when the same attribute
16526 * attribute.cs (Attribute.Emit): Distinction between null and default.
16528 2004-05-19 Raja R Harinath <rharinath@novell.com>
16530 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
16531 of a top-level attribute without an attribute target.
16532 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
16534 (Attribute.Conditional_GetConditionName),
16535 (Attribute.Obsolete_GetObsoleteMessage): Update.
16536 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
16537 part of ScanForIndexerName.
16538 (Attribute.CanIgnoreInvalidAttribute): New function.
16539 (Attribute.ScanForIndexerName): Move to ...
16540 (Attributes.ScanForIndexerName): ... here.
16541 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
16542 (Attributes.Search): New internal variant that can choose not to
16543 complain if types aren't resolved. The original signature now
16545 (Attributes.GetClsCompliantAttribute): Use internal variant, with
16546 complaints suppressed.
16547 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
16548 only if it not useful.
16549 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
16550 top-level for attributes that are shared between the assembly
16551 and a top-level class.
16552 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
16553 * class.cs: Update to reflect changes.
16554 (DefineIndexers): Fuse loops.
16555 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
16556 a couple more variants of attribute names.
16558 2004-05-18 Marek Safar <marek.safar@seznam.cz>
16560 Fix bug #52585 (Implemented explicit attribute declaration)
16563 (Attributable.ValidAttributeTargets): New abstract method. It gets
16564 list of valid attribute targets for explicit target declaration.
16565 (Attribute.Target): It holds target itself.
16566 (AttributeSection): Removed.
16567 (Attribute.CheckTargets): New method. It checks whether attribute
16568 target is valid for the current element.
16571 (EventProperty): New class. For events that are declared like
16572 property (with add and remove accessors).
16573 (EventField): New class. For events that are declared like field.
16576 * cs-parser.jay: Implemented explicit attribute target declaration.
16578 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
16579 Override ValidAttributeTargets.
16582 (ReturnParameter): Class for applying custom attributes on
16584 (ParameterAtribute): New class. Class for applying custom
16585 attributes on the parameter type.
16587 2004-05-17 Miguel de Icaza <miguel@ximian.com>
16589 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
16592 (Method): Allow UNSAFE here.
16594 * modifiers.cs: Support unsafe reporting.
16596 2004-05-17 Marek Safar <marek.safar@seznam.cz>
16598 * decl.cs: Fix bug #58478.
16600 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16602 * statement.cs: When checking for unreachable code on an EmptyStatement,
16603 set the location. Fixes bug #58488.
16605 2004-05-13 Miguel de Icaza <miguel@ximian.com>
16607 * driver.cs: Add -pkg handling.
16609 From Gonzalo: UseShelLExecute=false
16611 2004-05-12 Marek Safar <marek.safar@seznam.cz>
16614 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
16616 (Attribute.IsClsCompliaceRequired): Moved to base for better
16618 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
16619 when attribute is AttributeUsageAttribute.
16620 (Attribute.GetValidTargets): Simplified.
16621 (Attribute.GetAttributeUsage): New method returns AttributeUsage
16622 attribute for this type.
16623 (Attribute.ApplyAttributes): Method renamed to Emit and make
16625 (GlobalAttributeSection): New class for special handling of global
16626 attributes (assembly, module).
16627 (AttributeSection.Emit): New method.
16629 * class.cs: Implemented Attributable abstract methods.
16630 (MethodCore.LabelParameters): Moved to Parameter class.
16631 (Accessor): Is back simple class.
16632 (PropertyMethod): Implemented Attributable abstract class.
16633 (DelegateMethod): Implemented Attributable abstract class.
16634 (Event): New constructor for disctintion between normal Event
16635 and Event with accessors.
16637 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
16639 * codegen.cs, const.cs, decl.cs, delegate.cs:
16640 (CommonAssemblyModulClass): Implemented Attributable abstract class
16643 * enum.cs: Implement IAttributeSupport interface.
16644 (EnumMember): New class for emum members. Implemented Attributable
16648 (ParameterBase): Is abstract.
16649 (ReturnParameter): New class for easier [return:] attribute handling.
16651 * typemanager.cs: Removed builder_to_attr.
16653 2004-05-11 Raja R Harinath <rharinath@novell.com>
16656 * attribute.cs (Attribute.GetPositionalValue): New function.
16657 * class.cs (TypeContainer.VerifyMembers): New function.
16658 (TypeContainer.Emit): Use it.
16659 (ClassOrStruct): New base class for Class and Struct.
16660 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
16661 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
16663 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
16664 then each non-static field should have a FieldOffset attribute.
16665 Otherwise, none of the fields should have a FieldOffset attribute.
16666 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
16667 and FieldOffset attributes.
16668 * typemanager.cs (TypeManager.struct_layout_attribute_type)
16669 (TypeManager.field_offset_attribute_type): New core types.
16670 (TypeManager.InitCoreTypes): Initialize them.
16672 2004-05-11 Michal Moskal <malekith@pld-linux.org>
16674 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
16675 Return correct type.
16678 2004-05-09 Miguel de Icaza <miguel@ximian.com>
16680 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
16681 be implicitly converted to ulong.
16683 * expression.cs: The logic for allowing operator &, | and ^ worked
16684 was wrong, it worked before because we did not report an error in
16685 an else branch. Fixes 57895.
16687 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
16688 allow volatile fields to be reference types.
16690 2004-05-07 Miguel de Icaza <miguel@ximian.com>
16692 * driver.cs: Add support for /debug-
16694 2004-05-07 Raja R Harinath <rharinath@novell.com>
16696 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
16697 Add a 'complain' parameter to silence errors.
16698 (Attribute.Resolve): Update to changes. Put in sanity check to catch
16699 silently overlooked type-resolutions.
16700 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
16701 to reflect changes.
16702 (Attributes.Search): New function.
16703 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
16704 (Attributes.GetAttributeFullName): Remove hack.
16705 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
16706 Update to reflect changes.
16707 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16708 Use Attributes.Search instead of nested loops.
16710 2004-05-07 Marek Safar <marek.safar@seznam.cz>
16713 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
16714 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
16715 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
16717 * report.cs: (Report.Warning): Renamed to Warning_T because of
16718 parameter collision.
16720 2004-05-05 Raja R Harinath <rharinath@novell.com>
16722 * expression.cs (MemberAccess.ResolveMemberAccess):
16723 Exit with non-zero status after Report.Error.
16724 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
16726 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
16728 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
16730 * support.cs: Don't hang when the file is empty.
16732 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
16734 * support.cs: In SeekableStreamReader, compute the preamble size of the
16735 underlying stream. Position changes should take into account that initial
16738 2004-05-03 Todd Berman <tberman@sevenl.net>
16740 * driver.cs: remove unused GetSysVersion function.
16742 2004-05-03 Todd Berman <tberman@sevenl.net>
16744 * driver.cs: Remove the hack from saturday, as well as the hack
16745 from jackson (LoadAssemblyFromGac), also adds the CWD to the
16746 link_paths to get that bit proper.
16748 2004-05-01 Todd Berman <tberman@sevenl.net>
16750 * driver.cs: Try a LoadFrom before a Load, this checks the current
16751 path. This is currently a bug in mono that is be fixed, however, this
16752 provides a workaround for now. This will be removed when the bug
16755 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
16757 * CryptoConvert.cs: Updated to latest version. Fix issue with
16758 incomplete key pairs (#57941).
16760 2004-05-01 Todd Berman <tberman@sevenl.net>
16762 * driver.cs: Remove '.' from path_chars, now System.* loads properly
16765 2004-04-30 Jackson Harper <jackson@ximian.com>
16767 * codegen.cs: Open keys readonly.
16769 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16771 * typemanager.cs: don't report cyclic struct layout when a struct
16772 contains 2 or more fields of the same type. Failed for Pango.AttrShape
16773 which has 2 Pango.Rectangle fields.
16775 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
16777 * expression.cs: Handle IntPtr comparisons with IL code
16778 rather than a method call.
16780 2004-04-29 Martin Baulig <martin@ximian.com>
16782 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
16783 the list of PropertyInfo's in class hierarchy and find the
16784 accessor. Fixes #56013.
16786 2004-04-29 Martin Baulig <martin@ximian.com>
16788 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
16790 2004-04-29 Martin Baulig <martin@ximian.com>
16792 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16794 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
16796 2004-04-29 Martin Baulig <martin@ximian.com>
16798 * class.cs (ConstructorInitializer.Resolve): Check whether the
16799 parent .ctor is accessible. Fixes #52146.
16801 2004-04-29 Martin Baulig <martin@ximian.com>
16803 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16805 * statement.cs (Using.EmitLocalVariableDecls): Use
16806 TypeManager.idisposable_type, not typeof (IDisposable).
16807 (Foreach.EmitCollectionForeach): Added support for valuetypes.
16809 2004-04-29 Martin Baulig <martin@ximian.com>
16811 * class.cs (Event.Define): Don't emit the field and don't set
16812 RTSpecialName and SpecialName for events on interfaces. Fixes
16815 2004-04-29 Raja R Harinath <rharinath@novell.com>
16817 Refactor Attribute.ApplyAttributes.
16818 * attribute.cs (Attributable): New base class for objects that can
16819 have Attributes applied on them.
16820 (Attribute): Make AttributeUsage fields public.
16821 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
16822 (Attribute.IsInternalCall): New property.
16823 (Attribute.UsageAttr): Convert to a public read-only property.
16824 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
16825 (Attribute.ResolveType, Attribute.Resolve)
16826 (Attribute.ScanForIndexerName): Update to reflect changes.
16827 (Attribute.CheckAttributeTarget): Re-format.
16828 (Attribute.ApplyAttributes): Refactor, to various
16829 Attributable.ApplyAttributeBuilder methods.
16830 * decl.cs (MemberCore): Make Attributable.
16831 * class.cs (Accessor): Make Attributable.
16832 (MethodData.ApplyAttributes): Use proper attribute types, not
16834 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
16835 (TypeContainer.ApplyAttributeBuilder)
16836 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
16837 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
16838 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
16839 (Operator.ApplyAttributeBuilder): New factored-out methods.
16840 * const.cs (Const.ApplyAttributeBuilder): Likewise.
16841 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
16842 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
16843 * parameter.cs (ParameterBase): New Attributable base class
16844 that can also represent Return types.
16845 (Parameter): Update to the changes.
16847 2004-04-29 Jackson Harper <jackson@ximian.com>
16849 * driver.cs: Prefer the corlib system version when looking for
16850 assemblies in the GAC. This is still a hack, but its a better hack
16853 2004-04-29 Marek Safar <marek.safar@seznam.cz>
16855 * decl.cs, enum.cs: Improved error 3005 reporting.
16857 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
16858 (related_symbols): New private member for list of symbols
16859 related to reported error/warning.
16861 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
16863 2004-04-29 Martin Baulig <martin@ximian.com>
16865 * ecore.cs (Expression.Constantify): If we're an enum and
16866 TypeManager.TypeToCoreType() doesn't give us another type, use
16867 t.UnderlyingSystemType. Fixes #56178.
16869 2004-04-29 Martin Baulig <martin@ximian.com>
16871 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
16872 interfaces and for each interface, only add members directly
16873 declared in that interface. Fixes #53255.
16875 2004-04-28 Martin Baulig <martin@ximian.com>
16877 * expression.cs (ConditionalLogicalOperator): Use a temporary
16878 variable for `left' to avoid that we evaluate it more than once;
16881 2004-04-28 Martin Baulig <martin@ximian.com>
16883 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
16886 2004-04-28 Martin Baulig <martin@ximian.com>
16888 * statement.cs (LocalInfo.Resolve): Check whether the type is not
16891 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
16892 whether the type is not void (CS1547).
16894 2004-04-28 Martin Baulig <martin@ximian.com>
16896 * expression.cs (Unary.DoResolveLValue): Override this and report
16897 CS0131 for anything but Operator.Indirection.
16899 2004-04-28 Martin Baulig <martin@ximian.com>
16901 Committing a patch from Ben Maurer; see bug #50820.
16903 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16906 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16909 2004-04-28 Martin Baulig <martin@ximian.com>
16911 Committing a patch from Ben Maurer; see bug #50820.
16913 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16916 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16919 2004-04-28 Martin Baulig <martin@ximian.com>
16921 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
16922 (Block.AddLabel): Call DoLookupLabel() to only search in the
16925 2004-04-28 Martin Baulig <martin@ximian.com>
16927 * cfold.cs (ConstantFold.BinaryFold): Added special support for
16928 comparing StringConstants and NullLiterals in Equality and Inequality.
16930 2004-04-28 Jackson Harper <jackson@ximian.com>
16932 * driver.cs: Attempt to load referenced assemblies from the
16933 GAC. This is the quick and dirty version of this method that
16934 doesnt take into account versions and just takes the first
16935 canidate found. Will be good enough for now as we will not have more
16936 then one version installed into the GAC until I update this method.
16938 2004-04-28 Martin Baulig <martin@ximian.com>
16940 * typemanager.cs (TypeManager.CheckStructCycles): New public
16941 static method to check for cycles in the struct layout.
16943 * rootcontext.cs (RootContext.PopulateTypes): Call
16944 TypeManager.CheckStructCycles() for each TypeContainer.
16945 [Note: We only need to visit each type once.]
16947 2004-04-28 Martin Baulig <martin@ximian.com>
16949 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
16951 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
16952 success and added `out object value'. Use a `bool resolved' field
16953 to check whether we've already been called rather than
16954 `ConstantValue != null' since this breaks for NullLiterals.
16956 2004-04-28 Raja R Harinath <rharinath@novell.com>
16958 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
16959 setting of this flag, since the 'set' method may be non-public.
16961 2004-04-28 Raja R Harinath <rharinath@novell.com>
16963 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
16964 check on current_vector.Block.
16966 2004-04-27 Martin Baulig <martin@ximian.com>
16968 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
16969 a field initializer. Fixes #56459.
16971 2004-04-27 Martin Baulig <martin@ximian.com>
16973 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
16974 we're not attempting to use an indexer. Fixes #52154.
16976 2004-04-27 Martin Baulig <martin@ximian.com>
16978 * statement.cs (Return): Don't create a return label if we don't
16979 need it; reverts my change from January 20th. Thanks to Ben
16982 2004-04-27 Martin Baulig <martin@ximian.com>
16984 According to the spec, `goto' can only leave a nested scope, but
16987 * statement.cs (Block.LookupLabel): Only lookup in the current
16988 block, don't recurse into parent or child blocks.
16989 (Block.AddLabel): Check in parent and child blocks, report
16990 CS0140/CS0158 if we find a duplicate.
16991 (Block): Removed this indexer for label lookups.
16992 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
16993 this already does the error reporting for us.
16996 (FlowBranching.UsageVector.Block): New public variable; may be null.
16997 (FlowBranching.CreateSibling): Added `Block' argument.
16998 (FlowBranching.LookupLabel): New public virtual method. Lookup a
16999 label for the target of a `goto' and check whether we're not
17000 leaving a `finally'.
17002 2004-04-27 Martin Baulig <martin@ximian.com>
17004 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17005 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
17008 2004-04-27 Martin Baulig <martin@ximian.com>
17010 * statement.cs (Block.AddLabel): Also check for implicit blocks
17011 and added a CS0158 check.
17013 2004-04-27 Martin Baulig <martin@ximian.com>
17015 * flowanalysis.cs (FlowBranchingLoop): New class.
17016 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
17017 UsageVector's instead of an ArrayList.
17018 (FlowBranching.Label): Likewise.
17019 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
17020 (FlowBranching.AddBreakVector): New method.
17022 2004-04-27 Miguel de Icaza <miguel@ximian.com>
17024 * attribute.cs: Small regression fix: only convert the type if we
17025 the type is different, fixes System.Drawing build.
17027 2004-04-27 Martin Baulig <martin@ximian.com>
17029 * attribute.cs (Attribute.Resolve): If we have a constant value
17030 for a named field or property, implicity convert it to the correct
17033 2004-04-27 Raja R Harinath <rharinath@novell.com>
17035 * statement.cs (Block.Block): Implicit blocks share
17036 'child_variable_names' fields with parent blocks.
17037 (Block.AddChildVariableNames): Remove.
17038 (Block.AddVariable): Mark variable as "used by a child block" in
17039 every surrounding block.
17040 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
17041 been used in a child block, complain about violation of "Invariant
17042 meaning in blocks" rule.
17043 * cs-parser.jay (declare_local_variables): Don't use
17044 AddChildVariableNames.
17045 (foreach_statement): Don't create an implicit block: 'foreach'
17046 introduces a scope.
17048 2004-04-23 Miguel de Icaza <miguel@ximian.com>
17050 * convert.cs (ImplicitNumericConversion): 0 is also positive when
17051 converting from 0L to ulong. Fixes 57522.
17053 2004-04-22 Marek Safar <marek.safar@seznam.cz>
17055 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
17056 derived class hides via 'new' keyword field from base class (test-242.cs).
17057 TODO: Handle this in the more general way.
17059 * class.cs (CheckBase): Ditto.
17061 2004-04-22 Marek Safar <marek.safar@seznam.cz>
17063 * decl.cs (caching_flags): New member for storing cached values
17065 (MemberCore.Flags): New enum where bit flags for caching_flags
17067 (MemberCore.cls_compliance): Moved to caching_flags.
17068 (DeclSpace.Created): Moved to caching_flags.
17070 * class.cs: Use caching_flags instead of DeclSpace.Created
17072 2004-04-21 Miguel de Icaza <miguel@ximian.com>
17074 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
17075 if we are only a derived class, not a nested class.
17077 * typemanager.cs: Same as above, but do this at the MemberLookup
17078 level (used by field and methods, properties are handled in
17079 PropertyExpr). Allow for the qualified access if we are a nested
17082 2004-04-21 Marek Safar <marek.safar@seznam.cz>
17084 * class.cs: Refactoring.
17085 (IMethodData): New inteface; Holds links to parent members
17086 to avoid member duplication (reduced memory allocation).
17087 (Method): Implemented IMethodData interface.
17088 (PropertyBase): New inner classes for get/set methods.
17089 (PropertyBase.PropertyMethod): Implemented IMethodData interface
17090 (Event): New inner classes for add/remove methods.
17091 (Event.DelegateMethod): Implemented IMethodData interface.
17093 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
17094 EmitContext (related to class.cs refactoring).
17096 2004-04-21 Raja R Harinath <rharinath@novell.com>
17098 * delegate.cs (Delegate.VerifyApplicability): If the number of
17099 arguments are the same as the number of parameters, first try to
17100 verify applicability ignoring any 'params' modifier on the last
17104 2004-04-16 Raja R Harinath <rharinath@novell.com>
17106 * class.cs (TypeContainer.AddIndexer): Use
17107 'ExplicitInterfaceName' to determine if interface name was
17108 explicitly specified. 'InterfaceType' is not initialized at this time.
17109 (TypeContainer.DefineIndexers): Remove use of temporary list. The
17110 Indexers array is already in the required order. Initialize
17111 'IndexerName' only if there are normal indexers.
17112 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
17113 (TypeContainer.Emit): Emit DefaultMember attribute only if
17114 IndexerName is initialized.
17117 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
17119 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
17122 2004-04-15 Raja R Harinath <rharinath@novell.com>
17124 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
17128 * attribute.cs (Attribute.Resolve): Check for duplicate named
17132 2004-04-15 Miguel de Icaza <miguel@ximian.com>
17134 * iterators.cs (MarkYield): track whether we are in an exception,
17135 and generate code accordingly. Use a temporary value to store the
17136 result for our state.
17138 I had ignored a bit the interaction of try/catch with iterators
17139 since their behavior was not entirely obvious, but now it is
17140 possible to verify that our behavior is the same as MS .NET 2.0
17144 2004-04-14 Miguel de Icaza <miguel@ximian.com>
17146 * iterators.cs: Avoid creating temporaries if there is no work to
17149 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
17150 Enumerations, use TypeManager.EnumToUnderlying and call
17153 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
17156 (This.Emit): Use EmitContext.EmitThis to emit our
17159 (This.EmitAssign): Ditto.
17161 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
17162 codepaths, we will move all the functionality into
17165 (FieldExpr.EmitAssign): Ditto.
17167 This fixes several hidden bugs that I uncovered while doing a code
17168 review of this today.
17170 * codegen.cs (EmitThis): reworked so the semantics are more clear
17171 and also support value types "this" instances.
17173 * iterators.cs: Changed so that for iterators in value types, we
17174 do not pass the value type as a parameter.
17176 Initialization of the enumerator helpers is now done in the caller
17177 instead of passing the parameters to the constructors and having
17178 the constructor set the fields.
17180 The fields have now `assembly' visibility instead of private.
17182 2004-04-11 Miguel de Icaza <miguel@ximian.com>
17184 * expression.cs (Argument.Resolve): Check if fields passed as ref
17185 or out are contained in a MarshalByRefObject.
17187 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
17188 another compiler type.
17190 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
17192 * class.cs (Indexer.Define): use the new name checking method.
17193 Also, return false on an error.
17194 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
17195 (is_identifier_[start/part]_character): make static.
17197 2004-04-10 Miguel de Icaza <miguel@ximian.com>
17199 * expression.cs (Binary.ResolveOperator): Do no append strings
17200 twice: since we can be invoked more than once (array evaluation)
17201 on the same concatenation, take care of this here. Based on a fix
17202 from Ben (bug #56454)
17204 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
17206 * codegen.cs: Fix another case where CS1548 must be reported (when
17207 delay-sign isn't specified and no private is available #56564). Fix
17208 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
17209 error when MCS is used on the MS runtime and we need to delay-sign
17210 (which seems unsupported by AssemblyBuilder - see #56621).
17212 2004-04-08 Marek Safar <marek.safar@seznam.cz>
17214 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
17215 (TypeManager.ComputeNamespaces): Faster implementation for
17218 * compiler.csproj: Updated AssemblyName to mcs.
17220 2004-04-07 Miguel de Icaza <miguel@ximian.com>
17222 * rootcontext.cs: Add new types to the boot resolution.
17224 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
17225 MulticastDelegate is not allowed.
17227 * typemanager.cs: Add new types to lookup: System.TypedReference
17230 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
17231 check for TypedReference or ArgIterator, they are not allowed.
17233 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
17234 makes us properly catch 1510 in some conditions (see bug 56016 for
17237 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
17239 * CryptoConvert.cs: update from corlib version
17242 2004-04-05 Miguel de Icaza <miguel@ximian.com>
17244 * class.cs (Indexer.Define): Check indexername declaration
17246 2004-04-05 Marek Safar <marek.safar@seznam.cz>
17248 * attribute.cs (IsClsCompliant): Fixed problem with handling
17249 all three states (compliant, not-compliant, undetected).
17251 2004-03-30 Marek Safar <marek.safar@seznam.cz>
17253 * attribute.cs (Attribute): Location is now public.
17254 (Resolve): Store resolved arguments (pos_values) in attribute class.
17255 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
17256 (GetClsCompliantAttributeValue): New method that gets
17257 CLSCompliantAttribute value.
17258 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
17259 if exists else null.
17260 (AttributeTester): New class for CLS-Compliant verification routines.
17262 * class.cs (Emit): Add CLS-Compliant verification.
17263 (Method.GetSignatureForError): Implemented.
17264 (Constructor.GetSignatureForError): Implemented
17265 (Constructor.HasCompliantArgs): Returns if constructor has
17266 CLS-Compliant arguments.
17267 (Constructor.Emit): Override.
17268 (Construcor.IsIdentifierClsCompliant): New method; For constructors
17269 is needed to test only parameters.
17270 (FieldBase.GetSignatureForError): Implemented.
17271 (TypeContainer): New member for storing base interfaces.
17272 (TypeContainer.FindMembers): Search in base interfaces too.
17274 * codegen.cs (GetClsComplianceAttribute): New method that gets
17275 assembly or module CLSCompliantAttribute value.
17276 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
17278 (ModuleClass.Emit): Add error 3012 test.
17280 * const.cs (Emit): Override and call base for CLS-Compliant tests.
17282 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
17283 state for all decl types.
17284 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
17285 if CLS-Compliant tests are required.
17286 (IsClsCompliaceRequired): New method. Analyze whether code
17287 must be CLS-Compliant.
17288 (IsExposedFromAssembly): New method. Returns true when MemberCore
17289 is exposed from assembly.
17290 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
17291 value or gets cached value.
17292 (HasClsCompliantAttribute): New method. Returns true if MemberCore
17293 is explicitly marked with CLSCompliantAttribute.
17294 (IsIdentifierClsCompliant): New abstract method. This method is
17295 used to testing error 3005.
17296 (IsIdentifierAndParamClsCompliant): New method. Common helper method
17297 for identifier and parameters CLS-Compliant testing.
17298 (VerifyClsCompliance): New method. The main virtual method for
17299 CLS-Compliant verifications.
17300 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
17301 null. I don't know why is null (too many public members !).
17302 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
17303 and get value of first CLSCompliantAttribute that found.
17305 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
17306 (VerifyClsCompliance): Override and add extra tests.
17308 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
17309 clscheck- disable CLS-Compliant verification event if assembly is has
17310 CLSCompliantAttribute(true).
17312 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
17313 ApllyAttribute is now called in emit section as in the other cases.
17314 Possible future Emit integration.
17315 (IsIdentifierClsCompliant): New override.
17316 (VerifyClsCompliance): New override.
17317 (GetEnumeratorName): Returns full enum name.
17319 * parameter.cs (GetSignatureForError): Implemented.
17321 * report.cs (WarningData): New struct for Warning message information.
17322 (LocationOfPreviousError): New method.
17323 (Warning): New method. Reports warning based on the warning table.
17324 (Error_T): New method. Reports error based on the error table.
17326 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
17327 verifications are done here.
17329 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
17331 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
17332 CLSCompliantAttribute.
17333 (all_imported_types): New member holds all imported types from other
17335 (LoadAllImportedTypes): New method fills static table with exported types
17336 from all referenced assemblies.
17337 (Modules): New property returns all assembly modules.
17339 2004-03-30 Miguel de Icaza <miguel@ximian.com>
17341 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
17342 throwing a parser error.
17344 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
17345 which removes the hardcoded get_/set_ prefixes for properties, as
17346 IL allows for the properties to be named something else.
17350 * expression.cs: Do not override operand before we know if it is
17351 non-null. Fix 56207
17353 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17355 * typemanager.cs: support for pinned variables.
17357 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17359 * decl.cs, typemanager.cs: Avoid using an arraylist
17360 as a buffer if there is only one result set.
17362 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17364 * expression.cs: Make sure you cant call a static method
17365 with an instance expression, bug #56174.
17367 2004-03-29 Miguel de Icaza <miguel@ximian.com>
17369 * class.cs (IsDuplicateImplementation): Improve error reporting to
17370 flag 663 (method only differs in parameter modifier).
17372 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
17373 in preprocessor directives.
17375 * location.cs (LookupFile): Allow for the empty path.
17377 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
17378 better approach for some of that patch, but its failing with the
17379 CharSet enumeration. For now try/catch will do.
17381 * typemanager.cs: Do not crash if a struct does not have fields.
17384 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17386 * expression.cs: cs0213, cant fix a fixed expression.
17389 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17391 * cs-parser.jay: detect invalid embeded statements gracefully.
17394 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17396 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
17399 the invocation type may not be a subclass of the tye of the item/
17400 The type of the item must be a subclass of the invocation item.
17405 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
17407 * attribute.cs: Added methods to get a string and a bool from an
17408 attribute. Required to information from AssemblyKeyFileAttribute,
17409 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
17410 * codegen.cs: Modified AssemblyName creation to include support for
17411 strongnames. Catch additional exceptions to report them as CS1548.
17412 * compiler.csproj: Updated include CryptoConvert.cs.
17413 * compiler.csproj.user: Removed file - user specific configuration.
17414 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
17415 Mono.Security assembly. The original class is maintained and tested in
17416 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
17417 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
17418 like CSC 8.0 (C# v2) supports.
17419 * Makefile: Added CryptoConvert.cs to mcs sources.
17420 * rootcontext.cs: Added new options for strongnames.
17422 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
17424 * driver.cs: For --expect-error, report error code `2'
17425 if the program compiled with no errors, error code `1' if
17426 it compiled with an error other than the one expected.
17428 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
17430 * compiler.csproj: Updated for Visual Studio .NET 2003.
17431 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
17432 * compiler.sln: Updated for Visual Studio .NET 2003.
17434 2004-03-24 Ravi Pratap M <ravi@ximian.com>
17436 * expression.cs: Fix bug #47234. We basically need to apply the
17437 rule that we prefer the conversion of null to a reference type
17438 when faced with a conversion to 'object' (csc behaviour).
17440 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17442 * statement.cs: Shorter form for foreach, eliminates
17443 a local variable. r=Martin.
17445 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17447 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
17448 checks if we can use brtrue/brfalse to test for 0.
17449 * expression.cs: use the above in the test for using brtrue/brfalse.
17450 cleanup code a bit.
17452 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17454 * expression.cs: Rewrite string concat stuff. Benefits:
17456 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
17457 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
17458 rather than a concat chain.
17460 * typemanager.cs: Add lookups for more concat overloads.
17462 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17464 * expression.cs: Emit shorter il code for array init.
17481 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
17483 * statement.cs: Before, two switch blocks would be merged if the
17484 total size of the blocks (end_item - begin_item + 1) was less than
17485 two times the combined sizes of the blocks.
17487 Now, it will only merge if after the merge at least half of the
17492 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
17494 * class.cs : csc build fix for GetMethods(). See bug #52503.
17496 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
17498 * expression.cs: Make sure fp comparisons work with NaN.
17499 This fixes bug #54303. Mig approved this patch a long
17500 time ago, but we were not able to test b/c the runtime
17503 2004-03-19 Miguel de Icaza <miguel@ximian.com>
17505 * ecore.cs (TypExpr.GetHashCode): implement this overload.
17507 2004-03-19 Martin Baulig <martin@ximian.com>
17509 * class.cs (MemberCore.IsDuplicateImplementation): Report the
17510 error here and not in our caller.
17512 2004-03-19 Martin Baulig <martin@ximian.com>
17514 * interface.cs: Completely killed this file.
17515 (Interface): We're now a TypeContainer and live in class.cs.
17517 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
17518 argument; we're now also called for interfaces.
17519 (TypeContainer.DefineMembers): Allow this method being called
17521 (TypeContainer.GetMethods): New public method; formerly known as
17522 Interface.GetMethod(). This is used by PendingImplementation.
17523 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
17524 it's now private and non-static.
17525 (Interface): Moved this here; it's now implemented similar to
17527 (Method, Property, Event, Indexer): Added `bool is_interface'
17528 argument to their .ctor's.
17529 (MemberBase.IsInterface): New public field.
17531 * cs-parser.jay: Create normal Method, Property, Event, Indexer
17532 instances instead of InterfaceMethod, InterfaceProperty, etc.
17533 (opt_interface_base): Removed; we now use `opt_class_base' instead.
17534 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
17536 2004-03-19 Martin Baulig <martin@ximian.com>
17538 * class.cs (MethodCore.IsDuplicateImplementation): New private
17539 method which does the CS0111 checking.
17540 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
17541 Use IsDuplicateImplementation().
17543 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
17545 * decl.cs (FindMemberToOverride): New method to find the correct
17546 method or property to override in the base class.
17548 - Make Method/Property use the above method to find the
17549 version in the base class.
17550 - Remove the InheritableMemberSignatureCompare as it is now
17553 This patch makes large code bases much faster to compile, as it is
17554 O(n) rather than O(n^2) to do this validation.
17556 Also, it fixes bug 52458 which is that nested classes are not
17557 taken into account when finding the base class member.
17559 Reviewed/Approved by Martin.
17561 2004-03-17 Marek Safar <marek.safar@seznam.cz>
17563 * interface.cs: In all interface classes removed redundant
17564 member initialization.
17566 2004-03-16 Martin Baulig <martin@ximian.com>
17568 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
17570 2004-03-15 Miguel de Icaza <miguel@ximian.com>
17572 * decl.cs (DefineTypeAndParents): New helper method to define a
17573 type's containers before the type itself is defined; This is a
17574 bug exposed by the recent changes to Windows.Forms when an
17575 implemented interface was defined inside a class that had not been
17578 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
17580 (Check): Loop correctly to report errors modifiers
17581 (UNSAFE was not in the loop, since it was the same as TOP).
17583 * interface.cs: Every interface member now takes a ModFlags,
17584 instead of a "is_new" bool, which we set on the base MemberCore.
17586 Every place where we called "UnsafeOk" in the interface, now we
17587 call the proper member (InterfaceMethod.UnsafeOK) instead to get
17588 the unsafe settings from the member declaration instead of the
17589 container interface.
17591 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
17593 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
17594 `set_indexer_name' to the pending bits (one per type).
17596 We fixed a bug today that was picking the wrong method to
17597 override, since for properties the existing InterfaceMethod code
17598 basically ignored the method name. Now we make sure that the
17599 method name is one of the valid indexer names.
17601 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
17603 * support.cs (SeekableStreamReader): Keep track of stream byte
17604 positions and don't mix them with character offsets to the buffer.
17606 Patch from Gustavo Giráldez
17608 2004-03-15 Marek Safar <marek.safar@seznam.cz>
17610 * interface.cs (InterfaceSetGetBase): Removed double member
17611 initialization, base class does it as well.
17613 2004-03-13 Martin Baulig <martin@ximian.com>
17615 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
17616 when compiling corlib.
17618 2004-03-13 Miguel de Icaza <miguel@ximian.com>
17620 * convert.cs (ExplicitConversion): We were reporting an error on
17621 certain conversions (object_type source to a value type, when the
17622 expression was `null') before we had a chance to pass it through
17623 the user defined conversions.
17625 * driver.cs: Replace / and \ in resource specifications to dots.
17628 * class.cs: Add check for duplicate operators. Fixes 52477
17630 2004-03-11 Miguel de Icaza <miguel@ximian.com>
17632 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
17633 that are in the middle of the statements, not only at the end.
17636 * class.cs (TypeContainer.AddField): No longer set the
17637 `HaveStaticConstructor' flag, now we call it
17638 `UserDefineStaticConstructor' to diferentiate the slightly
17639 semantic difference.
17641 The situation is that we were not adding BeforeFieldInit (from
17642 Modifiers.TypeAttr) to classes that could have it.
17643 BeforeFieldInit should be set to classes that have no static
17648 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
17650 And most importantly Zoltan's comment:
17652 http://bugzilla.ximian.com/show_bug.cgi?id=44229
17654 "I think beforefieldinit means 'it's ok to initialize the type sometime
17655 before its static fields are used', i.e. initialization does not need
17656 to be triggered by the first access to the type. Setting this flag
17657 helps the JIT to compile better code, since it can run the static
17658 constructor at JIT time, and does not need to generate code to call it
17659 (possibly lots of times) at runtime. Unfortunately, mcs does not set
17660 this flag for lots of classes like String.
17662 csc sets this flag if the type does not have an explicit static
17663 constructor. The reasoning seems to be that if there are only static
17664 initalizers for a type, and no static constructor, then the programmer
17665 does not care when this initialization happens, so beforefieldinit
17668 This bug prevents the AOT compiler from being usable, since it
17669 generates so many calls to mono_runtime_class_init that the AOT code
17670 is much slower than the JITted code. The JITted code is faster,
17671 because it does not generate these calls if the vtable is type is
17672 already initialized, which is true in the majority of cases. But the
17673 AOT compiler can't do this."
17675 2004-03-10 Miguel de Icaza <miguel@ximian.com>
17677 * class.cs (MethodData.Emit): Refactor the code so symbolic
17678 information is generated for destructors; For some reasons we
17679 were taking a code path that did not generate symbolic information
17682 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
17684 * class.cs: Create a Constructor.CheckBase method that
17685 takes care of all validation type code. The method
17686 contains some code that was moved from Define.
17688 It also includes new code that checks for duplicate ctors.
17689 This fixes bug #55148.
17691 2004-03-09 Joshua Tauberer <tauberer@for.net>
17693 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
17694 a { ... }-style array creation invokes EmitStaticInitializers
17695 which is not good for reference-type arrays. String, decimal
17696 and now null constants (NullCast) are not counted toward
17697 static initializers.
17699 2004-03-05 Martin Baulig <martin@ximian.com>
17701 * location.cs (SourceFile.HasLineDirective): New public field;
17702 specifies whether the file contains or is referenced by a "#line"
17704 (Location.DefineSymbolDocuments): Ignore source files which
17705 either contain or are referenced by a "#line" directive.
17707 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
17709 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
17710 direct access to our parent, so check the method inline there.
17712 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
17714 * expression.cs (Invocation.EmitCall): Miguel's last commit
17715 caused a regression. If you had:
17720 In Foo the implict this would be null.
17722 2004-02-27 Miguel de Icaza <miguel@ximian.com>
17724 * expression.cs (Invocation.EmitCall): If the method is not
17725 virtual, do not emit a CallVirt to it, use Call.
17727 * typemanager.cs (GetFullNameSignature): Improve the method to
17728 cope with ".ctor" and replace it with the type name.
17730 * class.cs (ConstructorInitializer.Resolve): Now the method takes
17731 as an argument the ConstructorBuilder where it is being defined,
17732 to catch the recursive constructor invocations.
17734 2004-02-26 Miguel de Icaza <miguel@ximian.com>
17736 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
17737 routines to check if a type is an enumerable/enumerator allow
17738 classes that implement the IEnumerable or IEnumerator interfaces.
17740 * class.cs (Property, Operator): Implement IIteratorContainer, and
17741 implement SetYields.
17743 (Property.Define): Do the block swapping for get_methods in the
17744 context of iterators. We need to check if Properties also
17745 include indexers or not.
17747 (Operator): Assign the Block before invoking the
17748 OperatorMethod.Define, so we can trigger the Iterator code
17751 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
17752 Property and Operator classes are not created when we parse the
17753 declarator but until we have the block completed, so we use a
17754 singleton SimpleIteratorContainer.Simple to flag whether the
17755 SetYields has been invoked.
17757 We propagate this setting then to the Property or the Operator to
17758 allow the `yield' to function.
17760 2004-02-25 Marek Safar <marek.safar@seznam.cz>
17762 * codegen.cs: Implemented attribute support for modules.
17763 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
17764 Assembly/Module functionality.
17766 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
17767 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
17768 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
17770 2004-02-16 Marek Safar <marek.safar@seznam.cz>
17772 * interface.cs (FindMembers): The operation is performed on all base
17773 interfaces and not only on the first. It is required for future CLS Compliance patch.
17775 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
17777 * statement.cs, codegen.cs:
17778 This patch deals with patterns such as:
17780 public class List : IEnumerable {
17782 public MyEnumerator GetEnumerator () {
17783 return new MyEnumerator(this);
17786 IEnumerator IEnumerable.GetEnumerator () {
17790 public struct MyEnumerator : IEnumerator {
17795 Before, there were a few things we did wrong:
17796 1) we would emit callvirt on a struct, which is illegal
17797 2) we emited ldarg when we needed to emit ldarga
17798 3) we would mistakenly call the interface methods on an enumerator
17799 type that derived from IEnumerator and was in another assembly. For example:
17801 public class MyEnumerator : IEnumerator
17803 Would have the interface methods called, even if there were public impls of the
17804 method. In a struct, this lead to invalid IL code.
17806 2004-02-11 Marek Safar <marek.safar@seznam.cz>
17808 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
17811 * delegate.cs (Define): Fixed crash when delegate type is undefined.
17813 2004-02-11 Miguel de Icaza <miguel@ximian.com>
17815 * cs-parser.jay: Fix small regression: we were not testing V2
17816 compiler features correctly.
17818 * interface.cs: If the emit context is null, then create one
17820 2004-02-09 Marek Safar <marek.safar@seznam.cz>
17822 * decl.cs (GetSignatureForError): New virtual method to get full name
17823 for error messages.
17825 * attribute.cs (IAttributeSupport): New interface for attribute setting.
17826 Now it is possible to rewrite ApplyAttributes method to be less if/else.
17828 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
17829 Duplicated members and code in these classes has been removed.
17830 Better encapsulation in these classes.
17832 2004-02-07 Miguel de Icaza <miguel@ximian.com>
17834 * assign.cs (Assign.DoResolve): When dealing with compound
17835 assignments, there is a new rule in ECMA C# 2.4 (might have been
17836 there before, but it is documented here) that states that in:
17840 If b is of type int, and the `op' is a shift-operator, then the
17841 above is evaluated as:
17845 * expression.cs (Binary.ResolveOperator): Instead of testing for
17846 int/uint/long/ulong, try to implicitly convert to any of those
17847 types and use that in pointer arithmetic.
17849 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
17850 method to print information for from the type, not from the
17851 null-method we were given.
17853 2004-02-01 Duncan Mak <duncan@ximian.com>
17855 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
17856 parsing for cmd, fixes bug #53694.
17858 2004-02-04 Marek Safar <marek.safar@seznam.cz>
17860 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
17861 in the member name duplication tests. Property and operator name duplication
17862 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
17864 2004-02-03 Marek Safar <marek.safar@seznam.cz>
17866 * interface.cs (PopulateMethod): Fixed crash when interface method
17867 returns not existing type (error test cs0246-3.cs).
17869 2004-02-02 Ravi Pratap M <ravi@ximian.com>
17871 * cs-parser.jay (interface_accessors): Re-write actions to also
17872 store attributes attached to get and set methods. Fix spelling
17875 (inteface_property_declaration): Modify accordingly.
17877 (InterfaceAccessorInfo): New helper class to store information to pass
17878 around between rules that use interface_accessors.
17880 * interface.cs (Emit): Apply attributes on the get and set
17881 accessors of properties and indexers too.
17883 * attribute.cs (ApplyAttributes): Modify accordingly to use the
17884 right MethodBuilder when applying attributes to the get and set accessors.
17886 2004-01-31 Miguel de Icaza <miguel@ximian.com>
17888 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
17890 2004-01-26 Miguel de Icaza <miguel@ximian.com>
17892 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
17894 2004-01-25 Miguel de Icaza <miguel@ximian.com>
17896 * cs-parser.jay: Remove YIELD token, instead use the new grammar
17897 changes that treat `yield' specially when present before `break'
17898 or `return' tokens.
17900 * cs-tokenizer.cs: yield is no longer a keyword.
17902 2004-01-23 Marek Safar <marek.safar@seznam.cz>
17904 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
17905 setting for default constructors.
17906 For default constructors are almost every time set wrong Modifier. The
17907 generated IL code has been alright. But inside mcs this values was
17908 wrong and this was reason why several of my CLS Compliance tests
17911 2004-01-22 Martin Baulig <martin@ximian.com>
17913 * cs-parser.jay (namespace_or_type_name): Return an Expression,
17914 not a QualifiedIdentifier. This is what `type_name_expression'
17915 was previously doing.
17916 (type_name_expression): Removed; the code is now in
17917 `namespace_or_type_name'.
17918 (qualified_identifier): Removed, use `namespace_or_type_name'
17920 (QualifiedIdentifier): Removed this class.
17922 2004-01-22 Martin Baulig <martin@ximian.com>
17924 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
17925 not a string as alias name.
17927 2004-01-21 Miguel de Icaza <miguel@ximian.com>
17929 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
17930 #52730 bug, and instead compute correctly the need to use a
17931 temporary variable when requesting an address based on the
17932 static/instace modified of the field and the constructor.
17934 2004-01-21 Martin Baulig <martin@ximian.com>
17936 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
17937 class and namespace before looking up aliases. Fixes #52517.
17939 2004-01-21 Martin Baulig <martin@ximian.com>
17941 * flowanalysis.cs (UsageVector.Merge): Allow variables being
17942 assinged in a 'try'; fixes exception4.cs.
17944 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17945 * class.cs : Implemented parameter-less constructor for TypeContainer
17947 * decl.cs: Attributes are now stored here. New property OptAttributes
17949 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
17951 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
17953 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17955 * typemanager.cs (CSharpSignature): Now reports also inner class name.
17956 (CSharpSignature): New method for indexer and property signature.
17958 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17960 * pending.cs (IsVirtualFilter): Faster implementation.
17962 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17964 * typemanager.cs: Avoid inclusion of same assembly more than once.
17966 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17968 * cs-parser.jay: Fixed problem where the last assembly attribute
17969 has been applied also to following declaration (class, struct, etc.)
17971 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17973 * class.cs: Added error CS0538, CS0539 reporting.
17974 Fixed crash on Microsoft runtime when field type is void.
17976 * cs-parser.jay: Added error CS0537 reporting.
17978 * pending.cs: Added error CS0535 reporting.
17979 Improved error report for errors CS0536, CS0534.
17981 2004-01-20 Miguel de Icaza <miguel@ximian.com>
17983 Merge a few bits from the Anonymous Method MCS tree.
17985 * statement.cs (ToplevelBlock): New class for toplevel methods,
17986 will hold anonymous methods, lifted variables.
17988 * cs-parser.jay: Create toplevel blocks for delegates and for
17989 regular blocks of code.
17991 2004-01-20 Martin Baulig <martin@ximian.com>
17993 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
17994 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
17995 and `NeedExplicitReturn'; added `IsLastStatement'.
17996 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
17997 have a `ReturnLabel' or we're not unreachable.
17999 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
18000 child's reachability; don't just override ours with it. Fixes
18001 #58058 (lluis's example).
18002 (FlowBranching): Added public InTryOrCatch(), InCatch(),
18003 InFinally(), InLoop(), InSwitch() and
18004 BreakCrossesTryCatchBoundary() methods.
18006 * statement.cs (Return): Do all error checking in Resolve().
18007 Unless we are the last statement in a top-level block, always
18008 create a return label and jump to it.
18009 (Break, Continue): Do all error checking in Resolve(); also make
18010 sure we aren't leaving a `finally'.
18011 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
18012 statement in a top-level block.
18013 (Block.Flags): Added `IsDestructor'.
18014 (Block.IsDestructor): New public property.
18016 2004-01-20 Martin Baulig <martin@ximian.com>
18018 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
18020 2004-01-20 Martin Baulig <martin@ximian.com>
18022 * statement.cs (Statement.ResolveUnreachable): New public method.
18023 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
18024 (Block.Resolve): Resolve unreachable statements.
18026 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
18028 * expression.cs: We need to fix the case where we do
18029 not have a temp variable here.
18031 * assign.cs: Only expression compound assignments need
18032 temporary variables.
18034 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
18036 * flowanalysis.cs: Reduce memory allocation in a few ways:
18037 - A block with no variables should not allocate a bit
18039 - A method with no out parameters does not need any tracking
18040 for assignment of the parameters, so we need not allocate
18043 public readonly Type[] VariableTypes;
18044 public readonly string[] VariableNames;
18045 Are redundant. The data is already stored in the variable
18046 map, so we need not allocate another array for it.
18047 - We need to add alot of checks for if (params | locals) == null
18048 due to the first two changes.
18050 2004-01-18 Miguel de Icaza <miguel@ximian.com>
18052 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
18053 implement IMemoryLocation, we store a copy on a local variable and
18054 take the address of it. Patch from Benjamin Jemlich
18056 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
18057 to use a special "type_name_expression" rule which reduces the
18058 number of "QualifiedIdentifier" classes created, and instead
18059 directly creates MemberAccess expressions.
18061 2004-01-17 Miguel de Icaza <miguel@ximian.com>
18063 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
18064 that fixes #52853. Null literal assignment to ValueType
18066 * class.cs (MethodData.Emit): Instead of checking the name of the
18067 method to determine if its a destructor, create a new derived
18068 class from Method called Destructor, and test for that.
18070 * cs-parser.jay: Create a Destructor object instead of a Method.
18072 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
18076 2004-01-16 Miguel de Icaza <miguel@ximian.com>
18078 * expression.cs (Binary.ResolveOperator): Perform an implicit
18079 conversion from MethodGroups to their delegate types on the
18080 Addition operation.
18082 * delegate.cs: Introduce a new class DelegateCreation that is the
18083 base class for `NewDelegate' and `ImplicitDelegateCreation',
18084 factor some code in here.
18086 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
18087 conversion from MethodGroups to compatible delegate types.
18089 * ecore.cs (Expression.Resolve): Do not flag error 654
18090 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
18091 we allow conversions from MethodGroups to delegate types now.
18093 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
18094 assignments in v2 either.
18096 2004-01-10 Miguel de Icaza <miguel@ximian.com>
18098 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
18099 static read-only fields in ctors.
18101 Applied patch from Benjamin Jemlich
18103 * expression.cs (UnaryMutator): Avoid leaking local variables.
18105 2004-01-09 Miguel de Icaza <miguel@ximian.com>
18107 * cs-tokenizer.cs (IsCastToken): Allow the various native types
18108 here to return true, as they can be used like this:
18110 (XXX) int.MEMBER ()
18112 Fixed 49836 and all the other dups
18114 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
18116 * driver.cs: Implement /win32res and /win32icon.
18118 2004-01-08 Miguel de Icaza <miguel@ximian.com>
18120 * cs-parser.jay: Add a rule to improve error handling for the
18121 common mistake of placing modifiers after the type.
18123 2004-01-07 Miguel de Icaza <miguel@ximian.com>
18125 * cs-parser.jay (interface_event_declaration): Catch
18126 initialization of events on interfaces, and report cs0068
18128 * cs-parser.jay (interface_event_declaration): Catch
18129 initialization of events.
18131 * ecore.cs: Better report missing constructors.
18133 * expression.cs (Binary.ResolveOperator): My previous bug fix had
18134 the error reporting done in the wrong place. Fix.
18136 * expression.cs (Binary.ResolveOperator): Catch the
18137 operator + (E x, E y) error earlier, and later allow for implicit
18138 conversions in operator +/- (E e, U x) from U to the underlying
18141 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
18142 52596, if the container class is abstract, the default constructor
18143 is protected otherwise its public (before, we were always public).
18145 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
18148 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
18149 Jemlich that fixes bug #52597, MCS was generating invalid code for
18150 idisposable structs. Thanks to Ben for following up with this
18153 2004-01-06 Miguel de Icaza <miguel@ximian.com>
18155 * driver.cs: Allow assemblies without code to be generated, fixes
18158 2004-01-07 Nick Drochak <ndrochak@gol.com>
18160 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
18162 2004-01-05 Miguel de Icaza <miguel@ximian.com>
18164 * cs-parser.jay: Add rules to improve error reporting if fields or
18165 methods are declared at the namespace level (error 116)
18167 * Add rules to catch event add/remove
18169 2004-01-04 David Sheldon <dave-mono@earth.li>
18171 * expression.cs: Added matching ")" to error message for
18174 2004-01-03 Todd Berman <tberman@gentoo.org>
18176 * ecore.cs, attribute.cs:
18177 Applying fix from #52429.
18179 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18181 * ecore.cs, expression.cs, statement.cs:
18182 Total rewrite of how we handle branching. We
18183 now handle complex boolean expressions with fewer
18184 jumps. As well if (x == 0) no longer emits a ceq.
18186 if (x is Foo) is much faster now, because we generate
18189 Overall, we get a pretty big improvement on our benchmark
18190 tests. The code we generate is smaller and more readable.
18192 I did a full two-stage bootstrap. The patch was reviewed
18193 by Martin and Miguel.
18195 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18197 * cs-parser.jay: Make primary_expression not take a QI.
18198 we dont need this because the member_access rule covers
18199 us here. So we replace the rule with just IDENTIFIER.
18201 This has two good effects. First, we remove a s/r conflict.
18202 Second, we allocate many fewer QualifiedIdentifier objects.
18204 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18206 * attribute.cs: Handle MarshalAs attributes as pseudo, and
18207 set the correct information via SRE. This prevents
18208 hanging on the MS runtime. Fixes #29374.
18210 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18212 * convert.cs: correctly handle conversions to value types
18213 from Enum and ValueType as unboxing conversions.
18215 Fixes bug #52569. Patch by Benjamin Jemlich.
18217 2004-01-02 Ravi Pratap <ravi@ximian.com>
18219 * expression.cs (BetterConversion): Prefer int -> uint
18220 over int -> ulong (csc's behaviour). This fixed bug #52046.
18222 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
18224 * decl.cs (MemberCache.FindMembers): now returns a
18227 * typemanager.cs: In general, go with with ^^.
18228 (CopyNewMethods): take an IList.
18229 (RealMemberLookup): Only allocate an arraylist
18230 if we copy from two sets of methods.
18232 This change basically does two things:
18233 1) Fewer array lists allocated due to CopyNewMethods.
18234 2) the explicit cast in MemberList costed ALOT.
18236 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
18238 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
18239 a hashtable to avoid needless string allocations when an identifier is
18240 used more than once (the common case).
18242 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
18244 * pending.cs: MS's TypeBuilder.GetInterfaces ()
18245 is broken, it will not return anything. So, we
18246 have to use the information we have in mcs to
18249 * typemanager.cs: Add a cache for GetInterfaces,
18250 since this will now be used more often (due to ^^)
18252 (GetExplicitInterfaces) New method that gets the
18253 declared, not effective, interfaces on a type
18254 builder (eg, if you have interface IFoo, interface
18255 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
18258 This patch makes MCS able to bootstrap itself on
18261 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
18263 * expression.cs: Remove the Nop's that Miguel put
18266 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18268 * report.cs, codegen.cs: Give the real stack trace to
18269 the error when an exception is thrown.
18271 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18273 * decl.cs: only allocate hashtables for ifaces if
18276 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18278 * expression.cs: fix the error from cs0121-2.cs
18279 (a parent interface has two child interfaces that
18280 have a function with the same name and 0 params
18281 and the function is called through the parent).
18283 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
18285 * class.cs, rootcontext.cs, typmanager.cs: do not
18288 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
18290 * codegen.cs: remove stack for the ec flow branching.
18291 It is already a linked list, so no need.
18293 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
18295 * Makefile: Allow custom profiler here.
18297 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
18299 * typemanager.cs (LookupType):
18300 - Use a static char [], because split takes
18301 a param array for args, so it was allocating
18303 - Do not store true in a hashtable, it boxes.
18305 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
18307 * flowanalysis.cs: bytify common enums.
18309 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18311 * modifiers.cs: Add a new set of flags for the
18312 flags allowed on explicit interface impls.
18313 * cs-parser.jay: catch the use of modifiers in
18314 interfaces correctly.
18315 * class.cs: catch private void IFoo.Blah ().
18317 All related to bug #50572.
18319 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18321 * decl.cs: Rewrite the consistant accessability checking.
18322 Accessability is not linear, it must be implemented in
18323 a tableish way. Fixes #49704.
18325 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18327 * expression.cs: Handle negation in a checked context.
18328 We must use subtraction from zero. Fixes #38674.
18330 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
18332 * class.cs: Ignore static void main in DLLs.
18333 * rootcontext.cs: Handle the target type here,
18334 since we are have to access it from class.cs
18335 * driver.cs: account for the above.
18337 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
18339 * report.cs: Give line numbers and files if available.
18341 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
18343 * driver.cs: Implement /addmodule.
18345 * typemanager.cs: Change 'modules' field so it now contains Modules not
18348 2003-12-20 Martin Baulig <martin@ximian.com>
18350 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
18351 (FieldBase.IsAssigned): Removed this field.
18352 (FieldBase.SetAssigned): New public method.
18353 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
18355 2003-12-20 Martin Baulig <martin@ximian.com>
18357 * expression.cs (LocalVariableReference.DoResolve): Don't set
18358 `vi.Used' if we're called from DoResolveLValue().
18360 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
18361 returns the usage vector it just merged into the current one -
18362 pass this one to UsageWarning().
18363 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
18364 of the `EmitContext', don't call this recursively on our children.
18366 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
18368 * driver.cs: Implement /target:module.
18370 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
18372 * support.cs (CharArrayHashtable): New helper class.
18374 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
18375 char arrays, not strings, so we can avoid creating a string in
18376 consume_identifier if the identifier is a keyword.
18378 2003-12-16 Martin Baulig <martin@ximian.com>
18380 * statement.cs (LocalInfo.Assigned): Removed this property.
18381 (LocalInfo.Flags): Removed `Assigned'.
18382 (LocalInfo.IsAssigned): New public method; takes the EmitContext
18383 and uses flow analysis.
18384 (Block.UsageWarning): Made this method private.
18385 (Block.Resolve): Call UsageWarning() if appropriate.
18387 * expression.cs (LocalVariableReference.DoResolve): Always set
18388 LocalInfo.Used here.
18390 2003-12-13 Martin Baulig <martin@ximian.com>
18392 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
18393 any value here; we're now using flow analysis to figure out
18394 whether a statement/block returns a value.
18396 2003-12-13 Martin Baulig <martin@ximian.com>
18398 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
18400 (FlowBranching.MergeFinally): Don't call
18401 `branching.CheckOutParameters()' here, this is called in
18403 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
18404 when adding the `finally' vector.
18406 2003-12-13 Martin Baulig <martin@ximian.com>
18409 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
18410 actually work and also fix #48962.
18412 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
18414 * decl.cs: Do not check System.Object for nested types,
18415 since we know it does not have any. Big bang for buck:
18418 Run 1: 8.35 seconds
18419 Run 2: 8.32 seconds
18420 corlib: 17.99 seconds
18422 Run 1: 8.17 seconds
18423 Run 2: 8.17 seconds
18424 corlib: 17.39 seconds
18426 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
18428 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
18429 time we are returning 0 members, so we save alot here.
18431 2003-12-11 Martin Baulig <martin@ximian.com>
18433 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
18434 `MergeChild()', also just take the `FlowBranching' as argument;
18435 call Merge() on it and return the result.
18436 (FlowBranching.Merge): We don't need to do anything if we just
18439 2003-12-11 Martin Baulig <martin@ximian.com>
18441 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
18442 them in an `ArrayList' to reduce memory usage. Thanks to Ben
18443 Maurer for this idea.
18445 2003-12-11 Martin Baulig <martin@ximian.com>
18447 * flowanalysis.cs (MergeResult): This class is now gone; we now
18448 use the `UsageVector' for this. The reason for this is that if a
18449 branching just has one sibling, we don't need to "merge" them at
18450 all - that's the next step to do.
18451 (FlowBranching.Merge): We now return a `UsageVector' instead of a
18454 2003-12-11 Martin Baulig <martin@ximian.com>
18456 Reworked flow analyis and made it more precise and bug-free. The
18457 most important change is that we're now using a special `Reachability'
18458 class instead of having "magic" meanings of `FlowReturns'. I'll
18459 do some more cleanups and optimizations and also add some more
18460 documentation this week.
18462 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
18463 largely reworked this class.
18464 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
18465 the new `Reachability' class instead of having "magic" values here.
18466 (FlowBranching): We're now using an instance of `Reachability'
18467 instead of having separate `Returns', `Breaks' etc. fields.
18469 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
18470 based on flow analysis; ignore the return value of block.Emit ().
18472 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
18474 * driver.cs typemanager.cs: Find the mono extensions to corlib even
18475 if they are private.
18477 2003-12-09 Martin Baulig <martin@ximian.com>
18479 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
18480 call them directly on the UsageVector.
18482 2003-12-09 Martin Baulig <martin@ximian.com>
18484 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
18485 Changed return type from `FlowReturns' to `Reachability'.
18487 2003-12-09 Martin Baulig <martin@ximian.com>
18489 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
18490 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
18491 `Reachable' fields with a single `Reachability' one.
18493 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18495 * class.cs (FindMembers): Remove foreach's.
18500 Run 1: 8.74 seconds
18501 Run 2: 8.71 seconds
18504 Run 1: 8.64 seconds
18505 Run 2: 8.58 seconds
18508 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18513 This patch does a few things:
18514 1. EmptyStatement is now a singleton, so it is never reallocated.
18515 2. All blah is EmptyStatement constructs have been changed to
18516 blah == EmptyStatement.Value, which is much faster and valid
18517 now that EmptyStatement is a singleton.
18518 3. When resolving a block, rather than allocating a new array for
18519 the non-empty statements, empty statements are replaced with
18520 EmptyStatement.Value
18521 4. Some recursive functions have been made non-recursive.
18522 Mainly the performance impact is from (3), however (1) and (2) are needed for
18523 this to work. (4) does not make a big difference in normal situations, however
18524 it makes the profile look saner.
18529 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18530 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18531 Total memory allocated: 56397 KB
18534 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
18535 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
18536 Total memory allocated: 55666 KB
18538 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18540 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
18541 than the hashtable in a hashtable version
18543 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
18544 we always end up concating a string. This results in a huge perf
18545 loss, because many strings have to be tracked by the GC. In this
18546 patch, we first use a hashtable that works with two keys, so that
18547 the strings do not need to be concat'ed.
18551 Run 1: 8.74 seconds
18552 Run 2: 8.71 seconds
18555 Run 1: 8.65 seconds
18556 Run 2: 8.56 seconds
18558 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18560 * Makefile: Add a new target `do-time' that does a quick and simple
18561 profile, leaving easy to parse output.
18563 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
18565 * codegen.cs (Init): Create the dynamic assembly with
18566 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
18568 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
18570 * support.cs: Make the PtrHashtable use only one
18571 instance of its comparer.
18573 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
18575 * typemanager.cs: Fix lookup of GetNamespaces.
18577 2003-11-29 Miguel de Icaza <miguel@ximian.com>
18579 * expression.cs: Removed redundant line.
18581 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
18582 ArrayLists, use for loops with bounds.
18584 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
18587 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
18588 arraylists, use for loop with bounds.
18590 The above three changes give us a 0.071 second performance
18591 improvement out of 3.294 seconds down to 3.223. On my machine
18592 the above changes reduced the memory usage by 1,387 KB during
18593 compiler bootstrap.
18595 * cs-parser.jay (QualifiedIdentifier): New class used to represent
18596 QualifiedIdentifiers. Before we created a new string through
18597 concatenation, and mostly later on, the result would be
18598 manipulated by DecomposeQI through string manipulation.
18600 This reduced the compiler memory usage for bootstrapping from
18601 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
18602 compile times in 0.05 seconds.
18604 2003-11-28 Dick Porter <dick@ximian.com>
18606 * support.cs: Do string compares with the Invariant culture.
18614 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
18615 the comparison is done with the Invariant culture.
18617 2003-11-27 Miguel de Icaza <miguel@ximian.com>
18619 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
18620 GetEnumerator method.
18622 (ProbeCollectionType): Iterate starting at the most specific type
18623 upwards looking for a GetEnumerator
18625 * expression.cs: Shift count can be up to 31 for int/uint and 63
18628 2003-11-26 Miguel de Icaza <miguel@ximian.com>
18630 * statement.cs (Block.LookupLabel): Also look for the label on the
18631 children blocks. Use a hash table to keep track of visited
18634 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
18635 we actually did transform the other operand, otherwise fall back
18636 to the common codepath that casts to long.
18638 * cs-tokenizer.cs: Use the same code pattern as the int case.
18639 Maybe I should do the parsing myself, and avoid depending on the
18640 Parse routines to get this done.
18642 2003-11-25 Miguel de Icaza <miguel@ximian.com>
18644 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
18645 which fixes bug 51347. This time test it.
18647 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
18648 attributes for example can not tell the difference between these.
18649 The difference was only a syntax feature of the language.
18651 * attribute.cs: Apply attributes to delegates.
18653 * delegate.cs: Call the apply attributes method.
18655 2003-11-24 Miguel de Icaza <miguel@ximian.com>
18657 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
18658 comparing 0 vs Byte.MinValue, not the value
18660 (ImplicitConversionRequired): When reporting a conversion error,
18661 use error 31 to print out the constant error instead of the
18664 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
18665 which fixes bug 51347.
18667 2003-11-22 Miguel de Icaza <miguel@ximian.com>
18669 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
18670 which fixes the -warnaserror command line option.
18672 2003-11-21 Miguel de Icaza <miguel@ximian.com>
18674 * cfold.cs (DoNumericPromotions): During constant folding of
18675 additions on UIntConstant, special case intconstants with
18676 IntConstants like we do on the expression binary operator.
18678 2003-11-12 Miguel de Icaza <miguel@ximian.com>
18680 * convert.cs (ImplicitReferenceConversion): We were missing a case
18681 (System.Enum are not value types or class types, so we need to
18682 classify them separatedly).
18684 * driver.cs: We do not support error 2007.
18686 2003-11-12 Jackson Harper <jackson@ximian.com>
18688 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
18689 system directory. Also use the full file name so users can
18690 libraries names mscorlib-o-tron.dll in a non system dir.
18692 2003-11-10 Martin Baulig <martin@ximian.com>
18694 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
18695 (TypeManager.InitCoreTypes): Initialize them here, but instead of
18696 calling `ResolveType()' on them, directly assign their `Type'.
18698 2003-11-08 Martin Baulig <martin@ximian.com>
18700 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
18701 return value and the `out parent' parameter.
18702 (TypeContainer.DefineType): Moved the CS0644 check into
18703 GetClassBases(). Don't pass the interface types to the
18704 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
18705 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
18707 * ecore.cs (TypeExpr.IsAttribute): New property.
18708 (TypeExpr.GetInterfaces): New method.
18710 * interface.cs (Interface.GetInterfaceTypeByName): Return a
18711 TypeExpr instead of a Type.
18712 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
18713 (Interface.DefineType): Don't pass the interface types to the
18714 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
18715 them later and then call `TypeBulider.AddInterfaceImplementation()'.
18717 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
18718 instead of a `Type[]'.
18719 (TypeManager.RegisterBuilder): Likewise.
18720 (TypeManager.AddUserInterface): Likewise.
18721 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
18722 `Type[]' and also return a `TypeExpr[]'.
18723 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
18725 2003-11-08 Martin Baulig <martin@ximian.com>
18727 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
18730 2003-11-08 Martin Baulig <martin@ximian.com>
18732 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
18733 TypeManager.ResolveExpressionTypes().
18735 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
18736 instead of an Expression.
18737 (TypeExpr): This is now an abstract base class for `TypeExpression'.
18738 (TypeExpression): New public class; formerly known as `TypeExpr'.
18740 * expression.cs (ComposedCast): Derive from TypeExpr.
18742 * typemanager.cs (TypeManager.system_*_expr): These are now
18743 TypExpr's instead of Expression's.
18744 (TypeManager.ResolveExpressionTypes): New public static function;
18745 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
18748 2003-11-06 Miguel de Icaza <miguel@ximian.com>
18750 * expression.cs (New.DoResolve): Do not dereference value that
18751 might be a null return.
18753 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
18754 sure that the constant value has the right type. Fixes an
18755 unreported bug, similar to 50425.
18757 * const.cs (Const.LookupConstantValue): Call
18758 ImplicitStandardConversionExists before doing a conversion to
18759 avoid havng the TypeManager.ChangeType do conversions.
18761 Reduced the number of casts used
18763 (Const.ChangeType): New routine to enable reuse of the constant
18764 type changing code from statement.
18766 * typemanager.cs (ChangeType): Move common initialization to
18767 static global variables.
18771 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
18772 every value type to go through, even if it was void. Fix that.
18774 * cs-tokenizer.cs: Use is_identifier_start_character on the start
18775 character of the define, and the is_identifier_part_character for
18776 the rest of the string.
18778 2003-11-05 Miguel de Icaza <miguel@ximian.com>
18780 * expression.cs (UnaryMutator.EmitCode): When I updated
18781 LocalVariableReference.DoResolve, I overdid it, and dropped an
18782 optimization done on local variable references.
18784 2003-11-04 Miguel de Icaza <miguel@ximian.com>
18786 * ecore.cs: Convert the return from Ldlen into an int.
18788 2003-10-20 Miguel de Icaza <miguel@ximian.com>
18790 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
18791 the accessibility, this is a special case for toplevel non-public
18792 classes (internal for instance).
18794 2003-10-20 Nick Drochak <ndrochak@gol.com>
18796 * ecore.cs: Fix typo and build. Needed another right paren.
18798 2003-10-19 Miguel de Icaza <miguel@ximian.com>
18800 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
18801 `internal' case regular and protected, but not allowing protected
18802 to be evaluated later. Bug 49840
18804 2003-10-15 Miguel de Icaza <miguel@ximian.com>
18806 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
18807 to kb.Nlast, and not the kb.nFirst to isolate the switch
18810 Extract the underlying type, so enumerations of long/ulong are
18811 treated like long/ulong.
18813 2003-10-14 Miguel de Icaza <miguel@ximian.com>
18815 * expression.cs (New): Overload the meaning of RequestedType to
18816 track the possible creation of the NewDelegate type, since
18817 DoResolve is invoked more than once for new constructors on field
18820 See bugs: #48800 and #37014
18822 * cs-parser.jay (declare_local_constants): Take an arraylist
18823 instead of a single constant.
18825 (local_constant_declaration): It should take a
18826 constant_declarators, not a constant_declarator. Fixes 49487
18828 * convert.cs: Fix error report.
18830 2003-10-13 Jackson Harper <jackson@ximian.com>
18832 * typemanager.cs (TypeToCoreType): Add float and double this fixes
18835 2003-10-09 Martin Baulig <martin@ximian.com>
18837 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
18839 (MethodCore.DoDefineParameters): Removed the TypeContainer
18840 argument; use the DeclSpace which was passed to the .ctor instead.
18841 (MethodCore.CheckParameter): Take a DeclSpace instead of a
18842 TypeContainer; we only need a DeclSpace here.
18844 2003-10-09 Martin Baulig <martin@ximian.com>
18846 * class.cs (MethodData): Added additional `DeclSpace ds' argument
18848 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
18849 EmitContext's .ctor.
18851 2003-10-09 Martin Baulig <martin@ximian.com>
18853 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
18854 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
18855 AsAccessible(), moved them as well.
18857 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
18859 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
18861 * cs-parser.jay : Renamed yyName to yyNames related to jay.
18863 2003-10-07 Miguel de Icaza <miguel@ximian.com>
18865 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
18866 generation for >=, as spotted by Paolo, bug 48679.
18867 Patch from David Waite.
18869 * cs-tokenizer.cs: Add handling for #pragma.
18871 * cs-parser.jay: Allow for both yield and yield return in the
18872 syntax. The anti-cobolization of C# fight will go on!
18874 * class.cs (TypeBuilder.DefineType): Catch error condition here
18875 (Parent.DefineType erroring out and returning null).
18877 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18878 coping with enumerations variables, we were mistakenly processing
18879 them as a regular value type instead of built-in types. Fixes the
18882 * typemanager.cs (IsBuiltinOrEnum): New method.
18884 2003-09-30 Miguel de Icaza <miguel@ximian.com>
18886 * cs-parser.jay: Upgrade: yield now needs the return clause.
18888 2003-09-19 Martin Baulig <martin@ximian.com>
18890 * decl.cs (MemberCache.SetupCacheForInterface): Take a
18891 `MemberCache parent' argument. Normally, an interface doesn't
18892 have a parent type except System.Object, but we use this in gmcs
18893 for generic type parameters.
18895 2003-09-18 Martin Baulig <martin@ximian.com>
18897 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
18898 on `type.IsInterface'; don't check whether the type has a parent
18899 to determine whether it's an interface.
18901 2003-09-15 Martin Baulig <martin@ximian.com>
18903 * class.cs (TypeContainer.DefineType): Added an error flag to
18904 avoid reporting duplicate CS0146's ("class definition is
18907 * driver.cs (Driver.MainDriver): Abort if
18908 RootContext.ResolveTree() reported any errors.
18910 2003-09-07 Martin Baulig <martin@ximian.com>
18912 * report.cs (Error, Warning): Added overloaded versions which take
18913 a `params object[] args' and call String.Format().
18915 2003-09-07 Martin Baulig <martin@ximian.com>
18917 * decl.cs (DeclSpace..ctor): Don't call
18918 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
18919 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
18920 (DeclSpace.RecordDecl): New method.
18922 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
18924 2003-09-02 Ravi Pratap <ravi@ximian.com>
18926 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
18927 value attributes to be applied to ParameterBuilders.
18929 * class.cs (MethodCore.LabelParameters): Make static and more
18930 generic so that it can be used from other places - like interface
18931 methods, for instance.
18933 * interface.cs (Interface.Emit): Call LabelParameters before
18934 emitting attributes on the InterfaceMethod.
18936 2003-08-26 Martin Baulig <martin@ximian.com>
18938 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
18939 resolving aliases; fixes #47927.
18941 2003-08-26 Martin Baulig <martin@ximian.com>
18943 * statement.cs (Using.DoResolve): This is internally emitting a
18944 try/finally clause, so we need to set ec.NeedExplicitReturn if we
18945 do not always return. Fixes #47681.
18947 2003-08-26 Martin Baulig <martin@ximian.com>
18949 * decl.cs (MemberCore): Moved WarningNotHiding(),
18950 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
18952 (AdditionResult): Make this nested in DeclSpace.
18953 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
18954 argument; call NamespaceEntry.Define() unless we're nested in a
18957 * namespace.cs (Namespace.DefineName): New public function. This
18958 is called from DeclSpace's .ctor to add
18959 (Namespace.Lookup): Include DeclSpaces in the lookup.
18961 * class.cs (Operator): Derive from MemberBase, not MemberCore.
18963 * const.cs (Const): Derive from MemberBase, not MemberCore.
18965 2003-08-25 Martin Baulig <martin@ximian.com>
18967 * convert.cs (Convert.ExplicitReferenceConversion): When
18968 converting from an interface type to a class, unbox if the target
18969 type is a struct type. Fixes #47822.
18971 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18973 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
18976 2003-08-22 Martin Baulig <martin@ximian.com>
18978 * class.cs (TypeManager.DefineType): When defining a nested type,
18979 call DefineType() on our parent; fixes #47801.
18981 2003-08-22 Martin Baulig <martin@ximian.com>
18983 * class.cs (MethodData.Define): While checking if a method is an
18984 interface implementation, improve the test a bit more to fix #47654.
18986 2003-08-22 Martin Baulig <martin@ximian.com>
18988 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
18989 correctly; fixes #47722.
18991 2003-08-22 Martin Baulig <martin@ximian.com>
18993 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
18994 LocalVariableReference, ensure it's not read-only. Fixes #47536.
18996 * statement.cs (Fixed.DoResolve): Make all variables read-only.
18998 2003-08-22 Martin Baulig <martin@ximian.com>
19000 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
19001 can only be assigned in static constructors. Fixes #47161.
19003 2003-08-22 Martin Baulig <martin@ximian.com>
19005 Rewrote and improved the flow analysis code.
19007 * flowbranching.cs (FlowBranching): Make this class abstract.
19008 (FlowBranching.CreateBranching): New static function to create a
19009 new flow branching.
19010 (FlowBranchingBlock, FlowBranchingException): New classes.
19011 (FlowBranching.UsageVector.Type): New public readonly field.
19012 (FlowBranching.UsageVector.Breaks): Removed the setter.
19013 (FlowBranching.UsageVector.Returns): Removed the setter.
19014 (FlowBranching.UsageVector): Added Break(), Return(),
19015 NeverReachable() and Throw() methods to modify the reachability.
19016 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
19017 done by FlowBranching.Merge().
19018 (FlowBranching.UsageVector.MergeChild): New method; merges the
19019 merge result into the current vector.
19020 (FlowBranching.Merge): New abstract method to merge a branching.
19022 2003-08-12 Martin Baulig <martin@ximian.com>
19024 * expression.cs (Indirection.CacheTemporaries): Create the
19025 LocalTemporary with the pointer type, not its element type.
19027 2003-08-10 Miguel de Icaza <miguel@ximian.com>
19029 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
19030 token was a keyword or not.
19032 Add `error' options where an IDENTIFIER was expected; Provide
19033 CheckToken and CheckIdentifierToken convenience error reporting
19036 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
19038 * decl.cs: Rename `NamespaceEntry Namespace' public field into
19039 NameSpaceEntry NameSpaceEntry.
19041 (LookupInterfaceOrClass): Avoid creating a full qualified name
19042 from namespace and name: avoid doing lookups when we know the
19043 namespace is non-existant. Use new Tree.LookupByNamespace which
19044 looks up DeclSpaces based on their namespace, name pair.
19046 * driver.cs: Provide a new `parser verbose' to display the
19047 exception thrown during parsing. This is turned off by default
19048 now, so the output of a failure from mcs is more graceful.
19050 * namespace.cs: Track all the namespaces defined in a hashtable
19053 (IsNamespace): New method
19055 2003-08-09 Miguel de Icaza <miguel@ximian.com>
19057 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
19058 we know that we need to concatenate (full typename can never be
19063 * statement.cs: Use a bitfield; Do not initialize to null things
19064 which are done by the constructor by default.
19066 * cs-parser.jay: bug fix, parameter was 4, not 3.
19068 * expression.cs: Just use the property;
19070 * statement.cs: No need for GetVariableInfo method.
19072 2003-08-08 Martin Baulig <martin@ximian.com>
19074 * flowanalysis.cs (FlowReturns): This is now nested in the
19075 `FlowBranching' class.
19076 (MyBitVector): Moved this here from statement.cs.
19077 (FlowBranching.SiblingType): New enum type.
19078 (FlowBranching.CreateSibling): Added `SiblingType' argument.
19080 2003-08-07 Martin Baulig <martin@ximian.com>
19082 * flowanalysis.cs (FlowBranchingType): This is now nested in the
19083 `FlowBranching' class and called `BranchingType'.
19085 2003-08-07 Martin Baulig <martin@ximian.com>
19087 * flowanalysis.cs: Moved all the control flow analysis code into
19090 2003-08-07 Martin Baulig <martin@ximian.com>
19092 * assign.cs (Assign.DoResolve): `target' must either be an
19093 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
19096 2003-08-07 Miguel de Icaza <miguel@ximian.com>
19098 * expression.cs (BinaryMethod): This kind of expression is created by the
19099 Binary class if it determines that the operator has to be handled
19102 (BinaryDelegate): This kind of expression is created if we are
19103 dealing with a + or - operator on delegates.
19105 (Binary): remove method, argumetns, and DelegateOperator: when
19106 dealing with methods,
19108 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
19110 * statement.cs (Block): use bitfields for the three extra booleans
19111 we had in use. Remove unused topblock parameter.
19113 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
19115 * assign.cs: Drop extra unneeded tests.
19117 2003-08-06 Miguel de Icaza <miguel@ximian.com>
19119 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
19121 * statement.cs (Foreach): Use VariableStorage instead of
19124 * codegen.cs (VariableStorage): New class used by clients that
19125 require a variable stored: locals or fields for variables that
19126 need to live across yield.
19128 Maybe provide a convenience api for EmitThis+EmitLoad?
19130 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
19133 2003-08-05 Miguel de Icaza <miguel@ximian.com>
19135 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
19136 RemapParameterLValue): New methods that are used to turn a
19137 precomputed FieldInfo into an expression like this:
19141 The idea is to use this instead of making LocalVariableReference
19142 have more than one meaning.
19144 * cs-parser.jay: Add error production to BASE.
19146 * ecore.cs: Deal with TypeManager.GetField returning null, which
19147 is now a valid return value.
19149 (FieldExprNoAddress): New expression for Fields whose address can
19152 * expression.cs (LocalVariableReference): During the resolve
19153 phases, create new expressions if we are in a remapping context.
19154 Remove code that dealt with remapping here.
19156 (ParameterReference): same.
19158 (ProxyInstance): New expression, like the `This' expression, but
19159 it is born fully resolved. We know what we are doing, so remove
19160 the errors that are targeted to user-provided uses of `this'.
19162 * statement.cs (Foreach): our variable is now stored as an
19163 Expression; During resolution, follow the protocol, dont just
19164 assume it will return this.
19166 2003-08-06 Martin Baulig <martin@ximian.com>
19168 * support.cs (SeekableStreamReader.cs): New public class.
19170 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
19171 SeekableStreamReader instead of the normal StreamReader.
19173 2003-08-04 Martin Baulig <martin@ximian.com>
19175 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
19176 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
19177 deambiguate casts and delegate invocations.
19178 (parenthesized_expression): Use the new tokens to ensure this is
19179 not a cast of method invocation.
19181 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
19182 when reading a `)' and Deambiguate_CloseParens () was previously
19185 * expression.cs (ParenthesizedExpression): New class. This is
19186 just used for the CS0075 test.
19187 (Binary.DoResolve): Check for CS0075.
19189 2003-07-29 Ravi Pratap <ravi@ximian.com>
19191 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
19192 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
19193 reference comparison.
19195 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
19196 examine the ReturnType for equality - this is necessary in the
19197 cases of implicit and explicit operators whose signature also
19198 includes the return type.
19200 2003-07-26 Miguel de Icaza <miguel@ximian.com>
19202 * namespace.cs: Cache the result of the namespace computation,
19203 instead of computing it every time.
19205 2003-07-24 Miguel de Icaza <miguel@ximian.com>
19207 * decl.cs: Use a global arraylist that we reuse over invocations
19208 to avoid excesive memory consumption. Reduces memory usage on an
19209 mcs compile by one meg (45 average).
19211 * typemanager.cs (LookupTypeReflection): In .NET pointers are
19212 private, work around that.
19214 2003-07-23 Miguel de Icaza <miguel@ximian.com>
19216 * literal.cs (IntLiteral): Define Zero and One static literals.
19218 * cs-parser.jay (integer_literal): use static literals to reduce
19219 memory usage for the most used literals (0, 1 and -1). 211kb
19220 reduced in memory usage.
19222 Replace all calls to `new ArrayList' with `new
19223 ArrayList(4)' which is a good average number for most allocations,
19224 and also requires only 16 bytes of memory for its buffer by
19227 This reduced MCS memory usage in seven megabytes for the RSS after
19230 2003-07-28 Ravi Pratap <ravi@ximian.com>
19232 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
19233 handle params methods the correct way by forming only one
19234 applicable set with params and normal methods in them. Earlier we
19235 were looking at params methods only if we found no normal methods
19236 which was not the correct thing to do.
19238 (Invocation.BetterFunction): Take separate arguments indicating
19239 when candidate and the best method are params methods in their
19242 This fixes bugs #43367 and #46199.
19244 * attribute.cs: Documentation updates.
19246 (CheckAttribute): Rename to CheckAttributeTarget.
19247 (GetValidPlaces): Rename to GetValidTargets.
19249 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
19250 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
19254 2003-07-28 Martin Baulig <martin@ximian.com>
19256 * class.cs (TypeContainer.DefineMembers): Use the base type's full
19257 name when looking up the base class of a nested class. Fixes #46977.
19259 2003-07-26 Martin Baulig <martin@ximian.com>
19261 * expression.cs (Indexers.Indexer): New nested struct; contains
19262 getter, setter and the indexer's type.
19263 (Indexers.Properties): This is now an ArrayList of
19264 Indexers.Indexer's.
19265 (IndexerAccess.DoResolveLValue): Correctly set the type if the
19266 indexer doesn't have any getters.
19268 * assign.cs (Assign.DoResolve): Also do the implicit conversions
19269 for embedded property and indexer assignments.
19271 2003-07-26 Martin Baulig <martin@ximian.com>
19273 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
19274 preprocessor directive is not the first non-whitespace character
19277 2003-07-26 Martin Baulig <martin@ximian.com>
19279 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
19280 namespace parsing, follow the spec more closely.
19282 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
19283 NamespaceEntry.Lookup().
19285 2003-07-25 Martin Baulig <martin@ximian.com>
19287 * MethodCore.cs (OverridesSomething): New public field; it's set
19288 from TypeContainer.DefineMembers if this method overrides
19289 something (which doesn't need to be a method). Fix #39462.
19291 2003-07-25 Ravi Pratap <ravi@ximian.com>
19293 * typemanager.cs (GetMembers): Ensure that the list of members is
19294 reversed. This keeps things in sync.
19296 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
19297 find an AttributeUsage attribute.
19299 * expression.cs (Invocation.OverloadResolve): Perform the check
19300 which disallows Invoke to be directly called on a Delegate.
19302 (Error_InvokeOnDelegate): Report error cs1533.
19304 2003-07-25 Martin Baulig <martin@ximian.com>
19306 * expression.cs (Indexers.GetIndexersForType): Only look in the
19307 interface hierarchy if the requested type is already an
19308 interface. Fixes #46788 while keeping #46502 fixed.
19310 2003-07-25 Martin Baulig <martin@ximian.com>
19312 * class.cs (TypeContainer.DefineMembers): Check whether all
19313 readonly fields have been assigned and report warning CS0649 if
19316 * statement.cs (LocalInfo.IsFixed): Always return true if this is
19319 2003-07-24 Ravi Pratap <ravi@ximian.com>
19321 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
19322 returned from GetMethods to make things consistent with the
19323 assumptions MCS makes about ordering of methods.
19325 This should comprehensively fix bug #45127 and it does :-)
19327 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
19328 ordering is actually reverse.
19330 * Clean up some debug messages I left lying around.
19332 * interface.cs (Populate*): Get rid of code which emits attributes
19333 since the stage in which we emit attributes is the 'Emit' stage,
19334 not the define stage.
19336 (Emit): Move attribute emission for interface members here.
19338 2003-07-22 Ravi Pratap <ravi@ximian.com>
19340 * expression.cs (Invocation.OverloadResolve): Follow the spec more
19341 closely: we eliminate methods in base types when we have an
19342 applicable method in a top-level type.
19344 Please see section 14.5.5.1 for an exact description of what goes
19347 This fixes bug #45127 and a host of other related to corlib compilation.
19349 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
19350 array is the method corresponding to the top-level type (this is
19351 because of the changes made to icall.c) so we change this
19354 (MethodGroupExpr.Name): This too.
19356 * typemanager.cs (GetElementType): New method which does the right
19357 thing when compiling corlib.
19359 * everywhere: Make use of the above in the relevant places.
19361 2003-07-22 Martin Baulig <martin@ximian.com>
19363 * cs-parser.jay (invocation_expression): Moved
19364 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
19365 `cast_expression', but create a InvocationOrCast which later
19366 resolves to either an Invocation or a Cast.
19368 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
19369 method; call this before EmitStatement() to make sure that this
19370 expression can be used as a statement.
19372 * expression.cs (InvocationOrCast): New class; resolves to either
19373 an Invocation or a Cast.
19375 * statement.cs (StatementExpression): Call ResolveStatement() on
19376 the ExpressionStatement before emitting it.
19378 2003-07-21 Martin Baulig <martin@ximian.com>
19380 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
19381 `ref' and `out' attributes match; fixes #46220.
19382 (MemberAccess.ResolveMemberAccess): You can't reference a type
19383 through an expression; fixes #33180.
19384 (Indexers.GetIndexersForType): Don't return the indexers from
19385 interfaces the class implements; fixes #46502.
19387 2003-07-21 Martin Baulig <martin@ximian.com>
19389 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
19390 CS0661 checks; fixes bug #30442.
19392 2003-07-21 Martin Baulig <martin@ximian.com>
19394 * decl.cs (AdditionResult): Added `Error'.
19396 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
19398 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
19399 makes cs0031.cs actually work.
19401 2003-07-20 Martin Baulig <martin@ximian.com>
19403 * namespace.cs: Fixed that bug which caused a crash when compiling
19404 the debugger's GUI.
19406 2003-07-20 Miguel de Icaza <miguel@ximian.com>
19408 * typemanager.cs (LookupTypeReflection): Never expose types which
19409 are NotPublic, NestedPrivate, NestedAssembly, or
19410 NestedFamANDAssem. We used to return these, and later do a check
19411 that would report a meaningful error, but the problem is that we
19412 would not get the real match, if there was a name override.
19414 2003-07-18 Miguel de Icaza <miguel@ximian.com>
19416 * namespace.cs (Namespace, Name): Do not compute the namespace
19417 name dynamically, compute it in the constructor. This reduced
19418 memory usage by 1697 KB.
19420 * driver.cs: Use --pause to pause at the end.
19422 2003-07-17 Peter Williams <peter@newton.cx>
19424 * Makefile: Change the name of the test target so that it doesn't
19425 conflict with the recursive test target.
19427 2003-07-17 Miguel de Icaza <miguel@ximian.com>
19429 * expression.cs (LocalVariableReference.Emit, EmitAssign,
19430 AddressOf): Do not use EmitThis, that was wrong, use the actual
19433 2003-07-15 Miguel de Icaza <miguel@ximian.com>
19435 * class.cs (MethodData.Define): While checking if a method is an
19436 interface implementation, improve the test: If we are not public
19437 (use new test here: use the computed MethodAttributes directly,
19438 instead of the parsed modifier flags) check if the `implementing'
19439 method comes from an interface or not.
19441 * pending.cs (VerifyPendingMethods): Slightly better error
19444 * makefile: add test target that does the mcs bootstrap.
19446 2003-07-16 Ravi Pratap <ravi@ximian.com>
19448 * interface.cs (Define): Do nothing here since there are no
19449 members to populate etc. Move the attribute emission out of here
19450 since this was just totally the wrong place to put it. Attribute
19451 application happens during the 'Emit' phase, not in the 'Define'
19454 (Emit): Add this method and move the attribute emission here
19456 * rootcontext.cs (EmitCode): Call the Emit method on interface
19459 2003-07-14 Ravi Pratap M <ravi@ximian.com>
19461 * expression.cs (OverloadResolve): Report error only if Location
19462 is not 'Null' which means that there was a probe going on.
19464 2003-07-14 Martin Baulig <martin@ximian.com>
19466 * expression.cs (ConditionalLogicalOperator): New public class to
19467 implement user defined conditional logical operators.
19468 This is section 14.11.2 in the spec and bug #40505.
19470 2003-07-14 Martin Baulig <martin@ximian.com>
19472 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
19474 2003-07-14 Martin Baulig <martin@ximian.com>
19476 * codegen.cs (EmitContext.InFixedInitializer): New public field.
19478 * ecore.cs (IVariable.VerifyFixed): New interface method.
19480 * expression.cs (Unary.ResolveOperator): When resolving the `&'
19481 operator, check whether the variable is actually fixed. Fixes bug
19482 #36055. Set a variable definitely assigned when taking its
19483 address as required by the spec.
19485 * statement.cs (LocalInfo.IsFixed): New field.
19486 (LocalInfo.MakePinned): Set `IsFixed' to true.
19488 2003-07-14 Ravi Pratap M <ravi@ximian.com>
19490 * attribute.cs (Attribute.Resolve): While doing a Member lookup
19491 for .ctors, ensure that we only ask for members declared in the
19492 attribute type (BindingFlags.DeclaredOnly).
19496 * expression.cs (Error_WrongNumArguments): Report error 1501
19497 correctly the way CSC does.
19499 2003-07-13 Martin Baulig <martin@ximian.com>
19501 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
19502 lookup on the fully qualified name, to make things like "X.X" work
19503 where "X.X" is a fully qualified type name, but we also have a
19504 namespace "X" in the using list. Fixes #41975.
19506 2003-07-13 Martin Baulig <martin@ximian.com>
19508 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
19509 function. If we're a CompoundAssign, we need to create an embedded
19510 CompoundAssign, not an embedded Assign.
19511 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
19514 2003-07-13 Martin Baulig <martin@ximian.com>
19516 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
19517 work to fix bug #46088.
19519 2003-07-13 Ravi Pratap <ravi@ximian.com>
19521 * class.cs (Operator.Emit): Do not emit attributes here - it is
19522 taken care of by the Method class that we delegate too. This takes
19523 care of bug #45876.
19525 2003-07-10 Martin Baulig <martin@ximian.com>
19527 * expression.cs (TypeOfVoid): New class.
19528 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
19530 2003-07-10 Martin Baulig <martin@ximian.com>
19532 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
19535 2003-07-10 Martin Baulig <martin@ximian.com>
19537 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
19538 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
19540 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
19542 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
19544 2003-07-10 Martin Baulig <martin@ximian.com>
19546 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
19547 of decimal. Fixes #42850.
19549 NOTE: I also fixed the created byte blob, but this doesn't work on
19550 the MS runtime and csc never produces any byte blobs for decimal
19553 2003-07-10 Martin Baulig <martin@ximian.com>
19555 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
19556 structs; fixes #32068.
19557 (Block.AddChildVariableNames): Fixed #44302.
19559 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19561 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
19563 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19565 * attribute.cs: And this test is onger needed.
19567 2003-07-08 Martin Baulig <martin@ximian.com>
19569 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
19570 inaccessible types. Fixes #36313.
19572 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
19574 * namespace.cs (NamespaceEntry): Create implicit entries for all
19575 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
19576 implicit entries for N1.N2 and N1.
19578 2003-07-08 Martin Baulig <martin@ximian.com>
19580 Rewrote the handling of namespaces to fix a lot of the issues
19581 wrt. `using' aliases etc.
19583 * namespace.cs (Namespace): Splitted this class into a
19584 per-assembly `Namespace' and a per-file `NamespaceEntry'.
19586 * typemanager.cs (TypeManager.IsNamespace): Removed.
19587 (TypeManager.ComputeNamespaces): Only compute namespaces from
19588 loaded assemblies here, not the namespaces from the assembly we're
19589 currently compiling.
19591 2003-07-08 Martin Baulig <martin@ximian.com>
19593 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
19595 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19597 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
19600 I thought about the memory savings here, but LookupTypeReflection
19601 is used under already very constrained scenarios. Compiling
19602 corlib or mcs only exposes one hit, so it would not really reduce
19603 any memory consumption.
19605 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19607 * typemanager.cs: fixes bug #45889 by only adding public types from
19608 other assemblies to the list of known types.
19610 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19612 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
19613 on the type we resolved.
19615 2003-07-05 Martin Baulig <martin@ximian.com>
19617 * pending.cs (PendingImplementation.ParentImplements): Don't
19618 create the proxy if the parent is abstract.
19620 * class.cs (TypeContainer.DefineIndexers): Process explicit
19621 interface implementations first. Fixes #37714.
19623 2003-07-04 Miguel de Icaza <miguel@ximian.com>
19625 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
19626 defined recursively; but since we modify the input parameters
19627 (left is set to `this' temporarily), we reset this value if the
19628 left_is_explicit is false, which gives the original semantics to
19631 * literal.cs (NullPointer): new class used to represent a null
19632 literal in a pointer context.
19634 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
19635 type is a pointer, use a NullPointer object instead of a
19636 NullLiteral. Closes 43687
19638 (ExplicitConversion): Convert pointer values using
19639 the conv opcode to the proper type.
19641 * ecore.cs (New): change ValueTypeVariable property into a method,
19642 that returns whether the valuetype is suitable for being used.
19644 * expression.cs (Binary.DoNumericPromotions): Only return if we
19645 the int constant was a valid uint, and we can return both left and
19646 right as uints. If not, we continue processing, to trigger the
19647 type conversion. This fixes 39018.
19649 * statement.cs (Block.EmitMeta): During constant resolution, set
19650 the CurrentBlock property on the emitcontext, so that we resolve
19651 constants propertly.
19653 2003-07-02 Martin Baulig <martin@ximian.com>
19655 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
19656 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
19658 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
19659 than emitting it here.
19661 * statement.cs: Fixed some more flow analysis bugs.
19663 2003-07-02 Martin Baulig <martin@ximian.com>
19665 * class.cs (MethodData.Define): When implementing interface
19666 methods, set Final unless we're Virtual.
19668 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
19669 check work for interface methods.
19671 2003-07-01 Martin Baulig <martin@ximian.com>
19673 * ecore.cs (EmitContext.This): Replaced this property with a
19674 GetThis() method which takes a Location argument. This ensures
19675 that we get the correct error location for a CS0188.
19677 2003-07-01 Miguel de Icaza <miguel@ximian.com>
19679 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
19680 ImplicitStandardConversion.
19682 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
19684 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
19686 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
19689 2003-06-30 Miguel de Icaza <miguel@ximian.com>
19691 * class.cs (Constructor.Define): Turn off initlocals for unsafe
19694 (MethodData.Define): Turn off initlocals for unsafe methods.
19696 2003-06-29 Miguel de Icaza <miguel@ximian.com>
19698 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
19699 complete; Fixes #37521.
19701 * delegate.cs: Use Modifiers.TypeAttr to compute the
19702 TypeAttributes, instead of rolling our own. This makes the flags
19703 correct for the delegates.
19705 2003-06-28 Miguel de Icaza <miguel@ximian.com>
19707 * class.cs (Constructor.Define): Set the private flag for static
19708 constructors as well.
19710 * cs-parser.jay (statement_expression): Set the return value to
19711 null, to avoid a crash when we catch an error.
19713 2003-06-24 Miguel de Icaza <miguel@ximian.com>
19715 * cs-parser.jay: Applied patch from Jackson that adds support for
19716 extern and unsafe modifiers to destructor declarations.
19718 * expression.cs: Report error 21 if the user is trying to index a
19721 * driver.cs: Add an error message, suggested by the bug report.
19723 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
19724 if we do not have a ": this ()" constructor initializer. Fixes 45149
19726 2003-06-14 Miguel de Icaza <miguel@ximian.com>
19728 * namespace.cs: Add some information to reduce FAQs.
19730 2003-06-13 Miguel de Icaza <miguel@ximian.com>
19732 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
19733 underlying enumeration types. Fixes #43915.
19735 * expression.cs: Treat ushort/short as legal values to be used in
19736 bitwise operations.
19738 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
19740 * delegate.cs: transfer custom attributes for paramenters from
19741 the delegate declaration to Invoke and BeginInvoke.
19743 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
19745 * attribute.cs: handle custom marshalers and emit marshal info
19748 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
19750 * makefile.gnu: Added anonymous.cs to the compiler sources.
19752 2003-05-28 Miguel de Icaza <miguel@ximian.com>
19754 * iterators.cs: Change the name of the proxy class to include two
19757 * cs-parser.jay: Update grammar to include anonymous methods.
19759 * anonymous.cs: new file.
19761 2003-05-27 Miguel de Icaza <miguel@ximian.com>
19763 * class.cs (Field.Define): Add missing test for pointers and
19766 2003-05-27 Ravi Pratap <ravi@ximian.com>
19768 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
19769 we use the stobj opcode.
19771 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
19772 since it wasn't the correct fix.
19774 It still is puzzling that we are required to use stobj for IntPtr
19775 which seems to be a ValueType.
19777 2003-05-26 Miguel de Icaza <miguel@ximian.com>
19779 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
19780 during regular simple name resolution. Now, the trick is that
19781 instead of returning for processing the simplename, we do a
19782 TypeManager.LookupType (ie, a rooted lookup as opposed to a
19783 contextual lookup type). If a match is found, return that, if
19784 not, return for further composition.
19786 This fixes long-standing 30485.
19788 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19789 using the address to initialize an object, do an Stobj instead of
19790 using the regular Stelem.
19792 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
19793 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
19794 Because if we are a BaseIndexerAccess that value will be true.
19797 * statement.cs (GotoCase.Resolve): Return after reporting an
19798 error, do not attempt to continue.
19800 * expression.cs (PointerArithmetic.Emit): If our operand is a
19801 long, convert our constants to match the operand before
19802 multiplying. Convert to I type before adding. Fixes 43670.
19804 2003-05-14 Ravi Pratap <ravi@ximian.com>
19806 * enum.cs (ImplicitConversionExists) : Rename to
19807 ImplicitEnumConversionExists to remove ambiguity.
19809 * ecore.cs (NullCast): New type of cast expression class which
19810 basically is very similar to EmptyCast with the difference being
19811 it still is a constant since it is used only to cast a null to
19813 (eg. (string) null)
19815 * convert.cs (ImplicitReferenceConversion): When casting a null
19816 literal, we return a NullCast.
19818 * literal.cs (NullLiteralTyped): Remove - I don't see why this
19819 should be around anymore.
19821 The renaming (reported was slightly wrong). Corrections:
19823 ConvertImplicitStandard -> ImplicitConversionStandard
19824 ConvertExplicitStandard -> ExplicitConversionStandard
19826 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
19827 before passing them in !
19829 * convert.cs (ImplicitConversionStandard): When comparing for
19830 equal expr and target types, ensure that expr is not a
19833 In general, we must not be checking (expr_type ==
19834 target_type) in the top level conversion methods
19835 (ImplicitConversion, ExplicitConversion etc). This checking is
19836 done in the methods that they delegate to.
19838 2003-05-20 Miguel de Icaza <miguel@ximian.com>
19840 * convert.cs: Move Error_CannotConvertType,
19841 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
19842 ImplicitNumericConversion, ImplicitConversionExists,
19843 ImplicitUserConversionExists, StandardConversionExists,
19844 FindMostEncompassedType, FindMostSpecificSource,
19845 FindMostSpecificTarget, ImplicitUserConversion,
19846 ExplicitUserConversion, GetConversionOperators,
19847 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
19848 TryImplicitIntConversion, Error_CannotConvertImplicit,
19849 ConvertImplicitRequired, ConvertNumericExplicit,
19850 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
19851 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
19854 Perform the following renames:
19856 StandardConversionExists -> ImplicitStandardConversionExists
19857 ConvertImplicit -> ImplicitConversion
19858 ConvertImplicitStandard -> ImplicitStandardConversion
19859 TryImplicitIntConversion -> ImplicitIntConversion
19860 ConvertImplicitRequired -> ImplicitConversionRequired
19861 ConvertNumericExplicit -> ExplicitNumericConversion
19862 ConvertReferenceExplicit -> ExplicitReferenceConversion
19863 ConvertExplicit -> ExplicitConversion
19864 ConvertExplicitStandard -> ExplicitStandardConversion
19866 2003-05-19 Martin Baulig <martin@ximian.com>
19868 * statement.cs (TypeInfo.StructInfo): Made this type protected.
19869 (TypeInfo): Added support for structs having structs as fields.
19871 * ecore.cs (FieldExpr): Implement IVariable.
19872 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
19873 VariableInfo for the field.
19875 2003-05-18 Martin Baulig <martin@ximian.com>
19877 * expression.cs (This.DoResolve): Report a CS0027 if we're
19878 emitting a field initializer.
19880 2003-05-18 Martin Baulig <martin@ximian.com>
19882 * expression.cs (This.ResolveBase): New public function.
19883 (This.DoResolve): Check for CS0188.
19885 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
19888 * ecore.cs (MethodGroupExpr.DoResolve): Set the
19889 `instance_expression' to null if we don't have any non-static
19892 2003-05-18 Martin Baulig <martin@ximian.com>
19894 Reworked the way how local variables and parameters are handled by
19895 the flow analysis code.
19897 * statement.cs (TypeInfo, VariableMap): New public classes.
19898 (VariableInfo): New public class. This is now responsible for
19899 checking whether a variable has been assigned. It is used for
19900 parameters and local variables.
19901 (Block.EmitMeta): Take the InternalParameters as argument; compute
19902 the layout of the flow vectors here.
19903 (Block.LocalMap, Block.ParameterMap): New public properties.
19904 (FlowBranching): The .ctor doesn't get the InternalParameters
19905 anymore since Block.EmitMeta() now computes the layout of the flow
19907 (MyStructInfo): This class is now known as `StructInfo' and nested
19908 in `TypeInfo'; we don't access this directly anymore.
19910 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
19911 property and removed IsAssigned(), IsFieldAssigned(),
19912 SetAssigned() and SetFieldAssigned(); we now call them on the
19913 VariableInfo so we don't need to duplicate this code everywhere.
19915 * expression.cs (ParameterReference): Added `Block block' argument
19917 (LocalVariableReference, ParameterReference, This): The new
19918 VariableInfo class is now responsible for all the definite
19921 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
19922 IsParameterAssigned, SetParameterAssigned): Removed.
19924 2003-05-18 Martin Baulig <martin@ximian.com>
19926 * typemanager.cs (InitCoreTypes): Try calling
19927 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
19928 the 3-args-version. Corlib now also needs our `void_type'.
19929 (GetMethod): Added overloaded version which takes an optional
19930 `bool report_errors' to allow lookups of optional methods.
19932 2003-05-12 Martin Baulig <martin@ximian.com>
19934 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
19935 only used for locals and not for parameters.
19937 2003-05-12 Miguel de Icaza <miguel@ximian.com>
19939 * support.cs (InternalParameters.ParameterType): Return the
19940 ExternalType of the parameter.
19942 * parameter.cs (Parameter.ExternalType): drop the two arguments,
19945 2003-05-11 Miguel de Icaza <miguel@ximian.com>
19947 * class.cs (MethodData.Define): Do not set the `newslot' on
19948 interface members, if they are also flagged as "override".
19950 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
19951 better code for ++i and i++. This only works for static fields
19952 and local variables.
19954 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
19955 want to pull the DeclSpace out of the builder_to_declspace instead
19956 of the TypeBuilder (like in TypeContainer.FindMembers).
19958 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
19959 instead of LookupTypeContainer. Fixes the crash on .NET for
19960 looking up interface members.
19962 * const.cs: Create our own emit context during the Definition
19963 stage, so that constants are evaluated in the proper context, when
19964 a recursive definition happens.
19966 2003-05-11 Martin Baulig <martin@ximian.com>
19968 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
19969 new block for a switch section.
19970 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
19971 the adding/lookup in the switch block. Fixes #39828.
19973 2003-05-09 Miguel de Icaza <miguel@ximian.com>
19975 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
19976 functionality: I needed to convert the data after I had performed
19977 the add/sub operation into the operands type size.
19979 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
19980 pass the type for the box operation, otherwise the resulting
19981 object would have been of type object.
19983 (BoxedCast): Add constructor to specify the type to box as.
19985 2003-05-07 Miguel de Icaza <miguel@ximian.com>
19987 * iterators.cs: I was reusing the `count' variable inadvertently,
19988 take steps to not allow this to happen.
19990 2003-05-06 Miguel de Icaza <miguel@ximian.com>
19992 * attribute.cs (Attribute.Resolve): Params attributes are encoded
19993 by creating an array at the point where the params starts and
19994 putting all those arguments there, then adjusting the size of the
19997 2003-05-05 Miguel de Icaza <miguel@ximian.com>
19999 * expression.cs (New.AddressOf): Implement interface
20000 IMemoryLocation. This is used when the `new' operator is used in
20001 the context of an invocation to a method on a value type.
20003 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
20006 * namespace.cs: Also check the using aliases here.
20008 * driver.cs: Move the test for using validity after the types have
20009 been entered, so we do a single pass that also includes the using
20012 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
20013 in the regular case. CreateSiblingForFinally is doing extra
20016 * attribute.cs (GetAttributeArgumentExpression): Store the result
20017 on an out value, and use the return value to indicate failure
20018 instead of using null (which is a valid return for Constant.GetValue).
20020 * statement.cs: Perform the analysis flow for the increment
20021 portion after the statement, because this will be the real flow of
20022 execution. Fixes #42385
20024 * codegen.cs (EmitContext.EmitArgument,
20025 EmitContext.EmitStoreArgument): New helper functions when the
20026 RemapToProxy flag is set.
20028 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
20031 Add support for remapping parameters.
20033 * iterators.cs: Propagate parameter values; Store parameter
20034 values in the proxy classes.
20036 2003-05-04 Miguel de Icaza <miguel@ximian.com>
20038 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
20039 need a proxy reference; I do not know what I was thinking
20041 * cs-parser.jay (constructor_initializer): catch another error,
20042 and display nice message.
20044 (field_declaration): catch void field declaration
20045 to flag a better error.
20047 * class.cs (MemberBase.CheckBase): Report an error instead of a
20048 warning if a new protected member is declared in a struct.
20049 (Field.Define): catch the error of readonly/volatile.
20051 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
20053 (FieldExpr.AddressOf): ditto. Catch error where the address of a
20054 volatile variable is taken
20056 2003-05-02 Miguel de Icaza <miguel@ximian.com>
20058 * statement.cs (Fixed.Resolve): Report an error if we are not in
20061 2003-05-01 Miguel de Icaza <miguel@ximian.com>
20063 * typemanager.cs: reuse the code that handles type clashes for
20064 delegates and enumerations.
20066 * class.cs (Report28): Always report.
20068 * expression.cs (EncodeAsAttribute): Allow nulls here.
20070 2003-04-28 Miguel de Icaza <miguel@ximian.com>
20072 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
20073 the functionality for testing whether an expression is valid for
20074 an attribute here. Also handle the case of arrays of elements
20077 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
20078 encoding a linear array into an array of objects that are suitable
20079 to be passed to an CustomAttributeBuilder.
20081 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
20083 * ecore.cs: (FieldExpr): Handle field remapping here.
20085 * iteratators.cs: Pass the instance variable (if the method is an
20086 instance method) to the constructors, so we can access the field
20087 variables on the class.
20089 TODO: Test this with structs. I think the THIS variable on
20090 structs might have to be a pointer, and not a refenrece
20092 2003-04-27 Miguel de Icaza <miguel@ximian.com>
20094 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
20095 local variables to fields in a proxy class.
20097 * iterators.cs (PopulateProxy): Rename our internal fields to
20099 Create a <THIS> field if we are an instance method, so we can
20100 reference our parent container variables.
20101 (MapVariable): Called back from the EmitContext code to enter a
20102 new variable to field mapping into the proxy class (we just create
20106 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
20107 for using the remapped locals to fields.
20109 I placed the code here, because that gives the same semantics to
20110 local variables, and only changes the Emit code.
20112 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
20113 statements inside iterators.
20114 (VariableInfo): Add a FieldBuilder for the cases when we are
20115 remapping local variables to fields in a proxy class
20117 * ecore.cs (SimpleNameResolve): Avoid testing two times for
20118 current_block != null.
20120 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
20121 not cope with strings, as it has been moved to the
20122 TableSwitchEmit. Fixed bug in switch generation.
20124 * expression.cs (New.DoResolve): Provide more context for the user
20125 when reporting an error.
20127 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
20130 * expression.cs (MemberAccess.DoResolve): When we get a type back,
20131 check the permissions for it. Note than in a type-resolution
20132 context the check was already present in DeclSpace.ResolveType,
20133 but was missing from the MemberAccess.
20135 (ArrayCreation.CheckIndices): warn if the user has
20136 more nested levels of expressions, but there are no more
20137 dimensions specified. Avoids crash on bug 41906.
20139 2003-04-26 Miguel de Icaza <miguel@ximian.com>
20141 * statement.cs (Block): replace Implicit bool, for a generic
20143 New flag: `Unchecked'. This is used during the EmitMeta phase
20144 (which is out-of-line with the regular Resolve/Emit process for a
20145 statement, as this is done ahead of time, but still gets a chance
20146 to call constant resolve).
20148 (Block.Flags): new enum for adding a new flag.
20150 (Block.EmitMeta): track the state of unchecked.
20152 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
20153 to enable constant resolution to work there as well.
20155 2003-04-22 Miguel de Icaza <miguel@ximian.com>
20157 * typemanager.cs (ienumerable_type): Also look up
20158 System.Collections.IEnumerable.
20160 2003-04-21 Miguel de Icaza <miguel@ximian.com>
20162 TODO: Test more than one conditional per method.
20164 * class.cs (Indexer.Define): Report the location where the user is
20165 referencing the unsupported feature.
20167 (MethodData): Overload the use of `conditionals' to
20168 minimize the creation of needless ArrayLists. This saves roughly
20169 212kb on my machine.
20171 (Method): Implement the new IIteratorContainer interface.
20172 (Method.SetYields): Implement the method by setting the ModFlags
20173 to contain METHOD_YIELDS.
20175 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
20176 which just got set to null.
20178 * iterators.cs: New file.
20180 (Yield, YieldBreak): New statements.
20182 * statement.cs (Return.Resolve): Flag an error if we are used in
20183 an iterator method.
20185 * codegen.cs (InIterator): New flag set if the code is being
20186 compiled in an iterator method.
20188 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
20189 internal modifier, and we just use it to avoid adding extra
20190 fields, as this is seldom used.
20192 * cs-parser.jay: Add yield_statement (yield and yield break).
20194 * driver.cs: New flag -v2 to turn on version 2 features.
20196 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
20197 hashtable when v2 is enabled.
20199 2003-04-20 Miguel de Icaza <miguel@ximian.com>
20201 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
20202 there is already a namespace defined with this name.
20204 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
20205 people upgraded their corlibs.
20207 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
20208 always use fully qualified types, no need to use the compiler
20211 (TypeManager.IsNamespace): Use binarysearch.
20213 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
20214 AddDelegate): I did not quite use the new IsValid API properly: I
20215 have to pass the short-name and the fullname. I was passing only
20216 the basename instead of the fullname sometimes.
20218 (TypeContainer.DefineType): call NamespaceClash.
20220 * interface.cs (Interface.DefineType): use NamespaceClash before
20223 * delegate.cs (Delegate.DefineType): use NamespaceClash before
20226 * enum.cs: (Enum.DefineType): use NamespaceClash before
20229 * typemanager.cs (: 3-line patch that gives us some tasty 11%
20230 speed increase. First, use the negative_hits cache when we get a
20231 negative. Second, add the type with its full original name
20232 instead of the new . and + encoded name (reflection uses + to
20233 separate type from a nested type). Use LookupTypeReflection
20234 directly which bypasses the type->name hashtable (that we already
20235 know does not contain the type.
20237 * decl.cs (DeclSpace.ResolveTypeExpr): track the
20238 location/container type.
20240 * driver.cs: When passing utf8, use directly the UTF8Encoding.
20242 2003-04-19 Miguel de Icaza <miguel@ximian.com>
20244 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
20246 * delegate.cs (NewDelegate.Resolve): Test whether an instance
20247 method is being referenced in the method group from a static
20248 context, and report error 120 if so.
20250 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
20253 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
20254 is created, we create the A namespace).
20256 * cs-parser.jay: A namespace also introduces a DeclarationFound.
20259 2003-04-18 Miguel de Icaza <miguel@ximian.com>
20261 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
20262 invocation to ModuleBuilder.GetType with the same values will
20263 return a new type instance, so we need to cache its return
20266 * expression.cs (Binary.ResolveOperator): Only allow the compare
20267 operators on enums if they are of the same type.
20269 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
20270 types of ValueType on their own case. Before we were giving them
20271 the same treatment as objects.
20273 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
20274 fullname. Short name is used to compare against container name.
20275 Fullname is used to check against defined namespace names.
20277 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
20278 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
20280 (Method.CheckBase): Call parent.
20281 (MemberBase.CheckBase): Check for protected members on sealed
20283 (PropertyBase.CheckBase): Call parent.
20284 (Field.Define): Call parent.
20286 * report.cs: Negative error codes are now mapped to 8000 - code,
20287 so that the display is render more nicely.
20289 * typemanager.cs: Do not use try/catch, instead report a regular
20292 (GetPointerType, GetReferenceType): These methods provide
20293 mechanisms to obtain the T* and T& from a T. We had the code
20294 previously scattered around the code base, and it also used
20295 TypeManager.LookupType that would go through plenty of caches.
20296 This one goes directly to the type source.
20298 In some places we did the Type.GetType followed by
20299 ModuleBuilder.GetType, but not in others, so this unifies the
20300 processing as well.
20302 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
20303 statements now that we have namespace information.
20305 * typemanager.cs (IsNamespace): New method, returns whether the
20306 string presented is a namespace or not.
20308 (ComputeNamespaces): New public entry point, computes the list of
20309 available namespaces, using the GetNamespaces API call in Mono, or
20310 the slower version in MS.NET.
20312 Now before we start the semantic analysis phase, we have a
20313 complete list of namespaces including everything that the user has
20316 Deleted old code to cache namespaces in .nsc files.
20318 2003-04-17 Miguel de Icaza <miguel@ximian.com>
20320 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
20321 class/struct location definition Location for the implicit
20322 constructor location.
20324 (Operator.Define): Use the location of the operator for the
20325 implicit Method definition.
20327 (Constructor.Emit): use the constructor location for the implicit
20328 base initializer constructor.
20330 * ecore.cs: Remove ITypeExpression. This interface is now gone,
20331 and the Expression class now contains two new methods:
20333 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
20334 isolate type lookup from the rest of the resolution process.
20336 Since we use Expressions to hold type definitions due to the way
20337 we parse the input we have historically overloaded Resolve to
20338 perform the Type lookups if a special flag is passed. Now this is
20339 eliminated and two methods take their place.
20341 The differences in the two methods between xStep and xTerminal is
20342 that xStep is involved in our current lookup system that uses
20343 SimpleNames to compose a name, while xTerminal is used just to
20344 catch the case where the simplename lookup failed.
20346 2003-04-16 Miguel de Icaza <miguel@ximian.com>
20348 * expression.cs (ResolveMemberAccess): Remove redundant code.
20349 TypeExpr expressions are always born fully resolved.
20351 * interface.cs (PopulateMethod): Do not lookup the types twice.
20352 We were doing it once during SemanticAnalysis and once during
20355 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
20356 in local variable type definitions, were being returned as a
20357 SimpleName (we decomposed everything into a string), that is
20358 because primary_expression was being used instead of a type in the
20359 grammar (reduce/reduce conflicts).
20361 The part that was wrong is that we converted the expression into a
20362 string (an oversimplification in one hand, compounded with primary
20363 expressions doing string concatenation).
20369 Would return "A.B.C[]" as a SimpleName. This stopped things like
20370 using clauses from working on this particular context. And a type
20371 was being matched directly against "A.B.C[]".
20373 We now use the correct approach, and allow for ComposedCast to be
20374 part of the unary expression. So the "A.B.C []" become a composed
20375 cast of "A.B.C" (as a nested group of MemberAccess with a
20376 SimpleName at the end) plus the rank composition "[]".
20380 2003-04-10 Miguel de Icaza <miguel@ximian.com>
20382 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
20383 for the access level checking.
20385 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
20386 `TypeContainer container', because I kept getting confused when I
20387 was debugging this code.
20389 * expression.cs (Indexers): Instead of tracking getters/setters,
20390 we now track them in parallel. We create one arraylist less, but
20391 most importantly it is possible now for the LValue code to find a
20392 matching get for a set.
20394 (IndexerAccess.DoResolveLValue): Update the code.
20395 GetIndexersForType has been modified already to extract all the
20396 indexers from a type. The code assumed it did not.
20398 Also make the code set the correct return type for the indexer.
20399 This was fixed a long time ago for properties, but was missing for
20400 indexers. It used to be void_type.
20402 (Binary.Emit): Test first for doubles instead of
20403 floats, as they are more common.
20405 (Binary.EmitBranchable): Use the .un version of the branch opcodes
20406 when dealing with floats and the <=, >= operators. This fixes bug
20409 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
20410 to load the array value by emitting a load on the foreach variable
20411 type. This was incorrect.
20413 We now emit the code to load an element using the the array
20414 variable type, and then we emit the conversion operator.
20418 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
20420 * attribute.cs: Avoid allocation of ArrayLists in the common case.
20422 2003-04-09 Miguel de Icaza <miguel@ximian.com>
20424 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
20425 test for protection before we test for signatures.
20427 (MethodSignature.ToString): implement.
20429 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
20430 to the case where we reduced into a LongConstant.
20432 * decl.cs (CheckAccessLevel): If the type is an array, we can not
20433 depend on whether the information is acurrate, because the
20434 Microsoft runtime will always claim that the array type is public,
20435 regardless of the real state.
20437 If the type is a pointer, another problem happens: the type is
20438 reported as non-public in Microsoft.
20440 In both cases we have to call CheckAccessLevel recursively with
20441 the underlying type as the argument to be tested.
20443 2003-04-08 Miguel de Icaza <miguel@ximian.com>
20445 * assign.cs (Assign.Emit): If we are dealing with a compound
20446 assignment expression, we should use the code path that stores the
20447 intermediate result in a temporary value. This fixes #40903.
20449 *expression.cs (Indirection.ToString): Provide ToString method for
20452 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
20454 * class.cs: Null out fields holding references to Block objects so
20455 they can be garbage collected.
20457 * expression.cs (OverloadResolve): Remove unused local.
20459 2003-04-07 Martin Baulig <martin@ximian.com>
20461 * codegen.cs (EmitContext.CurrentFile): New public field.
20462 (EmitContext.Mark): Use the CurrentFile to check whether the
20463 location is in the correct file.
20464 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
20466 2003-04-07 Martin Baulig <martin@ximian.com>
20468 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
20470 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
20471 location. [FIXME: The location argument which gets passed to this
20472 method is sometimes wrong!]
20474 2003-04-07 Nick Drochak <ndrochak@gol.com>
20476 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
20478 2003-04-07 Miguel de Icaza <miguel@ximian.com>
20480 * expression.cs (Indirection.EmitAssign): We were using the
20481 temporary, but returning immediately instead of continuing the
20484 2003-04-06 Martin Baulig <martin@ximian.com>
20486 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
20487 if it's a nested child, but also deriving from the outer class.
20490 * typemanager.cs (IsNestedChildOf): Make this work if it's a
20491 nested child, but also deriving from the outer class. See
20493 (FilterWithClosure): We may access private members of the outer
20494 class if we're a nested child and deriving from the outer class.
20495 (RealMemberLookup): Only set `closure_private_ok' if the
20496 `original_bf' contained BindingFlags.NonPublic.
20498 2003-04-05 Martin Baulig <martin@ximian.com>
20500 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
20502 2003-04-02 Miguel de Icaza <miguel@ximian.com>
20504 * class.cs (Event.Define): Do not allow abstract events to have
20507 2003-04-01 Miguel de Icaza <miguel@ximian.com>
20509 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
20510 block in event declarations.
20512 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
20513 value type, get its address.
20515 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
20516 leaving a class on the stack instead of a boolean value (int
20517 0/1). Change the code so we compare against null, and then the
20518 result against zero.
20520 * class.cs (TypeContainer.GetClassBases): We were checking for the
20521 parent class being sealed too late.
20523 * expression.cs (Binary.Emit): For <= and >= when dealing with
20524 floating point values, use cgt.un and clt.un instead of cgt and
20527 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
20529 * statement.cs: Apply the same optimization as MS: skip the
20530 GetEnumerator returning an IEnumerator, and use the one returning a
20531 CharEnumerator instead. This allows us to avoid the try-finally block
20534 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
20536 * cs-parser.jay: Attributes cannot be applied to
20537 namespaces. Fixes #40473
20539 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20542 (Add*): check if the name is valid using the full name for constants,
20543 fields, properties and events.
20545 2003-03-28 Miguel de Icaza <miguel@ximian.com>
20547 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
20548 char constants to be part of the enumeration.
20550 * expression.cs (Conditional.DoResolve): Add support for operator
20551 true. Implements the missing functionality from 14.12
20553 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
20554 operator true/false as required by the spec.
20556 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
20557 implicit conversion to boolean.
20559 * statement.cs (Statement.ResolveBoolean): A boolean expression is
20560 also one where the type implements `operator true'.
20562 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
20563 get an expression that will invoke operator true based on an
20566 (GetConversionOperators): Removed the hack that called op_True
20569 (Expression.ResolveBoolean): Move this from Statement.
20571 2003-03-17 Miguel de Icaza <miguel@ximian.com>
20573 * ecore.cs (FieldExpr): do not allow initialization of initonly
20574 fields on derived classes
20576 2003-03-13 Martin Baulig <martin@ximian.com>
20578 * statement.cs (Block.Emit): Call ig.BeginScope() and
20579 ig.EndScope() when compiling with debugging info; call
20580 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
20582 2003-03-08 Miguel de Icaza <miguel@ximian.com>
20584 * expression.cs (Indexers): Do not construct immediately, allow
20585 for new members to be appended as we go. Fixes 38143
20587 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20589 * expression.cs: save/restore context when resolving an unchecked
20592 2003-03-05 Miguel de Icaza <miguel@ximian.com>
20594 * cfold.cs: Catch division by zero in modulus operator during
20597 2003-03-03 Miguel de Icaza <miguel@ximian.com>
20599 * interface.cs (Interface.DefineMembers): Avoid defining members
20602 2003-02-27 Miguel de Icaza <miguel@ximian.com>
20604 * driver.cs: handle the +/- options for -noconfig
20606 * statement.cs (Unckeched.Resolve): Also track the state of
20607 unchecked in the Resolve phase.
20609 2003-02-27 Martin Baulig <martin@ximian.com>
20611 * ecore.cs (Expression.MemberLookup): Don't create a
20612 MethodGroupExpr for something which is not a method. Fixes #38291.
20614 2003-02-25 Miguel de Icaza <miguel@ximian.com>
20616 * class.cs (MemberBase.CheckParameters): Also check that the type
20617 is unmanaged if it is a pointer.
20619 * expression.cs (SizeOf.Resolve): Add location information.
20621 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
20622 a managed type is declared.
20624 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
20625 parameter modifiers as well. Fixes bug 38606
20627 * class.cs: Very sad. Am backing out the speed up changes
20628 introduced by the ArrayList -> Array in the TypeContainer, as they
20629 were not actually that much faster, and introduced a bug (no error
20630 reports on duplicated methods).
20632 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
20633 source first, this will guarantee that we have a valid expression
20634 before calling in lower levels functions that will require a
20635 resolved object. Then use this original_source in the
20636 target.ResolveLValue instead of the original source that was
20639 Another change. Use target.Resolve instead of LValueResolve.
20640 Although we are resolving for LValues, we will let the Assign code
20641 take care of that (it will be called again from Resolve). This
20642 basically allows code like this:
20644 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
20645 class Y { void A (X x) { x [0] += o; }
20647 The problem was that the indexer was trying to resolve for
20648 set_Item (idx, object o) and never finding one. The real set_Item
20649 was set_Item (idx, X). By delaying the process we get the right
20654 2003-02-23 Martin Baulig <martin@ximian.com>
20656 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
20657 while calling DoEmit ().
20659 * codegen.cs (EmitContext.Mark): Don't mark locations in other
20660 source files; if you use the #line directive inside a method, the
20661 compiler stops emitting line numbers for the debugger until it
20662 reaches the end of the method or another #line directive which
20663 restores the original file.
20665 2003-02-23 Martin Baulig <martin@ximian.com>
20667 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
20669 2003-02-23 Martin Baulig <martin@ximian.com>
20671 * statement.cs (Block.AddChildVariableNames): We need to call this
20672 recursively, not just for our immediate children.
20674 2003-02-23 Martin Baulig <martin@ximian.com>
20676 * class.cs (Event.Define): Always make the field private, like csc does.
20678 * typemanager.cs (TypeManager.RealMemberLookup): Make events
20679 actually work, fixes bug #37521.
20681 2003-02-23 Miguel de Icaza <miguel@ximian.com>
20683 * delegate.cs: When creating the various temporary "Parameters"
20684 classes, make sure that we call the ComputeAndDefineParameterTypes
20685 on those new parameters (just like we do with the formal ones), to
20686 allow them to be resolved in the context of the DeclSpace.
20688 This fixes the bug that Dick observed in Bugzilla #38530.
20690 2003-02-22 Miguel de Icaza <miguel@ximian.com>
20692 * expression.cs (ResolveMemberAccess): When resolving a constant,
20693 do not attempt to pull a constant if the value was not able to
20694 generate a valid constant.
20696 * const.cs (LookupConstantValue): Do not report more errors than required.
20698 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20700 * expression.cs: fixes bug #38328.
20702 2003-02-18 Miguel de Icaza <miguel@ximian.com>
20704 * class.cs: Changed all the various members that can be part of a
20705 class from being an ArrayList to be an Array of the right type.
20706 During the DefineType type_list, interface_list, delegate_list and
20707 enum_list are turned into types, interfaces, delegates and enums
20710 And during the member population, indexer_list, event_list,
20711 constant_list, field_list, instance_constructor_list, method_list,
20712 operator_list and property_list are turned into their real arrays.
20714 Although we could probably perform this operation earlier, for
20715 good error reporting we need to keep the lists and remove the
20716 lists for longer than required.
20718 This optimization was triggered by Paolo profiling the compiler
20719 speed on the output of `gen-sample-program.pl' perl script.
20721 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
20722 not crash in methods like MemberLookupFailed that use this field.
20724 This problem arises when the compiler fails to resolve a type
20725 during interface type definition for example.
20727 2003-02-18 Miguel de Icaza <miguel@ximian.com>
20729 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
20730 inherit from System.Object, so we have to stop at null, not only
20731 when reaching System.Object.
20733 2003-02-17 Miguel de Icaza <miguel@ximian.com>
20735 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
20736 DeclaredOnly because the parent indexer might have had a different
20737 name, but did not loop until the top of the hierarchy was reached.
20739 The problem this one fixes is 35492: when a class implemented an
20740 indexer from an interface, we were getting the interface method
20741 (which was abstract) and we were flagging an error (can not invoke
20744 This also keeps bug 33089 functioning, and test-148 functioning.
20746 * typemanager.cs (IsSpecialMethod): The correct way of figuring
20747 out if a method is special is to see if it is declared in a
20748 property or event, or whether it is one of the predefined operator
20749 names. This should fix correctly #36804.
20751 2003-02-15 Miguel de Icaza <miguel@ximian.com>
20753 The goal here is to remove the dependency on EmptyCast.Peel ().
20754 Killing it completely.
20756 The problem is that currently in a number of places where
20757 constants are expected, we have to "probe" for an EmptyCast, and
20758 Peel, which is not the correct thing to do, as this will be
20759 repetitive and will likely lead to errors.
20761 The idea is to remove any EmptyCasts that are used in casts that
20762 can be reduced to constants, so we only have to cope with
20765 This bug hunt was triggered by Bug 37363 and the desire to remove
20766 the duplicate pattern where we were "peeling" emptycasts to check
20767 whether they were constants. Now constants will always be
20770 * ecore.cs: Use an enumconstant here instead of wrapping with
20773 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
20774 throwing me off. By handling this we can get rid of a few hacks.
20776 * statement.cs (Switch): Removed Peel() code.
20778 2003-02-14 Miguel de Icaza <miguel@ximian.com>
20780 * class.cs: Location information for error 508
20782 * expression.cs (New.DoResolve): Add a guard against double
20783 resolution of an expression.
20785 The New DoResolve might be called twice when initializing field
20786 expressions (see EmitFieldInitializers, the call to
20787 GetInitializerExpression will perform a resolve on the expression,
20788 and later the assign will trigger another resolution
20790 This leads to bugs (#37014)
20792 * delegate.cs: The signature for EndInvoke should contain any ref
20793 or out parameters as well. We were not doing this in the past.
20795 * class.cs (Field.Define): Do not overwrite the type definition
20796 inside the `volatile' group. Turns out that volatile enumerations
20797 were changing the type here to perform a validity test, which
20800 2003-02-12 Miguel de Icaza <miguel@ximian.com>
20802 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
20803 and structs, we do not want to load the instance variable
20805 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
20806 enum_type has to be handled like an object reference (implicit
20807 conversions exists from this to object), but the regular IsClass
20808 and IsValueType tests will never return true for this one.
20810 Also we use TypeManager.IsValueType instead of type.IsValueType,
20811 just for consistency with the rest of the code (this is only
20812 needed if we ever use the construct exposed by test-180.cs inside
20813 corlib, which we dont today).
20815 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
20817 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
20820 2003-02-09 Martin Baulig <martin@ximian.com>
20822 * namespace.cs (Namespace..ctor): Added SourceFile argument.
20823 (Namespace.DefineNamespaces): New static public method; this is
20824 called when we're compiling with debugging to add all namespaces
20825 to the symbol file.
20827 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
20828 pass it to the Namespace's .ctor.
20830 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
20831 and MethodBase arguments; pass the namespace ID to the symwriter;
20832 pass the MethodBase instead of the token to the symwriter.
20833 (SymbolWriter.DefineNamespace): New method to add a namespace to
20836 2003-02-09 Martin Baulig <martin@ximian.com>
20838 * symbolwriter.cs: New file. This is a wrapper around
20839 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
20840 methods here in near future.
20842 2003-02-09 Martin Baulig <martin@ximian.com>
20844 * codegen.cs (EmitContext.Mark): Just pass the arguments to
20845 ILGenerator.MarkSequencePoint() which are actually used by the
20848 2003-02-09 Martin Baulig <martin@ximian.com>
20850 * location.cs (SourceFile): New public sealed class. This
20851 contains the name and an index which is used in the location's token.
20852 (Location): Reserve an appropriate number of bits in the token for
20853 the source file instead of walking over that list, this gives us a
20854 really huge performance improvement when compiling with debugging.
20856 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
20857 `SourceFile' argument instead of a string.
20858 (Driver.ProcessFile): Add all the files via Location.AddFile(),
20859 but don't parse/tokenize here, we need to generate the list of all
20860 source files before we do that.
20861 (Driver.ProcessFiles): New static function. Parses/tokenizes all
20864 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
20865 instead of a string.
20867 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
20870 2003-02-09 Martin Baulig <martin@ximian.com>
20872 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
20873 filename on `#line default'.
20875 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
20877 * statement.cs: don't clear the pinned var when the fixed statement
20878 returns from the method (fixes bug#37752).
20880 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
20882 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
20885 2003-02-07 Martin Baulig <martin@ximian.com>
20887 * driver.cs: Removed the `--debug-args' command line argument.
20889 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
20890 automatically by the AsssemblyBuilder.
20891 (CodeGen.InitializeSymbolWriter): We don't need to call any
20892 initialization function on the symbol writer anymore. This method
20893 doesn't take any arguments.
20895 2003-02-03 Miguel de Icaza <miguel@ximian.com>
20897 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
20898 from referenced assemblies as well.
20900 2003-02-02 Martin Baulig <martin@ximian.com>
20902 * class.cs (MethodData.Emit): Generate debugging info for external methods.
20904 2003-02-02 Martin Baulig <martin@ximian.com>
20906 * class.cs (Constructor.Emit): Open the symbol writer before
20907 emitting the constructor initializer.
20908 (ConstructorInitializer.Emit): Call ec.Mark() to allow
20909 single-stepping through constructor initializers.
20911 2003-01-30 Miguel de Icaza <miguel@ximian.com>
20913 * class.cs: Handle error 549: do not allow virtual methods in
20916 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
20918 * decl.cs: Check access levels when resolving types
20920 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
20922 * statement.cs: Add parameters and locals set in catch blocks that might
20923 return to set vector
20925 2003-01-29 Miguel de Icaza <miguel@ximian.com>
20927 * class.cs (Operator): Set the SpecialName flags for operators.
20929 * expression.cs (Invocation.DoResolve): Only block calls to
20930 accessors and operators on SpecialName methods.
20932 (Cast.TryReduce): Handle conversions from char constants.
20935 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
20937 * statement.cs: small memory and time optimization in FlowBranching.
20939 2003-01-28 Pedro Mart <yoros@wanadoo.es>
20941 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
20942 problem that the last fix but in the other sid (Set).
20944 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
20945 access when there is no indexer in the hierarchy.
20947 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
20949 * class.cs: Combine some if statements.
20951 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20953 * driver.cs: fixed bug #37187.
20955 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
20957 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
20958 any indexer, it's needed to build a list with all the indexers in the
20959 hierarchy (AllGetters), else we have problems. Fixes #35653.
20961 2003-01-23 Miguel de Icaza <miguel@ximian.com>
20963 * class.cs (MethodData.Define): It is wrong for an interface
20964 implementation to be static in both cases: explicit and implicit.
20965 We were only handling this in one case.
20967 Improve the if situation there to not have negations.
20969 * class.cs (Field.Define): Turns out that we do not need to check
20970 the unsafe bit on field definition, only on usage. Remove the test.
20972 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20974 * driver.cs: use assembly.Location instead of Codebase (the latest
20975 patch made mcs fail when using MS assemblies).
20977 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
20979 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
20980 get the path to *corlib.dll.
20982 2003-01-21 Nick Drochak <ndrochak@gol.com>
20986 * typemanager.cs: Remove compiler warnings
20988 2003-01-20 Duncan Mak <duncan@ximian.com>
20990 * AssemblyInfo.cs: Bump the version number to 0.19.
20992 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20994 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
20996 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
20998 * class.cs (Constructor::Emit): Emit debugging info for constructors.
21000 2003-01-17 Miguel de Icaza <miguel@ximian.com>
21002 * cs-parser.jay: Small fix: we were not comparing the constructor
21003 name correctly. Thanks to Zoltan for the initial pointer.
21005 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
21007 * cs-tokenizer.cs: Set file name when specified with #line
21009 2003-01-15 Miguel de Icaza <miguel@ximian.com>
21011 * cs-parser.jay: Only perform the constructor checks here if we
21012 are named like the class; This will help provider a better
21013 error. The constructor path is taken when a type definition is
21014 not found, but most likely the user forgot to add the type, so
21015 report that rather than the constructor error.
21017 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
21019 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
21022 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21024 * cs-parser.jay: Add cleanup call.
21026 2003-01-13 Duncan Mak <duncan@ximian.com>
21028 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
21029 consistent with other methods.
21031 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21033 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
21035 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
21037 * attribute.cs: only set GuidAttr to true when we have a
21040 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21044 * typemanager.cs: fixes to allow mcs compile corlib with the new
21045 Type.IsSubclassOf fix.
21047 2003-01-08 Miguel de Icaza <miguel@ximian.com>
21049 * expression.cs (LocalVariableReference.DoResolve): Classify a
21050 constant as a value, not as a variable. Also, set the type for
21053 * cs-parser.jay (fixed_statement): take a type instead of a
21054 pointer_type, so we can produce a better error message later.
21056 * statement.cs (Fixed.Resolve): Flag types that are not pointers
21059 (For.DoEmit): Make inifinite loops have a
21060 non-conditional branch back.
21062 (Fixed.DoEmit): First populate the pinned variables, then emit the
21063 statement, then clear the variables. Before I was emitting the
21064 code once for each fixed piece.
21067 2003-01-08 Martin Baulig <martin@ximian.com>
21069 * statement.cs (FlowBranching.MergeChild): A break in a
21070 SWITCH_SECTION does not leave a loop. Fixes #36155.
21072 2003-01-08 Martin Baulig <martin@ximian.com>
21074 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
21075 lives in the same number space than `param_map'. Fixes #36154.
21077 2003-01-07 Miguel de Icaza <miguel@ximian.com>
21079 * cs-parser.jay (constructor_declaration): Set the
21080 Constructor.ModFlags before probing for it. This makes the
21081 compiler report 514, 515 and 132 (the code was there, but got
21084 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
21085 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
21086 (GotoCase.Resolve): Set `Returns' to ALWAYS.
21088 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
21090 * enum.cs: create the enum static fields using the enum type.
21092 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
21094 * class.cs: don't try to create the ParamBuilder for the return
21095 type if it's not needed (and handle it breaking for the ms runtime
21098 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
21100 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
21102 2002-12-29 Miguel de Icaza <miguel@ximian.com>
21104 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
21105 the command. This showed up while compiling the JANET source
21106 code, which used \r as its only newline separator.
21108 2002-12-28 Miguel de Icaza <miguel@ximian.com>
21110 * class.cs (Method.Define): If we are an operator (because it
21111 reuses our code), then set the SpecialName and HideBySig. #36128
21113 2002-12-22 Miguel de Icaza <miguel@ximian.com>
21115 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
21116 exception, report error 120 `object reference required'.
21118 * driver.cs: Add --pause option, used during to measure the size
21119 of the process as it goes with --timestamp.
21121 * expression.cs (Invocation.DoResolve): Do not allow methods with
21122 SpecialName to be invoked.
21124 2002-12-21 Miguel de Icaza <miguel@ximian.com>
21126 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
21127 number before adding it.
21129 2002-12-21 Ravi Pratap <ravi@ximian.com>
21131 * ecore.cs (StandardImplicitConversion): When in an unsafe
21132 context, we allow conversion between void * to any other pointer
21133 type. This fixes bug #35973.
21135 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
21137 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
21138 is not thrown when extensionless outputs are used
21140 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21142 * rootcontext.cs: fixed compilation of corlib.
21144 2002-12-19 Miguel de Icaza <miguel@ximian.com>
21146 * attribute.cs (Attributes.Contains): Add new method.
21148 * class.cs (MethodCore.LabelParameters): if the parameter is an
21149 `out' parameter, check that no attribute `[In]' has been passed.
21151 * enum.cs: Handle the `value__' name in an enumeration.
21153 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
21155 * decl.cs: Added special case to allow overrides on "protected
21158 2002-12-18 Ravi Pratap <ravi@ximian.com>
21160 * attribute.cs (Attributes.AddAttributeSection): Rename to this
21161 since it makes much more sense.
21163 (Attributes.ctor): Don't require a Location parameter.
21165 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
21167 * attribute.cs (ApplyAttributes): Remove extra Location parameters
21168 since we already have that information per attribute.
21170 * everywhere : make appropriate changes.
21172 * class.cs (LabelParameters): Write the code which actually
21173 applies attributes to the return type. We can't do this on the MS
21174 .NET runtime so we flag a warning in the case an exception is
21177 2002-12-18 Miguel de Icaza <miguel@ximian.com>
21179 * const.cs: Handle implicit null conversions here too.
21181 2002-12-17 Ravi Pratap <ravi@ximian.com>
21183 * class.cs (MethodCore.LabelParameters): Remove the extra
21184 Type [] parameter since it is completely unnecessary. Instead
21185 pass in the method's attributes so that we can extract
21186 the "return" attribute.
21188 2002-12-17 Miguel de Icaza <miguel@ximian.com>
21190 * cs-parser.jay (parse): Use Report.Error to flag errors instead
21191 of ignoring it and letting the compile continue.
21193 * typemanager.cs (ChangeType): use an extra argument to return an
21194 error condition instead of throwing an exception.
21196 2002-12-15 Miguel de Icaza <miguel@ximian.com>
21198 * expression.cs (Unary.TryReduce): mimic the code for the regular
21199 code path. Perform an implicit cast in the cases where we can
21200 implicitly convert to one of the integral types, and then reduce
21201 based on that constant. This fixes bug #35483.
21203 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21205 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
21207 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21209 * namespace.cs: fixed bug #35489.
21211 2002-12-12 Miguel de Icaza <miguel@ximian.com>
21213 * class.cs: Remove some dead code.
21215 * cs-parser.jay: Estimate the number of methods needed
21216 (RootContext.MethodCount);
21218 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
21219 numbers instead of StringBuilders.
21221 * support.cs (PtrHashtable): Add constructor with initial size;
21222 We can now reduce reallocations of the method table.
21224 2002-12-10 Ravi Pratap <ravi@ximian.com>
21226 * attribute.cs (ApplyAttributes): Keep track of the emitted
21227 attributes on a per-target basis. This fixes bug #35413.
21229 2002-12-10 Miguel de Icaza <miguel@ximian.com>
21231 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
21232 default to the Windows 1252 encoding.
21234 (UnixParseOption): Support version, thanks to Alp for the missing
21237 * AssemblyInfo.cs: Add nice assembly information.
21239 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
21242 * cs-parser.jay: Allow a trailing comma before the close bracked
21243 in the attribute_section production.
21245 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
21246 address of the instance was being taken, I will take this out,
21247 because we take the address of the object immediately here.
21249 2002-12-09 Ravi Pratap <ravi@ximian.com>
21251 * typemanager.cs (AreMultipleAllowed): Take care of the most
21252 obvious case where attribute type is not in the current assembly -
21255 2002-12-08 Miguel de Icaza <miguel@ximian.com>
21257 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
21258 definitions, instead of doing that afterwards.
21260 Also we use a nice little hack, depending on the constructor, we
21261 know if we are a "composed" name or a simple name. Hence, we
21262 avoid the IndexOf test, and we avoid
21264 * codegen.cs: Add code to assist in a bug reporter to track down
21265 the source of a compiler crash.
21267 2002-12-07 Ravi Pratap <ravi@ximian.com>
21269 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
21270 types have been emitted for a given element and flag an error
21271 if something which does not have AllowMultiple set is used more
21274 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
21275 attribute types and their corresponding AllowMultiple properties
21277 (AreMultipleAllowed): Check the property for a given type.
21279 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
21280 property in the case we have a TypeContainer.
21282 (Attributes.AddAttribute): Detect duplicates and just skip on
21283 adding them. This trivial fix catches a pretty gross error in our
21284 attribute emission - global attributes were being emitted twice!
21286 Bugzilla bug #33187 is now fixed.
21288 2002-12-06 Miguel de Icaza <miguel@ximian.com>
21290 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
21291 instead of pp_and).
21293 * expression.cs (Binary.ResolveOperator): I can only use the
21294 Concat (string, string, string) and Concat (string, string,
21295 string, string) if the child is actually a concatenation of
21298 2002-12-04 Miguel de Icaza <miguel@ximian.com>
21300 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
21301 context where we need a 2-character lookahead.
21303 * pending.cs (PendingImplementation): Rework so we can keep track
21304 of interface types all the time, and flag those which were
21305 implemented by parents as optional.
21307 2002-12-03 Miguel de Icaza <miguel@ximian.com>
21309 * expression.cs (Binary.ResolveOperator): Use
21310 String.Concat(string,string,string) or
21311 String.Concat(string,string,string,string) when possible.
21313 * typemanager: More helper methods.
21316 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
21318 * pending.cs: remove the bogus return from GetMissingInterfaces()
21319 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
21321 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21323 * namespace.cs: avoid duplicated 'using xxx' being added to
21324 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
21325 when we get more than one 'using' statement for the same namespace.
21326 Report a CS0105 warning for it.
21328 2002-11-30 Miguel de Icaza <miguel@ximian.com>
21330 * cs-tokenizer.cs (consume_identifier): use read directly, instead
21331 of calling getChar/putback, uses internal knowledge of it.
21333 (xtoken): Reorder tokenizer so most common patterns are checked
21334 first. This reduces the compilation time in another 5% (from 8.11s
21335 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
21337 The parsing time is 22% of the compilation in mcs, and from that
21338 64% is spent on the tokenization process.
21340 I tried using a binary search for keywords, but this is slower
21341 than the hashtable. Another option would be to do a couple of
21344 * Not use a StringBuilder, instead use an array of chars,
21345 with a set value. Notice that this way we could catch
21346 the 645 error without having to do it *afterwards*.
21348 * We could write a hand-parser to avoid the hashtable
21349 compares altogether.
21351 The identifier consumption process takes 37% of the tokenization
21352 time. Another 15% is spent on is_number. 56% of the time spent
21353 on is_number is spent on Int64.Parse:
21355 * We could probably choose based on the string length to
21356 use Int32.Parse or Int64.Parse and avoid all the 64-bit
21359 Another 3% is spend on wrapping `xtoken' in the `token' function.
21361 Handle 0xa0 as whitespace (#34752)
21363 2002-11-26 Miguel de Icaza <miguel@ximian.com>
21365 * typemanager.cs (IsCLRType): New routine to tell whether a type
21366 is one of the builtin types.
21368 Maybe it needs to use TypeCodes to be faster. Maybe we could use
21369 typecode in more places instead of doing pointer comparissions.
21370 We could leverage some knowledge about the way the typecodes are
21373 New code to cache namespaces in assemblies, it is currently not
21374 invoked, to be used soon.
21376 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
21378 * expression.cs (Binary.ResolveOperator): specially handle
21379 strings, and do not perform user-defined operator overloading for
21382 2002-11-24 Miguel de Icaza <miguel@ximian.com>
21384 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
21385 internalcall as it is a pretty simple operation; Avoid whenever
21386 possible to call Char.IsLetter.
21388 (consume_identifier): Cut by half the number of
21389 hashtable calls by merging the is_keyword and GetKeyword behavior.
21391 Do not short-circuit, because if we do, we
21392 report errors (ie, #if false && true would produce an invalid
21396 2002-11-24 Martin Baulig <martin@ximian.com>
21398 * expression.cs (Cast.TryReduce): If we're in checked syntax,
21399 check constant ranges and report a CS0221. Fixes #33186.
21401 2002-11-24 Martin Baulig <martin@ximian.com>
21403 * cs-parser.jay: Make this work for uninitialized variable
21404 declarations in the `for' initializer. Fixes #32416.
21406 2002-11-24 Martin Baulig <martin@ximian.com>
21408 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
21409 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
21411 2002-11-24 Martin Baulig <martin@ximian.com>
21413 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
21414 argument; if true, we also check for user-defined conversions.
21415 This is only needed if both arguments are of a user-defined type.
21416 Fixes #30443, added test-175.cs.
21417 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
21419 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
21421 2002-11-24 Martin Baulig <martin@ximian.com>
21423 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
21424 function to get the store opcode.
21425 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
21426 only emit the Ldelema if the store opcode is Stobj. You must run
21427 both test-34 and test-167 to test this. Fixes #34529.
21429 2002-11-23 Martin Baulig <martin@ximian.com>
21431 * ecore.cs (Expression.MemberLookup): Added additional
21432 `qualifier_type' argument which is used when we're being called
21433 from MemberAccess.DoResolve() and null if we're called from a
21435 (Expression.MemberLookupFailed): New method to report errors; this
21436 does the CS1540 check and reports the correct error message.
21438 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
21439 argument for the CS1540 check and redone the way how we're dealing
21440 with private members. See the comment in the source code for details.
21441 (FilterWithClosure): Reverted this back to revision 1.197; renamed
21442 `closure_start_type' to `closure_qualifier_type' and check whether
21443 it's not null. It was not this filter being broken, it was just
21444 being called with the wrong arguments.
21446 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
21447 and pass it the correct `qualifier_type'; this also does the error
21450 2002-11-22 Miguel de Icaza <miguel@ximian.com>
21452 * expression.cs (Invocation.EmitParams): If the we are dealing
21453 with a non-built-in value type, load its address as well.
21455 (ArrayCreation): Use a a pretty constant instead
21456 of the hardcoded value 2. Use 6 instead of 2 for the number of
21457 static initializers.
21459 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
21460 because they are not really value types, just glorified integers.
21462 * driver.cs: Do not append .exe, the CSC compiler does not do it.
21464 * ecore.cs: Remove redundant code for enumerations, make them use
21465 the same code path as everything else, fixes the casting issue
21466 with enumerations in Windows.Forms.
21468 * attribute.cs: Do only cast to string if it is a string, the
21469 validation happens later.
21471 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
21472 people upgrade their corlibs.
21474 * ecore.cs: Oops, enumerations were not following the entire code path
21476 2002-11-21 Miguel de Icaza <miguel@ximian.com>
21478 * typemanager.cs (FilterWithClosure): Commented out the test for
21479 1540 in typemanager.cs, as it has problems when accessing
21480 protected methods from a parent class (see test-174.cs).
21482 * attribute.cs (Attribute.ValidateGuid): new method.
21483 (Attribute.Resolve): Use above.
21485 2002-11-19 Miguel de Icaza <miguel@ximian.com>
21487 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
21489 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
21490 handling for enumerations, as we only needed the TypeContainer
21491 functionality to begin with (this is required for the fix below to
21492 work for enums that reference constants in a container class for
21495 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
21497 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
21498 a valid TypeBuilder to perform lookups on.o
21500 * class.cs (InheritableMemberSignatureCompare): Use true in the
21501 call to GetGetMethod and GetSetMethod, because we are comparing
21502 the signature, and we need to get the methods *even* if they are
21505 (PropertyBase.CheckBase): ditto.
21507 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
21508 GotoCase.Resolve): Use Peel on EmpytCasts.
21510 * ecore.cs (EmptyCast): drop child, add Peel method.
21512 2002-11-17 Martin Baulig <martin@ximian.com>
21514 * ecore.cs (EmptyCast.Child): New public property.
21516 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
21517 label resolved to an EmptyCast. Fixes #34162.
21518 (GotoCase.Resolve): Likewise.
21519 (Block.EmitMeta): Likewise.
21521 2002-11-17 Martin Baulig <martin@ximian.com>
21523 * expression.cs (Invocation.BetterConversion): Prefer int over
21524 uint; short over ushort; long over ulong for integer literals.
21525 Use ImplicitConversionExists instead of StandardConversionExists
21526 since we also need to check for user-defined implicit conversions.
21527 Fixes #34165. Added test-173.cs.
21529 2002-11-16 Martin Baulig <martin@ximian.com>
21531 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
21532 with the `true' and `false' literals. Fixes #33151.
21534 2002-11-16 Martin Baulig <martin@ximian.com>
21536 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
21537 October 22nd; don't do the cs1540 check for static members.
21539 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
21540 now using our own filter here and doing the cs1540 check again.
21542 2002-11-16 Martin Baulig <martin@ximian.com>
21544 * support.cs (InternalParameters): Don't crash if we don't have
21545 any fixed parameters. Fixes #33532.
21547 2002-11-16 Martin Baulig <martin@ximian.com>
21549 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
21550 when looking up static methods to make this work on Windows.
21553 2002-11-16 Martin Baulig <martin@ximian.com>
21555 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
21556 a setter rather than using PropertyInfo.CanWrite.
21558 2002-11-15 Nick Drochak <ndrochak@gol.com>
21560 * class.cs: Allow acces to block member by subclasses. Fixes build
21563 2002-11-14 Martin Baulig <martin@ximian.com>
21565 * class.cs (Constructor.Emit): Added the extern/block check.
21568 2002-11-14 Martin Baulig <martin@ximian.com>
21570 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
21571 iteration while looking for indexers, this is needed because the
21572 indexer may have a different name in our base classes. Fixed the
21573 error reporting (no indexers at all, not get accessor, no
21574 overloaded match). Fixes bug #33089.
21575 (IndexerAccess.DoResolveLValue): Likewise.
21577 2002-11-14 Martin Baulig <martin@ximian.com>
21579 * class.cs (PropertyBase.CheckBase): Make this work for multiple
21580 indexers. Fixes the first part of bug #33089.
21581 (MethodSignature.InheritableMemberSignatureCompare): Added support
21584 2002-11-13 Ravi Pratap <ravi@ximian.com>
21586 * attribute.cs (Attribute.Resolve): Catch the
21587 NullReferenceException and report it since it isn't supposed to
21590 2002-11-12 Miguel de Icaza <miguel@ximian.com>
21592 * expression.cs (Binary.EmitBranchable): Also handle the cases for
21593 LogicalOr and LogicalAnd that can benefit from recursively
21594 handling EmitBranchable. The code now should be nice for Paolo.
21596 2002-11-08 Miguel de Icaza <miguel@ximian.com>
21598 * typemanager.cs (LookupType): Added a negative-hit hashtable for
21599 the Type lookups, as we perform quite a number of lookups on
21600 non-Types. This can be removed once we can deterministically tell
21601 whether we have a type or a namespace in advance.
21603 But this might require special hacks from our corlib.
21607 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
21608 and double which avoids a conversion from an integer to a double.
21610 * expression.cs: tiny optimization, avoid calling IsConstant,
21611 because it effectively performs the lookup twice.
21613 2002-11-06 Miguel de Icaza <miguel@ximian.com>
21615 But a bogus return here to keep the semantics of the old code
21616 until the Mono runtime is fixed.
21618 * pending.cs (GetMissingInterfaces): New method used to remove all
21619 the interfaces that are already implemented by our parent
21620 classes from the list of pending methods.
21622 * interface.cs: Add checks for calls after ResolveTypeExpr.
21624 2002-11-05 Miguel de Icaza <miguel@ximian.com>
21626 * class.cs (Class.Emit): Report warning 67: event not used if the
21627 warning level is beyond 3.
21629 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
21630 being a NullLiteral.
21632 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
21635 * class.cs (TypeContainer.GetClassBases): Cover a missing code
21636 path that might fail if a type can not be resolved.
21638 * expression.cs (Binary.Emit): Emit unsigned versions of the
21641 * driver.cs: use error 5.
21643 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
21645 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
21647 2002-11-01 Miguel de Icaza <miguel@ximian.com>
21649 * cs-parser.jay (switch_section): A beautiful patch from Martin
21650 Baulig that fixed 33094.
21652 2002-10-31 Miguel de Icaza <miguel@ximian.com>
21654 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
21655 Check whether the base is abstract and report an error if so.
21657 * expression.cs (IndexerAccess.DoResolveLValue,
21658 IndexerAccess.DoResolve): ditto.
21660 (Invocation.DoResolve): ditto.
21662 (Invocation.FullMethodDesc): Improve the report string.
21664 * statement.cs (Block): Eliminate IsVariableDefined as it is
21665 basically just a wrapper for GetVariableInfo.
21667 * ecore.cs (SimpleName): Use new
21669 * support.cs (ReflectionParamter.ParameterType): We unwrap the
21670 type, as we return the actual parameter ref/unref state on a
21673 2002-10-30 Miguel de Icaza <miguel@ximian.com>
21675 * support.cs: Return proper flags REF/OUT fixing the previous
21678 * expression.cs: Reverted last patch, that was wrong. Is_ref is
21679 not used to mean `ref' but `ref or out' in ParameterReference
21681 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
21682 full type signature instead of calling TypeManger.CSharpName
21685 * support.cs (InternalParameters.ParameterDesc): Do not compare
21686 directly to the modflags, because REF/OUT will actually be bitsets
21689 * delegate.cs (VerifyMethod): Check also the modifiers.
21691 * cs-tokenizer.cs: Fix bug where floating point values with an
21692 exponent where a sign was missing was ignored.
21694 * driver.cs: Allow multiple assemblies to be specified in a single
21697 2002-10-28 Miguel de Icaza <miguel@ximian.com>
21699 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
21700 because identifiers after a parenthesis would end up in this kind
21701 of production, and we needed to desamiguate it for having casts
21704 (UserDefinedType *) xxx
21706 2002-10-24 Miguel de Icaza <miguel@ximian.com>
21708 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
21709 we should set on the Bindingflags.NonPublic, but not turn on
21710 private_ok. private_ok controls whether a Private member is
21711 returned (this is chekced on the filter routine), while the
21712 BindingFlags.NonPublic just controls whether private/protected
21713 will be allowed. This fixes the problem part of the problem of
21714 private properties being allowed to be used in derived classes.
21716 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
21717 so we can call the children DoResolveLValue method (this will
21718 properly signal errors on lvalue assignments to base properties)
21720 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
21721 getter are null, and we have a property info, we know that this
21722 happened because the lookup failed, so we report an error 122 for
21723 protection level violation.
21725 We also silently return if setter and getter are null in the
21726 resolve functions, this condition only happens if we have flagged
21727 the error before. This is the other half of the problem.
21729 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
21730 not have accessibility information, that is why we were returning
21731 true in the filter function in typemanager.cs.
21733 To properly report 122 (property is inaccessible because of its
21734 protection level) correctly, we report this error in ResolveAccess
21735 by failing if both the setter and the getter are lacking (ie, the
21738 DoResolve and DoLResolve have been modified to check for both
21739 setter/getter being null and returning silently, the reason being
21740 that I did not want to put the knowledge about this error in upper
21743 int old = Report.Errors;
21744 x = new PropertyExpr (...);
21745 if (old != Report.Errors)
21750 So the property expr is returned, but it is invalid, so the error
21751 will be flagged during the resolve process.
21753 * class.cs: Remove InheritablePropertySignatureCompare from the
21754 class, as we no longer depend on the property signature to compute
21755 whether it is possible to implement a method or not.
21757 The reason is that calling PropertyInfo.GetGetMethod will return
21758 null (in .NET, in Mono it works, and we should change this), in
21759 cases where the Get Method does not exist in that particular
21764 class X { public virtual int A { get { return 1; } } }
21766 class Z : Y { public override int A { get { return 2; } } }
21768 Would fail in Z because the parent (Y) would not have the property
21769 defined. So we avoid this completely now (because the alternative
21770 fix was ugly and slow), and we now depend exclusively on the
21773 (PropertyBase.CheckBase): Use a method-base mechanism to find our
21774 reference method, instead of using the property.
21776 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
21777 routines are gone now.
21779 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
21780 names, they were incorrectly named.
21782 * cs-tokenizer.cs: Return are more gentle token on failure.
21784 * pending.cs (PendingImplementation.InterfaceMethod): This routine
21785 had an out-of-sync index variable, which caused it to remove from
21786 the list of pending methods the wrong method sometimes.
21788 2002-10-22 Miguel de Icaza <miguel@ximian.com>
21790 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
21791 CanWrite, because those refer to this particular instance of the
21792 property, and do not take into account the fact that we can
21793 override single members of a property.
21795 Constructor requires an EmitContext. The resolution process does
21796 not happen here, but we need to compute the accessors before,
21797 because the resolution does not always happen for properties.
21799 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
21800 subclass, before we did not update this flag, but we did update
21803 (GetAccessors): Drop this routine, as it did not work in the
21804 presence of partially overwritten set/get methods.
21806 Notice that this broke the cs1540 detection, but that will require
21809 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21813 * driver.cs: issue a warning instead of an error if we don't support
21814 debugging for the platform. Also ignore a couple of errors that may
21815 arise when trying to write the symbols. Undo my previous patch.
21817 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21819 * driver.cs: ignore /debug switch except for Unix platforms.
21821 2002-10-23 Nick Drochak <ndrochak@gol.com>
21823 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
21825 2002-10-21 Miguel de Icaza <miguel@ximian.com>
21827 * driver.cs: Do not make mcs-debug conditional, so we do not break
21828 builds that use it.
21830 * statement.cs (UsageVector.MergeChildren): I would like Martin to
21831 review this patch. But basically after all the children variables
21832 have been merged, the value of "Breaks" was not being set to
21833 new_breaks for Switch blocks. I think that it should be set after
21834 it has executed. Currently I set this to the value of new_breaks,
21835 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
21836 conservative, but I do not understand this code very well.
21838 I did not break anything in the build, so that is good ;-)
21840 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
21842 2002-10-20 Mark Crichton <crichton@gimp.org>
21844 * cfold.cs: Fixed compile blocker. Really fixed it this time.
21846 2002-10-20 Nick Drochak <ndrochak@gol.com>
21848 * cfold.cs: Fixed compile blocker.
21850 2002-10-20 Miguel de Icaza <miguel@ximian.com>
21852 * driver.cs: I was chekcing the key, not the file.
21854 2002-10-19 Ravi Pratap <ravi@ximian.com>
21856 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
21857 message that we were generating - we just need to silently return
21860 2002-10-19 Miguel de Icaza <miguel@ximian.com>
21862 * class.cs (Event.Define): Change my previous commit, as this
21863 breaks the debugger. This is a temporary hack, as it seems like
21864 the compiler is generating events incorrectly to begin with.
21866 * expression.cs (Binary.ResolveOperator): Added support for
21867 "U operator - (E x, E y)"
21869 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
21872 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
21873 init-only variables, but this path did not take into account that
21874 there might be also instance readonly variables. Correct this
21877 This fixes bug 32253
21879 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
21882 * driver.cs: Change the extension for modules to `netmodule'
21884 * cs-parser.jay: Improved slightly the location tracking for
21885 the debugger symbols.
21887 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
21888 modifiers that were specified instead of the hardcoded value
21889 (FamAndAssem). This was basically ignoring the static modifier,
21890 and others. Fixes 32429.
21892 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
21893 fixed a bug in the process (32476)
21895 * expression.cs (ArrayAccess.EmitAssign): Patch from
21896 hwang_rob@yahoo.ca that fixes bug 31834.3
21898 2002-10-18 Miguel de Icaza <miguel@ximian.com>
21900 * driver.cs: Make the module extension .netmodule.
21902 2002-10-16 Miguel de Icaza <miguel@ximian.com>
21904 * driver.cs: Report an error if the resource file is not found
21905 instead of crashing.
21907 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
21908 false, like Emit does.
21910 2002-10-16 Nick Drochak <ndrochak@gol.com>
21912 * typemanager.cs: Remove unused private member. Also reported mcs
21913 bug to report this as a warning like csc.
21915 2002-10-15 Martin Baulig <martin@gnome.org>
21917 * statement.cs (Statement.Emit): Made this a virtual method; emits
21918 the line number info and calls DoEmit().
21919 (Statement.DoEmit): New protected abstract method, formerly knows
21920 as Statement.Emit().
21922 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
21924 2002-10-11 Miguel de Icaza <miguel@ximian.com>
21926 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
21927 have fixed a remaining problem: not every AddXXXX was adding a
21928 fully qualified name.
21930 Now everyone registers a fully qualified name in the DeclSpace as
21931 being defined instead of the partial name.
21933 Downsides: we are slower than we need to be due to the excess
21934 copies and the names being registered this way.
21936 The reason for this is that we currently depend (on the corlib
21937 bootstrap for instance) that types are fully qualified, because
21938 we dump all the types in the namespace, and we should really have
21939 types inserted into the proper namespace, so we can only store the
21940 basenames in the defined_names array.
21942 2002-10-10 Martin Baulig <martin@gnome.org>
21944 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
21945 from bug #31834, see the bug report for a testcase which is
21948 2002-10-10 Martin Baulig <martin@gnome.org>
21950 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
21951 flow analysis code for this.
21953 * statement.cs (Do, While, For): Tell the flow analysis code about
21955 (FlowBranching.UsageVector): Added support for infinite loops.
21956 (Block.Resolve): Moved the dead code elimination here and use flow
21959 2002-10-09 Miguel de Icaza <miguel@ximian.com>
21961 * class.cs (Field.Define): Catch cycles on struct type
21964 * typemanager.cs (IsUnmanagedtype): Do not recursively check
21965 fields if the fields are static. We only need to check instance
21968 * expression.cs (As.DoResolve): Test for reference type.
21970 * statement.cs (Using.ResolveExpression): Use
21971 ConvertImplicitRequired, not ConvertImplicit which reports an
21973 (Using.ResolveLocalVariableDecls): ditto.
21975 * expression.cs (Binary.ResolveOperator): Report errors in a few
21976 places where we had to.
21978 * typemanager.cs (IsUnmanagedtype): Finish implementation.
21980 2002-10-08 Miguel de Icaza <miguel@ximian.com>
21982 * expression.cs: Use StoreFromPtr instead of extracting the type
21983 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
21985 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
21986 an enumeration value to a System.Enum, but System.Enum is not a
21987 value type, but an class type, so we need to box.
21989 (Expression.ConvertExplicit): One codepath could return
21990 errors but not flag them. Fix this. Fixes #31853
21992 * parameter.cs (Resolve): Do not allow void as a parameter type.
21994 2002-10-06 Martin Baulig <martin@gnome.org>
21996 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
21997 if it's a class type and not a struct. Fixes #31815.
21999 2002-10-06 Martin Baulig <martin@gnome.org>
22001 * statement.cs: Reworked the flow analysis code a bit to make it
22002 usable for dead code elimination.
22004 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22006 * cs-parser.jay: allow empty source files. Fixes bug #31781.
22008 2002-10-04 Miguel de Icaza <miguel@ximian.com>
22010 * expression.cs (ComposedCast.DoResolveType): A quick workaround
22011 to fix the test 165, will investigate deeper.
22013 2002-10-04 Martin Baulig <martin@gnome.org>
22015 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
22016 finally blocks actually work.
22017 (Try.Resolve): We don't need to create a sibling for `finally' if
22018 there is no finally block.
22020 2002-10-04 Martin Baulig <martin@gnome.org>
22022 * class.cs (Constructor.Define): The default accessibility for a
22023 non-default constructor is private, not public.
22025 2002-10-04 Miguel de Icaza <miguel@ximian.com>
22027 * class.cs (Constructor): Make AllowedModifiers public, add
22030 * cs-parser.jay: Perform the modifiers test here, as the
22031 constructor for the Constructor class usually receives a zero
22032 because of the way we create it (first we create, later we
22033 customize, and we were never checking the modifiers).
22035 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
22036 is a version of LookupTypeReflection that includes the type-name
22037 cache. This can be used as a fast path for functions that know
22038 the fully qualified name and are only calling into *.GetType() to
22039 obtain a composed type.
22041 This is also used by TypeManager.LookupType during its type
22044 (LookupType): We now also track the real type name, as sometimes
22045 we can get a quey for the real type name from things like
22046 ComposedCast. This fixes bug 31422.
22048 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
22049 complete type fullname, it does not have to go through the type
22050 resolution system to obtain the composed version of the type (for
22051 obtaining arrays or pointers).
22053 (Conditional.Emit): Use the EmitBoolExpression to
22054 generate nicer code, as requested by Paolo.
22056 (ArrayCreation.CheckIndices): Use the patch from
22057 hwang_rob@yahoo.ca to validate the array initializers.
22059 2002-10-03 Miguel de Icaza <miguel@ximian.com>
22061 * class.cs (ConstructorInitializer.Emit): simplify code by using
22062 Invocation.EmitCall, and at the same time, fix the bugs in calling
22063 parent constructors that took variable arguments.
22065 * ecore.cs (Expression.ConvertNumericExplicit,
22066 Expression.ImplicitNumericConversion): Remove the code that
22067 manually wrapped decimal (InternalTypeConstructor call is now gone
22070 * expression.cs (Cast.TryReduce): Also handle decimal types when
22071 trying to perform a constant fold on the type.
22073 * typemanager.cs (IsUnmanagedtype): Partially implemented.
22075 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
22076 that only turned off an error report, and did nothing else.
22078 2002-10-02 Miguel de Icaza <miguel@ximian.com>
22080 * driver.cs: Handle and ignore /fullpaths
22082 2002-10-01 Miguel de Icaza <miguel@ximian.com>
22084 * expression.cs (Binary.ResolveOperator): Catch the case where
22085 DoNumericPromotions returns true,
22087 (Binary.DoNumericPromotions): Simplify the code, and the tests.
22089 2002-09-27 Miguel de Icaza <miguel@ximian.com>
22091 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
22094 2002-09-26 Miguel de Icaza <miguel@ximian.com>
22096 * ecore.cs (ConvertNumericExplicit): It is not enough that the
22097 conversion exists, but it is also required that the conversion be
22098 performed. This manifested in "(Type64Enum) 2".
22100 * class.cs (TypeManager.AddMethod): The fix is not to change
22101 AddEnum, because that one was using a fully qualified name (every
22102 DeclSpace derivative does), but to change the AddMethod routine
22103 that was using an un-namespaced name. This now correctly reports
22104 the duplicated name.
22106 Revert patch until I can properly fix it. The issue
22107 is that we have a shared Type space across all namespaces
22108 currently, which is wrong.
22110 Options include making the Namespace a DeclSpace, and merge
22111 current_namespace/current_container in the parser.
22113 2002-09-25 Miguel de Icaza <miguel@ximian.com>
22115 * cs-parser.jay: Improve error reporting when we get a different
22116 kind of expression in local_variable_type and
22117 local_variable_pointer_type.
22119 Propagate this to avoid missleading errors being reported.
22121 * ecore.cs (ImplicitReferenceConversion): treat
22122 TypeManager.value_type as a target just like object_type. As
22127 Is valid, and needs to result in the int 1 being boxed before it
22128 is assigned to the value type v.
22130 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
22131 to validate the enumeration name.
22133 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
22134 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
22135 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
22137 * ecore.cs (TryImplicitIntConversion): When doing an
22138 implicit-enumeration-conversion, check if the type is 64-bits and
22139 perform a conversion before passing to EnumConstant.
22141 2002-09-23 Miguel de Icaza <miguel@ximian.com>
22143 * decl.cs (Error_AmbiguousTypeReference); New routine used to
22144 report ambiguous type references. Unlike the MS version, we
22145 report what the ambiguity is. Innovation at work ;-)
22147 (DeclSpace.FindType): Require a location argument to
22148 display when we display an ambiguous error.
22150 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
22152 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
22154 * expression.cs (EmitDynamicInitializers): Apply patch from
22155 hwang_rob@yahoo.ca that fixes the order in which we emit our
22158 2002-09-21 Martin Baulig <martin@gnome.org>
22160 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
22161 delegate takes no arguments.
22163 2002-09-20 Miguel de Icaza <miguel@ximian.com>
22165 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
22168 * expression.cs: Extract the underlying type.
22170 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
22172 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
22174 2002-09-19 Miguel de Icaza <miguel@ximian.com>
22176 * class.cs (TypeContainer.DefineType): We can not use the nice
22177 PackingSize with the size set to 1 DefineType method, because it
22178 will not allow us to define the interfaces that the struct
22181 This completes the fixing of bug 27287
22183 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
22184 means also structs. This fixes part of the problem.
22185 (Expresion.ImplicitReferenceConversionExists): ditto.
22187 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
22188 error if there were no errors reported during the type lookup
22189 process, to avoid duplicates or redundant errors. Without this
22190 you would get an ambiguous errors plus a type not found. We have
22191 beaten the user enough with the first error.
22193 (DeclSparce.FindType): Emit a warning if we have an ambiguous
22196 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
22197 during the resolution process, stop the lookup, this avoids
22198 repeated error reports (same error twice).
22200 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
22202 * typemanager.cs (LookupType): Redo the type lookup code to match
22203 the needs of System.Reflection.
22205 The issue is that System.Reflection requires references to nested
22206 types to begin with a "+" sign instead of a dot. So toplevel
22207 types look like: "NameSpace.TopLevelClass", and nested ones look
22208 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
22211 2002-09-19 Martin Baulig <martin@gnome.org>
22213 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
22214 says that a method always returns or always throws an exception,
22215 don't report the CS0161.
22217 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
22218 set `Returns = new_returns'.
22220 2002-09-19 Martin Baulig <martin@gnome.org>
22222 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
22223 to an enum constant, check for a CS0176.
22225 2002-09-18 Miguel de Icaza <miguel@ximian.com>
22227 * class.cs (TypeContainer.CheckPairedOperators): Now we check
22228 for operators that must be in pairs and report errors.
22230 * ecore.cs (SimpleName.DoResolveType): During the initial type
22231 resolution process, when we define types recursively, we must
22232 check first for types in our current scope before we perform
22233 lookups in the enclosing scopes.
22235 * expression.cs (MakeByteBlob): Handle Decimal blobs.
22237 (Invocation.VerifyArgumentsCompat): Call
22238 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
22239 I thought we were supposed to always call this, but there are a
22240 few places in the code where we dont do it.
22242 2002-09-17 Miguel de Icaza <miguel@ximian.com>
22244 * driver.cs: Add support in -linkres and -resource to specify the
22245 name of the identifier.
22247 2002-09-16 Miguel de Icaza <miguel@ximian.com>
22249 * ecore.cs (StandardConversionExists): Sync with the conversion
22250 code: allow anything-* to void* conversions.
22252 (FindMostSpecificSource): Use an Expression argument
22253 instead of a Type, because we might be handed over a Literal which
22254 gets a few more implicit conversions that plain types do not. So
22255 this information was being lost.
22257 Also, we drop the temporary type-holder expression when not
22260 2002-09-17 Martin Baulig <martin@gnome.org>
22262 * class.cs (PropertyBase.CheckBase): Don't check the base class if
22263 this is an explicit interface implementation.
22265 2002-09-17 Martin Baulig <martin@gnome.org>
22267 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
22268 different `IndexerName' attributes.
22270 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
22271 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
22272 virtual CommonResolve().
22274 2002-09-16 Miguel de Icaza <miguel@ximian.com>
22276 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
22277 and convert that to the UnderlyingType.
22279 * statement.cs (Foreach.Resolve): Indexers are just like variables
22280 or PropertyAccesses.
22282 * cs-tokenizer.cs (consume_string): Track line numbers and columns
22283 inside quoted strings, we were not doing this before.
22285 2002-09-16 Martin Baulig <martin@gnome.org>
22287 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
22288 resolve it. This is needed for the definite assignment check of the
22289 instance expression, fixes bug #29846.
22290 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
22292 2002-09-16 Nick Drochak <ndrochak@gol.com>
22294 * parameter.cs: Fix compile error. Cannot reference static member
22295 from an instance object. Is this an mcs bug?
22297 2002-09-14 Martin Baulig <martin@gnome.org>
22299 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
22300 multiple times. Fixes bug #30295, added test-166.cs.
22302 2002-09-14 Martin Baulig <martin@gnome.org>
22304 * statement.cs (Block.Emit): Don't emit unreachable code.
22305 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
22306 `break' statements.
22307 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
22309 2002-09-14 Martin Baulig <martin@gnome.org>
22311 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
22314 2002-09-14 Martin Baulig <martin@gnome.org>
22316 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
22317 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
22318 be false on the ms runtime.
22320 2002-09-13 Martin Baulig <martin@gnome.org>
22322 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
22323 the CS0038 error message.
22325 2002-09-12 Miguel de Icaza <miguel@ximian.com>
22327 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
22328 constant inside, return it.
22330 2002-09-12 Martin Baulig <martin@gnome.org>
22332 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
22333 implicit conversion can be done between enum types.
22335 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
22336 check whether an implicit conversion to the current enum's UnderlyingType
22337 exists and report an error if not.
22339 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
22340 without debugging support.
22342 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
22343 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
22345 2002-09-12 Martin Baulig <martin@gnome.org>
22347 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
22349 * ecore.cs (IMemberExpr.DeclaringType): New property.
22350 (SimpleName.SimpleNameResolve): Check whether we're accessing a
22351 nonstatic member of an outer type (CS0038).
22353 2002-09-11 Miguel de Icaza <miguel@ximian.com>
22355 * driver.cs: Activate the using-error detector at warning level
22356 4 (at least for MS-compatible APIs).
22358 * namespace.cs (VerifyUsing): Small buglett fix.
22360 * pending.cs (PendingImplementation): pass the container pointer.
22362 * interface.cs (GetMethods): Allow for recursive definition. Long
22363 term, I would like to move every type to support recursive
22364 definitions, not the current ordering mechanism that we have right
22367 The situation is this: Attributes are handled before interfaces,
22368 so we can apply attributes to interfaces. But some attributes
22369 implement interfaces, we will now handle the simple cases
22370 (recursive definitions will just get an error).
22372 * parameter.cs: Only invalidate types at the end if we fail to
22375 2002-09-09 Martin Baulig <martin@gnome.org>
22377 * ecore.cs (PropertyExpr.Emit): Also check for
22378 TypeManager.system_int_array_get_length so this'll also work when
22379 compiling corlib. Fixes #30003.
22381 2002-09-09 Martin Baulig <martin@gnome.org>
22383 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
22384 and throw an exception if we can't get the type's size. Fixed #30040,
22387 2002-09-09 Martin Baulig <martin@gnome.org>
22389 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
22391 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
22392 context. Fixes bug #30027.
22394 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
22395 virtual functions. Fixes bug #30043, added test-164.cs.
22397 2002-09-08 Ravi Pratap <ravi@ximian.com>
22399 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
22401 2002-09-08 Nick Drochak <ndrochak@gol.com>
22403 * driver.cs: Use an object to get the windows codepage since it's not a
22406 2002-09-08 Miguel de Icaza <miguel@ximian.com>
22408 * statement.cs (For.Emit): for infinite loops (test == null)
22409 return whether there is a break inside, not always "true".
22411 * namespace.cs (UsingEntry): New struct to hold the name of the
22412 using definition, the location where it is defined, and whether it
22413 has been used in a successful type lookup.
22415 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
22420 2002-09-06 Ravi Pratap <ravi@ximian.com>
22422 * attribute.cs : Fix incorrect code which relied on catching
22423 a NullReferenceException to detect a null being passed in
22424 where an object was expected.
22426 2002-09-06 Miguel de Icaza <miguel@ximian.com>
22428 * statement.cs (Try): flag the catch variable as assigned
22430 * expression.cs (Cast): Simplified by using ResolveType instead of
22431 manually resolving.
22433 * statement.cs (Catch): Fix bug by using ResolveType.
22435 2002-09-06 Ravi Pratap <ravi@ximian.com>
22437 * expression.cs (BetterConversion): Special case for when we have
22438 a NullLiteral as the argument and we have to choose between string
22439 and object types - we choose string the way csc does.
22441 * attribute.cs (Attribute.Resolve): Catch the
22442 NullReferenceException and report error #182 since the Mono
22443 runtime no more has the bug and having this exception raised means
22444 we tried to select a constructor which takes an object and is
22447 2002-09-05 Ravi Pratap <ravi@ximian.com>
22449 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
22450 message (1502, 1503) when we can't locate a method after overload
22451 resolution. This is much more informative and closes the bug
22454 * interface.cs (PopulateMethod): Return if there are no argument
22455 types. Fixes a NullReferenceException bug.
22457 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
22458 expressions too. Previously we were checking only in one place for
22459 positional arguments leaving out named arguments.
22461 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
22462 type to the enum type is not allowed. Remove code corresponding to
22465 (ConvertNumericExplicit): Allow explicit conversions from
22466 the underlying type to enum type. This precisely follows the spec
22467 and closes a bug filed by Gonzalo.
22469 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22472 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
22474 2002-09-03 Miguel de Icaza <miguel@ximian.com>
22476 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
22477 it was important that we stored the right value after the
22478 reduction in `converted'.
22480 2002-09-04 Martin Baulig <martin@gnome.org>
22482 * location.cs (Location.SymbolDocument): Use full pathnames for the
22485 2002-08-30 Miguel de Icaza <miguel@ximian.com>
22487 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
22488 of the expression resolve mechanism, because that will catch the
22489 SimpleName error failures.
22491 (Conditional): If we can not resolve the
22492 expression, return, do not crash.
22494 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22497 (location): display token name instead of its number.
22499 2002-08-28 Martin Baulig <martin@gnome.org>
22501 * expression.cs (Binary.ResolveOperator): Don't silently return
22502 but return an error if an operator cannot be applied between two
22505 2002-08-28 Martin Baulig <martin@gnome.org>
22507 * class.cs (Constructor.Define): Set the permission attributes
22508 correctly instead of making all constructors public.
22510 2002-08-28 Martin Baulig <martin@gnome.org>
22512 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
22513 for private members before reporting a CS0103; if we find anything,
22516 2002-08-28 Martin Baulig <martin@gnome.org>
22518 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
22519 to check whether `closure_start_type == closure_invocation_type',
22520 we also need to check whether `m.DeclaringType == closure_invocation_type'
22521 before bypassing the permission checks. We might be accessing
22522 protected/private members from the base class.
22523 (TypeManager.RealMemberLookup): Only set private_ok if private
22524 members were requested via BindingFlags.NonPublic.
22526 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
22528 * expression.cs (MemberAccess.ResolveMemberAccess): Set
22529 MethodGroupExpr.IsExplicitImpl if appropriate.
22530 (Invocation.DoResolve): Don't report the CS0120 for explicit
22531 interface implementations.
22533 2002-08-27 Martin Baulig <martin@gnome.org>
22535 * expression.cs (Invocation.DoResolve): If this is a static
22536 method and we don't have an InstanceExpression, we must report
22539 2002-08-25 Martin Baulig <martin@gnome.org>
22541 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
22542 `==' between a valuetype and an object.
22544 2002-08-25 Miguel de Icaza <miguel@ximian.com>
22546 * ecore.cs (TypeExpr): Provide a ToString method.
22548 2002-08-24 Martin Baulig <martin@gnome.org>
22550 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
22551 now called proggie.dbg and it's a binary file.
22553 2002-08-23 Martin Baulig <martin@gnome.org>
22555 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
22557 2002-08-23 Martin Baulig <martin@gnome.org>
22559 * struct.cs (MyStructInfo.ctor): Make this work with empty
22560 structs; it's not allowed to use foreach() on null.
22562 2002-08-23 Martin Baulig <martin@gnome.org>
22564 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
22565 writer the full pathname of the generated assembly.
22567 2002-08-23 Martin Baulig <martin@gnome.org>
22569 * statements.cs (FlowBranching.UsageVector.MergeChildren):
22570 A `finally' block never returns or breaks; improved handling of
22573 2002-08-23 Martin Baulig <martin@gnome.org>
22575 * statement.cs (Throw.Resolve): Allow `throw null'.
22577 2002-08-23 Martin Baulig <martin@gnome.org>
22579 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
22580 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
22581 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
22582 MemberLookup would return a wrong event if this is an explicit
22583 interface implementation and the class has an event with the same
22586 2002-08-23 Martin Baulig <martin@gnome.org>
22588 * statement.cs (Block.AddChildVariableNames): New public method.
22589 (Block.AddChildVariableName): Likewise.
22590 (Block.IsVariableNameUsedInChildBlock): Likewise.
22591 (Block.AddVariable): Check whether a variable name has already
22592 been used in a child block.
22594 * cs-parser.jay (declare_local_variables): Mark all variable names
22595 from the current block as being used in a child block in the
22598 2002-08-23 Martin Baulig <martin@gnome.org>
22600 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
22601 find the symbol writer.
22603 * driver.cs: csc also allows the arguments to /define being
22604 separated by commas, not only by semicolons.
22606 2002-08-23 Martin Baulig <martin@gnome.org>
22608 * interface.cs (Interface.GetMembers): Added static check for events.
22610 2002-08-15 Martin Baulig <martin@gnome.org>
22612 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
22613 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
22615 * ecore.cs (Expression.MemberLookup): Added documentation and explained
22616 why the MethodData.EmitDestructor() change was necessary.
22618 2002-08-20 Martin Baulig <martin@gnome.org>
22620 * class.cs (TypeContainer.FindMembers): Added static check for events.
22622 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
22624 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
22625 use Type.GetEvents(), not Type.FindMembers().
22627 2002-08-20 Martin Baulig <martin@gnome.org>
22629 * decl.cs (MemberCache): Added a special method cache which will
22630 be used for method-only searched. This ensures that a method
22631 search will return a MethodInfo with the correct ReflectedType for
22634 2002-08-20 Martin Baulig <martin@gnome.org>
22636 * decl.cs (DeclSpace.FindMembers): Made this public.
22638 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22640 * delegate.cs: fixed build on windows.
22641 [FIXME: Filed as bug #29150: MCS must report these errors.]
22643 2002-08-19 Ravi Pratap <ravi@ximian.com>
22645 * ecore.cs (StandardConversionExists): Return a false
22646 if we are trying to convert the void type to anything else
22647 since that is not allowed.
22649 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
22650 we flag error 70 in the event an event is trying to be accessed
22651 directly from outside the declaring type.
22653 2002-08-20 Martin Baulig <martin@gnome.org>
22655 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
22656 MemberCache from typemanager.cs to decl.cs.
22658 2002-08-19 Martin Baulig <martin@gnome.org>
22660 * class.cs (TypeContainer): Implement IMemberContainer.
22661 (TypeContainer.DefineMembers): Create the MemberCache.
22662 (TypeContainer.FindMembers): Do better BindingFlags checking; only
22663 return public members if BindingFlags.Public was given, check
22664 whether members are static.
22666 2002-08-16 Martin Baulig <martin@gnome.org>
22668 * decl.cs (DeclSpace.Define): Splitted this in Define and
22669 DefineMembers. DefineMembers is called first and initializes the
22672 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
22673 DefineMembers() on all our DeclSpaces.
22675 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
22676 but call DefineMembers() on all nested interfaces. We call their
22677 Define() in our new Define() function.
22679 * interface.cs (Interface): Implement IMemberContainer.
22680 (Interface.Define): Moved all code except the attribute stuf to
22682 (Interface.DefineMembers): Initialize the member cache.
22684 * typemanager.cs (IMemberFinder): Removed this interface, we don't
22685 need this anymore since we can use MemberCache.FindMembers directly.
22687 2002-08-19 Martin Baulig <martin@gnome.org>
22689 * typemanager.cs (MemberCache): When creating the cache for an
22690 interface type, add all inherited members.
22691 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
22692 to `out bool used_cache' and documented it.
22693 (TypeManager.MemberLookup): If we already used the cache in the first
22694 iteration, we don't need to do the interfaces check.
22696 2002-08-19 Martin Baulig <martin@gnome.org>
22698 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
22699 here from IMemberFinder and don't implement this interface anymore.
22700 (DeclSpace.MemberCache): Moved here from IMemberFinder.
22702 * typemanager.cs (IMemberFinder): This interface is now only used by
22703 classes which actually support the member cache.
22704 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
22705 since we only put DeclSpaces into this Hashtable.
22706 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
22707 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
22709 2002-08-16 Martin Baulig <martin@gnome.org>
22711 * typemanager.cs (ICachingMemberFinder): Removed.
22712 (IMemberFinder.MemberCache): New property.
22713 (TypeManager.FindMembers): Merged this with RealFindMembers().
22714 This function will never be called from TypeManager.MemberLookup()
22715 so we can't use the cache here, just the IMemberFinder.
22716 (TypeManager.MemberLookup_FindMembers): Check whether the
22717 IMemberFinder has a MemberCache and call the cache's FindMembers
22719 (MemberCache): Rewrote larger parts of this yet another time and
22720 cleaned it up a bit.
22722 2002-08-15 Miguel de Icaza <miguel@ximian.com>
22724 * driver.cs (LoadArgs): Support quoting.
22726 (Usage): Show the CSC-like command line arguments.
22728 Improved a few error messages.
22730 2002-08-15 Martin Baulig <martin@gnome.org>
22732 * typemanager.cs (IMemberContainer.Type): New property.
22733 (IMemberContainer.IsInterface): New property.
22735 The following changes are conditional to BROKEN_RUNTIME, which is
22736 defined at the top of the file.
22738 * typemanager.cs (MemberCache.MemberCache): Don't add the base
22739 class'es members, but add all members from TypeHandle.ObjectType
22740 if we're an interface.
22741 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
22742 is the current type.
22743 (MemberCache.CacheEntry.Container): Removed this field.
22744 (TypeHandle.GetMembers): Include inherited members.
22746 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22748 * typemanager.cs: fixed compilation and added a comment on a field that
22751 2002-08-15 Martin Baulig <martin@gnome.org>
22753 * class.cs (ConstructorInitializer.Resolve): In the
22754 Expression.MemberLookup call, use the queried_type as
22757 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
22758 declared' attribute, it's always true.
22759 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
22760 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
22761 temporary wrapper for FindMembers which tells MemberLookup whether
22762 members from the base classes are included in the return value.
22763 This will go away soon.
22764 (TypeManager.MemberLookup): Use this temporary hack here; once the
22765 new MemberCache is completed, we don't need to do the DeclaredOnly
22766 looping here anymore since the MemberCache will take care of this.
22767 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
22768 (MemberCache): When creating the MemberCache for a class, get
22769 members from the current class and all its base classes.
22770 (MemberCache.CacheEntry.Container): New field. This is a
22771 temporary hack until the Mono runtime is fixed to distinguish
22772 between ReflectedType and DeclaringType. It allows us to use MCS
22773 with both the MS runtime and the unfixed Mono runtime without
22774 problems and without accecting performance.
22775 (MemberCache.SearchMembers): The DeclaredOnly looping from
22776 TypeManager.MemberLookup is now done here.
22778 2002-08-14 Martin Baulig <martin@gnome.org>
22780 * statement.cs (MyStructInfo.MyStructInfo): Don't call
22781 Type.GetFields on dynamic types but get the fields from the
22782 corresponding TypeContainer.
22783 (MyStructInfo.GetStructInfo): Added check for enum types.
22785 * typemanager.cs (MemberList.IsSynchronized): Implemented.
22786 (MemberList.SyncRoot): Implemented.
22787 (TypeManager.FilterWithClosure): No need to check permissions if
22788 closure_start_type == closure_invocation_type, don't crash if
22789 closure_invocation_type is null.
22791 2002-08-13 Martin Baulig <martin@gnome.org>
22793 Rewrote TypeContainer.FindMembers to use a member cache. This
22794 gives us a speed increase of about 35% for the self-hosting MCS
22795 build and of about 15-20% for the class libs (both on GNU/Linux).
22797 * report.cs (Timer): New class to get enhanced profiling. This
22798 whole class is "TIMER" conditional since it remarkably slows down
22801 * class.cs (MemberList): New class. This is an IList wrapper
22802 which we're now using instead of passing MemberInfo[]'s around to
22803 avoid copying this array unnecessarily.
22804 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
22805 (ICachingMemberFinder, IMemberContainer): New interface.
22806 (TypeManager.FilterWithClosure): If `criteria' is null, the name
22807 has already been checked, otherwise use it for the name comparision.
22808 (TypeManager.FindMembers): Renamed to RealMemberFinder and
22809 provided wrapper which tries to use ICachingMemberFinder.FindMembers
22810 if possible. Returns a MemberList, not a MemberInfo [].
22811 (TypeHandle): New class, implements IMemberContainer. We create
22812 one instance of this class per type, it contains a MemberCache
22813 which is used to do the member lookups.
22814 (MemberCache): New class. Each instance of this class contains
22815 all members of a type and a name-based hash table.
22816 (MemberCache.FindMembers): This is our new member lookup
22817 function. First, it looks up all members of the requested name in
22818 the hash table. Then, it walks this list and sorts out all
22819 applicable members and returns them.
22821 2002-08-13 Martin Baulig <martin@gnome.org>
22823 In addition to a nice code cleanup, this gives us a performance
22824 increase of about 1.4% on GNU/Linux - not much, but it's already
22825 half a second for the self-hosting MCS compilation.
22827 * typemanager.cs (IMemberFinder): New interface. It is used by
22828 TypeManager.FindMembers to call FindMembers on a TypeContainer,
22829 Enum, Delegate or Interface.
22830 (TypeManager.finder_to_member_finder): New PtrHashtable.
22831 (TypeManager.finder_to_container): Removed.
22832 (TypeManager.finder_to_delegate): Removed.
22833 (TypeManager.finder_to_interface): Removed.
22834 (TypeManager.finder_to_enum): Removed.
22836 * interface.cs (Interface): Implement IMemberFinder.
22838 * delegate.cs (Delegate): Implement IMemberFinder.
22840 * enum.cs (Enum): Implement IMemberFinder.
22842 * class.cs (TypeContainer): Implement IMemberFinder.
22844 2002-08-12 Martin Baulig <martin@gnome.org>
22846 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
22848 2002-08-12 Martin Baulig <martin@gnome.org>
22850 * ecore.cs (ITypeExpression): New interface for expressions which
22852 (TypeExpression): Renamed to TypeLookupExpression.
22853 (Expression.DoResolve): If we're doing a types-only lookup, the
22854 expression must implement the ITypeExpression interface and we
22855 call DoResolveType() on it.
22856 (SimpleName): Implement the new ITypeExpression interface.
22857 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
22858 hack, the situation that we're only looking up types can't happen
22859 anymore when this method is called. Moved the type lookup code to
22860 DoResolveType() and call it.
22861 (SimpleName.DoResolveType): This ITypeExpression interface method
22862 is now doing the types-only lookup.
22863 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
22864 (ResolveFlags): Added MaskExprClass.
22866 * expression.cs (MemberAccess): Implement the ITypeExpression
22868 (MemberAccess.DoResolve): Added support for a types-only lookup
22869 when we're called via ITypeExpression.DoResolveType().
22870 (ComposedCast): Implement the ITypeExpression interface.
22872 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
22873 Expression.Resolve() with ResolveFlags.Type instead.
22875 2002-08-12 Martin Baulig <martin@gnome.org>
22877 * interface.cs (Interface.Define): Apply attributes.
22879 * attribute.cs (Attribute.ApplyAttributes): Added support for
22880 interface attributes.
22882 2002-08-11 Martin Baulig <martin@gnome.org>
22884 * statement.cs (Block.Emit): Only check the "this" variable if we
22885 do not always throw an exception.
22887 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
22888 whether the property has a set accessor.
22890 2002-08-11 Martin Baulig <martin@gnome.org>
22892 Added control flow analysis support for structs.
22894 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
22895 with control flow analysis turned off.
22896 (IVariable): New interface.
22897 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
22898 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
22899 (FieldExpr.DoResolve): Resolve the instance expression with flow
22900 analysis turned off and do the definite assignment check after the
22901 resolving when we know what the expression will resolve to.
22903 * expression.cs (LocalVariableReference, ParameterReference):
22904 Implement the new IVariable interface, only call the flow analysis
22905 code if ec.DoFlowAnalysis is true.
22906 (This): Added constructor which takes a Block argument. Implement
22907 the new IVariable interface.
22908 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
22909 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
22910 This does the definite assignment checks for struct members.
22912 * class.cs (Constructor.Emit): If this is a non-static `struct'
22913 constructor which doesn't have any initializer, call
22914 Block.AddThisVariable() to tell the flow analysis code that all
22915 struct elements must be initialized before control returns from
22918 * statement.cs (MyStructInfo): New public class.
22919 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
22920 argument to this indexer. If non-zero, check an individual struct
22921 member, not the whole struct.
22922 (FlowBranching.CheckOutParameters): Check struct members.
22923 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
22924 overloaded versions of these methods which take an additional
22925 `int field_idx' argument to check struct members.
22926 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
22927 overloaded versions of these methods which take an additional
22928 `string field_name' argument to check struct member.s
22929 (VariableInfo): Implement the IVariable interface.
22930 (VariableInfo.StructInfo): New public property. Returns the
22931 MyStructInfo instance of the variable if it's a struct or null.
22932 (Block.AddThisVariable): New public method. This is called from
22933 Constructor.Emit() for non-static `struct' constructor which do
22934 not have any initializer. It creates a special variable for the
22935 "this" instance variable which will be checked by the flow
22936 analysis code to ensure that all of the struct's fields are
22937 initialized before control returns from the constructor.
22938 (UsageVector): Added support for struct members. If a
22939 variable/parameter is a struct with N members, we reserve a slot
22940 in the usage vector for each member. A struct is considered fully
22941 initialized if either the struct itself (slot 0) or all its
22942 members are initialized.
22944 2002-08-08 Martin Baulig <martin@gnome.org>
22946 * driver.cs (Driver.MainDriver): Only report an error CS5001
22947 if there were no compilation errors.
22949 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
22950 `UnsafeContext' property to determine whether the parent is in
22951 unsafe context rather than checking the parent's ModFlags:
22952 classes nested in an unsafe class are unsafe as well.
22954 2002-08-08 Martin Baulig <martin@gnome.org>
22956 * statement.cs (UsageVector.MergeChildren): Distinguish between
22957 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
22958 we return. Added test17() and test18() to test-154.cs.
22960 2002-08-08 Martin Baulig <martin@gnome.org>
22962 * typemanager.cs (TypeManager.FilterWithClosure): If we have
22963 Family access, make sure the invoking type isn't a subclass of the
22964 queried type (that'd be a CS1540).
22966 * ecore.cs (Expression.MemberLookup): Added overloaded version of
22967 this method which takes an additional `Type invocation_type'.
22969 * expression.cs (BaseAccess.DoResolve): Use the base type as
22970 invocation and query type.
22971 (MemberAccess.DoResolve): If the lookup failed and we're about to
22972 report a CS0122, try a lookup with the ec.ContainerType - if this
22973 succeeds, we must report a CS1540.
22975 2002-08-08 Martin Baulig <martin@gnome.org>
22977 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
22978 (MethodGroupExpr): Implement the IMemberExpr interface.
22980 * expression (MemberAccess.ResolveMemberAccess): No need to have
22981 any special code for MethodGroupExprs anymore, they're now
22984 2002-08-08 Martin Baulig <martin@gnome.org>
22986 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
22987 Family, FamANDAssem and FamORAssem permissions.
22988 (TypeManager.IsSubclassOrNestedChildOf): New public method.
22990 2002-08-08 Martin Baulig <martin@gnome.org>
22992 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
22993 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
22996 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
22998 * driver.cs: implemented /resource option to embed managed resources.
23000 2002-08-07 Martin Baulig <martin@gnome.org>
23002 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
23003 (FieldBase.HasFieldInitializer): New public property.
23004 (FieldBase.GetInitializerExpression): New public method. Resolves and
23005 returns the field initializer and makes sure it is only resolved once.
23006 (TypeContainer.EmitFieldInitializers): Call
23007 FieldBase.GetInitializerExpression to get the initializer, this ensures
23008 that it isn't resolved multiple times.
23010 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
23011 the resolving process (SimpleName/MemberLookup) that we're currently
23012 emitting a field initializer (which must not access any instance members,
23013 this is an error CS0236).
23015 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
23016 argument, if the `IsFieldInitializer' flag is set, we must report and
23017 error CS0236 and not an error CS0120.
23019 2002-08-07 Martin Baulig <martin@gnome.org>
23021 * ecore.cs (IMemberExpr): New public interface.
23022 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
23023 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
23024 if the expression is an IMemberExpr.
23026 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
23027 to be null, implicitly default to `this' if we're non-static in
23028 this case. Simplified the code a lot by using the new IMemberExpr
23029 interface. Also fixed bug #28176 here.
23031 2002-08-06 Martin Baulig <martin@gnome.org>
23033 * cs-parser.jay (SimpleLookup): Removed. We need to create
23034 ParameterReferences during semantic analysis so that we can do a
23035 type-only search when resolving Cast, TypeOf and SizeOf.
23036 (block): Pass the `current_local_parameters' to the Block's
23039 * class.cs (ConstructorInitializer): Added `Parameters parameters'
23040 argument to the constructor.
23041 (ConstructorInitializer.Resolve): Create a temporary implicit
23042 block with the parameters.
23044 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
23045 references here if we aren't doing a type-only search.
23047 * statement.cs (Block): Added constructor which takes a
23048 `Parameters parameters' argument.
23049 (Block.Parameters): New public property.
23051 * support.cs (InternalParameters.Parameters): Renamed `parameters'
23052 to `Parameters' and made it public readonly.
23054 2002-08-06 Martin Baulig <martin@gnome.org>
23056 * ecore.cs (Expression.Warning): Made this public as well.
23058 * report.cs (Report.Debug): Print the contents of collections.
23060 2002-08-06 Martin Baulig <martin@gnome.org>
23062 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
23063 used to tell Resolve() which kinds of expressions it may return.
23064 (Expression.Resolve): Added overloaded version of this method which
23065 takes a `ResolveFlags flags' argument. This can be used to tell
23066 Resolve() which kinds of expressions it may return. Reports a
23068 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
23069 ResolveFlags.SimpleName.
23070 (Expression.Error118): Added overloaded version of this method which
23071 takes a `ResolveFlags flags' argument. It uses the flags to determine
23072 which kinds of expressions are allowed.
23074 * expression.cs (Argument.ResolveMethodGroup): New public method.
23075 Resolves an argument, but allows a MethodGroup to be returned.
23076 This is used when invoking a delegate.
23078 * TODO: Updated a bit.
23080 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23082 Fixed compilation with csc.
23084 * ecore.cs: Expression.Error made public. Is this correct? Should
23085 Warning be made public too?
23087 * expression.cs: use ea.Location instead of ea.loc.
23088 [FIXME: Filed as bug #28607: MCS must report these errors.]
23090 2002-08-06 Martin Baulig <martin@gnome.org>
23092 * ecore.cs (Expression.loc): Moved the location here instead of
23093 duplicating it in all derived classes.
23094 (Expression.Location): New public property.
23095 (Expression.Error, Expression.Warning): Made them non-static and
23096 removed the location argument.
23097 (Expression.Warning): Added overloaded version which takes an
23098 `int level' argument.
23099 (Expression.Error118): Make this non-static and removed the
23100 expression and location arguments.
23101 (TypeExpr): Added location argument to the constructor.
23103 * expression.cs (StaticCallExpr): Added location argument to
23105 (Indirection, PointerArithmetic): Likewise.
23106 (CheckedExpr, UnCheckedExpr): Likewise.
23107 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
23108 (StringPtr): Likewise.
23111 2002-08-05 Martin Baulig <martin@gnome.org>
23113 * expression.cs (BaseAccess.DoResolve): Actually report errors.
23115 * assign.cs (Assign.DoResolve): Check whether the source
23116 expression is a value or variable.
23118 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
23119 while resolving the corresponding blocks.
23121 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
23122 an error, don't silently return null.
23124 * statement.cs (Block.AddVariable): Do the error reporting here
23125 and distinguish between CS0128 and CS0136.
23126 (Block.DoResolve): Report all unused labels (warning CS0164).
23127 (LabeledStatement): Pass the location to the constructor.
23128 (LabeledStatement.HasBeenReferenced): New property.
23129 (LabeledStatement.Resolve): Set it to true here.
23131 * statement.cs (Return.Emit): Return success even after reporting
23132 a type mismatch error (CS0126 or CS0127), this is what csc does and
23133 it avoids confusing the users with any consecutive errors.
23135 2002-08-05 Martin Baulig <martin@gnome.org>
23137 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
23139 * const.cs (Const.LookupConstantValue): Catch circular definitions.
23141 * expression.cs (MemberAccess.DoResolve): Silently return if an
23142 error has already been reported.
23144 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
23145 error has already been reported.
23147 2002-08-05 Martin Baulig <martin@gnome.org>
23149 * statement.cs (UsageVector): Only initialize the `parameters'
23150 vector if we actually have any "out" parameters.
23152 2002-08-05 Martin Baulig <martin@gnome.org>
23154 * expression.cs (Binary.ResolveOperator): When combining delegates,
23155 they must have the same type.
23157 2002-08-05 Martin Baulig <martin@gnome.org>
23159 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
23160 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
23161 work with the ms runtime and we also don't need it: if we're a
23162 PropertyBuilder and not in the `indexer_arguments' hash, then we
23163 are a property and not an indexer.
23165 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
23166 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
23167 since the latter one doesn't work with the ms runtime.
23169 2002-08-03 Martin Baulig <martin@gnome.org>
23171 Fixed bugs #27998 and #22735.
23173 * class.cs (Method.IsOperator): New public field.
23174 (Method.CheckBase): Report CS0111 if there's already a method
23175 with the same parameters in the current class. Report CS0508 when
23176 attempting to change the return type of an inherited method.
23177 (MethodData.Emit): Report CS0179 if a method doesn't have a body
23178 and it's not marked abstract or extern.
23179 (PropertyBase): New abstract base class for Property and Indexer.
23180 (PropertyBase.CheckBase): Moved here from Property and made it work
23182 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
23183 the same so we can reuse it there.
23184 (Property, Indexer): Derive from PropertyBase.
23185 (MethodSignature.inheritable_property_signature_filter): New delegate
23186 to find properties and indexers.
23188 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
23189 argument and improved error reporting.
23191 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
23192 EmptyReadOnlyParameters and made it a property.
23194 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
23195 version of this method which takes a `PropertyInfo indexer'.
23196 (TypeManager.RegisterIndexer): New method.
23198 * class.cs: Added myself as author of this file :-)
23200 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23202 * class.cs: fixed compilation on windoze.
23204 2002-08-03 Martin Baulig <martin@gnome.org>
23206 * interface.cs (Interface.GetInterfaceBases): Check whether all
23207 base interfaces are at least as accessible than the current one.
23209 * class.cs (TypeContainer.GetClassBases): Check whether base types
23210 are at least as accessible than the current type.
23211 (TypeContainer.AsAccessible): Implemented and made non-static.
23212 (MemberBase.CheckParameters): Report errors if the accessibility
23215 * delegate.cs (Delegate.Delegate): The default visibility is
23216 internal for top-level types and private for nested types.
23217 (Delegate.Define): Report errors if the accessibility checks fail.
23219 * enum.cs (Enum.Enum): The default visibility is internal for
23220 top-level types and private for nested types.
23221 (Enum.DefineType): Compute the correct visibility.
23223 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
23224 function which takes a `bool is_toplevel' instead of a TypeContainer.
23226 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
23229 2002-08-02 Martin Baulig <martin@gnome.org>
23231 * expression.cs (LocalVariableReferenc): Added constructor which
23232 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
23233 (LocalVariableReference.IsReadOnly): New property.
23234 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
23235 variable is readonly, use our own readonly flag to do this; you can
23236 use the new constructor to get a writable reference to a read-only
23239 * cs-parser.jay (foreach_statement, using_statement): Get a writable
23240 reference to the local variable.
23242 2002-08-01 Miguel de Icaza <miguel@ximian.com>
23244 * rootcontext.cs (ResolveCore): Also include System.Exception
23246 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
23247 we reach an EmptyStatement.
23249 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
23252 * expression.cs (Binary.ResolveOperator): Check error result in
23255 use brtrue/brfalse directly and avoid compares to null.
23257 2002-08-02 Martin Baulig <martin@gnome.org>
23259 * class.cs (TypeContainer.Define): Define all nested interfaces here.
23260 Fixes bug #28407, added test-155.cs.
23262 2002-08-01 Martin Baulig <martin@gnome.org>
23264 * class.cs (Event.EmitDefaultMethod): Make this work with static
23265 events. Fixes #28311, added verify-3.cs.
23267 2002-08-01 Martin Baulig <martin@gnome.org>
23269 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
23270 `is_disposable' fields.
23271 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
23272 `hm.is_disposable' if we're using the collection pattern.
23273 (Foreach.EmitCollectionForeach): Use the correct type for the
23274 enumerator's local variable, only emit the try/finally block if
23275 necessary (fixes #27713).
23277 2002-08-01 Martin Baulig <martin@gnome.org>
23279 * ecore.cs (Expression.report118): Renamed to Error118 and made
23282 * statement.cs (Throw.Resolve): Check whether the expression is of
23283 the correct type (CS0118) and whether the type derives from
23284 System.Exception (CS0155).
23285 (Catch.Resolve): New method. Do the type lookup here and check
23286 whether it derives from System.Exception (CS0155).
23287 (Catch.CatchType, Catch.IsGeneral): New public properties.
23289 * typemanager.cs (TypeManager.exception_type): Added.
23291 2002-07-31 Miguel de Icaza <miguel@ximian.com>
23293 * driver.cs: Updated About function.
23295 2002-07-31 Martin Baulig <martin@gnome.org>
23297 Implemented Control Flow Analysis.
23299 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
23300 (EmitContext.CurrentBranching): Added.
23301 (EmitContext.StartFlowBranching): Added.
23302 (EmitContext.EndFlowBranching): Added.
23303 (EmitContext.KillFlowBranching): Added.
23304 (EmitContext.IsVariableAssigned): Added.
23305 (EmitContext.SetVariableAssigned): Added.
23306 (EmitContext.IsParameterAssigned): Added.
23307 (EmitContext.SetParameterAssigned): Added.
23308 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
23309 Added control flow analysis stuff here.
23311 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
23312 resolve the expression as lvalue.
23313 (LocalVariableReference.DoResolve): Check whether the variable has
23314 already been assigned.
23315 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
23316 the parameter as assigned here.
23317 (ParameterReference.DoResolve): Check whether the parameter has already
23319 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
23320 expression as lvalue.
23322 * statement.cs (FlowBranching): New class for the flow analysis code.
23323 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
23324 (LabeledStatement.IsDefined): New public property.
23325 (LabeledStatement.AddUsageVector): New public method to tell flow
23326 analyis that the label may be reached via a forward jump.
23327 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
23329 (VariableInfo.Number): New public field. This is used by flow analysis
23330 to number all locals of a block.
23331 (Block.CountVariables): New public property. This is the number of
23332 local variables in this block (including the locals from all parent
23334 (Block.EmitMeta): Number all the variables.
23336 * statement.cs: Added flow analysis support to all classes.
23338 2002-07-31 Martin Baulig <martin@gnome.org>
23340 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
23341 To get debugging messages, compile mcs with /define:MCS_DEBUG and
23342 then use this argument.
23344 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
23346 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
23347 use this to specify /define options.
23349 2002-07-29 Martin Baulig <martin@gnome.org>
23351 * statement.cs (Fixed): Moved all code that does variable lookups
23352 and resolvings from Emit to Resolve.
23354 * statement.cs (For): Moved all code that does variable lookups
23355 and resolvings from Emit to Resolve.
23357 * statement.cs (Using): Moved all code that does variable lookups
23358 and resolvings from Emit to Resolve.
23360 2002-07-29 Martin Baulig <martin@gnome.org>
23362 * attribute.cs (Attribute.Resolve): Explicitly catch a
23363 System.NullReferenceException when creating the
23364 CustromAttributeBuilder and report a different warning message.
23366 2002-07-29 Martin Baulig <martin@gnome.org>
23368 * support.cs (ParameterData.ParameterName): Added method to
23369 get the name of a parameter.
23371 * typemanager.cs (TypeManager.IsValueType): New public method.
23373 2002-07-29 Martin Baulig <martin@gnome.org>
23375 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
23376 is a flag which specifies that it's either ref or out.
23377 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
23378 the out parameter to `out Parameter.Modifier mod', also set the
23379 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
23381 * support.cs (InternalParameters.ParameterModifier): Distinguish
23382 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23383 Parameter.Modifier.ISBYREF flag if it's either ref or out.
23385 * expression.cs (Argument.GetParameterModifier): Distinguish
23386 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23387 Parameter.Modifier.ISBYREF flag if it's either ref or out.
23389 2002-07-29 Martin Baulig <martin@gnome.org>
23391 * expression.cs (ParameterReference.ParameterReference): Added
23392 `Location loc' argument to the constructor.
23394 * cs-parser.jay: Pass location to ParameterReference.
23396 2002-07-28 Miguel de Icaza <miguel@ximian.com>
23398 * statement.cs (Try): Initialize the location.
23400 * cs-parser.jay: pass location to Try.
23402 * expression.cs (Unary.Reduce): Change the prototype to return
23403 whether a constant fold could be performed or not. The result is
23404 returned in an out parameters. In the case of Indirection and
23405 AddressOf, we want to perform the full tests.
23407 2002-07-26 Miguel de Icaza <miguel@ximian.com>
23409 * statement.cs (Statement.Emit): Flag dead code.
23411 2002-07-27 Andrew Birkett <andy@nobugs.org>
23413 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
23415 2002-07-27 Martin Baulig <martin@gnome.org>
23417 * class.cs (MethodData.Define): Put back call to
23418 TypeManager.AddMethod(), accidentally commented this out.
23420 * report.cs (Debug): New public method to print debugging information,
23421 this is `[Conditional ("DEBUG")]'.
23423 2002-07-26 Martin Baulig <martin@gnome.org>
23425 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
23426 (switch_statement): Push the current_block to the switch_stack and
23427 pop it again when we're done with the switch.
23428 (switch_section): The new block is a child of the current_block.
23429 Fixes bug #24007, added test-152.cs.
23431 2002-07-27 Martin Baulig <martin@gnome.org>
23433 * expression.cs (Invocation.EmitArguments): When calling a varargs
23434 function with only its fixed arguments, we need to pass an empty
23437 2002-07-27 Martin Baulig <martin@gnome.org>
23439 Mono 0.13 has been released.
23441 2002-07-25 Miguel de Icaza <miguel@ximian.com>
23443 * driver.cs: Rename --resource to --linkres, because that is what
23444 we do currently, we dont support --resource yet.
23446 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
23448 2002-07-25 Martin Baulig <martin@gnome.org>
23450 * class.cs (MethodData): New public class. This is a `method builder'
23451 class for a method or one accessor of a Property/Indexer/Event.
23452 (MethodData.GetMethodFlags): Moved here from MemberBase.
23453 (MethodData.ApplyAttributes): Likewise.
23454 (MethodData.ApplyObsoleteAttribute): Likewise.
23455 (MethodData.ApplyConditionalAttribute): Likewise.
23456 (MethodData.ApplyDllImportAttribute): Likewise.
23457 (MethodData.CheckAbstractAndExternal): Likewise.
23458 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
23459 (MethodData.Emit): Formerly known as Method.Emit().
23460 (MemberBase): Moved everything which was specific to a single
23461 accessor/method to MethodData.
23462 (Method): Create a new MethodData and call Define() and Emit() on it.
23463 (Property, Indexer, Event): Create a new MethodData objects for each
23464 accessor and call Define() and Emit() on them.
23466 2002-07-25 Martin Baulig <martin@gnome.org>
23468 Made MethodCore derive from MemberBase to reuse the code from there.
23469 MemberBase now also checks for attributes.
23471 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
23472 (MemberBase.GetMethodFlags): Moved here from class Method and marked
23474 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
23475 `CallingConventions cc' and `Attributes opt_attrs' arguments.
23476 (MemberBase.ApplyAttributes): New virtual method; applies the
23477 attributes to a method or accessor.
23478 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
23479 (MemberBase.ApplyConditionalAttribute): Likewise.
23480 (MemberBase.ApplyDllImportAttribute): Likewise.
23481 (MemberBase.CheckAbstractAndExternal): Likewise.
23482 (MethodCore.ParameterTypes): This is now a property instead of a
23483 method, it's initialized from DoDefineParameters().
23484 (MethodCore.ParameterInfo): Removed the set accessor.
23485 (MethodCore.DoDefineParameters): New protected virtual method to
23486 initialize ParameterTypes and ParameterInfo.
23487 (Method.GetReturnType): We can now simply return the MemberType.
23488 (Method.GetMethodFlags): Override the MemberBase version and add
23489 the conditional flags.
23490 (Method.CheckBase): Moved some code from Define() here, call
23491 DoDefineParameters() here.
23492 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
23493 here to avoid some larger code duplication.
23494 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
23495 ensure that abstract and external accessors don't declare a body.
23497 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
23498 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
23499 lookup in the attribute's parent classes, so we need to abort as soon
23500 as we found the first match.
23501 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
23502 the attribute has no arguments.
23504 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
23507 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23509 * cs-parser.jay: reverted previous patch.
23511 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23513 * cs-parser.jay: fixed bug #22119.
23515 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23517 * attribute.cs: fixed compilation. The error was:
23518 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
23519 be assigned to before control leaves the current method."
23520 [FIXME: Filed as bug #28186: MCS must report this error.]
23522 2002-07-25 Martin Baulig <martin@gnome.org>
23524 * attribute.cs (Attribute.Conditional_GetConditionName): New static
23525 method to pull the condition name ouf of a Conditional attribute.
23526 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
23527 the obsolete message and error flag out of an Obsolete attribute.
23529 * class.cs (Method.GetMethodFlags): New public method to get the
23530 TypeManager.MethodFlags for this method.
23531 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
23533 (Method.Define): Get and apply the Obsolete and Conditional attributes;
23534 if we're overriding a virtual function, set the new private variable
23535 `parent_method'; call the new TypeManager.AddMethod().
23537 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
23538 the MethodBuilder and the Method in a PtrHashtable.
23539 (TypeManager.builder_to_method): Added for this purpose.
23540 (TypeManager.MethodFlags): Added IsObsoleteError.
23541 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
23542 Obsolete and Conditional arguments in MethodBuilders. If we discover
23543 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
23544 the message from the attribute.
23546 2002-07-24 Martin Baulig <martin@gnome.org>
23548 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
23549 preprocessor directives, ensure that the argument to #define/#undef is
23550 exactly one identifier and that it's actually an identifier.
23552 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
23555 2002-07-24 Martin Baulig <martin@gnome.org>
23557 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
23558 initialize it to TypeManager.object_type in the constructor.
23559 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
23560 of the `hm.get_current' method if we're using the collection pattern.
23561 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
23562 for the explicit conversion to make it work when we're using the collection
23563 pattern and the `Current' property has a different return type than `object'.
23566 2002-07-24 Martin Baulig <martin@gnome.org>
23568 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
23569 does not match, but don't report any errors. This method is called in
23570 order for all methods in a MethodGroupExpr until a matching method is
23571 found, so we don't want to bail out if the first method doesn't match.
23572 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
23573 matches, report the 123. Fixes #28070.
23575 2002-07-24 Martin Baulig <martin@gnome.org>
23577 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
23578 TypeManager.TypeToCoreType() to the top of the method so the
23579 following equality checks will work. Fixes #28107.
23581 2002-07-24 Martin Baulig <martin@gnome.org>
23583 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
23584 operand is of type uint, and the other operand is of type sbyte,
23585 short or int, the operands are converted to type long." -
23586 Actually do what this comment already told us. Fixes bug #28106,
23589 2002-07-24 Martin Baulig <martin@gnome.org>
23591 * class.cs (MethodBase): New abstract class. This is now a base
23592 class for Property, Indexer and Event to avoid some code duplication
23593 in their Define() and DefineMethods() methods.
23594 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
23595 generic methods for Define() and DefineMethods().
23596 (FieldBase): Derive from MemberBase, not MemberCore.
23597 (Property): Derive from MemberBase, not MemberCore.
23598 (Property.DefineMethod): Moved all the code from this method to the
23599 new MethodBase.DefineAccessor(), just call it with appropriate
23601 (Property.Define): Call the new Property.DoDefine(), this does some
23602 sanity checks and we don't need to duplicate the code everywhere.
23603 (Event): Derive from MemberBase, not MemberCore.
23604 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
23605 accessors, this will also make them work with interface events.
23606 (Indexer): Derive from MemberBase, not MemberCore.
23607 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
23608 (Indexer.Define): Use the new MethodBase functions.
23610 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
23611 argument to the constructor.
23612 (Interface.FindMembers): Added support for interface events.
23613 (Interface.PopluateEvent): Implemented.
23615 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
23617 2002-07-22 Miguel de Icaza <miguel@ximian.com>
23619 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
23620 but this is required to check for a method name being the same as
23621 the containing class.
23625 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23627 * interface.cs: initialize variable.
23629 2002-07-23 Martin Baulig <martin@gnome.org>
23631 Implemented the IndexerName attribute in interfaces.
23633 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
23634 name if this is an explicit interface implementation.
23635 (Indexer.InterfaceIndexerName): New public variable. If we're
23636 implementing an interface indexer, this is the IndexerName in that
23637 interface. Otherwise, it's the IndexerName.
23638 (Indexer.DefineMethod): If we're implementing interface indexer,
23639 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
23640 and Pending.ImplementIndexer methods.
23641 (Indexer.Define): Also define the PropertyBuilder if we're
23642 implementing an interface indexer and this is neither an explicit
23643 interface implementation nor do the IndexerName match the one in
23646 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
23647 If a method is defined here, then we always need to create a proxy
23648 for it. This is used when implementing interface indexers.
23649 (Pending.IsInterfaceIndexer): New public method.
23650 (Pending.ImplementIndexer): New public method.
23651 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
23652 This is used when implementing interface indexers to define a proxy
23654 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
23655 define a proxy if necessary.
23657 * interface.cs (Interface.IndexerName): New public variable.
23658 (Interface.PopulateIndexer): Set the IndexerName.
23659 (Interface.DefineIndexers): New private method. Populate all the
23660 indexers and make sure their IndexerNames match.
23662 * typemanager.cs (IndexerPropertyName): Added support for interface
23665 2002-07-22 Martin Baulig <martin@gnome.org>
23667 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
23668 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
23669 ret if HasReturnLabel.
23670 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
23673 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
23674 and set the ec.LoopBeginTryCatchLevel.
23675 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
23676 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
23677 the current ec.TryCatchLevel, the branch goes out of an exception
23678 block. In this case, we need to use Leave and not Br.
23680 2002-07-22 Martin Baulig <martin@gnome.org>
23682 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
23683 block unless the block does not always return or it is contained in
23684 another try { ... } catch { ... } block. Fixes bug #26506.
23685 Added verify-1.cs to the test suite.
23687 2002-07-22 Martin Baulig <martin@gnome.org>
23689 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
23690 then we do not always return. Fixes bug #24985.
23692 2002-07-22 Martin Baulig <martin@gnome.org>
23694 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
23695 lookup on a per-class level; ie. walk up the class hierarchy until we
23696 found at least one applicable method, then choose the best among them.
23697 Fixes bug #24463 and test-29.cs.
23699 2002-07-22 Martin Baulig <martin@gnome.org>
23701 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
23702 return types of the methods. The return type is not part of the
23703 signature and we must not check it to make the `new' modifier work.
23704 Fixes bug #27999, also added test-147.cs.
23705 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
23707 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
23708 on the method's return type.
23710 2002-07-21 Martin Baulig <martin@gnome.org>
23712 * assign.cs: Make this work if the rightmost source is a constant and
23713 we need to do an implicit type conversion. Also adding a few more tests
23714 to test-38.cs which should have caught this.
23716 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
23717 target in the makefile for this. The makefile.gnu is primarily intended
23718 for end-users who don't want to debug the compiler.
23720 2002-07-21 Martin Baulig <martin@gnome.org>
23722 * assign.cs: Improved the Assign class so it can now handle embedded
23723 assignments (X = Y = Z = something). As a side-effect this'll now also
23724 consume less local variables. test-38.cs now passes with MCS, added
23725 a few new test cases to that test.
23727 2002-07-20 Martin Baulig <martin@gnome.org>
23729 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
23730 instructions. Fixes bug #27977, also added test-146.cs.
23732 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23734 * cs-tokenizer.cs: fixed getHex ().
23736 2002-07-19 Martin Baulig <martin@gnome.org>
23738 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
23739 not Type.GetType() to lookup the array type. This is needed when
23740 we're constructing an array of a user-defined type.
23741 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
23742 single-dimensional arrays, but also for single-dimensial arrays of
23745 2002-07-19 Martin Baulig <martin@gnome.org>
23747 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
23748 this function is called, it's not allowed to share LocalBuilders
23749 among ILGenerators.
23751 2002-07-19 Martin Baulig <martin@gnome.org>
23753 * expression.cs (Argument.Resolve): Report an error 118 when trying
23754 to pass a type as argument.
23756 2002-07-18 Martin Baulig <martin@gnome.org>
23758 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
23759 Conv_R_Un for the signed `long' type.
23761 2002-07-15 Miguel de Icaza <miguel@ximian.com>
23763 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
23764 `expr' for the temporary result, as that will fail if we do
23765 multiple resolves on the same expression.
23767 2002-07-05 Miguel de Icaza <miguel@ximian.com>
23769 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
23770 ec.TypeContainer for looking up aliases.
23772 * class.cs (TypeContainer): Remove LookupAlias from here.
23774 * decl.cs (DeclSpace); Move here.
23776 2002-07-01 Miguel de Icaza <miguel@ximian.com>
23778 * class.cs (FindMembers): Only call filter if the constructor
23779 bulider is not null.
23781 Also handle delegates in `NestedTypes' now. Now we will perform
23782 type lookups using the standard resolution process. This also
23785 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
23786 This uses Expressions (the limited kind that can be parsed by the
23787 tree) instead of strings.
23789 * expression.cs (ComposedCast.ToString): Implement, used to flag
23790 errors since now we have to render expressions.
23792 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
23795 * ecore.cs (SimpleName.ToString): ditto.
23797 * cs-parser.jay: Instead of using strings to assemble types, use
23798 Expressions to assemble the type (using SimpleName, ComposedCast,
23799 MemberAccess). This should fix the type lookups in declarations,
23800 because we were using a different code path for this.
23802 * statement.cs (Block.Resolve): Continue processing statements
23803 even when there is an error.
23805 2002-07-17 Miguel de Icaza <miguel@ximian.com>
23807 * class.cs (Event.Define): Also remove the `remove' method from
23808 the list of pending items.
23810 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
23811 generate more compact code.
23813 2002-07-17 Martin Baulig <martin@gnome.org>
23815 * const.cs (Const.LookupConstantValue): Add support for constant
23816 `unchecked' and `checked' expressions.
23817 Also adding test case test-140.cs for this.
23819 2002-07-17 Martin Baulig <martin@gnome.org>
23821 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
23822 check whether mi.ReturnType implements the IEnumerator interface; the
23823 `==' and the IsAssignableFrom() will fail in this situation.
23825 2002-07-16 Ravi Pratap <ravi@ximian.com>
23827 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
23830 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23832 * expression.cs: fixed bug #27811.
23834 2002-07-14 Miguel de Icaza <miguel@ximian.com>
23836 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
23837 Molaro: when we are a ref, the value already contains a pointer
23838 value, do not take the address of it.
23840 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23841 * removed mb-parser.jay and mb-tokenizer.cs
23843 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23845 * expression.cs: check against the building corlib void type.
23847 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
23849 * ecore.cs: fix for valuetype static readonly fields: when
23850 initializing them, we need their address, not the address of a copy.
23852 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23854 * typemanager.cs: register also enum_type in corlib.
23856 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23858 * class.cs: allow calling this (but not base) initializers in structs.
23860 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
23862 * ecore.cs: make sure we compare against the building base types
23865 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
23867 * typemanager.cs: fix TypeToCoreType() to handle void and object
23868 (corlib gets no more typerefs after this change).
23870 2002-07-12 Miguel de Icaza <miguel@ximian.com>
23872 * expression.cs (ArrayCreation.EmitArrayArguments): use
23873 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
23875 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
23876 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
23877 array indexes, the runtime actually forbids them.
23879 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
23880 for array arguments here.
23882 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
23883 instead of the default for ValueTypes.
23885 (New.DoEmit): Use IsValueType instead of
23886 IsSubclassOf (value_type)
23887 (New.DoResolve): ditto.
23888 (Invocation.EmitCall): ditto.
23890 * assign.cs (Assign): ditto.
23892 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
23893 Statements *are* currently doing part of their resolution during
23896 Expressions do always resolve during resolve, but statements are
23897 only required to propagate resolution to their children.
23899 2002-07-11 Miguel de Icaza <miguel@ximian.com>
23901 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
23903 (LoadAssembly): Do not add the dll if it is already specified
23905 (MainDriver): Add the System directory to the link path at the end,
23906 after all the other -L arguments.
23908 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
23909 wrong opcode for loading bytes and bools (ldelem.i1 instead of
23910 ldelem.u1) and using the opposite for sbytes.
23912 This fixes Digger, and we can finally run it.
23914 * driver.cs (UnixParseOption): Move the option parsing here.
23915 (CSCParseOption): Implement CSC-like parsing of options.
23917 We now support both modes of operation, the old Unix way, and the
23918 new CSC-like way. This should help those who wanted to make cross
23919 platform makefiles.
23921 The only thing broken is that /r:, /reference: and /lib: are not
23922 implemented, because I want to make those have the same semantics
23923 as the CSC compiler has, and kill once and for all the confussion
23924 around this. Will be doing this tomorrow.
23926 * statement.cs (Unsafe.Resolve): The state is checked during
23927 resolve, not emit, so we have to set the flags for IsUnsfe here.
23929 2002-07-10 Miguel de Icaza <miguel@ximian.com>
23931 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
23932 not catch the Error_ObjectRefRequired in SimpleName (as it is
23933 possible to have a class/instance variable name that later gets
23934 deambiguated), we have to check this here.
23936 2002-07-10 Ravi Pratap <ravi@ximian.com>
23938 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
23939 make static and put into Expression.
23941 (Event.Define): Register the private field of the event with the
23942 TypeManager so that GetFieldFromEvent can get at it.
23944 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
23945 keep track of the private field associated with an event which
23948 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
23951 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
23953 2002-07-10 Miguel de Icaza <miguel@ximian.com>
23955 * expression.cs (Binary.EmitBranchable): this routine emits the
23956 Binary expression in a branchable context. This basically means:
23957 we need to branch somewhere, not just get the value on the stack.
23959 This works together with Statement.EmitBoolExpression.
23961 * statement.cs (Statement.EmitBoolExpression): Use
23964 2002-07-09 Miguel de Icaza <miguel@ximian.com>
23966 * statement.cs (For): Reduce the number of jumps in loops.
23968 (For): Implement loop inversion for the For statement.
23970 (Break): We can be breaking out of a Try/Catch controlled section
23971 (foreach might have an implicit try/catch clause), so we need to
23972 use Leave instead of Br.
23974 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
23975 now). If the instace expression supports IMemoryLocation, we use
23976 the AddressOf method from the IMemoryLocation to extract the
23977 address instead of emitting the instance.
23979 This showed up with `This', as we were emitting the instance
23980 always (Emit) instead of the Address of This. Particularly
23981 interesting when This is a value type, as we dont want the Emit
23982 effect (which was to load the object).
23984 2002-07-08 Miguel de Icaza <miguel@ximian.com>
23986 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
23988 * statement.cs (Checked): Set the CheckedState during the resolve
23989 process too, as the ConvCast operations track the checked state on
23990 the resolve process, and not emit.
23992 * cs-parser.jay (namespace_member_declaration): Flag that we have
23993 found a declaration when we do. This is used to flag error 1529
23995 * driver.cs: Report ok when we display the help only.
23997 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
23999 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
24001 2002-07-04 Miguel de Icaza <miguel@ximian.com>
24003 * cs-tokenizer.cs (define): We also have to track locally the
24004 defines. AllDefines is just used for the Conditional Attribute,
24005 but we also need the local defines for the current source code.
24007 2002-07-03 Miguel de Icaza <miguel@ximian.com>
24009 * statement.cs (While, For, Do): These loops can exit through a
24010 Break statement, use this information to tell whether the
24011 statement is the last piece of code.
24013 (Break): Flag that we break.
24015 * codegen.cs (EmitContexts): New `Breaks' state variable.
24017 2002-07-03 Martin Baulig <martin@gnome.org>
24019 * class.cs (TypeContainer.MethodModifiersValid): Allow override
24020 modifiers in method declarations in structs. Otherwise, you won't
24021 be able to override things like Object.Equals().
24023 2002-07-02 Miguel de Icaza <miguel@ximian.com>
24025 * class.cs (Method, Property, Indexer): Do not allow the public
24026 modifier to be used in explicit interface implementations.
24028 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
24029 override modifiers in method declarations in structs
24031 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
24033 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
24034 integer or real overflow, report an error
24036 2002-07-02 Martin Baulig <martin@gnome.org>
24038 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
24039 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
24040 to tell the runtime about our newly created System.Object and
24041 System.ValueType types.
24043 2002-07-02 Miguel de Icaza <miguel@ximian.com>
24045 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
24046 struct instead of Ldarg/Starg.
24048 2002-07-02 Martin Baulig <martin@gnome.org>
24050 * expression.cs (Indirection.Indirection): Call
24051 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
24053 2002-07-02 Martin Baulig <martin@gnome.org>
24055 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
24056 ValueType, call TypeManager.TypeToCoreType() on it.
24057 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
24058 the OpCodes.Newarr argument.
24060 2002-07-02 Martin Baulig <martin@gnome.org>
24062 * expression.cs (Invocation.EmitCall): When compiling corlib,
24063 replace all calls to the system's System.Array type to calls to
24064 the newly created one.
24066 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
24067 System.Array methods.
24068 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
24069 from the system's System.Array type which must be replaced.
24071 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
24073 * typemanager.cs: load unverifiable_code_ctor so we can build
24074 corlib using the correct type. Avoid using GetTypeCode() with
24076 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
24077 TypeManager.object_type to allow building corlib.
24079 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24081 * ecore.cs: handle System.Enum separately in LoadFromPtr().
24083 2002-07-01 Martin Baulig <martin@gnome.org>
24085 * class.cs: Make the last change actually work, we need to check
24086 whether `ifaces != null' to avoid a crash.
24088 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24090 * class.cs: when we build structs without fields that implement
24091 interfaces, we need to add the interfaces separately, since there is
24092 no API to both set the size and add the interfaces at type creation
24095 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24097 * expression.cs: the dimension arguments to the array constructors
24098 need to be converted if they are a long.
24100 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24102 * class.cs: don't emit ldarg.0 if there is no parent constructor
24103 (fixes showstopper for corlib).
24105 2002-06-29 Martin Baulig <martin@gnome.org>
24107 MCS now compiles corlib on GNU/Linux :-)
24109 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
24110 ie. check for MethodImplOptions.InternalCall.
24112 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
24113 and TypeManager.attribute_type are null, so we must explicitly check
24114 whether parent is not null to find out whether it's an attribute type.
24115 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
24116 and SetBuilder, not only if the property is neither abstract nor external.
24117 This is necessary to set the MethodImplOptions on the accessor methods.
24118 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
24119 SetBuilder, see Property.Emit().
24121 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
24122 populate "System.Object", "System.ValueType" and "System.Attribute" since
24123 they've already been populated from BootCorlib_PopulateCoreTypes().
24125 2002-06-29 Martin Baulig <martin@gnome.org>
24127 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
24128 is the NullLiteral, we also need to make sure that target_type is not
24131 2002-06-29 Martin Baulig <martin@gnome.org>
24133 * rootcontext.cs (RootContext.ResolveCore): We must initialize
24134 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
24135 before calling BootstrapCorlib_ResolveDelegate ().
24137 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24139 * statement.cs: fixed build-breaker. All tests passed ok.
24141 2002-06-27 Martin Baulig <martin@gnome.org>
24143 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
24144 for System.Decimal when compiling corlib.
24146 2002-06-27 Martin Baulig <martin@gnome.org>
24148 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
24149 switch blocks which contain nothing but a default clause.
24151 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
24153 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
24155 2002-06-27 Martin Baulig <martin@gnome.org>
24157 * ecore.cs (PropertyExpr.PropertyExpr): Call
24158 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
24160 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
24161 is already a TypeBuilder.
24163 2002-06-27 Martin Baulig <martin@gnome.org>
24165 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
24166 `target_type == TypeManager.array_type', not IsAssignableFrom() in
24167 the "from an array-type to System.Array" case. This makes it work
24168 when compiling corlib.
24170 2002-06-27 Martin Baulig <martin@gnome.org>
24172 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
24173 non-static PropertyExpr, set its InstanceExpression. This makes
24174 the `ICollection.Count' property work in System/Array.cs.
24176 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
24178 * driver.cs: Made error handling more consistent. Errors now
24179 tracked by Report class, so many methods which used to return int
24180 now return void. Main() now prints success/failure and
24181 errors/warnings message.
24183 Renamed '--probe' compiler argument to '--expect-error'. Removed
24184 the magic number return values (123 and 124). Now, if the
24185 expected error occurs, the compiler exits with success (exit value
24186 0). If the compilation completes without seeing that particular
24187 error, the compiler exits with failure (exit value 1). The
24188 makefile in mcs/errors has been changed to handle the new behaviour.
24190 * report.cs: Made 'expected error' number a property and renamed
24191 it from 'Probe' to 'ExpectedError'.
24193 * genericparser.cs: Removed error handling support, since it is
24194 now all done by Report class.
24196 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
24197 class, so parse() no longer returns an int.
24199 * namespace.cs: Use Report.Error instead of GenericParser.error
24201 2002-06-22 Miguel de Icaza <miguel@ximian.com>
24203 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
24204 TypeContainer.AddOperator): At the front of the list put the
24205 explicit implementations, so they get resolved/defined first.
24207 2002-06-21 Miguel de Icaza <miguel@ximian.com>
24209 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
24210 interface type is implemented by this TypeContainer. Used during
24211 explicit interface implementation.
24213 (Property.Define, Indexer.Define, Method.Define): Validate that
24214 the given interface in the explicit implementation is one of the
24215 base classes for the containing type.
24217 Also if we are explicitly implementing an interface, but there is
24218 no match in the pending implementation table, report an error.
24220 (Property.Define): Only define the property if we are
24221 not explicitly implementing a property from an interface. Use the
24222 correct name also for those properties (the same CSC uses,
24223 although that is really not needed).
24225 (Property.Emit): Do not emit attributes for explicitly implemented
24226 properties, as there is no TypeBuilder.
24228 (Indexer.Emit): ditto.
24230 Hiding then means that we do not really *implement* a pending
24231 implementation, which makes code fail.
24233 2002-06-22 Martin Baulig <martin@gnome.org>
24235 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
24236 the return value of Object.GetType(). [FIXME: we need to do this whenever
24237 we get a type back from the reflection library].
24239 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24241 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
24243 2002-06-20 Miguel de Icaza <miguel@ximian.com>
24245 * attribute.cs: Return null if we can not look up the type.
24247 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
24248 the interface types found.
24250 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
24251 interface types found.
24253 * typemanager.cs (GetInterfaces): Make this routine returns alll
24254 the interfaces and work around the lame differences between
24255 System.Type and System.Reflection.Emit.TypeBuilder in the results
24256 result for GetInterfaces.
24258 (ExpandInterfaces): Given an array of interface types, expand and
24259 eliminate repeated ocurrences of an interface. This expands in
24260 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
24263 2002-06-21 Martin Baulig <martin@gnome.org>
24265 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
24268 2002-06-21 Martin Baulig <martin@gnome.org>
24270 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
24271 and called with one of the core types, return the corresponding typebuilder for
24274 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
24277 2002-06-21 Martin Baulig <martin@gnome.org>
24279 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
24280 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
24281 (Expression.ConvertReferenceExplicit): Likewise.
24283 * expression.cs (ElementAccess.DoResolve): Likewise.
24284 (ElementAccess.DoResolveLValue): Likewise.
24286 2002-06-10 Martin Baulig <martin@gnome.org>
24288 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
24289 add the "value" parameter to the parameter list.
24291 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
24294 2002-06-19 Miguel de Icaza <miguel@ximian.com>
24296 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
24297 the argument to an int, uint, long or ulong, per the spec. Also
24298 catch negative constants in array creation.
24300 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24302 * class.cs: do not allow the same interface to appear twice in
24303 the definition list.
24305 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24307 * ecore.cs: don't use ldlen with System.Array.
24309 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
24311 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
24313 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
24315 * modifiers.cs: produce correct field attributes for protected
24316 internal. Easy fix so miguel can work on ther harder stuff:-)
24318 2002-06-18 Miguel de Icaza <miguel@ximian.com>
24320 * pending.cs: New file. Move the code from class.cs here.
24321 Support clearning the pending flag for all methods (when not doing
24322 explicit interface implementation).
24324 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
24326 * rootcontext.cs: added a couple more types needed to bootstrap.
24328 2002-06-17 Miguel de Icaza <miguel@ximian.com>
24330 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
24331 constructor in the type, instead of any constructor in the type
24332 hierarchy. Thanks to Paolo for finding this bug (it showed up as
24333 a bug in the Mono runtime when applying the params attribute).
24335 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24336 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
24338 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
24340 * expression.cs (Unary.ResolveOperator): Use TypeManager
24341 to resolve the type.
24343 2002-06-13 Ravi Pratap <ravi@ximian.com>
24345 * cs-parser.jay (enum_member_declaration): Pass in the attributes
24348 * enum.cs (AddEnumMember): Add support to store the attributes associated
24349 with each member too.
24351 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
24352 field builders too - this takes care of the enum member case.
24354 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
24356 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
24357 address-of operator on both value types and pointers.
24359 2002-06-10 Martin Baulig <martin@gnome.org>
24361 * interface.cs (Interface.PopulateIndexer): Add the indexer's
24362 PropertyBuilder to the `property_builders' list.
24364 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
24365 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
24366 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
24367 find any indexers which are inherited from an interface.
24369 2002-06-09 Martin Baulig <martin@gnome.org>
24371 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
24372 the same type as the constant if necessary. There's also a test-130.cs
24375 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
24377 * typemanager.cs (TypeManager.ChangeType): Previously known as
24378 Enum.ChangeEnumType().
24380 2002-06-09 Martin Baulig <martin@gnome.org>
24382 * expression.cs (Cast.TryReduce): Added support for consts.
24384 2002-06-08 Ravi Pratap <ravi@ximian.com>
24386 * class.cs (Accessor): Hold attributes information so we can pass
24389 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
24390 Modify to pass in attributes attached to the methods.
24392 (add_accessor_declaration, remove_accessor_declaration): Ditto.
24394 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
24395 to handle the Accessor kind :-)
24397 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
24399 2002-06-08 Martin Baulig <martin@gnome.org>
24401 * expression.cs (Unary.TryReduceNegative): Added support for
24404 2002-06-08 Martin Baulig <martin@gnome.org>
24406 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
24407 name can't be found in the `defined_names' - the caller will do a
24408 MemberLookup in this case and thus find methods in System.Enum
24409 such as Enum.IsDefined().
24411 2002-06-08 Martin Baulig <martin@gnome.org>
24413 * enum.cs (Enum.ChangeEnumType): This is a custom version of
24414 Convert.ChangeType() which works with TypeBuilder created types.
24415 (Enum.LookupEnumValue, Enum.Define): Use it here.
24417 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
24418 `TypeBuilder.BaseType != null' check.
24419 (TypeContainer.FindMembers): Only lookup parent members if we
24420 actually have a parent.
24421 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
24422 (ConstructorInitializer.Resolve): Likewise.
24424 * interface.cs (Interface.FindMembers): Added
24425 `TypeBuilder.BaseType != null' check.
24427 * rootcontext.cs (RootContext.ResolveCore): Added
24428 "System.Runtime.CompilerServices.IndexerNameAttribute" to
24429 classes_second_stage.
24431 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
24432 debug_type and trace_type when compiling with --nostdlib.
24434 2002-06-07 Martin Baulig <martin@gnome.org>
24436 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
24437 (AddField): Set it to true when adding a non-static field.
24438 (DefineType): Use `have_nonstatic_fields' to find out whether we
24439 have non-static fields, not `Fields != null'.
24441 2002-06-02 Miguel de Icaza <miguel@ximian.com>
24443 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
24444 dereferencing a null on the static-field code path)
24446 2002-05-30 Martin Baulig <martin@gnome.org>
24448 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
24449 to take command line arguments. Use reflection to call the new
24450 custom `Initialize' function on the symbol writer and pass it the
24451 command line arguments.
24453 * driver.cs (--debug-args): New command line argument to pass command
24454 line arguments to the symbol writer.
24456 2002-05-28 Miguel de Icaza <miguel@ximian.com>
24458 * assign.cs (DoResolve): Forgot to do the implicit conversion to
24459 the target type for indexers and properties. Thanks to Joe for
24462 2002-05-27 Miguel de Icaza <miguel@ximian.com>
24464 * typemanager.cs (MethodFlags): returns the method flags
24465 (Obsolete/ShouldIgnore) that control warning emission and whether
24466 the invocation should be made, or ignored.
24468 * expression.cs (Invocation.Emit): Remove previous hack, we should
24469 not do this on matching a base type, we should do this based on an attribute
24471 Only emit calls to System.Diagnostics.Debug and
24472 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
24473 on the command line.
24475 * rootcontext.cs: Global settings for tracing and debugging.
24477 * cs-tokenizer.cs (define): New utility function to track
24478 defines. Set the global settings for TRACE and DEBUG if found.
24480 2002-05-25 Ravi Pratap <ravi@ximian.com>
24482 * interface.cs (Populate*): Pass in the TypeContainer as well as
24483 the DeclSpace as parameters so that we can create EmitContexts and
24484 then use that to apply attributes etc.
24486 (PopulateMethod, PopulateEvent, PopulateProperty)
24487 (PopulateIndexer): Apply attributes everywhere.
24489 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
24492 (ApplyAttributes): Update accordingly.
24494 We now apply interface attributes for all members too.
24496 2002-05-26 Miguel de Icaza <miguel@ximian.com>
24498 * class.cs (Indexer.Define); Correctly check if we are explicit
24499 implementation (instead of checking the Name for a ".", we
24500 directly look up if the InterfaceType was specified).
24502 Delay the creation of the PropertyBuilder.
24504 Only create the PropertyBuilder if we are not an explicit
24505 interface implementation. This means that explicit interface
24506 implementation members do not participate in regular function
24507 lookups, and hence fixes another major ambiguity problem in
24508 overload resolution (that was the visible effect).
24510 (DefineMethod): Return whether we are doing an interface
24513 * typemanager.cs: Temporary hack until we get attributes in
24514 interfaces (Ravi is working on that) and we get IndexerName
24515 support in interfaces.
24517 * interface.cs: Register the indexers as properties.
24519 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
24520 warning, I have verified that this is a bug in the .NET runtime
24521 (JavaScript suffers of the same problem).
24523 * typemanager.cs (MemberLookup): When looking up members for
24524 interfaces, the parent of an interface is the implicit
24525 System.Object (so we succeed in searches of Object methods in an
24526 interface method invocation. Example: IEnumerable x; x.ToString
24529 2002-05-25 Miguel de Icaza <miguel@ximian.com>
24531 * class.cs (Event): Events should also register if they do
24532 implement the methods that an interface requires.
24534 * typemanager.cs (MemberLookup); use the new GetInterfaces
24537 (GetInterfaces): The code used to lookup interfaces for a type is
24538 used in more than one place, factor it here.
24540 * driver.cs: Track the errors at the bottom of the file, we kept
24543 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
24544 instance if the method we are calling is static!
24546 2002-05-24 Miguel de Icaza <miguel@ximian.com>
24548 * attribute.cs (ApplyAttributes): Make this function filter out
24549 the IndexerName attribute (as that attribute in reality is never
24550 applied) and return the string constant for the IndexerName
24553 * class.cs (TypeContainer.Emit): Validate that all the indexers
24554 have the same IndexerName attribute, and if so, set the
24555 DefaultName attribute on the class.
24557 * typemanager.cs: The return value might contain other stuff (not
24558 only methods). For instance, consider a method with an "Item"
24559 property and an Item method.
24561 * class.cs: If there is a problem with the parameter types,
24564 2002-05-24 Ravi Pratap <ravi@ximian.com>
24566 * ecore.cs (ImplicitConversionExists): Wrapper function which also
24567 looks at user defined conversion after making a call to
24568 StandardConversionExists - we need this for overload resolution.
24570 * expression.cs : Update accordingly the various method calls.
24572 This fixes 2 bugs filed against implicit user defined conversions
24574 2002-05-22 Miguel de Icaza <miguel@ximian.com>
24576 * statement.cs: Track the result of the assignment.
24578 2002-05-21 Miguel de Icaza <miguel@ximian.com>
24580 * expression.cs (MemberAccess): Improved error reporting for
24581 inaccessible members.
24583 2002-05-22 Martin Baulig <martin@gnome.org>
24585 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
24586 itself with debugging support.
24588 2002-05-22 Martin Baulig <martin@gnome.org>
24590 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
24591 Removed, this isn't needed anymore.
24593 2002-05-20 Martin Baulig <martin@gnome.org>
24595 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
24596 be underlying type for an enum.
24598 2002-05-20 Miguel de Icaza <miguel@ximian.com>
24600 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
24601 that splits out the loading of just the core types.
24603 * rootcontext.cs (ResolveCore): Split the struct resolution in
24604 two, so we can load the enumeration underlying types before any
24607 * expression.cs (Is): Bandaid until we fix properly Switch (see
24608 bug #24985 for details).
24610 * typemanager.cs (ImplementsInterface): The hashtable will contain
24611 a null if there are no interfaces implemented.
24613 2002-05-18 Miguel de Icaza <miguel@ximian.com>
24615 * cs-parser.jay (indexer_declarator): It is fine to have array
24618 2002-05-17 Miguel de Icaza <miguel@ximian.com>
24620 * typemanager.cs: (RegisterBuilder): New function used to register
24621 TypeBuilders that implement interfaces. Since
24622 TypeBuilder.GetInterfaces (as usual) does not work with lame
24624 (AddUserType): register interfaces.
24626 (ImplementsInterface): Use the builder_to_ifaces hash if we are
24627 dealing with TypeBuilder. Also, arrays are showing up as
24628 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
24629 methods can not be invoked on them!
24631 * ecore.cs (ExplicitReferenceConversionExists): Made public.
24632 (ImplicitReferenceConversionExists): Split out from
24633 StandardConversionExists.
24635 * expression.cs (As): We were only implementing one of the three
24636 cases for the as operator. We now implement them all.
24637 (Is): Implement the various other cases for Is as well.
24639 * typemanager.cs (CACHE): New define used to control if we want or
24640 not the FindMembers cache. Seems to have a negative impact on
24641 performance currently
24643 (MemberLookup): Nested types have full acess to
24644 enclosing type members
24646 Remove code that coped with instance/static returns for events, we
24647 now catch this in RealFindMembers.
24649 (RealFindMembers): only perform static lookup if the instance
24650 lookup did not return a type or an event.
24652 2002-05-17 Miguel de Icaza <miguel@ximian.com>
24654 * assign.cs (CompoundAssign): We pass more semantic information
24655 now to Compound Assignments than we did before: now we have all
24656 the information at hand, and now we resolve the target *before* we
24657 do the expression expansion, which allows the "CacheValue" method
24658 to have the effect we intended (before, a [x] += 1 would generate
24659 two differen ArrayAccess expressions from the ElementAccess,
24660 during the resolution process).
24662 (CompoundAssign.DoResolve): Resolve target and original_source here.
24664 2002-05-16 Miguel de Icaza <miguel@ximian.com>
24666 * expression.cs (ArrayAccess): dropped debugging information.
24668 * typemanager.cs: Small bug fix: I was always returning i_members,
24669 instead of one of i_members or s_members (depending on which had
24672 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
24673 method is invoked before any code generation takes place, and it
24674 is a mechanism to inform that the expression will be invoked more
24675 than once, and that the method should use temporary values to
24676 avoid having side effects
24678 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
24680 * ecore.cs (Expression.CacheTemporaries): Provide empty default
24683 * expression.cs (Indirection, ArrayAccess): Add support for
24684 CacheTemporaries in these two bad boys.
24686 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
24687 ldobj or ldind_ref.
24688 (StoreFromPtr): Handle stobj as well.
24690 * expression.cs (UnaryMutator): Share more code.
24692 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
24693 down: I was not tracking the Filter function as well, which
24694 was affecting the results of the cache.
24696 2002-05-15 Miguel de Icaza <miguel@ximian.com>
24698 * attribute.cs: Remove the hack to handle the CharSet property on
24701 2002-05-14 Miguel de Icaza <miguel@ximian.com>
24703 * attribute.cs (DoResolve): More uglyness, we now only try to
24704 resolve the attribute partially, to extract the CharSet
24705 information (only if we are a StructLayout attribute). Otherwise
24707 (GetExtraTypeInfo): Add some code to conditionally kill in the
24708 future this. I am more and more convinced that the .NET
24709 framework has special code to handle the attribute setting on
24712 * expression.cs (IsParamsMethodApplicable): Revert my previous
24713 foreach change here, it was wrong.
24715 2002-05-13 Miguel de Icaza <miguel@ximian.com>
24717 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
24718 (pp_expr): do not abort on unknown input, just return.
24719 (eval): abort if there are pending chars.
24721 * attribute.cs (Attribute.Resolve): Positional parameters are
24722 optional. Deal with that case.
24724 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
24725 the Ansi/Unicode/Auto information for the type.
24727 (TypeContainer.DefineType): instantiate the EmitContext here, as
24728 we will be using it during the type definition (to resolve
24729 attributes) and during the emit phase.
24731 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
24732 to pull type information out of the attributes
24734 (Attribute.Resolve): track the constructor builder, and allow for
24735 multiple invocations (structs and classes will use this).
24737 * ecore.cs (MemberLookupFinal): new version with all the
24738 parameters customizable.
24740 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
24741 constructors. Return if the result value is null (as the error
24742 would have been flagged already by MemberLookupFinal)
24744 Do not allow instances of abstract classes or interfaces to be
24747 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
24748 We have to compare the assembly property here when dealing with
24749 FamANDAssem and Assembly access modifiers, because we might be
24750 creating an assembly from *modules* (that means that we are not
24751 getting TypeBuilders for types defined in other modules that are
24752 part of this assembly).
24754 (Method.Emit): If the method is marked abstract and has a body,
24757 (TypeContainer.DefineMembers): If both the defined member and the
24758 parent name match are methods, then do not emit any warnings: let
24759 the Method.Define routine take care of flagging warnings. But if
24760 there is a mismatch (method overrides something else, or method is
24761 overriwritten by something, then emit warning).
24763 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
24764 set to null, this means `do not check for the return type on the
24767 (Method.Define): set the return type for the method signature to
24768 null, so that we get methods with the same name and parameters and
24769 different return types. This is used to flag warning 114 (you are
24770 hiding a method, and you probably want to use the new/override
24773 * typemanager.cs (MemberLookup): Implemented proper access
24774 control, closing a long standing set of bug reports. The problem
24775 was that the Framework only has two bits: Public and NonPublic,
24776 and NonPublic includes private and protected methods, but we need
24777 to enforce the FamANDAssem, FamOrAssem and Family.
24779 2002-05-11 Miguel de Icaza <miguel@ximian.com>
24781 * statement.cs (GotoCase): Return true: Ammounts to giving up
24782 knowledge on whether we return or not, and letting the other case
24783 be responsible for it.
24785 2002-05-10 Miguel de Icaza <miguel@ximian.com>
24787 * driver.cs: Do not load directories for each file processed, only
24788 do it if there is a pattern.
24790 * ecore.cs: Report readonly assigns here as well, as we might have
24791 been resolved only by MemberAccess.
24793 (SimpleName.SimpleNameResolve): Also be useful for LValue
24794 resolution. We need this to propagate assign to local readonly variables
24796 * typemanager.cs: Use a ptrhashtable for the criteria, because we
24797 do not want to reuse potential criteria memory.
24799 * class.cs (MyEventBuilder): Set reflected_type;
24801 * ecore.cs (Constantify): Added support for constifying bools.
24803 (RootContext.LookupType): Added a cache for values looked up in
24804 the declaration space.
24806 * typemanager.cs (FindMembers): Now is a front-end to
24807 RealFindMembers, and provides a two-level hashtable-based cache to
24810 15% performance improvement: from 22.5 to 19.2 seconds.
24812 * expression.cs (IsParamsMethodApplicable): use foreach.
24813 (Invocation.DoResolve): ditto.
24814 (New.DoResolve): ditto.
24815 (ArrayCreation.DoResolve): ditto.
24817 * ecore.cs (FindMostEncompassingType): use foreach.
24819 * delegate.cs (NewDelegate.DoResolve): Use foreach
24821 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
24822 (RemoveMethods): use foreach.
24824 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
24825 nested foreach statements instead of for, and also break out of
24826 the inner loop once a match is found.
24828 (Invocation.OverloadResolve): Use foreach, simplify the code.
24830 2002-05-08 Miguel de Icaza <miguel@ximian.com>
24832 * cfold.cs (BinaryFold): During an enumeration evaluation context,
24833 we actually unwrap the expression to allow for extra information
24836 * expression.cs: Use Shr_Un on unsigned operations.
24838 2002-05-08 Ravi Pratap <ravi@ximian.com>
24840 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
24841 applicable operators was not being considered correctly. This closes
24842 the bug Miguel reported.
24844 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
24846 * attribute.cs: check that the type derives from System.Attribute
24847 and report the correct error in that case (moved the duplicate code to
24848 its own method, too).
24850 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
24852 * attribute.cs: lookup attribute type name as the spec says: first the
24853 bare attribute name and then name + "Attribute" (nant compiles with
24854 mcs after this fix).
24856 2002-05-07 Miguel de Icaza <miguel@ximian.com>
24858 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
24859 Because of the way we parse things, we should try to see if a
24860 UIntConstant can fit in an integer.
24862 2002-05-07 Ravi Pratap <ravi@ximian.com>
24864 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
24865 when we are in an explicit context.
24867 (ConvertReferenceExplicit): When converting from Iface type S to Class
24868 T make sure the rules are implemented as an OR.
24870 * parameter.cs (ParameterType): Make it a property for now although the
24871 purpose really isn't anything immediate.
24873 * expression.cs (Is*Applicable): Do better checking on the parameter type
24874 of a ref/out parameter. The ones from the system assemblies are already
24875 marked with the correct type so we don't need to do any correction.
24877 * ecore.cs (StandardConversionExists): Conversion from Interface types to
24878 the object type is standard too so include that.
24880 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24882 * ecore.cs (StandardConversionExists): Augment with missing code:
24883 deal with IntConstant, LongConstants and Enumerations.
24885 * assign.cs: Report the error, instead of failing silently
24887 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
24888 typecontainer that they are declared, because the
24889 typecontainer/namespace will have the list of using clauses that
24890 need to be applied.
24892 Assembly Attributes were escaping the normal registration
24895 (EmitCode): Apply attributes within an EmitContext that represents
24896 the container they were declared on.
24898 * cs-parser.jay: Track bases for structs. How did I get this wrong?
24900 2002-05-06 Ravi Pratap <ravi@ximian.com>
24902 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
24903 Revamp completely - make much cleaner as we now operate only
24906 (FindMostSpecificSource, FindMostSpecificTarget): New methods
24907 to implement the logic detailed in the spec more correctly.
24909 (UserDefinedConversion): Update accordingly.
24911 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24913 * statement.cs: Return flow analysis information up.
24915 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
24918 (token): Do not consume an extra character before calling
24921 2002-05-06 Piers Haken <piersh@friskit.com>
24923 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
24925 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24927 * class.cs (Constructor.Emit): Set the IsStatic flag in the
24928 EmitContext during the instance constructor initializer
24929 resolution, to stop access to instance variables.
24931 This is mandated by the spec, last paragraph of the `constructor
24932 initializers' section.
24934 2002-05-05 Miguel de Icaza <miguel@ximian.com>
24936 * cs-parser.jay, class.cs (Accessor): new class used to represent
24937 an accessor (get or set). In the past we used `null' to represent
24938 a missing accessor. But this is ambiguous because there was no
24939 way to tell in abstract indexers/properties if one of them was
24942 Now there is a way of addressing that.
24944 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
24945 instead of FindMembers.
24947 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
24948 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
24950 * attribute.cs: Treat indexers and properties as the same in terms
24951 of applying attributes
24953 * ecore.cs (FindMostEncompassedType): Use statically initialized
24954 EmptyExpressions()s like we do elsewhere to avoid creating useless
24955 objects (and we take this out of the tight loop).
24957 (GetConversionOperators): Move the code to extract the actual
24958 operators to a separate routine to clean things up.
24960 2002-05-04 Miguel de Icaza <miguel@ximian.com>
24962 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
24963 events are always registered FieldBuilders.
24965 * class.cs (FieldBase): New class shared by Fields
24967 * delegate.cs: If we are a toplevel delegate, use our full name.
24968 If we are a nested delegate, then only use our tail name.
24970 2002-05-02 Ravi Pratap <ravi@ximian.com>
24972 * expression.cs (IsApplicable): Ensure that we add the "&" to
24973 ref/out types before comparing it with the type of the argument.
24975 (IsParamsMethodApplicable): Ditto.
24977 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
24980 * delegate.cs : Handle the case when we have more than one applicable
24981 method. Flag an error only when we finish checking all.
24983 2002-05-02 Miguel de Icaza <miguel@ximian.com>
24985 * expression.cs: Add support for boolean static initializers.
24987 2002-05-01 Miguel de Icaza <miguel@ximian.com>
24989 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
24991 * parameter.cs (ComputeParameterTypes,
24992 ComputeAndDefineParameterTypes): Better error handling: now we
24993 clear the `types' cache if we fail during any of the type lookups.
24994 We also return the status code correctly to our caller
24996 * delegate.cs: If we fail to define a delegate, abort the extra
24999 * expression.cs (Binary.ResolveOperator): for
25000 operator==(object,object) and operator !=(object, object) we also
25001 have to verify that there is an implicit conversion from one to
25004 (ArrayAccess.DoResolve): Array Access can operate on
25007 2002-04-30 Miguel de Icaza <miguel@ximian.com>
25009 * assign.cs (CompoundAssign): A new class used as a "flag" that
25010 the assignment actually is happening as part of a compound
25011 assignment operator.
25013 During compound assignment, a few new rules exist to enable things
25020 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
25021 to the type of x) if y is implicitly convertible to the type of x,
25022 and the operator is a builtin operator and the return type of the
25023 operator is explicitly convertible to the type of x.
25025 * rootcontext.cs: Reset warning level to 2. 4 catches various
25026 "interesting" features in mcs, we must clean this up at some
25027 point, but currently am trying to kill other bugs ;-)
25029 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
25030 in container classes as well.
25032 * expression.cs (Binary.ResolveOperator): Handle string case
25033 before anything else (as operator overloading does emit an error
25034 before doing anything else).
25036 This code could go away when we move to a table driven model, but
25037 i could not come up with a good plan last night.
25039 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
25041 * typemanager.cs (CSharpName): reimplementation using regex.
25042 * class.cs: added null check for fields in Emit
25043 * rootcontext.cs: set warninglevel to 4
25045 2002-04-29 Miguel de Icaza <miguel@ximian.com>
25047 * typemanager.cs (CSharpName): reimplemented with Lupus
25050 2002-04-28 Miguel de Icaza <miguel@ximian.com>
25052 * statement.cs (If): correclty implement Resolve, because we were
25053 not catching sem errors in there. The same process is needed
25055 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
25058 (Statement.Warning_DeadCodeFound): Factorize code.
25059 (While): Report dead code here too.
25061 (Statement): Added Resolve virtual method to allow
25062 for resolution split from the emit code.
25064 2002-04-26 Miguel de Icaza <miguel@ximian.com>
25066 * statement.cs (EmitBoolExpression): No longer try to resolve the
25068 (MakeBoolean): New utility function that resolve, implicitly
25069 converts to boolean and tags the expression.
25072 (If, Do): Implement dead code elimination.
25073 (While): Implement loop inversion
25075 (Do, While, For, If): Resolve the expression prior to calling our
25078 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
25081 - added method Report28 (warning: program has more than one entry point)
25082 - added method IsEntryPoint, implements paragraph 10.1 of the spec
25083 - modified method Method.Define, the part at the end of the method
25085 * rootcontext.cs: added static public Location EntryPointLocation;
25087 * ../errors/cs0028.cs : Add test case for the above warning.
25090 - modified method CSharpName to allow arrays of primitive type to
25091 be printed nicely (e.g. instead of System.Int32[][] it now prints
25093 - added method CSharpSignature: returns the signature of a method
25094 in string format to be used in reporting errors, warnings, etc.
25096 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
25099 2002-04-26 Ravi Pratap <ravi@ximian.com>
25101 * delegate.cs (Define): Fix extremely silly bug where I was
25102 setting the type of the 'object' parameter of the BeginInvoke
25103 method to System.IAsyncResult instead of System.Object ;-)
25105 2002-04-26 Miguel de Icaza <miguel@ximian.com>
25107 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
25110 (Constructor.Emit): return if we fail to initialize the
25111 constructor. Another door closed!
25113 * expression.cs (New.DoResolve): Improve error message (from -6 to
25114 1501). Use DeclaredOnly lookup to find the exact constructor.
25116 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
25117 loop. This is useful.
25119 * cs-parser.jay: Adjust the default parameters so that destructors
25120 have the proper signature.
25122 2002-04-26 Martin Baulig <martin@gnome.org>
25124 * driver.cs (LoadAssembly): If `assembly' contains any characters
25125 which are only valid in path names and not in assembly names
25126 (currently slash, backslash and point), use Assembly.LoadFrom ()
25127 instead of Assembly.Load () on the `assembly' (before iteration
25128 over the link_paths).
25130 2002-04-26 Martin Baulig <martin@gnome.org>
25132 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
25134 2002-04-25 Miguel de Icaza <miguel@ximian.com>
25136 * class.cs (Property): use the new typemanager.MemberLookup
25138 (TypeContainer.MemberLookup): Implement using the
25139 TypeManager.MemberLookup now.
25141 * typemanager.cs: Make MemberLookup a function of the TypeManager,
25142 and return MemberInfos, so that these can be used without an
25143 EmitContext (what we had before).
25145 2002-04-24 Miguel de Icaza <miguel@ximian.com>
25147 * expression.cs: Fix the case where the argument to params if the
25148 type of the params. I omitted handling this before. Fixed
25150 2002-04-22 Miguel de Icaza <miguel@ximian.com>
25152 * driver.cs: Call BootCorlib_PopulateCoreType
25154 * class.cs (Property.CheckBase): Check for properties only, not
25157 * interface.cs: Temporary hack: try/catch around the
25158 CustomAttributeBuilder, because I am getting an exception that I
25161 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
25162 types whose definitions are required to be there (attributes are
25163 defined before standard types).
25165 Compute definitions as we boot the various types, as they are used
25166 immediately (value_type class will need object_type, but if we do
25167 not initialize object_type, we will pass a null, which will let
25168 the runtime pick the System.Object from the existing corlib, which
25169 is not what we want).
25171 2002-04-22 Patrik Torstensson <totte@labs2.com>
25173 * cs-tokenizer.cs: fixed a number of trim() issues.
25175 2002-04-22 Ravi Pratap <ravi@ximian.com>
25177 * expression.cs (Argument.Type): Ensure that we return the correct
25178 type when we have out or ref parameters [in which case we
25181 2002-04-22 Miguel de Icaza <miguel@ximian.com>
25183 * class.cs (Property, Indexer): Allow extern modifier in there.
25185 * typemanager.cs (InitBaseTypes): Initializes object_type and
25186 value_type, since those will be used early on during the bootstrap
25187 process to compile corlib.
25189 (InitCoreTypes): Move code from here to InitBaseTypes.
25191 2002-04-21 Miguel de Icaza <miguel@ximian.com>
25193 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
25194 single-dimension arrays as using the ldlen opcode.
25196 Daniel Lewis discovered this optimization.
25198 * typemanager.cs: Add signature for System.Array::get_Length
25200 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25202 * statement.cs: report the error when the foreach does not apply to an
25203 array nor a collection.
25205 2002-04-19 Miguel de Icaza <miguel@ximian.com>
25207 * expression.cs: Add implicit conversions to the operator ~.
25209 * constant.cs (DecimalConstant.Emit): Emit decimal value.
25211 * typemanager.cs: Locate the decimal constructor.
25213 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25215 * attribute.cs: use the new property of TypeOf.
25216 * expression.cs: added 'get' property around typearg.
25218 These changes fix a build breaker reported by NickD. Is this the
25219 correct way to fix? If not, please, revert my changes and make it
25222 2002-04-17 Miguel de Icaza <miguel@ximian.com>
25224 * attribute.cs: Add support for typeof in attribute invocations.
25225 I am not sure that this is right though.
25227 2002-04-14 Duncan Mak <duncan@ximian.com>
25229 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
25230 Binary.Operator.Division case.
25232 2002-04-13 Ravi Pratap <ravi@ximian.com>
25234 * class.cs (DefineType): Ensure that we do a proper check on
25235 attribute types and also register it with the TypeManager.
25237 (TypeContainer.Targets): The default for attribute types is
25238 AttributeTargets.All.
25240 * attribute.cs (ApplyAttributes): Registering the attribute type
25241 is done elsewhere, not when we discover we have a Usage attribute.
25243 2002-04-12 Ravi Pratap <ravi@ximian.com>
25245 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
25246 and get rid of is_delegate parameter.
25248 * everywhere : update.
25250 2002-04-12 Ravi Pratap <ravi@ximian.com>
25252 * cs-parser.jay (compilation_unit): Revamp completely to use
25253 some new ideas that I got from Rhys' grammar to solve the problems
25254 with assembly level attributes.
25256 (outer_declaration): New grammar production.
25258 (attribute_sections): Add.
25260 (opt_attributes): Base on attribute_sections
25262 (namespace_declaration): Allow opt_attributes to tackle the case
25263 when we have assembly level attributes - we are clever in this
25266 * attribute.cs (ApplyAttributes): Do not worry about assembly
25267 attributes in the non-global context.
25269 * rootcontext.cs (AddGlobalAttributes): Go back to using this
25270 instead of SetGlobalAttributes.
25272 * class.cs, rootcontext.cs : Ensure we define and generate
25273 attribute types before anything else.
25275 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
25276 and flag the new error -20 for the case when the attribute type
25277 does not have valid targets specified. csc does not catch this.
25279 * ../errors/errors.txt : update for error # -20
25281 2002-04-11 Ravi Pratap <ravi@ximian.com>
25283 * support.cs (InternalParameters.ParameterModifier): Do some null
25284 checking and return sane values.
25286 * class.cs (Method.Define): If we are a PInvoke method, ensure
25287 that we are static and extern. Report error # 601
25289 * ../errors/cs0601.cs : Add test case for the above error.
25291 2002-04-07 Ravi Pratap <ravi@ximian.com>
25293 * rootcontext.cs (attribute_types): We need to keep type of
25294 all attribute types separately and emit code for them first.
25296 (RegisterAttribute) : Implement.
25298 * class.cs (DefineType): Check if the current Type is a custom
25299 attribute type and register it accordingly.
25301 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
25302 adding the first attribute twice and rename to
25304 (SetGlobalAttributes): this.
25306 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
25309 * attribute.cs (ApplyAttributes): Take an additional argument telling us
25310 if we are processing global arguments. Hmm, I am unsure of this.
25312 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25314 * expression.cs: added static array of strings to avoid calling
25315 Enum.ToString () for Operator in Binary. Significant recover of
25318 2002-04-10 Miguel de Icaza <miguel@ximian.com>
25320 * class.cs (FindMembers): Allow the Builders of the various
25321 members to be null. If they are skip them. This only happens
25322 during the PInvoke declaration.
25324 2002-04-09 Miguel de Icaza <miguel@ximian.com>
25326 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
25327 failure, so we do not keep going afterwards.
25329 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
25330 wanted to pass `false' as the `is_delegate' argument. If this is
25331 the case, why not use delegate_type == null to mean `is_delegate =
25332 false' and anything else as is_delegate = true.
25334 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
25336 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
25337 code for the section, not the beginning of the tests.
25339 2002-04-08 Miguel de Icaza <miguel@ximian.com>
25341 * cfold.cs: Handle operator + (Enum x, Underlying x)
25343 * expression.cs (Binary): same. Warn about errors where we have
25344 Enum/Enum in operator + as well.
25346 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
25349 - added support for switch(bool)
25350 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
25351 - add TableSwitchEmit() to handle table-based switch statements
25353 2002-04-05 Ravi Pratap <ravi@ximian.com>
25355 * expression.cs (Invocation.OverloadResolve): Factor out code which
25356 does parameter compatibility checking with arguments so that we can
25357 re-use the code even from Delegate.VerifyApplicability
25359 (VerifyArgumentsCompat): Move above code here.
25361 * delegate.cs (VerifyApplicability): Get rid of duplicate code
25362 and instead make a call to the above method.
25364 2002-03-31 Ravi Pratap <ravi@ximian.com>
25366 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
25367 We use it to keep track of classes which are attribute types.
25369 2002-04-02 Miguel de Icaza <miguel@ximian.com>
25371 * delegate.cs (Delegate.Define): Correctly define the types in the
25372 presence of fixed and array parameters.
25374 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
25377 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
25378 include NonPublic after the first iteration.
25380 * class.cs (Indexer.CheckBase): Only check if both parents are
25383 * cs-parser.jay (accessor_body): If empty, set to null.
25385 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
25386 same code path here to resolve constants names that we did have in
25387 MemberAccess.DoResolve. There is too much code duplicated here.
25389 2002-04-01 Miguel de Icaza <miguel@ximian.com>
25391 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
25393 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
25396 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
25397 tokens, numbers and strings.
25399 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
25402 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
25403 asyncronous parameters and the regular parameters.
25405 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
25406 specify the target directory.
25408 * expression.cs: (This.DoResolve): Simplify
25409 (As.Emit): Optimize, do not generate IsInst if the expression is
25410 always of the given type.
25412 (Is.DoResolve): Bug fix, we were reporting both always/never for
25415 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
25416 creating too many unnecessary arrays.
25418 2002-03-31 Miguel de Icaza <miguel@ximian.com>
25420 * class.cs (EmitFieldInitializer): Use Assign expression to assign
25421 fields instead of rolling our own initializer. Takes care of all
25422 implicit conversions, and drops unnecessary static checks/argument.
25424 2002-03-31 Dick Porter <dick@ximian.com>
25426 * driver.cs: use the GetDirectories() return values properly, and
25427 use "/" as path separator.
25429 2002-03-30 Miguel de Icaza <miguel@ximian.com>
25431 * expression.cs (Unary): Optimize - - expr into expr.
25432 (Binary): Optimize a + (-b) into a -b.
25434 * codegen.cs (CodeGen): Made all methods static.
25436 2002-03-29 Miguel de Icaza <miguel@ximian.com>
25440 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
25441 TypeBuilder property.
25443 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
25446 * tree.cs: Removed the various RecordXXXX, and replaced with a
25447 single RecordDecl. Removed all the accessor methods, and just
25448 left a single access point Type
25450 * enum.cs: Rename DefineEnum to DefineType.
25452 * decl.cs: New abstract method `DefineType' used to unify the
25453 Defines for Enumerations, Interfaces, TypeContainers and
25456 (FindType): Moved LookupInterfaceOrClass here. Moved the
25457 LookupBaseClasses method that used to live in class.cs and
25458 interface.cs here, and renamed to FindType.
25460 * delegate.cs: Implement DefineType. Take advantage of the
25461 refactored pattern for locating the parent builder without taking
25462 the parent_builder argument (which we know does not work if we are
25463 nested, and triggering a toplevel definition).
25465 2002-03-28 Miguel de Icaza <miguel@ximian.com>
25467 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
25468 accessibility of a member has changed during override and report
25471 * class.cs (Method.Define, Property.Define): Only complain on
25472 overrides if the method is private, any other accessibility is
25473 fine (and since we just checked the permission is the same, we are
25476 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
25477 and elif are processed always. The other pre-processing
25478 directives are only processed if we are "taking" the path
25480 2002-03-29 Martin Baulig <martin@gnome.org>
25482 * class.cs (Method.Emit): Only emit symbolic debugging info if the
25483 current location is not Null.
25485 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
25486 a separate method so we can profile it.
25488 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
25489 `span.Seconds' are just seconds, but no minutes or hours.
25490 (MainDriver): Profile the CodeGen.SaveSymbols calls.
25492 2002-03-28 Miguel de Icaza <miguel@ximian.com>
25494 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
25495 Remove the gratuitous set of Final:
25497 // If an interface implementation, then we can set Final.
25498 if (((flags & MethodAttributes.Abstract) == 0) &&
25499 implementing.DeclaringType.IsInterface)
25500 flags |= MethodAttributes.Final;
25502 I do not know what I was smoking when I used that.
25505 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
25506 step into fixing the name resolution issues for delegates and
25507 unifying the toplevel name resolution.
25509 2002-03-28 Martin Baulig <martin@gnome.org>
25511 * class.cs (Method.Emit): If we have a symbol writer, call its
25512 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
25513 tell it about the current method.
25515 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
25516 writer that we're going to emit the first byte of IL code for a new
25517 statement (a new source line).
25518 (EmitContext.EmitTopBlock): If we have a symbol writer, call
25519 EmitContext.Mark() before emitting any code.
25521 * location.cs (SymbolDocument): Return null when we're Null.
25523 * statement.cs (Statement): Moved the `Location loc' variable here.
25524 (Statement.EmitBoolExpression): If we have a symbol writer, call
25525 ec.Mark() before emitting any code to tell it that we're at the
25526 beginning of a new statement.
25527 (StatementExpression): Added `Location' argument to the constructor.
25528 (Block): Added public readonly variable `StartLocation' and public
25529 variable `EndLocation'. The latter is to be set using SetEndLocation().
25530 (Block): Added constructor which takes a start and end location.
25531 (Block.SetEndLocation): New method. This sets the end location.
25532 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
25533 local variables we create.
25534 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
25535 each statement and do also mark the begin and end of the block.
25537 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
25538 tell it the current lexer.Location, use Location.Null for the end of the
25540 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
25541 current block, set its end location using SetEndLocation().
25542 (statement_expression): StatementExpression constructor now takes the
25543 lexer.Location as additional argument.
25544 (for_statement, declare_local_variables): Likewise.
25545 (declare_local_variables): When creating a new implicit block, use the
25546 new Block constructor and pass it the lexer.Location.
25548 2002-03-28 Miguel de Icaza <miguel@ximian.com>
25550 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
25551 members also on the parent interfaces recursively.
25553 2002-03-27 Miguel de Icaza <miguel@ximian.com>
25555 * report.cs: Use new formats, since Gonzalo finished the missing
25558 * expression.cs (Binary.ResolveOperator): added missing operator|
25559 operator& and operator^ for bool/bool.
25561 * cs-parser.jay: CheckDef now takes a Location argument that is
25562 used to report errors more precisly (instead of reporting the end
25563 of a definition, we try to track something which is a lot closer
25564 to the source of the problem).
25566 * cs-tokenizer.cs: Track global token use, so we can properly flag
25567 the use of #define/#undef after the first token has been seen.
25569 Also, rename the reportXXXX to Error_DescriptiveName
25571 * decl.cs (DeclSpace.IsTopLevel): Move property here from
25572 TypeContainer, so that Enum and Interface can use this too.
25574 * class.cs (TypeContainer.LookupInterfaceOrClass,
25575 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
25576 `builder' argument. Typically this was used to pass the parent
25577 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
25580 The problem is that a nested class could trigger the definition of
25581 a toplevel class, and the builder would be obviously wrong in that
25584 So we drop this argument, and we compute dynamically the
25585 TypeBuilder/ModuleBuilder (the correct information was available
25586 to us anyways from DeclSpace.Parent)
25588 * interface.cs (Interface.DefineInterface): Drop builder
25589 parameter cleanup like class.cs
25591 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
25594 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
25597 (Try.Emit): Propagate the returns value from the statement.
25599 (Return.Emit): Even if we are leavning
25601 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
25603 * modifiers.cs: Fix the computation of MethodAttributes flags.
25605 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
25607 * driver.cs: allow compilation of files that start with '/'.
25608 Add a default case when checking the argument of --target.
25610 2002-03-25 Miguel de Icaza <miguel@ximian.com>
25612 * interface.cs: Implement the same search algorithm for types in
25613 the interface code.
25615 * delegate.cs: Do not allow multiple definition.
25617 * Recovered ChangeLog that got accidentally amputated
25619 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
25621 * rootcontext.cs: Load manually enum to allow core classes to
25622 contain enumerations.
25624 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
25625 Update to new static methods in TypeManager.
25627 * typemanager.cs (GetMethod, GetConstructor): Use our
25628 implementation of FindMembers to find the members, since during
25629 corlib compilation, the types are TypeBuilders and GetMethod and
25630 GetConstructor do not work.
25632 Make all methods in TypeManager static.
25634 (InitCodeHelpers): Split the functionality from
25635 the InitCodeTypes function.
25637 * driver.cs: Call InitCodeHelpers after we have populated the
25640 * cs-parser.jay (delegate_declaration): we did not used to compute
25641 the delegate name correctly for void delegates.
25643 2002-03-24 Miguel de Icaza <miguel@ximian.com>
25645 * rootcontext.cs (RootContext): Init the interface_resolve_order
25646 and type_container_resolve_order always.
25648 (ResolveCore, BootstrapCorlib_ResolveClass,
25649 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
25650 compiler when compiling with --nostdlib
25652 * class.cs (TypeContainer.DefineType): Check that our parent is
25653 not null. This test is most important when we are bootstraping
25656 * codegen.cs: Split out the symbol writing code.
25658 2002-03-25 Martin Baulig <martin@gnome.org>
25660 * driver.cs (-g): Made -g an alias for --debug.
25662 2002-03-24 Martin Baulig <martin@gnome.org>
25664 * codegen.cs (SymbolWriter): New public variable. Returns the
25665 current symbol writer.
25666 (CodeGen): Added `bool want_debugging_support' argument to the
25667 constructor. If true, tell the ModuleBuild that we want debugging
25668 support and ask it for the ISymbolWriter.
25669 (Save): If we have a symbol writer, call it's Close() method after
25670 saving the assembly.
25672 * driver.c (--debug): New command line argument to create a
25673 debugger information file.
25675 * location.cs (SymbolDocument): New public property. Returns an
25676 ISymbolDocumentWriter object for the current source file or null
25677 if we don't have a symbol writer.
25679 2002-03-21 Miguel de Icaza <miguel@ximian.com>
25681 * driver.cs (LoadAssembly): Correctly return when all the paths
25682 have been tried and not before.
25684 * statement.cs (Switch.Emit): return the actual coverage for this
25685 statement (returns/not-returns)
25687 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
25688 switch of the statement if we are the last switch section. That
25689 kills two problems: try/catch problems (we used to emit an empty
25690 nop at the end) and switch statements where all branches would
25693 2002-03-19 Miguel de Icaza <miguel@ximian.com>
25695 * driver.cs: Add default assemblies (the equivalent to the
25696 Microsoft CSC.RSP file)
25698 * cs-tokenizer.cs: When updating `cols and setting it to zero,
25699 also update tokens_seen and set it to false.
25701 * driver.cs: Implement --recurse for Mike.
25703 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
25704 correctly splitting out the paths.
25706 2002-03-18 Miguel de Icaza <miguel@ximian.com>
25708 * interface.cs (Interface.PopulateProperty): Instead of using
25709 `parent' as the declaration space for the set parameters, use
25712 * support.cs (InternalParameters): InternalParameters constructor
25713 takes a DeclSpace instead of a TypeContainer.
25715 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
25716 types are being initialized, load the address of it before calling
25719 (New): Provide a mechanism to disable the generation of local
25720 value type temporaries when the caller will be providing us with
25721 an address to store it.
25723 (ArrayCreation.EmitDynamicInitializers): Use it.
25725 2002-03-17 Miguel de Icaza <miguel@ximian.com>
25727 * expression.cs (Invocation.EmitArguments): Only probe for array
25728 property if there is more than one argument. Sorry about that.
25730 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
25731 empty param arrays.
25733 * class.cs (Method.LabelParameters): Fix incorrect code path that
25734 prevented the `ParamArrayAttribute' from being applied to the
25737 2002-03-16 Miguel de Icaza <miguel@ximian.com>
25739 * support.cs (ReflectionParameters): Correctly compute whether the
25740 last argument is a params array. Fixes the problem with
25743 * typemanager.cs: Make the assemblies array always be non-null
25744 (empty, but non-null)
25746 * tree.cs (RecordDecl): New function that abstracts the recording
25747 of names. This reports error 101, and provides a pointer to the
25748 previous declaration. Fixes a crash in the compiler.
25750 * cs-parser.jay (constructor_declaration): Update to new grammar,
25751 and provide a constructor_body that can be empty.
25753 2002-03-15 Miguel de Icaza <miguel@ximian.com>
25755 * driver.cs: Add support for --resources.
25757 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
25758 Make all types for the various array helper methods be integer.
25760 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
25761 CheckState to ConvCast.
25763 (ConvCast): Now it takes a `checked' state argument, to avoid
25764 depending on the emit context for the conversion, and just using
25765 the resolve time setting.
25767 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
25768 instead of Invocation.EmitArguments. We do not emit the original
25769 arguments, instead we emit those which have been converted to
25770 unsigned int expressions.
25772 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
25774 * codegen.cs: ditto.
25776 * expression.cs (LocalVariableReference): Drop the use of the
25777 Store function that depended on the variable index.
25779 * statement.cs (VariableInfo): Drop the `Idx' property from this
25780 class, as this is not taking into account the indexes for
25781 temporaries tat we generate during the execution, getting the
25784 * class.cs: First emit class initializers, then call the parent
25787 * expression.cs (Binary): Fix opcode emision.
25788 (UnaryMutator.EmitCode): Support checked code generation
25790 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
25791 matches for events for both the Static and Instance scans,
25792 pointing to the same element. Fix that.
25794 2002-03-14 Miguel de Icaza <miguel@ximian.com>
25796 * rootcontext.cs (ResolveTree): Always set the
25797 interface_resolve_order, because nested interfaces will be calling
25800 * class.cs (GetInterfaceOrClass): Track the same resolution
25801 process used by TypeManager.LookupType. This fixes the nested
25802 type lookups in class declarations (separate path from
25805 (TypeContainer.DefineType): Also define nested interfaces.
25806 (TypeContainer.RegisterOrder): New public function used to
25807 register the order in which child interfaces need to be closed.
25809 Nested interfaces need to be closed after their parents have been
25812 * interface.cs (InterfaceAttr): Put all the logic for computing
25813 the interface attribute here.
25815 (DefineInterface): Register our interface order with the
25816 RootContext or with the TypeContainer depending on the case.
25818 2002-03-12 Miguel de Icaza <miguel@ximian.com>
25820 * cs-parser.jay: rework foreach statement to work with the new
25821 changes to the policy on SimpleNames.
25823 * report.cs: support Stacktrace on warnings as well.
25825 * makefile: drop --unsafe and /unsafe from the compile.
25827 2002-03-13 Ravi Pratap <ravi@ximian.com>
25829 * ecore.cs (StandardConversionExists): Modify to take an Expression
25830 as the first parameter. Ensure we do null -> reference type conversion
25833 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
25834 temporary Expression objects.
25836 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
25838 * interface.cs: workaround bug in method overloading resolution
25839 (there is already a bugzilla bug for it).
25841 2002-03-12 Miguel de Icaza <miguel@ximian.com>
25843 We could also solve this problem by having a separate path for
25844 performing type lookups, instead of DoResolve, we could have a
25845 ResolveType entry point, and only participating pieces of the
25846 production (simplename, deref, array) would implement this.
25848 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
25849 signal SimpleName to only resolve type names and not attempt to
25850 resolve anything else.
25852 * expression.cs (Cast): Set the flag.
25854 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
25856 * class.cs: Only report 108 if there is no `new' modifier.
25858 * cs-parser.jay: rework foreach statement to work with the new
25859 changes to the policy on SimpleNames.
25861 * report.cs: support Stacktrace on warnings as well.
25863 * makefile: drop --unsafe and /unsafe from the compile.
25865 2002-03-11 Miguel de Icaza <miguel@ximian.com>
25867 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25868 lookups here, instead of doing that at parse time. This means
25869 that our grammar will not introduce `LocalVariableReferences' as
25870 expressions at this point. That solves the problem of code like
25874 static void Main ()
25878 This is only half the fix. The full fix requires parameters to
25879 also be handled in this way.
25881 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
25882 makes the use more obvious of the DeclSpace. The
25883 ec.TypeContainer.TypeBuilder is now only used to pull the
25884 TypeBuilder for it.
25886 My theory is that I can get rid of the TypeBuilder completely from
25887 the EmitContext, and have typecasts where it is used (from
25888 DeclSpace to where it matters).
25890 The only pending problem is that the code that implements Aliases
25891 is on TypeContainer, and probably should go in DeclSpace.
25893 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25894 lookups here, instead of doing that at parse time. This means
25895 that our grammar will not introduce `LocalVariableReferences' as
25896 expressions at this point. That solves the problem of code like
25900 static void Main ()
25904 This is only half the fix. The full fix requires parameters to
25905 also be handled in this way.
25907 * class.cs (Property.DefineMethod): When implementing an interface
25908 method, set newslot, when implementing an abstract method, do not
25909 set the flag (before we tried never setting it, or always setting
25910 it, which is the difference).
25911 (Indexer.DefineMethod): same.
25912 (Method.DefineMethod): same.
25914 * ecore.cs: Only set the status used flag if we get back a Field.
25916 * attribute.cs: Temporary hack, so Paolo can keep working.
25918 2002-03-08 Ravi Pratap <ravi@ximian.com>
25920 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
25921 the unmanaged type in the case we have a MarshalAs attribute.
25923 (Resolve): Handle the case when we are parsing the special MarshalAs
25924 attribute [we need to store the unmanaged type to use later]
25926 * typemanager.cs (marshal_as_attr_type): Built in type for the
25927 MarshalAs Attribute.
25929 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
25930 on parameters and accordingly set the marshalling info.
25932 2002-03-09 Miguel de Icaza <miguel@ximian.com>
25934 * class.cs: Optimizing slightly by removing redundant code after
25935 we switched to the `NoTypes' return value.
25936 (Property.DefineMethod): use NoTypes here too.
25938 This fixes the bug I introduced in my last batch of changes.
25940 2002-03-05 Ravi Pratap <ravi@ximian.com>
25942 * tree.cs (RecordEnum): Add. We now keep track of enums too.
25944 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
25945 Enums since those are types too.
25947 * cs-parser.jay (enum_declaration): Record enums as we parse them.
25949 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
25950 thanks to a call during the lookup process.
25952 2002-03-07 Miguel de Icaza <miguel@ximian.com>
25954 * statement.cs (Foreach): Lots of work to accomodate a particular
25955 kind of foreach statement that I had not kept in mind. It is
25956 possible to have foreachs on classes that provide a GetEnumerator
25957 method that return objects that implement the "pattern" for using
25958 a foreach, there is no need to support GetEnumerator
25961 This is needed to compile nant.
25963 * decl.cs: Only report 114 if the member is not `Finalize' and if
25964 the warning level is at least 2.
25966 * class.cs: Moved the compare function from Method to
25969 (MethodSignature.InheritableMemberSignatureCompare): Add new
25970 filter function that is used to extract inheritable methods from a
25973 (Method.Define): Use the new `inheritable_method_signature_filter'
25976 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
25979 2002-03-06 Miguel de Icaza <miguel@ximian.com>
25981 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
25983 * cs-parser.jay: Add opt_semicolon to the interface declaration.
25985 * expression.cs: Pass location information to
25986 ConvertImplicitStandard.
25988 * class.cs: Added debugging code to track return values from
25991 2002-03-05 Miguel de Icaza <miguel@ximian.com>
25993 * expression.cs (Is.DoResolve): If either side of the `is' is an
25994 interface, do not flag the warning.
25996 * ecore.cs (ImplicitReferenceConversion): We need a separate test
25999 * report.cs: Allow for --fatal to be used with --probe.
26001 * typemanager.cs (NoTypes): Move the definition for the empty Type
26004 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
26006 (TypeContainer.DefineProxy): New function used to proxy to parent
26007 implementations when implementing interfaces.
26008 (TypeContainer.ParentImplements): used to lookup if our parent
26009 implements a public function that is required by an interface.
26010 (TypeContainer.VerifyPendingMethods): Hook this up.
26012 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
26013 `modules' and `assemblies' arraylists into arrays. We only grow
26014 these are the very early start up of the program, so this improves
26015 the speedof LookupType (nicely measured).
26017 * expression.cs (MakeByteBlob): Replaced unsafe code with
26018 BitConverter, as suggested by Paolo.
26020 * cfold.cs (ConstantFold.Binary): Special case: perform constant
26021 folding of string concatenation, but if either side is a string,
26022 and the other is not, then return null, and let the runtime use
26023 the concatenation on the string plus the object (using
26024 `Object.ToString').
26026 2002-03-04 Miguel de Icaza <miguel@ximian.com>
26028 Constant Folding has been implemented now.
26030 * expression.cs (Unary.Reduce): Do not throw an exception, catch
26031 the error instead on types that are not supported in one's
26034 * constant.cs (Constant and all children): New set of functions to
26035 perform implict and explicit conversions.
26037 * ecore.cs (EnumConstant): Implement the new functions to perform
26038 conversion by proxying to the child expression.
26040 * codegen.cs: (ConstantCheckState): Constant evaluation has its
26041 own separate setting that can not be turned off from the command
26042 line using --unchecked or --checked and is only controlled using
26043 the checked/unchecked statements and expressions. This setting is
26044 used by the constant folder to flag errors.
26046 * expression.cs (CheckedExpr, UncheckedExpr): Set the
26047 ConstantCheckState as well.
26049 During Resolve, they also have to flag the state, because the
26050 constant folder runs completely in the Resolve phase.
26052 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
26055 2002-03-01 Miguel de Icaza <miguel@ximian.com>
26057 * cfold.cs: New file, this file contains the constant folder.
26059 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
26060 argument to track whether we are using the resulting address to
26061 load or store a value and provide better error messages.
26063 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
26064 new AddressOf arguments.
26066 * statement.cs (Foreach.EmitCollectionForeach): Update
26068 * expression.cs (Argument.Emit): Call AddressOf with proper
26069 arguments to track usage.
26071 (New.DoEmit): Call AddressOf with new arguments.
26073 (Unary.Emit): Adjust AddressOf call.
26075 2002-03-01 Ravi Pratap <ravi@ximian.com>
26077 * cs-parser.jay (member_access): Change the case for pre-defined types
26078 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
26081 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
26084 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
26085 essentially like methods and apply attributes like MethodImplOptions to them too.
26087 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
26090 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
26091 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
26094 * Update code everywhere accordingly.
26096 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
26098 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
26100 2002-02-28 Ravi Pratap <ravi@ximian.com>
26102 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
26103 try performing lookups against those instead of jumping straight into using
26104 the 'using' clauses.
26106 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
26108 (LookupType): Perform lookups in implicit parents too.
26110 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
26111 sequence as RootContext.LookupType.
26113 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
26114 the various cases of namespace lookups into this method.
26116 2002-03-01 Miguel de Icaza <miguel@ximian.com>
26118 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
26119 in positional arguments)
26121 * class.cs (Operator): Update the AllowedModifiers to contain
26124 * cs-parser.jay: Update operator declaration to allow for the
26125 operator body to be empty.
26127 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
26130 2002-02-27 Miguel de Icaza <miguel@ximian.com>
26132 * class.cs (Method.Emit): Label parameters.
26134 * driver.cs: Return 1 or 0 as the program exit code.
26136 2002-02-26 Miguel de Icaza <miguel@ximian.com>
26138 * expression.cs: Special case the `null' object when trying to
26139 auto-compute the type, as anything can be explicitly converted to
26142 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
26143 spotting this Paolo.
26145 (Expression.ImplicitNumericConversion): Perform comparissions of
26146 the type using the underlying type in the case of an enumeration
26147 rather than using the enumeration type for the compare.
26149 Cope with the underlying == type case, which is not possible to
26152 (Expression.ConvertNumericExplicit): Perform comparissions of
26153 the type using the underlying type in the case of an enumeration
26154 rather than using the enumeration type for the compare.
26156 * driver.cs: If the user does not supply an extension, assume .exe
26158 * cs-parser.jay (if_statement): Rewrote so that we can track the
26159 location for the if statement.
26161 * expression.cs (Binary.ConstantFold): Only concat strings when
26162 the operation is "+", not everything ;-)
26164 * statement.cs (Statement.EmitBoolExpression): Take a location
26166 (If, While, Do): Track location.
26168 * expression.cs (Binary.ResolveOperator): In the object + string
26169 case, I was missing a call to ConvertImplicit
26171 2002-02-25 Ravi Pratap <ravi@ximian.com>
26173 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
26174 Location arguments. Ensure we use RootContext.LookupType to do our work
26175 and not try to do a direct Type.GetType and ModuleBuilder.GetType
26177 * interface.cs (PopulateMethod): Handle the type of the parameter being
26180 * expression.cs (Invocation.BetterFunction): Handle the case when we
26181 have a params method with no fixed arguments and a call is made with no
26184 2002-02-25 Miguel de Icaza <miguel@ximian.com>
26186 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
26187 the verbatim-string-literal
26189 * support.cs (InternalParameters.ParameterModifier): handle null
26191 (InternalParameters.ParameterType): ditto.
26193 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
26194 duplicating the name of the variable parameter.
26195 (GetParameterByName): Fix bug where we were not looking up array
26196 paramters if they were the only present (thanks Paolo!).
26197 (GetParameterInfo): We only have an empty set of types if both
26198 fixed and array are set to null.
26199 (GetParameterInfo-idx): Handle FixedParameter == null
26201 * cs-parser.jay: Handle the case where there is no catch
26202 statements (missing null test).
26204 2002-02-22 Miguel de Icaza <miguel@ximian.com>
26206 * driver.cs (MainDriver): Be conservative on our command line
26209 Catch DirectoryNotFoundException when calling GetFiles.
26211 (SplitPathAndPattern): Used to split the input specification into
26212 a path and a pattern that we can feed to Directory.GetFiles.
26214 2002-02-21 Miguel de Icaza <miguel@ximian.com>
26216 * statement.cs (Fixed): Implement the last case of the Fixed
26217 statement (string handling).
26219 * expression.cs (StringPtr): New class used to return a char * to
26220 a string; Used by the Fixed statement.
26222 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
26224 * expression.cs (Binary.ResolveOperator): Remove redundant
26225 MemberLookup pn parent type.
26226 Optimize union call, we do not need a union if the types are the same.
26227 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
26230 Specialize the use of MemberLookup everywhere, instead of using
26231 the default settings.
26233 (StackAlloc): Implement stackalloc keyword.
26235 * cs-parser.jay: Add rule to parse stackalloc.
26237 * driver.cs: Handle /h, /help, /?
26239 * expression.cs (MakeByteBlob): Removed the hacks we had in place
26240 before we supported unsafe code.
26242 * makefile: add --unsafe to the self compilation of mcs.
26244 2002-02-20 Miguel de Icaza <miguel@ximian.com>
26246 * expression.cs (PointerArithmetic): New class that is used to
26247 perform pointer arithmetic.
26248 (Binary.Resolve): Handle pointer arithmetic
26249 Handle pointer comparission.
26250 (ArrayPtr): Utility expression class that is used to take the
26251 address of an array.
26253 (ElementAccess): Implement array access for pointers
26255 * statement.cs (Fixed): Implement fixed statement for arrays, we
26256 are missing one more case before we are done.
26258 * expression.cs (Indirection): Implement EmitAssign and set the
26259 ExprClass to Variable. This allows pointer dereferences to be
26260 treated as variables, and to have values assigned to them.
26262 * ecore.cs (Expression.StoreFromPtr): New utility function to
26263 store values dereferencing.
26265 2002-02-20 Ravi Pratap <ravi@ximian.com>
26267 * expression.cs (Binary.ResolveOperator): Ensure that we are
26268 not trying to operate on a void type - this fixes the reported
26271 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
26272 the parent implementation is sealed.
26274 * ../errors/cs0239.cs : Add.
26276 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
26278 * typemanager.cs (unverifiable_code_type): Corresponds to
26279 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
26280 which have unsafe code in them.
26282 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
26285 2002-02-19 Miguel de Icaza <miguel@ximian.com>
26287 * cs-tokenizer.cs: Add support for @"litreal strings"
26289 Make tokenizer accept pre-processor directives
26290 on any column (remove the old C-like limitation).
26292 * rootcontext.cs (EmitCode): Emit any global attributes.
26293 (AddGlobalAttributes): Used to keep track of assembly attributes.
26295 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
26297 * cs-parser.jay: Add support for global attributes.
26299 2002-02-17 Miguel de Icaza <miguel@ximian.com>
26301 * expression.cs (Indirection): New helper class. Unary will
26302 create Indirection classes to be able to implement the
26303 IMemoryLocation interface on it.
26305 2002-02-16 Miguel de Icaza <miguel@ximian.com>
26307 * cs-parser.jay (fixed_statement): reference the right statement.
26309 * statement.cs (Fixed.Emit): Finish implementing the fixed
26310 statement for the &x case.
26312 2002-02-14 Miguel de Icaza <miguel@ximian.com>
26314 * class.cs (Property.Define, Method.Define): Remove newslot when
26317 * modifiers.cs: My use of NewSlot when `Abstract' was set was
26318 wrong. NewSlot should only be used if the `new' keyword is present.
26320 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
26321 locating our system dir. Sorry about this.
26323 2002-02-13 Miguel de Icaza <miguel@ximian.com>
26325 * driver.cs (GetSystemDir): Compute correctly the location of our
26326 system assemblies. I was using the compiler directory instead of
26327 the library directory.
26329 2002-02-13 Ravi Pratap <ravi@ximian.com>
26331 * expression.cs (BetterFunction): Put back in what Miguel commented out
26332 since it is the correct fix. The problem is elsewhere ;-)
26334 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
26335 parameters of the parms method are themselves compatible or not !
26337 (StandardConversionExists): Fix very dangerous bug where we were forgetting
26338 to check that a class implements an interface before saying that an implicit
26339 conversion was allowed. Use ImplementsInterface to do the checking.
26341 2002-02-13 Miguel de Icaza <miguel@ximian.com>
26343 * class.cs (Method.Define): Track whether we are an explicit
26344 implementation or not. And only call DefineMethodOverride if we
26345 are an explicit implementation.
26347 (Property.DefineMethod): Ditto.
26349 2002-02-11 Ravi Pratap <ravi@ximian.com>
26351 * expression.cs (BetterFunction): Catch hideous bug which was
26352 preventing us from detecting ambiguous calls due to implicit casts i.e
26355 2002-01-29 Miguel de Icaza <miguel@ximian.com>
26357 * support.cs (Pair): Remove un-needed method. I figured why I was
26358 getting the error in cs-parser.jay, the variable in a foreach loop
26359 is readonly, and the compiler does not really treat this as a variable.
26361 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
26362 instead of EQUALS in grammar.
26364 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
26366 * expression.cs (Unary.DoResolve): Check whether the argument is
26369 2002-01-28 Miguel de Icaza <miguel@ximian.com>
26371 * support.cs: Api for Pair to set a value. Despite the fact that
26372 the variables are public the MS C# compiler refuses to compile
26373 code that accesses the field if the variable is part of a foreach
26376 * statement.cs (Fixed): Begin implementation of the fixed
26379 (Block.AddVariable): Return the VariableInfo on success and null
26380 on failure instead of true/false.
26382 * cs-parser.jay (foreach): Catch errors on variables already
26383 defined (we were ignoring this value before) and properly unwind
26384 the block hierarchy
26386 (fixed_statement): grammar for the fixed statement.
26388 2002-01-25 Miguel de Icaza <miguel@ximian.com>
26390 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
26391 pointer types to be incretemented.
26393 (SizeOf): Implement.
26395 * cs-parser.jay (pointer_member_access): Implement
26396 expr->IDENTIFIER production.
26398 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
26399 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
26402 (Unary): Implement indirection.
26404 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
26405 use in non-unsafe context).
26407 (SimpleName.DoResolve): Check for pointers in field access on safe
26410 (Expression.LoadFromPtr): Factor the load-indirect code in this
26411 function. This was duplicated in UnboxCast and ParameterReference
26413 2002-01-24 Miguel de Icaza <miguel@ximian.com>
26415 * expression.cs (ComposedCast): report an error if a pointer cast
26416 is used in a safe region.
26418 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
26419 pointer type casts in unsafe context.
26421 * codegen.cs (EmitContext): Set up IsUnsafe.
26423 * cs-parser.jay (non_expression_type): Add productions for pointer
26426 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
26427 code. We should not use force into static mode if the method is
26428 not virtual. Fixes bug in MIS
26430 * statement.cs (Do.Emit, While.Emit, For.Emit,
26431 Statement.EmitBoolExpression): Add support to Do and While to
26432 propagate infinite loop as `I do return' semantics.
26434 Improve the For case to also test for boolean constants.
26436 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
26437 to the list of attributes we can add.
26439 Remove `EmitContext' argument.
26441 * class.cs (Method.Define): Apply parameter attributes.
26442 (Constructor.Define): Apply parameter attributes.
26443 (MethodCore.LabelParameters): Move here the core of labeling
26446 * support.cs (ReflectionParameters.ParameterModifier,
26447 InternalParameters.ParameterModifier): Use IsByRef on the type and
26448 only return the OUT bit for these parameters instead of in/out/ref
26451 This is because I miss-understood things. The ParameterInfo.IsIn
26452 and IsOut represent whether the parameter has the [In] and [Out]
26455 2002-01-22 Miguel de Icaza <miguel@ximian.com>
26457 * ecore.cs (FieldExpr.Emit): Release temporaries.
26459 * assign.cs (LocalTemporary.Release): new function.
26461 * codegen.cs (EmitContext.GetTemporaryStorage,
26462 EmitContext.FreeTemporaryStorage): Rework the way we deal with
26463 temporary storage. Now we can "put back" localbuilders when we
26466 2002-01-21 Miguel de Icaza <miguel@ximian.com>
26468 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
26469 need to make a copy of the variable to generate verifiable code.
26471 2002-01-19 Miguel de Icaza <miguel@ximian.com>
26473 * driver.cs: Compute dynamically the system directory.
26475 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
26476 Slower, but more generally useful. Used by the abstract
26477 registering implementation.
26479 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
26480 the rules for the special rule on Type/instances. First check if
26481 we have the same name, and if so, try that special static path
26482 rather than the instance path.
26484 2002-01-18 Miguel de Icaza <miguel@ximian.com>
26486 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
26489 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
26490 Enum, ValueType, Delegate or Array for non-corlib compiles.
26492 * cs-tokenizer.cs: Catch long identifiers (645)
26494 * typemanager.cs (IndexerPropetyName): Ravi never tested this
26497 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
26498 fix, we were returning too early, so we were not registering
26499 pending methods from abstract classes.
26501 Do not register pending methods if the class is abstract.
26503 * expression.cs (Conditional.DoResolve): Report circular implicit
26504 conversions when we neecd to compute it for conditional
26507 (Is.DoResolve): If the expression is always of the provided type,
26508 flag warning 183. If the expression can not ever be of the
26509 provided type flag warning 184.
26511 * class.cs: Catch 169 as well.
26513 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
26516 2002-01-18 Nick Drochak <ndrochak@gol.com>
26518 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
26520 2002-01-17 Miguel de Icaza <miguel@ximian.com>
26522 * interface.cs: (PopulateMethod): Check for pointers being defined
26523 only if the unsafe context is active.
26524 (PopulateProperty): ditto.
26525 (PopulateIndexer): ditto.
26527 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
26528 specified. If pointers are present, make sure that they are
26529 present in an unsafe context.
26530 (Constructor, Constructor.Define): ditto.
26531 (Field, Field.Define): ditto.
26532 (Property, Property.Define): ditto.
26533 (Event, Event.Define): ditto.
26535 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
26536 hashtable if there are classes or structs defined.
26538 * expression.cs (LocalVariableReference.DoResolve): Simplify this
26539 code, as the constant resolution moved.
26541 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
26542 the metadata, so we can flag error 133.
26544 * decl.cs (MemberCore.UnsafeOK): New function to test that a
26545 pointer is being declared in an unsafe context.
26547 2002-01-16 Miguel de Icaza <miguel@ximian.com>
26549 * modifiers.cs (Modifiers.Check): Require a Location argument.
26550 Report error 227 for Unsafe use.
26552 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
26554 * statement.cs (For.Emit): If the test is null, then report that
26555 we do `return', as we wont reach anything afterwards.
26557 (Switch.SwitchGoverningType): Track the expression that matched
26560 * driver.cs: Allow negative numbers as an error code to flag.
26562 * cs-parser.jay: Handle 1551.
26564 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
26566 2002-01-15 Miguel de Icaza <miguel@ximian.com>
26568 * cs-parser.jay: Report 1518 (type declaration can only contain
26569 class, struct, interface, enum or delegate)
26571 (switch_label): Report 1523 (keywords `case' or `default' must
26574 (opt_switch_sections): Report 1522 (empty switch)
26576 * driver.cs: Report 1515 (response file specified multiple times)
26577 Report 1516 (Source file specified multiple times).
26579 * expression.cs (Argument.Resolve): Signal 1510
26581 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
26582 access not allowed in static code)
26584 2002-01-11 Ravi Pratap <ravi@ximian.com>
26586 * typemanager.cs (IsPointerType): Utility method which we are going
26589 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
26590 the object type, so we take care of that.
26592 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
26594 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
26595 added to non-params parameters :-)
26597 * typemanager.cs (CSharpName): Include 'void' type too.
26599 (void_ptr_type): Include in the set of core types.
26601 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
26604 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
26607 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
26608 completely forgotten about it.
26610 2002-01-10 Ravi Pratap <ravi@ximian.com>
26612 * cs-parser.jay (pointer_type): Add. This begins our implementation
26613 of parsing rules for unsafe code.
26615 (unsafe_statement): Implement.
26617 (embedded_statement): Modify to include the above.
26619 * statement.cs (Unsafe): Implement new class for unsafe blocks.
26621 * codegen.cs (EmitContext.InUnsafe): Add. This determines
26622 if the current context is an unsafe one.
26624 * cs-parser.jay (local_variable_pointer_type): Since local variable types
26625 are handled differently, we need separate rules for them.
26627 (local_variable_declaration): Update to use local_variable_pointer_type
26628 to allow variable declarations of unmanaged pointer types.
26630 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
26631 in unsafe contexts.
26633 * ../errors/cs0214.cs : Add.
26635 2002-01-16 Nick Drochak <ndrochak@gol.com>
26637 * makefile: remove 'response' file when cleaning.
26639 2002-01-15 Miguel de Icaza <miguel@ximian.com>
26641 * cs-parser.jay: Report 1524.
26643 2002-01-14 Miguel de Icaza <miguel@ximian.com>
26645 * typemanager.cs (RegisterMethod): drop checking if we have
26646 registered this from here
26648 2002-01-12 Miguel de Icaza <miguel@ximian.com>
26650 * class.cs (Method.EmitDestructor): Implement calling our base
26653 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
26654 value of InFinally.
26656 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
26657 this routine and will wrap the call in a try/catch block. Deal
26660 2002-01-11 Miguel de Icaza <miguel@ximian.com>
26662 * ecore.cs (Expression.MemberLookup): instead of taking a
26663 parameter `same_type' that was used to tell whether we could
26664 access private members we compute our containing type from the
26667 (FieldExpr): Added partial support for volatile fields. This does
26668 not work for volatile fields exposed from assemblies, as I can not
26669 figure out how to extract the modreq from it.
26671 Updated all the source files to use this.
26673 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
26674 because it is referenced by MemberLookup very often.
26676 2002-01-09 Ravi Pratap <ravi@ximian.com>
26678 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
26679 TypeBuilder.GetCustomAttributes to retrieve what we need.
26681 Get rid of redundant default_member_attr_type as this is the same as
26682 default_member_type which already exists.
26684 * interface.cs, attribute.cs : Update accordingly.
26686 2002-01-08 Miguel de Icaza <miguel@ximian.com>
26688 * typemanager.cs: Enable IndexerPropertyName again. It does not
26689 work for TYpeBuilders though. Ravi, can you please fix this?
26691 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
26693 * expression.cs (Argument.Emit): Handle the case of ref objects
26694 being passed to ref functions;
26696 (ParameterReference.EmitLoad): Loads the content of the pointer
26697 without dereferencing.
26699 2002-01-07 Miguel de Icaza <miguel@ximian.com>
26701 * cs-tokenizer.cs: Implemented the pre-processing expressions.
26703 2002-01-08 Ravi Pratap <ravi@ximian.com>
26705 * class.cs (Indexer.DefineMethod): Incorporate the interface
26706 type in the name of the method if we are doing explicit interface
26709 * expression.cs (ConversionExists): Remove as it is completely obsolete.
26711 (BetterConversion): Fix extremely trivial bug where we were referring to
26712 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
26715 * ../errors/bug16.cs : Add although we have fixed it.
26717 2002-01-07 Miguel de Icaza <miguel@ximian.com>
26719 * expression.cs (BaseIndexer): Begin implementation.
26721 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
26723 * cs-parser.jay (indexer_declarator): Use qualified_identifier
26724 production directly to remove a shift/reduce, and implement
26725 explicit interface implementation.
26727 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
26728 after a floating point suffix.
26730 * expression.cs (DoNumericPromotions): Improved the conversion for
26731 uint/uint. If we have a constant, we avoid doing a typecast to a
26734 * class.cs (Indexer): Implement explicit interface implementation
26737 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
26739 * class.cs: make the default instance constructor public and hidebysig.
26741 2001-01-03 Ravi Pratap <ravi@ximian.com>
26743 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
26744 so we can call it from elsewhere.
26746 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
26747 we emit it internally if the class has a defined indexer; otherwise the user
26748 emits it by decorating the class definition with the DefaultMemberAttribute.
26750 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
26751 attribute is not used on a type which defines an indexer.
26753 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
26754 character when we skip whitespace.
26756 * ../errors/cs0646.cs : Add.
26758 2002-01-03 Miguel de Icaza <miguel@ximian.com>
26760 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
26763 * makefile: Add practical target `mcs3.exe' which builds the third
26764 generation compiler.
26766 * expression.cs (New): Fix structures constructor calling.
26768 * class.cs (Property, Method, Indexer): Emit Final flag on the
26769 method if we are an interface implementation and we are not
26772 * ecore.cs (PropertyExpr): New public field `IsBase', tells
26773 whether this property is referencing a `base' method.
26775 * expression.cs (Invocation.EmitCall): take an extra argument:
26776 is_base, this is used to determine whether the `call' or
26777 `callvirt' opcode should be used.
26780 * delegate.cs: update EmitCall.
26782 * class.cs (Method.Define): Set NewSlot for the cases where we are
26783 not implementing an interface method.
26785 (Property.Define): ditto.
26787 2002-01-02 Miguel de Icaza <miguel@ximian.com>
26789 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
26790 'r'. Allows mcs to parse itself fully.
26792 2002-01-02 Ravi Pratap <ravi@ximian.com>
26794 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
26795 of the number of initializers that require the InitializeArray method.
26797 (CheckIndices): Store the Expression in all cases - not the plain value. Also
26798 update the above field where necessary.
26800 (MakeByteBlob): Update accordingly.
26802 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
26805 (EmitDynamicInitializers): Update in accordance with the new optimization.
26807 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
26808 same OpCode applies.
26810 * cs-parser.jay : Fix some glaring errors I introduced.
26812 2002-01-01 Ravi Pratap <ravi@ximian.com>
26814 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
26815 so that we can check for name clashes there too.
26817 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
26818 for interface indexers.
26820 * interfaces.cs (Define): Emit the default member attribute.
26822 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
26823 variable was being referred to while setting the value ;-)
26825 2002-01-01 Miguel de Icaza <miguel@ximian.com>
26827 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
26828 byte-by-byte information when we know the data is zero.
26830 Make the block always a multiple of 4, because
26831 DefineInitializedData has a bug.
26833 * assign.cs: Fix, we should assign from the temporary, not from
26836 * expression.cs (MakeByteBlob): Fix my incorrect code.
26838 2001-12-31 Miguel de Icaza <miguel@ximian.com>
26840 * typemanager.cs (EnumToUnderlying): This function is used to get
26841 the underlying type from an enumeration, because it does not
26844 * constant.cs: Use the I4_S form for values between -128 and 127.
26846 * statement.cs (Block.LookupLabel): Looks up a label.
26847 (Block): Drop support for labeled blocks.
26849 (LabeledStatement): New kind of statement that represents a label
26852 (Goto): Finally implement this bad boy.
26854 * cs-parser.jay: Update to reflect new mechanism to implement
26857 2001-12-30 Miguel de Icaza <miguel@ximian.com>
26859 * codegen.cs (EmitContext.This): a codegen property that keeps the
26860 a single instance of this instead of creating many different this
26863 * delegate.cs (Delegate.DoResolve): Update to use the property;
26865 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
26867 * expression.cs (BaseAccess.DoResolve): Ditto.
26869 2001-12-29 Ravi Pratap <ravi@ximian.com>
26871 * typemanager.cs (methodimpl_attr_type): Add to hold the type
26872 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
26874 (InitCoreTypes): Update accordingly.
26876 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
26877 so we can quickly store the state.
26879 (ApplyAttributes): Set the correct implementation flags
26880 for InternalCall methods.
26882 2001-12-29 Miguel de Icaza <miguel@ximian.com>
26884 * expression.cs (EmitCall): if a method is not virtual, then do
26885 not use callvirt on it.
26887 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
26888 user defined stuff) requires the use of stobj, which takes an
26889 address on the stack instead of an array and an index. So emit
26890 the Ldelema operation for it.
26892 (EmitStoreOpcode): Use stobj for valuetypes.
26894 (UnaryMutator.EmitCode): Use the right 1 value depending on
26895 whether we are dealing with int64/uint64, float or doubles.
26897 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
26898 constructors that I implemented last night.
26900 (Constructor.IsDefault): Fix to work properly for static
26903 * cs-parser.jay (CheckDef): report method signature errors.
26904 Update error number 103 to be 132.
26906 * decl.cs: New AdditionResult enumeration value: MethodExists.
26907 Although we do this check for methods later on in the semantic
26908 analysis, catching repeated default constructors is so easy that
26909 we catch these here.
26911 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
26914 (ParameterReference.EmitAssign, Emit): handle
26917 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
26918 (ArrayAccess.EmitStoreOpcode): ditto.
26920 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
26922 * expression.cs (MakeByteBlob): Complete all the missing types
26923 (uint, short, ushort, byte, sbyte)
26925 * class.cs: Only init instance field initializers on instance
26928 Rename `constructors' to instance_constructors.
26930 (TypeContainer.AddConstructor): Only add constructors to the list
26931 if it is not static.
26933 Make sure that we handle default_static_constructor independently
26934 everywhere where we handle instance_constructors
26936 2001-12-28 Miguel de Icaza <miguel@ximian.com>
26938 * class.cs: Do not lookup or create a base initializer for a
26939 static constructor.
26941 (ConstructorInitializer.Resolve): use the proper type to lookup
26944 * cs-parser.jay: Report error 1585 (modifiers between type and name).
26946 * enum.cs, interface.cs: Remove CloseType, this is taken care by
26949 * decl.cs: CloseType is now an virtual method, the default
26950 implementation just closes this type.
26952 2001-12-28 Ravi Pratap <ravi@ximian.com>
26954 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
26955 to PreserveSig by default. Also emit HideBySig on such methods.
26957 Basically, set the defaults to standard values.
26959 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
26960 argument, if candidate is better, it can't be worse than the best !
26962 (Invocation): Re-write bits to differentiate between methods being
26963 applicable in their expanded form and their normal form - for params
26966 Get rid of use_standard everywhere as only standard conversions are allowed
26967 in overload resolution.
26969 More spec conformance.
26971 2001-12-27 Miguel de Icaza <miguel@ximian.com>
26973 * driver.cs: Add --timestamp, to see where the compiler spends
26976 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
26977 `this' in static code.
26979 (SimpleName.DoResolve): Implement in terms of a helper function
26980 that allows static-references to be passed upstream to
26983 (Expression.ResolveWithSimpleName): Resolve specially simple
26984 names when called by MemberAccess to implement the special
26987 (Expression.ImplicitReferenceConversion): Handle conversions from
26988 Null to reference types before others, as Null's type is
26991 * expression.cs (Invocation.EmitCall): Handle the special case of
26992 calling methods declared on a reference type from a ValueType
26993 (Base classes System.Object and System.Enum)
26995 (MemberAccess.Resolve): Only perform lookups on Enumerations if
26996 the left hand side is a TypeExpr, not on every enumeration.
26998 (Binary.Resolve): If types are reference types, then do a cast to
26999 object on operators != and == of both arguments.
27001 * typemanager.cs (FindMembers): Extract instance and static
27002 members if requested.
27004 * interface.cs (PopulateProperty): Use void_type instead of null
27005 as the return type for the setter method.
27007 (PopulateIndexer): ditto.
27009 2001-12-27 Ravi Pratap <ravi@ximian.com>
27011 * support.cs (ReflectionParameters): Fix minor bug where we
27012 were examining the wrong parameter for the ParamArray attribute.
27014 Cope with requests for the type of the parameter at position
27015 greater than the params parameter's. We now return the element
27016 type of the params array as that makes more sense.
27018 * expression.cs (Invocation.IsParamsMethodApplicable): Update
27019 accordingly as we no longer have to extract the element type
27022 (Invocation.OverloadResolve): Update.
27024 2001-12-27 Miguel de Icaza <miguel@ximian.com>
27026 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
27027 against IEnumerator, test whether the return value is a descendant
27028 of the IEnumerator interface.
27030 * class.cs (Indexer.Define): Use an auxiliary method to implement
27031 the other bits of the method definition. Begin support for
27032 explicit interface implementation.
27034 (Property.DefineMethod): Use TypeManager.void_type instead of null
27035 for an empty return value.
27037 2001-12-26 Miguel de Icaza <miguel@ximian.com>
27039 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
27040 dealing with a FieldExpr which is composed of a FieldBuilder, in
27041 the code path we did extract the constant, but we should have
27042 obtained the underlying value to be able to cast it (otherwise we
27043 end up in an infinite loop, this is what Ravi was running into).
27045 (ArrayCreation.UpdateIndices): Arrays might be empty.
27047 (MemberAccess.ResolveMemberAccess): Add support for section
27048 14.5.4.1 that deals with the special case of E.I when E is a type
27049 and something else, that I can be a reference to a static member.
27051 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
27052 handle a particular array type to create byte blobs, it is just
27053 something we dont generate byteblobs for.
27055 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
27058 * location.cs (Push): remove the key from the hashtable that we
27059 are about to add. This happens for empty files.
27061 * driver.cs: Dispose files after we have parsed them.
27063 (tokenize): new function that only runs the tokenizer on its
27064 input, for speed testing.
27066 2001-12-26 Ravi Pratap <ravi@ximian.com>
27068 * class.cs (Event.Define): Define the private field only if there
27069 are no accessors defined.
27071 * expression.cs (ResolveMemberAccess): If there is no associated
27072 field with the event, that means we have an event defined with its
27073 own accessors and we should flag error cs0070 since transforming
27074 ourselves into a field is not valid in that case.
27076 * ecore.cs (SimpleName.DoResolve): Same as above.
27078 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
27079 and charset to sane values.
27081 2001-12-25 Ravi Pratap <ravi@ximian.com>
27083 * assign.cs (DoResolve): Perform check on events only if they
27084 are being accessed outside the declaring type.
27086 * cs-parser.jay (event_declarations): Update rules to correctly
27087 set the type of the implicit parameter etc.
27089 (add_accessor, remove_accessor): Set current local parameters.
27091 * expression.cs (Binary): For delegate addition and subtraction,
27092 cast the return value from the method into the appropriate delegate
27095 2001-12-24 Ravi Pratap <ravi@ximian.com>
27097 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
27098 of these as the workaround is unnecessary.
27100 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
27101 delegate data - none of that is needed at all.
27103 Re-write bits to extract the instance expression and the delegate method
27106 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
27109 * attribute.cs (ApplyAttributes): New method to take care of common tasks
27110 of attaching attributes instead of duplicating code everywhere.
27112 * everywhere : Update code to do attribute emission using the above method.
27114 2001-12-23 Miguel de Icaza <miguel@ximian.com>
27116 * expression.cs (IsParamsMethodApplicable): if there are not
27117 parameters, return immediately.
27119 * ecore.cs: The 0 literal can be implicity converted to an enum
27122 (SimpleName.DoResolve): First lookup the type, then lookup the
27125 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
27126 want to get its address. If the InstanceExpression is not
27127 addressable, store the result in a temporary variable, then get
27130 * codegen.cs: Only display 219 errors on warning level or above.
27132 * expression.cs (ArrayAccess): Make it implement the
27133 IMemoryLocation interface.
27135 (Binary.DoResolve): handle the operator == (object a, object b)
27136 and operator != (object a, object b) without incurring into a
27137 BoxedCast (because 5 != o should never be performed).
27139 Handle binary enumerator operators.
27141 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
27142 value type, otherwise use Ldelem_ref.
27144 Use precomputed names;
27146 (AddressOf): Implement address of
27148 * cs-parser.jay (labeled_statement): Fix recursive block
27149 addition by reworking the production.
27151 * expression.cs (New.DoEmit): New has a special case:
27153 If we are dealing with a ValueType, we have a few
27154 situations to deal with:
27156 * The target of New is a ValueType variable, that is
27157 easy, we just pass this as the variable reference
27159 * The target of New is being passed as an argument,
27160 to a boxing operation or a function that takes a
27163 In this case, we need to create a temporary variable
27164 that is the argument of New.
27167 2001-12-23 Ravi Pratap <ravi@ximian.com>
27169 * rootcontext.cs (LookupType): Check that current_type is not null before
27170 going about looking at nested types.
27172 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
27173 not implement the IAssignMethod interface any more.
27175 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
27176 where we tranform them into FieldExprs if they are being resolved from within
27177 the declaring type.
27179 * ecore.cs (SimpleName.DoResolve): Do the same here.
27181 * assign.cs (DoResolve, Emit): Clean up code considerably.
27183 * ../errors/bug10.cs : Add.
27185 * ../errors/cs0070.cs : Add.
27187 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
27189 * assign.cs : Get rid of EventIsLocal everywhere.
27191 2001-12-23 Miguel de Icaza <miguel@ximian.com>
27193 * ecore.cs (ConvertIntLiteral): finished the implementation.
27195 * statement.cs (SwitchLabel): Convert the value we are using as a
27196 key before looking up the table.
27198 2001-12-22 Miguel de Icaza <miguel@ximian.com>
27200 * codegen.cs (EmitTopBlock): Require a Location argument now.
27202 * cs-parser.jay (constructor_declarator): We need to setup
27203 current_local_parameters before we parse the
27204 opt_constructor_initializer, to allow the variables to be bound
27205 to the constructor arguments.
27207 * rootcontext.cs (LookupType): First lookup nested classes in our
27208 class and our parents before we go looking outside our class.
27210 * expression.cs (ConstantFold): Extract/debox the values at the
27213 * rootcontext.cs (EmitCode): Resolve the constants first before we
27214 resolve the types. This is not really needed, but it helps debugging.
27216 * statement.cs: report location.
27218 * cs-parser.jay: pass location to throw statement.
27220 * driver.cs: Small bug fix.
27222 * report.cs: Updated format to be 4-zero filled digits.
27224 2001-12-22 Ravi Pratap <ravi@ximian.com>
27226 * expression.cs (CheckIndices): Fix minor bug where the wrong
27227 variable was being referred to ;-)
27229 (DoEmit): Do not call EmitStaticInitializers when the
27230 underlying type is System.Object.
27232 2001-12-21 Ravi Pratap <ravi@ximian.com>
27234 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
27235 and do the usual workaround for SRE.
27237 * class.cs (MyEventBuilder.EventType): New member to get at the type
27238 of the event, quickly.
27240 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
27242 * assign.cs (Assign.DoResolve): Handle the case when the target
27243 is an EventExpr and perform the necessary checks.
27245 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
27248 (SimpleName.MemberStaticCheck): Include check for EventExpr.
27250 (EventExpr): Set the type in the constructor itself since we
27251 are meant to be born fully resolved.
27253 (EventExpr.Define): Revert code I wrote earlier.
27255 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
27256 instance expression is null. The instance expression is a This in that case
27257 or a null, depending on whether it is a static method or not.
27259 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
27260 refers to more than one method.
27262 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
27263 and accordingly flag errors.
27265 2001-12-21 Miguel de Icaza <miguel@ximian.com>
27267 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
27269 2001-12-22 Miguel de Icaza <miguel@ximian.com>
27271 * location.cs (ToString): Provide useful rutine.
27273 2001-12-21 Miguel de Icaza <miguel@ximian.com>
27275 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
27276 objects, return the actual integral boxed.
27278 * statement.cs (SwitchLabel): define an ILLabel for each
27281 (Switch.CheckSwitch): If the value is a Literal, extract
27282 the underlying literal.
27284 Also in the unused hashtable we had, add the SwitchLabel so we can
27285 quickly look this value up.
27287 * constant.cs: Implement a bunch of new constants. Rewrite
27288 Literal based on this. Made changes everywhere to adapt to this.
27290 * expression.cs (Expression.MakeByteBlob): Optimize routine by
27291 dereferencing array only once, and also copes with enumrations.
27293 bytes are two bytes wide, not one.
27295 (Cast): Perform constant conversions.
27297 * ecore.cs (TryImplicitIntConversion): Return literals instead of
27298 wrappers to the literals here.
27300 * expression.cs (DoNumericPromotions): long literals can converted
27301 to ulong implicity (this is taken care of elsewhere, but I was
27302 missing this spot).
27304 * ecore.cs (Expression.Literalize): Make the return type Literal,
27305 to improve type checking.
27307 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
27309 2001-12-20 Miguel de Icaza <miguel@ximian.com>
27311 * literal.cs: Revert code from ravi that checked the bounds. The
27312 bounds are sane by the definition of the type itself.
27314 * typemanager.cs: Fix implementation of ImplementsInterface. We
27315 need to actually look up in our parent hierarchy for interfaces
27318 * const.cs: Use the underlying type for enumerations
27320 * delegate.cs: Compute the basename for the delegate creation,
27321 that should fix the delegate test case, and restore the correct
27322 Type Lookup semantics in rootcontext
27324 * rootcontext.cs: Revert Ravi's last patch. The correct way of
27325 referencing a nested type with the Reflection API is using the "+"
27328 * cs-parser.jay: Do not require EOF token at the end.
27330 2001-12-20 Ravi Pratap <ravi@ximian.com>
27332 * rootcontext.cs (LookupType): Concatenate type names with
27333 a '.' instead of a '+' The test suite passes again.
27335 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
27336 field of the enumeration.
27338 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
27339 the case when the member is an EventExpr.
27341 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
27342 static has an associated instance expression.
27344 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
27346 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
27348 * class.cs (Event.Define): Register event and perform appropriate checks
27351 We define the Add and Remove methods even if the use provides none because
27352 in that case, we provide default implementations ourselves.
27354 Define a private field of the type of the event. This is done by the CSC compiler
27355 and we should be doing it too ;-)
27357 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
27358 More methods we use in code we generate.
27360 (multicast_delegate_type, delegate_type): Two separate types since the distinction
27363 (InitCoreTypes): Update accordingly for the above.
27365 * class.cs (Event.Emit): Generate code for default accessors that we provide
27367 (EmitDefaultMethod): Do the job in the above.
27369 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
27372 2001-12-20 Miguel de Icaza <miguel@ximian.com>
27374 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
27375 builders even if we were missing one.
27377 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
27378 pass the Basename as our class name instead of the Name. The
27379 basename will be correctly composed for us.
27381 * parameter.cs (Paramters): Now takes a Location argument.
27383 * decl.cs (DeclSpace.LookupType): Removed convenience function and
27384 make all the code call directly LookupType in RootContext and take
27385 this chance to pass the Location information everywhere.
27387 * Everywhere: pass Location information.
27389 2001-12-19 Miguel de Icaza <miguel@ximian.com>
27391 * class.cs (Constructor.Define): Updated way of detecting the
27392 length of the parameters.
27394 (TypeContainer.DefineType): Use basename as the type name for
27397 (TypeContainer.Define): Do not recursively define types here, as
27398 definition is taken care in order by the RootContext.
27400 * tree.cs: Keep track of namespaces in a per-file basis.
27402 * parameter.cs (Parameter.ComputeSignature): Update to use
27405 (Parameters.GetSignature): ditto.
27407 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
27408 instead of a TypeContainer.
27410 (Interface.SemanticAnalysis): Use `this' instead of our parent to
27411 resolve names. Because we need to be resolve in our context, not
27414 * driver.cs: Implement response files.
27416 * class.cs (TypeContainer.DefineType): If we are defined, do not
27417 redefine ourselves.
27419 (Event.Emit): Emit the code for add/remove handlers.
27420 (Event.Define): Save the MethodBuilders for add/remove.
27422 * typemanager.cs: Use pair here too.
27424 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
27425 DictionaryEntry requires the first argument to be non-null.
27427 (enum_declaration): Compute full name for registering the
27430 (delegate_declaration): Instead of using
27431 formal_parameter_list, use opt_formal_parameter_list as the list
27434 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
27435 (EventParsing): New property that controls whether `add' and
27436 `remove' are returned as tokens or identifiers (for events);
27438 2001-12-19 Ravi Pratap <ravi@ximian.com>
27440 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
27441 use MyEventBuilder only and let it wrap the real builder for us.
27443 (MyEventBuilder): Revamp constructor etc.
27445 Implement all operations that we perform on EventBuilder in precisely the same
27448 (FindMembers): Update to use the EventBuilder member.
27450 (Event.Emit): Update accordingly.
27452 2001-12-18 Ravi Pratap <ravi@ximian.com>
27454 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
27455 by calling the appropriate methods.
27457 (GetCustomAttributes): Make stubs as they cannot possibly do anything
27460 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
27462 2001-12-17 Ravi Pratap <ravi@ximian.com>
27464 * delegate.cs (Delegate.Populate): Check that the return type
27465 and various parameters types are indeed accessible.
27467 * class.cs (Constructor.Define): Same here.
27469 (Field.Define): Ditto.
27471 (Event.Define): Ditto.
27473 (Operator.Define): Check that the underlying Method defined itself
27474 correctly - so it's MethodBuilder should not be null.
27476 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
27477 expression happens to be null.
27479 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
27480 members but as of now we don't seem to be able to do anything really useful with it.
27482 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
27483 not the EventBuilder.
27485 2001-12-18 Miguel de Icaza <miguel@ximian.com>
27487 * cs-tokenizer.cs: Add support for defines.
27488 Add support for #if, #elif, #else, #endif
27490 (eval_var): evaluates a variable.
27491 (eval): stubbed for evaluating functions.
27493 * cs-parser.jay: Pass the defines information
27495 * driver.cs: Add --define command line option.
27497 * decl.cs: Move MemberCore here.
27499 Make it the base class for DeclSpace. This allows us to catch and
27500 report 108 and 109 for everything now.
27502 * class.cs (TypeContainer.Define): Extract all the members
27503 before populating and emit the warning 108 (new keyword required
27504 to override) instead of having each member implement this.
27506 (MemberCore.Define): New abstract method, we will be using this in
27507 the warning reporting engine in Populate.
27509 (Operator.Define): Adjust to new MemberCore protocol.
27511 * const.cs (Const): This does not derive from Expression, it is a
27512 temporary object we use to create fields, it is a MemberCore.
27514 * class.cs (Method.Define): Allow the entry point to be in a
27517 * driver.cs: Rewrite the argument handler to clean it up a bit.
27519 * rootcontext.cs: Made it just an auxiliary namespace feature by
27520 making everything static.
27522 * driver.cs: Adapt code to use RootContext type name instead of
27525 * delegate.cs: Remove RootContext argument.
27527 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
27530 * class.cs (Event.Define): The lookup can fail.
27532 * cs-tokenizer.cs: Begin implementation of pre-procesor.
27534 * expression.cs: Resolve the this instance before invoking the code.
27536 2001-12-17 Miguel de Icaza <miguel@ximian.com>
27538 * cs-parser.jay: Add a production in element_access that allows
27539 the thing to become a "type" reference. This way we can parse
27540 things like "(string [])" as a type.
27542 Note that this still does not handle the more complex rules of
27546 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
27548 * ecore.cs: (CopyNewMethods): new utility function used to
27549 assemble the list of methods from running FindMembers.
27551 (MemberLookup): Rework FindMembers so that
27553 2001-12-16 Miguel de Icaza <miguel@ximian.com>
27555 * class.cs (TypeContainer): Remove Delegates who fail to be
27558 * delegate.cs (Populate): Verify that we dont get null return
27559 values. TODO: Check for AsAccessible.
27561 * cs-parser.jay: Use basename to emit error 574 (destructor should
27562 have the same name as container class), not the full name.
27564 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
27565 possible representation.
27567 Also implements integer type suffixes U and L.
27569 2001-12-15 Miguel de Icaza <miguel@ximian.com>
27571 * expression.cs (ArrayCreation.DoResolve): We need to do the
27572 argument resolution *always*.
27574 * decl.cs: Make this hold the namespace. Hold the root context as
27576 (LookupType): Move here.
27578 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
27580 * location.cs (Row, Name): Fixed the code, it was always returning
27581 references to the first file.
27583 * interface.cs: Register properties defined through interfaces.
27585 * driver.cs: Add support for globbing on the command line
27587 * class.cs (Field): Make it derive from MemberCore as well.
27590 2001-12-15 Ravi Pratap <ravi@ximian.com>
27592 * class.cs (Event::Define): Check that the type of the event is a delegate
27593 type else flag error #66.
27595 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
27598 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
27599 values of EntryPoint, CharSet etc etc.
27601 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
27603 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
27604 be null and we should ignore this. I am not sure if this is really clean. Apparently,
27605 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
27606 which needs this to do its work.
27608 * ../errors/cs0066.cs : Add.
27610 2001-12-14 Miguel de Icaza <miguel@ximian.com>
27612 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
27615 * class.cs: (MethodSignature.MethodSignature): Removed hack that
27616 clears out the parameters field.
27617 (MemberSignatureCompare): Cleanup
27619 (MemberCore): New base class used to share code between MethodCore
27622 (RegisterRequiredImplementations) BindingFlags.Public requires
27623 either BindingFlags.Instace or Static. Use instance here.
27625 (Property): Refactored code to cope better with the full spec.
27627 * parameter.cs (GetParameterInfo): Return an empty array instead
27630 * class.cs (Property): Abstract or extern properties have no bodies.
27632 * parameter.cs (GetParameterInfo): return a zero-sized array.
27634 * class.cs (TypeContainer.MethodModifiersValid): Move all the
27635 method modifier validation to the typecontainer so we can reuse
27636 this on properties.
27638 (MethodCore.ParameterTypes): return an empty sized array of types.
27640 (Property.Define): Test property modifier validity.
27642 Add tests for sealed/override too.
27644 (Method.Emit): abstract or extern methods have no bodies.
27646 2001-12-14 Ravi Pratap <ravi@ximian.com>
27648 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
27651 (Method::Define, ::Emit): Modify accordingly.
27653 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
27655 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
27657 * makefile: Pass in /unsafe.
27659 2001-12-13 Miguel de Icaza <miguel@ximian.com>
27661 * class.cs (MakeKey): Kill routine.
27663 * class.cs (TypeContainer.Define): Correctly define explicit
27664 method implementations (they require the full interface name plus
27667 * typemanager.cs: Deply the PtrHashtable here and stop using the
27668 lame keys. Things work so much better.
27670 This of course broke everyone who depended on `RegisterMethod' to
27671 do the `test for existance' test. This has to be done elsewhere.
27673 * support.cs (PtrHashtable): A hashtable that avoid comparing with
27674 the object stupid Equals method (because, that like fails all over
27675 the place). We still do not use it.
27677 * class.cs (TypeContainer.SetRequiredInterface,
27678 TypeContainer.RequireMethods): Killed these two routines and moved
27679 all the functionality to RegisterRequiredImplementations.
27681 (TypeContainer.RegisterRequiredImplementations): This routine now
27682 registers all the implementations required in an array for the
27683 interfaces and abstract methods. We use an array of structures
27684 which can be computed ahead of time to reduce memory usage and we
27685 also assume that lookups are cheap as most classes will not
27686 implement too many interfaces.
27688 We also avoid creating too many MethodSignatures.
27690 (TypeContainer.IsInterfaceMethod): Update and optionally does not
27691 clear the "pending" bit if we find that there are problems with
27694 (TypeContainer.VerifyPendingMethods): Update to report errors of
27695 methods that look like implementations but are not.
27697 (TypeContainer.Define): Add support for explicit interface method
27700 2001-12-12 Miguel de Icaza <miguel@ximian.com>
27702 * typemanager.cs: Keep track of the parameters here instead of
27703 being a feature of the TypeContainer.
27705 * class.cs: Drop the registration of parameters here, as
27706 InterfaceMethods are also interface declarations.
27708 * delegate.cs: Register methods with the TypeManager not only with
27709 the TypeContainer. This code was buggy.
27711 * interface.cs: Full registation here.
27713 2001-12-11 Miguel de Icaza <miguel@ximian.com>
27715 * expression.cs: Remove reducer for binary expressions, it can not
27718 * const.cs: Put here the code that used to go into constant.cs
27720 * constant.cs: Put here the code for constants, this is a new base
27721 class for Literals.
27723 * literal.cs: Make Literal derive from Constant.
27725 2001-12-09 Miguel de Icaza <miguel@ximian.com>
27727 * statement.cs (Return.Emit): Report error 157 if the user
27728 attempts to return from a finally block.
27730 (Return.Emit): Instead of emitting a return, jump to the end of
27733 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
27734 LocalBuilder to store the result of the function. ReturnLabel is
27735 the target where we jump.
27738 2001-12-09 Radek Doulik <rodo@ximian.com>
27740 * cs-parser.jay: remember alias in current namespace
27742 * ecore.cs (SimpleName::DoResolve): use aliases for types or
27745 * class.cs (LookupAlias): lookup alias in my_namespace
27747 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
27749 (LookupAlias): lookup alias in this and if needed in parent
27752 2001-12-08 Miguel de Icaza <miguel@ximian.com>
27756 * rootcontext.cs: (ModuleBuilder) Made static, first step into
27757 making things static. I need this to avoid passing the
27758 TypeContainer when calling ParameterType.
27760 * support.cs (InternalParameters.ParameterType): Remove ugly hack
27761 that did string manipulation to compute the type and then call
27762 GetType. Use Parameter.ParameterType instead.
27764 * cs-tokenizer.cs: Consume the suffix for floating values.
27766 * expression.cs (ParameterReference): figure out whether this is a
27767 reference parameter or not. Kill an extra variable by computing
27768 the arg_idx during emission.
27770 * parameter.cs (Parameters.GetParameterInfo): New overloaded
27771 function that returns whether a parameter is an out/ref value or not.
27773 (Parameter.ParameterType): The type of the parameter (base,
27774 without ref/out applied).
27776 (Parameter.Resolve): Perform resolution here.
27777 (Parameter.ExternalType): The full type (with ref/out applied).
27779 * statement.cs (Using.Emit, Using.EmitExpression): Implement
27780 support for expressions on the using statement.
27782 2001-12-07 Miguel de Icaza <miguel@ximian.com>
27784 * statement.cs (Using.EmitLocalVariableDecls): Split the
27785 localvariable handling of the using statement.
27787 (Block.EmitMeta): Keep track of variable count across blocks. We
27788 were reusing slots on separate branches of blocks.
27790 (Try.Emit): Emit the general code block, we were not emitting it.
27792 Check the type of the declaration to be an IDisposable or
27793 something that can be implicity converted to it.
27795 Emit conversions if required.
27797 * ecore.cs (EmptyExpression): New utility class.
27798 (Expression.ImplicitConversionExists): New utility function.
27800 2001-12-06 Miguel de Icaza <miguel@ximian.com>
27802 * statement.cs (Using): Implement.
27804 * expression.cs (LocalVariableReference): Support read only variables.
27806 * statement.cs: Remove the explicit emit for the Leave opcode.
27807 (VariableInfo): Add a readonly field.
27809 2001-12-05 Miguel de Icaza <miguel@ximian.com>
27811 * ecore.cs (ConvCast): new class used to encapsulate the various
27812 explicit integer conversions that works in both checked and
27813 unchecked contexts.
27815 (Expression.ConvertNumericExplicit): Use new ConvCast class to
27816 properly generate the overflow opcodes.
27818 2001-12-04 Miguel de Icaza <miguel@ximian.com>
27820 * statement.cs: The correct type for the EmptyExpression is the
27821 element_type, not the variable type. Ravi pointed this out.
27823 2001-12-04 Ravi Pratap <ravi@ximian.com>
27825 * class.cs (Method::Define): Handle PInvoke methods specially
27826 by using DefinePInvokeMethod instead of the usual one.
27828 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
27829 above to do the task of extracting information and defining the method.
27831 2001-12-04 Ravi Pratap <ravi@ximian.com>
27833 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
27834 of the condition for string type.
27836 (Emit): Move that here.
27838 (ArrayCreation::CheckIndices): Keep string literals in their expression
27841 (EmitDynamicInitializers): Handle strings appropriately.
27843 2001-12-04 Miguel de Icaza <miguel@ximian.com>
27845 * codegen.cs (EmitContext): Replace multiple variables with a
27846 single pointer to the current Switch statement.
27848 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
27851 2001-12-03 Miguel de Icaza <miguel@ximian.com>
27855 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
27858 (Foreach.Emit): Foreach on arrays was not setting
27859 up the loop variables (for break/continue).
27861 (GotoCase): Semi-implented.
27863 2001-12-03 Ravi Pratap <ravi@ximian.com>
27865 * attribute.cs (CheckAttribute): Handle system attributes by using
27866 Attribute.GetAttributes to examine information we need.
27868 (GetValidPlaces): Same here.
27870 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
27872 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
27874 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
27876 (Method::Define): Set appropriate flags if we have a DllImport attribute.
27878 (Method::Emit): Handle the case when we are a PInvoke method.
27880 2001-12-03 Miguel de Icaza <miguel@ximian.com>
27882 * expression.cs: Use ResolveWithSimpleName on compound names.
27884 2001-12-02 Ravi Pratap <ravi@ximian.com>
27886 * constant.cs (EmitConstant): Make sure we resolve the associated expression
27887 before trying to reduce it.
27889 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
27891 * constant.cs (LookupConstantValue): Implement.
27893 (EmitConstant): Use the above in emitting the constant.
27895 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
27896 that are user-defined by doing a LookupConstantValue on them.
27898 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
27901 2001-11-29 Miguel de Icaza <miguel@ximian.com>
27903 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
27905 (BaseAccess.DoResolve): Implement.
27907 (MemberAccess.DoResolve): Split this routine into a
27908 ResolveMemberAccess routine that can be used independently
27910 2001-11-28 Miguel de Icaza <miguel@ximian.com>
27912 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
27913 As that share bits of the implementation. Is returns a boolean,
27914 while As returns the Type that is being probed.
27916 2001-12-01 Ravi Pratap <ravi@ximian.com>
27918 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
27919 instead of a Literal - much easier.
27921 (EnumInTransit): Remove - utterly useless :-)
27923 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
27925 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
27927 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
27928 chain when we have no associated expression.
27930 2001-11-30 Ravi Pratap <ravi@ximian.com>
27932 * constant.cs (Define): Use Location while reporting the errror.
27934 Also emit a warning when 'new' is used and there is no inherited
27937 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
27940 (LookupEnumValue): Implement to lookup an enum member's value and define it
27943 (Populate): Re-write accordingly to use the above routine.
27945 2001-11-27 Miguel de Icaza <miguel@ximian.com>
27947 * expression.cs (This): Fix prototype for DoResolveLValue to
27948 override the base class DoResolveLValue.
27950 * cs-parser.cs: Report errors cs574 and cs575 (destructor
27953 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
27954 (we need to load the address of the field here). This fixes
27957 (FieldExpr.DoResolveLValue): Call the DoResolve
27958 function to initialize the Instance expression.
27960 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
27961 correctly the GetEnumerator operation on a value type.
27963 * cs-parser.jay: Add more simple parsing error catches.
27965 * statement.cs (Switch): Add support for string switches.
27966 Handle null specially.
27968 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
27970 2001-11-28 Ravi Pratap <ravi@ximian.com>
27972 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
27974 (declare_local_constant): New helper function.
27976 * statement.cs (AddConstant): Keep a separate record of constants
27978 (IsConstant): Implement to determine if a variable is a constant.
27980 (GetConstantExpression): Implement.
27982 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
27984 * statement.cs (IsVariableDefined): Re-write.
27986 2001-11-27 Ravi Pratap <ravi@ximian.com>
27988 * class.cs (TypeContainer::FindMembers): Look for constants
27989 in the case when we are looking for MemberTypes.Field
27991 * expression.cs (MemberAccess::DoResolve): Check that in the
27992 case we are a FieldExpr and a Literal, we are not being accessed
27993 by an instance reference.
27995 * cs-parser.jay (local_constant_declaration): Implement.
27997 (declaration_statement): Implement for constant declarations.
27999 2001-11-26 Miguel de Icaza <miguel@ximian.com>
28001 * statement.cs (Switch): Catch double defaults.
28003 (Switch): More work on the switch() statement
28004 implementation. It works for integral values now, need to finish
28008 2001-11-24 Miguel de Icaza <miguel@ximian.com>
28010 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
28011 integer literals into other integer literals. To be used by
28014 2001-11-24 Ravi Pratap <ravi@ximian.com>
28016 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
28019 (EmitDynamicInitializers): Cope with the above since we extract data
28020 directly from ArrayData now.
28022 (ExpectInitializers): Keep track of whether initializers are mandatory
28025 (Bounds): Make it a hashtable to prevent the same dimension being
28026 recorded for every element in that dimension.
28028 (EmitDynamicInitializers): Fix bug which prevented the Set array method
28031 Also fix bug which was causing the indices to be emitted in the reverse
28034 2001-11-24 Miguel de Icaza <miguel@ximian.com>
28036 * expression.cs (ArrayCreation): Implement the bits that Ravi left
28037 unfinished. They do not work, because the underlying code is
28040 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28042 * cs-parser.jay: Remove bogus fixme.
28044 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
28045 on Switch statement.
28047 2001-11-23 Ravi Pratap <ravi@ximian.com>
28049 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
28052 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
28053 parameter. Apparently, any expression is allowed.
28055 (ValidateInitializers): Update accordingly.
28057 (CheckIndices): Fix some tricky bugs thanks to recursion.
28059 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
28060 I was being completely brain-dead.
28062 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
28063 and re-write acordingly.
28065 (DelegateInvocation): Re-write accordingly.
28067 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
28069 (MakeByteBlob): Handle types more correctly.
28071 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
28072 initialization from expressions but it is incomplete because I am a complete
28075 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28077 * statement.cs (If.Emit): Fix a bug that generated incorrect code
28078 on If. Basically, we have to return `true' (ie, we do return to
28079 our caller) only if both branches of the if return.
28081 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
28082 short-circuit operators, handle them as short circuit operators.
28084 (Cast.DoResolve): Resolve type.
28085 (Cast.Cast): Take an expression as the target type.
28087 * cs-parser.jay (cast_expression): Remove old hack that only
28088 allowed a limited set of types to be handled. Now we take a
28089 unary_expression and we resolve to a type during semantic
28092 Use the grammar productions from Rhys to handle casts (this is
28093 not complete like Rhys syntax yet, we fail to handle that corner
28094 case that C# has regarding (-x), but we will get there.
28096 2001-11-22 Ravi Pratap <ravi@ximian.com>
28098 * class.cs (EmitFieldInitializer): Take care of the case when we have a
28099 field which is an array type.
28101 * cs-parser.jay (declare_local_variables): Support array initialization too.
28103 * typemanager.cs (MakeKey): Implement.
28105 (everywhere): Use the above appropriately.
28107 * cs-parser.jay (for_statement): Update for array initialization while
28108 declaring variables.
28110 * ecore.cs : The error message was correct, it's the variable's names that
28111 were misleading ;-) Make the code more readable.
28113 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
28114 the correct type etc.
28116 (ConvertExplicit): Handle Enum types by examining the underlying type.
28118 2001-11-21 Ravi Pratap <ravi@ximian.com>
28120 * parameter.cs (GetCallingConvention): Always return
28121 CallingConventions.Standard for now.
28123 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28125 * expression.cs (Binary.ResolveOperator): Update the values of `l'
28126 and `r' after calling DoNumericPromotions.
28128 * ecore.cs: Fix error message (the types were in the wrong order).
28130 * statement.cs (Foreach.ProbeCollectionType): Need to pass
28131 BindingFlags.Instance as well
28133 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
28134 implicit int literal conversion in an empty cast so that we
28135 propagate the right type upstream.
28137 (UnboxCast): new class used to unbox value types.
28138 (Expression.ConvertExplicit): Add explicit type conversions done
28141 (Expression.ImplicitNumericConversion): Oops, forgot to test for
28142 the target type before applying the implicit LongLiterals to ULong
28145 2001-11-21 Miguel de Icaza <miguel@ximian.com>
28147 * cs-parser.jay (for_statement): Reworked the way For works: now
28148 we declare manually any variables that are introduced in
28149 for_initializer to solve the problem of having out-of-band code
28150 emition (that is what got for broken).
28152 (declaration_statement): Perform the actual variable declaration
28153 that used to be done in local_variable_declaration here.
28155 (local_variable_declaration): Do not declare anything, just pass
28156 the information on a DictionaryEntry
28158 2001-11-20 Ravi Pratap <ravi@ximian.com>
28160 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
28161 re-write of the logic to now make it recursive.
28163 (UpdateIndices): Re-write accordingly.
28165 Store element data in a separate ArrayData list in the above methods.
28167 (MakeByteBlob): Implement to dump the array data into a byte array.
28169 2001-11-19 Ravi Pratap <ravi@ximian.com>
28171 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
28174 * constant.cs (Define): Implement.
28176 (EmitConstant): Re-write fully.
28178 Pass in location info.
28180 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
28183 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
28184 DictionaryEntry since we need location info too.
28186 (constant_declaration): Update accordingly.
28188 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
28189 code into another method : UpdateIndices.
28191 2001-11-18 Ravi Pratap <ravi@ximian.com>
28193 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
28194 some type checking etc.
28196 2001-11-17 Ravi Pratap <ravi@ximian.com>
28198 * expression.cs (ArrayCreation::ValidateInitializers): Implement
28199 bits to provide dimension info if the user skips doing that.
28201 Update second constructor to store the rank correctly.
28203 2001-11-16 Ravi Pratap <ravi@ximian.com>
28205 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
28206 and try to implement.
28208 * ../errors/cs0150.cs : Add.
28210 * ../errors/cs0178.cs : Add.
28212 2001-11-16 Miguel de Icaza <miguel@ximian.com>
28214 * statement.cs: Implement foreach on multi-dimensional arrays.
28216 * parameter.cs (Parameters.GetParameterByName): Also lookup the
28217 name of the params argument.
28219 * expression.cs: Use EmitStoreOpcode to get the right opcode while
28220 initializing the array.
28222 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
28223 we can use this elsewhere.
28225 * statement.cs: Finish implementation of foreach for single
28228 * cs-parser.jay: Use an out-of-band stack to pass information
28229 around, I wonder why I need this.
28231 foreach_block: Make the new foreach_block the current_block.
28233 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
28234 function used to return a static Parameters structure. Used for
28235 empty parameters, as those are created very frequently.
28237 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
28239 2001-11-15 Ravi Pratap <ravi@ximian.com>
28241 * interface.cs : Default modifier is private, not public. The
28242 make verify test passes again.
28244 2001-11-15 Ravi Pratap <ravi@ximian.com>
28246 * support.cs (ReflectionParameters): Fix logic to determine
28247 whether the last parameter is a params one. Test 9 passes again.
28249 * delegate.cs (Populate): Register the builders we define with
28250 RegisterParameterForBuilder. Test 19 passes again.
28252 * cs-parser.jay (property_declaration): Reference $6 instead
28253 of $$ to get at the location.
28255 (indexer_declaration): Similar stuff.
28257 (attribute): Ditto.
28259 * class.cs (Property): Register parameters for the Get and Set methods
28260 if they exist. Test 23 passes again.
28262 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
28263 call to EmitArguments as we are sure there aren't any params arguments.
28264 Test 32 passes again.
28266 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
28267 IndexOutOfRangeException.
28269 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
28270 Test 33 now passes again.
28272 2001-11-15 Miguel de Icaza <miguel@ximian.com>
28274 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
28275 broke a bunch of things. Will have to come up with a better way
28276 of tracking locations.
28278 * statement.cs: Implemented foreach for single dimension arrays.
28280 2001-11-09 Miguel de Icaza <miguel@ximian.com>
28282 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
28283 an error. This removes the lookup from the critical path.
28285 * cs-parser.jay: Removed use of temporary_loc, which is completely
28288 2001-11-14 Miguel de Icaza <miguel@ximian.com>
28290 * support.cs (ReflectionParameters.ParameterModifier): Report
28291 whether the argument is a PARAMS argument or not.
28293 * class.cs: Set the attribute `ParamArrayAttribute' on the
28294 parameter argument.
28296 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
28297 and cons_param_array_attribute (ConstructorInfo for
28298 ParamArrayAttribute).,
28300 * codegen.cs: Emit the return using the `Return' statement, that
28301 way we can report the error correctly for missing return values.
28303 * class.cs (Method.Emit): Clean up.
28305 * expression.cs (Argument.Resolve): Take another argument: the
28306 location where this argument is used. Notice that this is not
28307 part of the "Argument" class as to reduce the size of the
28308 structure (we know the approximate location anyways).
28310 Test if the argument is a variable-reference, if not, then
28311 complain with a 206.
28313 (Argument.Emit): Emit addresses of variables.
28315 (Argument.FullDesc): Simplify.
28317 (Invocation.DoResolve): Update for Argument.Resolve.
28319 (ElementAccess.DoResolve): ditto.
28321 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
28322 method should be virtual, as this method is always virtual.
28324 (NewDelegate.DoResolve): Update for Argument.Resolve.
28326 * class.cs (ConstructorInitializer.DoResolve): ditto.
28328 * attribute.cs (Attribute.Resolve): ditto.
28330 2001-11-13 Miguel de Icaza <miguel@ximian.com>
28332 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
28334 * expression.cs (ParameterReference): Drop IStackStorage and implement
28335 IAssignMethod instead.
28337 (LocalVariableReference): ditto.
28339 * ecore.cs (FieldExpr): Drop IStackStorage and implement
28340 IAssignMethod instead.
28342 2001-11-13 Miguel de Icaza <miguel@ximian.com>
28344 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
28345 enumerations that are used in heavily used structures derive from
28346 byte in a laughable and pathetic attempt to reduce memory usage.
28347 This is the kind of pre-optimzations that you should not do at
28348 home without adult supervision.
28350 * expression.cs (UnaryMutator): New class, used to handle ++ and
28351 -- separatedly from the other unary operators. Cleans up the
28352 code, and kills the ExpressionStatement dependency in Unary.
28354 (Unary): Removed `method' and `Arguments' from this class, making
28355 it smaller, and moving it all to SimpleCall, so I can reuse this
28356 code in other locations and avoid creating a lot of transient data
28357 strucutres when not required.
28359 * cs-parser.jay: Adjust for new changes.
28361 2001-11-11 Miguel de Icaza <miguel@ximian.com>
28363 * enum.cs (Enum.Populate): If there is a failure during
28366 * cs-parser.jay (opt_enum_base): we used to catch type errors
28367 here, but this is really incorrect. The type error should be
28368 catched during semantic analysis.
28370 2001-12-11 Ravi Pratap <ravi@ximian.com>
28372 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
28373 current_local_parameters as expected since I, in my stupidity, had forgotten
28376 * attribute.cs (GetValidPlaces): Fix stupid bug.
28378 * class.cs (Method::Emit): Perform check on applicability of attributes.
28380 (Constructor::Emit): Ditto.
28382 (Field::Emit): Ditto.
28384 (Field.Location): Store location information.
28386 (Property, Event, Indexer, Operator): Ditto.
28388 * cs-parser.jay (field_declaration): Pass in location for each field.
28390 * ../errors/cs0592.cs : Add.
28392 2001-11-12 Ravi Pratap <ravi@ximian.com>
28394 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
28396 (InitCoreTypes): Update accordingly.
28398 (RegisterAttrType, LookupAttr): Implement.
28400 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
28401 info about the same.
28403 (Resolve): Update to populate the above as necessary.
28405 (Error592): Helper.
28407 (GetValidPlaces): Helper to the above.
28409 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
28411 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
28413 2001-11-12 Ravi Pratap <ravi@ximian.com>
28415 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
28417 * ../errors/cs0617.cs : Add.
28419 2001-11-11 Ravi Pratap <ravi@ximian.com>
28421 * enum.cs (Emit): Rename to Populate to be more consistent with what
28422 we expect it to do and when exactly it is called.
28424 * class.cs, rootcontext.cs : Update accordingly.
28426 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
28427 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
28429 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
28431 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
28432 of a fieldinfo using the above, when dealing with a FieldBuilder.
28434 2001-11-10 Ravi Pratap <ravi@ximian.com>
28436 * ../errors/cs0031.cs : Add.
28438 * ../errors/cs1008.cs : Add.
28440 * ../errrors/cs0543.cs : Add.
28442 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
28445 (FindMembers): Implement.
28447 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
28448 enums and delegates too.
28450 (enum_types): Rename to builder_to_enum.
28452 (delegate_types): Rename to builder_to_delegate.
28454 * delegate.cs (FindMembers): Implement.
28456 2001-11-09 Ravi Pratap <ravi@ximian.com>
28458 * typemanager.cs (IsEnumType): Implement.
28460 * enum.cs (Emit): Re-write parts to account for the underlying type
28461 better and perform checking etc.
28463 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
28464 of the underlying type.
28466 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
28469 * enum.cs (error31): Helper to report error #31.
28471 * cs-parser.jay (enum_declaration): Store location of each member too.
28473 * enum.cs (member_to_location): New hashtable.
28475 (AddEnumMember): Update location hashtable.
28477 (Emit): Use the location of each member while reporting errors.
28479 2001-11-09 Miguel de Icaza <miguel@ximian.com>
28481 * cs-parser.jay: A for_initializer if is a
28482 local_variable_declaration really ammount to have an implicit
28483 block with the variable declaration and no initializer for for.
28485 * statement.cs (For.Emit): Cope with null initializers.
28487 This fixes the infinite loop on for initializers.
28489 2001-11-08 Miguel de Icaza <miguel@ximian.com>
28491 * enum.cs: More cleanup.
28493 * ecore.cs: Remove dead code.
28495 * class.cs (Property.Emit): More simplification.
28496 (Event.Emit): ditto.
28498 Reworked to have less levels of indentation.
28500 2001-11-08 Ravi Pratap <ravi@ximian.com>
28502 * class.cs (Property): Emit attributes.
28512 * enum.cs (Emit): Ditto.
28514 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
28517 * class.cs (Field, Event, etc.): Move attribute generation into the
28518 Emit method everywhere.
28520 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
28521 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
28522 as we had no way of defining nested enums !
28524 * rootcontext.cs : Adjust code accordingly.
28526 * typemanager.cs (AddEnumType): To keep track of enum types separately.
28528 2001-11-07 Ravi Pratap <ravi@ximian.com>
28530 * expression.cs (EvalConstantExpression): Move into ecore.cs
28532 * enum.cs (Enum): Rename some members and make them public and readonly
28533 according to our convention.
28535 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
28538 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
28540 (Enum::Emit): Write a simple version for now which doesn't try to compute
28541 expressions. I shall modify this to be more robust in just a while.
28543 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
28545 (TypeContainer::CloseType): Create the Enum types too.
28547 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
28549 * expression.cs (EvalConstantExpression): Get rid of completely.
28551 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
28552 user-defined values and other cases.
28554 (IsValidEnumLiteral): Helper function.
28556 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
28557 out there in the case we had a literal FieldExpr.
28559 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
28561 (Literalize): Revamp a bit to take two arguments.
28563 (EnumLiteral): New class which derives from Literal to wrap enum literals.
28565 2001-11-06 Ravi Pratap <ravi@ximian.com>
28567 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
28569 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
28571 (Resolve): Use the above to ensure we have proper initializers.
28573 2001-11-05 Ravi Pratap <ravi@ximian.com>
28575 * expression.cs (Expression::EvalConstantExpression): New method to
28576 evaluate constant expressions.
28578 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
28580 2001-11-07 Miguel de Icaza <miguel@ximian.com>
28582 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
28585 (Binary.ResolveOperator): Handle operator != (object a, object b)
28586 and operator == (object a, object b);
28588 (Binary.DoNumericPromotions): Indicate whether the numeric
28589 promotion was possible.
28591 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
28594 Made the ArrayAccess implement interface IAssignMethod instead of
28595 IStackStore as the order in which arguments are passed reflects
28598 * assign.cs: Instead of using expr.ExprClass to select the way of
28599 assinging, probe for the IStackStore/IAssignMethod interfaces.
28601 * typemanager.cs: Load InitializeArray definition.
28603 * rootcontext.cs (RootContext.MakeStaticData): Used to define
28604 static data that can be used to initialize arrays.
28606 2001-11-05 Miguel de Icaza <miguel@ximian.com>
28608 * expression.cs: Handle operator== and operator!= for booleans.
28610 (Conditioal.Reduce): Implement reducer for the ?: operator.
28612 (Conditional.Resolve): Implement dead code elimination.
28614 (Binary.Resolve): Catch string literals and return a new
28615 concatenated string.
28617 (Unary.Reduce): Implement reduction of unary expressions.
28619 * ecore.cs: Split out the expression core handling here.
28621 (Expression.Reduce): New method used to perform constant folding
28622 and CSE. This is needed to support constant-expressions.
28624 * statement.cs (Statement.EmitBoolExpression): Pass true and false
28625 targets, and optimize for !x.
28627 2001-11-04 Ravi Pratap <ravi@ximian.com>
28629 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
28630 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
28631 set custom atttributes.
28633 * literal.cs (Literal::GetValue): New abstract method to return the actual
28634 value of the literal, cast as an object.
28636 (*Literal): Implement GetValue method.
28638 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
28639 expressions to the arraylist but objects of type Argument.
28641 * class.cs (TypeContainer::Emit): Emit our attributes too.
28643 (Method::Emit, Constructor::Emit): Ditto.
28645 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
28646 to be ignoring earlier.
28648 2001-11-03 Ravi Pratap <ravi@ximian.com>
28650 * attribute.cs (AttributeSection::Define): Implement to do the business
28651 of constructing a CustomAttributeBuilder.
28653 (Attribute): New trivial class. Increases readability of code.
28655 * cs-parser.jay : Update accordingly.
28657 (positional_argument_list, named_argument_list, named_argument): New rules
28659 (attribute_arguments): Use the above so that we are more correct.
28661 2001-11-02 Ravi Pratap <ravi@ximian.com>
28663 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
28664 to perform all checks for a method with a params parameter.
28666 (Invocation::OverloadResolve): Update to use the above method and therefore
28667 cope correctly with params method invocations.
28669 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
28672 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
28673 constructors in our parent too because we can't afford to miss out on
28676 * attribute.cs (AttributeSection): New name for the class Attribute
28678 Other trivial changes to improve readability.
28680 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
28681 use the new class names.
28683 2001-11-01 Ravi Pratap <ravi@ximian.com>
28685 * class.cs (Method::Define): Complete definition for params types too
28687 (Indexer::Define): Ditto.
28689 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
28690 Cope everywhere with a request for info about the array parameter.
28692 2001-11-01 Ravi Pratap <ravi@ximian.com>
28694 * tree.cs (RecordNamespace): Fix up to check for the correct key.
28696 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
28697 local_variable_type to extract the string corresponding to the type.
28699 (local_variable_type): Fixup the action to use the new helper method.
28701 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
28704 * expression.cs : Clean out code which uses the above.
28706 2001-10-31 Ravi Pratap <ravi@ximian.com>
28708 * typemanager.cs (RegisterMethod): Check if we already have an existing key
28709 and bale out if necessary by returning a false.
28711 (RegisterProperty): Ditto.
28713 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
28714 and print out appropriate error messages.
28716 * interface.cs (everywhere): Ditto.
28718 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
28719 location to constructor.
28721 * class.cs (Property, Event, Indexer): Update accordingly.
28723 * ../errors/cs111.cs : Added.
28725 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
28726 of a method, as laid down by the spec.
28728 (Invocation::OverloadResolve): Use the above method.
28730 2001-10-31 Ravi Pratap <ravi@ximian.com>
28732 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
28733 now take a TypeContainer and a Parameters object.
28735 (ParameterData): Modify return type of ParameterModifier method to be
28736 Parameter.Modifier and not a string.
28738 (ReflectionParameters, InternalParameters): Update accordingly.
28740 * expression.cs (Argument::GetParameterModifier): Same here.
28742 * support.cs (InternalParameters::ParameterType): Find a better way of determining
28743 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
28744 symbol in it at all so maybe this is only for now.
28746 2001-10-30 Ravi Pratap <ravi@ximian.com>
28748 * support.cs (InternalParameters): Constructor now takes an extra argument
28749 which is the actual Parameters class.
28751 (ParameterDesc): Update to provide info on ref/out modifiers.
28753 * class.cs (everywhere): Update call to InternalParameters to pass in
28754 the second argument too.
28756 * support.cs (ParameterData): Add ParameterModifier, which is a method
28757 to return the modifier info [ref/out etc]
28759 (InternalParameters, ReflectionParameters): Implement the above.
28761 * expression.cs (Argument::ParameterModifier): Similar function to return
28762 info about the argument's modifiers.
28764 (Invocation::OverloadResolve): Update to take into account matching modifiers
28767 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
28768 a new SetFormalParameters object which we pass to InternalParameters.
28770 2001-10-30 Ravi Pratap <ravi@ximian.com>
28772 * expression.cs (NewArray): Merge into the ArrayCreation class.
28774 2001-10-29 Ravi Pratap <ravi@ximian.com>
28776 * expression.cs (NewArray): Merge classes NewBuiltinArray and
28777 NewUserdefinedArray into one as there wasn't much of a use in having
28780 * expression.cs (Argument): Change field's name to ArgType from Type.
28782 (Type): New readonly property which returns the proper type, taking into
28783 account ref/out modifiers.
28785 (everywhere): Adjust code accordingly for the above.
28787 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
28788 whether we are emitting for a ref or out parameter.
28790 * expression.cs (Argument::Emit): Use the above field to set the state.
28792 (LocalVariableReference::Emit): Update to honour the flag and emit the
28795 * parameter.cs (Attributes): Set the correct flags for ref parameters.
28797 * expression.cs (Argument::FullDesc): New function to provide a full desc.
28799 * support.cs (ParameterData): Add method ParameterDesc to the interface.
28801 (ReflectionParameters, InternalParameters): Implement the above method.
28803 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
28806 (Invocation::FullMethodDesc): Ditto.
28808 2001-10-29 Miguel de Icaza <miguel@ximian.com>
28810 * cs-parser.jay: Add extra production for the second form of array
28813 * expression.cs (ArrayCreation): Update to reflect the above
28816 * Small changes to prepare for Array initialization.
28818 2001-10-28 Miguel de Icaza <miguel@ximian.com>
28820 * typemanager.cs (ImplementsInterface): interface might be null;
28821 Deal with this problem;
28823 Also, we do store negative hits on the cache (null values), so use
28824 this instead of calling t.GetInterfaces on the type everytime.
28826 2001-10-28 Ravi Pratap <ravi@ximian.com>
28828 * typemanager.cs (IsBuiltinType): New method to help determine the same.
28830 * expression.cs (New::DoResolve): Get rid of array creation code and instead
28831 split functionality out into different classes.
28833 (New::FormArrayType): Move into NewBuiltinArray.
28835 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
28838 (NewBuiltinArray): New class to handle creation of built-in arrays.
28840 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
28841 account creation of one-dimensional arrays.
28843 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
28845 (NewUserdefinedArray::DoResolve): Implement.
28847 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
28849 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
28850 we maintain inside the TypeManager. This is necessary to perform lookups on the
28853 (LookupType): Update to perform GetType on the module builders too.
28855 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
28857 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
28859 2001-10-23 Ravi Pratap <ravi@ximian.com>
28861 * expression.cs (New::DoResolve): Implement guts of array creation.
28863 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
28865 2001-10-27 Miguel de Icaza <miguel@ximian.com>
28867 * expression.cs: Fix bug I introduced lsat night that broke
28870 (Expression.Resolve): Report a 246 error (can not resolve name)
28871 if we find a SimpleName in the stream.
28873 (Expression.ResolveLValue): Ditto.
28875 (Expression.ResolveWithSimpleName): This function is a variant of
28876 ResolveName, this one allows SimpleNames to be returned without a
28877 warning. The only consumer of SimpleNames is MemberAccess
28879 2001-10-26 Miguel de Icaza <miguel@ximian.com>
28881 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
28882 might arrive here. I have my doubts that this is correct.
28884 * statement.cs (Lock): Implement lock statement.
28886 * cs-parser.jay: Small fixes to support `lock' and `using'
28888 * cs-tokenizer.cs: Remove extra space
28890 * driver.cs: New flag --checked, allows to turn on integer math
28893 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
28894 Threading.Monitor.Exit
28896 2001-10-23 Miguel de Icaza <miguel@ximian.com>
28898 * expression.cs (IndexerAccess::DoResolveLValue): Set the
28899 Expression Class to be IndexerAccess.
28901 Notice that Indexer::DoResolve sets the eclass to Value.
28903 2001-10-22 Miguel de Icaza <miguel@ximian.com>
28905 * class.cs (TypeContainer::Emit): Emit code for indexers.
28907 * assign.cs (IAssignMethod): New interface implemented by Indexers
28908 and Properties for handling assignment.
28910 (Assign::Emit): Simplify and reuse code.
28912 * expression.cs (IndexerAccess, PropertyExpr): Implement
28913 IAssignMethod, clean up old code.
28915 2001-10-22 Ravi Pratap <ravi@ximian.com>
28917 * typemanager.cs (ImplementsInterface): New method to determine if a type
28918 implements a given interface. Provides a nice cache too.
28920 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
28923 (ConvertReferenceExplicit): Ditto.
28925 * delegate.cs (Delegate::Populate): Update to define the parameters on the
28926 various methods, with correct names etc.
28928 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
28929 Operator.UnaryNegation.
28931 * cs-parser.jay (operator_declarator): Be a little clever in the case where
28932 we have a unary plus or minus operator.
28934 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
28937 * everywhere : update accordingly.
28939 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
28942 * class.cs (Method::Define): For the case where we are implementing a method
28943 inherited from an interface, we need to set the MethodAttributes.Final flag too.
28944 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
28946 2001-10-21 Ravi Pratap <ravi@ximian.com>
28948 * interface.cs (FindMembers): Implement to work around S.R.E
28951 * typemanager.cs (IsInterfaceType): Implement.
28953 (FindMembers): Update to handle interface types too.
28955 * expression.cs (ImplicitReferenceConversion): Re-write bits which
28956 use IsAssignableFrom as that is not correct - it doesn't work.
28958 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
28959 and accordingly override EmitStatement.
28961 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
28962 using the correct logic :-)
28964 2001-10-19 Ravi Pratap <ravi@ximian.com>
28966 * ../errors/cs-11.cs : Add to demonstrate error -11
28968 2001-10-17 Miguel de Icaza <miguel@ximian.com>
28970 * assign.cs (Assign::Resolve): Resolve right hand side first, and
28971 then pass this as a hint to ResolveLValue.
28973 * expression.cs (FieldExpr): Add Location information
28975 (FieldExpr::LValueResolve): Report assignment to readonly
28978 (Expression::ExprClassFromMemberInfo): Pass location information.
28980 (Expression::ResolveLValue): Add new method that resolves an
28983 (Expression::DoResolveLValue): Default invocation calls
28986 (Indexers): New class used to keep track of indexers in a given
28989 (IStackStore): Renamed from LValue, as it did not really describe
28990 what this did. Also ResolveLValue is gone from this interface and
28991 now is part of Expression.
28993 (ElementAccess): Depending on the element access type
28995 * typemanager.cs: Add `indexer_name_type' as a Core type
28996 (System.Runtime.CompilerServices.IndexerNameAttribute)
28998 * statement.cs (Goto): Take a location.
29000 2001-10-18 Ravi Pratap <ravi@ximian.com>
29002 * delegate.cs (Delegate::VerifyDelegate): New method to verify
29003 if two delegates are compatible.
29005 (NewDelegate::DoResolve): Update to take care of the case when
29006 we instantiate a delegate from another delegate.
29008 * typemanager.cs (FindMembers): Don't even try to look up members
29009 of Delegate types for now.
29011 2001-10-18 Ravi Pratap <ravi@ximian.com>
29013 * delegate.cs (NewDelegate): New class to take care of delegate
29016 * expression.cs (New): Split the delegate related code out into
29017 the NewDelegate class.
29019 * delegate.cs (DelegateInvocation): New class to handle delegate
29022 * expression.cs (Invocation): Split out delegate related code into
29023 the DelegateInvocation class.
29025 2001-10-17 Ravi Pratap <ravi@ximian.com>
29027 * expression.cs (New::DoResolve): Implement delegate creation fully
29028 and according to the spec.
29030 (New::DoEmit): Update to handle delegates differently.
29032 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
29033 because of which we were printing out arguments in reverse order !
29035 * delegate.cs (VerifyMethod): Implement to check if the given method
29036 matches the delegate.
29038 (FullDelegateDesc): Implement.
29040 (VerifyApplicability): Implement.
29042 * expression.cs (Invocation::DoResolve): Update to accordingly handle
29043 delegate invocations too.
29045 (Invocation::Emit): Ditto.
29047 * ../errors/cs1593.cs : Added.
29049 * ../errors/cs1594.cs : Added.
29051 * delegate.cs (InstanceExpression, TargetMethod): New properties.
29053 2001-10-16 Ravi Pratap <ravi@ximian.com>
29055 * typemanager.cs (intptr_type): Core type for System.IntPtr
29057 (InitCoreTypes): Update for the same.
29059 (iasyncresult_type, asynccallback_type): Ditto.
29061 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
29064 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
29067 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
29068 the builders for the 4 members of a delegate type :-)
29070 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
29073 * expression.cs (New::DoResolve): Implement guts for delegate creation.
29075 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
29077 2001-10-15 Miguel de Icaza <miguel@ximian.com>
29079 * statement.cs (Break::Emit): Implement.
29080 (Continue::Emit): Implement.
29082 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
29083 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
29084 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
29085 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
29088 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
29089 properties that track the label for the current loop (begin of the
29090 loop and end of the loop).
29092 2001-10-15 Ravi Pratap <ravi@ximian.com>
29094 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
29095 use of emitting anything at all.
29097 * class.cs, rootcontext.cs : Get rid of calls to the same.
29099 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
29101 (Populate): Define the constructor correctly and set the implementation
29104 * typemanager.cs (delegate_types): New hashtable to hold delegates that
29107 (AddDelegateType): Implement.
29109 (IsDelegateType): Implement helper method.
29111 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
29113 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
29114 and accordingly handle it.
29116 * delegate.cs (Populate): Take TypeContainer argument.
29117 Implement bits to define the Invoke method. However, I still haven't figured out
29118 how to take care of the native int bit :-(
29120 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
29121 Qualify the name of the delegate, not its return type !
29123 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
29126 (StandardConversionExists): Checking for array types turns out to be recursive.
29128 (ConvertReferenceExplicit): Implement array conversion.
29130 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
29132 2001-10-12 Ravi Pratap <ravi@ximian.com>
29134 * cs-parser.jay (delegate_declaration): Store the fully qualified
29135 name as it is a type declaration.
29137 * delegate.cs (ReturnType, Name): Rename members to these. Make them
29140 (DefineDelegate): Renamed from Define. Does the same thing essentially,
29141 as TypeContainer::DefineType.
29143 (Populate): Method in which all the definition of the various methods (Invoke)
29146 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
29149 (CloseDelegate): Finally creates the delegate.
29151 * class.cs (TypeContainer::DefineType): Update to define delegates.
29152 (Populate, Emit and CloseType): Do the same thing here too.
29154 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
29155 delegates in all these operations.
29157 2001-10-14 Miguel de Icaza <miguel@ximian.com>
29159 * expression.cs: LocalTemporary: a new expression used to
29160 reference a temporary that has been created.
29162 * assign.cs: Handle PropertyAccess back here, so that we can
29163 provide the proper semantic access to properties.
29165 * expression.cs (Expression::ConvertReferenceExplicit): Implement
29166 a few more explicit conversions.
29168 * modifiers.cs: `NEW' modifier maps to HideBySig.
29170 * expression.cs (PropertyExpr): Make this into an
29171 ExpressionStatement, and support the EmitStatement code path.
29173 Perform get/set error checking, clean up the interface.
29175 * assign.cs: recognize PropertyExprs as targets, and if so, turn
29176 them into toplevel access objects.
29178 2001-10-12 Miguel de Icaza <miguel@ximian.com>
29180 * expression.cs: PropertyExpr::PropertyExpr: use work around the
29183 * typemanager.cs: Keep track here of our PropertyBuilders again to
29184 work around lameness in SRE.
29186 2001-10-11 Miguel de Icaza <miguel@ximian.com>
29188 * expression.cs (LValue::LValueResolve): New method in the
29189 interface, used to perform a second resolution pass for LValues.
29191 (This::DoResolve): Catch the use of this in static methods.
29193 (This::LValueResolve): Implement.
29195 (This::Store): Remove warning, assigning to `this' in structures
29198 (Invocation::Emit): Deal with invocation of
29199 methods on value types. We need to pass the address to structure
29200 methods rather than the object itself. (The equivalent code to
29201 emit "this" for structures leaves the entire structure on the
29202 stack instead of a pointer to it).
29204 (ParameterReference::DoResolve): Compute the real index for the
29205 argument based on whether the method takes or not a `this' pointer
29206 (ie, the method is static).
29208 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
29209 value types returned from functions when we need to invoke a
29210 method on the sturcture.
29213 2001-10-11 Ravi Pratap <ravi@ximian.com>
29215 * class.cs (TypeContainer::DefineType): Method to actually do the business of
29216 defining the type in the Modulebuilder or Typebuilder. This is to take
29217 care of nested types which need to be defined on the TypeBuilder using
29218 DefineNestedMethod.
29220 (TypeContainer::GetClassBases): Implement. Essentially the code from the
29221 methods in RootContext, only ported to be part of TypeContainer.
29223 (TypeContainer::GetInterfaceOrClass): Ditto.
29225 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
29227 * interface.cs (Interface::DefineInterface): New method. Does exactly
29228 what RootContext.CreateInterface did earlier, only it takes care of nested types
29231 (Interface::GetInterfaces): Move from RootContext here and port.
29233 (Interface::GetInterfaceByName): Same here.
29235 * rootcontext.cs (ResolveTree): Re-write.
29237 (PopulateTypes): Re-write.
29239 * class.cs (TypeContainer::Populate): Populate nested types too.
29240 (TypeContainer::Emit): Emit nested members too.
29242 * typemanager.cs (AddUserType): Do not make use of the FullName property,
29243 instead just use the name argument passed in as it is already fully
29246 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
29247 to TypeContainer mapping to see if a type is user-defined.
29249 * class.cs (TypeContainer::CloseType): Implement.
29251 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
29252 the default constructor.
29254 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
29257 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
29259 * interface.cs (CloseType): Create the type here.
29261 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
29264 Remove all the methods which are now in TypeContainer.
29266 2001-10-10 Ravi Pratap <ravi@ximian.com>
29268 * delegate.cs (Define): Re-write bits to define the delegate
29271 2001-10-10 Miguel de Icaza <miguel@ximian.com>
29273 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
29275 * expression.cs (ImplicitReferenceConversion): handle null as well
29276 as a source to convert to any reference type.
29278 * statement.cs (Return): Perform any implicit conversions to
29279 expected return type.
29281 Validate use of return statement.
29283 * codegen.cs (EmitContext): Pass the expected return type here.
29285 * class.cs (Method, Constructor, Property): Pass expected return
29286 type to EmitContext.
29288 2001-10-09 Miguel de Icaza <miguel@ximian.com>
29290 * expression.cs: Make DoResolve take an EmitContext instead of a
29293 Replaced `l' and `location' for `loc', for consistency.
29295 (Error, Warning): Remove unneeded Tc argument.
29297 * assign.cs, literal.cs, constant.cs: Update to new calling
29300 * codegen.cs: EmitContext now contains a flag indicating whether
29301 code is being generated in a static method or not.
29303 * cs-parser.jay: DecomposeQI, new function that replaces the old
29304 QualifiedIdentifier. Now we always decompose the assembled
29305 strings from qualified_identifier productions into a group of
29308 2001-10-08 Miguel de Icaza <miguel@ximian.com>
29310 * rootcontext.cs: Deal with field-less struct types correctly now
29311 by passing the size option to Define Type.
29313 * class.cs: Removed hack that created one static field.
29315 2001-10-07 Miguel de Icaza <miguel@ximian.com>
29317 * statement.cs: Moved most of the code generation here.
29319 2001-10-09 Ravi Pratap <ravi@ximian.com>
29321 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
29324 (ElementAccess): Remove useless bits for now - keep checks as the spec
29327 2001-10-08 Ravi Pratap <ravi@ximian.com>
29329 * expression.cs (ElementAccess::DoResolve): Remove my crap code
29330 and start performing checks according to the spec.
29332 2001-10-07 Ravi Pratap <ravi@ximian.com>
29334 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
29335 rank_specifiers instead.
29337 (rank_specifiers): Change the order in which the rank specifiers are stored
29339 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
29341 * expression.cs (ElementAccess): Implement the LValue interface too.
29343 2001-10-06 Ravi Pratap <ravi@ximian.com>
29345 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
29346 except that user defined conversions are not included.
29348 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
29349 perform the conversion of the return type, if necessary.
29351 (New::DoResolve): Check whether we are creating an array or an object
29352 and accordingly do the needful.
29354 (New::Emit): Same here.
29356 (New::DoResolve): Implement guts of array creation.
29358 (New::FormLookupType): Helper function.
29360 2001-10-07 Miguel de Icaza <miguel@ximian.com>
29362 * codegen.cs: Removed most of the code generation here, and move the
29363 corresponding code generation bits to the statement classes.
29365 Added support for try/catch/finalize and throw.
29367 * cs-parser.jay: Added support for try/catch/finalize.
29369 * class.cs: Catch static methods having the flags override,
29370 virtual or abstract.
29372 * expression.cs (UserCast): This user cast was not really doing
29373 what it was supposed to do. Which is to be born in fully resolved
29374 state. Parts of the resolution were being performed at Emit time!
29378 2001-10-05 Miguel de Icaza <miguel@ximian.com>
29380 * expression.cs: Implicity convert the result from UserCast.
29382 2001-10-05 Ravi Pratap <ravi@ximian.com>
29384 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
29385 prevented it from working correctly.
29387 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
29388 merely ConvertImplicit.
29390 2001-10-05 Miguel de Icaza <miguel@ximian.com>
29392 * typemanager.cs: Make the LookupTypeContainer function static,
29393 and not per-instance.
29395 * class.cs: Make static FindMembers (the one that takes a Type
29398 * codegen.cs: Add EmitForeach here.
29400 * cs-parser.jay: Make foreach a toplevel object instead of the
29401 inline expansion, as we need to perform semantic analysis on it.
29403 2001-10-05 Ravi Pratap <ravi@ximian.com>
29405 * expression.cs (Expression::ImplicitUserConversion): Rename to
29406 UserDefinedConversion.
29408 (Expression::UserDefinedConversion): Take an extra argument specifying
29409 whether we look for explicit user conversions too.
29411 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
29413 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
29415 (ExplicitUserConversion): Make it a call to UserDefinedConversion
29416 with the appropriate arguments.
29418 * cs-parser.jay (cast_expression): Record location too.
29420 * expression.cs (Cast): Record location info.
29422 (Expression::ConvertExplicit): Take location argument.
29424 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
29425 to determine if we are doing explicit conversions.
29427 (UserCast::Emit): Update accordingly.
29429 (Expression::ConvertExplicit): Report an error if everything fails.
29431 * ../errors/cs0030.cs : Add.
29433 2001-10-04 Miguel de Icaza <miguel@ximian.com>
29435 * modifiers.cs: If the ABSTRACT keyword is present, also set the
29436 virtual and newslot bits.
29438 * class.cs (TypeContainer::RegisterRequiredImplementations):
29439 Record methods we need.
29441 (TypeContainer::MakeKey): Helper function to make keys for
29442 MethodBases, since the Methodbase key is useless.
29444 (TypeContainer::Populate): Call RegisterRequiredImplementations
29445 before defining the methods.
29447 Create a mapping for method_builders_to_methods ahead of time
29448 instead of inside a tight loop.
29450 (::RequireMethods): Accept an object as the data to set into the
29451 hashtable so we can report interface vs abstract method mismatch.
29453 2001-10-03 Miguel de Icaza <miguel@ximian.com>
29455 * report.cs: Make all of it static.
29457 * rootcontext.cs: Drop object_type and value_type computations, as
29458 we have those in the TypeManager anyways.
29460 Drop report instance variable too, now it is a global.
29462 * driver.cs: Use try/catch on command line handling.
29464 Add --probe option to debug the error reporting system with a test
29467 * report.cs: Add support for exiting program when a probe
29468 condition is reached.
29470 2001-10-03 Ravi Pratap <ravi@ximian.com>
29472 * expression.cs (Binary::DoNumericPromotions): Fix the case when
29473 we do a forcible conversion regardless of type, to check if
29474 ForceConversion returns a null.
29476 (Binary::error19): Use location to report error.
29478 (Unary::error23): Use location here too.
29480 * ../errors/cs0019.cs : Check in.
29482 * ../errors/cs0023.cs : Check in.
29484 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
29485 case of a non-null MethodInfo object with a length of 0 !
29487 (Binary::ResolveOperator): Flag error if overload resolution fails to find
29488 an applicable member - according to the spec :-)
29489 Also fix logic to find members in base types.
29491 (Unary::ResolveOperator): Same here.
29493 (Unary::report23): Change name to error23 and make first argument a TypeContainer
29494 as I was getting thoroughly confused between this and error19 :-)
29496 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
29497 (::FindMostEncompassedType): Implement.
29498 (::FindMostEncompassingType): Implement.
29499 (::StandardConversionExists): Implement.
29501 (UserImplicitCast): Re-vamp. We now need info about most specific
29502 source and target types so that we can do the necessary conversions.
29504 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
29505 mathematical union with no duplicates.
29507 2001-10-03 Miguel de Icaza <miguel@ximian.com>
29509 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
29510 in order from base classes to child classes, so that we can in
29511 child classes look up in our parent for method names and
29512 attributes (required for handling abstract, virtual, new, override
29513 constructs: we need to instrospect our base class, and if we dont
29514 populate the classes in order, the introspection might be
29515 incorrect. For example, a method could query its parent before
29516 the parent has any methods and would determine that the parent has
29517 no abstract methods (while it could have had them)).
29519 (RootContext::CreateType): Record the order in which we define the
29522 2001-10-02 Miguel de Icaza <miguel@ximian.com>
29524 * class.cs (TypeContainer::Populate): Also method definitions can
29525 fail now, keep track of this.
29527 (TypeContainer::FindMembers): Implement support for
29528 DeclaredOnly/noDeclaredOnly flag.
29530 (Constructor::Emit) Return the ConstructorBuilder.
29532 (Method::Emit) Return the MethodBuilder.
29533 Check for abstract or virtual methods to be public.
29535 * rootcontext.cs (RootContext::CreateType): Register all the
29536 abstract methods required for the class to be complete and the
29537 interface methods that must be implemented.
29539 * cs-parser.jay: Report error 501 (method requires body if it is
29540 not marked abstract or extern).
29542 * expression.cs (TypeOf::Emit): Implement.
29544 * typemanager.cs: runtime_handle_type, new global type.
29546 * class.cs (Property::Emit): Generate code for properties.
29548 2001-10-02 Ravi Pratap <ravi@ximian.com>
29550 * expression.cs (Unary::ResolveOperator): Find operators on base type
29551 too - we now conform exactly to the spec.
29553 (Binary::ResolveOperator): Same here.
29555 * class.cs (Operator::Define): Fix minor quirk in the tests.
29557 * ../errors/cs0215.cs : Added.
29559 * ../errors/cs0556.cs : Added.
29561 * ../errors/cs0555.cs : Added.
29563 2001-10-01 Miguel de Icaza <miguel@ximian.com>
29565 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
29566 single integer which is really efficient
29568 2001-10-01 Ravi Pratap <ravi@ximian.com>
29570 * expression.cs (Expression::ImplicitUserConversion): Use location
29571 even in the case when we are examining True operators.
29573 * class.cs (Operator::Define): Perform extensive checks to conform
29574 with the rules for operator overloading in the spec.
29576 * expression.cs (Expression::ImplicitReferenceConversion): Implement
29577 some of the other conversions mentioned in the spec.
29579 * typemanager.cs (array_type): New static member for the System.Array built-in
29582 (cloneable_interface): For System.ICloneable interface.
29584 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
29585 we start resolving the tree and populating types.
29587 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
29589 2001-10-01 Miguel de Icaza <miguel@ximian.com>
29591 * expression.cs (Expression::ExprClassFromMemberInfo,
29592 Expression::Literalize): Create literal expressions from
29593 FieldInfos which are literals.
29595 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
29596 type casts, because they were wrong. The test suite in tests
29599 (ImplicitNumericConversion): ushort to ulong requires a widening
29602 Int32 constant to long requires widening cast as well.
29604 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
29605 for integers because the type on the stack is not i4.
29607 2001-09-30 Miguel de Icaza <miguel@ximian.com>
29609 * expression.cs (report118): require location argument.
29611 * parameter.cs: Do not dereference potential null value.
29613 * class.cs: Catch methods that lack the `new' keyword when
29614 overriding a name. Report warnings when `new' is used without
29615 anything being there to override.
29617 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
29619 * class.cs: Only add constructor to hashtable if it is non-null
29620 (as now constructors can fail on define).
29622 (TypeManager, Class, Struct): Take location arguments.
29624 Catch field instance initialization in structs as errors.
29626 accepting_filter: a new filter for FindMembers that is static so
29627 that we dont create an instance per invocation.
29629 (Constructor::Define): Catch errors where a struct constructor is
29632 * cs-parser.jay: Pass location information for various new
29635 * delegate.cs (Delegate): take a location argument.
29637 * driver.cs: Do not call EmitCode if there were problesm in the
29638 Definition of the types, as many Builders wont be there.
29640 * decl.cs (Decl::Decl): Require a location argument.
29642 * cs-tokenizer.cs: Handle properly hex constants that can not fit
29643 into integers, and find the most appropiate integer for it.
29645 * literal.cs: Implement ULongLiteral.
29647 * rootcontext.cs: Provide better information about the location of
29648 failure when CreateType fails.
29650 2001-09-29 Miguel de Icaza <miguel@ximian.com>
29652 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
29655 * expression.cs (Binary::CheckShiftArguments): Add missing type
29657 (Binary::ResolveOperator): Add type to the logical and and logical
29658 or, Bitwise And/Or and Exclusive Or code paths, it was missing
29661 (Binary::DoNumericPromotions): In the case where either argument
29662 is ulong (and most signed types combined with ulong cause an
29663 error) perform implicit integer constant conversions as well.
29665 2001-09-28 Miguel de Icaza <miguel@ximian.com>
29667 * expression.cs (UserImplicitCast): Method should always be
29669 (Invocation::BetterConversion): Simplified test for IntLiteral.
29671 (Expression::ImplicitNumericConversion): Split this routine out.
29672 Put the code that performs implicit constant integer conversions
29675 (Expression::Resolve): Become a wrapper around DoResolve so we can
29676 check eclass and type being set after resolve.
29678 (Invocation::Badness): Remove this dead function
29680 (Binary::ResolveOperator): Do not compute the expensive argumnets
29681 unless we have a union for it.
29683 (Probe::Emit): Is needs to do an isinst and then
29684 compare against null.
29686 (::CanConvert): Added Location argument. If the Location argument
29687 is null (Location.Null), then we do not report errors. This is
29688 used by the `probe' mechanism of the Explicit conversion. We do
29689 not want to generate an error for something that the user
29690 explicitly requested to be casted. But the pipeline for an
29691 explicit cast first tests for potential implicit casts.
29693 So for now, if the Location is null, it means `Probe only' to
29694 avoid adding another argument. Might have to revise this
29697 (ClassCast): New class used to type cast objects into arbitrary
29698 classes (used in Explicit Reference Conversions).
29700 Implement `as' as well.
29702 Reverted all the patches from Ravi below: they were broken:
29704 * The use of `level' as a mechanism to stop recursive
29705 invocations is wrong. That was there just to catch the
29706 bug with a strack trace but not as a way of addressing
29709 To fix the problem we have to *understand* what is going
29710 on and the interactions and come up with a plan, not
29711 just get things going.
29713 * The use of the type conversion cache that I proposed
29714 last night had an open topic: How does this work across
29715 protection domains. A user defined conversion might not
29716 be public in the location where we are applying the
29717 conversion, a different conversion might be selected
29718 (ie, private A->B (better) but public B->A (worse),
29719 inside A, A->B applies, but outside it, B->A will
29722 * On top of that (ie, even if the above is solved),
29723 conversions in a cache need to be abstract. Ie, `To
29724 convert from an Int to a Short use an OpcodeCast', not
29725 `To convert from an Int to a Short use the OpcodeCast on
29726 the variable 5' (which is what this patch was doing).
29728 2001-09-28 Ravi Pratap <ravi@ximian.com>
29730 * expression.cs (Invocation::ConversionExists): Re-write to use
29731 the conversion cache
29733 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
29734 cache all conversions done, not just user-defined ones.
29736 (Invocation::BetterConversion): The real culprit. Use ConversionExists
29737 to determine if a conversion exists instead of acutually trying to
29738 perform the conversion. It's faster too.
29740 (Expression::ConvertExplicit): Modify to use ConversionExists to check
29741 and only then attempt the implicit conversion.
29743 2001-09-28 Ravi Pratap <ravi@ximian.com>
29745 * expression.cs (ConvertImplicit): Use a cache for conversions
29746 already found. Check level of recursion and bail out if necessary.
29748 2001-09-28 Miguel de Icaza <miguel@ximian.com>
29750 * typemanager.cs (string_concat_string_string, string_concat_object_object):
29751 Export standard methods that we expect for string operations.
29753 * statement.cs (Block::UsageWarning): Track usage of variables and
29754 report the errors for not used variables.
29756 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
29759 2001-09-27 Miguel de Icaza <miguel@ximian.com>
29761 * codegen.cs: remove unnneded code
29763 * expression.cs: Removed BuiltinTypeAccess class
29765 Fix the order in which implicit conversions are
29768 The previous fixed dropped support for boxed conversions (adding a
29769 test to the test suite now)
29771 (UserImplicitCast::CanConvert): Remove test for source being null,
29772 that code is broken. We should not feed a null to begin with, if
29773 we do, then we should track the bug where the problem originates
29774 and not try to cover it up here.
29776 Return a resolved expression of type UserImplicitCast on success
29777 rather than true/false. Ravi: this is what I was talking about,
29778 the pattern is to use a static method as a "constructor" for
29781 Also, do not create arguments until the very last minute,
29782 otherwise we always create the arguments even for lookups that
29783 will never be performed.
29785 (UserImplicitCast::Resolve): Eliminate, objects of type
29786 UserImplicitCast are born in a fully resolved state.
29788 * typemanager.cs (InitCoreTypes): Init also value_type
29789 (System.ValueType).
29791 * expression.cs (Cast::Resolve): First resolve the child expression.
29793 (LValue): Add new method AddressOf to be used by
29796 Change the argument of Store to take an EmitContext instead of an
29797 ILGenerator, because things like FieldExpr need to be able to call
29798 their children expression to generate the instance code.
29800 (Expression::Error, Expression::Warning): Sugar functions for
29803 (Expression::MemberLookup): Accept a TypeContainer instead of a
29804 Report as the first argument.
29806 (Expression::ResolvePrimary): Killed. I still want to improve
29807 this as currently the code is just not right.
29809 (Expression::ResolveMemberAccess): Simplify, but it is still
29812 (Unary::Resolve): Catch errors in AddressOf operators.
29814 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
29815 index to a byte for the short-version, or the compiler will choose
29816 the wrong Emit call, which generates the wrong data.
29818 (ParameterReference::Emit, ::Store): same.
29820 (FieldExpr::AddressOf): Implement.
29822 * typemanager.cs: TypeManager: made public variable instead of
29825 * driver.cs: document --fatal.
29827 * report.cs (ErrorMessage, WarningMessage): new names for the old
29828 Error and Warning classes.
29830 * cs-parser.jay (member_access): Turn built-in access to types
29831 into a normal simplename
29833 2001-09-27 Ravi Pratap <ravi@ximian.com>
29835 * expression.cs (Invocation::BetterConversion): Fix to cope
29836 with q being null, since this was introducing a bug.
29838 * expression.cs (ConvertImplicit): Do built-in conversions first.
29840 2001-09-27 Ravi Pratap <ravi@ximian.com>
29842 * expression.cs (UserImplicitCast::Resolve): Fix bug.
29844 2001-09-27 Ravi Pratap <ravi@ximian.com>
29846 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
29847 I had introduced long ago (what's new ?).
29849 * expression.cs (UserImplicitCast::CanConvert): Static method to do
29850 the work of all the checking.
29851 (ConvertImplicit): Call CanConvert and only then create object if necessary.
29852 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
29854 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
29855 that is the right way.
29857 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
29858 overloading resolution. Use everywhere instead of cutting and pasting code.
29860 (Binary::ResolveOperator): Use MakeUnionSet.
29862 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
29863 we have to convert to bool types. Not complete yet.
29865 2001-09-27 Miguel de Icaza <miguel@ximian.com>
29867 * typemanager.cs (TypeManager::CSharpName): support ushort.
29869 * expression.cs (Expression::TryImplicitIntConversion): Attempts
29870 to provide an expression that performsn an implicit constant int
29871 conversion (section 6.1.6).
29872 (Expression::ConvertImplicitRequired): Reworked to include
29873 implicit constant expression conversions.
29875 (Expression::ConvertNumericExplicit): Finished.
29877 (Invocation::Emit): If InstanceExpression is null, then it means
29878 that we perform a call on this.
29880 2001-09-26 Miguel de Icaza <miguel@ximian.com>
29882 * expression.cs (Unary::Emit): Remove some dead code.
29883 (Probe): Implement Resolve and Emit for `is'.
29884 (Expression::ConvertImplicitRequired): Attempt to do constant
29885 expression conversions here. Maybe should be moved to
29886 ConvertImplicit, but I am not sure.
29887 (Expression::ImplicitLongConstantConversionPossible,
29888 Expression::ImplicitIntConstantConversionPossible): New functions
29889 that tell whether is it possible to apply an implicit constant
29890 expression conversion.
29892 (ConvertNumericExplicit): Started work on explicit numeric
29895 * cs-parser.jay: Update operator constants.
29897 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
29898 (Parameters::GetSignature): Hook up VerifyArgs here.
29899 (Parameters::VerifyArgs): Verifies that no two arguments have the
29902 * class.cs (Operator): Update the operator names to reflect the
29903 ones that the spec expects (as we are just stringizing the
29906 * expression.cs (Unary::ResolveOperator): Fix bug: Use
29907 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
29908 previous usage did only work for our methods.
29909 (Expression::ConvertImplicit): Handle decimal implicit numeric
29910 conversions as well.
29911 (Expression::InternalTypeConstructor): Used to invoke constructors
29912 on internal types for default promotions.
29914 (Unary::Emit): Implement special handling for the pre/post
29915 increment/decrement for overloaded operators, as they need to have
29916 the same semantics as the other operators.
29918 (Binary::ResolveOperator): ditto.
29919 (Invocation::ConversionExists): ditto.
29920 (UserImplicitCast::Resolve): ditto.
29922 2001-09-26 Ravi Pratap <ravi@ximian.com>
29924 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
29925 operator, return after emitting body. Regression tests pass again !
29927 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
29928 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
29929 (Invocation::OverloadResolve): Ditto.
29930 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
29932 * everywhere : update calls to the above methods accordingly.
29934 2001-09-26 Miguel de Icaza <miguel@ximian.com>
29936 * assign.cs (Assign): Make it inherit from ExpressionStatement.
29938 * expression.cs (ExpressionStatement): New base class used for
29939 expressions that can appear in statements, so that we can provide
29940 an alternate path to generate expression that do not leave a value
29943 (Expression::Emit, and all the derivatives): We no longer return
29944 whether a value is left on the stack or not. Every expression
29945 after being emitted leaves a single value on the stack.
29947 * codegen.cs (EmitContext::EmitStatementExpression): Use the
29948 facilties of ExpressionStatement if possible.
29950 * cs-parser.jay: Update statement_expression.
29952 2001-09-25 Miguel de Icaza <miguel@ximian.com>
29954 * driver.cs: Change the wording of message
29956 2001-09-25 Ravi Pratap <ravi@ximian.com>
29958 * expression.cs (Binary::ResolveOperator): Had forgottten to set
29959 the type of the expression to the return type of the method if
29960 we have an overloaded operator match ! The regression tests pass again !
29961 (Unary::ResolveOperator): Ditto.
29963 * expression.cs (Invocation::ConversionExists): Correct the member lookup
29964 to find "op_Implicit", not "implicit" ;-)
29965 (UserImplicitCast): New class to take care of user-defined implicit conversions.
29966 (ConvertImplicit, ForceConversion): Take TypeContainer argument
29968 * everywhere : Correct calls to the above accordingly.
29970 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
29971 (ConvertImplicit): Do user-defined conversion if it exists.
29973 2001-09-24 Miguel de Icaza <miguel@ximian.com>
29975 * assign.cs: track location.
29976 (Resolve): Use implicit conversions on assignment.
29978 * literal.cs: Oops. Not good, Emit of short access values should
29979 pass (Bytes) or the wrong argument will be selected.
29981 * expression.cs (Unary::Emit): Emit code for -expr.
29983 (Unary::ResolveOperator): Handle `Substract' for non-constants
29984 (substract from zero from the non-constants).
29985 Deal with Doubles as well.
29987 (Expression::ConvertImplicitRequired): New routine that reports an
29988 error if no implicit conversion exists.
29990 (Invocation::OverloadResolve): Store the converted implicit
29991 expressions if we make them
29993 2001-09-24 Ravi Pratap <ravi@ximian.com>
29995 * class.cs (ConstructorInitializer): Take a Location argument.
29996 (ConstructorBaseInitializer): Same here.
29997 (ConstructorThisInitializer): Same here.
29999 * cs-parser.jay : Update all calls accordingly.
30001 * expression.cs (Unary, Binary, New): Take location argument.
30002 Update accordingly everywhere.
30004 * cs-parser.jay : Update all calls to the above to take a location
30007 * class.cs : Ditto.
30009 2001-09-24 Ravi Pratap <ravi@ximian.com>
30011 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
30012 (Invocation::BetterConversion): Same here
30013 (Invocation::ConversionExists): Ditto.
30015 (Invocation::ConversionExists): Implement.
30017 2001-09-22 Ravi Pratap <ravi@ximian.com>
30019 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
30020 Also take an additional TypeContainer argument.
30022 * All over : Pass in TypeContainer as argument to OverloadResolve.
30024 * typemanager.cs (CSharpName): Update to check for the string type and return
30027 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
30030 2001-09-21 Ravi Pratap <ravi@ximian.com>
30032 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
30033 (Invocation::BetterFunction): Implement.
30034 (Invocation::BetterConversion): Implement.
30035 (Invocation::ConversionExists): Skeleton, no implementation yet.
30037 Okay, things work fine !
30039 2001-09-21 Miguel de Icaza <miguel@ximian.com>
30041 * typemanager.cs: declare and load enum_type, delegate_type and
30044 * expression.cs (Expression::Emit): Now emit returns a value that
30045 tells whether a value is left on the stack or not. This strategy
30046 might be reveted tomorrow with a mechanism that would address
30047 multiple assignments.
30048 (Expression::report118): Utility routine to report mismatches on
30051 (Unary::Report23): Report impossible type/operator combination
30054 (Unary::IsIncrementableNumber): Whether the type can be
30055 incremented or decremented with add.
30056 (Unary::ResolveOperator): Also allow enumerations to be bitwise
30058 (Unary::ResolveOperator): Implement ++, !, ~,
30060 (Invocation::Emit): Deal with new Emit convetion.
30062 * All Expression derivatives: Updated their Emit method to return
30063 whether they leave values on the stack or not.
30065 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
30066 stack for expressions that are statements.
30068 2001-09-20 Miguel de Icaza <miguel@ximian.com>
30070 * expression.cs (LValue): New interface. Must be implemented by
30072 (LocalVariableReference, ParameterReference, FieldExpr): Implement
30075 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
30076 interface for generating code, simplifies the code.
30078 2001-09-20 Ravi Pratap <ravi@ximian.com>
30080 * expression.cs (everywhere): Comment out return statements in ::Resolve
30081 methods to avoid the warnings.
30083 2001-09-20 Miguel de Icaza <miguel@ximian.com>
30085 * driver.cs (parse): Report error 2001 if we can not open the
30088 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
30091 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
30094 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
30095 otherwise nested blocks end up with the same index.
30097 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
30099 * expression.cs: Instead of having FIXMEs in the Resolve
30100 functions, throw exceptions so it is obvious that we are facing a
30103 * cs-parser.jay (invocation_expression): Pass Location information.
30105 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
30106 Use a basename for those routines because .NET does not like paths
30109 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
30112 2001-09-19 Miguel de Icaza <miguel@ximian.com>
30114 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
30115 are loading the correct data types (throws an exception if not).
30116 (TypeManager::InitCoreTypes): Use CoreLookupType
30118 * expression.cs (Unary::ResolveOperator): return the child
30119 expression for expressions which are just +expr.
30120 (Unary::ResolveOperator): Return negative literals for -LITERAL
30121 expressions (otherwise they are Unary {Literal}).
30122 (Invocation::Badness): Take into account `Implicit constant
30123 expression conversions'.
30125 * literal.cs (LongLiteral): Implement long literal class.
30126 (IntLiteral): export the `Value' of the intliteral.
30128 2001-09-19 Ravi Pratap <ravi@ximian.com>
30130 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
30132 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
30133 instead of 'Operator'
30135 * expression.cs (Binary::ResolveOperator): Update accordingly.
30136 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
30139 * cs-parser.jay (unary_expression): Update to use the new names.
30141 * gen-treedump.cs (GetUnary): Same here.
30143 * expression.cs (Unary::Resolve): Implement.
30144 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
30145 operators are found instead of making noise ;-)
30146 (Unary::ResolveOperator): New method to do precisely the same thing which
30147 Binary::ResolveOperator does for Binary expressions.
30148 (Unary.method, .Arguments): Add.
30149 (Unary::OperName): Implement.
30150 (Unary::ForceConversion): Copy and Paste !
30152 * class.cs (Operator::Define): Fix a small bug for the case when we have
30155 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
30156 for the inbuilt operators. Only overloading works for now ;-)
30158 2001-09-18 Miguel de Icaza <miguel@ximian.com>
30160 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
30161 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
30163 * expression.cs (This::Emit): Implement.
30164 (This::Resolve): Implement.
30165 (TypeOf:Resolve): Implement.
30166 (Expression::ResolveSimpleName): Add an implicit this to instance
30168 (MemberAccess::Resolve): Deal with Parameters and Fields.
30169 Bind instance variable to Field expressions.
30170 (FieldExpr::Instance): New field used to track the expression that
30171 represents the object instance.
30172 (FieldExpr::Resolve): Track potential errors from MemberLookup not
30174 (FieldExpr::Emit): Implement.
30176 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
30177 the last instruction contains a return opcode to avoid generating
30178 the last `ret' instruction (this generates correct code, and it is
30179 nice to pass the peverify output).
30181 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
30182 initializer for static and instance variables.
30183 (Constructor::Emit): Allow initializer to be null in the case of
30184 static constructors. Only emit initializer for instance
30187 (TypeContainer::FindMembers): Return a null array if there are no
30190 Also fix the code for the MemberTypes.Method branch, as it was not
30191 scanning that for operators (or tried to access null variables before).
30193 * assign.cs (Assign::Emit): Handle instance and static fields.
30197 * driver.cs: Stop compilation if there are parse errors.
30199 * cs-parser.jay (constructor_declaration): Provide default base
30200 initializer for non-static constructors.
30201 (constructor_declarator): Do not provide a default base
30202 initializers if none was specified.
30203 Catch the fact that constructors should not have parameters.
30205 * class.cs: Do not emit parent class initializers for static
30206 constructors, that should be flagged as an error.
30208 2001-09-18 Ravi Pratap <ravi@ximian.com>
30210 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
30211 Move back code into TypeContainer::Populate.
30213 2001-09-18 Ravi Pratap <ravi@ximian.com>
30215 * class.cs (TypeContainer::AddConstructor): Fix the check to
30216 compare against Name, not Basename.
30217 (Operator::OpType): Change Plus and Minus to Add and Subtract.
30219 * cs-parser.jay : Update accordingly.
30221 * class.cs (TypeContainer::FindMembers): For the case where we are searching
30222 for methods, don't forget to look into the operators too.
30223 (RegisterMethodBuilder): Helper method to take care of this for
30224 methods, constructors and operators.
30225 (Operator::Define): Completely revamp.
30226 (Operator.OperatorMethod, MethodName): New fields.
30227 (TypeContainer::Populate): Move the registering of builders into
30228 RegisterMethodBuilder.
30229 (Operator::Emit): Re-write.
30231 * expression.cs (Binary::Emit): Comment out code path to emit method
30232 invocation stuff for the case when we have a user defined operator. I am
30233 just not able to get it right !
30235 2001-09-17 Miguel de Icaza <miguel@ximian.com>
30237 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
30240 (Expression::MemberLookup): Provide a version that allows to
30241 specify the MemberTypes and BindingFlags.
30243 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
30244 so it was not fetching variable information from outer blocks.
30246 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
30247 Beforefieldinit as it was buggy.
30249 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
30250 that Ravi put here.
30252 * class.cs (Constructor::Emit): Only emit if block is not null.
30253 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
30254 deal with this by semantically definining it as if the user had
30257 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
30258 constructors as we now "emit" them at a higher level.
30260 (TypeContainer::DefineDefaultConstructor): Used to define the
30261 default constructors if none was provided.
30263 (ConstructorInitializer): Add methods Resolve and Emit.
30265 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
30267 2001-09-17 Ravi Pratap <ravi@ximian.com>
30269 * class.cs (TypeContainer::EmitDefaultConstructor): Register
30270 the default constructor builder with our hashtable for methodbuilders
30273 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
30274 and argument_count is 0 in which case we have a match.
30275 (Binary::ResolveOperator): More null checking and miscellaneous coding
30278 2001-09-17 Ravi Pratap <ravi@ximian.com>
30280 * rootcontext.cs (IsNameSpace): Compare against null.
30282 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
30284 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
30285 and Unary::Operator.
30287 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
30290 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
30291 we have overloaded operators.
30292 (Binary::ResolveOperator): Implement the part which does the operator overload
30295 * class.cs (Operator::Emit): Implement.
30296 (TypeContainer::Emit): Emit the operators we have too.
30298 * expression.cs (Binary::Emit): Update to emit the appropriate code for
30299 the case when we have a user-defined operator.
30301 2001-09-17 Miguel de Icaza <miguel@ximian.com>
30303 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
30305 2001-09-16 Ravi Pratap <ravi@ximian.com>
30307 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
30308 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
30309 (Constructor::Emit): Implement.
30310 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
30311 if we have no work to do.
30312 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
30315 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
30316 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
30318 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
30321 2001-09-15 Ravi Pratap <ravi@ximian.com>
30323 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
30325 (Tree::RecordNamespace): Method to do what the name says ;-)
30326 (Tree::Namespaces): Property to get at the namespaces hashtable.
30328 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
30331 * rootcontext.cs (IsNamespace): Fixed it :-)
30333 2001-09-14 Miguel de Icaza <miguel@ximian.com>
30335 * class.cs (TypeContainer::FindMembers): Add support for
30337 (MethodCore): New class that encapsulates both the shared aspects
30338 of a Constructor and a Method.
30339 (Method, Constructor): Factored pieces into MethodCore.
30341 * driver.cs: Added --fatal which makes errors throw exceptions.
30342 Load System assembly as well as part of the standard library.
30344 * report.cs: Allow throwing exceptions on errors for debugging.
30346 * modifiers.cs: Do not use `parent', instead use the real type
30347 container to evaluate permission settings.
30349 * class.cs: Put Ravi's patch back in. He is right, and we will
30350 have to cope with the
30352 2001-09-14 Ravi Pratap <ravi@ximian.com>
30354 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
30355 FamORAssem, not FamANDAssem.
30357 2001-09-14 Miguel de Icaza <miguel@ximian.com>
30359 * driver.cs: Added --parse option that only parses its input files
30362 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
30363 incorrect. IsTopLevel is not used to tell whether an object is
30364 root_types or not (that can be achieved by testing this ==
30365 root_types). But to see if this is a top-level *class* (not
30366 necessarly our "toplevel" container).
30368 2001-09-14 Ravi Pratap <ravi@ximian.com>
30370 * enum.cs (Enum::Define): Modify to call the Lookup method on the
30371 parent instead of a direct call to GetType.
30373 2001-09-14 Ravi Pratap <ravi@ximian.com>
30375 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
30376 Modifiers.TypeAttr. This should just be a call to that method.
30378 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
30379 object so that we can determine if we are top-level or not.
30381 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
30384 * enum.cs (Enum::Define): Ditto.
30386 * modifiers.cs (FieldAttr): Re-write.
30388 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
30389 (TypeContainer::HaveStaticConstructor): New property to provide access
30390 to precisely that info.
30392 * modifiers.cs (MethodAttr): Re-write.
30393 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
30395 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
30396 of top-level types as claimed.
30398 2001-09-13 Miguel de Icaza <miguel@ximian.com>
30400 * expression.cs (MemberLookup): Fruitless attempt to lookup
30401 constructors. Maybe I need to emit default constructors? That
30402 might be it (currently .NET emits this for me automatically).
30403 (Invocation::OverloadResolve): Cope with Arguments == null.
30404 (Invocation::EmitArguments): new function, shared by the new
30405 constructor and us.
30406 (Invocation::Emit): Handle static and instance methods. Emit
30407 proper call instruction for virtual or non-virtual invocations.
30408 (New::Emit): Implement.
30409 (New::Resolve): Implement.
30410 (MemberAccess:Resolve): Implement.
30411 (MethodGroupExpr::InstanceExpression): used conforming to the spec
30412 to track instances.
30413 (FieldExpr::Resolve): Set type.
30415 * support.cs: Handle empty arguments.
30417 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
30418 SimpleLookup): Auxiliary routines to help parse a qualifier
30421 Update qualifier_identifier rule.
30423 * codegen.cs: Removed debugging messages.
30425 * class.cs: Make this a global thing, this acts just as a "key" to
30426 objects that we might have around.
30428 (Populate): Only initialize method_builders_to_methods once.
30430 * expression.cs (PropertyExpr): Initialize type from the
30433 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
30434 Resolve pattern. Attempt to implicitly convert value to boolean.
30437 * expression.cs: Set the type for the int32/int32 argument case.
30438 (Binary::ResolveOperator): Set the return type to boolean for
30439 comparission operators
30441 * typemanager.cs: Remove debugging print code.
30443 (Invocation::Resolve): resolve type.
30445 * class.cs: Allocate a MemberInfo of the correct size, as the code
30446 elsewhere depends on the test to reflect the correct contents.
30448 (Method::) Keep track of parameters, due to System.Reflection holes
30450 (TypeContainer::Populate): Keep track of MethodBuilders to Method
30453 (TypeContainer::FindMembers): Use ArrayList and then copy an array
30454 of the exact size and return that.
30456 (Class::LookupMethodByBuilder): New function that maps
30457 MethodBuilders to its methods. Required to locate the information
30458 on methods because System.Reflection bit us again.
30460 * support.cs: New file, contains an interface ParameterData and
30461 two implementations: ReflectionParameters and InternalParameters
30462 used to access Parameter information. We will need to grow this
30465 * expression.cs (Invocation::GetParameterData): implement a cache
30466 and a wrapper around the ParameterData creation for methods.
30467 (Invocation::OverloadResolve): Use new code.
30469 2001-09-13 Ravi Pratap <ravi@ximian.com>
30471 * class.cs (TypeContainer::EmitField): Remove and move into
30472 (Field::Define): here and modify accordingly.
30473 (Field.FieldBuilder): New member.
30474 (TypeContainer::Populate): Update accordingly.
30475 (TypeContainer::FindMembers): Implement.
30477 2001-09-13 Miguel de Icaza <miguel@ximian.com>
30479 * statement.cs: (VariableInfo::VariableType): New field to be
30480 initialized with the full type once it is resolved.
30482 2001-09-12 Miguel de Icaza <miguel@ximian.com>
30484 * parameter.cs (GetParameterInfo): Use a type cache to compute
30485 things only once, and to reuse this information
30487 * expression.cs (LocalVariableReference::Emit): Implement.
30488 (OpcodeCast::Emit): fix.
30490 (ParameterReference::Resolve): Implement.
30491 (ParameterReference::Emit): Implement.
30493 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
30494 that are expressions need to stay as Expressions.
30496 * typemanager.cs (CSharpName): Returns the C# name of a type if
30499 * expression.cs (Expression::ConvertImplicit): New function that
30500 implements implicit type conversions.
30502 (Expression::ImplicitReferenceConversion): Implements implicit
30503 reference conversions.
30505 (EmptyCast): New type for transparent casts.
30507 (OpcodeCast): New type for casts of types that are performed with
30508 a sequence of bytecodes.
30510 (BoxedCast): New type used for casting value types into reference
30511 types. Emits a box opcode.
30513 (Binary::DoNumericPromotions): Implements numeric promotions of
30514 and computation of the Binary::Type.
30516 (Binary::EmitBranchable): Optimization.
30518 (Binary::Emit): Implement code emission for expressions.
30520 * typemanager.cs (TypeManager): Added two new core types: sbyte
30523 2001-09-12 Ravi Pratap <ravi@ximian.com>
30525 * class.cs (TypeContainer::FindMembers): Method which does exactly
30526 what Type.FindMembers does, only we don't have to use reflection. No
30527 implementation yet.
30529 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
30530 typecontainer objects as we need to get at them.
30531 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
30533 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
30534 typecontainer object.
30536 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
30537 of just a Report object.
30539 2001-09-11 Ravi Pratap <ravi@ximian.com>
30541 * class.cs (Event::Define): Go back to using the prefixes "add_" and
30543 (TypeContainer::Populate): Now define the delegates of the type too.
30544 (TypeContainer.Delegates): Property to access the list of delegates defined
30547 * delegates.cs (Delegate::Define): Implement partially.
30549 * modifiers.cs (TypeAttr): Handle more flags.
30551 2001-09-11 Ravi Pratap <ravi@ximian.com>
30553 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
30555 (Operator::Define): Re-write logic to get types by using the LookupType method
30556 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
30557 (Indexer::Define): Ditto.
30558 (Event::Define): Ditto.
30559 (Property::Define): Ditto.
30561 2001-09-10 Ravi Pratap <ravi@ximian.com>
30563 * class.cs (TypeContainer::Populate): Now define operators too.
30564 (TypeContainer.Operators): New property to access the list of operators
30566 (Operator.OperatorMethodBuilder): New member to hold the method builder
30567 for the operator we are defining.
30568 (Operator::Define): Implement.
30570 2001-09-10 Ravi Pratap <ravi@ximian.com>
30572 * class.cs (Event::Define): Make the prefixes of the accessor methods
30573 addOn_ and removeOn_
30575 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
30576 of the location being passed in too. Ideally, this should go later since all
30577 error reporting should be done through the Report object.
30579 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
30580 (Populate): Iterate thru the indexers we have and define them too.
30581 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
30582 for the get and set accessors.
30583 (Indexer::Define): Implement.
30585 2001-09-09 Miguel de Icaza <miguel@ximian.com>
30587 * expression.cs (Binary::Resolve): Beginning of it. I scratched
30588 my previous implementation, did not work.
30590 * typemanager.cs: Add a couple of missing types (the longs).
30592 * literal.cs: Use TypeManager.bool_type instead of getting it.
30594 * expression.cs (EventExpr): New kind of expressions.
30595 (Expressio::ExprClassFromMemberInfo): finish
30597 2001-09-08 Miguel de Icaza <miguel@ximian.com>
30599 * assign.cs: Emit stores to static fields differently.
30601 2001-09-08 Ravi Pratap <ravi@ximian.com>
30603 * Merge in changes and adjust code to tackle conflicts. Backed out my
30604 code in Assign::Resolve ;-)
30606 2001-09-08 Ravi Pratap <ravi@ximian.com>
30608 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
30609 instead Report.Error and also pass in the location.
30610 (CSharpParser::Lexer): New readonly property to return the reference
30611 to the Tokenizer object.
30612 (declare_local_variables): Use Report.Error with location instead of plain
30616 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
30617 (Operator.CheckBinaryOperator): Ditto.
30619 * cs-parser.jay (operator_declarator): Update accordingly.
30621 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
30622 (CheckBinaryOperator): Same here.
30624 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
30625 on the name without any prefixes of namespace names etc. This is because we
30626 already might have something already fully qualified like
30627 'System.Console.WriteLine'
30629 * assign.cs (Resolve): Begin implementation. Stuck ;-)
30631 2001-09-07 Ravi Pratap <ravi@ximian.com>
30633 * cs-tokenizer.cs (location): Return a string which also contains
30636 * expression.cs (ElementAccess): New class for expressions of the
30637 type 'element access.'
30638 (BaseAccess): New class for expressions of the type 'base access.'
30639 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
30642 * cs-parser.jay (element_access): Implement action.
30643 (base_access): Implement actions.
30644 (checked_expression, unchecked_expression): Implement.
30646 * cs-parser.jay (local_variable_type): Correct and implement.
30647 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
30649 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
30651 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
30652 name and the specifiers.
30654 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
30656 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
30657 making them all public ;-)
30659 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
30662 2001-09-07 Miguel de Icaza <miguel@ximian.com>
30664 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
30666 (FieldExpr, PropertyExprs): New resolved expressions.
30667 (SimpleName::MemberStaticCheck): Perform static checks for access
30668 to non-static fields on static methods. Maybe this should be
30669 generalized for MemberAccesses.
30670 (SimpleName::ResolveSimpleName): More work on simple name
30673 * cs-parser.jay (primary_expression/qualified_identifier): track
30674 the parameter index.
30676 * codegen.cs (CodeGen::Save): Catch save exception, report error.
30677 (EmitContext::EmitBoolExpression): Chain to expression generation
30678 instead of temporary hack.
30679 (::EmitStatementExpression): Put generic expression code generation.
30681 * assign.cs (Assign::Emit): Implement variable assignments to
30682 local variables, parameters and fields.
30684 2001-09-06 Miguel de Icaza <miguel@ximian.com>
30686 * statement.cs (Block::GetVariableInfo): New method, returns the
30687 VariableInfo for a variable name in a block.
30688 (Block::GetVariableType): Implement in terms of GetVariableInfo
30690 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
30691 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
30693 2001-09-06 Ravi Pratap <ravi@ximian.com>
30695 * cs-parser.jay (operator_declaration): Continue on my quest : update
30696 to take attributes argument.
30697 (event_declaration): Ditto.
30698 (enum_declaration): Ditto.
30699 (indexer_declaration): Ditto.
30701 * class.cs (Operator::Operator): Update constructor accordingly.
30702 (Event::Event): Ditto.
30704 * delegate.cs (Delegate::Delegate): Same here.
30706 * enum.cs (Enum::Enum): Same here.
30708 2001-09-05 Ravi Pratap <ravi@ximian.com>
30710 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
30712 * ../tests/cs0658.cs : New file to demonstrate error 0658.
30714 * attribute.cs (Attributes): New class to encapsulate all attributes which were
30715 being passed around as an arraylist.
30716 (Attributes::AddAttribute): Method to add attribute sections.
30718 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
30719 (struct_declaration): Update accordingly.
30720 (constant_declaration): Update.
30721 (field_declaration): Update.
30722 (method_header): Update.
30723 (fixed_parameter): Update.
30724 (parameter_array): Ditto.
30725 (property_declaration): Ditto.
30726 (destructor_declaration): Ditto.
30728 * class.cs (Struct::Struct): Update constructors accordingly.
30729 (Class::Class): Ditto.
30730 (Field::Field): Ditto.
30731 (Method::Method): Ditto.
30732 (Property::Property): Ditto.
30733 (TypeContainer::OptAttribute): update property's return type.
30735 * interface.cs (Interface.opt_attributes): New member.
30736 (Interface::Interface): Update to take the extra Attributes argument.
30738 * parameter.cs (Parameter::Parameter): Ditto.
30740 * constant.cs (Constant::Constant): Ditto.
30742 * interface.cs (InterfaceMemberBase): New OptAttributes field.
30743 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
30744 the attributes as a parameter.
30745 (InterfaceProperty): Update constructor call.
30746 (InterfaceEvent): Ditto.
30747 (InterfaceMethod): Ditto.
30748 (InterfaceIndexer): Ditto.
30750 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
30751 pass the attributes too.
30752 (interface_event_declaration): Ditto.
30753 (interface_property_declaration): Ditto.
30754 (interface_method_declaration): Ditto.
30755 (interface_declaration): Ditto.
30757 2001-09-05 Miguel de Icaza <miguel@ximian.com>
30759 * class.cs (Method::Define): Track the "static Main" definition to
30760 create an entry point.
30762 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
30763 EntryPoint if we find it.
30765 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
30766 (EmitContext::ig): Make this variable public.
30768 * driver.cs: Make the default output file be the first file name
30769 with the .exe extension.
30771 Detect empty compilations
30773 Handle various kinds of output targets. Handle --target and
30774 rename -t to --dumper.
30776 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
30777 methods inherited from Expression return now an Expression. This
30778 will is used during the tree rewriting as we resolve them during
30781 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
30782 the spec. Missing entirely is the information about
30783 accessability of elements of it.
30785 (Expression::ExprClassFromMemberInfo): New constructor for
30786 Expressions that creates a fully initialized Expression based on
30787 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
30790 (Invocation::Resolve): Begin implementing resolution of invocations.
30792 * literal.cs (StringLiteral): Implement Emit.
30794 2001-09-05 Ravi Pratap <ravi@ximian.com>
30796 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
30799 2001-09-04 Ravi Pratap <ravi@ximian.com>
30801 * cs-parser.jay (attribute_arguments): Implement actions.
30802 (attribute): Fix bug in production. Implement action.
30803 (attribute_list): Implement.
30804 (attribute_target): Implement.
30805 (attribute_target_specifier, opt_target_specifier): Implement
30806 (CheckAttributeTarget): New method to check if the attribute target
30808 (attribute_section): Implement.
30809 (opt_attributes): Implement.
30811 * attribute.cs : New file to handle attributes.
30812 (Attribute): Class to hold attribute info.
30814 * cs-parser.jay (opt_attribute_target_specifier): Remove production
30815 (attribute_section): Modify production to use 2 different rules to
30816 achieve the same thing. 1 s/r conflict down !
30817 Clean out commented, useless, non-reducing dimension_separator rules.
30819 * class.cs (TypeContainer.attributes): New member to hold list
30820 of attributes for a type.
30821 (Struct::Struct): Modify to take one more argument, the attribute list.
30822 (Class::Class): Ditto.
30823 (Field::Field): Ditto.
30824 (Method::Method): Ditto.
30825 (Property::Property): Ditto.
30827 * cs-parser.jay (struct_declaration): Update constructor call to
30828 pass in the attributes too.
30829 (class_declaration): Ditto.
30830 (constant_declaration): Ditto.
30831 (field_declaration): Ditto.
30832 (method_header): Ditto.
30833 (fixed_parameter): Ditto.
30834 (parameter_array): Ditto.
30835 (property_declaration): Ditto.
30837 * constant.cs (Constant::Constant): Update constructor similarly.
30838 Use System.Collections.
30840 * parameter.cs (Parameter::Parameter): Update as above.
30842 2001-09-02 Ravi Pratap <ravi@ximian.com>
30844 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
30845 (TypeContainer.delegates): New member to hold list of delegates.
30847 * cs-parser.jay (delegate_declaration): Implement the action correctly
30848 this time as I seem to be on crack ;-)
30850 2001-09-02 Miguel de Icaza <miguel@ximian.com>
30852 * rootcontext.cs (RootContext::IsNamespace): new function, used to
30853 tell whether an identifier represents a namespace.
30855 * expression.cs (NamespaceExpr): A namespace expression, used only
30856 temporarly during expression resolution.
30857 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
30858 utility functions to resolve names on expressions.
30860 2001-09-01 Miguel de Icaza <miguel@ximian.com>
30862 * codegen.cs: Add hook for StatementExpressions.
30864 * class.cs: Fix inverted test for static flag in methods.
30866 2001-09-02 Ravi Pratap <ravi@ximian.com>
30868 * class.cs (Operator::CheckUnaryOperator): Correct error number used
30869 to make it coincide with MS' number.
30870 (Operator::CheckBinaryOperator): Ditto.
30872 * ../errors/errors.txt : Remove error numbers added earlier.
30874 * ../errors/cs1019.cs : Test case for error # 1019
30876 * ../errros/cs1020.cs : Test case for error # 1020
30878 * cs-parser.jay : Clean out commented cruft.
30879 (dimension_separators, dimension_separator): Comment out. Ostensibly not
30880 used anywhere - non-reducing rule.
30881 (namespace_declarations): Non-reducing rule - comment out.
30883 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
30884 with TypeContainer::AddEnum.
30886 * delegate.cs : New file for delegate handling classes.
30887 (Delegate): Class for declaring delegates.
30889 * makefile : Update.
30891 * cs-parser.jay (delegate_declaration): Implement.
30893 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
30895 * class.cs (Event::Define): Implement.
30896 (Event.EventBuilder): New member.
30898 * class.cs (TypeContainer::Populate): Update to define all enums and events
30900 (Events): New property for the events arraylist we hold. Shouldn't we move to using
30901 readonly fields for all these cases ?
30903 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
30905 * class.cs (Property): Revamp to use the convention of making fields readonly.
30906 Accordingly modify code elsewhere.
30908 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
30909 the Define method of the Property class.
30911 * class.cs : Clean up applied patch and update references to variables etc. Fix
30913 (TypeContainer::Populate): Update to define all the properties we have. Also
30914 define all enumerations.
30916 * enum.cs (Define): Implement.
30918 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
30920 * cs-parser.jay (overloadable_operator): The semantic value is an
30921 enum of the Operator class.
30922 (operator_declarator): Implement actions.
30923 (operator_declaration): Implement.
30925 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
30926 validity of definitions.
30927 (Operator::CheckBinaryOperator): Static method to check for binary operators
30928 (TypeContainer::AddOperator): New method to add an operator to a type.
30930 * cs-parser.jay (indexer_declaration): Added line to actually call the
30931 AddIndexer method so it gets added ;-)
30933 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
30934 already taken care of by the MS compiler ?
30936 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
30938 * class.cs (Operator): New class for operator declarations.
30939 (Operator::OpType): Enum for the various operators.
30941 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
30943 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
30944 ostensibly handle this in semantic analysis.
30946 * cs-parser.jay (general_catch_clause): Comment out
30947 (specific_catch_clauses, specific_catch_clause): Ditto.
30948 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
30949 (catch_args, opt_catch_args): New productions.
30950 (catch_clause): Rewrite to use the new productions above
30951 (catch_clauses): Modify accordingly.
30952 (opt_catch_clauses): New production to use in try_statement
30953 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
30954 and re-write the code in the actions to extract the specific and
30955 general catch clauses by being a little smart ;-)
30957 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
30958 Hooray, try and catch statements parse fine !
30960 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30962 * statement.cs (Block::GetVariableType): Fix logic to extract the type
30963 string from the hashtable of variables.
30965 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
30966 I end up making that mistake ;-)
30967 (catch_clauses): Fixed gross error which made Key and Value of the
30968 DictionaryEntry the same : $1 !!
30970 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30972 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
30974 * cs-parser.jay (event_declaration): Correct to remove the semicolon
30975 when the add and remove accessors are specified.
30977 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30979 * cs-parser.jay (IndexerDeclaration): New helper class to hold
30980 information about indexer_declarator.
30981 (indexer_declarator): Implement actions.
30982 (parsing_indexer): New local boolean used to keep track of whether
30983 we are parsing indexers or properties. This is necessary because
30984 implicit_parameters come into picture even for the get accessor in the
30985 case of an indexer.
30986 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
30988 * class.cs (Indexer): New class for indexer declarations.
30989 (TypeContainer::AddIndexer): New method to add an indexer to a type.
30990 (TypeContainer::indexers): New member to hold list of indexers for the
30993 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
30995 * cs-parser.jay (add_accessor_declaration): Implement action.
30996 (remove_accessor_declaration): Implement action.
30997 (event_accessors_declaration): Implement
30998 (variable_declarators): swap statements for first rule - trivial.
31000 * class.cs (Event): New class to hold information about event
31002 (TypeContainer::AddEvent): New method to add an event to a type
31003 (TypeContainer::events): New member to hold list of events.
31005 * cs-parser.jay (event_declaration): Implement actions.
31007 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
31009 * cs-parser.jay (dim_separators): Implement. Make it a string
31010 concatenating all the commas together, just as they appear.
31011 (opt_dim_separators): Modify accordingly
31012 (rank_specifiers): Update accordingly. Basically do the same
31013 thing - instead, collect the brackets here.
31014 (opt_rank_sepcifiers): Modify accordingly.
31015 (array_type): Modify to actually return the complete type string
31016 instead of ignoring the rank_specifiers.
31017 (expression_list): Implement to collect the expressions
31018 (variable_initializer): Implement. We make it a list of expressions
31019 essentially so that we can handle the array_initializer case neatly too.
31020 (variable_initializer_list): Implement.
31021 (array_initializer): Make it a list of variable_initializers
31022 (opt_array_initializer): Modify accordingly.
31024 * expression.cs (New::NType): Add enumeration to help us
31025 keep track of whether we have an object/delegate creation
31026 or an array creation.
31027 (New:NewType, New::Rank, New::Indices, New::Initializers): New
31028 members to hold data about array creation.
31029 (New:New): Modify to update NewType
31030 (New:New): New Overloaded contructor for the array creation
31033 * cs-parser.jay (array_creation_expression): Implement to call
31034 the overloaded New constructor.
31036 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
31038 * class.cs (TypeContainer::Constructors): Return member
31039 constructors instead of returning null.
31041 2001-08-26 Miguel de Icaza <miguel@ximian.com>
31043 * typemanager.cs (InitCoreTypes): Initialize the various core
31044 types after we have populated the type manager with the user
31045 defined types (this distinction will be important later while
31046 compiling corlib.dll)
31048 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
31049 on Expression Classification. Now all expressions have a method
31050 `Resolve' and a method `Emit'.
31052 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
31053 generation from working. Also add some temporary debugging
31056 2001-08-24 Miguel de Icaza <miguel@ximian.com>
31058 * codegen.cs: Lots of code generation pieces. This is only the
31059 beginning, will continue tomorrow with more touches of polish. We
31060 handle the fundamentals of if, while, do, for, return. Others are
31061 trickier and I need to start working on invocations soon.
31063 * gen-treedump.cs: Bug fix, use s.Increment here instead of
31066 * codegen.cs (EmitContext): New struct, used during code
31067 emission to keep a context. Most of the code generation will be
31070 * cs-parser.jay: Add embedded blocks to the list of statements of
31071 this block. So code generation proceeds in a top down fashion.
31073 2001-08-23 Miguel de Icaza <miguel@ximian.com>
31075 * statement.cs: Add support for multiple child blocks.
31077 2001-08-22 Miguel de Icaza <miguel@ximian.com>
31079 * codegen.cs (EmitCode): New function, will emit the code for a
31080 Block of code given a TypeContainer and its ILGenerator.
31082 * statement.cs (Block): Standard public readonly optimization.
31083 (Block::Block constructors): Link children.
31084 (Block::Child): Child Linker.
31085 (Block::EmitVariables): Emits IL variable declarations.
31087 * class.cs: Drop support for MethodGroups here, delay until
31089 (Method::): Applied the same simplification that I did before, and
31090 move from Properties to public readonly fields.
31091 (Method::ParameterTypes): Returns the parameter types for the
31092 function, and implements a cache that will be useful later when I
31093 do error checking and the semantic analysis on the methods is
31095 (Constructor::GetCallingConvention): Renamed from CallingConvetion
31096 and made a method, optional argument tells whether this is a class
31097 or a structure to apply the `has-this' bit.
31098 (Method::GetCallingConvention): Implement, returns the calling
31100 (Method::Define): Defines the type, a second pass is performed
31101 later to populate the methods.
31103 (Constructor::ParameterTypes): implement a cache similar to the
31104 one on Method::ParameterTypes, useful later when we do semantic
31107 (TypeContainer::EmitMethod): New method. Emits methods.
31109 * expression.cs: Removed MethodGroup class from here.
31111 * parameter.cs (Parameters::GetCallingConvention): new method.
31113 2001-08-21 Miguel de Icaza <miguel@ximian.com>
31115 * class.cs (TypeContainer::Populate): Drop RootContext from the
31118 (Constructor::CallingConvention): Returns the calling convention.
31119 (Constructor::ParameterTypes): Returns the constructor parameter
31122 (TypeContainer::AddConstructor): Keep track of default constructor
31123 and the default static constructor.
31125 (Constructor::) Another class that starts using `public readonly'
31126 instead of properties.
31128 (Constructor::IsDefault): Whether this is a default constructor.
31130 (Field::) use readonly public fields instead of properties also.
31132 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
31133 track of static constructors; If none is used, turn on
31134 BeforeFieldInit in the TypeAttributes.
31136 * cs-parser.jay (opt_argument_list): now the return can be null
31137 for the cases where there are no arguments.
31139 (constructor_declarator): If there is no implicit `base' or
31140 `this', then invoke the default parent constructor.
31142 * modifiers.cs (MethodAttr): New static function maps a set of
31143 modifiers flags into a MethodAttributes enum
31144 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
31145 MethodAttr, TypeAttr to represent the various mappings where the
31146 modifiers are used.
31147 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
31149 2001-08-19 Miguel de Icaza <miguel@ximian.com>
31151 * parameter.cs (GetParameterInfo): Fix bug where there would be no
31154 * interface.cs (PopulateIndexer): Implemented the code generator
31155 for interface indexers.
31157 2001-08-17 Miguel de Icaza <miguel@ximian.com>
31159 * interface.cs (InterfaceMemberBase): Now we track the new status
31162 (PopulateProperty): Implement property population. Woohoo! Got
31163 Methods and Properties going today.
31165 Removed all the properties for interfaces, and replaced them with
31166 `public readonly' fields.
31168 2001-08-16 Miguel de Icaza <miguel@ximian.com>
31170 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
31171 initialize their hashtables/arraylists only when they are needed
31172 instead of doing this always.
31174 * parameter.cs: Handle refs and out parameters.
31176 * cs-parser.jay: Use an ArrayList to construct the arguments
31177 instead of the ParameterCollection, and then cast that to a
31180 * parameter.cs: Drop the use of ParameterCollection and use
31181 instead arrays of Parameters.
31183 (GetParameterInfo): Use the Type, not the Name when resolving
31186 2001-08-13 Miguel de Icaza <miguel@ximian.com>
31188 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
31189 and instead use public readonly fields.
31191 * class.cs: Put back walking code for type containers.
31193 2001-08-11 Miguel de Icaza <miguel@ximian.com>
31195 * class.cs (MakeConstant): Code to define constants.
31197 * rootcontext.cs (LookupType): New function. Used to locate types
31200 2001-08-08 Miguel de Icaza <miguel@ximian.com>
31202 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
31203 this System.Reflection code is. Kudos to Microsoft
31205 * typemanager.cs: Implement a type cache and avoid loading all
31206 types at boot time. Wrap in LookupType the internals. This made
31207 the compiler so much faster. Wow. I rule!
31209 * driver.cs: Make sure we always load mscorlib first (for
31210 debugging purposes, nothing really important).
31212 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
31213 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
31215 * rootcontext.cs: Lookup types on their namespace; Lookup types
31216 on namespaces that have been imported using the `using' keyword.
31218 * class.cs (TypeContainer::TypeAttr): Virtualize.
31219 (Class::TypeAttr): Return attributes suitable for this bad boy.
31220 (Struct::TypeAttr): ditto.
31221 Handle nested classes.
31222 (TypeContainer::) Remove all the type visiting code, it is now
31223 replaced with the rootcontext.cs code
31225 * rootcontext.cs (GetClassBases): Added support for structs.
31227 2001-08-06 Miguel de Icaza <miguel@ximian.com>
31229 * interface.cs, statement.cs, class.cs, parameter.cs,
31230 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
31231 Drop use of TypeRefs, and use strings instead.
31233 2001-08-04 Miguel de Icaza <miguel@ximian.com>
31237 * class.cs (Struct::Struct): set the SEALED flags after
31238 checking the modifiers.
31239 (TypeContainer::TypeAttr): new property, returns the
31240 TypeAttributes for a class.
31242 * cs-parser.jay (type_list): Oops, list production was creating a
31243 new list of base types.
31245 * rootcontext.cs (StdLib): New property.
31246 (GetInterfaceTypeByName): returns an interface by type name, and
31247 encapsulates error handling here.
31248 (GetInterfaces): simplified.
31249 (ResolveTree): Encapsulated all the tree resolution here.
31250 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
31253 * driver.cs: Add support for --nostdlib, to avoid loading the
31254 default assemblies.
31255 (Main): Do not put tree resolution here.
31257 * rootcontext.cs: Beginning of the class resolution.
31259 2001-08-03 Miguel de Icaza <miguel@ximian.com>
31261 * rootcontext.cs: Provide better error reporting.
31263 * cs-parser.jay (interface_base): set our $$ to be interfaces.
31265 * rootcontext.cs (CreateInterface): Handle the case where there
31266 are no parent interfaces.
31268 (CloseTypes): Routine to flush types at the end.
31269 (CreateInterface): Track types.
31270 (GetInterfaces): Returns an array of Types from the list of
31271 defined interfaces.
31273 * typemanager.c (AddUserType): Mechanism to track user types (puts
31274 the type on the global type hash, and allows us to close it at the
31277 2001-08-02 Miguel de Icaza <miguel@ximian.com>
31279 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
31280 RecordInterface instead.
31282 * cs-parser.jay: Updated to reflect changes above.
31284 * decl.cs (Definition): Keep track of the TypeBuilder type that
31285 represents this type here. Not sure we will use it in the long
31286 run, but wont hurt for now.
31288 * driver.cs: Smaller changes to accomodate the new code.
31290 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
31293 * rootcontext.cs (CreateInterface): New method, used to create
31294 the System.TypeBuilder type for interfaces.
31295 (ResolveInterfaces): new entry point to resolve the interface
31297 (CodeGen): Property, used to keep track of the code generator.
31299 2001-07-26 Miguel de Icaza <miguel@ximian.com>
31301 * cs-parser.jay: Add a second production for delegate_declaration
31304 (enum_body): Put an opt_comma here instead of putting it on
31305 enum_body or enum_member_declarations so we can handle trailing
31306 commas on enumeration members. Gets rid of a shift/reduce.
31308 (type_list): Need a COMMA in the middle.
31310 (indexer_declaration): Tell tokenizer to recognize get/set
31312 * Remove old targets.
31314 * Re-add the parser target.
31316 2001-07-13 Simon Cozens <simon@simon-cozens.org>
31318 * cs-parser.jay: Add precendence rules for a number of operators
31319 ot reduce the number of shift/reduce conflicts in the grammar.
31321 2001-07-17 Miguel de Icaza <miguel@ximian.com>
31323 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
31326 Get rid of old crufty code.
31328 * rootcontext.cs: Use this to keep track of the parsed
31329 representation and the defined types available to the program.
31331 * gen-treedump.cs: adjust for new convention.
31333 * type.cs: Split out the type manager, and the assembly builder
31336 * typemanager.cs: the type manager will live here now.
31338 * cil-codegen.cs: And the code generator here.
31340 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
31342 * makefile: Fixed up for easy making.
31344 2001-07-13 Simon Cozens <simon@simon-cozens.org>
31346 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
31349 (unary_expression): Expand pre_increment_expression and
31350 post_decrement_expression to reduce a shift/reduce.
31352 2001-07-11 Simon Cozens
31354 * cs-tokenizer.cs: Hex numbers should begin with a 0.
31356 Improve allow_keyword_as_indent name.
31358 2001-06-19 Miguel de Icaza <miguel@ximian.com>
31360 * Adjustments for Beta2.
31362 2001-06-13 Miguel de Icaza <miguel@ximian.com>
31364 * decl.cs: Added `Define' abstract method.
31365 (InTransit): new property, used to catch recursive definitions.
31367 * interface.cs: Implement `Define'.
31369 * modifiers.cs: Map Modifiers.constants to
31370 System.Reflection.TypeAttribute flags.
31372 * class.cs: Keep track of types and user-defined types.
31373 (BuilderInit): New method for creating an assembly
31374 (ResolveType): New function to launch the resolution process, only
31375 used by interfaces for now.
31377 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
31378 that are inserted into the name space.
31380 2001-06-08 Miguel de Icaza <miguel@ximian.com>
31382 * ARGH. I have screwed up my tree so many times due to the use of
31383 rsync rather than using CVS. Going to fix this at once.
31385 * driver.cs: Objetify driver. Load assemblies, use assemblies to
31388 2001-06-07 Miguel de Icaza <miguel@ximian.com>
31390 * Experiment successful: Use System.Type rather that our own
31393 2001-05-25 Miguel de Icaza <miguel@ximian.com>
31395 * cs-parser.jay: Removed nsAliases from here.
31397 Use new namespaces, handle `using XXX;'
31399 * namespace.cs: Reimplemented namespace handling, use a recursive
31400 definition of the class. Now we can keep track of using clauses
31401 and catch invalid using clauses.
31403 2001-05-24 Miguel de Icaza <miguel@ximian.com>
31405 * gen-treedump.cs: Adapted for all the renaming.
31407 * expression.cs (Expression): this class now has a Type property
31408 which returns an expression Type.
31410 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
31411 `Type', as this has a different meaning now in the base
31413 2001-05-22 Miguel de Icaza <miguel@ximian.com>
31415 * interface.cs, class.cs: Removed from all the sources the
31416 references to signature computation, as we can not do method
31417 signature computation during the parsing time, as we are not
31418 trying to solve at that point distinguishing:
31422 void a (NS.Blah x) {}
31425 Which depending on the context might be valid or not, as we do not
31426 know if Blah is the same thing as NS.Blah at that point.
31428 * Redid everything so the code uses TypeRefs now instead of
31429 Types. TypeRefs are just temporary type placeholders, that need
31430 to be resolved. They initially have a pointer to a string and the
31431 current scope in which they are used. This is used later by the
31432 compiler to resolve the reference to an actual Type.
31434 * DeclSpace is no longer a CIR.Type, and neither are
31435 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
31436 are all DeclSpaces, but no Types.
31438 * type.cs (TypeRefManager): This implements the TypeRef manager,
31439 which keeps track of all the types that need to be resolved after
31440 the parsing has finished.
31442 2001-05-13 Miguel de Icaza <miguel@ximian.com>
31444 * ARGH. We are going to have to store `foreach' as a class rather
31445 than resolving it, as we need to verify error 1579 after name
31446 resolution. *OR* we could keep a flag that says `This request to
31447 IEnumerator comes from a foreach statement' which we can then use
31448 to generate the error.
31450 2001-05-10 Miguel de Icaza <miguel@ximian.com>
31452 * class.cs (TypeContainer.AddMethod): we now add methods to the
31453 MethodGroup instead of the method hashtable.
31455 * expression.cs: Add MethodGroup abstraction, which gets us one
31456 step closer to the specification in the way we handle method
31459 * cs-parser.jay (primary_expression): qualified_identifier now
31460 tried to match up an identifier to a local variable reference or
31461 to a parameter reference.
31463 current_local_parameters is now a parser global variable that
31464 points to the current parameters for the block, used during name
31467 (property_declaration): Now creates an implicit `value' argument to
31470 2001-05-09 Miguel de Icaza <miguel@ximian.com>
31472 * parameter.cs: Do not use `param' arguments as part of the
31473 signature, per the spec.
31475 2001-05-08 Miguel de Icaza <miguel@ximian.com>
31477 * decl.cs: Base class for classes, structs and interfaces. This
31478 is the "Declaration Space"
31480 * cs-parser.jay: Use CheckDef for checking declaration errors
31481 instead of having one on each function.
31483 * class.cs: Factor out some code for handling error handling in
31484 accordance to the "Declarations" section in the "Basic Concepts"
31485 chapter in the ECMA C# spec.
31487 * interface.cs: Make all interface member classes derive from
31488 InterfaceMemberBase.
31490 2001-05-07 Miguel de Icaza <miguel@ximian.com>
31492 * Many things: all interfaces are parsed and generated in
31493 gen-treedump. Support for member variables, constructors,
31494 destructors, properties, constants is there.
31496 Beginning of the IL backend, but very little done, just there for
31499 2001-04-29 Miguel de Icaza <miguel@ximian.com>
31501 * cs-parser.jay: Fix labeled statement.
31503 * cs-tokenizer.cs (escape): Escape " and ' always.
31504 ref_line, ref_name: keep track of the line/filename as instructed
31505 by #line by the compiler.
31508 2001-04-27 Miguel de Icaza <miguel@ximian.com>
31510 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
31511 to match the values in System.CodeDOM.
31513 Divid renamed to Divide.
31515 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
31517 (Statements.set): remove.
31519 * System.CodeDOM/CodeCatchClause.cs: always have a valid
31522 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
31523 falseStatements always have valid values.
31525 * cs-parser.jay: Use System.CodeDOM now.