1 2009-01-16 Marek Safar <marek.safar@gmail.com>
3 * nullable.cs (LiftedBinaryOperator): Check for all possible null
6 2009-01-15 Marek Safar <marek.safar@gmail.com>
9 * statement.cs: Add reference for nested storey when only this
12 2009-01-15 Marek Safar <marek.safar@gmail.com>
15 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
18 2009-01-15 Marek Safar <marek.safar@gmail.com>
20 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
21 Fixed nested stories parent referencing process. Also fixes #463985.
23 2009-01-06 Marek Safar <marek.safar@gmail.com>
25 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
26 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
27 implementation. Also fixes #463108.
29 2009-01-05 Marek Safar <marek.safar@gmail.com>
32 * decl.cs: Issue correct CLSAttribute warning location.
34 2009-01-05 Marek Safar <marek.safar@gmail.com>
37 * attribute.cs: Use attribute owner scope when resolving attribute
40 2009-01-05 Marek Safar <marek.safar@gmail.com>
43 * decl.cs: Fixed incorrect member declaring type comparison.
45 2009-01-05 Marek Safar <marek.safar@gmail.com>
48 * driver.cs: Handle /RES resources as embeddable.
50 2009-01-05 Marek Safar <marek.safar@gmail.com>
53 * ecore.cs: Report inacessible members upwards.
55 2009-01-05 Marek Safar <marek.safar@gmail.com>
57 A fix for bug #463190, #463192
58 * decl.cs, namespace.cs: Also import internal extension classes.
60 2009-01-04 Marek Safar <marek.safar@gmail.com>
63 * generic.cs: Use right index for RemoveDependentTypes.
65 2009-01-02 Marek Safar <marek.safar@gmail.com>
68 * expression.cs: Fixed enum to null comparison.
70 2009-01-02 Marek Safar <marek.safar@gmail.com>
73 * nullable.cs: Fixed nullable user equality operator comparison.
75 2009-01-02 Marek Safar <marek.safar@gmail.com>
78 * class.cs, decl.cs: Use full explicit name when defining automatic
79 property backing field.
81 2009-01-02 Marek Safar <marek.safar@gmail.com>
84 * pending.cs: Emit type arguments for generic proxy method.
86 2008-12-30 Marek Safar <marek.safar@gmail.com>
88 * expression.cs (As): Mutate all type arguments.
90 2008-12-29 Marek Safar <marek.safar@gmail.com>
93 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
96 2008-12-29 Marek Safar <marek.safar@gmail.com>
99 * ecore.cs: Consider more variables of form V.I to be fixed.
101 2008-12-29 Marek Safar <marek.safar@gmail.com>
103 A fix for bug #460712
104 * typemanager.cs: Core types could be imported.
106 2008-12-28 Marek Safar <marek.safar@gmail.com>
108 A fix for bugs #460847, #460772, #458049, #457339, #447807
109 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
110 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
111 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
112 user lambdas used inside query clauses.
114 2008-12-18 Marek Safar <marek.safar@gmail.com>
116 A fix for bug #460229
117 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
119 2008-12-18 Marek Safar <marek.safar@gmail.com>
121 A fix for bug #459952
122 * decl.cs, namespace.cs: Use common CheckAccessLevel.
124 2008-12-18 Marek Safar <marek.safar@gmail.com>
126 A fix for bug #459630
127 * convert.cs: Enum to valuetype conversion is not allowed.
129 2008-12-18 Marek Safar <marek.safar@gmail.com>
131 A fix for bug #457087
132 * generic.cs: Don't crash when constraint comes from type
135 2008-12-16 Marek Safar <marek.safar@gmail.com>
137 A fix for bug #459221
138 * anonymous.cs, statement.cs: Delay only captured this
141 2008-12-12 Marek Safar <marek.safar@gmail.com>
143 A fix for bug #457489
144 * anonymous.cs, statement.cs: Split anonymous storey instantiation
145 and initialization to capture scope initializers correctly.
147 2008-12-11 Marek Safar <marek.safar@gmail.com>
149 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
150 ParameterReference refactoring.
152 2008-12-03 Marek Safar <marek.safar@gmail.com>
154 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
155 to be imported from any assembly.
157 2008-12-03 Marek Safar <marek.safar@gmail.com>
159 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
160 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
161 from anonymous method and lambda expression.
163 2008-12-01 Marek Safar <marek.safar@gmail.com>
165 A fix for bug #448560
166 * expression.cs (As): Box any generic type arguments to be
169 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
171 Add tripwire for implicit conversion bugs
172 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
174 (MethodGroupExpr.OverloadResolve): Add sanity check between
175 IsApplicable and VerifyArgumentsCompat.
176 (VerifyArgumentsCompat): Report CS1501 where appropriate.
178 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
180 Fix build break in System.Data_test
181 * convert.cs (ImplicitConversionExists): Move NullLiteral
183 (ImplicitStandardConversionExists): ... here.
185 2008-11-28 Marek Safar <marek.safar@gmail.com>
187 * literal.cs: Emit correctly explicit null to nullable cast.
189 2008-11-28 Marek Safar <marek.safar@gmail.com>
191 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
194 2008-11-28 Marek Safar <marek.safar@gmail.com>
196 A fix for bug #449005
197 * convert.cs, nullable.cs: Use only one implicit nullable
200 2008-11-27 Marek Safar <marek.safar@gmail.com>
202 * convert.cs, literal.cs: More Convert cleanup is needed.
204 2008-11-27 Marek Safar <marek.safar@gmail.com>
206 * decl.cs, class.cs: Fixed misleading error message.
208 2008-11-26 Marek Safar <marek.safar@gmail.com>
210 A fix for bug #449005
211 * nullable.cs (EmitEquality): Disable optimization for user operator
214 2008-11-25 Marek Safar <marek.safar@gmail.com>
216 A fix for bug #447027
217 * anonymous.cs (HoistedVariable): Cache also outer access to deal
218 with context variables stored as expression instances.
220 2008-11-25 Marek Safar <marek.safar@gmail.com>
222 A fix for bug #447027
223 * delegate.cs: Fixed delegate VerifyMethod logic.
225 2008-11-24 Marek Safar <marek.safar@gmail.com>
227 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
230 2008-11-21 Marek Safar <marek.safar@gmail.com>
232 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
233 member type resolve to follow normal flow, instead of random
236 2008-11-21 Marek Safar <marek.safar@gmail.com>
238 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
241 2008-11-21 Marek Safar <marek.safar@gmail.com>
243 * const.cs: Emit decimal array constant as literal.
245 2008-11-20 Marek Safar <marek.safar@gmail.com>
247 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
249 2008-11-19 Marek Safar <marek.safar@gmail.com>
251 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
252 into real property (saves 8 MB for corlib compilation).
254 2008-11-19 Marek Safar <marek.safar@gmail.com>
256 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
257 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
258 generic-mcs.cs: Small cleanup of TypeArguments.
260 2008-11-18 Marek Safar <marek.safar@gmail.com>
262 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
263 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
264 of ConstructedType expression, renamed to GenericTypeExpr.
266 2008-11-17 Marek Safar <marek.safar@gmail.com>
268 A fix for bug #445303
269 * location.cs (IsConditionalDefined): Handle undefined global
272 2008-11-17 Marek Safar <marek.safar@gmail.com>
274 A fix for bug #444678
275 * expression.cs (TryReduceConstant): Always create new constant
278 2008-11-17 Marek Safar <marek.safar@gmail.com>
280 A fix for bug #444673
281 * ecore.cs: Ignore open generic types when used as generic type
284 2008-11-17 Marek Safar <marek.safar@gmail.com>
286 A fix for bug #445458
287 * expression.cs, cs-parser.jay: Don't crash when an expression
290 2008-11-17 Marek Safar <marek.safar@gmail.com>
292 A fix for bug #445464
293 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
296 2008-11-14 Jb Evain <jbevain@novell.com>
298 * driver.cs: ignore empty -nowarn argument such as
299 the one in -nowarn:12,13,,.
301 2008-11-13 Marek Safar <marek.safar@gmail.com>
303 A fix for bug #444271
304 * anonymous.cs: Rescan parent storeys when best candidate was
307 2008-11-13 Marek Safar <marek.safar@gmail.com>
309 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
310 useless UnboundTypeExpression.
312 * attribute.cs: Do check obsolete attribute on generic types.
314 2008-11-12 Marek Safar <marek.safar@gmail.com>
316 A fix for bugs #425680, #400139
317 * ecore.cs, expression.cs: Trying to do some almost_matched_members
320 2008-11-11 Marek Safar <marek.safar@gmail.com>
322 A fix for bug #435747
323 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
324 compound value types assignment. Few micro optimizations added.
326 2008-11-10 Marek Safar <marek.safar@gmail.com>
328 A fix for bug #442610
329 * anonymous.cs (MutateConstructor): More SRE hacking.
331 2008-11-10 Marek Safar <marek.safar@gmail.com>
333 A fix for bug #442579
334 * ecore.cs: Also initialize expanded form of a method with 1 params
337 2008-11-06 Marek Safar <marek.safar@gmail.com>
339 * expression.cs (UnaryMutator): Do early l-side check.
341 2008-11-05 Miguel de Icaza <miguel@novell.com>
343 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
344 Init, otherwise we would crash later on when checking for friend
347 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
348 Otherwise we never get any meaningful information as to what
351 2008-11-05 Marek Safar <marek.safar@gmail.com>
353 A fix for bug #436318
354 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
356 2008-11-05 Miguel de Icaza <miguel@novell.com>
358 * namespace.cs: Turns out that it was a really bad idea to hide
359 the errors for namespaces not found here in eval mode.
361 * eval.cs: When we process using clauses, only enter those into
362 the list of valid using clauses after they have been validated.
364 The above change gives the proper semantics: it does not
365 senselessly report the same errors with broken using statements by
366 never storing them in the first place when they are invalid.
368 2008-11-05 Marek Safar <marek.safar@gmail.com>
370 A fix for bug #421839
371 * cs-parser.jay: Remove expression from coalesce rule to force lower
372 priority than the assignment operator.
374 2008-11-05 Marek Safar <marek.safar@gmail.com>
376 A fix for bug #437875
377 * nullable.cs: Compile correctly method group operand used with null
380 2008-11-04 Marek Safar <marek.safar@gmail.com>
382 A fix for bug #434589
383 * expression.cs (Binary): Ignore lifted conversions when at least
384 one operand is of reference type.
386 2008-11-04 Marek Safar <marek.safar@gmail.com>
388 * cs-parser.jay: Better syntax error report.
390 2008-11-03 Marek Safar <marek.safar@gmail.com>
392 A fix for bug #436792
393 * cs-parser.jay: Use GetLocation to access location.
395 2008-11-03 Marek Safar <marek.safar@gmail.com>
397 A fix for bug #440774
398 * cs-parser.jay: Also set current_array_type when parsing local
401 2008-11-03 Marek Safar <marek.safar@gmail.com>
403 A fix for bug #440785
404 * expression.cs (As): Don't resolve self modifing expression
407 2008-11-03 Marek Safar <marek.safar@gmail.com>
409 A fix for bug #439447
410 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
412 2008-11-03 Marek Safar <marek.safar@gmail.com>
414 A fix for bug #437571
415 * cs-parser.jay: Fixes internal error for invalid expression
418 2008-10-17 Marek Safar <marek.safar@gmail.com>
420 * ecore.cs: Resolve correctly ambiguous params delegate methods.
422 2008-10-17 Marek Safar <marek.safar@gmail.com>
424 * generic.cs, anonymous.cs: Simplified GetDeclarations.
426 2008-10-17 Marek Safar <marek.safar@gmail.com>
428 * cs-tokenizer.cs: More precise cast parsing.
430 2008-10-16 Martin Baulig <martin@ximian.com>
432 * anonymous.cs (AnonymousMethodStorey): Put back the
433 `hoisted_locals' hashtable and use it in EmitType().
435 2008-10-15 Marek Safar <marek.safar@gmail.com>
437 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
438 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
441 2008-10-14 Marek Safar <marek.safar@gmail.com>
443 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
445 2008-10-14 Marek Safar <marek.safar@gmail.com>
447 * statement.cs: Mutate scope initializers.
449 2008-10-14 Marek Safar <marek.safar@gmail.com>
451 * expression.cs: Use typeless value for This constant.
453 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
455 2008-10-14 Marek Safar <marek.safar@gmail.com>
457 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
460 2008-10-13 Marek Safar <marek.safar@gmail.com>
462 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
465 2008-10-13 Marek Safar <marek.safar@gmail.com>
467 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
468 parser and tokenizer. Fixes many ambiguities including #433258.
470 2008-10-10 Marek Safar <marek.safar@gmail.com>
472 * cs-parser.jay: Fixed missing accessor recovery.
474 2008-10-10 Marek Safar <marek.safar@gmail.com>
476 A fix for bug #433701
477 * expression.cs: Better error message.
479 2008-10-10 Marek Safar <marek.safar@gmail.com>
481 * cs-parser.jay, expression.cs: Start reporting real parser errors.
483 * Makefile: Disabled unused debug symbols.
485 Also fixes: #320556, #321097, #321656, #321876, #351316
487 2008-10-09 Miguel de Icaza <miguel@novell.com>
489 * eval.cs: rename "<interactive>" to "{interactive}", to work
490 around a requirement in the compiler that this be a valid
491 filename, and in Windows it is not (433886).
493 2008-10-09 Marek Safar <marek.safar@gmail.com>
495 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
497 2008-10-08 Marek Safar <marek.safar@gmail.com>
499 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
500 cs-parser.jay: Generic type declaration and type arguments cleanup.
502 2008-10-05 Marek Safar <marek.safar@gmail.com>
504 * cs-parser.jay: Allow parsing weird array creation construct.
506 2008-10-05 Marek Safar <marek.safar@gmail.com>
508 * cs-parser.jay: Conflicts reduction.
510 2008-10-04 Marek Safar <marek.safar@gmail.com>
512 * cs-parser.jay: Conflicts reduction.
514 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
517 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
518 property. Add a 'count' hint about the use of the shared vector.
519 Ensure that we don't leak out dirty bits.
520 (UsageVector.MergeChild): Throw away information about variables
522 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
524 2008-10-03 Marek Safar <marek.safar@gmail.com>
526 A fix for bug #431746
527 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
528 parameters when iterator is created.
530 2008-10-03 Marek Safar <marek.safar@gmail.com>
532 A fix for bug #431827
533 * expression.cs: Fixed right based pointer arithmetic operations
536 2008-10-03 Marek Safar <marek.safar@gmail.com>
538 A fix for bug #353779
539 * assign.cs, expression.cs: Fixed compound assignment conversions.
541 2008-10-02 Marek Safar <marek.safar@gmail.com>
543 A fix for bug #375262
544 * statement.cs: Refactor ArrayForeach to be usable with string
545 indexer. Optimized single dimentional arrays foreach.
547 2008-10-02 Marek Safar <marek.safar@gmail.com>
549 A fix for bug #431255
550 * anonymous.cs, expression.cs: Removed broken optimization.
552 2008-10-01 Marek Safar <marek.safar@gmail.com>
554 * anonymous.cs: Use full type parameters of parent generic
555 containers. Removed unnecessary AddParentStoreyReference call.
557 2008-10-01 Marek Safar <marek.safar@gmail.com>
559 A fix for bug #324702
560 * class.cs: Use better shorter names for explicit interface member
563 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
565 2008-10-01 Marek Safar <marek.safar@gmail.com>
567 * expression.cs: Use new interface to check fixed expression.
569 2008-10-01 Marek Safar <marek.safar@gmail.com>
571 A fix for bug #421101
572 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
573 interface to check for fixed fixed-buffers.
575 2008-10-01 Marek Safar <marek.safar@gmail.com>
577 A fix for bug #429264
578 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
580 * delegate.cs: Removed unnecessary casts.
582 2008-09-30 Marek Safar <marek.safar@gmail.com>
584 A fix for bug #352151
585 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
586 class.cs: Fixed already defined explicit interface members check.
588 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
590 cs-tokenizer.cs: Fix typo.
592 2008-09-28 Miguel de Icaza <miguel@novell.com>
594 * eval.cs (InteractiveBase): The quit command now just sets a
595 flag, instead of calling Environment.Exit(), it is milder on
598 CompiledMethod is now in Mono.CSharp, not nested inside
599 the Evaluator, it was inconvenient to use.
601 2008-09-27 Miguel de Icaza <miguel@novell.com>
603 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
604 code to be invoked without having to reparse.
606 2008-09-27 Miguel de Icaza <miguel@novell.com>
608 * ecore.cs: The recent changes to FieldExpr broke this as well.
609 Fixes LINQ queries in the interactive shell.
611 * Multiple files: indentation fixing for the Mono coding
612 guidelines for the switch statement.
614 * eval.cs: Make the Evaluator API thread safe.
616 2008-09-26 Marek Safar <marek.safar@gmail.com>
618 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
621 2008-09-26 Marek Safar <marek.safar@gmail.com>
623 A fix for bug #325326
624 * statement.cs: Check possible mistaken empty statement using
625 explicit blocks only.
627 2008-09-25 Miguel de Icaza <miguel@novell.com>
629 * eval.cs (LoadAssembly, ReferenceAssembly): Call
630 RootNamespace.ComputeNamespaces to update the internal list of
631 namespaces, this is no longer done for us.
633 (InteractiveBase): Use the Evaluator APIs instead of calling into
636 2008-09-25 Marek Safar <marek.safar@gmail.com>
638 A fix for bug #429264
639 * expression.cs: Missing mutator for access to multidimensional
642 2008-09-25 Marek Safar <marek.safar@gmail.com>
644 * class.cs, statement: Emit DebuggerHidden attribute for iterator
647 * driver.cs: Missing input argument check.
649 2008-09-25 Marek Safar <marek.safar@gmail.com>
651 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
652 expression.cs, statement.cs, rootcontext.cs, class.cs,
653 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
656 2008-09-24 Miguel de Icaza <miguel@novell.com>
658 * ecore.cs (FieldExpr): Only initialize eclass when we return a
659 fully constructed FieldExpr, fixes the regression introduced in
662 * ecore.cs, expression.cs: Plug back the eclass initialization as
663 otherwise it regresses `csharp'.
665 2008-09-24 Marek Safar <marek.safar@gmail.com>
667 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
668 ecore.cs, attribute.cs: Moved obsolete method checks from emit
669 phase to resolve phase. It resolves problems with expression trees
670 and fixes bugs #323796, #325156.
672 2008-09-23 Marek Safar <marek.safar@gmail.com>
674 * codegen.cs: Report better error when symbol writer is missing.
676 2008-09-23 Marek Safar <marek.safar@gmail.com>
678 * codegen.cs: Set .NET symbol writer.
680 * decl.cs: Guard against null generic arguments.
682 * report.cs: Don't report exactly same additional details.
684 2008-09-22 Marek Safar <marek.safar@gmail.com>
686 A fix for bug #324917
687 * cs-parser.jay: Add missing multidimensional non-expression type
690 2008-09-22 Marek Safar <marek.safar@gmail.com>
692 A fix for bug #428191
693 * anonymous.cs: Create an outer generic fields also for non-storey
696 2008-09-22 Marek Safar <marek.safar@gmail.com>
698 A fix for bug #378294
699 * class.cs: Make fixed size buffers gmcs feature only.
701 2008-09-22 Marek Safar <marek.safar@gmail.com>
703 A fix for bug #355622, #324993
704 * assign.cs, const.cs, class.cs: Create new EmitContext for each
707 2008-09-19 Marek Safar <marek.safar@gmail.com>
709 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
712 2008-09-19 Marek Safar <marek.safar@gmail.com>
714 A fix for bug #416110
715 * generic.cs: Struct constraint results in default ctor and
716 ValueType base type constraint to be set.
718 2008-09-19 Marek Safar <marek.safar@gmail.com>
720 A fix for bug #423791
721 * generic.cs: Fixed params output type type-inference.
723 2008-09-19 Marek Safar <marek.safar@gmail.com>
725 * cs-parser.jay, expression.cs: Fixed few expression crashes.
727 2008-09-19 Marek Safar <marek.safar@gmail.com>
729 * cs-tokenizer.cs: Don't break on extra partial modifier.
731 2008-09-19 Marek Safar <marek.safar@gmail.com>
733 A fix for bug #427592
734 * generic.cs: Use common parameter resolve method.
736 2008-09-18 Marek Safar <marek.safar@gmail.com>
738 A fix for bug #414758
739 * expression.cs, ecore.cs: Fixed crash when accessing non-static
742 2008-09-18 Marek Safar <marek.safar@gmail.com>
744 * driver.cs, namespace.cs: Read types and namespaces after all
745 requested assemblies are loaded, fixes issues with System.Core
746 auto-reference, and #419888.
748 2008-09-18 Marek Safar <marek.safar@gmail.com>
750 A fix for bug #417705
751 * cs-parser.jay: Fixed as/is operator expression split.
753 2008-09-18 Marek Safar <marek.safar@gmail.com>
755 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
756 Fixed expression tree representation of empty new expression and
757 new initializer expression.
759 2008-09-18 Miguel de Icaza <miguel@novell.com>
761 * eval.cs: Remove warning, keep reference to driver around.
763 * Hide fields that do not need to be public.
765 2008-09-17 Marek Safar <marek.safar@gmail.com>
767 A fix for bug #426385
768 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
769 conversion for array elements.
771 2008-09-17 Marek Safar <marek.safar@gmail.com>
773 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
774 void parsing conflicts.
776 2008-09-15 Marek Safar <marek.safar@gmail.com>
778 A fix for bug #425601
779 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
780 System.Core only when there is no custom ExtensionAttribute
783 2008-09-15 Miguel de Icaza <miguel@novell.com>
785 * namespace.cs: Do not report CS0246 (name
787 2008-09-12 Marek Safar <marek.safar@gmail.com>
789 A fix for bug #425669
790 * generic.cs: Don't cache generic static anonymous method
793 2008-09-12 Marek Safar <marek.safar@gmail.com>
795 * generic.cs, class.cs, delegate.cs: Check recursive inherited
796 conflicting constraints.
798 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
800 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
803 2008-09-12 Marek Safar <marek.safar@gmail.com>
805 * literal.cs, convert.cs, expression.cs, statement.cs: More null
806 to null pointer conversion fixes.
808 2008-09-11 Marek Safar <marek.safar@gmail.com>
810 * cs-parser.jay, expression.cs: An implicitly typed local variable
811 declarator cannot use an array initializer.
813 2008-09-11 Marek Safar <marek.safar@gmail.com>
815 * cs-parser.jay: Reduced number of printed tokens, add sorting.
817 2008-09-11 Marek Safar <marek.safar@gmail.com>
819 * generic.cs (InflatedConstraints): Don't crash when constraints
822 * cs-parser.jay: const_declarator is a block.
824 * constant.cs: Check for not allowed NaN conversions.
826 2008-09-10 Miguel de Icaza <miguel@novell.com>
828 * driver.cs: Drop --shell argument, the compiler is no longer a
831 * eval.cs: Move most of the code that deals with evaluation into
832 this file and document the public API from repl.cs
834 * repl.cs: Remove from here.
836 2008-09-10 Marek Safar <marek.safar@gmail.com>
838 A fix for bug #424684
839 * generic.cs: Generic class constraints must come first.
841 2008-09-09 Miguel de Icaza <miguel@novell.com>
843 * cs-parser.jay: Improve error reporting for syntax errors in
844 statements and expressions, we now report the expected tokens
845 instead of reporting the useless "; expected".
847 Drop the strings from the token declaration, it turns out that
848 they did not do what I thought they did. Instead they were adding
849 two sets of tokens to the tables.
851 2008-09-09 Marek Safar <marek.safar@gmail.com>
853 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
854 delegate.cs: Share special type check.
856 2008-09-09 Marek Safar <marek.safar@gmail.com>
858 A fix for bug #423981
859 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
861 2008-09-09 Marek Safar <marek.safar@gmail.com>
863 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
866 2008-09-09 Marek Safar <marek.safar@gmail.com>
868 A fix for bugs: #324750, #335946
869 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
870 lookup rule to determine ?-based tokens.
872 2008-09-08 Miguel de Icaza <miguel@novell.com>
874 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
875 expressions (like event adding or removing) end up here, so we
876 need to treat those as statements.
878 Add LoadAssembly method.
880 2008-09-04 Miguel de Icaza <miguel@novell.com>
882 * repl.cs: Add Time method.
884 2008-09-05 Marek Safar <marek.safar@gmail.com>
886 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
888 2008-09-05 Miguel de Icaza <miguel@novell.com>
890 * repl.cs: Add workaround for old compilers.
892 2008-09-04 Jb Evain <jbevain@novell.com>
894 * repl.cs (PrettyPrint): pretty print everything that
895 implements IDictionary, as well as IEnumerables. Also,
896 add a quit helper property.
898 2008-09-04 Marek Safar <marek.safar@gmail.com>
900 * constant.cs: Better error reporting for decimal literals.
902 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
905 2008-09-04 Marek Safar <marek.safar@gmail.com>
906 Miguel de Icaza <miguel@novell.com>
908 A fix for bug #422951
909 * assign.cs (Assign.DoResolve): Perform the type conversions
910 checks before we attempt to initialize `New' initializers.
912 2008-09-04 Marek Safar <marek.safar@gmail.com>
914 A fix for bug #422853
915 * delegate.cs (DelegateCreation): Add special handling for
916 EmptyExpression.Null instance expression which is just another
917 hack for undecided member instance exression.
919 2008-09-04 Marek Safar <marek.safar@gmail.com>
921 * expression.cs, ecore.cs: Emit full expression tree for reduced
924 2008-09-04 Marek Safar <marek.safar@gmail.com>
926 * expression.cs (This): Guard against multi-resolving.
928 * ecore.cs, statement.cs (Throw): Simplified.
930 * flowanalysis.cs: Also verify event fields.
932 2008-09-04 Miguel de Icaza <miguel@novell.com>
934 * assign.cs (Assign.DoResolve): Perform the type conversions
935 checks before we attempt to initialize `New' initializers.
937 * repl.cs (PrettyPrint): Add Hashtable prettyprint
939 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
942 * repl.cs: Update help.
944 2008-09-03 Miguel de Icaza <miguel@novell.com>
946 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
947 handling of the default config handling, including the special
948 treatment of System.Core assembly.
950 Fixes the REPL processing for LINQ.
952 2008-09-03 Marek Safar <marek.safar@gmail.com>
954 A fix for bug #422507
955 * expression.cs (UnboxCast): Add missing child expression mutator.
957 2008-09-03 Marek Safar <marek.safar@gmail.com>
959 * driver.cs: Don't self reference System.Core assembly.
961 2008-09-03 Marek Safar <marek.safar@gmail.com>
963 A fix for bug #422507
964 * expression.cs (StringConcat): Add missing type mutator.
966 2008-09-03 Marek Safar <marek.safar@gmail.com>
968 * generic.cs (TypeInferenceContext): Follow equality rule for
969 constructed type lower bound type inference.
971 2008-09-02 Miguel de Icaza <miguel@novell.com>
973 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
974 <dblank@cs.brynmawr.edu> which updates the cursor position on
977 2008-09-02 Marek Safar <marek.safar@gmail.com>
979 A fix for bug #367145
980 * driver.cs: Fixed import of extension methods when using -noconfig
983 2008-09-02 Marek Safar <marek.safar@gmail.com>
985 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
986 version from non-generic implementation instead.
988 2008-09-01 Marek Safar <marek.safar@gmail.com>
990 A fix for bug #418908
991 * class.cs: Use AddScopeStatement for field initializers.
993 2008-09-01 Marek Safar <marek.safar@gmail.com>
995 A fix for bug #415385
996 * ecore.cs, convert.cs: Do method group conversion for equal group types.
998 2008-09-01 Marek Safar <marek.safar@gmail.com>
1000 A fix for bug #421736
1001 * iterators.cs: Don't crash on unreachable iterators.
1003 2008-09-01 Marek Safar <marek.safar@gmail.com>
1005 A fix for bug #421628
1006 * parameter.cs, attribute.cs: Clone also parameter attributes.
1008 2008-08-30 Miguel de Icaza <miguel@novell.com>
1010 * namespace.cs (LookupType): In EvalMode, try to replace
1011 the TypeBuilder from our cache with a Type as Reflection.Emit does
1012 not like to mix code from older assemblies emitted and new
1015 This sounds like a serious Mono bug that prevents multiple
1016 assemblies to be generated and consumed at the same time.
1018 * cs-parser.jay (push_current_class): Do not make interactive
1019 classes internal or private, make them public as we currently
1020 generate each new class in a new assembly.
1022 2008-08-29 Miguel de Icaza <miguel@novell.com>
1024 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
1025 remove types that are entered into the global namespace during
1026 parsing so that we can remove them on failure.
1028 * cs-parser.jay: Parsing: we now keep track of types that are
1029 entered into global variables and queue those in case the parsing
1032 This happens in a few situations: during partial-input, we invoke
1033 the parser repeatedly for example with the string "class X", this
1034 would cause X to be registed, and we need to remove this
1035 registration so that another parse attempt later with say "class X {"
1036 would actually work.
1038 Additionally, if there is an error in the resolution phase, for
1039 example: "class X : NonExistant {}" th
1041 * cs-parser.jay: Be more precise with the errors being raised,
1042 instead of flagging all exceptions during parsing to be attributed
1043 to the parsing process, distinguish those from errors happening in
1044 the actions and hint that using -v would produce the actual
1047 * repl.cs: Do not load all compiler references on each reset,
1048 doing the partial reset takes care of this.
1050 2008-08-28 Miguel de Icaza <miguel@novell.com>
1052 * repl.cs: Add support for loading all the files from
1053 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
1056 Introduce a micro-parser that is able to deambiguate on its input
1057 whether we are dealing with a compilation unit (namespace, class,
1058 interface, struct, delegate) declaration or a statement. This
1059 allows both declarations and statements to be entered.
1061 Set history size by default to 300 lines.
1063 Instead of distinguishing based on the parser.InteractiveResult,
1064 have only two cases: statements were parsed, or a compilation unit
1065 was. Always pull the Using statement additions from the
1066 compilation unit parse.
1068 * cs-tokenizer.cs: Rename tokens to better describe their intent
1069 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
1071 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
1072 EvalMode is used to trigger the lookup of global variables while
1073 StatementMode is used turn variable declarations into static
1076 * getline.cs: Allow history size to be set.
1078 2008-08-29 Marek Safar <marek.safar@gmail.com>
1080 A fix for bug #360755
1081 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
1083 2008-08-29 Marek Safar <marek.safar@gmail.com>
1085 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
1087 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
1088 member name, it is too confusing
1090 * decl.cs, class.cs: Don't report unused fields with attached attribute.
1092 * rootcontext.cs: Finally default to warning level 4.
1094 2008-08-28 Marek Safar <marek.safar@gmail.com>
1096 * class.cs (CheckBase): Ignore overloaded operators.
1098 2008-08-28 Marek Safar <marek.safar@gmail.com>
1100 A fix for bug #420830
1101 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
1103 2008-08-28 Marek Safar <marek.safar@gmail.com>
1105 A fix for bug #420832
1106 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
1108 2008-08-28 Marek Safar <marek.safar@gmail.com>
1110 A fix for bug #420386
1111 * nullables.cs: Fixed logic of nullable user comparison operators involving
1114 2008-08-28 Marek Safar <marek.safar@gmail.com>
1116 * attribute (IsClsCompliant): Use FALSE value for pointer types.
1118 2008-08-27 Miguel de Icaza <miguel@novell.com>
1120 * repl.cs: Add support for aborting the running code with C-c.
1122 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
1124 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
1126 2008-08-27 Miguel de Icaza <miguel@novell.com>
1128 * cs-parser.jay (interactive_statement_list): A new set of rules
1129 for hosting statements that uses the "interactive_" prefix.
1131 * repl.cs: Add support for parsing `using' as a statement or as a
1132 directive. Deambiguating before passing this to the parser.
1134 We need to distinguish statement_expressions that occur at the
1135 toplevel vs those that occur embedded into expressions.
1137 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
1138 that fixes the cursor key handling, and a history bug.
1140 2008-08-26 Miguel de Icaza <miguel@novell.com>
1142 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
1143 limitations in Console, instead the 2.0 bootstrap libraries now
1144 include the Console bits.
1146 Also, remove the use of Nullables from getline.cs
1150 Interactive support for the C# compiler. Use gmcs --shell to
1151 enter a read-eval-print loop shell.
1153 Docs: http://www.mono-project.com/CsharpRepl
1155 * sources: include repl.cs here and getline.cs for gmcs.exe,
1156 everything else is getline.cs impaired.
1158 * Makefile: when bootstrapping pass a special flag
1159 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
1160 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
1161 This distinguishes those two cases.
1163 * repl.cs: Support for a read-eval-print loop. Will be soon
1164 refactored into eval support and then REPL on top of it.
1166 * ecore.cs: If a simplename lookup fails, before erroring out,
1167 if we are in EvalMode to resolve the name to a declaration in the
1170 This means that variable declarations that happened in previous
1171 classes (as repl puts every statement in a separate class) are
1172 made visible in this way.
1174 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
1175 triggered an error due to the end of file being reached. This is
1176 used to do multi-line input, and notify the caller that the user
1177 needs to provide more text before a successful parse.
1179 Add new grammar rules after the INTERACTIVE_PARSER token is seen
1180 to drive the evaluation with a custom wrapper.
1182 * driver.cs: Add support for --shell, and refactor some code to be
1185 * namespace.cs: Add support for serializing the contents of the
1186 namespaces and reloading them.
1188 * getline.cs: A managed implementation of ReadLine under
1189 X11/Apache2 license terms. Easy to embed in other applications as
1192 * namespace.cs: Add some functions to save and restore the
1195 * rootcontext.cs: New public field.
1197 * cs-tokenizer.cs: Add support for one of the possible characters
1198 we introduce into the token stream.
1200 This patch does not affect the regular tokenization process, the
1201 only performance hit would happen if there is an invalid character
1202 on the input string.
1204 * support.cs: Move isatty helper routine here.
1206 * codegen.cs: Small cleanup, and add a mechanism to initialize the
1207 code generator for in-memory assemblies.
1209 2008-08-26 Marek Safar <marek.safar@gmail.com>
1211 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
1212 parameter cannot be always used as a type.
1214 2008-08-21 Marek Safar <marek.safar@gmail.com>
1216 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
1218 2008-08-21 Marek Safar <marek.safar@gmail.com>
1220 * convert.cs: Implement explicit array to IList<T> conversion.
1222 2008-08-20 Marek Safar <marek.safar@gmail.com>
1224 A fix for bug #362740
1225 * cs-tokenizer.cs: Handle UTF-16 surrogates.
1227 2008-08-20 Marek Safar <marek.safar@gmail.com>
1229 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
1230 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
1231 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
1232 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
1233 handling to use just one type of infrastructure and deal with generics
1236 2008-07-23 Martin Baulig <martin@ximian.com>
1238 *** Merged this from trunk revision 108527 ***
1241 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
1242 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
1245 2008-08-15 Marek Safar <marek.safar@gmail.com>
1247 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
1250 2008-08-15 Marek Safar <marek.safar@gmail.com>
1252 * delegate.cs: Fixed compiler crash when creating delegate using partial
1255 * typemanager.cs: MulticastDelegate is not a delegate.
1257 2008-08-14 Marek Safar <marek.safar@gmail.com>
1259 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
1262 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
1264 * cs-parser.jay (type): Allow 'var' in mcs too.
1265 (local_variable_type): Likewise.
1267 2008-08-14 Marek Safar <marek.safar@gmail.com>
1269 * driver.cs: Removed broken -noconfig variants.
1271 2008-08-14 Marek Safar <marek.safar@gmail.com>
1273 A fix for bug #417078
1274 * expression.cs: Emit correctly left side pointer operators.
1276 2008-08-13 Marek Safar <marek.safar@gmail.com>
1278 * generic.cs, lambda.cs: Inflate method generic arguments only.
1280 2008-08-12 Marek Safar <marek.safar@gmail.com>
1282 * class.cs: Fixed struct layout check regression.
1284 2008-08-12 Marek Safar <marek.safar@gmail.com>
1286 * cs-parser.jay, enum.cs: Simplified enum parsing.
1288 * decl.cs: Check all type parameters conflicts.
1290 * expression.cs, statement.cs, attribute.cs: More expression checks.
1292 2008-08-11 Marek Safar <marek.safar@gmail.com>
1294 * generic.cs: Add type inference types restriction.
1296 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
1297 anonymous.cs, expression.cs: Allocate less accessor parameters.
1299 2008-08-08 Marek Safar <marek.safar@gmail.com>
1301 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
1304 2008-08-08 Marek Safar <marek.safar@gmail.com>
1306 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
1308 2008-08-07 Marek Safar <marek.safar@gmail.com>
1310 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
1311 Also fixes #362146 and #381592.
1313 2008-08-07 Marek Safar <marek.safar@gmail.com>
1315 * ecore.cs: Reduced constant cannot be used as an attribute value.
1317 * cs-parser.jay: Base expression has to be a type.
1319 * expression.cs (Conditional): Uses ReducedExpression.
1321 2008-08-06 Marek Safar <marek.safar@gmail.com>
1323 A fix for bug #376826
1324 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
1325 address of hoisted local variable or parameter cannot be taken.
1327 2008-08-05 Marek Safar <marek.safar@gmail.com>
1329 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
1330 anonymous method inside checked/unchecked expression.
1332 2008-08-05 Marek Safar <marek.safar@gmail.com>
1334 * typemanager.cs (IsEqual): Guard against null.
1336 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
1337 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
1338 routine. Fixed few misleading conversion errors.
1340 2008-08-04 Marek Safar <marek.safar@gmail.com>
1342 * class.cs: Consider generics when checking cycles in struct layout.
1344 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
1346 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
1348 2008-08-04 Marek Safar <marek.safar@gmail.com>
1350 A fix for bug #414165
1351 * anonymous.cs: Use same anonymous implementation method for all anonymous
1354 2008-08-04 Marek Safar <marek.safar@gmail.com>
1356 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
1359 2008-08-04 Marek Safar <marek.safar@gmail.com>
1361 * cs-parser.jay: Typeof argument has to be a type expression.
1363 * namespace.cs: Check alias and namespace definitions collisions.
1365 * class.cs, pending.cs: Moved explicit interface accessor implementation
1368 * delegate.cs, expression.cs: Verify special name invocations.
1370 2008-08-01 Marek Safar <marek.safar@gmail.com>
1372 * cs-parser.jay: Don't choke on empty generic type arguments.
1374 * cs-tokenizer.cs: Handle escaped preprocessor directives.
1376 * expression.cs, ecore.cs: Minor expressions bugs.
1378 2008-08-01 Marek Safar <marek.safar@gmail.com>
1380 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
1381 and added more error handling.
1383 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
1385 * modifiers.cs, enum.cs: Fixed.
1387 2008-07-31 Jb Evain <jbevain@novell.com>
1389 * driver.cs: remove -pkg ability of smcs.
1391 2008-07-30 Marek Safar <marek.safar@gmail.com>
1393 * statement.cs (Switch): Correctly set empty default target for single
1396 2008-07-30 Marek Safar <marek.safar@gmail.com>
1398 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
1399 string switch statement implementation to use string dictionary which
1400 significantly (2-8x) improves performance of generated code.
1402 2008-07-29 Marek Safar <marek.safar@gmail.com>
1404 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
1405 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
1407 2008-07-29 Marek Safar <marek.safar@gmail.com>
1409 A fix for bug #412595
1410 * typemanager.cs, convert.cs, expression.cs: Some types are never
1411 convertible to each other.
1413 2008-07-29 Marek Safar <marek.safar@gmail.com>
1415 * nullable.cs (CreateNullConstant): An error messages update.
1417 2008-07-29 Marek Safar <marek.safar@gmail.com>
1419 A fix for bug #412595
1420 * cfold.cs: Don't cast undefined bool constant.
1422 2008-07-29 Martin Baulig <martin@ximian.com>
1425 (SymbolWriter.Reset): New public static method.
1428 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
1430 2008-07-28 Marek Safar <marek.safar@gmail.com>
1432 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
1434 * expression.cs (ElementAccess): Exact size allocation.
1436 2008-07-26 Marek Safar <marek.safar@gmail.com>
1438 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
1440 2008-07-25 Marek Safar <marek.safar@gmail.com>
1442 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
1444 * class.cs: Removed $PRIVATE$ field hack which caused problems during
1447 2008-07-25 Marek Safar <marek.safar@gmail.com>
1449 A fix for bug #412217
1450 * assign.cs: Mutate also assignment type.
1452 2008-07-25 Marek Safar <marek.safar@gmail.com>
1454 A fix for bug #323644
1455 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
1458 2008-07-25 Marek Safar <marek.safar@gmail.com>
1460 A fix for bug #412134
1461 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
1462 non-enumerable operands when overloading equality or bitwise operators.
1464 2008-07-25 Marek Safar <marek.safar@gmail.com>
1466 * anonymous.cs: Cache closed generic anonymous method delegates.
1468 2008-07-24 Marek Safar <marek.safar@gmail.com>
1470 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
1471 anonymous.cs, statement.cs: Always emit anonymous method as static method
1472 when is instance free. Use nesting for nested anynomous methods blocks.
1474 2008-07-23 Marek Safar <marek.safar@gmail.com>
1476 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
1479 2008-07-23 Marek Safar <marek.safar@gmail.com>
1481 * expression.cs: Removed MakeSimpleCall.
1483 2008-07-23 Marek Safar <marek.safar@gmail.com>
1485 A fix for bug #323012
1486 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
1487 Base method implementing interface has to be public.
1489 2008-07-23 Marek Safar <marek.safar@gmail.com>
1491 * cs-parser.jay: Don't break on missing argument.
1493 2008-07-22 Marek Safar <marek.safar@gmail.com>
1495 A fix for bug #320993
1496 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
1497 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
1499 2008-07-22 Marek Safar <marek.safar@gmail.com>
1501 A fix for bug #320748
1502 * convert.cs: Implicit user operators cannot convert to interfaces
1504 2008-07-22 Marek Safar <marek.safar@gmail.com>
1506 A fix for bug #312686
1507 * driver.cs: Ignore empty assembly references.
1509 2008-07-22 Marek Safar <marek.safar@gmail.com>
1511 A fix for bug #387040
1512 * ecore.cs: Skip constrains check for an explicit implementation.
1514 2008-07-21 Marek Safar <marek.safar@gmail.com>
1516 A fix for bug #409045
1517 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
1518 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
1519 identifiers are file specific unless passed as input arguments.
1521 2008-07-21 Marek Safar <marek.safar@gmail.com>
1523 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
1524 to emit UnmanagedMarshal data under 2.0 profile.
1526 2008-07-21 Marek Safar <marek.safar@gmail.com>
1528 A fix for bug #410369
1529 * parameter.cs: Clone correctly ParamsParameter.
1531 2008-07-21 Marek Safar <marek.safar@gmail.com>
1533 * expression.cs (Argument): Always report type for type based expressions
1536 2008-07-18 Marek Safar <marek.safar@gmail.com>
1538 A fix for bug #410666
1539 * anonymous.cs: Correctly initialize generic storey reference.
1541 2008-07-18 Marek Safar <marek.safar@gmail.com>
1543 * convert.cs: Don't box same type arguments.
1545 2008-07-18 Marek Safar <marek.safar@gmail.com>
1547 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
1548 Finished missing generic type mutators.
1550 2008-07-18 Marek Safar <marek.safar@gmail.com>
1552 * iterators.cs, statement.cs: Finished statements CloneTo.
1554 2008-07-18 Marek Safar <marek.safar@gmail.com>
1556 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
1558 * expression.cs: Emit optimized default value expressions in expression tree
1561 2008-07-18 Marek Safar <marek.safar@gmail.com>
1563 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
1565 2008-07-17 Marek Safar <marek.safar@gmail.com>
1567 A fix for bug #367536
1568 * cs-parser.jay: Check static constructor of generic types for an access
1571 2008-07-17 Marek Safar <marek.safar@gmail.com>
1573 A fix for bug #353800
1574 * lambda.cs: Emit ret for contextual statements.
1576 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
1577 up emitting redundant ret for all anonymous methods with return.
1579 2008-07-17 Marek Safar <marek.safar@gmail.com>
1581 A fix for bug #365188
1582 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
1583 create anonymous method storey in unreachable block.
1585 2008-07-17 Marek Safar <marek.safar@gmail.com>
1587 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
1588 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
1589 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
1590 statement.cs: Fixed relevant defects found by Gendarme.
1592 2008-07-17 Marek Safar <marek.safar@gmail.com>
1594 A fix for bug #325291
1595 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
1596 statement.cs: Replaced IAnonymousHost with top level block flag.
1598 2008-07-17 Marek Safar <marek.safar@gmail.com>
1600 * cs-parser.jay: Clean up unused open_parens.
1602 2008-07-17 Marek Safar <marek.safar@gmail.com>
1604 * ecore.cs: Custom error message for a range variable assignment.
1606 2008-07-16 Marek Safar <marek.safar@gmail.com>
1608 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
1611 2008-07-16 Marek Safar <marek.safar@gmail.com>
1613 * literal.cs: Null literal is of object type.
1615 2008-07-16 Marek Safar <marek.safar@gmail.com>
1617 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
1618 expression of nullable equality comparison.
1620 2008-07-15 Marek Safar <marek.safar@gmail.com>
1622 * expression.cs(PointerArithmetic): Removed redundant assignment.
1624 2008-07-15 Marek Safar <marek.safar@gmail.com>
1626 * decl.cs (GetSignatureForError): Report full namespace name for containers.
1628 2008-07-14 Marek Safar <marek.safar@gmail.com>
1630 A fix for bug #408361
1631 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
1632 they are replaced by GetMethod.
1634 2008-07-14 Marek Safar <marek.safar@gmail.com>
1636 A fix for bug #408721 by jeremie.laval@gmail.com
1637 * expression.cs (Indirection): Implemented CloneTo.
1639 2008-07-14 Marek Safar <marek.safar@gmail.com>
1641 * statement.cs (AssignableSlots): Temporary disabled variable initialization
1644 2008-07-14 Marek Safar <marek.safar@gmail.com>
1646 * report.cs (EnableReporting): Don't reinitialize 0-based values.
1648 2008-07-11 Marek Safar <marek.safar@gmail.com>
1650 * linq.cs: Reset tranparent parameter counter in probing mode.
1652 2008-07-11 Marek Safar <marek.safar@gmail.com>
1654 * anonymous.cs: Mutate anonymous method type.
1656 2008-07-11 Marek Safar <marek.safar@gmail.com>
1658 * ecore.cs, anonymous.cs: Mutate field expressions.
1660 2008-07-10 Marek Safar <marek.safar@gmail.com>
1662 A fix for bug #369670
1663 * linq.cs, statement.cs: Use explicit block for query expressions variables.
1665 2008-07-10 Marek Safar <marek.safar@gmail.com>
1667 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
1669 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
1672 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
1673 only one '>', and finds a '>>', abort the generic lookahead.
1675 2008-07-10 Marek Safar <marek.safar@gmail.com>
1677 A fix for bug #319902
1678 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
1680 2008-07-10 Marek Safar <marek.safar@gmail.com>
1682 A fix for bug #406371
1683 * statement.cs: Moved EmitSymbolInfo to Block.
1685 2008-07-09 Marek Safar <marek.safar@gmail.com>
1687 * ecore.cs: Report better error for extension method overload failures.
1689 2008-07-09 Marek Safar <marek.safar@gmail.com>
1691 * expression.cs (Is): No need to box reference values.
1693 2008-07-09 Marek Safar <marek.safar@gmail.com>
1695 * class.cs: Use event resolve context when initializing CreateEmitContext.
1697 2008-07-09 Marek Safar <marek.safar@gmail.com>
1699 A fix for bug #394436
1700 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
1701 method used inside expression trees. Added more LINQ to expression tree
1704 2008-07-08 Marek Safar <marek.safar@gmail.com>
1706 A fix for bug #378189, #370577
1707 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
1710 2008-07-08 Marek Safar <marek.safar@gmail.com>
1712 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
1715 2008-07-08 Marek Safar <marek.safar@gmail.com>
1717 A fix for bug #406702
1718 * anonymous.cs: Always park anonymous method in the nearest parent storey.
1720 2008-07-07 Marek Safar <marek.safar@gmail.com>
1722 A fix for bug #406648
1723 * cs-parser.jay: Report nullable use in mcs for some cases.
1725 2008-07-07 Marek Safar <marek.safar@gmail.com>
1727 * ecore.cs: Improved argument mismatch error messages.
1729 2008-07-07 Marek Safar <marek.safar@gmail.com>
1731 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
1733 2008-07-07 Marek Safar <marek.safar@gmail.com>
1735 * expression.cs (TypeOf): Mutate type argument.
1737 2008-07-04 Marek Safar <marek.safar@gmail.com>
1739 * class.cs: Report missing partial modifier for correct type.
1741 2008-07-04 Marek Safar <marek.safar@gmail.com>
1743 * ecore.cs, expression.cs (VariableReference): Variable property is
1746 2008-07-04 Marek Safar <marek.safar@gmail.com>
1748 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
1750 2008-07-04 Marek Safar <marek.safar@gmail.com>
1752 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
1755 2008-07-04 Marek Safar <marek.safar@gmail.com>
1757 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
1758 anonymous method storey to an instance method when only "this" is hoisted.
1760 2008-07-03 Marek Safar <marek.safar@gmail.com>
1762 A fix for bug #321615
1763 * expression.cs: Pointer comparisons use unsigned operator.
1765 2008-07-03 Marek Safar <marek.safar@gmail.com>
1767 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
1769 2008-07-02 Marek Safar <marek.safar@gmail.com>
1771 A fix for bug #404905
1772 * class.cs: Always initialize local unsafe variables.
1774 2008-06-30 Marek Safar <marek.safar@gmail.com>
1776 A fix for bug #396987
1777 * expression.cs (NewInitialize): Clear local temporary variable for next run
1779 2008-06-27 Marek Safar <marek.safar@gmail.com>
1781 A fix for bug #401020
1782 * ecore.cs: Both types and modifiers have to match for ref and out arguments
1784 2008-06-27 Marek Safar <marek.safar@gmail.com>
1786 A fix for bug #398319
1787 * cs-parser.jay: Implemented undocumented base access expression inside
1790 2008-06-26 Marek Safar <marek.safar@gmail.com>
1792 A fix for bug #404227
1793 * cs-parser.jay: Parse namespace declaration using qualified identifier.
1795 2008-06-26 Marek Safar <marek.safar@gmail.com>
1797 A fix for bug #404227
1798 * convert.cs: Fixed explicit array to interface cast.
1800 2008-06-26 Marek Safar <marek.safar@gmail.com>
1802 A fix for bug #403894
1803 * delegate.cs: Mutate DelegateInvocation type.
1805 2008-06-26 Marek Safar <marek.safar@gmail.com>
1807 A fix for bug #379348
1808 * delegate.cs: Box a load of generic parameters.
1810 2008-06-26 Marek Safar <marek.safar@gmail.com>
1812 * expression.cs: Add an array creation arguments mutate.
1814 2008-06-26 Marek Safar <marek.safar@gmail.com>
1816 A fix for bug #386068
1817 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
1820 2008-06-25 Marek Safar <marek.safar@gmail.com>
1822 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
1825 2008-06-25 Marek Safar <marek.safar@gmail.com>
1827 A fix for bug #403518
1828 * delegate.cs: Type correctly anonymous method new invocation.
1830 2008-06-24 Marek Safar <marek.safar@gmail.com>
1832 A fix for bug #394826
1833 * anonymous.cs: Fully qualify members when resolving anonymous type internal
1836 2008-06-24 Marek Safar <marek.safar@gmail.com>
1838 A fix for bug #394826
1839 * anonymous.cs, iterators.cs: Construct generic storey only when is really
1842 2008-06-24 Marek Safar <marek.safar@gmail.com>
1844 * class.cs: Clone indexer parameters for localized capturing.
1846 2008-06-24 Marek Safar <marek.safar@gmail.com>
1848 A fix for bug #402379
1849 * expression.cs: Don't crash when an object initializer resolve fails.
1851 2008-06-24 Marek Safar <marek.safar@gmail.com>
1853 A fix for bug #402888
1854 * expression.cs: Mutate conditional expression.
1856 2008-06-24 Marek Safar <marek.safar@gmail.com>
1858 A fix for bug #401012
1859 * class.cs: Keep StructLayout in shared container.
1861 2008-06-24 Marek Safar <marek.safar@gmail.com>
1863 A fix for bug #400438
1864 * decl.cs, class.cs: Only properties can be automatically implemented.
1866 2008-06-24 Marek Safar <marek.safar@gmail.com>
1868 * statement.cs (ChangeToIterator): Copy also labels.
1870 2008-06-23 Marek Safar <marek.safar@gmail.com>
1872 * ecore.cs: Pass type argument details to parent extension method.
1874 2008-06-23 Marek Safar <marek.safar@gmail.com>
1876 A fix for bug #375966
1877 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
1879 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
1881 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
1883 2008-06-22 Marek Safar <marek.safar@gmail.com>
1885 A fix for bug #394347
1886 * anonymous.cs: Cache compatible delegates as compatibility check produces
1887 a new method every time.
1889 2008-06-20 Marek Safar <marek.safar@gmail.com>
1891 * anonymous.cs: Propagate storey reference for single references.
1893 2008-06-20 Marek Safar <marek.safar@gmail.com>
1895 A fix for bug #387615
1896 * assign.cs, expression.cs: Correctly clone compound assignment.
1898 2008-06-19 Marek Safar <marek.safar@gmail.com>
1900 A fix for bug #359611, #359604
1901 * anonymous.cs: Mutate all types of hoisted parameters.
1903 2008-06-19 Marek Safar <marek.safar@gmail.com>
1905 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
1906 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
1907 expression.cs, codegen.cs, statement.cs
1909 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
1910 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
1912 ** Anonymous methods, lambda expressions rewrite **
1914 Anonymous expressions are now resolved when an explicit block is resolved
1915 and they don't require any registration procedure anymore. Further,
1916 anonymous methods are defined when explicit block is emitted which allows
1917 better control of whole process and opens possibilities for more
1918 optimizations as well as alternative to reverse whole process.
1920 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
1921 process consistent and to correctly emit hoisted generic methods when they
1922 have at least 1 hoisted variable.
1924 2008-06-17 Martin Baulig <martin@ximian.com>
1926 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
1928 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
1929 virtual property; check it in Emit().
1930 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
1932 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
1934 (Indexer.Define): Likewise.
1936 2008-06-17 Marek Safar <marek.safar@gmail.com>
1938 * convert.cs: Don't use IsInterface on type arguments.
1940 * delegate.cs: DelegateInvocation uses MethodInfo.
1942 * parameter.cs: Removed IsTypeParameter.
1944 * generic-mcs.cs: More missing stuff.
1946 2008-06-16 Martin Baulig <martin@ximian.com>
1949 (Modifiers.DEBUGGER_HIDDEN): New public const.
1952 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
1955 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
1956 (AbstractPropertyEventMethod): Likewise.
1957 (Constructor.Emit): Likewise.
1958 (SourceMethod.SetCompilerGenerated): Removed.
1960 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
1964 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
1965 if we're an `IteratorHost'.
1966 (AnonymousMethodMethod..ctor): Don't set
1967 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
1970 2008-06-16 Marek Safar <marek.safar@gmail.com>
1972 * statement.cs: Clean-up foreach statements.
1974 2008-06-12 Marek Safar <marek.safar@gmail.com>
1976 * class.cs: Stop using public method which should not exist
1977 (MethodBuilder.SetGenericMethodSignature).
1979 2008-06-11 Martin Baulig <martin@ximian.com>
1982 (Location.LookupFile): Add `CompilationUnit' argument; when given
1983 a relative file name, make it relative to the directory the .cs
1984 file is located in instead of using the current directory.
1986 2008-06-11 Martin Baulig <martin@ximian.com>
1989 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
1990 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
1991 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
1992 (SourceMethod.SetCompilerGenerated): Likewise.
1994 2008-06-11 Marek Safar <marek.safar@gmail.com>
1996 * codegen.cs, driver: Only write symbol file when it's asked for.
1998 2008-06-11 Marek Safar <marek.safar@gmail.com>
2000 * codegen.cs: Don't use assembly writer error handling for symbol writer.
2002 2008-06-10 Martin Baulig <martin@ximian.com>
2004 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
2006 2008-06-09 Marek Safar <marek.safar@gmail.com>
2008 A fix for bug #316290
2009 * expression.cs: Include decimal operators in predefined table.
2011 * parameters.cs: More readonlyness.
2013 2008-06-09 Marek Safar <marek.safar@gmail.com>
2015 A fix for bug #397213
2016 * cs-parser.jay: One more missing current_local_parameters reset.
2018 2008-06-09 Marek Safar <marek.safar@gmail.com>
2020 A fix for bug #396633
2021 * class.cs: Host backing field in partial container.
2023 2008-06-09 Marek Safar <marek.safar@gmail.com>
2025 A fix for bug #397068
2026 * expression.cs: Check both operand types when predefined operator is used.
2028 2008-06-05 Martin Baulig <martin@ximian.com>
2030 Merged the `debugger-kahalo' branch.
2033 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
2034 we're an iterator method.
2035 (SourceMethod): Reflect latest symbol writer changes;
2036 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
2037 now `start_row' and `end_row'.
2038 (Constructor.Emit): Fix the logic whether to emit symbol information.
2040 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
2044 (CompilationUnit): New public class; derives from `SourceFile'.
2045 (SourceFileEntry.DefineSymbolInfo): New public method.
2046 (SourceFileEntry.SetChecksum): New public method.
2047 (Location): Encode hidden line numbers by using `column == 255';
2048 the .ctor now accepts `column == -1' to mark a hidden line number.
2049 (Location.Hidden): New public property.
2050 (Location.CheckPoint): Add `CompilationUnit'.
2051 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
2052 (Location.Push): Add `CompilationUnit compile_unit' argument.
2053 (Location.CompilationUnit): New public property.
2056 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
2058 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
2060 * driver.cs: `SourceFile' -> `CompilationUnit'.
2062 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
2064 * namespace.cs: `SourceFile' -> `CompilationUnit'.
2066 * cs-tokenizer.cs: Add support for `#pragma checksum' and
2070 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
2071 new symbol writer API to also pass the file.
2073 2008-06-05 Marek Safar <marek.safar@gmail.com>
2075 * statement.cs: Emit catch variable assignment using variable expression.
2077 2008-06-05 Marek Safar <marek.safar@gmail.com>
2079 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
2080 with other variable types.
2082 2008-06-04 Marek Safar <marek.safar@gmail.com>
2084 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
2085 GetLength method emit, it breaks resolve rules.
2087 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
2088 Marek Safar <marek.safar@gmail.com>
2090 A fix for bug #395542
2091 * cs-parser.jay: The trailing comma is allowed in anonymous type member
2094 2008-06-02 Marek Safar <marek.safar@gmail.com>
2096 A fix for bug #395287
2097 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
2099 2008-05-31 Marek Safar <marek.safar@gmail.com>
2101 A fix for bug #395845
2102 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
2103 non-nullable parameter type.
2105 2008-05-31 Marek Safar <marek.safar@gmail.com>
2107 * class.cs: Handle contructor initializer as a statement in top-level block.
2109 2008-05-30 Marek Safar <marek.safar@gmail.com>
2111 * attribute.cs: Don't mix old and new corlib types when emitting corlib
2112 security attributes.
2114 2008-05-24 Marek Safar <marek.safar@gmail.com>
2116 * ecore.cs, expression.cs: Small IVariable refactoring.
2118 2008-05-22 Marek Safar <marek.safar@gmail.com>
2120 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
2122 2008-05-21 Marek Safar <marek.safar@gmail.com>
2124 * cs-parser.jay: Removed redundant catch type check.
2126 2008-05-21 Marek Safar <marek.safar@gmail.com>
2128 A fix for bug #390372
2129 * nullable.cs: Set correct return type.
2131 2008-05-21 Marek Safar <marek.safar@gmail.com>
2133 A fix for bug #391062
2134 * typemanager.cs: Fixed crash when comparing null types.
2136 2008-05-21 Marek Safar <marek.safar@gmail.com>
2138 A fix for bug #391871
2139 * cs-parser.jay: Better error handling for invalid catch type.
2141 2008-05-20 Marek Safar <marek.safar@gmail.com>
2143 A fix for bug #392155
2144 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
2146 2008-05-15 Marek Safar <marek.safar@gmail.com>
2148 A fix for bug #390666
2149 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
2152 2008-05-15 Marek Safar <marek.safar@gmail.com>
2154 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
2157 2008-05-13 Marek Safar <marek.safar@gmail.com>
2159 A fix for bug #389625
2160 * delegate.cs, generic.cs: Some progress on method group return type
2163 2008-05-13 Marek Safar <marek.safar@gmail.com>
2165 A fix for bug #378419
2166 * namespace.cs: Inspect also parent namespaces not only namespace entries.
2168 2008-05-12 Marek Safar <marek.safar@gmail.com>
2170 * class.cs (Constructor): Added IsCompilerGenerated.
2172 2008-05-12 Marek Safar <marek.safar@gmail.com>
2174 * expression.cs: Enum binary operators can accept non-enum operand only when
2175 is implicitly convertible to underlying type.
2177 2008-05-12 Marek Safar <marek.safar@gmail.com>
2179 A fix for bug #389272
2180 * support.cs: Workaround System.InvalidOperationException for enums.
2182 2008-05-12 Marek Safar <marek.safar@gmail.com>
2184 A fix for bug #389073
2185 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
2187 2008-05-10 Marek Safar <marek.safar@gmail.com>
2189 * driver.cs: Split Parse.
2191 * location.cs (LookupFile): Uses string.Empty.
2193 2008-05-07 Marek Safar <marek.safar@gmail.com>
2195 * expression.cs, parameter.cs: Small ParameterReference clean up.
2197 2008-05-07 Marek Safar <marek.safar@gmail.com>
2199 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
2200 hack. Fixes #387502.
2202 2008-05-06 Martin Baulig <martin@ximian.com>
2204 * class.cs (Constructor.Emit): Fix the logic whether to emit
2207 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
2210 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
2211 InvalidOperationException when the iterator is before the start or
2214 2008-05-06 Marek Safar <marek.safar@gmail.com>
2216 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
2217 when left is nullable type.
2219 2008-05-06 Marek Safar <marek.safar@gmail.com>
2221 A fix for bug #386628
2222 * expression.cs (LocalVariableReference): Continue in resolving when
2223 variable is not assigned.
2225 2008-05-05 Marek Safar <marek.safar@gmail.com>
2227 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
2228 nullable operations.
2230 2008-05-04 Marek Safar <marek.safar@gmail.com>
2232 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
2233 it saves many redundant temporary variables for nullable operations.
2235 2008-05-03 Marek Safar <marek.safar@gmail.com>
2237 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
2239 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
2242 * nullable.cs: Constant coalescing operator optimizations.
2244 2008-05-03 Marek Safar <marek.safar@gmail.com>
2246 * constant.cs: Use unsigned conversion for values which are unsigned only.
2248 2008-05-03 Marek Safar <marek.safar@gmail.com>
2250 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
2251 coalescing operator as it should be.
2253 2008-05-02 Marek Safar <marek.safar@gmail.com>
2255 A fix for bug #371016
2256 * expression.cs: All predefined delegate operators require implicit method
2259 2008-05-02 Marek Safar <marek.safar@gmail.com>
2261 * constant.cs: Emit long constant as uint when fits the range.
2263 * convert.cs, expression.cs: Fixed few unsafe conversions.
2265 2008-05-02 Marek Safar <marek.safar@gmail.com>
2267 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
2269 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
2272 * convert.cs (ImplicitNumericConversion): Don't modify the type of
2274 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
2276 2008-05-01 Marek Safar <marek.safar@gmail.com>
2278 * constant.cs, literal.cs: IsLiteral property for error reporting.
2280 * ecore.cs, expression.cs: Implemented Property expression.
2282 2008-05-01 Marek Safar <marek.safar@gmail.com>
2284 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
2286 * nullable.cs: Implemented nullable coalescing null operator.
2288 * ecore.cs, expression.cs: Expression trees work.
2290 2008-05-01 Marek Safar <marek.safar@gmail.com>
2292 * ecore.cs: CreateExpressionTree is finally abstract.
2294 * expression.cs, linq.cs: Updated.
2296 2008-05-01 Marek Safar <marek.safar@gmail.com>
2298 * expression.cs, ecore.cs: Block base access expression inside expression
2301 2008-05-01 Marek Safar <marek.safar@gmail.com>
2303 A fix for bug #385058
2304 * expression.cs: User-defined operator implementations always take
2305 precedence over predefined operator implementations.
2307 2008-04-30 Marek Safar <marek.safar@gmail.com>
2309 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
2310 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
2311 expression tree conversions.
2313 2008-04-30 Marek Safar <marek.safar@gmail.com>
2315 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
2316 operators method details to Operator class.
2318 2008-04-30 Marek Safar <marek.safar@gmail.com>
2320 * anonymous.cs: Pass unsafe flags to anonymous container.
2322 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
2323 inside expression tree.
2325 2008-04-29 Martin Baulig <martin@ximian.com>
2327 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
2328 (Tokenizer.PopPosition): Also restore the `line'.
2330 2008-04-29 Marek Safar <marek.safar@gmail.com>
2332 * delegate.cs: Implemented Invoke expression.
2334 2008-04-29 Marek Safar <marek.safar@gmail.com>
2336 * expression.cs: Fixed equality reference comparison regression.
2338 2008-04-29 Marek Safar <marek.safar@gmail.com>
2340 * ecore.cs: Clean up EmptyCast hack.
2342 * expression.cs, nullable.cs: Implemented enum binary and unary operations
2343 using correct conversion rules. Also fixes #383993.
2345 2008-04-28 Martin Baulig <martin@ximian.com>
2347 * class.cs (Constructor.Emit): Don't emit debugging information
2348 for generated default .ctor's.
2350 2008-04-28 Marek Safar <marek.safar@gmail.com>
2352 * convert.cs: Empty-cast ushort to int conversion.
2354 2008-04-28 Marek Safar <marek.safar@gmail.com>
2356 A fix for bug #384191
2357 * ecore.cs, expression.cs: Fixed expression cloning.
2359 2008-04-28 Marek Safar <marek.safar@gmail.com>
2361 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
2363 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
2365 Fix #381559, test-638.cs, test-639.cs
2366 * assign.cs (CompoundAssign.Helper): New wrapper.
2367 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
2369 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
2370 Pass unconverted expressions to the params array creation expression.
2371 (FieldExpr.EmitAssign): Don't special-case StringConcat.
2372 (PropertyExpr.EmitAssign): Likewise.
2373 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
2374 element if it is of kind CompoundAssign.Helper.
2375 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
2376 first before anything else.
2377 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
2378 (ArrayAccess.LoadArrayAndArguments): Simplify.
2380 2008-04-27 Marek Safar <marek.safar@gmail.com>
2382 * expression.cs: Fixed cloning of typeof(void).
2384 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
2386 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
2387 (Assign.Emit): Likewise. Move it to ...
2388 (CompoundAssign.DoResolve): ... here and ...
2389 (CompoundAssign.Emit): ... here.
2390 (EventAddOrRemove): New helper to handle += and -= on events, and
2391 avoid the use of BinaryDelegates.
2392 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
2393 (EventExpr.EmitAddOrRemove): Improve.
2394 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
2396 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
2397 create VarExprs for 'foo.bar.var'.
2398 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
2399 is a highly inappropriate name for its functionality.
2401 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
2403 Simplify handling of multiple assignments
2404 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
2406 (SimpleAssign): New. Class to be used for normal assignments.
2407 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
2408 * expression.cs, parameter.cs, statement.cs: Likewise.
2410 2008-04-25 Marek Safar <marek.safar@gmail.com>
2412 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
2413 for incompatible underlying types, more to come, uff.
2415 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
2418 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
2419 Handle 'leave_copy'.
2421 2008-04-25 Marek Safar <marek.safar@gmail.com>
2423 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
2425 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
2427 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
2428 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
2429 * statement.cs (While, Do, For): Allow test to have side effects.
2430 (For.DoEmit): Always emit InitStatement.
2433 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
2434 Always create SideEffectConstant.
2435 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
2436 of type EnumConstant.
2438 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2439 Handle 'right' being SideEffectConstant of type 'bool'.
2441 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2442 Use left.EmitBranchable instead of open coding it, so as to
2443 improve optimization opportunities.
2445 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
2447 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
2449 (Expression.EmitSideEffect): Document.
2451 2008-04-23 Marek Safar <marek.safar@gmail.com>
2453 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
2455 2008-04-23 Marek Safar <marek.safar@gmail.com>
2457 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
2459 2008-04-23 Marek Safar <marek.safar@gmail.com>
2461 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
2462 conversion to expression tree.
2464 2008-04-23 Marek Safar <marek.safar@gmail.com>
2466 * ecore.cs: Removed unused expression.
2468 2008-04-22 Marek Safar <marek.safar@gmail.com>
2470 * expression.cs: Implemented NegateChecked and New expressions.
2472 2008-04-22 Marek Safar <marek.safar@gmail.com>
2474 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
2476 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
2479 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
2480 needing final 'ret' instruction.
2482 2008-04-22 Marek Safar <marek.safar@gmail.com>
2484 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
2486 2008-04-21 Marek Safar <marek.safar@gmail.com>
2488 * expression.cs: Emit ldnull and not null expression as an instance argument
2489 of static method expression calls.
2491 2008-04-21 Marek Safar <marek.safar@gmail.com>
2493 A fix for bug #378200
2494 * expression.cs: Fixed crash when creating parameterless expression tree
2497 2008-04-21 Marek Safar <marek.safar@gmail.com>
2499 A fix for bug #375297
2500 * anonymous.cs: Fixed crash when inferring from null argument anonymous
2503 2008-04-21 Marek Safar <marek.safar@gmail.com>
2505 A fix for bug #377596
2506 * decl.cs, class.cs: Emit delegate type argument attributes.
2508 2008-04-21 Marek Safar <marek.safar@gmail.com>
2510 A fix for bug #365314
2511 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
2513 2008-04-21 Marek Safar <marek.safar@gmail.com>
2515 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
2518 2008-04-21 Marek Safar <marek.safar@gmail.com>
2520 * generic.cs (TypeParameter): Removed redundant location.
2522 2008-04-19 Marek Safar <marek.safar@gmail.com>
2524 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
2525 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
2526 FullNamedExpression in all declaration type expression, statements will come
2529 2008-04-18 Marek Safar <marek.safar@gmail.com>
2531 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
2532 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
2534 2008-04-18 Marek Safar <marek.safar@gmail.com>
2536 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
2539 2008-04-17 Marek Safar <marek.safar@gmail.com>
2541 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
2544 2008-04-17 Marek Safar <marek.safar@gmail.com>
2546 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
2550 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
2552 Hook up 'EmitSideEffect'
2553 * constant.cs (Constant.EmitSideEffect): New.
2554 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
2555 (SideEffectConstant.EmitSideEffect): New.
2556 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
2557 unconditional branch in EmitBranchable.
2558 (FieldExpr.EmitBranchable): New.
2559 * expression.cs (Unary.EmitSideEffect): New.
2560 (Binary.EmitSideEffect): New.
2561 (VariableReference.EmitSideEffect): New. Do nothing.
2563 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
2565 Introduce 'EmitSideEffect'
2566 * ecore.cs (Expression.EmitSideEffect): New.
2567 (TypeCast): Rename from EmptyCast.
2569 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
2570 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
2571 * convert.cs, nullable.cs: Update to changes.
2573 2008-04-16 Marek Safar <marek.safar@gmail.com>
2575 * class.cs, cs-parser.jay: Early check for base types expression.
2577 2008-04-16 Marek Safar <marek.safar@gmail.com>
2579 * decl.cs (MemberName): Declare PrettyName as obsolete.
2581 2008-04-16 Marek Safar <marek.safar@gmail.com>
2583 * namespace.cs: Use MemberName comparison.
2585 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
2588 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
2590 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
2591 (MemberName.FullyQualifiedName): New. Provides the functionality
2592 that users assume FullName would have.
2593 * ecore.cs, namespace.cs: Update to changes.
2595 * statement.cs (Using.assign): Make into ExpressionStatement.
2596 (Using.EmitPreTryBody): Simplify.
2598 2008-04-16 Marek Safar <marek.safar@gmail.com>
2600 * report.cs: ColorFormat is protected.
2602 * rootcontext.cs: Unused fields clean-up.
2604 * namespace.cs: Made UsingEntry name private.
2606 2008-04-16 Marek Safar <marek.safar@gmail.com>
2608 * cs-tokenizer.cs, location.cs: Removed unused field.
2610 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
2611 Raja R Harinath <harinath@hurrynot.org>
2614 * constant.cs (SideEffectConstant.value): Rename from 'left'.
2615 (SideEffectConstant.side_effect): Rename from 'right'.
2616 (SideEffectConstant..ctor): Normalize 'side_effect'.
2617 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
2618 value of this constant.
2619 * cfold.cs: Update to changes.
2621 2008-04-15 Marek Safar <marek.safar@gmail.com>
2623 * cs-paser.jay: Removed unused variable.
2625 * driver.cs: Made Compile instance method.
2627 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
2629 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
2631 2008-04-15 Marek Safar <marek.safar@gmail.com>
2633 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
2635 2008-04-13 Jb Evain <jbevain@novell.com>
2637 * namespace.cs: update the System.Core fullname for 2.1
2638 * driver.cs: update the list of required assemblies for 2.1.
2639 Merged from the Moonlight 2 branch.
2641 2008-04-11 Marek Safar <marek.safar@gmail.com>
2643 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
2644 types and user defined operators. User operators arguments has to be checked
2645 for null value before invocation, which also means no operator is called
2646 when any argument is not convertible to unwrapped nullable type.
2648 2008-04-09 Marek Safar <marek.safar@gmail.com>
2650 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
2651 of Unary expressions to follow operator overloading rules precisely.
2652 Also fixes #321794, #323794
2654 2008-04-08 Marek Safar <marek.safar@gmail.com>
2656 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
2659 2008-04-08 Marek Safar <marek.safar@gmail.com>
2661 * expression.cs, ecore.cs: Implemented MemberInit expression.
2663 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
2665 Fix mono/tests/exception4.cs
2666 * statement.cs (ExceptionStatement, TryCatch): Revert to using
2667 ec.NeedReturnLabel () rather emitting a 'nop'.
2669 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
2671 (TryCatch.SomeCodeFollows): Likewise.
2672 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
2673 for 'break', 'continue' and 'return' statements inside a try.
2674 We're fairly sure that the generated IL stream will have more
2675 instructions textually following the try.
2676 (FlowBranchingTryCatch): Likewise.
2678 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
2679 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
2682 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
2683 wrapper -- forward everything to CollectionForeach.
2684 (CollectionForeach.NonDisposableWrapper): New.
2685 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
2686 instead of a pop + branch to end.
2688 2008-04-07 Marek Safar <marek.safar@gmail.com>
2690 A fix for bug #377485
2691 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
2692 Propagate location for extension method groups. Report conversion failure at
2695 2008-04-07 Marek Safar <marek.safar@gmail.com>
2697 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
2698 ListInit and Field expressions.
2700 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
2702 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
2703 Since $PC is always -1 inside the body of MoveNext, the fault
2705 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
2706 * statement.cs (ExceptionStatement.emit_finally): Likewise.
2707 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
2709 The denouement! Fix #324708
2710 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
2711 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
2712 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
2713 'finally' inside the finally clause.
2715 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
2716 inside an iterator. Don't emit the body of the 'finally' inside
2717 the finally clause yet.
2719 Use the ResumableStatement infrastructure for MoveNext ()
2720 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
2721 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
2722 'old_resume_points'. Move dispatcher upfront.
2723 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
2724 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
2725 in an enumerator. This encodes the main fix in this patch series
2726 -- we can only jump into the first instruction of a try from the
2727 outside, but we want to emit try/finally regions in iterators and
2728 resume in the middle of them.
2730 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
2732 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
2733 of NeedReturnLabel here.
2735 Introduce a common point for emitting try/finally to IL
2736 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
2737 features of the various subclasses, which are now driven by ...
2738 (ExceptionStatement.EmitPreTryBody): ... this and ...
2739 (ExceptionStatement.EmitTryBody): ... this and the original
2741 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
2742 Remove DoEmit and update to follow above protocol.
2744 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
2745 of the dispatcher are the same, skip emitting the 'switch'.
2746 * iterator.cs (Iterator.EmitDispose): Update to changes.
2748 Clean up handling of 'using' statement
2749 * statement.cs (UsingTemporary): New. Carved out of ...
2750 (Using): ... this. Simplify drastically. Handle exactly
2752 * cs-parser.jay (using_statement): Split. Create UsingTemporary
2753 or Using as appropriate. If there are multiple variable declared,
2754 create nested Using statements.
2755 (resource_acquisition): Kill.
2757 * statement.cs (ExceptionStatement.EmitForDispose): Use
2758 EmitFinallyBody, not EmitFinally.
2760 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
2761 * iterator.cs: Update to changes.
2763 Start using the ResumableStatement infrastructure
2764 * statement.cs (ResumeableStatement.PrepareForDispose): New.
2765 (ResumableStatement.EmitForDispose): New.
2766 (ExceptionStatement): Override them.
2767 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
2768 EmitForDispose to create the body of the Dispose method. Don't
2771 * iterator.cs (Iterator.AddResumePoint): Move here from ...
2772 * statement.cs (Toplevel.AddResumePoint): ... here.
2773 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
2774 * flowanalysis.cs (FlowBranchingIterator): New.
2775 * codegen.cs (EmitContext): Update to changes.
2777 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
2778 (Iterator.old_resume_points): Rename from 'resume_points'.
2779 (Iterator.MoveNextStatement): Remove unused class.
2781 New infrastructure for try/finally in iterators (still unused)
2782 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
2783 (FlowBranchingToplevel.AddResumePoint): Hook into
2784 ToplevelBlock.AddResumePoint.
2785 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
2786 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
2787 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
2788 resume points and assign program-counter values.
2789 (ExceptionBlock.AddResumePoint): Collect resume points for
2790 de-muxer at the top of try block.
2791 * iterators.cs (Yield.CheckContext): Simplify.
2792 (Yield.Resolve): Use FlowBranching.AddResumePoint.
2794 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
2796 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
2797 argument to an ExitStatement.
2798 (FlowBranchingException): Refactor saved origins code.
2799 * statement.cs (ExitStatement): Update to cahges.
2800 * iterator.cs (YieldBreak): Likewise.
2802 * statement.cs (ResumableStatement): New. Common base class for
2803 YieldReturn and ExceptionStatement.
2804 (ExitStatement): New. Common base class for Return and YieldBreak.
2805 (Return): Update to changes.
2806 * iterator.cs (YieldBreak): Likewise.
2807 * lambda.cs (ContextualReturn): Likewise.
2810 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
2811 emit a meaningful error message.
2813 Fix #324765, #319508
2814 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
2815 (VariableInfo.SetAssigned): Set it.
2816 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
2817 determine if CS0219 or CS0168 is appropriate. Don't use
2818 flow-analysis information.
2819 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
2820 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
2821 (EmitContext.EndFlowBranching): ... this.
2823 2008-04-03 Marek Safar <marek.safar@gmail.com>
2825 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
2827 2008-04-03 Marek Safar <marek.safar@gmail.com>
2829 A fix for bug #376508
2830 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
2831 ImplicitConversionExists.
2833 2008-04-03 Marek Safar <marek.safar@gmail.com>
2835 * expression.cs (Binary): Added remaining binary operators to expression
2838 * nullable.cs: Optimize shift with null argument.
2840 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
2842 Fix minor IL regression
2843 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
2844 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
2845 * cs-parser.jay (try_statement): Update to changes.
2847 * statement.cs (TryFinally.need_exc_block): Delete.
2848 (TryFinally): Update to changes.
2850 Now all ExceptionStatements are unconditional
2851 * statement.cs (CollectionForeach.DisposableWrapper): New.
2852 Extract out the try/finally code into a new wrapper.
2853 (CollectionForeach.Resolve): Use it to simplify the code.
2855 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
2857 Start at simplifying ExceptionStatement semantics a bit
2858 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
2859 * cs-parser.jay (try_statement): Update to changes.
2860 (opt_catch_clauses): Remove.
2861 * flowanalysis.cs: Update to changes.
2862 (FlowBranching.BranchingType.TryCatch): New.
2863 (FlowBranchingTryCatch): New.
2865 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
2866 (FlowBranching.CreateBranching): Update to changes.
2867 (FlowBranchingBlock.AddSibling): Add sanity check.
2868 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
2871 * iterators.cs (Iterator.MarkFinally): Remove.
2872 * statement.cs (ExceptionStatement): Update to changes.
2874 Add support for skipping over finally blocks at runtime. First
2875 in a series to fix #324708
2876 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
2877 (Iterator.EmitMoveNext): Initialize it.
2878 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
2879 branch over the body of the 'finally' clause.
2881 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
2883 Avoid lopsided use of Foo/DoFoo names
2884 * statement.cs (ExpressionStatement.EmitFinallyBody):
2885 Rename from EmitFinally.
2886 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
2887 * iterator.cs: Update to changes.
2889 2008-04-02 Marek Safar <marek.safar@gmail.com>
2891 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
2892 based on UserOperatorCall. More binary nullable operators clean up.
2894 2008-04-02 Martin Baulig <martin@ximian.com>
2896 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
2898 2008-04-02 Marek Safar <marek.safar@gmail.com>
2900 * nullable.cs: Merge user and empty conversions when lifting expression
2903 * expression.cs (StringConcat): Implemented expression tree representation.
2905 2008-04-01 Marek Safar <marek.safar@gmail.com>
2907 * nullable.cs: When lifting null literal and a user operator exists, no call
2910 2008-04-01 Marek Safar <marek.safar@gmail.com>
2912 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
2915 2008-04-01 Marek Safar <marek.safar@gmail.com>
2917 * nullable.cs, expression.cs: Use namespace instead heavily nested
2918 monster abstract class.
2920 2008-04-01 Marek Safar <marek.safar@gmail.com>
2922 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
2923 lifting of null literal and user operators. Clean up of some temporary
2926 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
2928 Fix #368224, test-629.cs
2929 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
2930 if it crossed an unwind-protect boundary.
2931 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
2932 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
2933 inside an unwind-protected region.
2934 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
2935 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
2936 'leave' instead of a 'br' if unwind-protected.
2937 (Iterator.EmitYieldBreak): Likewise.
2939 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
2941 * driver.cs: Only define versioninfo resources if no win32 resource
2944 2008-03-28 Marek Safar <marek.safar@gmail.com>
2946 A fix for bug #372375
2947 * convert.cs: Fixed boxing of nullable types.
2949 2008-03-28 Marek Safar <marek.safar@gmail.com>
2951 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
2954 2008-03-28 Marek Safar <marek.safar@gmail.com>
2956 A fix for bug #374619
2957 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
2959 2008-03-27 Marek Safar <marek.safar@gmail.com>
2961 * lambda.cs: Check return type only for invocation.
2963 2008-03-27 Marek Safar <marek.safar@gmail.com>
2965 A fix for bug #374214
2966 * ecore.cs: Correctly report argument type mismatch.
2968 2008-03-27 Marek Safar <marek.safar@gmail.com>
2970 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
2971 and not rely on broken IsEnum.
2973 2008-03-27 Marek Safar <marek.safar@gmail.com>
2975 * nullable.cs: New file, extracted from generic.cs.
2977 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
2979 2008-03-27 Marek Safar <marek.safar@gmail.com>
2981 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
2982 predefined comparison operators and null literals.
2984 * report.cs: New warning ID.
2986 2008-03-25 Marek Safar <marek.safar@gmail.com>
2988 A fix for bug #370577
2989 * lambda.cs: Check return type too.
2991 2008-03-25 Marek Safar <marek.safar@gmail.com>
2993 A fix for bug #372846
2994 * class.cs: Automatic properties can be declared as unsafe.
2996 2008-03-20 Marek Safar <marek.safar@gmail.com>
2998 * location.cs: Use string based concatenation.
3000 * expression.cs: LiftedBinaryOperator is gmcs only.
3002 2008-03-20 Marek Safar <marek.safar@gmail.com>
3004 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
3005 conversions rules and expression trees.
3007 2008-03-19 Marek Safar <marek.safar@gmail.com>
3009 * delegate.cs: Use extension method source as delegate target.
3011 2008-03-19 Marek Safar <marek.safar@gmail.com>
3013 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
3014 binary operations to be purely based on binary operations and optimized
3015 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
3016 and other ET refactoring.
3018 * typemanager.cs: Fixed warning.
3020 2008-03-17 Marek Safar <marek.safar@gmail.com>
3022 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
3024 * symbolwriter.cs: Fixed.
3026 2008-03-17 Marek Safar <marek.safar@gmail.com>
3028 * anonymous.cs, driver.cs: Reset anonymous types counters.
3030 2008-03-17 Marek Safar <marek.safar@gmail.com>
3032 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
3034 * class.cs: Use fullname for all type member definitions.
3036 2008-02-19 Martin Baulig <martin@ximian.com>
3039 (IMethodData.EmitExtraSymbolInfo): New interface method.
3040 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
3041 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
3042 interface method here as an empty public virtual method.
3045 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
3046 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
3047 CodeGen.SymbolWriter.SetRealMethodName().
3049 2008-02-18 Martin Baulig <martin@ximian.com>
3052 (ScopeInfo.EmitType): Override this and emit debugging
3053 information for captured variables.
3054 (RootScopeInfo.EmitType): Override this and emit symbol
3055 information for a captured `this'.
3057 2008-02-15 Martin Baulig <martin@ximian.com>
3059 * iterators.cs: Emit debugging info.
3062 (EmitContext.Flags): Add `OmitDebuggingInfo'.
3063 (EmitContext.OmitDebuggingInfo): New public property.
3066 (While): Override Emit() and don't emit symbol info there; do it
3067 inside DoEmit() instead.
3068 (Block.Emit): Omit symbol information while emitting the scope
3069 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
3071 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
3072 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
3073 .ctor to make `IsIterator' work.
3075 2008-03-14 Martin Baulig <martin@ximian.com>
3077 * symbolwriter.cs: Added the new symbol writer function from the
3078 debugger's `terrania' branch; temporarily enclose them inside
3079 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
3082 2008-03-14 Martin Baulig <martin@ximian.com>
3085 (SymbolWriter): Make this a public static class.
3088 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
3089 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
3091 2008-03-14 Marek Safar <marek.safar@gmail.com>
3093 A fix for bug #370577
3094 * statement.cs, lambda.cs: Added extra limitations when dealing with void
3097 2008-03-14 Marek Safar <marek.safar@gmail.com>
3099 * typemanager.cs (CSharpName): Made 250 times faster.
3101 2008-03-13 Marek Safar <marek.safar@gmail.com>
3103 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
3105 2008-03-12 Marek Safar <marek.safar@gmail.com>
3107 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
3108 crash when predefined field does not exist.
3110 2008-03-12 Marek Safar <marek.safar@gmail.com>
3112 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
3114 2008-03-12 Marek Safar <marek.safar@gmail.com>
3116 * class.cs (FixedField): Don't crash when contructors are missing.
3118 2008-03-11 Marek Safar <marek.safar@gmail.com>
3120 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
3121 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
3122 check internal types accessibility for internal and external types.
3123 Replaced EnumToUnderlying by GetEnumUnderlyingType.
3125 2008-03-11 Marek Safar <marek.safar@gmail.com>
3127 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
3128 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
3129 attribute.cs, statement: Use corect instance of predefined types (work
3130 related to #364674).
3132 2008-03-07 Marek Safar <marek.safar@gmail.com>
3134 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
3136 2008-03-07 Marek Safar <marek.safar@gmail.com>
3138 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
3139 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
3140 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
3141 predefined types clean up, delayed predefined types members initialization
3142 (work related to #364674).
3144 2008-03-05 Marek Safar <marek.safar@gmail.com>
3146 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
3148 2008-03-05 Marek Safar <marek.safar@gmail.com>
3150 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
3151 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
3152 predefined types clean up (work related to #364674).
3154 2008-03-04 Marek Safar <marek.safar@gmail.com>
3156 * ecore.cs: Print an error message instead of throwing exception.
3158 2008-03-04 Marek Safar <marek.safar@gmail.com>
3160 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
3161 expression.cs, statement.cs: Unififed null literal representation.
3163 2008-03-03 Marek Safar <marek.safar@gmail.com>
3165 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
3166 expression.cs: Refactored binary operators resolve phase and improved speed.
3167 The nullable code is still missing and won't work correctly, more fixes
3170 It also fixes #323726, #324312, #324248, and many other unreported issues.
3172 2008-02-29 Zoltan Varga <vargaz@gmail.com>
3174 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
3177 2008-02-27 Marek Safar <marek.safar@gmail.com>
3179 * ecore.cs: Clean-up and split BetterConversion.
3181 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
3184 * enum.cs (EnumMember.Value): Only access 'value' if
3185 ResolveValue says it's ok.
3186 (EnumMember.DoResolveValue): Don't set prev_member.value.
3187 (Enum.GetDefinition): Reverse arguments of Equals --
3188 EnumMember.Value can return 'null'.
3190 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
3192 2008-02-22 Marek Safar <marek.safar@gmail.com>
3194 * generic.cs, expression.cs: More ongoing work on expression trees.
3196 2008-02-21 Marek Safar <marek.safar@gmail.com>
3198 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
3199 handle missing matches when mutiple operators exist.
3201 2008-02-20 Marek Safar <marek.safar@gmail.com>
3203 A fix for bug #363218
3204 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
3207 2008-02-20 Marek Safar <marek.safar@gmail.com>
3209 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
3210 update. This time to deal correctly with SideEffectConstant expression used
3211 as an argument for another constant folding.
3213 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
3215 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
3218 2008-02-19 Marek Safar <marek.safar@gmail.com>
3220 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
3222 2008-02-19 Marek Safar <marek.safar@gmail.com>
3224 A fix for bug #328136
3225 * expression.cs: Do not fold immediately LogicalAnd operators when the left
3226 side is a false constant, because we still need to evaluate the right-hand
3229 * statement.cs (If): Emit two types of boolean constants (simple constant,
3230 side-effect constant).
3232 2008-02-19 Marek Safar <marek.safar@gmail.com>
3234 * constant.cs (SideEffectConstant): Don't emit boolean constant.
3236 * expression.cs: Fold immediately LogicalAnd operators when both sides are
3239 2008-02-18 Marek Safar <marek.safar@gmail.com>
3241 A fix for bug #361457
3242 * ecore.cs (IsApplicable): Params methods have lower priority.
3244 * support.cs: Return correct parameter modifier for params types.
3246 2008-02-18 Marek Safar <marek.safar@gmail.com>
3248 * generic.cs (TypeParameter): Cache attribute target name.
3250 * support.cs: Removed unused variable.
3252 * typemanager.cs: Removed debugging leftover.
3254 * ecore.cs: Use local type instead of a property;
3256 * class.cs (VerifyMembers): Consider also parent to test whether type member
3259 * expression.cs (FullMethodDesc): Removed.
3261 * attribute.cs (IsValidArgumentType): Made static.
3263 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
3265 Cleanup to be more readable.
3266 * Makefile (GMCS_PROFILE): Remove.
3267 (COMPILER_NAME): New helper.
3269 2008-02-15 Miguel de Icaza <miguel@novell.com>
3271 * cs-tokenizer.cs: if a conditional expression happens inside a
3272 (...) this also means that we do not need to de-ambiguate between
3273 an parenthesized expression and a cast.
3277 * constant.cs (SideEffectConstant): a constant value that happens
3278 to have a side effect.
3280 Fixes the build regressions introduced by the fix for #359789
3282 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
3284 * expression.cs (Conditional.Emit): when emitting the ternary
3285 operator, use local variables to generate code verifiable code.
3287 The verifier cannot infer that the type on stack before the
3288 stloc.0 is executed is of type ParentB. This happens because the
3289 stack merge algorithm uses only parent types when deciding which
3290 is the common type. This is described in Part III 1.8.1.3 of ECMA
3293 This code compiled with mcs is not verifiable under MS. The MS
3294 verifier picks the first common interface of Foo and Bar, which is
3295 wrong, but doesn't use a full join type of the 2 interfaces.
3297 CSC uses a clever hack to compile such code in a verifiable
3298 way. It stores the intermediate values in a local variable with
3303 2008-02-14 Miguel de Icaza <miguel@novell.com>
3305 * expression.cs: Do not fold BitwiseAnd operators when the left
3306 side is a false constant, because we still need to evaluate the
3311 * support.cs: Instead of throwing an InternalErrorException when
3312 the position of the stream is outside the boundary of our buffer,
3313 reset the state of the reader, and restart the reading from the
3314 beginning of the file.
3316 2008-02-14 Marek Safar <marek.safar@gmail.com>
3318 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
3320 2008-02-14 Marek Safar <marek.safar@gmail.com>
3322 A fix for bug #361686
3323 * decl.cs: A protected types used inside a private class which parents
3324 derives from the protected class are accessible.
3326 2008-02-13 Marek Safar <marek.safar@gmail.com>
3328 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
3329 the parameterless constructor.
3331 2008-02-13 Marek Safar <marek.safar@gmail.com>
3333 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
3334 lookup methods to use standard member cache when doing member lookup.
3336 2008-02-12 Marek Safar <marek.safar@gmail.com>
3338 * driver.cs: Don't report full path for referenced module as assembly error.
3340 2008-02-12 Marek Safar <marek.safar@gmail.com>
3342 * Makefile: Fixed `qh' target to work on all machines.
3344 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
3345 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
3346 and HasElementType with TypeManager implementation.
3348 2008-02-08 Marek Safar <marek.safar@gmail.com>
3350 A fix for bugs #325134, #359749
3351 * expression.cs, ecore.cs: Try to resolve an extension method even if the
3352 first binds point to non-method member expression.
3354 2008-02-08 Marek Safar <marek.safar@gmail.com>
3356 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
3358 2008-02-08 Marek Safar <marek.safar@gmail.com>
3360 A fix for bugs #321394, #323028
3361 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
3362 Reworked naive IsAccessibleAs implementation to handle nested types.
3364 2008-02-05 Jb Evain <jbevain@novell.com>
3366 * class.cs: use generic type comparison for parameters
3369 2008-02-05 Marek Safar <marek.safar@gmail.com>
3371 A fix for bug #325372
3372 * class.cs: Use generic type comparison when testing method signatures.
3374 2008-02-05 Marek Safar <marek.safar@gmail.com>
3376 A fix for bug #357047
3377 * ecore.cs: Applied C# 3.0 changes to better conversion.
3379 2008-02-05 Marek Safar <marek.safar@gmail.com>
3381 A fix for bug #358374
3382 * cs-parser.jay: Correctly set modifiers for all constructor types.
3384 2008-02-04 Marek Safar <marek.safar@gmail.com>
3386 A fix for bug #355251
3387 * generic.cs: Added base class constraint based type inference.
3389 2008-02-01 Marek Safar <marek.safar@gmail.com>
3391 A fix for bug #357255
3392 * decl.cs: One more missing visibility check.
3394 2008-02-01 Marek Safar <marek.safar@gmail.com>
3396 * support.cs: Fixed broken return.
3398 2008-01-25 Marek Safar <marek.safar@gmail.com>
3400 * report.cs: Correctly reset warnings count after probing.
3402 2008-01-25 Martin Baulig <martin@ximian.com>
3405 (NamespaceEntry.SymbolFileID): Make this work again after
3406 MemberName.ToString() is gone.
3408 2008-01-25 Marek Safar <marek.safar@gmail.com>
3410 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
3413 2008-01-25 Marek Safar <marek.safar@gmail.com>
3415 * generic.cs: Use full implicit conversion for type inference fixing.
3417 2008-01-24 Marek Safar <marek.safar@gmail.com>
3419 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
3420 Fixed user operator conversions.
3422 2008-01-24 Marek Safar <marek.safar@gmail.com>
3424 * generic.cs: Do nullable type to null comparison optimization during
3427 2008-01-24 Marek Safar <marek.safar@gmail.com>
3429 A fix for bug #355163
3430 * generic.cs: Enabled l-value resolve on nullable expressions.
3432 2008-01-24 Marek Safar <marek.safar@gmail.com>
3434 A fix for bug #353986
3435 * class.cs: Ingore static ctors with parameters for any further checks.
3437 2008-01-24 Marek Safar <marek.safar@gmail.com>
3439 A fix for bug #354310
3440 * namespace.cs: Removed redundant check.
3442 2008-01-24 Marek Safar <marek.safar@gmail.com>
3444 A fix for bug #354928
3445 * expression.cs: ElementInitializers can be resolved only once.
3447 2008-01-24 Marek Safar <marek.safar@gmail.com>
3449 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
3450 Condition expressions.
3452 2008-01-23 Marek Safar <marek.safar@gmail.com>
3454 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
3456 2008-01-22 Marek Safar <marek.safar@gmail.com>
3458 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
3461 * generic.cs: Implemented coalesce expression.
3463 2008-01-22 Marek Safar <marek.safar@gmail.com>
3465 A fix for bug #355145
3466 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
3467 expression tree type inference.
3469 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
3472 * expression.cs (Binary.IsUnsignedType): Fix typo.
3474 2008-01-22 Marek Safar <marek.safar@gmail.com>
3476 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
3478 2008-01-22 Marek Safar <marek.safar@gmail.com>
3480 A fix for bug #355161
3481 * ecore.cs, expression.cs: Wider range of extension method supported
3484 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
3486 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
3487 AssemblyBuilder to operate in compiler context. Fixes mcs part of
3490 2008-01-22 Marek Safar <marek.safar@gmail.com>
3492 A fix for bug #355148
3493 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
3495 2008-01-22 Miguel de Icaza <miguel@novell.com>
3497 * expression.cs (CreateExpressionTree): Add support for or and
3498 logical or, and indent following the coding conventions.
3500 * typemanager.cs (LinqExpression): renamed from
3501 ExpressionTreeManager, for a shorter name.
3503 Use TypeManager.CoreLookupType to lookup types from our core
3504 assemblies and turn those into "Type" variables.
3506 Consumers that previously used "Namespace" and "Type" from this
3507 class should instead use the TypeExpression which is a type that
3508 is fully resolved (without involving the regular C# resolution
3511 This typically looks like this:
3513 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
3514 new MemberAccess (texpr, name, type_arguments, loc)
3516 This avoids the problem in: #355178
3518 2008-01-21 Marek Safar <marek.safar@gmail.com>
3520 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
3521 feature in parser only as we do in other cases.
3523 2008-01-21 Marek Safar <marek.safar@gmail.com>
3525 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
3526 typemanager.cs: A refactoring of params arguments to reuse existing
3527 expressions (params -> array initializer) to emit params argument instead
3528 of specialized handling.
3529 It was required by expression tree implementation and it has other benefits
3530 as well, we now apply same optimization for params arguments as we do for
3533 2008-01-18 Marek Safar <marek.safar@gmail.com>
3535 A fix for bug #353526
3536 * generic.cs: A type inference of params arguments may not required any
3537 temporary array creation.
3539 2008-01-18 Marek Safar <marek.safar@gmail.com>
3541 A fix for bug #353534
3542 * generic.cs, ecore.cs, expression.cs: A method group type inference is
3543 supported for delegates only.
3545 2008-01-18 Marek Safar <marek.safar@gmail.com>
3547 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
3548 type for more than 1 candidates.
3550 2008-01-18 Marek Safar <marek.safar@gmail.com>
3552 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
3555 2008-01-16 Marek Safar <marek.safar@gmail.com>
3557 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
3558 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
3559 operator) expressions.
3561 2008-01-16 Zoltan Varga <vargaz@gmail.com>
3563 * statement.cs: Avoid declaring an IL variable for this_variable since it is
3564 not accessed from the generated IL.
3566 2008-01-14 Marek Safar <marek.safar@gmail.com>
3568 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
3569 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
3570 statement.cs: The first expression tree implementation drop, mostly
3571 infrastructure work.
3573 2008-01-14 Marek Safar <marek.safar@gmail.com>
3575 * ecore.cs (IsNestedChild): Refactored.
3577 2008-01-11 Marek Safar <marek.safar@gmail.com>
3579 * lambda.cs: Don't use a cast on unknown expression statement.
3581 2008-01-10 Geoff Norton <gnorton@novell.com>
3583 * cs-tokenizer.cs: One more token to distinguish between method and lambda
3586 2008-01-09 Marek Safar <marek.safar@gmail.com>
3588 * doc.cs: Report better /doc crash details.
3590 2008-01-09 Marek Safar <marek.safar@gmail.com>
3592 A fix for bug #352536
3593 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
3595 2008-01-08 Marek Safar <marek.safar@gmail.com>
3597 A fix for bug #352287
3598 * ecore.cs, expression.cs: Do `this' access checking in all member access
3601 2008-01-08 Marek Safar <marek.safar@gmail.com>
3603 * rootcontext.cs, driver.cs: Switch to linq mode by default.
3605 * report.cs: Reset message stacks.
3607 2008-01-08 Marek Safar <marek.safar@gmail.com>
3609 * generic.cs (InferInPhases): Correctly calculate params position.
3611 2008-01-08 Marek Safar <marek.safar@gmail.com>
3613 * cs-tokenizer.cs: No need to parse full string when parsing lambda
3616 2008-01-07 Marek Safar <marek.safar@gmail.com>
3618 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
3620 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
3622 * driver.cs: Updated --help option.
3624 2008-01-07 Marek Safar <marek.safar@gmail.com>
3626 * generic.cs (InferParamsTypeArguments): Removed.
3627 (InferInPhases): Add params type inference.
3628 (LowerBoundInference): Fixed scoring mechanism.
3630 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
3632 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
3634 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
3635 byte array for unsigned "baked" assemblies.
3637 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
3639 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
3640 array for assemblies that are not strongnamed.
3642 2008-01-04 Marek Safar <marek.safar@gmail.com>
3644 A fix for bug #351481
3645 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
3646 declaring type for nested generic types.
3648 2008-01-04 Marek Safar <marek.safar@gmail.com>
3650 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
3651 instead of ToString.
3653 2008-01-03 Marek Safar <marek.safar@gmail.com>
3655 A fix for bug #351047
3656 * expression.cs (Binary.ResolveOperator): Allow equality operators between
3657 null and structs only when equality and inequality operators are defined
3658 either as an user-operators or predefined operators.
3660 2008-01-03 Marek Safar <marek.safar@gmail.com>
3662 A fix for bug #351047
3663 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
3665 2008-01-03 Marek Safar <marek.safar@gmail.com>
3667 A fix for bug #351257
3668 * cs-tokenizer.cs: Advance line number for '\r' correctly.
3670 2008-01-03 Marek Safar <marek.safar@gmail.com>
3672 A fix for bug #351157
3673 * class.cs (Using): Fixed yet another broken cloning.
3675 (Block): Put back more sensible default value for statements.
3677 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
3679 * codegen.cs: Allow AssemblyVersion with only major version component.
3682 2007-12-29 Marek Safar <marek.safar@gmail.com>
3684 A fix for bug #324654
3685 * class.cs: Use FullName property as member name.
3687 2007-12-28 Marek Safar <marek.safar@gmail.com>
3689 A fix for bug #342117
3690 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
3691 constructor constraint.
3693 2007-12-28 Marek Safar <marek.safar@gmail.com>
3695 A fix for bug #338273
3696 * class.cs (ProbertyBase): Access modifier checks are required for overrides
3699 2007-12-28 Marek Safar <marek.safar@gmail.com>
3701 A fix for bug #350839
3702 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
3704 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
3706 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3709 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
3711 * statement.cs: Changed some Hashtables to use HybridDictionaries
3712 instead. It was observed that some HashTables only contained a few
3713 items in the vast majority of cases. Since HybridDictionary is
3714 more efficient on small sets (<10 elements), "known_variables"
3715 from class ExplicitBlock as well as "labels" and "constants " from
3716 class Block were changed to HybridDictionaries.
3718 Atsai results: (56216kb->54987kb)
3720 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
3723 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
3725 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3728 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
3730 * expression.cs: foreach loop to for loop, saved on allocation of
3731 enumerator (59333kb->59141kb)
3733 * statement.cs. Changed foreach loops to for loops, saved on
3734 allocation of enumerator (59141kb->59006kb)
3736 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
3737 when constructed with no specified capacity. This was causing a
3738 few ArrayLists to allocate more memory than they would potentially
3739 need in the Block class and MemberCache class. Setting the
3740 ArrayLists to construct with a capacity of 1 saves some
3741 memory. (56216kb->55585kb)
3743 2007-12-27 Marek Safar <marek.safar@gmail.com>
3745 A fix for bug #347189 (2nd issue)
3746 * expression.cs (MemberAccess): Nested type can be found in base non-generic
3749 2007-12-27 Miguel de Icaza <miguel@novell.com>
3751 * report.cs: Do not use colors if stdout and stderr are not a
3754 2007-12-27 Marek Safar <marek.safar@gmail.com>
3756 A fix for bug #346998
3757 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
3760 2007-12-27 Marek Safar <marek.safar@gmail.com>
3762 A fix for bug #343465
3763 * class.cs: Explicit method name for nested types uses dots only.
3765 2007-12-27 Marek Safar <marek.safar@gmail.com>
3767 A fix for bug #343707
3768 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
3770 2007-12-27 Marek Safar <marek.safar@gmail.com>
3772 * ecore.cs: Report type inference errors only when arguments count matches
3775 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
3777 * expression.cs, report.cs: New warning.
3779 * typemanager.cs: Catch anonymous method type too.
3781 2007-12-23 Marek Safar <marek.safar@gmail.com>
3783 A fix for bug #346379
3784 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
3786 2007-12-23 Marek Safar <marek.safar@gmail.com>
3788 A fix for bug #347359
3789 * expression.cs (Invocation): Don't resolve already resolved expression.
3791 2007-12-23 Marek Safar <marek.safar@gmail.com>
3793 A fix for bug #347189
3794 * class.cs (FixedField): Use non-dependent code only in the define phase.
3796 2007-12-23 Marek Safar <marek.safar@gmail.com>
3798 A fix for bug #348076
3799 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
3801 2007-12-22 Marek Safar <marek.safar@gmail.com>
3803 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
3804 discovered extension methods.
3806 2007-12-22 Marek Safar <marek.safar@gmail.com>
3808 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
3811 2007-12-21 Miguel de Icaza <miguel@novell.com>
3813 * report.cs (ErrorMessage): Add support for using colors on
3814 terminals that support it.
3816 2007-12-21 Marek Safar <marek.safar@gmail.com>
3818 * ecore.cs: Use information about expanded params for error reporting.
3820 2007-12-21 Marek Safar <marek.safar@gmail.com>
3822 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
3823 and logic for params overloads.
3825 2007-12-15 Miguel de Icaza <miguel@novell.com>
3827 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
3828 as this is also created from the parser. Fixes #349034
3830 2007-12-12 Miguel de Icaza <miguel@novell.com>
3832 * statement.cs (Throw.CloneTo): it is valid to have empty
3833 expressions for throw.
3835 2007-12-03 Marek Safar <marek.safar@gmail.com>
3837 * cs-parser.jay: Set delegate constraint parsing region correctly.
3839 2007-12-03 Marek Safar <marek.safar@gmail.com>
3841 A fix for bug #345467
3842 * typemanager.cs (IsEqual): Compare generic parameters position only.
3844 2007-11-28 Marek Safar <marek.safar@gmail.com>
3846 * expression.cs (BaseAccess): Type arguments can be null.
3848 2007-11-27 Raja R Harinath <harinath@gmail.com>
3850 * statement.cs (Block.Resolve): Ensure flow-branching tree is
3851 consistent even when an error has occured.
3852 (Switch.Resolve): Likewise.
3854 2007-11-22 Marek Safar <marek.safar@gmail.com>
3856 A fix for bug #334505
3857 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
3860 2007-11-22 Marek Safar <marek.safar@gmail.com>
3862 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
3863 refactorings required to resolve extension methods correctly when mixing
3864 generics and non-generics members.
3866 2007-11-20 Marek Safar <marek.safar@gmail.com>
3868 A fix for bug #342584
3869 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
3872 2007-11-19 Marek Safar <marek.safar@gmail.com>
3874 A fix for bug #342512
3875 * delegate.cs: Use delegate argument expression when is available. Don't
3876 emit virtual call when class is sealed.
3878 2007-11-16 Marek Safar <marek.safar@gmail.com>
3880 A fix for bug #325423
3881 * assign.cs (FieldInitializer): Use resolved expression for emit.
3883 * class.cs: Print less confusing error message.
3885 2007-11-16 Marek Safar <marek.safar@gmail.com>
3887 * cs-tokenizer.cs: Removed GMCS ifdefs.
3889 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
3892 * cs-parser.jay: Disabled nullable check.
3894 * generic-mcs: Copied more generic stuff.
3896 2007-11-16 Marek Safar <marek.safar@gmail.com>
3898 * gcs-parser.jay: Merged to cs-parser.jay.
3900 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
3901 * *.csproj, *.sources: Updated to use only jay parser file.
3903 2007-11-16 Marek Safar <marek.safar@gmail.com>
3905 * gcs-parser.jay: Added nullable and default expression feature checks.
3907 2007-11-16 Marek Safar <marek.safar@gmail.com>
3909 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
3910 it fixes many TODOs and hidden bugs.
3912 * expression: Removed duplicate error check.
3914 2007-11-15 Marek Safar <marek.safar@gmail.com>
3916 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
3917 implicitly type local variable only when it is used in a declaration.
3919 2007-11-15 Marek Safar <marek.safar@gmail.com>
3921 * attribute.cs: Use CS0612 for empty strings.
3923 2007-11-14 Marek Safar <marek.safar@gmail.com>
3925 * lambda.cs, statement.cs: Contextual return may act as a statement.
3927 2007-11-14 Marek Safar <marek.safar@gmail.com>
3929 A fix for a regression cause by #324222
3930 * class.cs: Don't report unused even when it implements an interface.
3932 2007-11-13 Marek Safar <marek.safar@gmail.com>
3934 A fix for bug #341205
3935 * ecore.cs, expression.cs: Method group expression cannot do static
3936 method access with an instance reference check before overloading takes
3939 2007-11-13 Marek Safar <marek.safar@gmail.com>
3941 A fix for bug #325359
3942 * class.cs: Use predictable name for automatically generated property.
3944 2007-11-12 Marek Safar <marek.safar@gmail.com>
3946 A fix for bug #324996
3947 * expression.cs (Is): Handle case where D is nullable and T is not
3950 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
3952 2007-11-12 Marek Safar <marek.safar@gmail.com>
3954 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
3955 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
3956 Flush small error reporting changes.
3958 2007-11-09 Marek Safar <marek.safar@gmail.com>
3960 A fix for bug #324996
3961 * expression.cs: Rewrote Is expression implementation to work with
3962 generics, nullable types, anonymous method. A const result expression
3963 uses existing infrastructure instead of custom not fully-featured one.
3965 2007-11-08 Marek Safar <marek.safar@gmail.com>
3967 A fix for bug #340202
3968 * class.cs: Consider generics for volatile field.
3970 2007-11-08 Marek Safar <marek.safar@gmail.com>
3972 A fix for bug #335594
3973 * expression.cs: Use conversion rules when handling string addition.
3975 2007-11-07 Marek Safar <marek.safar@gmail.com>
3977 A fix for bug #336651
3978 * expression.cs: Fixed a crash when probing is on.
3980 2007-11-07 Marek Safar <marek.safar@gmail.com>
3982 A fix for bug #324242
3983 * covert.cs: Added a conversion from any nullable-type with an
3984 underlying enum-type to the type System.Enum.
3986 2007-11-07 Marek Safar <marek.safar@gmail.com>
3988 A fix for bug #324222
3989 * class.cs: Report all non-used event fields.
3991 2007-11-07 Marek Safar <marek.safar@gmail.com>
3993 A fix for bug #325161
3994 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
3995 qualifier for generic types.
3997 2007-11-07 Marek Safar <marek.safar@gmail.com>
3999 A fix for bug #322971
4000 * expression.cs, ecore.cs: Added intermediate result value check for
4003 2007-11-07 Marek Safar <marek.safar@gmail.com>
4005 A fix for bug #324754
4006 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
4007 when it was requested.
4009 2007-11-07 Marek Safar <marek.safar@gmail.com>
4011 A fix for bug #325101
4012 * expression.cs: Do type not value comparison for `is' expression.
4014 2007-11-07 Marek Safar <marek.safar@gmail.com>
4016 A fix for bug #320236
4017 * convert.cs: Don't apply user conversion on underlying target type.
4019 2007-11-06 Marek Safar <marek.safar@gmail.com>
4021 * expression.cs: Don't use unresolved expression for error reporting.
4023 2007-11-06 Marek Safar <marek.safar@gmail.com>
4025 A fix for bugs #337712, #324490
4026 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
4027 overloading resolution too.
4029 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
4030 the process consistent and more robust.
4032 * expression.cs, linq.cs, report.cs: Update.
4034 2007-11-02 Marek Safar <marek.safar@gmail.com>
4036 A fix for bug #332909
4037 * attribute.cs: Resolve attributes in correct context using error
4040 * rootcontext.cs: Define Obsolete attribute members as core members.
4042 2007-11-02 Marek Safar <marek.safar@gmail.com>
4044 * statement.cs: Removed unused methods.
4046 2007-10-31 Wade Berrier <wberrier@novell.com>
4048 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
4049 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
4052 2007-10-31 Marek Safar <marek.safar@gmail.com>
4054 A fix for bug #338102
4055 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
4056 methods registered as non-generics.
4058 2007-10-31 Marek Safar <marek.safar@gmail.com>
4060 A fix for bugs #337712, #324490
4061 * delegate.cs: Delegate covariance and contravariance is not allowed for
4064 2007-10-31 Marek Safar <marek.safar@gmail.com>
4066 A fix for bug #337719
4067 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
4070 2007-10-30 Marek Safar <marek.safar@gmail.com>
4072 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
4074 2007-10-29 Marek Safar <marek.safar@gmail.com>
4076 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
4079 2007-10-29 Raja R Harinath <rharinath@novell.com>
4081 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
4083 2007-10-29 Marek Safar <marek.safar@gmail.com>
4085 A fix for bug #334652
4086 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
4087 extension methods when we have not found the best candidate in normal
4090 2007-10-27 Marek Safar <marek.safar@gmail.com>
4092 * AssemblyInfo.cs: Keep up-to-date.
4094 2007-10-27 Marek Safar <marek.safar@gmail.com>
4096 * Makefile: Fixed generics compiler name.
4098 2007-10-27 Marek Safar <marek.safar@gmail.com>
4100 * lambda.test: removed, lambda parsing is done differently.
4102 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
4104 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
4106 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
4108 2007-10-27 Marek Safar <marek.safar@gmail.com>
4110 * Makefile, *.sources : All C# compilers are in mcs folder.
4112 * *.cs: Use existing 2_1 define for smcs.
4114 2007-10-26 Marek Safar <marek.safar@gmail.com>
4116 A fix for bug #335847
4117 * assign.cs, expression.cs: Couple of changes to avoid creating a
4118 temporary variable for each object initializer assignment statement. It
4119 simplifies struct initialization too, otherwise two temporary variables
4121 Implemented optimization of redundant default element initializers.
4123 2007-10-25 Marek Safar <marek.safar@gmail.com>
4125 A fix for bug #336766
4126 * expression.cs (Class.CheckBase): Use generic name when method is
4129 2007-10-25 Marek Safar <marek.safar@gmail.com>
4131 A fix for bug #334737
4132 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
4133 variable and not variable argument for prepared copies.
4135 2007-10-24 Marek Safar <marek.safar@gmail.com>
4137 A fix for bug #325110
4138 * class.cs, expression.cs, attribute.cs: Use open generic method when
4139 checking conditional attribute.
4141 2007-10-24 Marek Safar <marek.safar@gmail.com>
4143 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
4144 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
4145 FeatureIsNotAvailable.
4147 2007-10-24 Marek Safar <marek.safar@gmail.com>
4149 ** C# 3.0 Partial methods
4151 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
4152 methods support. Because of member cache issue with generics only
4153 non-generics partial methods are fully supported.
4155 2007-10-23 Marek Safar <marek.safar@gmail.com>
4157 * class.cs, decl.cs: Rewrote member overloads check to cope with
4158 generics and to use member cache for member checking. It also improves
4159 performance and fixes remaining overloads issues.
4161 2007-10-20 Marek Safar <marek.safar@gmail.com>
4163 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
4164 roottypes.cs, typemanager.cs:
4166 A member cache creation logic changed to add members immediately and
4167 not rely on fallback. The member cache is now only prefered way
4168 how to access and find type declaration members. It saves 5 MB of memory
4169 during MWF compilation and makes code ready for more optimizations and
4170 clean-ups, it's also a pre-requirement for partial methods.
4172 2007-10-18 Raja R Harinath <harinath@gmail.com>
4174 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
4175 handling for generic parameters.
4177 2007-10-15 Marek Safar <marek.safar@gmail.com>
4179 * class.cs (FixedField): Removed redundant volatile check.
4181 2007-10-15 Marek Safar <marek.safar@gmail.com>
4183 * class.cs, decl.cs: Fixed overload members verification to do only one
4184 check per possible collision.
4186 2007-10-13 Marek Safar <marek.safar@gmail.com>
4188 A fix for bug #325478
4189 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
4190 and create only one disposable flags container.
4192 2007-10-12 Marek Safar <marek.safar@gmail.com>
4194 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
4195 * statement.cs (Fixed): Fixed variables cloning.
4197 2007-10-12 Marek Safar <marek.safar@gmail.com>
4199 A fix for bug #333342
4200 * class.cs (EventField): Don't mark value type event as synchronized.
4202 2007-10-12 Marek Safar <marek.safar@gmail.com>
4204 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
4205 inference to identify best candidate method correctly.
4206 (ProperyExpr): A range variable is read only and cannot be modified.
4208 2007-10-11 Marek Safar <marek.safar@gmail.com>
4210 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
4211 logic to identify best candidate method correctly.
4213 2007-10-11 Marek Safar <marek.safar@gmail.com>
4215 * location.cs (Equals, GetHashCode): Removed.
4217 2007-10-11 Marek Safar <marek.safar@gmail.com>
4219 * report.cs: Implemented message recorder. It is used mainly for lambda
4220 expressions to capture otherwise swallowed error messages.
4222 * anonymous.cs, lambda.cs.cs: Do full parameters check.
4224 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
4226 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
4228 * expression.cs (MemberAccess): Always report lookup failure.
4230 * location.cs: Implemented Equals, GetHashCode.
4232 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
4234 2007-10-10 Jb Evain <jbevain@novell.com>
4236 * codegen.cs: re-enable assembly version check.
4238 2007-10-09 Marek Safar <marek.safar@gmail.com>
4240 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
4243 * namespace.cs (UsingAlias): Do correct version check.
4245 2007-10-08 Marek Safar <marek.safar@gmail.com>
4247 * expresison.cs, ecore.cs: Issue extension method error message when
4250 * rootcontext.cs: Added ISO_2 compiler mode option.
4252 2007-10-08 Marek Safar <marek.safar@gmail.com>
4254 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
4257 2007-10-08 Marek Safar <marek.safar@gmail.com>
4259 * attribute.cs (GetString, GetBoolean): Work with both literal and
4262 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
4263 Moved method overload specific methods to MethodGroupExpr.
4265 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
4266 it should be less memory consuming.
4268 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
4270 * codegen.cs: remove the assembly version check until the buildbot is
4273 2007-10-07 Jb Evain <jbevain@novell.com>
4275 * attribute.cs (Attribute.GetString): if the value
4276 expression is a StringConstant, return its string value.
4278 2007-10-07 Jb Evain <jbevain@novell.com>
4280 * typemanager.cs: add `assembly_version_attribute_type`.
4281 * codegen.cs: on attribute emission, check that the
4282 AssemblyVersionAttribute doesn't overflow.
4284 2007-10-05 Marek Safar <marek.safar@gmail.com>
4286 A fix for bug #324677
4287 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
4288 parent container of a scope container with currently resolved one.
4290 2007-10-05 Marek Safar <marek.safar@gmail.com>
4292 A fix for bug #325534
4293 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
4296 2007-10-05 Marek Safar <marek.safar@gmail.com>
4298 A fix for bug #327504
4299 * class.cs (Operator.Define): Refactored implicit and explicit user
4300 operator conversion rules.
4302 2007-10-05 Marek Safar <marek.safar@gmail.com>
4304 A fix for bug #327520
4305 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
4307 2007-10-04 Marek Safar <marek.safar@gmail.com>
4309 A fix for bug #328022
4310 * class.cs (MethodData.Define): Use correct method to check whether
4311 a method implementents an accessor.
4313 2007-10-04 Marek Safar <marek.safar@gmail.com>
4315 A fix for bug #330069
4316 * statement.cs (Fixed.Resolve): Read the first array element only when
4317 an array is instantiated.
4319 2007-10-04 Marek Safar <marek.safar@gmail.com>
4321 * expression.cs, assign.cs, generics.cs: Print correct operator when
4322 compound assignment is used.
4324 2007-10-04 Marek Safar <marek.safar@gmail.com>
4326 A fix for bug #325841
4327 * expression.cs (ArrayAccess): Use full argument cloning only for
4328 string compound concatenation.
4330 2007-10-03 Marek Safar <marek.safar@gmail.com>
4332 A fix for bug #328774
4333 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
4335 (PropertyExpr.EmitAssign): Fixed string concatenation compound
4338 2007-10-03 Raja R Harinath <rharinath@novell.com>
4341 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
4342 Event accessibility checks here. Remove some bogus code that
4343 accidently made GenericMethods work.
4344 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
4346 2007-09-25 Marek Safar <marek.safar@gmail.com>
4348 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
4350 * statement.cs (Block): Refactored AddVariable to allow error handling
4353 * generic.cs: New stub.
4355 2007-09-23 Marek Safar <marek.safar@gmail.com>
4357 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
4360 2007-09-17 Marek Safar <marek.safar@gmail.com>
4362 * class.cs: Use partial container to record whether any partial part
4363 contains static field initializer and therefore default contructor has
4366 2007-09-14 Marek Safar <marek.safar@gmail.com>
4368 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
4369 mono-list when only one of two partial parts has defined accessibility
4372 2007-09-14 Marek Safar <marek.safar@gmail.com>
4374 A fix for bug #82845
4376 * class.cs (TypeContainer): Set correct resolve context for all field
4379 2007-09-13 Marek Safar <marek.safar@gmail.com>
4381 * assign.cs: Fixed a crash when field is resolved twice with an error.
4383 * codegen.cs: Changed InFieldInitializer to be flag.
4385 * anonymous.cs, ecore.cs, expression.cs: Update after
4386 IsInFieldInitializer rename.
4388 * const.cs: Removed unused parameter.
4390 * class.cs: Changed the way how we resolve and emit field initializers.
4391 The field initilizers have to have access to contructor block to emit
4392 compiler generated code.
4394 2007-09-13 Marek Safar <marek.safar@gmail.com>
4396 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
4397 generics use TypeContainer instead.
4399 2007-09-12 Marek Safar <marek.safar@gmail.com>
4401 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
4403 * lambda.cs (ResolveParameters): Use more powerful
4404 InflateGenericArgument.
4406 * parameters.cs: Better exception message.
4408 2007-09-10 Marek Safar <marek.safar@gmail.com>
4410 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
4411 correct expression block type.
4413 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
4415 * expression.cs (Invocation): Extracted method group resolve to
4418 2007-09-07 Marek Safar <marek.safar@gmail.com>
4420 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
4421 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
4423 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
4424 generic extension methods.
4426 2007-09-06 Marek Safar <marek.safar@gmail.com>
4428 A fix for bug #82676 (Do I get it right now?)
4429 * convert.cs (Binary.ResolveOperator): An interface is converted to the
4430 object before a standard conversion is applied.
4432 2007-09-06 Marek Safar <marek.safar@gmail.com>
4434 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
4437 2007-09-05 Marek Safar <marek.safar@gmail.com>
4439 A fix for bug #82676
4440 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
4441 non-generic interface types.
4443 2007-09-05 Marek Safar <marek.safar@gmail.com>
4445 A fix for bug #82690
4446 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
4448 2007-09-05 Marek Safar <marek.safar@gmail.com>
4450 A fix for bug #82571
4451 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
4452 modifier for container based methods.
4454 2007-09-05 Marek Safar <marek.safar@gmail.com>
4456 A fix for bug #82676
4457 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
4458 any interface-type T means to any of interface type T.
4460 2007-09-04 Marek Safar <marek.safar@gmail.com>
4462 * namespace.cs: We have 2 versions of System.Core assembly.
4464 2007-09-04 Marek Safar <marek.safar@gmail.com>
4466 A fix for bug #82652
4467 * class.cs (Class.GetClassBases): Compare types and not expressions.
4469 2007-09-04 Marek Safar <marek.safar@gmail.com>
4471 A fix for bug #82620
4472 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
4473 actually never worked before.
4474 (IndexerAccess): Emit prepared arguments before they are modified.
4476 2007-09-04 Marek Safar <marek.safar@gmail.com>
4478 A fix for bug #82563
4479 * assign.cs: Revert wrong fix.
4481 * expression.cs (VariableReference.EmitAssign): Handle ref reference
4483 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
4484 Instead of ldelema/stdind we have to use temporary variables to handle
4485 cases like String.Concat (params string[]).
4487 2007-08-31 Marek Safar <marek.safar@gmail.com>
4489 * class.cs: EmitAttributes to Emit rename.
4491 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
4493 (MemberCore.HasClsCompliantAttribute): Don't depend on
4494 GetClsCompliantAttributeValue execution.
4496 2007-08-31 Marek Safar <marek.safar@gmail.com>
4498 * anonymous.cs: Use shorter type prefix.
4500 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
4503 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
4504 variables when probing is on.
4506 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
4507 unresolved variables.
4508 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
4509 handle transparent identifiers.
4511 2007-08-26 Marek Safar <marek.safar@gmail.com>
4513 * attribute.cs (IsClsCompliant): Add nullable types test.
4515 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
4517 * doc.cs : catch other types of exception than XmlException to
4518 report CS1570. Fixed bug #82565.
4520 2007-08-23 Marek Safar <marek.safar@gmail.com>
4522 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
4523 The number of delegate parameters has to match.
4524 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
4527 2007-08-21 Marek Safar <marek.safar@gmail.com>
4529 * anonymous.cs (AnonymousMethod): Generate private anonymous method
4530 to fix problem with private arguments.
4532 2007-08-20 Marek Safar <marek.safar@gmail.com>
4534 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
4536 * decl.cs (MemberName): Ignore generic type with no generic arguments.
4538 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
4539 empty. Add cloning suport.
4541 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
4543 2007-08-20 Marek Safar <marek.safar@gmail.com>
4545 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
4546 to create EmptyCast. It handles EmptyConstantCast specialization for
4549 2007-08-18 Marek Safar <marek.safar@gmail.com>
4551 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
4552 (EmitArrayArgument): One routine for array arguments.
4553 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
4555 2007-08-17 Marek Safar <marek.safar@gmail.com>
4557 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
4559 2007-08-17 Marek Safar <marek.safar@gmail.com>
4561 * anonymous.cs: MemberLookupFinal update.
4563 * class.cs (ConstructorInitializer): Is expression based.
4565 * delegate.cs: MethodGroupExpr update.
4567 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
4569 (Error_MemberLookupFailed): Customizable error override.
4570 (MethodGroupExpr): Keep queried type for later usage.
4571 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
4574 * expression.cs: Error_MemberLookupFailed refactoring.
4575 (New.DoResolve): Resolve as much as possible.
4576 (ElementInitializer.Error_MemberLookupFailed): Object initializer
4577 customization for invalid member types.
4579 * statement.cs: MethodGroupExpr update.
4581 2007-08-16 Marek Safar <marek.safar@gmail.com>
4583 * modifier.cs (Check): Check all modifiers and not only accessibility
4586 2007-08-16 Marek Safar <marek.safar@gmail.com>
4588 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
4589 type and not an expression.
4591 2007-08-16 Marek Safar <marek.safar@gmail.com>
4593 * statement.cs (Catch.Clone): Type and variable can be null.
4595 2007-08-16 Marek Safar <marek.safar@gmail.com>
4597 A fix for bug #81979
4598 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
4599 I am really not sure whether this is the best fix.
4601 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
4604 2007-08-14 Marek Safar <marek.safar@gmail.com>
4606 ** C# 3.0 Object and collection initializers (major re-write)
4608 * assign.cs (DoResolve): Initializers are not assign related.
4610 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
4611 used during collection or object initialization.
4613 * expression.cs (Error_InvalidArguments): Add initializers specific
4614 messages. More will come later because it requires some general
4616 (New.DoResolve): Better error handling for unsafe types.
4617 (EmptyExpressionStatement): New class.
4618 (ElementInitializer): An object initializer expression.
4619 (CollectionElementInitializer): A collection initializer expression.
4620 (CollectionOrObjectInitializers): A block of object or collection
4622 (NewInitialize): New expression with element/object initializers.
4624 * statement.cs: Reverted object/collection initializer hacks.
4626 * typemanager.cs (CSharpName): Filter __arglist type.
4628 2007-08-09 Marek Safar <marek.safar@gmail.com>
4630 ** C# 3.0 Anonymous Types (update to the latest standard)
4632 * expression.cs (Binary.ResolveOperator): Threat all null based types
4634 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
4635 (AnonymousTypeParameter): Updated.
4637 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
4638 (AnonymousTypeClass): New anonymous type container.
4640 * class.cs (AddField): Return operation result.
4642 * generic.cs: Another empty TypeArguments overload.
4644 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
4645 are stored at top of normal hierarchy.
4647 * typemanager.cs (CSharpName): Filter anonymous types.
4649 2007-08-09 Marek Safar <marek.safar@gmail.com>
4651 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
4652 as single Concat call. How could we miss that :-(
4654 2007-08-08 Marek Safar <marek.safar@gmail.com>
4656 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
4658 2007-08-07 Miguel de Icaza <miguel@novell.com>
4660 * expression.cs: Fix the previous commit, the creation of the
4661 arguments array list needs also to be conditional on the arguments
4664 * class.cs: Add a little bit of help to help narrow down problems.
4666 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
4667 not try to copy in that case.
4669 * driver.cs: When building SMCS, include a new different set of
4670 default assemblies here. Do this here so we can control whether
4671 to include the default assemblies with /noconfig.
4673 2007-08-03 Marek Safar <marek.safar@gmail.com>
4675 A fix for bug #81979
4676 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
4679 2007-08-03 Marek Safar <marek.safar@gmail.com>
4681 A fix for bug #82300
4683 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
4684 we are in probing scope.
4686 2007-08-03 Marek Safar <marek.safar@gmail.com>
4688 A fix for bug #82301
4690 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
4691 (Statement.CloneTo): Clone and not map children blocks.
4693 2007-08-03 Marek Safar <marek.safar@gmail.com>
4695 A fix for bug #82299
4697 * expression.cs (LocalVariableReference.CloneTo): Remap local info
4700 * statement.cs (Statement.CloneTo): Clone variables before statements
4701 to allow remaping of local variables.
4703 2007-08-03 Marek Safar <marek.safar@gmail.com>
4705 A fix for bug #82296
4708 * report.cs: Log crash details for future clone problems.
4710 * statement.cs (Return.Clone): Don't clone non-existent expression.
4712 2007-08-03 Raja R Harinath <harinath@gmail.com>
4714 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
4715 (Class.AddBasesForPart): Move CS0537 check here from ...
4716 * cs-parser.jay (class_declaration): ... here. Move calling of
4717 'AddBasesForPart' to ...
4718 (class_bases): ... here.
4719 (struct_declaration, interface_declaration): Update to changes.
4721 2007-08-02 Marek Safar <marek.safar@gmail.com>
4723 A fix for bug #81923
4725 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
4726 conversion is allowed.
4728 2007-08-02 Marek Safar <marek.safar@gmail.com>
4730 A fix for bug #81564
4732 * ecore.cs (EventExpr): Add IsBase handling.
4734 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
4737 2007-08-02 Raja R Harinath <harinath@gmail.com>
4739 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
4740 * cs-parser.jay: Some whitespace cleanups.
4741 (current_delegate): New.
4743 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
4744 a dummy code block, and use 'type_name' instead of 'member_name'.
4745 (interface_declaration, class_declaration): Likewise.
4746 (delegate_declaration): Likewise. Rearrange slightly and use
4748 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
4749 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
4751 2007-08-02 Marek Safar <marek.safar@gmail.com>
4753 A fix for bug #82039
4755 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
4758 * typemanager.cs (CSharpName): Split to string overload.
4760 2007-08-02 Marek Safar <marek.safar@gmail.com>
4763 * report.cs: Updated warning CS0472.
4765 2007-08-01 Marek Safar <marek.safar@gmail.com>
4767 A fix for bug #82181
4769 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
4771 2007-08-01 Marek Safar <marek.safar@gmail.com>
4773 A fix for bug #82277
4774 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
4776 2007-08-01 Marek Safar <marek.safar@gmail.com>
4778 ** C# 3.0 Type Inference (major bits are working)
4780 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
4781 (.ImplicitStandardConversionExists): Uses compatible.
4782 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
4783 (.InferReturnType): New method.
4784 (.Compatible): Refactored.
4785 (.ResolveParameters): Uses factory to create resolved parameters.
4786 (.CompatibleMethod): Add probing mode support.
4787 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
4788 clearly distinguish between 2 different operations.
4789 (LambdaMethod): Moved to lambda.cs.
4790 (AnonymousMethod): Removed unused fields and methods.
4791 (AnonymousDelegate): Simplified.
4793 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
4795 * convert. cs (ImplicitConversionStandard): Compatible works differently.
4797 * delegate.cs (Delegate): New mehods to reduce code duplication.
4798 (.GetConstructor): New method.
4799 (.GetInvokeMethod): New method.
4800 (DelegateCreation): Updated.
4802 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
4804 (OverloadResolve): Made probing little bit faster.
4806 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
4809 * generic.cs (TypeInferenceContext): Dummy implementation.
4811 * iterators.cs: Updated after Resolve/Define rename.
4813 * lambda.cs (LambdaExpression)
4814 (.ResolveParameters): Handles both type of arguments and type inference too.
4816 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
4817 (InflateTypes): Updated.
4819 * support.cs (InflateTypes): Changed signature and updated.
4821 * typemanager.cs (LookupMemberCache): Better dynamic type check.
4822 (MemberLookup_FindMembers): More MS tricks.
4823 (GetParameterData): Ditto.
4824 (GetDelegateParameters): Uses quick path for dynamic types.
4826 2007-08-01 Marek Safar <marek.safar@gmail.com>
4828 * class.cs (MethodData.Define): EmitContext is required for generic stuff
4831 2007-07-31 Marek Safar <marek.safar@gmail.com>
4833 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
4836 2007-07-26 Jb Evain <jbevain@novell.com>
4838 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
4839 which takes a boolean 'report_errors', similar to the GetMethod.
4840 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
4841 in .net 2.1, do not report errors here.
4843 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
4844 System.Runtime.CompilerServices.RequiredAttributeAttribute and
4845 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
4848 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
4849 of the type InternalsVisibleToAttribute before the first call
4850 to CoreLookupType which is allowed to fail (third boolean parameter
4851 to true). Because, during the resolution for a type that is not
4852 immediately found, we try to check if the type is not defined in
4853 a friend assembly, and to do so, we need the
4854 InternalVisibleToAttribute.
4856 2007-07-23 Miguel de Icaza <miguel@novell.com>
4858 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
4859 feature that allows structs to be compared against null and inline
4860 the result as true or false.
4862 Notice that the same code is not permitted inside a generic block
4863 of code that would do:
4865 class Foo<T> where T : struct {
4872 It is only allowed if the type of T is not bound (no where
4873 clause). In my opinion, this CSC 2 behavior is broken but people
4874 seem to be using it (IronRuby does, a few bug reports on bugzilla
4875 have it and some people have complained about it).
4877 All of the users that depend on this behavior have code that is
4880 * report.cs (Warning, Error): make these take object arguments,
4881 not strings, as that allows us to take advantage of Format.
4883 2007-07-20 William Holmes <billholmes54@gmail.com>
4885 * decl.cs: Changed MemberName.CountTypeArguments to also check the
4886 Left member variable for the Count.
4887 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
4888 MemberName.CountTypeArguments to avoid a NRE.
4890 This code is contributed under the MIT X11 license
4892 2007-07-18 Marek Safar <marek.safar@gmail.com>
4894 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
4896 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
4898 * doc.cs : generic method arguments are written as ``x while generic
4899 type arguments are `x. Combined with the previous change, fixed bug
4902 2007-07-18 Raja R Harinath <rharinath@novell.com>
4905 * expression.cs (Binary.ResolveOperator): When converting
4906 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
4908 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
4910 * doc.cs : when T: or whatever x: is specified, it does not really
4911 check the doc comment's syntax correctness. Fixed bug #82006.
4913 2007-07-18 Marek Safar <marek.safar@gmail.com>
4915 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
4916 LambdaExpression better.
4918 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
4920 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
4922 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
4923 as it can be generated.
4925 * expression.cs (Invocation.Error_InvalidArguments): Show correct
4928 * lambda.cs (LambdaExpression): Refactored to share same code with
4929 AnonymousMethodExpression.
4931 2007-07-17 Marek Safar <marek.safar@gmail.com>
4933 * anonymous.cs (MakeName): Include host name for easier debugging.
4934 (LambdaMethod): New class for lambda spcecific stuff.
4936 * attribute.cs: Set EmitContext return type.
4938 * class.cs: Set EmitContext return type.
4940 * codegen.cs (EmitContext): Return type cannot be null to stop messing
4941 with null/void meaning.
4943 * iterators.cs (ContainerType): Implemented.
4945 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
4947 * statement.cs (Return): Updated to lambda expressions.
4948 (Block.CloneTo): Parent can be null.
4950 2007-07-13 Marek Safar <marek.safar@gmail.com>
4952 A fix for bug #81917
4953 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
4955 * class.cs (FixedField): Check whether field is in unsafe scope.
4957 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
4958 (FieldExpr.Emit): Fixed buffers cannot be volatile.
4960 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
4963 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
4965 2007-07-13 Marek Safar <marek.safar@gmail.com>
4967 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
4968 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
4971 2007-07-13 Marek Safar <marek.safar@gmail.com>
4973 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
4975 2007-07-13 Marek Safar <marek.safar@gmail.com>
4977 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
4978 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
4980 * codegen.cs(EmitContext): Add ProbingMode flag.
4982 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
4984 * driver.cs: For now set both warning values.
4986 * ecore.cs (SimpleName): Name is readonly.
4987 (MethodGroup.OverloadResolve): One quick path for probing.
4989 * expression.cs (Unary): Set Oper r/o.
4990 (Binary): Set Oper r/o.
4991 (ParameterReference): Set few instance variables as r/o.
4992 (ParameterReference.DoResolveBase): Don't capture aruments when
4994 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
4995 (Arglist): arguments are private.
4996 (SizeOf): type is private and r/o.
4997 (MemberAccess): arguments are private.
4999 * report.cs: Enhanced reporting on/off capabilities.
5001 * lambda.cs: Uses ec.IsInProbingMode.
5002 (ContextualReturn): Derives from return.
5004 * rootcontext.cs: For now set both warning values.
5006 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
5008 (Return.Resolve): Don't die immediately.
5009 (Block.Resolve): Speed-up probing.
5010 (Block.CloneTo): Clone only child blocks.
5012 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
5014 * iterators.cs: reverted Miguel's latest change (r81925) as it
5015 breaks the build in System.
5017 2007-07-13 Miguel de Icaza <miguel@novell.com>
5019 * iterators.cs (Yield.CheckContext): Check for the iterator type
5020 also here as we can call into Yield even in codepaths that are not
5022 (MethodOrOperator is the only path that was checked).
5024 In addition to the standard check, use a more specific check for
5025 constructors to report a more verbose error.
5027 2007-07-12 Miguel de Icaza <miguel@novell.com>
5029 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
5030 report the warning and continue
5032 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
5033 values on the stack on the call to Emit. Use EmitStatement if
5034 possible, or using Emit + Pop if not possible. Fixes #82064
5036 2007-07-12 Raja R Harinath <rharinath@novell.com>
5038 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
5039 avoid try...finally in some cases.
5041 2007-07-10 Marek Safar <marek.safar@gmail.com>
5043 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
5045 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
5046 instead of method. Re-use standard error handling.
5047 (ConstructorInitializer.Emit): Simplified.
5049 * delegate.cs: Updated after Invocation.EmitCall change.
5051 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
5052 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
5053 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
5054 method and don't permanently changing input arguments.
5055 (MethodGroupExpr): Introduced resolved best_candidate, when method group
5056 is resolved it has one of the candidates is the best one which is later
5057 used to emit. Removed a few unused method.
5058 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
5060 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
5061 (Binary.ResolveOperator): Ditto.
5062 (ConditionalLogicalOperator.DoResolve): Ditto.
5063 (Invocation): Uses method group.
5064 (Invocation.DoResolve): Simplified.
5065 (Invocation.EmitCall): Removed useless is_static.
5066 (Invocation.Emit): Delegate to method group.
5067 (Invocation.EmitStatement): Simplified.
5068 (New): Uses method group.
5069 (MemberAccess.DoResolve): Don't destroy original expression.
5071 * statement.cs (ForEach.Resolve): Use null for no method arguments.
5073 2007-07-04 Marek Safar <marek.safar@gmail.com>
5075 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
5078 * lambda.cs: Add custom error message type.
5080 2007-07-03 Marek Safar <marek.safar@gmail.com>
5082 * lambda.cs: Simplified little bit.
5084 * parameter.cs: Introduced ImplicitLambdaParameter.
5085 (Parameters.CreateFullyResolved): New factory instead of ctor.
5089 * delegate.cs: Updated parameter creation.
5091 2007-07-03 Marek Safar <marek.safar@gmail.com>
5093 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
5096 * generic.cs: Synchronized with gmcs.
5098 2007-07-03 Marek Safar <marek.safar@gmail.com>
5100 * class.cs (Indexer): Check return type as soon as possible.
5102 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
5105 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
5107 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
5109 * parameter.cs (Parameter): Use expression type when it is available.
5111 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
5112 method modifier for the first parameter only.
5114 2007-06-24 Marek Safar <marek.safar@gmail.com>
5116 A fix for bug #81938
5117 * typemanager.cs (ChangeType): Fixed couple of char conversions.
5119 * constant.cs: Tide up an exception message.
5121 2007-06-22 Marek Safar <marek.safar@gmail.com>
5123 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
5124 an uninitialized variable is used.
5126 * expression.cs (LocalVariableReference.DoResolve): Ditto.
5128 2007-06-22 Marek Safar <marek.safar@gmail.com>
5130 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
5131 not found error handling.
5133 * expression.cs (ArrayCreation): Removed redundant fields and little bit
5135 (ArrayCreation.ResolveArrayElement): To be ready to customization.
5136 (ArrayCreation.DoResolve): Simplified.
5137 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
5138 its own resolve process.
5139 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
5141 2007-06-20 Marek Safar <marek.safar@gmail.com>
5143 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
5146 2007-06-20 Marek Safar <marek.safar@gmail.com>
5148 * cs-tokenizer.cs: Removed var related stuff.
5150 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
5151 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
5152 a type and a keyword at same time.
5154 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
5157 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
5158 implicitly typed arrays, more changes will follow.
5160 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
5162 2007-06-19 Marek Safar <marek.safar@gmail.com>
5164 * ecore.cs (VarExpr): Removed Handled field.
5166 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
5167 build-in assign functionality.
5168 (ForEach.Resolve): Removed all implicitly typed local variable code and
5170 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
5171 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
5173 2007-06-18 Marek Safar <marek.safar@gmail.com>
5175 * assign.cs: Removed implicitly typed local variable check.
5177 * expression.cs (LocalVariableReference.DoResolve): Add check for self
5178 referencing implicitly typed local variable.
5179 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
5182 * statement.cs (Fixed): Removed unsupported implicitly typed local
5185 2007-06-15 Marek Safar <marek.safar@gmail.com>
5187 * decl.cs (MemberName): Moved all Unbound stuff to parser.
5189 2007-06-14 Marek Safar <marek.safar@gmail.com>
5191 A fix for bugs #81855 and #76274
5192 * attribute.cs (AttachTo): Always set owner for global attributes to
5195 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
5198 * cs-parser.jay: Assembly and module attributes must precede all other
5199 elements except using clauses and extern alias declarations.
5201 2007-06-13 Marek Safar <marek.safar@gmail.com>
5203 A fix for bug #81748
5205 * expression.cs: More checks for non ISO-1 features.
5207 2007-06-12 Marek Safar <marek.safar@gmail.com>
5209 A fix for bug #81807
5210 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
5211 present inside switch statement and it is required by nullable check.
5213 2007-06-12 Marek Safar <marek.safar@gmail.com>
5215 A fix for bug #81840
5216 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
5217 when type matching fails.
5219 * namespace.cs: Tiny error message change.
5221 2007-06-12 Marek Safar <marek.safar@gmail.com>
5223 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
5224 reporting. Added automatic property check.
5226 * class.cs: Updated after CheckAbstractAndExtern relocation.
5227 (AEventPropertyAccessor.GetSignatureForError): Customized.
5229 2007-06-11 Marek Safar <marek.safar@gmail.com>
5231 * class.cs (DefineBaseTypes): Base type can be undefined.
5233 * ecore.cs (TypeLookup): Minor refactoring.
5234 (DoResolveAsTypeStep): Removed redundant check.
5236 * namespace.cs (Lookup): Removed redundant check.
5238 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
5239 ResolveAsTypeTerminal step.
5240 (BootstrapCorlib_*): Simplified.
5241 (PopulateCoreType): Core types can be now external.
5243 2007-06-07 Marek Safar <marek.safar@gmail.com>
5245 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
5247 (InferTypeArguments): Infers anonymous expression type arguments.
5248 (Compatible): Split to Compatible and InferTypeArguments.
5250 * lambda.cs: Updated.
5252 2007-06-08 Marek Safar <marek.safar@gmail.com>
5254 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
5256 2007-06-07 Raja R Harinath <harinath@gmail.com>
5258 Fix #80477, cs0135-2.cs, cs0135-3.cs
5259 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
5260 names to the "known" variables list.
5261 (Block.CheckInvariantMeaningInBlock): Handle the fact the
5262 parameter names are also "known".
5263 (Block.CheckError136): Remove.
5264 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
5267 2007-06-07 Marek Safar <marek.safar@gmail.com>
5269 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
5271 2007-06-06 Marek Safar <marek.safar@gmail.com>
5273 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
5274 internal error not an user error.
5276 * expression.cs (IsApplicable): Refactored to make debugging easier.
5278 * support.cs: More tricks for non-mono runtimes.
5280 * typemanager.cs (CoreLookupType): Made public.
5281 (InitSystemCore): All linq specific stuff moved to linq.cs
5283 2007-06-05 Marek Safar <marek.safar@gmail.com>
5285 * typemanager.cs (CSharpSignature): One more missing build-in types
5287 More tricks for non-mono runtime.
5289 2007-06-05 Raja R Harinath <harinath@gmail.com>
5291 * statement.cs (Block.CheckError136_InParents): Remove.
5292 (Block.AddVariable): Use GetParameterInfo instead.
5293 (ToplevelBlock.ProcessArguments): Likewise.
5295 2007-06-04 Raja R Harinath <rharinath@novell.com>
5297 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
5299 (ToplevelBlock.GetParameterInfo): Split out of ...
5300 (ToplevelBlock.GetParameterRefernce): ... this.
5301 (ToplevelBlock.ParameterMap): Remove.
5302 * expression.cs (ParameterReference): Update to use
5303 ToplevelParameterInfo.
5305 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
5308 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
5309 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
5311 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
5312 (ToplevelBlock.ProcessParameters) ... here.
5313 (ToplevelBlock..ctor): Invoke it.
5315 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
5318 * statement.cs (IKnownVariable): New interface.
5319 (LocalInfo): Implement it.
5320 (ToplevelParameterInfo): New class.
5321 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
5322 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
5323 GetKnownVariableInfo.
5325 2007-06-03 Raja R Harinath <harinath@gmail.com>
5327 Partly speed up CS0136 error checks.
5328 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
5329 'recurse' parameter.
5330 (Block.DoCheckError136): Only check errors in parameters. Move
5331 local variable checks ...
5332 (Block.AddVariable): ... here, and ...
5333 (ToplevelBlock.ResolveMeta): ... here.
5335 2007-06-02 Raja R Harinath <harinath@gmail.com>
5337 * statement.cs (Block.IsChildOf): Remove.
5339 * statement.cs (Statement.Clone): Move special case code ...
5340 (Block.CloneTo): ... here.
5342 2007-05-29 Raja R Harinath <rharinath@novell.com>
5344 * statement.cs (ToplevelBlock.container): Remove field. It's
5345 redundant with 'Parent'.
5346 (ToplevelBlock.ContainerBlock): Remove accessor.
5347 (ToplevelBlock..ctor): Update to changes. Register anonymous
5348 child with parent here, ...
5349 * cs-parser.jay (end_anonymous): ... not here. Don't modify
5351 (start_anonymous): Don't save current_block.
5352 (top_current_block): Remove.
5354 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
5355 (Block.Resolve): Update to changes.
5356 (Block..ctor): Move setting of "correct" 'Toplevel'
5357 and 'Explicit' fields to ...
5358 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
5360 2007-05-27 Raja R Harinath <harinath@gmail.com>
5363 * statement.cs (Block.Implicit): Remove.
5364 (Block): Update to changes.
5365 * flowanalysis.cs: Likewise.
5367 Mildly speed up CheckInvariantMeaningInBlock
5368 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
5369 Recursively call AddKnownVariable to all enclosing blocks.
5370 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
5371 Remove recursive calls.
5372 (Block): Update to changes.
5374 New ExplicitBlock invariants
5375 * statement.cs (Block.Explicit): New field. It points to the
5376 immediately enclosing non-implicit block.
5377 (Block..ctor): Maintain the invariant.
5378 * cs-parser.jay: Take advantage of invariant.
5380 Introduce ExplicitBlock
5381 * statement.cs (ExplicitBlock): New.
5382 (ToplevelBlock): Derive from it.
5383 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
5385 (Block.Implicit): Update to changes.
5386 * cs-parser.jay: Update to changes.
5389 * codegen.cs (EmitContext.IsLastStatement): Remove.
5390 * statement.cs (Block.DoEmit): Update to changes.
5392 2007-05-25 Raja R Harinath <rharinath@novell.com>
5394 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
5395 modifying current_block directly.
5397 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
5399 * class.cs: Implemented automatic properties (C# 3.0)
5400 Thanks to Marek for the help.
5402 2007-05-23 Raja R Harinath <rharinath@novell.com>
5404 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
5405 variable as assigned, note also that all its components are
5407 (MyBitVector.SetRange): New. Function to set multiple bits to true.
5409 2007-05-19 Marek Safar <marek.safar@gmail.com>
5411 * anonymous.cs, class.cs: Emit Compiler generated attribute when
5412 member is marked as compiler generated.
5414 * decl.cs (MemberCore): Refactored ModFlags into property.
5416 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
5417 (Check): Check only accessibility modifiers.
5419 2007-05-18 Raja R Harinath <rharinath@novell.com>
5421 Track all assignable slots in one bit array
5422 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
5423 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
5424 logic from VariableMap constructor here. Use the same 'offset'
5425 variable that's later used for computing offsets of local
5427 * flowanalysis.cs (UsageVector.parameters): Remove.
5428 (UsageVector): Update to changes.
5429 (VariableMap): Remove.
5431 Avoid creating ParameterMap in every block
5432 * statement.cs (Block.ParameterMap): Move ...
5433 (ToplevelBlock.ParameterMap): ... here.
5434 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
5436 * flowanalysis.cs (FlowBranching.param_map): Remove.
5437 (FlowBranching.UsageVector): Update to changes.
5438 (FlowBranchingToplevel.CheckOutParameters): Likewise.
5440 * statement.cs (Block.CloneTo): Clone Toplevel field too.
5442 * expression.cs (ParameterReference): Distinguish between block
5443 where parameter was referenced and declared.
5445 2007-05-18 Marek Safar <marek.safar@gmail.com>
5447 * flowanalysis.cs, statement.cs: Put back improved error handling.
5449 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
5453 Imporved object and collection initialization (C# 3.0).
5455 2007-05-15 Marek Safar <marek.safar@gmail.com>
5457 A fix for bug #81380
5458 * expression.cs (Is.DoResolve): Only value types have constant `is'
5461 2007-05-15 Raja R Harinath <rharinath@novell.com>
5463 * statement.cs (ToplevelBlock.child): Remove.
5465 2007-05-15 Raja R Harinath <harinath@gmail.com>
5467 Rationalize ResolveMeta: refactoring
5468 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
5469 out constant handling code into ...
5470 (Block.DoResolveConstants): ... this.
5472 Rationalize ResolveMeta: kill local_map
5473 * statement.cs (Block.local_map, Block.LocalMap): Remove.
5474 (Block.AssignableSlots): New.
5475 (Block.ResolveMeta): Make protected. Don't create a VariableMap
5476 for locals -- move code from VariableMap here. Avoid unnecessary
5478 * flowanalysis.cs (FlowBranching.local_map): Remove.
5479 (FlowBranching..ctor): Use Block.AssignableSlots.
5480 (VariableMap): Remove unused constructors.
5482 2007-05-11 Raja R Harinath <rharinath@novell.com>
5484 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
5486 2007-05-11 Marek Safar <marek.safar@gmail.com>
5488 * typemanager.cs (IsFriendAssembly): Should not be called for building
5491 2007-05-09 Marek Safar <marek.safar@gmail.com>
5493 * literal.cs (NullConstant): Print null in all cases.
5495 * expression.cs (Binary.ResolveOperator): Implemented delegate
5496 comparison based on C# 2.0 changes.
5498 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
5500 This code is contributed under the MIT X11 license
5502 The following enables support for several C# 3.0 language features:
5504 * cs-tokenizer.cs: Added support for the "var" keyword.
5506 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
5507 Added VarExpr class to facilitate type inferencing.
5509 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
5510 to support anonymous types.
5512 * assign.cs: Added support for type inferencing and initialization.
5514 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
5516 * expression.cs: Added implicit array support to ArrayCreation.
5517 Added 5 types and 1 interface:
5519 IInitializable Implementing classes can inject initializing
5520 statements after object instantiation.
5522 Initializer Stores data for object initialization.
5524 AnonymousType An expression for anonymous types.
5526 AnonymousTypeParameter Stores data about an anonymous type's field.
5528 NewInitialize An expression for object initialization.
5530 CollectionInitialize An expression for collection initialization.
5532 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
5535 2007-05-06 Marek Safar <marek.safar@gmail.com>
5537 A fix for bug #81500
5538 * cs-tokenizer.cs: Add special handling for coalescing operator.
5540 2007-05-06 Marek Safar <marek.safar@gmail.com>
5542 A fix for bug #81529
5543 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
5544 its value from base class until it is redefined.
5546 2007-05-02 Raja R Harinath <rharinath@novell.com>
5548 Fix regression in cs0631-3.cs
5549 * cs-parser.jay (operator_declarator): Add opt_attributes to error
5550 fallback. Make error fallback catch more cases.
5552 2007-05-01 Miguel de Icaza <miguel@novell.com>
5554 * cs-parser.jay: Allow parameters in operator declarations to have
5557 2007-04-27 Miguel de Icaza <miguel@novell.com>
5559 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
5562 * lambda.cs (ContextualReturn.Resolve): An expression is valid
5563 inside the ContextualReturn, it does not have to be an
5564 ExpressionStatement.
5566 2007-04-24 Miguel de Icaza <miguel@novell.com>
5568 * lambda.cs (ContextualReturn.Resolve): if the return type is not
5571 2007-04-23 Miguel de Icaza <miguel@novell.com>
5573 * anonymous.cs (AnonymousContainer): split the virtual Resolve
5574 method in two methods: ResolveNoDefine and Resolve.
5576 ResolveNoDefine will stop just after ResolveTopBlock has been
5579 Resolve will then continue by creating a method and issuing the
5580 call to method.Define ().
5582 (AnonymousMethod): Split and implement the new Resolve and
5583 ResolveNoDefine as well.
5585 * lambda.cs (LambdaExpression): Split the anonymous method
5586 resolution code into a separate routine (CoreCompatibilityTest)
5587 from DoCompatibleTest.
5589 (LambdaExpression.TryBuild): New method, this method tries to
5590 build the LambdaExpression with the given set of types to be used
5591 as the types for the various parameters of the lambda expression.
5593 If the compilation succeed with the given types, the infered type
5594 of the Anonymous method is returned, otherwise null is returned.
5596 2007-04-23 Marek Safar <marek.safar@gmail.com>
5598 A fix for bug #81414
5599 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
5601 2007-04-22 Miguel de Icaza <miguel@novell.com>
5603 * cs-tokenizer.cs: Change various identifiers here from the
5604 camelCasing to the recommended Linux-like style for instance
5605 variables from the Coding Guidelines.
5607 2007-04-19 Martin Baulig <martin@ximian.com>
5610 (Convert.ImplicitReferenceConversionCore): Allow conversions from
5611 System.Enum to System.ValueType.
5613 2007-04-13 Martin Baulig <martin@ximian.com>
5615 Rewrote implicit reference conversions. We need to distinguish
5616 between implicit reference conversions (13.1.4) and implicit
5617 boxing conversions (13.1.5).
5619 According to the spec, there's an an implicit conversion
5620 "From a one-dimensional array-type S[] to IList<T> and base
5621 interfaces of this interface, provided there is an implicit
5622 reference conversion from S to T." Note that this does not
5623 include boxing conversions.
5626 (Convert.ImplicitTypeParameterBoxingConversion): New method.
5627 (Convert.ImplicitReferenceConversion): Split into
5628 ImplicitReferenceConversionCore() and
5629 ImplicitBoxingConversionExist().
5630 (Convert.ImplicitReferenceConversionExists): Use the new
5631 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
5633 2007-04-12 Martin Baulig <martin@ximian.com>
5635 * convert.cs (Convert.ImplicitReferenceConversion): Move the
5636 `TypeManager.null_type' checks up to the top of the method.
5638 2007-04-11 Marek Safar <marek.safar@gmail.com>
5640 A fix for bug #81350
5641 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
5644 2007-04-11 Martin Baulig <martin@ximian.com>
5646 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
5647 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
5648 to make this work for generic classes; fixes #79561.
5650 2007-04-11 Martin Baulig <martin@ximian.com>
5652 * expression.cs (As): Add support for nullable types; fixes #79371.
5654 2007-04-11 Martin Baulig <martin@ximian.com>
5656 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
5657 `type.FullName' is null; fixes #80243.
5659 2007-04-11 Martin Baulig <martin@ximian.com>
5661 * expression.cs (Invocation.IsApplicable): Don't modify the method
5662 if type inference succeeded, but the method was not applicable.
5665 2007-04-10 Marek Safar <marek.safar@gmail.com>
5667 A fix for bug #81324
5668 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
5669 internal and external namespaces containers.
5671 2007-04-10 Martin Baulig <martin@ximian.com>
5673 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
5674 TypeManager.DropGenericMethodArguments() so we also call
5675 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
5677 2007-04-10 Martin Baulig <martin@ximian.com>
5679 * iterators.cs (Iterator.CreateIterator): Don't crash if
5680 `method.ReturnType' is null. This happens if something went wrong
5681 while resolving that typ (we already reported an error in this case).
5683 2007-04-10 Martin Baulig <martin@ximian.com>
5685 * expression.cs (New.DoResolve): Don't call CheckComImport() on
5686 generic interfaces; report the CS0144 directly.
5688 2007-04-10 Martin Baulig <martin@ximian.com>
5690 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
5691 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
5693 2007-04-10 Martin Baulig <martin@ximian.com>
5695 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
5697 2007-04-09 Raja R Harinath <rharinath@novell.com>
5700 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
5701 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
5704 * statement.cs (For.Resolve): If resolution fails, use
5707 2007-04-08 Marek Safar <marek.safar@gmail.com>
5709 * anonymous.cs (MakeName): Make faster and zero-based.
5710 (VerifyExplicitParameterCompatibility): Back to mode where generic
5711 parameter is ignored.
5712 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
5714 * class.cs (EmitType): Method can emit another new method.
5716 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
5718 * driver.cs: Updated.
5720 * lambda.cs: Reuse predefined empty parameters.
5722 * parameter.cs: Updated
5724 * support.cs: Implemented InflateTypes.
5726 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
5727 (InitSystemCore): Introduced to isolate 3.0 dependencies.
5729 2007-04-03 Martin Baulig <martin@ximian.com>
5733 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
5734 version of TypeManager.IsOverride() which also works with generic
5737 2007-04-03 Martin Baulig <martin@ximian.com>
5742 (Convert.ExplicitReferenceConversion): We need to cast when
5743 converting from IList<T> to S[].
5745 2007-04-01 Marek Safar <marek.safar@gmail.com>
5747 * decl.cs (FindExtensionMethods): Consider all candidates with same name
5750 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
5752 2007-03-31 Marek Safar <marek.safar@gmail.com>
5754 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
5755 argument and return type inferring.
5757 * codegen.cs (InferReturnType): Flag whether return can be inferred.
5758 (ReturnType): Turned to property.
5760 * statement.cs (Return): Implemented return type inferring.
5762 * support.cs (ReflectionParameters): Use local types if possible.
5764 2007-03-30 Raja R Harinath <rharinath@novell.com>
5766 * flowanalysis.cs (FlowBranching.Reachability): Remove.
5767 (FlowBranching.UsageVector): Update to changes.
5769 Prepare to kill 'Reachability'
5770 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
5771 argument of constructor.
5773 2007-03-29 Raja R Harinath <rharinath@novell.com>
5775 Prepare to kill 'Reachability'
5776 * flowanalysis.cs (UsageVector.is_unreachable): New.
5777 (UsageVector): Update to maintain 'is_unreachable' in parallel to
5778 'reachability', and verify they're consistent.
5781 * expression.cs (New.EmitStatement): Handle type parameters here too.
5783 2007-03-29 Martin Baulig <martin@ximian.com>
5788 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
5789 CompilerGeneratedClass.
5790 (ScopeInfo.EmitScopeInstance): Make this protected.
5791 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
5792 `ec.CurrentAnonymousMethod.Scope == Scope'.
5794 * statement.cs (Block.ScopeInfo): Make this a property.
5796 2007-03-27 Raja R Harinath <harinath@gmail.com>
5798 Prepare to kill 'Reachability'
5799 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
5800 (FlowBranching.UsageVector.Reachability): Remove property.
5801 (FlowBranching.UsageVector.IsUnreachable): New property.
5802 (FlowBranching.UsageVector.ResetBarrier): New.
5803 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
5804 * codegen.cs, statement.cs: Update to changes.
5806 2007-03-27 Martin Baulig <martin@ximian.com>
5811 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
5814 2007-03-26 Raja R Harinath <rharinath@novell.com>
5816 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
5817 instead of TriState. Remove all mention of TriState.
5819 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
5820 replaced by a boolean. Add boolean 'is_unreachable' field, check
5821 and maintain invariants.
5823 2007-03-25 Marek Safar <marek.safar@gmail.com>
5825 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
5827 2007-03-25 Marek Safar <marek.safar@gmail.com>
5829 * expression.cs: Stop using obsolete 2.0 opcodes.
5831 2007-03-25 Marek Safar <marek.safar@gmail.com>
5833 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
5834 one of the latests Martin's fixes.
5836 2007-03-23 Miguel de Icaza <miguel@novell.com>
5838 * expression.cs: On BigEndian systems, swap the bytes, temporary
5839 solution until we get a new bitconverter class.
5841 2007-03-23 Martin Baulig <martin@ximian.com>
5845 * decl.cs (MemberCache.AddMembers): Add generic methods both as
5846 "Method" and "Method`1". Normally, a cache lookup is done on the
5847 "Method" form (ie. without the generic arity), but this one makes
5848 lookups on the full form work as well.
5850 2007-03-22 Raja R Harinath <rharinath@novell.com>
5852 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
5855 2007-03-20 Bill Holmes <billholmes54@gmail.com>
5857 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
5858 ordered_member_list, to TypeBuilder to store members to be defined
5859 in the order they were parsed in.
5860 - ordered_explicit_member_list contains all properties indexers
5861 and methods that are defined as explicit implementation of an
5862 interface or base class.
5863 - ordered_member_list contains all properties indexers and methods
5864 that are not defined as explicit implementation of an interface
5867 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
5868 functionality in these removed classes has been replaced with
5869 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
5870 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
5872 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
5873 to CheckForDuplications inside GetMethod and SetMethod Define Method
5874 to handle method property and indexer name conflicts.
5878 All code is contributed under the MIT/X11 license.
5880 2007-03-20 Martin Baulig <martin@ximian.com>
5882 * class.cs (TypeContainer.Interfaces): Removed; they're now
5883 included in `TypeContainer.Types'.
5885 2007-03-20 Martin Baulig <martin@ximian.com>
5887 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
5889 * class.cs (TypeContainer.CreateType): New public method. This is
5890 now called before DefineType() to create the TypeBuilders.
5891 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
5892 has already been created by CreateType().
5893 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
5894 don't resolve our base classes here; this has been moved into
5895 DefineBaseTypes(). We're now called from CreateType().
5896 (TypeContainer.DefineBaseTypes): New private method; resolve our
5897 base classes here. We're now called from DefineType().
5900 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
5901 our types first to create all the TypeBuilders. After that, call
5902 TypeContainer.DefineType() on all the types which'll resolve their
5903 base classes and setup the resolve order.
5905 2007-03-20 Martin Baulig <martin@ximian.com>
5907 * class.cs (TypeContainer.Enums): Removed; they're now included in
5908 `TypeContainer.Types'.
5910 2007-03-20 Martin Baulig <martin@ximian.com>
5913 (TypeContainer.DefineType): Don't call ResolveMembers() here.
5914 (TypeContainer.DoResolveMembers): Call DefineType() on our
5915 `compiler_generated' classes; moved here from DefineNestedTypes().
5918 (RootContext.ResolveTree): Call ResolveMembers() on all
5919 TypeContainer's in the `type_container_resolve_order'.
5921 2007-03-19 Marek Safar <marek.safar@gmail.com>
5923 * class.cs: Use corlib to handle InternalMethodImplAttribute.
5925 2007-03-17 Marek Safar <marek.safar@gmail.com>
5927 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
5928 implementation flags.
5930 2007-03-17 Marek Safar <marek.safar@gmail.com>
5932 * class.cs: More optimizations for type parameters.
5934 2007-03-15 Marek Safar <marek.safar@gmail.com>
5936 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
5938 * ecore.cs, parameter.cs: More common code for both corlibs.
5940 * typemanager.cs (IsGenericMethod): Simplified.
5942 2007-03-15 Raja R Harinath <rharinath@novell.com>
5944 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5946 * statement.cs, iterators.cs, lambda.cs: Update to changes.
5948 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
5949 unconditionally. Simplify explanation.
5950 (Try.Resolve, Using.Resolve): Likewise.
5952 2007-03-15 Martin Baulig <martin@ximian.com>
5956 * decl.cs (DeclSpace): If we're a partial class, use our
5957 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
5959 2007-03-15 Raja R Harinath <rharinath@novell.com>
5961 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5963 (FlowBranching.UsageVector): Update to changes.
5964 (FlowBranching.MergeSiblings): Likewise.
5965 * statement.cs: Likewise.
5967 2007-03-15 Martin Baulig <martin@ximian.com>
5972 (MemberCache): Added a special .ctor for type parameters.
5975 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
5978 2007-03-09 Martin Baulig <martin@ximian.com>
5980 * enum.cs (Enum): Make this a TypeContainer.
5981 (EnumMember): Derive from `Const'.
5984 (Const.DoResolveValue): New protected virtual method; move most of
5985 the functionality of ResolveValue() here so we can override it in
5987 (Const.CreateConstantReference): Make this virtual.
5989 * class.cs (Kind): Add `Kind.Enum'.
5990 (TypeContainer.Emit): Don't emit the enums here; they're already
5991 in the `RootContext.typecontainer_resolve_order'.
5993 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
5994 here; they're already in the `typecontainer_resolve_order'.
5996 * ecore.cs (EnumConstant.ConvertImplicitly): Add
5997 TypeManager.DropGenericTypeArguments().
6000 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
6001 (TypeManager.IsEnumType): Likewise.
6002 (TypeManager.EnumToUnderlying): Likewise.
6003 (TypeManager.IsEqual): Add support for enums.
6005 2007-03-12 Raja R Harinath <rharinath@novell.com>
6007 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
6008 DefaultParameterValueAttribute to be undefined, say if System.dll
6011 2007-03-11 Marek Safar <marek.safar@gmail.com>
6013 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
6016 2007-03-10 Marek Safar <marek.safar@gmail.com>
6018 * class.cs, parameter.cs: Unified parameters verification.
6020 2007-03-08 Martin Baulig <martin@ximian.com>
6022 * cs-parser.jay (constructor_header): Pass the location to the
6023 newly created TopLevelBlock.
6025 2007-03-07 Martin Baulig <martin@ximian.com>
6027 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
6029 2007-03-06 Miguel de Icaza <miguel@novell.com>
6031 * convert.cs (ExplicitReferenceConversionExists): Sync this method
6032 with the changes from David, fixes the build.
6034 2007-03-05 David Mitchell <dmitchell@logos.com>
6036 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
6037 and its base interfaces to a one-dimensional array type S[],
6038 provided there is an implicit or explicit reference conversion
6041 2007-03-03 Marek Safar <marek.safar@gmail.com>
6043 * cs-tokenizer.cs: Implemented basic linq grammar.
6045 * driver.cs: Set linq lang version on demand.
6047 2007-02-26 Marek Safar <marek.safar@gmail.com>
6049 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
6051 2007-02-25 Marek Safar <marek.safar@gmail.com>
6053 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
6056 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
6058 Check property and event extern attributes.
6060 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
6063 2007-02-24 Marek Safar <marek.safar@gmail.com>
6065 A fix for bug #80407
6066 * ecore.cs: Don't report ambiguity error when methods have same parent.
6068 2007-02-23 Marek Safar <marek.safar@gmail.com>
6070 A fix for bug #80878
6071 * class.cs, cs-parser.jay: Event property can host anonymous methods.
6073 2007-02-22 Marek Safar <marek.safar@gmail.com>
6075 * attribute.cs: Enable ExtensionAttribute presence test.
6077 2007-02-22 Marek Safar <marek.safar@gmail.com>
6079 * class.cs: Warn about missing GetHashCode only when Equals is override.
6081 * decl.cs: Check accessibility of type arguments.
6083 * typemanager.cs: Correctly report nullable array.
6085 2007-02-20 Marek Safar <marek.safar@gmail.com>
6087 * class.cs, report.cs: Capture more details when things go wrong.
6089 2007-02-20 Marek Safar <marek.safar@gmail.com>
6091 A fix for bug #80650
6092 * cs-parser.jay: Anonymous container starts at constructor declaration
6093 and not at block beginning because it has to be usable in constructor
6096 * statement.cs: Use context location and not block one for error reporting.
6098 2007-02-18 Marek Safar <marek.safar@gmail.com>
6100 A fix for bug #78712
6101 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
6104 2007-02-18 Marek Safar <marek.safar@gmail.com>
6106 A fix for bug #80493 by Atsushi Enomoto
6107 * cs-parser.jay: Ignore invalid attribute target.
6109 2007-02-18 Marek Safar <marek.safar@gmail.com>
6111 * cs-tokenizer.cs: Ignore '\0' as white space character.
6113 2007-02-17 Miguel de Icaza <miguel@novell.com>
6115 * cs-parser.jay: Add support for lambda expressions to the mcs
6118 * lambda.cs: Only clone when we are probing, not on the final call
6119 (Compatible is the final call).
6121 * statement.cs (CloneContext): Introduce class to provide block
6122 remapping during clone.
6124 All statements Clone themselves now.
6126 (Clone): special handling for blocks, when we clone a block, we
6127 register the block inside this routine, as children of the block
6128 might trigger a lookup.
6130 * expression.cs: Add support for CloneContext in all expressions.
6132 2007-02-17 Marek Safar <marek.safar@gmail.com>
6134 A fix for bug #80493
6135 * statement.cs: Report ambiguous warning when interfaces are not related.
6137 2007-02-15 Marek Safar <marek.safar@gmail.com>
6139 C# 3.0 extension methods.
6141 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
6142 cannot be used directly.
6144 * class.cs (Class.Emit): Emit extension attribute if any class method
6145 is extension method.
6146 (Method.Define): Add basic extension method validation conditions.
6147 (Method.Emit): Emit extension attribute for method.
6149 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
6150 extension method exists. Currently we follow same approach as Microsoft
6151 does, emit even if a method or a class are private but this can change
6154 * cs-parser.jay: Add handling of `this' keyword in method parameters
6157 * decl.cs (DeclSpace.IsStaticClass): New property.
6158 (MemberCache.FindExtensionMethods): Looks for extension methods with
6159 defined name and extension type.
6161 * doc.cs: Updated after OverloadResolve changes.
6163 * driver.cs: Add new soft reference to System.Core.dll.
6165 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
6166 (ExtensionMethodGroupExpr): Represents group of extension methods.
6168 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
6169 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
6170 to MethodGroupExpr and made non-static for easier customization.
6171 (Invocation.DoResolve): Add extension method lookup when no standard
6173 (MemberAccess.DoResolve): Try extension methods if no member exists.
6175 * modifiers.cs: Add METHOD_EXTENSION modifier.
6177 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
6178 as well as candidate extension type.
6179 (ComputeNamespaces): When assembly constains extension methods registers
6181 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
6182 extension method lookup.
6183 (Namespace.LookupExtensionMethod): Looks for extension method in this
6185 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
6186 find a method which matches name and extensionType.
6188 * parameter.cs (Parameter): Add This modifer.
6189 (HasExtensionMethodModifier): New property.
6190 (Resolve): Add extension parameter check.
6191 (ModFlags): turned to property to exclude this modifier as it is not real
6193 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
6195 * support.cs (ParameterData): Add ExtensionMethodType.
6196 (ReflectionParameters): Implemented ExtensionMethodType interface property.
6198 * typemanager.cs: Add type and ctor extension attribute type.
6200 2007-02-15 Miguel de Icaza <miguel@novell.com>
6202 * report.cs (DisableErrors, EnableErrors): used to prevent error
6203 output when we are "trying" to compile various methods with
6206 * ecore.cs (Expression): Add Clone method that calls the virtual
6207 CloneTo method. The current CloneTo method in Expression throws
6208 an exception so we can track down all the places where this must
6209 be implemented (not using abstract, because that would be a lot of
6210 up-front-work before we can start testing the implementation
6213 Important: we only need Clone capabilities for expressions created
6214 by the parser, as the expressions we will be cloning are
6215 expressions in the pre-resolved state. This vastly simplifies
6218 (SimpleName): Add CloneTo that does nothing.
6219 (EmptyCast): Add CloneTo.
6221 * expression.cs (Binary): Implement CloneTo.
6222 (Invocation.IsApplicable): Store the current ec in
6223 EmitContext.TempEc and restore it on return. This is used so we
6224 do not have to sprinkle hundres of methods with an extra
6225 EmitContext, we know that the only user is the lambda expression
6226 ImplicitConversionExists code.
6228 (Argument): Add Cloning capabilities.
6229 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
6230 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
6231 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
6232 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
6233 IndexerAccess): Add Clone capability.
6235 (LocalVariableReference, This): TODO: needs cloned Block mapping.
6237 (Argument): Add cloning capability.
6239 * assign.cs (Assign): Implement CloneTo.
6241 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
6243 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
6244 version by calling Convert with the EmitContext (that we are
6245 currently storing in ec, this is not great, but will do for now,
6246 to avoid passing EmitContext parameters to hundreds of functions
6247 that do not need them now).
6249 (SetExpression): Remove, it is not needed.
6251 (ContextualReturn): Implement CloneTo.
6253 * statement.cs (Statement): Implement cloning infrastructure,
6254 similar to expressions.
6256 (Block): Partial implementation of Clone for statements.
6258 (Return): Implement clone.
6260 * constant.cs (Constant.CloneTo): New method, does nothing.
6262 * codegen.cs (TempEc): Add a static EmitContext as a temporary
6263 solution, until we decide how to exactly do this.
6265 2007-02-14 Marek Safar <marek.safar@gmail.com>
6267 A fix for bug #80493
6268 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
6269 a property is override we need to use second accessor.
6271 2007-02-13 Marek Safar <marek.safar@gmail.com>
6273 A fix for bug #80418
6274 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
6277 2007-02-13 Marek Safar <marek.safar@gmail.com>
6279 Another fix for bug #80749
6280 * pending.cs: Abstract class has priority over interfaces.
6282 2007-02-13 Marek Safar <marek.safar@gmail.com>
6284 Another fix for bug #80749
6285 * pending.cs: Abstract class has priority over interfaces.
6287 2007-02-13 Marek Safar <marek.safar@gmail.com>
6289 Another fix for bug #80749
6290 * pending.cs: Abstract class has priority over interfaces.
6292 2007-02-13 Marek Safar <marek.safar@gmail.com>
6294 Another fix for bug #80749
6295 * pending.cs: Abstract class has priority over interfaces.
6297 2007-02-13 Marek Safar <marek.safar@gmail.com>
6299 * class.cs Better error message.
6301 * driver.cs: Add shorter versions of -optimize option.
6303 2007-02-13 Martin Baulig <martin@ximian.com>
6305 * class.cs (Constructor.Emit): Check the return value of
6306 ec.ResolveTopBlock() and return on error.
6308 2007-02-13 Raja R Harinath <rharinath@novell.com>
6310 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
6311 message to fix error message regression.
6313 2007-02-12 Marek Safar <marek.safar@gmail.com>
6315 * delegate.cs: Delegate creation expression cannot be of Nullable type.
6317 2007-02-12 Marek Safar <marek.safar@gmail.com>
6319 A fix for bug #80749
6320 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
6321 its parent container.
6323 * class.cs (DefineFieldInitializers): Each initializer can has different
6326 * const.cs: Updated.
6328 2007-02-11 Miguel de Icaza <miguel@novell.com>
6330 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
6331 now all the heavy lifting to check that embedded statements or
6332 expressions have the right form is done in the ContextualReturn.
6334 (ContextualReturn): New class.
6336 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
6337 method that can be invoked to report 201, so we do not replicate
6340 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
6342 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
6343 treating tabs as spaces.
6345 2007-02-09 Marek Safar <marek.safar@gmail.com>
6347 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
6348 * assign.cs: Use full implicit conversion for right side check.
6350 2007-02-09 Marek Safar <marek.safar@gmail.com>
6352 * statement.cs (Switch): Switch over boolean type is not standardized.
6354 2007-02-08 Marek Safar <marek.safar@gmail.com>
6356 A fix for bug #80755
6357 * decl.cs (FindBaseEvent): Don't use method cache for events.
6359 2007-02-07 Marek Safar <marek.safar@gmail.com>
6361 * cs-parser.jay: Better syntax error handling.
6363 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
6364 instead of underlying type value.
6366 2007-02-06 Marek Safar <marek.safar@gmail.com>
6368 * driver.cs: Check define identifier before is registered.
6370 * namespace.cs: Use existing error message.
6372 * report.cs: New warning.
6374 2007-02-06 Marek Safar <marek.safar@gmail.com>
6376 A fix for bug #80742
6377 * expression.cs: Delegate Invoke method can be called directly.
6379 2007-02-06 Marek Safar <marek.safar@gmail.com>
6381 A fix for bug #80676
6382 * class.cs (IsEntryPoint): The Main method can have params modifier.
6384 2007-02-04 Miguel de Icaza <miguel@novell.com>
6386 * parameter.cs (Parameter, Parameters): Add Clone method.
6388 * anonymous.cs (Compatible): Turn method into virtual method, so
6389 LambdaExpression can implement a different behavior.
6391 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
6392 out the basic checking here, so it can be used by
6395 * lambda.cs: Introduce "Compatible" function that will do the
6398 2007-02-02 Marek Safar <marek.safar@gmail.com>
6400 * attribute.cs: Unified one error message.
6402 * class.cs (Class): Use type attributes and not properties to test static
6404 (IsEntryPoint): Don's pass local variable.
6406 * convert.cs: Removed duplicate check.
6408 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
6410 * driver.cs: Don't crash when soft reference does not exist.
6412 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
6413 (UsingEntry): Removed redundant allocation.
6415 * parameter.cs: Add fast path for type parameters.
6417 * support.cs: Don't allocate attribute when it's not used.
6419 2007-01-30 Miguel de Icaza <miguel@novell.com>
6422 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
6423 this into a virtual method, so we can override it in LambdaExpression.
6425 * driver.cs: Improve diagnostics in case of failure.
6427 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
6428 write a function that is slightly more complex and that parses:
6430 type identifier [, type identifier]* )
6432 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
6435 (canEmpty ? i >= 0 : i > 0)
6437 2007-01-30 Raja R Harinath <rharinath@novell.com>
6439 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
6440 exception on possibly valid code.
6442 2007-01-29 Raja R Harinath <rharinath@novell.com>
6444 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
6446 (parse_opt_type_arguments): Remove. It's almost the same as
6448 (parse_namespace_or_typename): Use parse_less_than.
6450 2007-01-28 Miguel de Icaza <miguel@novell.com>
6452 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
6453 this bug took a few hours to find, because the state saved and
6454 restored by PushPosition and PopPosition was ignoring the state of
6455 parse_generic_less_than.
6457 I can also now remove the handling of OP_LT and OP_GT, this solves
6460 * cs-tokenizer.cs: store the location for the ARROW token, we use
6463 (PushPosition, PopPosition): save/restore also `current_token',
6464 restore `parse_generic_less_than' (was missing).
6466 (parse_opt_type_arguments): use parse_type, not
6467 parse_namespace_or_typename to parse types.
6469 * lambda.cs: Empty new file, will eventually have the lambda
6470 expression implementation.
6472 * lambda.test: used to test the internal tokenizer.
6474 * report.cs (FeatureIsNotISO1): Rename from
6475 FeatureIsNotStandardized, because it was about the language level
6476 (1 vs 2) it was not about standarization.
6478 (FeatureRequiresLINQ): New.
6480 * support.cs (SeekableStreamReader): Only require that the reader
6481 is a TextReader, not a StreamReader, so we can plug StringReader.
6483 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
6484 given position in the input stream the following tokens can be
6485 parsed as a type followed by an identifier.
6487 (is_punct): after a '(' if parse_type_and_parameter returns true,
6488 then return a special token OPEN_PARENS_LAMBDA which is used to
6489 avoid reduce/reduce errors in the grammar for the
6490 lambda_expression rules.
6492 (parse_type): implement a type parser inside the
6493 tokenizer, the parser only returns true or false depending on
6494 whether the input at a given position can be parsed as a type.
6496 (peek_token): new method used during type parsing.
6498 2007-01-28 Raja R Harinath <rharinath@novell.com>
6501 * anonymous.cs (ScopeInfo.InflateParameters): New.
6502 (AnonymousContainer.Resolve): Use it to redirect types of
6503 delegate parameters.
6505 2007-01-27 Raja R Harinath <rharinath@novell.com>
6508 * expression.cs (Error_InvalidArguments): Don't use two different
6509 messages for CS1503. Use ExtraInformation and
6510 SymbolRelatedToPreviousError instead.
6513 * decl.cs (DeclSpace.initialize_type_params): Don't access
6514 'type_params' of a partial class directly.
6516 2007-01-26 Miguel de Icaza <miguel@novell.com>
6518 * constant.cs: Removed a handful of out-of-range checks that were
6521 2007-01-25 Marek Safar <marek.safar@gmail.com>
6523 * expression.cs (CheckUselessComparison): Add additional check for char
6526 * namespace.cs: Fixed typo.
6528 2007-01-23 Miguel de Icaza <miguel@novell.com>
6530 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
6531 gone, instead we inline the test, preventing the needless casts to
6532 longs, ulongs and doubles for the parameters, avoiding calls to
6533 methods that overchecked stuff, and instead inlined things
6536 2007-01-20 Marek Safar <marek.safar@gmail.com>
6538 * cs-parser.jay: Better parameter error handling.
6540 2007-01-17 Marek Safar <marek.safar@gmail.com>
6542 A fix for bug #80368, #80522
6543 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
6544 whether array initializer contains constants only.
6545 (ArrayCreation.Emit): Use better formula to decide when
6546 are array initializers for static initialization.
6547 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
6548 have to emit even constants otherwise they are pre-initialized.
6550 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
6551 Raja R Harinath <rharinath@novell.com>
6553 Fix emit order of 'get' vs. 'set'.
6554 * support.cs (Accessors): New.
6555 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
6556 Note the order in which accessors are declared in the source.
6557 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
6558 Refactored from Property.Define and Indexer.Define.
6559 (PropertyBase.DefineAccessors): New helper that calls the above in
6560 appropriate order as noted by the parser.
6561 (Property.Define, Indexer.Define): Update to changes.
6562 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
6564 2007-01-17 Raja R Harinath <rharinath@novell.com>
6566 Fix cs0029-6.cs and gcs0029-2.cs (regression)
6567 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
6568 there's an implicit conversion from the current type to the target
6569 type before converting the underlying constant.
6571 2007-01-16 Marek Safar <marek.safar@gmail.com>
6573 * const.cs (ResolveValue): Updated after constant conversion was made more
6576 * constant.cs (GetAttributableValue): constant to object conversion is
6577 used for attributes only.
6578 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
6579 constant conversions.
6580 (LongConstant.ConvertImplicitly): Ditto.
6582 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
6583 (ImplicitConversionStandard): Handle constant conversion as extra step.
6584 It solves the issue when constant conversion was called indirectly like
6585 inside array initializer and constant folding was skipped.
6587 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
6590 * statement.cs(ImplicitConversionStandard): Updated after constant
6591 conversion was made more generic.
6593 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
6595 * expression.cs (As.DoResolve): Use GenericConstraints instead of
6596 Constraints, solves the problem where the compiler incorrectly
6597 reported that a type parameter was not constrained to a class (Bug
6600 2007-01-14 Marek Habersack <grendello@gmail.com>
6602 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
6604 2007-01-14 Marek Safar <marek.safar@gmail.com>
6606 A fix for bug #80368
6607 * assign.cs (FieldInitializer): New class implements field
6608 initializer statement.
6610 * attribute.cs: Update after FieldMember rename.
6612 * class.cs (PropertyBasedMember): New common class for property based
6614 (InterfaceMemberBase): New base class for all members which can be used as
6615 an interface members.
6616 (MethodCore): Moved really common code to InterfaceMemberBase.
6617 (Method.Define): Equal and GetHasCode detection is relevant for methods
6619 (MethodData.Define): Don't assume that public event implements an
6620 interface automatically.
6621 (MethodData.DefineMethodBuilder): Issue an error even if only extern
6623 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
6624 (FieldMember): Merged with FieldBase.
6625 (EventProperty.AEventPropertyAccessor): New specialization to check whether
6626 event extern modifier can be used.
6627 (EventField.EventFieldAccessor): Moved event field specific code here.
6628 (Event.AllowedModifiers): Even event can be extern.
6629 (Event.FindOutBaseMethod): New override specific to events.
6630 (Indexer.parameters): Reintroduce parameters because base class holds
6631 only properties common data.
6632 (Indexer.CheckForDuplications): Indexers are threated as methods so we
6633 need do extra parameters check.
6635 * const.cs: Update after FieldMember rename.
6637 * decl.cs (MemberCache.FindBaseEvent): New method.
6639 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
6640 to reflect that indexer is now derived from PropertyBased.
6642 * ecore.cs (GetMemberType): Made public.
6643 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
6646 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
6648 * typemanager.cs (CSharpSignature): Correctly print event accessors.
6649 (RegisterEvent): Removed.
6650 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
6651 (GetPrivateFieldOfEvent): Renamed to GetEventField.
6653 2007-01-11 Raja R Harinath <rharinath@novell.com>
6656 * statement.cs (CollectionForeach.TryType): Prefer generic
6657 GetEnumerator over non-generic variant. Fix code to follow comments.
6659 2007-01-09 Raja R Harinath <rharinath@novell.com>
6662 * support.cs (ReflectionParameter): Don't use an invalid index on
6663 the generic parameter data.
6665 2007-01-08 Miguel de Icaza <miguel@novell.com>
6667 * driver.cs: Just add a tiny bit of infrastructure.
6669 2007-01-02 Marek Safar <marek.safar@gmail.com>
6671 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
6672 where field type is struct from current assembly.
6674 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
6677 2007-01-02 Marek Safar <marek.safar@gmail.com>
6679 A fix for bug #80381
6680 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
6683 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
6685 (Namespace.LookupType): Always use core types from corlib when speficied.
6687 * report.cs: A new warning.
6689 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
6690 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
6691 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
6693 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
6694 (InitCoreTypes): Set expression type of object_type and value_type
6695 immediately after lookup.
6697 2007-01-01 Miguel de Icaza <miguel@novell.com>
6699 * cs-tokenizer.cs: Accept Pc class characters (Connector
6700 Punctuation) as valid identifiers. Fixes #78259
6702 * expression.cs (Invocation.DoResolve): Moved the check for the
6703 use of `this' for doing method calls to the Invocation resolution
6704 step, after overload resolution has taken place instead of doing
6705 the check at the low-level `This.DoResolve' level.
6707 The `This.DoResolve'(appens before overload resolution, so it has
6708 no way of knowing if the method that will be called will be
6709 instace or static, triggering an erroneous report for cs0188 (Bug
6712 We now do the check for instance method invocations after we know
6713 what method will be called.
6715 (This.CheckThisUsage): Move the actual use of this structure
6716 checking into its own method and expose it.
6718 * Everywhere that called Error_ValueCannotBeConverted: pass a new
6721 Exceptions: Null.ConvertImplicitly,
6722 Constant.ImplicitConversionRequired as there are too many call
6723 sites for passing the ec.
6725 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
6726 EmitContext, if the value is null, then we do not try to provide
6727 the extra information from the error (If a userdefined conversion
6728 exists, as UserDefinedConversion requires a non null-EmitContext).
6732 2006-12-30 Raja R Harinath <rharinath@novell.com>
6734 * flowanalysis.cs (MyBitVector): Document some invariants.
6735 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
6736 introduced below, and add a couple of others,
6738 2006-12-30 Marek Safar <marek.safar@gmail.com>
6740 * attribute.cs (GetMethodObsoleteAttribute): Uses new
6741 GetPropertyFromAccessor and GetEventFromAccessor.
6743 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
6744 overrides non-obsolete one.
6745 (Indexer.Define): Error message has been moved to the parser.
6747 * cs-parser.jay: Better syntax errors handling.
6749 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
6750 when an invocation has no arguments.
6752 * ecore.cs: Removed not used caching.
6754 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
6757 * report.cs: Add a new warning.
6759 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
6761 * typemanager.cs (enumeration_type): Removed.
6762 (CSharpSignature): Reuses IsSpecialMethod.
6763 (IsEqual): Hack for MS BCL.
6764 (GetPropertyFromAccessor): New method.
6765 (GetEventFromAccessor): New method.
6766 (IsSpecialMethod): Fixed to handle more cases.
6768 2006-12-30 Marek Safar <marek.safar@gmail.com>
6770 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
6771 Made white spaces array static.
6773 * ecore.cs (RemoveGenericArity): Optimized.
6775 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
6777 (MyBitVector.initialize_vector): Simplified.
6779 2006-12-22 Miguel de Icaza <miguel@novell.com>
6781 * ecore.cs: Am not entirely happy with this hack, but it seems to
6782 address the issue in 80257 (a small test case for
6785 I set the MethodGroupExpr.Type to an internal compiler type
6786 (itself in this case) to force the resolution to take place. Why
6787 it does not take place with a null is beyond me.
6789 2006-12-20 Marek Safar <marek.safar@gmail.com>
6791 A fix for bug #80288
6792 * expression.cs (ResolveOperator): Consider user defined conversion for
6793 logical and operator too.
6794 (EmitBranchable): Optimization for logical and when full constant folding
6795 could not be applied but one operand is constant.
6797 2006-12-19 Marek Safar <marek.safar@gmail.com>
6799 * class.cs (GetClassBases): Write 5 times every day, will never use
6800 FullName for error reporting.
6802 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
6804 2006-12-19 Martin Baulig <martin@ximian.com>
6806 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
6807 the symbol file info here.
6809 2006-12-18 Marek Safar <marek.safar@gmail.com>
6811 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
6812 of `elseif' is taking then following sections are not taking.
6813 Fixes an issue reported on mono mailing list.
6815 2006-12-18 Marek Safar <marek.safar@gmail.com>
6817 A fix for bug #80300
6818 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
6819 a caller is not taking.
6821 2006-12-18 Raja R Harinath <rharinath@novell.com>
6823 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
6824 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
6825 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
6826 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
6827 * class.cs: Update to changes.
6829 2006-12-17 Marek Safar <marek.safar@gmail.com>
6831 A fix for bug #79934
6832 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
6835 * class.cs (ResolveMembers): Register an iterator in current container and
6838 2006-12-16 Raja R Harinath <rharinath@novell.com>
6841 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
6842 satisfy a params annotated parameter.
6844 2006-12-16 Marek Safar <marek.safar@gmail.com>
6846 A fix for bug #77014
6847 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
6848 paramters correctly and not rely on hacks in Parameters class.
6849 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
6851 (Invocation.VerifyArgumentsCompat): Ditto.
6852 (Invocation.EmitArguments): Changed to correctly emit params arguments at
6855 * parameter.cs (HasParams): Don't assume that params is the last one.
6857 * support.cs (ReflectionParameters.ctor): Look for params attribute
6859 (ReflectionParameters.ParameterType): Removed hack when we returned last
6860 parameter for out of range parameters.
6861 (ParameterName, ParameterModifier): Ditto.
6863 2006-12-14 Marek Safar <marek.safar@gmail.com>
6865 A fix for bug #79987
6866 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
6867 when assembly is not CLS compliant but type is. I have no idea why is this
6870 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
6872 2006-12-13 Miguel de Icaza <miguel@novell.com>
6874 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
6875 in struct constructors, they are basically no-ops.
6877 2006-12-12 Marek Safar <marek.safar@gmail.com>
6879 * cs-tokenizer.cs (Position): Save preprocessor status too.
6881 2006-12-12 Marek Safar <marek.safar@gmail.com>
6883 A fix for bug #77794
6884 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
6886 2006-12-12 Marek Safar <marek.safar@gmail.com>
6888 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
6890 (pp_expr): Report error for an invalid expression.
6891 (handle_preprocessing_directive): Simplified; add more error checking.
6893 2006-12-11 Marek Safar <marek.safar@gmail.com>
6895 A fix for bug #74939
6896 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
6897 directives handling.
6899 2006-12-10 Marek Safar <marek.safar@gmail.com>
6901 A fix for bugs #80093, and #75984
6902 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
6903 logic, it seems to me as it worked before "by coincidence".
6904 (xtoken): Simplified to use reworked handle_preprocessing_directive.
6905 (cleanup): Enabled endif check.
6907 2006-12-09 Marek Safar <marek.safar@gmail.com>
6909 A fix for bug #80162
6910 * statement.cs (CollectionForeach.TryType): Generics and non-generics
6911 enumerators are never ambiguous.
6913 2006-12-08 Raja R Harinath <rharinath@novell.com>
6916 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
6918 2006-12-06 Marek Safar <marek.safar@gmail.com>
6920 A fix for bug #80144
6921 * class.cs (EventProperty.Define): Explicit implementation means
6922 that an even is used.
6924 2006-12-06 Marek Safar <marek.safar@gmail.com>
6926 Fixes the operators implementation (part II)
6928 * cfold.cs (DoConstantNumericPromotions): Renamed to
6929 DoBinaryNumericPromotions and simplified.
6930 (BinaryFold): Couple of conversion fixes; simplified.
6932 * constant.cs, ecore.cs, literal.cs
6933 (ToType): Renamed to ConvertImplicitly.
6934 (Reduce): Renamed to ConvertExplicitly.
6936 * class.cs, convert.cs: Updated.
6938 * expression.cs: TryReduce doesn't throw an exception.
6940 2006-12-01 Marek Safar <marek.safar@gmail.com>
6942 A fix for bug #80108
6943 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
6946 2006-11-30 Marek Safar <marek.safar@gmail.com>
6948 Fixes unary operators implementation (part I)
6951 * cfold.cs (Error_CompileTimeOverflow): Made internal
6953 * const.cs (IConstant): Changed to use reference to constant and
6954 not constant itself.
6955 Updated IConstant implementations.
6957 * constant.cs (CreateConstant): New factory method.
6958 Updated IConstant implementation.
6960 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
6962 * ecore.cs: Updated to use CreateConstantReference.
6964 * enum.cs: Reflects IConstant changes.
6966 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
6968 * literal.cs (NullConstant): Change to be independently usable.
6970 2006-11-29 Martin Baulig <martin@ximian.com>
6972 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
6973 we need to emit the scope initializer before calling the base .ctor.
6975 * anonymous.cs: Merged back from the new anonymous methods branch.
6976 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
6978 * expression.cs (ParameterReference.DoResolveBase): Create a
6979 "normal" ScopeInfo when capturing parameters rather than using the
6980 root scope; this makes things work with anonymous methods having
6984 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
6986 2006-11-22 Marek Safar <marek.safar@gmail.com>
6988 A fix for bug #79987
6989 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
6990 check to a base class.
6991 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
6992 only when assembly has missing attribute.
6993 * report.cs: Update.
6995 2006-11-21 Marek Safar <marek.safar@gmail.com>
6997 * cs-tokenizer.cs: Merged with gmcs version.
6999 2006-11-20 Marek Safar <marek.safar@gmail.com>
7002 * cs-parser.jay: Better error message when partial keyword is misplaced.
7004 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
7006 A fix for bug #79810
7007 report.cs: CS1058 only applies to 2.0 profile (gmcs).
7008 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
7009 a RuntimeWrappedException by default.
7011 2006-11-18 Marek Safar <marek.safar@gmail.com>
7013 A fix for bug #79843
7014 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
7016 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
7018 2006-11-18 Marek Safar <marek.safar@gmail.com>
7020 * driver.cs, namespace.cs: Uses faster IndexOf version.
7022 2006-11-17 Marek Safar <marek.safar@gmail.com>
7024 A fix for bug #79941
7025 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
7027 (Operator.Define): Implicit/Explicit operator of same type is duplicate
7028 even if internal name is different.
7029 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
7030 (UserDefinedConversion): Simplified as the operators cannot be internal.
7031 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
7033 (MethodLookup): Replaced EmitContext with parentType.
7034 * expression.cs: Updated.
7036 2006-11-09 Raja R Harinath <rharinath@novell.com>
7038 * driver.cs (BadAssembly): Handle all the ugliness of
7039 DefineDynamicAssembly.
7041 2006-11-08 Raja R Harinath <rharinath@novell.com>
7043 Address parts of #58244 -- most of what's left is in the runtime
7044 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
7045 CS1509 error checks, and handle them for all assembly loads, not
7046 just the first invocation.
7047 (LoadModule): Likewise. Move handling of 'adder_method' ...
7048 * codegen.cs (AssemblyClass.AddModule): ... here.
7050 2006-11-02 Marek Safar <marek.safar@gmail.com>
7052 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
7053 IEnumerable<T> is ambiguous.
7055 2006-10-31 Marek Safar <marek.safar@gmail.com>
7057 A fix for bug #67689
7058 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
7059 GetEnumerator is ambiguous.
7061 * report.cs: Add new warning.
7063 2006-10-29 Marek Safar <marek.safar@gmail.com>
7065 A fix for bug #78602
7066 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7067 to protected member can be nested type.
7069 2006-10-28 Marek Safar <marek.safar@gmail.com>
7071 A fix for bug #78965
7072 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7073 to protected member must derive from current type.
7075 2006-10-27 Marek Safar <marek.safar@gmail.com>
7077 assign.cs: Reuses error method.
7079 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
7080 instead of type for constants.
7081 (Expression.Error_ValueAssignment): Common error method.
7083 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
7086 2006-10-27 Marek Safar <marek.safar@gmail.com>
7088 A fix for bug #79081
7089 * expression.cs (MemberAccess.DoResolve): Check nested type
7092 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
7094 * doc.cs : nested delegates were not handled. Fixed bug #79754.
7096 2006-10-26 Marek Safar <marek.safar@gmail.com>
7098 A fix for bug #76591
7099 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
7101 2006-10-26 Marek Safar <marek.safar@gmail.com>
7103 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
7104 type forwarder of the same type multiple times.
7106 2006-10-26 Raja R Harinath <rharinath@novell.com>
7109 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
7110 instance as an rvalue, even when we later resolve as an lvalue.
7112 2006-10-25 Martin Baulig <martin@ximian.com>
7114 * anonymous.cs: Fix #79673.
7116 2006-10-24 Marek Safar <marek.safar@seznam.cz>
7118 A fix for bug #79666
7119 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
7120 ignored when is optimized (= default value) as its value is already set.
7122 2006-10-23 Marek Safar <marek.safar@seznam.cz>
7124 A fix for bug #79724
7125 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
7126 TypeContainer for type lookup.
7128 2006-10-23 Marek Safar <marek.safar@seznam.cz>
7130 A fix for bug #79231
7131 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
7132 * expression.cs (OverloadResolve): Always convert type name for
7134 (ResolveNamespaceOrType): Don't confuse a nested type with any
7137 2006-10-18 Martin Baulig <martin@ximian.com>
7139 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
7141 2006-10-17 Miguel de Icaza <miguel@novell.com>
7143 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
7144 an int32, but requesting an int64 from the conversion
7146 2006-10-12 Martin Baulig <martin@ximian.com>
7149 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
7151 2006-10-12 Martin Baulig <martin@ximian.com>
7154 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
7156 2006-10-11 Miguel de Icaza <miguel@novell.com>
7158 * convert.cs: Remove broken code: I was doing the "Existance"
7159 tests for Implicit conversions.
7161 2006-10-10 Miguel de Icaza <miguel@novell.com>
7163 * convert.cs: Added one missing case in
7164 ImplicitStandardConversionExists uint64 to intptr.
7168 * typemanager.cs (uintptr_type): another core known type.
7170 * ecore.cs (OperatorCast): routine used to do cast operations that
7171 depend on op_Explicit. We could change some of the Decimal
7172 conversions to use this.
7174 This one has a probe mechanism that checks both types for an op_
7175 which it coudl be used to eliminate two classes: CastToDecimal
7176 and CastFromDecimal.
7178 * convert.cs: Implement the conversions documented in #59800
7180 2006-10-10 Martin Baulig <martin@ximian.com>
7182 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
7183 before RootScope.ResolveMembers().
7185 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
7186 `CurrentType' if appropriate.
7188 2006-10-09 Marek Safar <marek.safar@seznam.cz>
7190 A fix for bug #78568
7191 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
7192 when contains binary operators.
7193 * cs-parser.jay: Updated.
7195 2006-10-09 Martin Baulig <martin@ximian.com>
7198 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
7199 moved that into Define() and also do the other type parameter
7200 checks there. Fixes #79094. Added gtest-292.cs.
7203 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
7204 since that doesn't include type parameters; don't use `Ldelema'
7205 for type parameters. Fixes #78980. Added gtest-293.cs.
7207 2006-10-08 Marek Safar <marek.safar@seznam.cz>
7210 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
7211 conversion is allowed.
7213 2006-10-06 Marek Safar <marek.safar@seznam.cz>
7215 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
7216 error reporting when no error occurs.
7218 2006-10-06 Marek Safar <marek.safar@seznam.cz>
7220 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
7223 2006-10-06 Raja R Harinath <rharinath@novell.com>
7226 * class.cs (DefineTypeBuilder): Check circular dependencies before
7227 setting the parent of the TypeBuilder.
7228 (CheckRecursiveDefinition): Don't use 'BaseType', since
7229 it may not be valid until after DefineTypeBuilder. Use
7230 'base_type' instead.
7232 2006-10-04 Martin Baulig <martin@ximian.com>
7234 Merged the Anonymous Methods patch.
7236 * anonymous.cs, iterators.cs: The new anonymous methods code.
7238 * statement.cs (Variable): New public abstract class.
7239 (LocalInfo.Variable): New public property.
7240 (LocalInfo.ResolveVariable): New public method.
7241 (Block.Flags): Add `IsIterator'.
7242 (Block.AddVariable): Improved the CS0136 check.
7243 (Block.AnonymousChildren): New public property.
7244 (Block.AddAnonymousChild): New public method.
7245 (ToplevelBlock): Update to use the new anonymous method framework.
7246 (ToplevelBlock.ctor): `container' is now a `Block' and not a
7247 `ToplevelBlock'; this is required to correctly implement the
7249 (Fixed, Using): Use `TemporaryVariable' instead of directly
7250 creating the `LocalBuilder'.
7252 * parameter.cs (Parameter.ResolveVariable): New public method.
7253 (Parameters.ResolveVariable): Likewise.
7255 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
7257 * class.cs (TypeContainer): Replaced the `iterators' list and
7258 corresponding methods with a list of `CompilerGeneratedClass'es.
7259 (TypeContainer.ResolveMembers): New public method.
7260 (Method): `IIteratorContainer' has been replaced by
7263 * expression.cs (VariableReference): New public abstract base
7264 class for `LocalVariableReference', `ParameterReference' and
7267 * codegen.cs (EmitContext): Removed `capture_context',
7268 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
7269 (EmitContext.EmitThis): Removed.
7271 * cs-parser.jay: Replace `iterator_container' with
7274 2006-10-04 Martin Baulig <martin@ximian.com>
7276 * generic.cs (GenericMethod): Don't make this abstract.
7277 (Constraints.Clone): Added dummy implementation.
7279 2006-10-04 Raja R Harinath <harinath@gmail.com>
7282 * namespace.cs (LookForAnyGenericType): Avoid nullref on
7283 'declspaces'. Avoid allocating arrays willy-nilly.
7286 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
7287 cases out of the switch.
7289 2006-09-28 Marek Safar <marek.safar@seznam.cz>
7291 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
7292 message when non-generic type is used with the type arguments.
7293 * expression.cs: Updated.
7295 2006-09-28 Raja R Harinath <rharinath@novell.com>
7298 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
7299 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7300 Change semantics slightly. Don't insist on having only one
7301 temporary EmptyExpression -- just throttle the creation of new ones.
7304 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
7305 non-interfaces too. If no methods are found, don't try to create
7308 2006-09-28 Marek Safar <marek.safar@seznam.cz>
7310 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
7313 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
7314 us produce better error message.
7316 2006-09-27 Marek Safar <marek.safar@seznam.cz>
7318 * expression.cs (Binary.ResolveOperator): Warn about a side effect
7319 of the `|' operator.
7321 * report.cs: A new warning added.
7323 2006-09-27 Martin Baulig <martin@ximian.com>
7325 * generic.cs (GenericMethod): Don't make this abstract.
7327 2006-09-27 Martin Baulig <martin@ximian.com>
7330 (InternalErrorException): Added overloaded ctor taking a params array.
7332 2006-09-26 Marek Safar <marek.safar@seznam.cz>
7334 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
7335 Fixed the cases when same error was reported twice.
7337 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
7338 now report symbol information.
7340 2006-09-25 Martin Baulig <martin@ximian.com>
7342 * class.cs: Completely unified with the gmcs version.
7344 2006-09-25 Martin Baulig <martin@ximian.com>
7346 * typemanager.cs (TypeManager.IsNullableType): New public function.
7347 (TypeManager.IsNullableTypeOf): Likewise.
7348 (TypeManager.IsNullableValueType): Likewise.
7350 * class.cs (MethodCore): Added the `GenericMethod' argument from
7351 gmcs and also unified all classes derived from `MethodCore' with gmcs.
7353 2006-09-24 Raja R Harinath <harinath@gmail.com>
7355 * convert.cs: Unify with gmcs version.
7357 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7359 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
7360 verify them as well.
7362 * report.cs: New warning.
7364 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7366 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
7367 for anonymous block with out argument.
7369 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7371 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
7372 not used private events only.
7374 2006-09-23 Marek Safar <marek.safar@seznam.cz>
7376 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
7378 * const.cs (Const.Define): Check for constant type.
7379 (Const.IsConstantTypeValid): Looks for valid constant types.
7381 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
7383 * ecore.cs (EmptyConstantCast): New common class for all constant based
7386 * expression.cs (Is.DoResolve): Handle null constant especially.
7387 (New.DoResolve): Check for new void().
7388 (MemberAccess.DoResolve): Cope with all kind of nulls.
7390 * literal.cs (NullConstant): Uses EmptyConstantCast.
7391 (NullDefault): Based on EmptyConstantCast.
7392 (NullLiteral): Uses EmptyConstantCast.
7394 * statement.cs (Block.ResolveMeta): Check for constant type.
7396 2006-09-22 Martin Baulig <martin@ximian.com>
7398 * delegate.cs, attribute.cs: Merged with the gmcs versions.
7400 2006-09-22 Raja R Harinath <rharinath@novell.com>
7402 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
7406 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
7407 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
7410 2006-09-22 Martin Baulig <martin@ximian.com>
7412 * ecore.cs: Merged with the gmcs version.
7414 * generic.cs (ConstructedType): New dummy class.
7415 (TypeArguments): Don't make this abstract.
7418 (TypeManager.IsGenericTypeDefinition): New method.
7419 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
7421 2006-09-22 Raja R Harinath <rharinath@novell.com>
7423 * expression.cs (ComposedCast): Check for arrays of TypedReference
7424 before creating the type, not after.
7426 2006-09-21 Marek Safar <marek.safar@seznam.cz>
7428 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
7429 after ToType change.
7431 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
7432 when constant must be implicitly convertible.
7434 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
7436 * ecore.cs (NullCast): Derives from NullConstant.
7438 * expression.cs (Is.DoResolve): Removed useless variables.
7439 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
7440 (New.Constantify): Add enum support.
7441 (MemberAccess.DoResolve): Add warning when accessing null constant or
7444 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
7447 * literal.cs (NullConstant): New abstract class with common
7448 functionality for all null specializations.
7449 (NullDefault): Represents default(X) when result can be
7451 (NullLiteral): Updated.
7453 * report.cs: Add new warning.
7455 2006-09-21 Martin Baulig <martin@ximian.com>
7457 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
7459 2006-09-21 Martin Baulig <martin@ximian.com>
7461 * generic.cs (GenericConstraints): New dummy class.
7462 (Constraints): Likewise.
7463 (TypeParameter): Likewise.
7464 (TypeParameterName): Likewise.
7465 (GenericMethod): Likewise.
7467 * typemanager.cs (TypeManager.GetGenericArguments): New method.
7469 * decl.cs: Merged with the gmcs version.
7471 2006-09-21 Raja R Harinath <rharinath@novell.com>
7473 * generic.cs (TypeParameter): Implement IMemberContainer.
7474 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
7476 * rootcontext.cs: Unify with gmcs version.
7478 * report.cs: Unify with gmcs version.
7479 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
7480 from gmcs/generics.cs.
7481 * generics.cs (TypeParameter): New dummy class.
7483 * support.cs: Unify with gmcs version.
7485 2006-09-20 Raja R Harinath <rharinath@novell.com>
7487 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
7488 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
7490 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
7491 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
7492 * mcs.exe.sources: Add generic.cs.
7494 * codegen.cs: Unify with gmcs version.
7496 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
7497 (EmitContext): Add GenericDeclContainer implementation.
7498 * decl.cs (MemberCore, DeclSpace): Likewise.
7499 * namespace.cs: Remove #ifdef GMCS_SOURCE.
7501 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
7502 MCS TypeManager has a corresponding dummy method.
7504 2006-09-19 Martin Baulig <martin@ximian.com>
7506 * expression.cs: Completely merged with the gmcs version.
7508 2006-09-19 Martin Baulig <martin@ximian.com>
7510 * expression.cs (Invocation): Merged with the gmcs version.
7511 (ArrayAccess.GetStoreOpcode): Likewise.
7513 2006-09-19 Martin Baulig <martin@ximian.com>
7516 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
7517 (TypeManager.IsGenericMethodDefinition): Likewise.
7519 2006-09-19 Martin Baulig <martin@ximian.com>
7522 (TypeManager.IsEqual): Moved the gmcs implementation here.
7523 (TypeManager.DropGenericTypeArguments): Likewise.
7524 (TypeManager.DropGenericMethodArguments): Likewise.
7525 (TypeManager.GetTypeArguments): Moved here from gmcs.
7526 (TypeManager.HasGenericArguments): Likewise.
7528 2006-09-19 Martin Baulig <martin@ximian.com>
7530 * expression.cs (Binary): Merged with the gmcs version.
7532 2006-09-19 Martin Baulig <martin@ximian.com>
7534 * expression.cs (Probe, As, Is): Merged with the gmcs version.
7536 2006-09-19 Martin Baulig <martin@ximian.com>
7538 * typemanager.cs: Merged with the gmcs version.
7540 2006-09-16 Raja R Harinath <rharinath@novell.com>
7542 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
7543 * driver.cs: Likewise.
7545 2006-09-16 Marek Safar <marek.safar@seznam.cz>
7548 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
7549 only if parent type is class.
7550 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
7553 2006-09-15 Marek Safar <marek.safar@seznam.cz>
7556 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
7558 * typemanager.cs(CSharpName): Converts NullType to null.
7560 2006-09-15 Martin Baulig <martin@ximian.com>
7563 (TypeManager.GetMethodName): Added mcs implementation.
7564 (TypeManager.IsEqual): Likewise.
7567 (SimpleName.RemoveGenericArity): Added dummy implementation.
7569 * pending.cs: Merged with the gmcs version.
7571 2006-09-15 Martin Baulig <martin@ximian.com>
7573 * statement.cs: Merge with the gmcs version.
7575 2006-09-15 Martin Baulig <martin@ximian.com>
7577 * statement.cs (Switch): Merge with the gmcs implementation
7578 (without nullables), which is newer.
7580 2006-09-15 Martin Baulig <martin@ximian.com>
7582 * statement.cs (Block.Variables): Make this public.
7583 (ToplevelBlock.Parameters): Make this a property.
7584 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
7586 2006-09-15 Martin Baulig <martin@ximian.com>
7588 * namespace.cs: Merge with the gmcs version.
7590 2006-09-15 Martin Baulig <martin@ximian.com>
7592 * decl.cs (MemberName): Minor code cleanups.
7594 2006-09-15 Martin Baulig <martin@ximian.com>
7596 * parameter.cs: Merge with the gmcs version.
7598 2006-09-15 Martin Baulig <martin@ximian.com>
7600 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
7601 and an error in mcs.
7603 2006-09-15 Martin Baulig <martin@ximian.com>
7605 * flowanalysis.cs: Merged from GMCS; added the generics code into
7606 a `GMCS_SOURCE' conditional so we can share this file.
7608 2006-09-08 Martin Baulig <martin@ximian.com>
7610 * typemanager.cs (TypeManager.interlocked_type): New public field.
7611 (TypeManager.int_interlocked_compare-exchange): New public field.
7612 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
7613 enumerator types here and call InitGenericCoreTypes().
7614 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
7615 after calling InitEnumUnderlyingTypes().
7618 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
7619 `classes_second_stage'.
7621 2006-09-14 Marek Safar <marek.safar@seznam.cz>
7623 * assign.cs, ecore.cs, expression.cs: Share error message text.
7624 * class.cs (FieldMember.Define): Check for varible of static type.
7625 * driver.cs (LoadAssembly): Uses error output for errors.
7626 * statement.cs: Updated.
7628 2006-09-08 Marek Safar <marek.safar@seznam.cz>
7630 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
7633 2006-09-07 Martin Baulig <martin@ximian.com>
7636 (MainDriver): Revert r62663 from Marek; see #70506 for details.
7638 2006-08-29 Miguel de Icaza <miguel@novell.com>
7640 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
7642 2006-08-17 Miguel de Icaza <miguel@novell.com>
7644 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
7645 #52019 and #79064, the use of the \uXXXX sequence in source code
7646 to represent unicode characters.
7648 2006-08-15 Marek Safar <marek.safar@seznam.cz>
7650 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
7652 * class.cs, ecore.cs, statement.cs: Merged to one error message.
7654 2006-08-13 Miguel de Icaza <miguel@novell.com>
7656 * assign.cs: Catch attempts to assign to a method groups in += and
7659 2006-08-13 Marek Safar <marek.safar@seznam.cz>
7662 * cs-parser.jay: Don't destroy current array type by typeof of array's.
7664 2006-08-12 Marek Safar <marek.safar@seznam.cz>
7666 * class.cs (Method.Define): Issue a warning when generic method looks like
7668 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
7671 2006-08-09 Marek Safar <marek.safar@seznam.cz>
7673 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
7675 * decl.cs (MemberCache.FindMembers): When container is interface we need to
7676 search all base interfaces as a member can be ambiguous.
7677 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
7678 Constructor member type filter.
7679 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
7680 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
7681 reporting for returned memberinfos.
7682 * report.cs: Updated.
7683 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
7684 version to work on all runtimes.
7685 (TypeManager.RealMemberLookup): Removed members filtering.
7687 2006-08-08 Raja R Harinath <rharinath@novell.com>
7689 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
7690 (PropertyExpr.EmitAssign): Likewise.
7691 * expression.cs (Indirection.EmitAssign): Likewise.
7692 (LocalVariableReference.EmitAssign): Likewise.
7693 (ParameterReference.EmitAssign): Likewise.
7694 (Invocation.EmitArguments): Likewise.
7695 (ArrayAccess.EmitAssign): Likewise.
7696 (IndexerAccess.EmitAssign): Likewise.
7697 (This.EmitAssign): Likewise.
7698 (ConditionalLogicalOperator.Emit): Likewise.
7701 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
7702 instead of ArrayList. If the hashtable has a LocalBuilder, don't
7703 leave it in after returning it.
7704 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
7706 2006-08-06 Marek Safar <marek.safar@seznam.cz>
7708 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
7711 2006-08-03 Raja R Harinath <rharinath@novell.com>
7713 Fix cs0146-3.cs and cs0146-4.cs.
7714 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
7715 enclosing types don't depend on the current type.
7717 2006-08-02 Raja R Harinath <rharinath@novell.com>
7720 * class.cs (TypeContainer.DoDefineMembers): Use
7721 FindBaseMemberWithSameName on Parent, since we're interested in
7722 whether we hide inherited members or not.
7723 (FindBaseMemberWithSameName): Make slightly more robust.
7725 Fix the non-generic testcase from #77396
7726 * decl.cs (DeclSpace.DeclContainer): Remove override.
7728 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
7729 declspaces for doppelgangers too.
7730 (UsingEntry): Implement IResolveContext.
7731 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
7732 'this' as the resolve context.
7733 (LocalAliasEntry): Likewise.
7735 Implement parts of #77403
7736 * roottypes.cs (RootDeclSpace): New. Used to represent the
7737 toplevel declaration space. Each namespace declaration introduces
7738 a "partial" root declaretion space.
7739 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
7740 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
7741 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
7742 from 'current_namespace.SlaveDeclSpace'.
7743 (namespace_declaration): Likewise.
7744 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
7745 check. It can't happen now.
7746 * decl.cs (DeclSpace.LookupType): Likewise.
7747 * driver.cs (MainDriver): Sanity check.
7749 2006-08-01 Raja R Harinath <rharinath@novell.com>
7751 * decl.cs (DeclSpace.FindNestedType): Remove.
7752 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
7753 LookupTypeContainer to get the container of the nested type.
7754 * class.cs (TypeContainer.FindNestedType): Make non-override.
7756 2006-07-31 Raja R Harinath <rharinath@novell.com>
7758 * decl.cs (DeclSpace.PartialContainer): Move field from ...
7759 * class.cs (TypeContainer.PartialContainer): ... here.
7760 (TypeContainer.AddBasesForPart): New helper.
7761 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
7763 * cs-parser.jay (current_class): Convert to DeclSpace.
7764 (struct_declaration, interface_declaration, class_declaration):
7765 Use AddBasesForPart instead of .Bases directly.
7766 * const.cs, iterators.cs: Update to changes.
7768 2006-07-28 Raja R Harinath <rharinath@novell.com>
7770 * class.cs (TypeContainer.AddMemberType): Rename from
7772 (TypeContainer.AddMember): Rename from AddToMemberContainer.
7773 (AddTypeContainer): New. Combine AddClassOrStruct and
7775 (AddPartial): Update. Add 'is_partial' argument.
7776 * roottypes.cs: Update to changes.
7777 * cs-parser.jay (push_current_class): New helper for handling
7778 current_container and current_class.
7779 (struct_declaration, interface_declaration, class_declaration):
7782 2006-07-26 Raja R Harinath <rharinath@novell.com>
7784 * roottypes.cs: Rename from tree.cs.
7786 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
7787 * tree.cs (Tree, ITreeDump): Remove types.
7788 * rootcontext.cs (tree, Tree): Remove fields.
7789 (root, ToplevelTypes): New.
7790 * *.cs: Update to rename.
7792 * tree.cs (Tree.RecordDecl): Remove.
7793 (RootTypes.AddToTypeContainer): Record the toplevel type in its
7795 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
7797 2006-07-23 Raja R Harinath <harinath@gmail.com>
7799 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
7800 DoFlowAnalysis and OmitStructFlowAnalysis here.
7801 (ec.With): Rename from WithUnsafe and generalize.
7802 (ec.WithCheckState): Remove. All users can be handled by 'With'.
7803 (ec.WithFlowAnalyis): New.
7804 * ecore.cs, expression.cs, statement.cs: Update.
7806 2006-07-22 Raja R Harinath <harinath@gmail.com>
7808 * statement.cs (Block.ResolveMeta): Simplify slightly.
7810 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
7811 multiple boolean fields. Convert InUnsafe, constant_check_state,
7812 check_state to flags.
7813 (CheckState, ConstantCheckState): Update.
7814 (InUnsafe): New read-only property.
7815 (FlagsHandle): Rename from CheckStateHandle and convert to handle
7817 (WithUnsafe): New helper similar to WithCheckState.
7818 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
7819 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
7821 2006-07-21 Raja R Harinath <rharinath@novell.com>
7823 Make comparisons use the same IL irrespective of whether they're
7824 in a 'checked' or 'unchecked' context: one of the issues in #78899
7825 * codegen.cs (EmitContext.CheckState): Make read-only property.
7826 (EmitContext.ConstantCheckState): Likewise.
7827 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
7828 helper that implement a save/restore stack for CheckState
7829 values. This is the only way to change check-state.
7830 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
7831 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
7832 (CheckedExpr.EmitBranchable): New forwarding method.
7833 (UnCheckedExpr): Likewise.
7834 * statement.cs (Block.ResolveMeta): Use WithCheckState.
7835 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
7836 (Checked.Resolve, checked.DoEmit): Likewise.
7838 2006-07-20 Miguel de Icaza <miguel@novell.com>
7840 * anonymous.cs: Cache the resolved anonymous delegate, and return
7841 this so that the ResolveTopBlock is only triggered once, not
7844 Currently we trigger ResolvetopBlock twice due to a first pass of
7845 argument check compatibility, and a second pass that does the
7848 2006-07-15 Marek Safar <marek.safar@seznam.cz>
7850 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
7852 * rootcontext.cs (Reset): Add helper_classes.
7854 2006-07-15 Marek Safar <marek.safar@seznam.cz>
7857 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
7860 2006-07-13 Miguel de Icaza <miguel@novell.com>
7862 * statement.cs (Lock): Handle expressions of type
7863 TypeManager.null_type specially. Fixes #78770
7865 2006-07-08 Marek Safar <marek.safar@seznam.cz>
7867 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
7870 2006-07-08 Marek Safar <marek.safar@seznam.cz>
7872 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
7873 for accessors as well.
7874 * ecore.cs (EventExpr): Add AccessorTable.
7876 2006-07-01 Marek Safar <marek.safar@seznam.cz>
7879 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
7880 for CS0122 where appropriate.
7881 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
7883 (Filter): Assembly can be null in the case of top level attributes.
7885 2006-06-25 Marek Safar <marek.safar@seznam.cz>
7889 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
7890 is done at global level.
7892 2006-06-24 Marek Safar <marek.safar@seznam.cz>
7894 A fix for #77002, Implemented TypeForwarder support.
7896 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
7897 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
7898 * typemanager.cs (): Add type_forwarder_attr_type.
7900 2006-06-24 Marek Safar <marek.safar@seznam.cz>
7902 * report.cs: Add CS0469 warning.
7904 2006-06-21 Martin Baulig <martin@ximian.com>
7906 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
7907 the `try'-block, so we also report CS0016 etc. there.
7909 2006-06-21 Martin Baulig <martin@ximian.com>
7912 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
7914 2006-06-21 Martin Baulig <martin@ximian.com>
7916 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
7917 also report CS1686 for parameters.
7919 2006-06-21 Martin Baulig <martin@ximian.com>
7921 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
7922 instead of an error if the value is not implicitly convertible to
7923 the switch types; fixes #77964.
7925 2006-06-21 Raja R Harinath <rharinath@novell.com>
7928 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
7929 FieldBuilder is null.
7932 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
7933 'left' and 'right' before error-checking.
7935 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
7937 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
7939 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
7940 (FieldExpr.DoResolve): likewise.
7941 (PropertyExpr.InstanceResolve): likewise.
7942 (EventExpr.InstanceResolve): likewise.
7944 2006-06-04 Marek Safar <marek.safar@seznam.cz>
7946 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
7947 attribute applicable tests for attribute argument.
7949 2006-06-02 Raja R Harinath <rharinath@novell.com>
7952 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
7953 (Binary.OverloadResolve_PredefinedIntegral): New.
7954 (Binary.OverloadResolve_PredefinedFloating): New.
7955 (Binary.OverloadResolve_PredefinedString): New.
7956 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
7957 Follow the standard more closely, and treat numeric promotions in
7958 terms of overload resolution.
7959 (Binary.CheckShiftArguments): Simplify.
7961 2006-06-01 Raja R Harinath <rharinath@novell.com>
7963 * flowanalysis.cs (MyBitVector): Simplify representation.
7964 (MyBitVector.Clone): Avoid allocating BitArray.
7965 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
7966 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
7967 (*): Update. Change all references to MyBitVector.And and
7968 MyBitVector.Or to &= and |=.
7970 2006-05-29 Raja R Harinath <rharinath@novell.com>
7973 * cs-parser.jay (formal_parameter_list): Extend the pattern below
7974 to param arguments too.
7976 2006-05-26 Miguel de Icaza <miguel@novell.com>
7978 * cs-parser.jay: Catch another parsing form for arglist being
7979 followed by other arguments. Fixes #78313.
7981 2006-05-24 Raja R Harinath <rharinath@novell.com>
7983 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
7984 checking of out parameters to ...
7985 (FlowBranchingToplevel.Merge): ... here.
7986 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
7987 set, propagate the origin upward, and only complain if there was
7989 (FlowBranchingException.AddContinueOrigin): Likewise.
7990 (FlowBranchingException.AddReturnOrigin): Likewise.
7991 (FlowBranchingException.AddGotoOrigin): Likewise.
7993 2006-05-23 Raja R Harinath <rharinath@novell.com>
7995 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
7996 unreachable, skip it.
7997 (FlowBranchingException.Merge): Always propagate jumps, even if
7998 the finally block renders subsequent code unreachable.
8000 2006-05-18 Raja R Harinath <rharinath@novell.com>
8003 * statement.cs (Goto.Resolve): Move responsibility for resolving
8004 'goto' to FlowBranching.AddGotoOrigin.
8005 (Goto.SetResolvedTarget): New. Callback to set the
8006 LabeledStatement that's the target of the goto.
8007 (Goto.DoEmit): Use Leave instead of Br when crossing an
8008 unwind-protect boundary.
8009 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
8010 LookupLabel and adjust to new semantics.
8011 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
8012 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
8013 Goto.SetResolvedTarget to update target.
8014 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
8015 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
8016 AddBreakOrigin & co. Delay propagation until ...
8017 (FlowBranchingException.Merge): ... this.
8019 * statement.cs (Block.Resolve): Always depend on flow-branching to
8020 determine unreachability. Kill workaround that originally emitted
8021 only one statement after an "unreachable" label (see infloop in
8024 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
8025 This is still "wrong", but anything better would probably need a
8026 multi-pass algorithm.
8027 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
8028 usage vector. Force current usage vector to be reachable, to
8029 optimistically signify backward jumps.
8030 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
8032 (FlowBranchingLabeled.Merge): New. If no backward jump was
8033 detected, return the original salted-away usage vector instead,
8034 updated with appropriate changes. Print unreachable warning if
8036 * statement.cs (Block.Resolve): Don't print unreachable warning on
8037 a labeled statement.
8039 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
8041 * driver.cs: Pass filename without path to AssemblyBuilder's
8042 AddResourceFile. Fixes bug #78407.
8044 2006-05-17 Raja R Harinath <rharinath@novell.com>
8046 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
8047 * flowanalysis.cs (FlowBranchingLabeled): ... here.
8048 (FlowBranching.MergeChild): Overwrite
8049 reachability information from Labeled branchings too.
8051 2006-05-16 Raja R Harinath <rharinath@novell.com>
8053 * statement.cs (Goto.Resolve): Merge jump origins here ...
8054 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
8056 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
8057 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
8058 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
8059 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
8061 * statement.cs (Goto.Resolve): ... not here.
8062 (Goto.Emit): Remove CS1632 check.
8064 2006-05-14 Marek Safar <marek.safar@seznam.cz>
8066 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
8069 2006-05-11 Raja R Harinath <rharinath@novell.com>
8071 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
8072 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
8073 (FlowBranchingException.Label): Likewise.
8075 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
8077 (MyBitVector.Or): Use it to avoid losing information (Count).
8078 (FlowBranching.MergeOrigins): Likewise.
8080 * flowanalysis.cs (UsageVector.IsDirty): Remove.
8081 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
8082 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
8083 (UsageVector.ToString): Simplify.
8084 (UsageVector.MergeSiblings): Move here from ...
8085 (FlowBranching.Merge): ... here.
8086 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
8089 2006-05-10 Raja R Harinath <rharinath@novell.com>
8091 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
8092 null bitvector is treated as all-true.
8094 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
8095 (MyBitVector): Rationalize invariants. 'vector != null' implies
8096 that we have our own copy of the bitvector. Otherwise,
8097 'InheritsFrom == null' implies all inherited bits are true.
8099 2006-05-09 Marek Safar <marek.safar@seznam.cz>
8101 * statement.cs (LocalInfo): Add IsConstant.
8102 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
8103 local variable for constants.
8105 2006-05-09 Raja R Harinath <rharinath@novell.com>
8107 * flowanalysis.cs (MyBitVector.Empty): New.
8108 (MyBitVector): Don't allow InheritedFrom to be null.
8109 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
8110 (UsageVector, FlowBranching): Update to changes.
8112 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
8113 recursion. The 'Parent == null' condition isn't sufficient for
8115 (FlowBranching.AddBreakOrigin): Likewise.
8116 (FlowBranching.AddContinueOrigin): Likewise.
8117 (FlowBranching.AddReturnOrigin): Likewise.
8118 (FlowBranching.StealFinallyClauses): Likewise.
8119 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
8120 (FlowBranching.CheckOutParameters): Likewise.
8121 (FlowBranchingToplevel): Terminate all the above recursions here.
8122 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
8123 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
8125 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
8127 (FlowBranchingToplevel): New. Empty for now.
8128 (FlowBranching.MergeTopBlock): Update.
8129 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
8130 branching for the anonymous delegate.
8131 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
8133 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
8134 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
8135 information at the start of the merge. Reorganize.
8137 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8139 * class.cs (MethodData.Define): Method cannot implement interface accessor.
8141 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8143 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
8144 to newly introduced ctor.
8146 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
8147 message to one place.
8148 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
8151 2006-05-07 Marek Safar <marek.safar@seznam.cz>
8153 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
8155 * ecore.cs (Expression.ResolveAsConstant): Updated.
8157 * statement.cs (ResolveMeta): Updated.
8159 2006-05-06 Marek Safar <marek.safar@seznam.cz>
8161 * cs-parser.jay: __arglist cannot be used in initializer.
8163 2006-05-06 Marek Safar <marek.safar@seznam.cz>
8166 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
8169 2006-05-05 Raja R Harinath <rharinath@novell.com>
8171 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
8172 (LabeledStatement): Add 'name' parameter.
8173 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
8174 (Block.AddLabel): Update to changes.
8175 * cs-parser.jay (labeled_statement): Likewise.
8177 * flowanalysis.cs (BranchingType.Labeled): New.
8178 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
8179 (FlowBranchingLabeled): New. Does nothing for now, but will
8180 eventually handle 'goto' flows.
8181 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8182 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
8183 that's terminated ...
8184 (Block.Resolve): ... here.
8186 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
8187 (UsageVector.MergeFinallyOrigins): Likewise.
8188 (FlowBranching.InTryOrCatch): Likewise.
8189 (FlowBranching.AddFinallyVector): Likewise.
8190 (FlowBranchingException): Update to changes.
8193 * statement.cs (Return.Resolve): Move error checking to ...
8194 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
8195 (FlowBranchingException): Handle return origins like break and
8197 (FlowBranching.UsageVector.CheckOutParameters): Remove.
8199 2006-05-04 Marek Safar <marek.safar@seznam.cz>
8202 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
8205 2006-05-04 Marek Safar <marek.safar@seznam.cz>
8208 * class.cs (MethodData.Define): Do public accessor check only when method
8209 implements an interface.
8211 2006-05-04 Raja R Harinath <rharinath@novell.com>
8213 Remove special handling of 'break'
8214 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
8215 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
8216 (UsageVector.Break): Remove.
8217 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
8219 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
8221 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
8222 UsageVector.Breaks (). Don't set NeedsReturnLabel.
8224 2006-05-03 Marek Safar <marek.safar@seznam.cz>
8227 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
8228 be the interface member.
8230 2006-05-03 Marek Safar <marek.safar@seznam.cz>
8233 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
8234 for emitting small (int) values.
8236 2006-05-03 Raja R Harinath <rharinath@novell.com>
8239 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
8240 control-flow passes through the 'finally' after merging-in all the
8241 control-flows from 'try' and the 'catch' clauses.
8243 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
8244 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
8245 always true at the only non-recursive entry point.
8246 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
8247 FlowBranchingBreakable.
8248 (FlowBranchingLoop): Remove.
8249 * statement.cs (Return.DoResolve): Update to changes.
8252 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
8253 (FlowBranching.CreateBranching): Handle it: create a
8254 FlowBranchingContinuable.
8255 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
8256 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
8257 except that it handles the 'continue' command.
8258 (FlowBranching.UsageVector.MergeOrigins): Rename from
8260 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
8261 except that it overrides AddContinueOrigin.
8262 (FlowBranchingException): Override AddContinueOrigin, similar to
8264 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
8265 Create a new branching around the embedded statement.
8266 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
8267 control flow after the embedded statement.
8268 (Continue.Resolve): Move all error checking to AddContinueOrigin.
8270 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
8271 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
8272 FlowBranchingBreakable.
8273 (FlowBranchingSwitch): Remove.
8276 * statement.cs (Break.Resolve): Simplify. Move responsibility for
8277 error reporting to ...
8278 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
8279 Rename from 'AddBreakVector'. Add new location argument. Return
8280 a bool indicating whether the 'break' crosses an unwind-protect.
8281 (FlowBranchingException.AddBreakOrigin): Add.
8282 (FlowBranchingException.Merge): Propagate 'break's to surrounding
8283 flowbranching after updating with the effects of the 'finally'
8285 (FlowBranchingBreakable): New common base class for
8286 FlowBranchingLoop and FlowBranchingSwitch.
8288 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
8290 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
8292 2006-05-02 Raja R Harinath <rharinath@novell.com>
8294 * statement.cs (Do.Resolve): If the loop is infinite, set the
8296 (While.Resolve, For.Resolve): Set a barrier after the embedded
8297 statement. There's no direct control flow that goes from the end
8298 of the embedded statement to the end of the loop.
8299 * flowanalysis.cs (FlowBranching.Infinite): Remove.
8300 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
8301 above ensure that the reachability is correctly computed.
8303 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
8304 (UsageVector.MergeBreakOrigins): If the current path is
8305 unreachable, treat it as if all parameters/locals are initialized.
8306 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
8307 infinite loops before merging-in break origins.
8309 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
8310 (Reachability.Reachable): Split part into ...
8311 (Reachability.Unreachable): ... this. Simplify.
8312 (Reachability.IsUnreachable): Use 'Unreachable' instead.
8314 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
8315 (Reachability.SetThrowsSometimes): Likewise.
8316 (FlowBranchingBlock.MergeTopBlock): Don't compare against
8317 TriState.Always, use corresponding property.
8318 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
8319 (Block.Resolve): Likewise. Remove some redundant checks.
8321 2006-05-02 Raja R Harinath <harinath@gmail.com>
8323 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
8324 (Reachability.Meet): Don't bother checking AlwaysThrows --
8325 barrier is always set.
8326 (FlowBranchingBlock.Merge): Likewise.
8328 2006-05-01 Raja R Harinath <harinath@gmail.com>
8330 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
8331 checks for unreachable.
8333 2006-05-01 Marek Safar <marek.safar@seznam.cz>
8336 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
8338 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
8339 whether field is really assigned.
8341 2006-04-30 Raja R Harinath <harinath@gmail.com>
8343 * flowanalysis.cs (Reachability): Make 4-argument constructor
8345 (Reachability.Meet): Rename from 'And'. Remove static variant.
8346 (Reachability.Always): Rename from the highly misleading
8347 'Reachability.Never'.
8348 (FlowBranching.Merge): Update to changes. Mark an impossible
8349 situation with a 'throw'.
8350 (*): Update to changes.
8352 2006-04-29 Raja R Harinath <harinath@gmail.com>
8354 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
8356 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
8357 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
8358 (*): Update to changes.
8359 * statement.cs: Update to changes.
8361 2006-04-28 Marek Safar <marek.safar@seznam.cz>
8364 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
8366 2006-04-28 Raja R Harinath <harinath@gmail.com>
8368 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
8371 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
8372 argument to two arguments: an usage-vector and a bool. Move call
8373 to FlowBranching.Merge () ...
8374 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
8376 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
8377 handling of loop and switch reachability to ...
8378 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
8380 2006-04-27 Raja R Harinath <harinath@gmail.com>
8382 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
8383 handling to FlowBranchingLoop.InLoop.
8384 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
8386 2006-04-26 Marek Safar <marek.safar@seznam.cz>
8389 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
8390 anonymous method is allowed from AnonymousContainer here.
8392 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
8394 2006-04-24 Raja R Harinath <rharinath@novell.com>
8397 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
8399 2006-04-23 Marek Safar <marek.safar@seznam.cz>
8402 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
8403 (DoubleConstant.Reduce): Ditto.
8405 2006-04-23 Raja R Harinath <rharinath@novell.com>
8407 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
8408 Remove 'lvalue_right_side' argument. Move parts to ...
8409 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
8410 (LocalVariable.DoResolveLValue): ... these.
8412 2006-04-21 Raja R Harinath <rharinath@novell.com>
8415 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
8416 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
8417 (LocalVariableReference.DoResolveBase): Use it to implement new
8419 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
8420 (Argument.Resolve): Simplify. Move CS1510 check ...
8421 * ecore.cs (Expression.ResolveLValue): ... here.
8422 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
8423 (PropertyExpr.DoResolveLValue): Likewise.
8424 (FieldExpr.Report_AssignToReadonly): Likewise.
8425 (FieldExpr.DoResolve): Add 'out_access' argument. Use
8426 LValueMemberAccess or LValueMemberOutAccess on instance depending
8428 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
8429 DoResolve as appropriate.
8431 2006-04-20 Raja R Harinath <rharinath@novell.com>
8434 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
8435 implicit conversions on 'out' and 'ref' arguments.
8437 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
8438 improve clarity. Remove dead code.
8441 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
8442 (Catch.Resolve): Resolve VarBlock if it exists.
8444 2006-04-19 Miguel de Icaza <miguel@novell.com>
8446 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
8447 twice, this was some residual code, the enumerator was emitted
8448 properly in the two branche of if later.
8450 2006-04-19 Raja R Harinath <rharinath@novell.com>
8452 * expression.cs (Cast.ResolveLValue): Remove. The result of a
8453 cast is never an lvalue.
8454 (Cast.DoResolve, Cast.ResolveRest): Combine.
8455 (Argument.Emit): Simplify slightly. Move 'Expr is
8456 IMemoryLocation' check ...
8457 (Argument.Resolve): ... here.
8458 (Argument.Error_LValueRequired): Remove. Inline into only user.
8460 Simplifications. Fix cs0191-2.cs
8461 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
8462 CS1649 and CS1651 to ...
8463 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
8464 the actual selection of the error code and message to a lookup
8465 table. Add a dummy return value to simplify callsites.
8466 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
8467 readonly fields of other instances of the same type. Move CS0197
8469 * expression.cs (Argument.Resolve): ... here. Simplify code.
8470 Ensure that ec.InRefOutArgumentResolving is only set during LValue
8471 resolution of an out or ref argument. The code simplification
8472 above uses this invariant.
8474 2006-04-18 Raja R Harinath <rharinath@novell.com>
8476 Possibly fix #77752. Fix cs1690-[4-7].cs.
8477 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
8478 CheckMarshallByRefAccess. Drop parameter.
8479 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
8481 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
8483 * report.cs (AllWarnings): Add CS1690.
8484 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
8486 (LocalVariableReference.DoResolveBase): Update.
8488 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8490 * class.cs (MethodOrOperator): Moved common parts from method class.
8491 detect obsolete attributes.
8492 (Method.Define): Simplified as it reuses code from base.
8493 (Constructor.ValidAttributeTargets): Fixed issue found during
8495 (Destructor.ValidAttributeTargets): Fixed issue found during
8497 (Operator): Finished refactoring set off by #78020. Operator class is now
8498 ordinary method class.
8500 * anonymous.cs: Updated.
8502 * decl.cs (DeclSpace): Add IsGeneric
8504 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8506 * class.cs (Constructor.Emit): Don't emit the attributes twice.
8508 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8510 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
8511 detect obsolete attributes.
8512 (Method.CreateEmitContext): Moved to MethodOrOperator.
8514 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8517 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
8518 customized exception to make crash detection easier.
8519 (MethodOrOperator): Started to work on new base class for methods and
8521 (Method): Derives from MethodOrOperator.
8522 (Constructor.Emit): Emits its own attributes.
8523 (AbstractPropertyEventMethod.Emit): Ditto.
8524 (Operator): Derives from MethodOrOperator, will refactor fully in extra
8526 (Operator.Emit): It's temporary more tricky than should be.
8528 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
8530 * report.cs (InternalErrorException): Add ctor with inner exception.
8532 2006-04-08 Marek Safar <marek.safar@seznam.cz>
8535 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
8538 2006-04-07 Marek Safar <marek.safar@seznam.cz>
8541 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
8544 2006-04-06 Marek Safar <marek.safar@seznam.cz>
8546 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
8547 attribute is present and Guid not.
8548 (Interface.ApplyAttributeBuilder): Ditto.
8550 * attribute.cs: Add error message.
8552 2006-04-06 Marek Safar <marek.safar@seznam.cz>
8556 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
8557 sources (it's composite) so hold them in extra array as they are used in
8558 Emit phase only. It worked in the previous versions by mistake.
8559 (Attribute.Emit): Emit attribute for more owners when exist.
8561 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
8562 it has now different behaviour.
8564 2006-04-04 Marek Safar <marek.safar@seznam.cz>
8566 * constant.cs (Constant.IsDefaultInitializer): New method.
8568 * class.cs: Updated.
8570 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
8571 re-initialize default values. It saves KBs almost for every assembly.
8572 Thanks Zoltan for the idea.
8573 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
8574 (ArrayCreation.DoResolve): Resolve only once.
8575 (ArrayCreation.Emit): Emit static initializer only when it is faster.
8576 (ArrayCreation.GetAttributableValue): Cope with optimized values.
8578 2006-04-03 Zoltan Varga <vargaz@gmail.com>
8580 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
8583 2006-04-01 Marek Safar <marek.safar@seznam.cz>
8585 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
8586 in an embedded statement too.
8588 2006-04-01 Raja R Harinath <rharinath@novell.com>
8591 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
8593 2006-04-01 Marek Safar <marek.safar@seznam.cz>
8597 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
8600 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
8602 2006-03-31 Marek Safar <marek.safar@seznam.cz>
8604 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
8607 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
8608 LocalTemporary change.
8610 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
8612 (ClassOrStruct.DefineFieldInitializers): Implemented static field
8613 initializers optimization.
8614 (ClassOrStruct.TypeAttr): Moved from modifiers.
8615 (Constructor.CheckBase): Don't crash when static ctor has parameters.
8616 (FieldBase.ResolveInitializer): Resolves initializer.
8617 (FieldBase.HasDefaultInitializer): New property.
8619 * cs-parser.jay: Removed message.
8621 * expression.cs (CompilerGeneratedThis): New specialization.
8623 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
8625 2006-03-28 Marek Safar <marek.safar@seznam.cz>
8627 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
8629 2006-03-27 Marek Safar <marek.safar@seznam.cz>
8631 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
8632 be now EnumConstants only.
8634 2006-03-27 Marek Safar <marek.safar@seznam.cz>
8636 * attribute.cs, driver.cs: Reset more caches.
8638 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8640 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
8642 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8644 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
8645 for easier reuse. Updated all overrides.
8646 (IntegralConstant): New base class for all integral constants.
8647 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
8648 of the constant range, report custom error.
8649 (UIntConstant.Reduce): Fixed uint conversion.
8651 * ecore.cs, literal.cs: Reduce updates.
8653 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8657 * class.cs (Constructor.Define): Removed extra if for default ctors.
8658 A patch from Atsushi Enomoto.
8660 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8662 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
8663 GetAttributableValue.
8665 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
8668 * convert.cs (ImplicitConversionRequired): Error message moved to
8671 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
8672 automatic implicit conversion of an output value.
8673 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
8675 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
8677 (TypeOf.GetAttributableValue): Add extra handling for object type.
8679 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
8680 special error message.
8682 2006-03-25 Marek Safar <marek.safar@seznam.cz>
8684 * class.cs (Constructor.Emit): Don't crash when struct ctor is
8686 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
8687 compatible with MS runtime.
8689 2006-03-23 Marek Safar <marek.safar@seznam.cz>
8691 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
8692 attribute arguments here.
8694 * class.cs (Indexer.Define): The check was moved to attribute class.
8696 2006-03-22 Marek Safar <marek.safar@seznam.cz>
8698 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
8699 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
8702 2006-03-22 Raja R Harinath <rharinath@novell.com>
8704 Support ParameterDefaultValueAttribute in gmcs. Also applied to
8705 mcs to keep code differences small.
8706 * attribute.cs (Attribute.GetParameterDefaultValue): New.
8707 * typemanager.cs (parameter_default_value_attribute_type): New.
8708 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
8711 2006-03-21 Marek Safar <marek.safar@seznam.cz>
8713 * expression.cs (StringConcat.Append): Reverted back to no warning state.
8715 2006-03-21 Marek Safar <marek.safar@seznam.cz>
8717 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
8719 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
8722 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
8724 * doc-bootstrap.cs : fix build.
8726 2006-03-20 Marek Safar <marek.safar@seznam.cz>
8728 * expression.cs (StringConcat.Append): Issue a warning when empty string
8731 2006-03-20 Marek Safar <marek.safar@seznam.cz>
8733 * assign.cs (CompoundAssign.ResolveSource): Removed.
8735 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
8738 * class.cs (TypeContainer.FindMethods): Removed.
8739 (TypeContainer.CheckMemberUsage): Made static.
8741 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
8743 * constant.cs (CheckRange): Removed unused type argument.
8744 (CheckUnsigned): Removed unused type argument.
8746 * cs-parser.jay: Updated after MemberAccess clean up.
8747 Uses Length for empty string test.
8749 * cs-tokenizer.cs: Uses Length for empty string test.
8750 (IsCastToken): Made static.
8751 (is_hex): Made static.
8752 (real_type_suffix): Made static.
8754 * decl.cs (SetupCache): Made static.
8755 (OnGenerateDocComment): Removed unused ds argument.
8757 * delegate.cs (VerifyDelegate): Removed unused argument.
8759 * doc.cs: Uses Length for empty string test.
8761 * driver.cs: Uses Length for empty string test.
8763 * enum.cs (IsValidEnumType): Made static
8765 * expression.cs (EnumLiftUp): Removed unused argument.
8766 (ResolveMethodGroup): Ditto.
8767 (BetterConversion): Ditto.
8768 (GetVarargsTypes): Ditto.
8769 (UpdateIndices): Ditto.
8770 (ValidateInitializers): Ditto.
8771 (MemberAccess.ctor): Ditto.
8772 (GetIndexersForType): Ditto.
8774 * flowanalysis.cs: (MergeFinally): Removed unused argument.
8776 * iterators.cs: Updated after MemberAccess clean up.
8778 * location.cs: Uses Length for empty string test.
8780 * namespace.cs: Uses Length for empty string test.
8782 * report.cs (CheckWarningCode): Made static.
8784 * statement.cs (LabeledStatement): Removed unused argument.
8786 * typemanager.cs (FilterNone): Removed.
8788 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8790 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
8793 * class.cs: Updated.
8795 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8797 * cs-parser.jay.cs: __arglist is not allowed for delegates.
8799 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8803 * expression.cs (VerifyArgumentsCompat): Reverted to double error
8804 reporting, it's more tricky than I thought.
8806 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8810 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
8812 (AnonymousMethod.ImplicitStandardConversionExists): New method.
8813 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
8814 Add more error reporting; Fixed issue with params.
8816 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
8818 * cs-parser.jay: AnonymousMethod requires host container.
8820 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
8822 2006-03-18 Raja R Harinath <harinath@gmail.com>
8824 * class.cs: Change 'TypeContainer ds' constructor argument to
8825 'DeclSpace parent'. Some classes were missed below due to
8826 different naming convention.
8828 * class.cs (MemberCore.Parent): Delete. This makes the
8829 ParentContainer changes below enforceable by the compiler.
8831 Treat pointers to enclosing declaration space as 'DeclSpace', not
8833 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
8834 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
8836 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
8838 (Block.AddThisVariable): Likewise.
8839 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
8840 (AbstractPropertyEventMethod.Emit): Likewise.
8841 (AbstractPropertyEventMethod.EmitMethod): Likewise.
8842 (GetMethod.Define, SetMethod.Define): Likewise.
8843 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
8844 (DelegateMethod.EmitMethod): Likewise.
8846 Fix regression test-partial-13.cs.
8847 Rationalize use of PartialContainer. Ensure that the partial
8848 class semantics can be tied to type-correctness, i.e., any
8849 violation will cause a compile error.
8850 * class.cs, const.cs: Access all fields that belong to class
8851 TypeContainer via ParentContainer. Arguments of EmitContexts and
8852 Resolve()-like functions still use 'Parent'.
8854 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
8855 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
8856 (PropertyMethod.CheckModifiers): Remove unused argument.
8857 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
8860 2006-03-17 Raja R Harinath <harinath@gmail.com>
8862 Make semantics of PartialContainer simpler.
8863 * decl.cs (DeclSpace.IsPartial): Remove.
8864 * class.cs (TypeContainer.IsPartial): Likewise.
8865 (TypeContainer..ctor): Set PartialContainer to point to self.
8866 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
8867 (TypeContainer.FindNestedType): Likewise.
8868 (MemberCore.ParentContainer): Simplify. Remove deprecation.
8870 2006-03-17 Marek Safar <marek.safar@seznam.cz>
8872 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
8874 2006-03-15 Marek Safar <marek.safar@seznam.cz>
8876 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
8879 2006-03-15 Marek Safar <marek.safar@seznam.cz>
8881 * class.cs (Operator.Define): An error for base conversion was not
8884 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
8886 * iterator.cs : yield break is allowed in try statement which has
8887 catch clauses. Fixed bug #77767.
8889 2006-03-13 Marek Safar <marek.safar@seznam.cz>
8891 A fix for #77593, #77574.
8893 * class.cs (MethodCore.CheckBase): Another if for operator.
8895 2006-03-09 Marek Safar <marek.safar@seznam.cz>
8897 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
8900 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
8901 (DelegateCreation.ImplicitStandardConversionExists): New method for just
8904 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
8907 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
8908 Updated after another emitcontext usage was clean up. It should help us to
8909 synchronize with gmcs easier.
8911 2006-03-04 Marek Safar <marek.safar@seznam.cz>
8915 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
8916 (Event.Define): ditto
8917 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
8919 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
8920 Removed redundant code and set NewSlot for Invoke method too.
8922 * parameter.cs (Parameters.ctor): Add custom, type ctor.
8923 (Parameters.MergeGenerated): New method. Use this method when you merge
8924 compiler generated argument with user arguments.
8926 2006-03-03 Marek Safar <marek.safar@seznam.cz>
8928 * attribute.cs (ResolveAsTypeTerminal): Removed.
8930 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
8931 specialization for predefined types; 30% speed up.
8932 Finally placed obsolete check to right place.
8933 (Expression.ResolveType): Removed.
8935 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
8936 Updated after ResolveType was removed.
8938 * expression.cs (Cast.ctor): Check void cast.
8939 (Binary.ResolveAsTypeTerminal): Is never type.
8940 (Conditional.ResolveAsTypeTerminal): Is never type.
8942 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
8944 2006-03-01 Raja R Harinath <rharinath@novell.com>
8947 * expression.cs (ParameterReference.DoResolveBase): Change return
8949 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
8953 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
8956 * typemanager.cs (GetFullNameSignature): Don't nullref on
8957 protected accessors.
8959 2006-02-27 Marek Safar <marek.safar@seznam.cz>
8961 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
8962 these two separated members to simplify the code.
8963 (Attribute.Resolve): Refactored to use new fields and methods.
8964 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
8965 implemented obsolete attribute checking.
8966 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
8967 implemented obsolete checking again. It look line never ending quest ;-)
8968 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
8970 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
8972 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
8974 *class.cs (Property.Define): Add RegisterProperty call.
8976 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
8977 argument groups (only 2).
8979 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
8980 encoding expression to arguments.
8981 (Expression.ExprClassToResolveFlags): Just turned to property.
8983 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
8984 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
8985 optimized as well as implemented support for zero-length attributes.
8987 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
8988 Add caching of PropertyInfo's.
8990 2006-02-25 Marek Safar <marek.safar@seznam.cz>
8992 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
8993 error multiple times.
8995 2006-02-25 Marek Safar <marek.safar@seznam.cz>
8997 New partial class implementation.
8998 A fix for #77027, #77029, #77403
9000 * attribute.cs (Attributable): Made attributes protected.
9002 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
9003 the replacements of ClassPart and PartialContainer.
9004 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
9005 (TypeContainer.AddInterface): Ditto.
9006 (TypeContainer.AddPartial): The main method for partial classes. It checks
9007 for errors and merges ModFlags and attributes. At the end class is added to
9009 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
9011 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
9012 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
9013 from the rest of partial classes.
9014 (TypeContainer.GetClassBases): Simplified.
9015 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
9017 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
9018 (TypeContainer.HasExplicitLayout): Uses Flags now.
9019 (PartialContainer): Removed.
9020 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
9021 (StaticClass): Was merged with Class.
9022 (Class.GetClassBases): class and static class bases are verified here.
9023 (Class.TypeAttr): Added static attributes when class is static.
9024 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
9025 (MemberBase): In some cases we need to call parent container for partial
9026 class. It should be eliminated but it's not easy now.
9028 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
9030 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
9031 partial classed to accumulate class comments.
9032 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
9034 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
9036 * driver.cs (MainDriver): Tree.GetDecl was removed.
9038 * modifiers.cs (Modifiers): Add partial modifier.
9040 * tree.cs (Tree.decl): Removed.
9041 (RootTypes): Started to use this class more often for root types
9044 2006-02-22 Marek Safar <marek.safar@seznam.cz>
9048 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
9049 external interface does not have an attribute.
9051 2006-02-22 Marek Safar <marek.safar@seznam.cz>
9053 Another prerequisites for new partial classs implementation.
9055 * attribute.cs (Attribute.Equal): Implemented.
9056 (Attribute.Emit): Changed as attributes can be applied more than twice.
9057 (Attributes.Emit): Check for duplicate attributes here.
9059 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
9060 as a parameter, clean-up.
9062 2006-02-11 Marek Safar <marek.safar@seznam.cz>
9066 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
9067 contains obsolete attribute check which can in some cases look for base
9068 type of current class which is not initialized yet.
9069 (TypeContainer.BaseType): Replacement of ptype.
9071 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
9073 2006-02-11 Marek Safar <marek.safar@seznam.cz>
9075 First of prerequisites for new partial classs implemention.
9077 * attribute.cs (Attributable): Extended by ResolveContext;
9078 Attributes finally have correct context for resolving in all cases.
9079 (AttachTo): Attribute owner is assigned here.
9081 * codegen.cs (IResolveContext): Introduce new interface to hold
9082 all information needed in resolving phase.
9083 (EmitContext): Implements IResolveContext; more clean-up needed here.
9085 * decl.cs (MemberCore): Implemented IResolveContext.
9087 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
9088 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
9089 parameter.cs, statement.cs, tree.cs, typemanager.cs:
9090 Refactored to use new IResolveContext instead of EmitContext; cleanup
9092 2006-02-06 Miguel de Icaza <miguel@novell.com>
9094 * codegen.cs (EmitScopeInitFromBlock): check here the
9095 capture_context, there is no need to make two calls to the
9098 * anonymous.cs: Add some debugging messages that might help me
9099 track other instances of this problem in the future (the
9100 regression of test 467).
9102 * cs-parser.jay: track the variable block, as we need to initalize
9103 any captured variables declared in this block for the "catch"
9104 portion of the "Try" statement.
9106 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
9107 scope initialization for captured variables.
9109 Also, move the emit for the variables after the block location has
9112 2006-02-06 Marek Safar <marek.safar@seznam.cz>
9114 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
9116 2006-02-02 Miguel de Icaza <miguel@novell.com>
9118 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
9119 commit yesterday, the initialization for the roots is necessary.
9120 What is not necessary is the scope activation.
9122 2006-02-02 Raja R Harinath <rharinath@novell.com>
9124 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
9125 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
9127 (Argument.Resolve): Remove CS0206 checks.
9129 2006-02-01 Miguel de Icaza <miguel@novell.com>
9131 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
9132 scopes for all the roots, the scopes will now be emitted when the
9133 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
9135 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
9136 code. This reduces a lot of existing cruft.
9138 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
9139 that the ScopeInfo is generated as we enter the scope, not at the
9140 time of use, which is what we used to do before.
9142 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
9143 every time a Block is about to be emitted if we have a
9146 2006-02-01 Raja R Harinath <rharinath@novell.com>
9148 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
9150 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
9152 * typemanager.cs (cons_param_array_attribute): Make private.
9153 (Reset): Set it to null.
9154 (InitCoreHelpers): Don't initialize it.
9155 (ConsParamArrayAttribute): New. Initialize it as needed.
9156 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
9158 2006-01-31 Miguel de Icaza <miguel@novell.com>
9160 * expression.cs: There might be errors reported during the
9161 selection of applicable methods. If there are errors, do not
9162 continue execution as it will lead the compiler to crash.
9164 2006-01-30 Miguel de Icaza <miguel@novell.com>
9166 * expression.cs: Member access is not allowed on anonymous
9167 methods. Fixes #77402.
9169 2006-01-30 Raja R Harinath <rharinath@novell.com>
9172 * cs-parser.jay (VariableDeclaration): Don't set
9173 current_array_type to null.
9174 (field_declaration, event_declaration, declaration_statement):
9175 Set it to null here.
9177 2006-01-28 Raja R Harinath <harinath@gmail.com>
9179 * typemanager.cs (GenericParameterPosition): New.
9182 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
9184 * doc.cs : To process "include" elements, first we should create
9185 another list than XmlNodeList, because it could result in node
9186 removal, which could result in that the XmlNodeList gives up
9189 (Also made code identical to gmcs again.)
9191 2006-01-25 Miguel de Icaza <miguel@novell.com>
9193 * ecore.cs: Introduce an error report that we were not catching
9194 before, if not silent, we must report the error. Gonzalo ran into
9197 2006-01-23 Miguel de Icaza <miguel@novell.com>
9199 A fix for bug: #76957
9201 * iterators.cs (MoveNextMethod.CreateMethodHost): call
9202 ComputeMethodHost before creating the method, this is a new
9205 * anonymous.cs (AnonymousContainer): Now we track all the scopes
9206 that this method references (RegisterScope). The actual scope
9207 where the method is hosted is computed with the ComputeMethodHost
9208 before we create the method.
9210 Moved the Deepest routine here.
9212 (AnonymousContainer.ComputeMethodHost): New routine used to
9213 compute the proper ScopeInfo that will host the anonymous method.
9215 (ScopeInfo): Deal with multiple roots. The problem was that we
9216 did not have a unique root where all ScopeInfos could be hanged
9217 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
9220 Remove AdjustMethodScope which is now computed at the end. Remove
9221 LinkScope which did a partial link, instead link all ScopeInfos
9222 before code generation from the new "LinkScopes" routine.
9224 Simplify all the Add* routines as they no longer need to maintain
9225 the tree, they just need to record that they are using variables
9228 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
9229 routines to produce the forest of ScopeInfo trees.
9231 * class.cs (TypeContainer.AppendMethod): This is just like
9232 AddMethod, but ensures that an interface implementation method
9233 (IEnumerable.XXX) is not inserted at the beginning of the queue of
9234 methods, but at the end.
9236 We use this functionality to ensure that the generated MoveNext
9237 method in the iterator class is resolved/emitted before the
9238 enumerator methods created.
9240 This is required because the MoveNext method computes the right
9241 ScopeInfo for the method. And the other methods will eventually
9242 need to resolve and fetch information computed from the anonymous
9245 2006-01-21 Raja R Harinath <harinath@gmail.com>
9246 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9249 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
9251 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
9252 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
9254 2006-01-18 Raja R Harinath <rharinath@novell.com>
9256 Fix #76656, cs0231-2.cs.
9257 * cs-parser.jay (formal_parameter_list): Make error case catch
9259 (parenthesized_expression_0): Add CS1026 check.
9260 (invocation_expression): Remove unused { $$ = lexer.Location }.
9262 2006-01-17 Raja R Harinath <rharinath@novell.com>
9265 * cs-parser.jay (statement_expression): Don't list out the
9266 individual statement-expressions. Convert syntax error into
9269 2006-01-16 Raja R Harinath <rharinath@novell.com>
9272 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
9273 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
9274 CheckIntermediateModification.
9275 (FieldExpr.DoResolve): Add new two-argument version that
9276 allows us to resolve the InstanceExpression as an lvalue.
9277 The one-argument variant is now just a wrapper.
9278 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
9279 Resolve the lhs as an lvalue if the it has a value type.
9280 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
9281 from Assign.DoResolve.
9282 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
9283 resolved as an lvalue.
9284 (PropertyExpr.DoResolve): Update.
9285 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
9286 has a value type. Move CS1612 check here from
9287 CheckIntermediateModification.
9288 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
9289 * expression.cs (EmptyExpression.OutAccess): New. Used as the
9290 'right_side' of a ResolveLValue on an 'out' argument.
9291 (EmptyExpression.LValueMemberAccess): New. Used as the
9292 'right_side' of a propagated ResolveLValue on a value type.
9293 (LocalVariableReference.DoResolveBase): Recognize
9294 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
9296 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
9297 EmptyExpression.Null.
9299 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
9301 * typemanager.cs : added IsGenericParameter(). In mcs it always
9303 * doc.cs : for generic parameters, use GenericParameterPosition,
9306 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
9308 * expression.cs: Fix Console.WriteLine ((this = x).foo);
9310 2006-01-12 Miguel de Icaza <miguel@novell.com>
9312 This fixes the problem where we used ldfld instead of ldflda to
9313 load the "THIS" pointer on captured parameters, when THIS is a
9314 value type. See bug #77205.
9316 * iterators.cs (CapturedThisReference.Emit): Pass false to
9317 EmitThis (we do not need the address).
9319 * codegen.cs (EmitThis): it needs to know whether we need the
9320 address of `this' or not. This is used by value types.
9322 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
9323 every other call passes false.
9325 2006-01-12 Raja R Harinath <rharinath@novell.com>
9328 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
9330 * expression.cs (Invocation.OverloadResolve): Update.
9331 (Invocation.DoResolve): Avoid double resolution of invocation.
9333 2006-01-11 Raja R Harinath <rharinath@novell.com>
9336 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
9337 unary negation of floating point types as 0-expr; negation cannot
9338 overflow in floating point types.
9341 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
9342 on operands of 'void' type.
9345 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
9346 and ExclusiveOr for boolean constants too.
9348 2006-01-09 Raja R Harinath <rharinath@novell.com>
9351 * expression.cs (Invocation.OverloadResolve): Replace reflected
9352 override methods with their base virtual methods, rather than
9354 * typemanager.cs (TypeManager.GetOverride): New.
9356 2006-01-05 Jb Evain <jbevain@gmail.com>
9358 * class.cs (Property.Define, Indexer.Define): do not tag the
9359 properties as SpecialName | RTSpecialName.
9361 2006-01-04 Miguel de Icaza <miguel@novell.com>
9363 * class.cs (MethodCore.IsDuplicateImplementation): This method was
9364 doing a low-level comparission of parameter types. It was lacking
9365 a check for __argslist.
9367 2005-12-30 Miguel de Icaza <miguel@novell.com>
9369 * expression.cs (ParameterReference.DoResolveBase): Allow
9370 reference parameters if they are local to this block.
9372 This allows the ref and out parameters of a delegate to be used in
9373 an anonymous method, for example:
9375 delegate void set (out int x);
9377 set s = delegate (out int x){
9381 This is used by functionality introduced late in the C# language.
9383 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
9384 method that take ref and out parameters.
9386 Fixes #77119 which was a late change in the spec.
9388 2005-12-23 Miguel de Icaza <miguel@novell.com>
9390 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
9391 parent if its the same scope. Fixes #77060.
9393 2005-12-21 Miguel de Icaza <miguel@novell.com>
9395 * driver.cs: Report the case of no source files and no -out:
9398 2005-12-20 Raja R Harinath <rharinath@novell.com>
9401 * expression.cs (ComposedCast.GetSignatureForError): Define.
9403 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9407 * namespace.cs (NamespaceEntry): Add extern_aliases as a
9408 ListDictionary, to contain the ExternAliasEntry entries (in
9409 addition to the NamespaceEntry.aliases hashtable). This field is
9410 shared between the original entry and its doppelganger (bodyless
9412 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
9413 extern_aliases field.
9414 (NamespaceEntry.Lookup): Move the IsImplicit check after the
9415 lookup in extern_aliases.
9417 2005-12-16 Raja R Harinath <rharinath@novell.com>
9420 * class.cs (TypeContainer.Mark_HasEquals): New.
9421 (TypeContainer.Mark_HasGetHashCode): New.
9422 (ClassPart): Override them.
9423 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
9426 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
9427 'parent' argument to the base constructor.
9429 Remove all mention of TypeContainer from decl.cs.
9430 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
9431 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
9432 (DeclSpace.DeclSpace): Likewise.
9433 (DeclSpace.DefineMembers): Remove unused argument.
9434 * cs-parser.jay (pop_current_class): Update to changes. Simplify
9435 debugging check -- we don't care if the debug code throws an
9436 InvalidCastException instead of an InternalErrorException.
9437 * class.cs (TypeContainer.DefineMembers): Update to changes.
9438 (TypeContainer.DoDefineMembers): Likewise.
9439 (TypeContainer.GetMethods): Likewise.
9440 (PropertyMember.Define): Likewise.
9441 (MemberBase.Parent): New property that forwards to
9442 MemberCore.Parent, but ensures that we get a TypeContainer.
9443 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
9444 (RootContext.PopulateTypes): Likewise. Remove special case code
9445 for !RootContext.StdLib: DefineMembers is idempotent.
9447 2005-12-14 Miguel de Icaza <miguel@novell.com>
9449 * convert.cs (ExplicitConversionCore): Check the return value from
9450 ExplicitConversionCore which can return null on failure. Fixes #76914
9452 2005-12-13 Marek Safar <marek.safar@seznam.cz>
9454 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
9456 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
9458 * doc.cs : The search for referenced namespace was insufficient to
9459 get global one as it used to do. Fixed bug #76965.
9461 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
9463 * doc.cs : check name in cref in the last phase that whether it is
9466 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
9468 * cs-tokenizer.cs : reverted the latest change: it somehow broke
9471 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
9473 * doc.cs : so it turned out that we cannot skip override check for
9474 interface members. Fixed bug #76954.
9476 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
9478 * cs-tokenizer.cs : fixed bug #75984:
9479 - #warning and #error should not be handled when the source line
9481 - #line is not checked strictly when the source line is disabled.
9482 - #define and #undef is on the other hand checked strictly at any
9485 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
9487 * cs-tokenizer.cs : missing Location (actually, filename) in one of
9490 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9492 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
9494 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
9496 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
9497 (FieldBase.Initializer): Initializer is now optional.
9498 (EventField.Define): Only event field can have initializer.
9500 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
9502 * const.cs (Const): Reuse initializer.
9504 * cs-parser.jay: Updated after FieldBase changes.
9505 Added current_array_type to simplify array initializers.
9507 * ecore.cs (NullCast.IsDefaultValue): Implemented.
9509 * expression.cs, iterators.cs: Updated.
9511 * namespace.cs (NamespaceEntry): Made UsingFound private.
9513 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9515 * parameterCollection.cs: Obsolete, removed.
9516 * parser.cs: Obsolete, removed.
9518 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9521 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
9523 * enum.cs (Enum.Define): Set obsolete context here.
9525 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
9528 - FindDocumentedMember() now expects 1) paramList as null
9529 when "we don't have to check the number of parameters" and
9530 2) Type.EmptyTypes when "there is no arguments".
9531 - Introduced FoundMember struct to hold the exact type which was
9532 used to find the documented member (the above change broke
9533 test-xml-044; it might be better just to use DeclaringType than
9534 what MS does, like this change does, but it depends on usage.)
9536 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
9538 * doc.cs : documented member might be from DeclaringType for nested
9539 types. Fixed bug #76782.
9541 2005-12-03 Ben Maurer <bmaurer@ximian.com>
9543 * anonymous.cs: Have the param code handle leaving copies on the
9544 stack etc. Allows anonymous params to take part in the assignment
9545 code (++, +=, etc). Fixes bug #76550
9547 * expression.cs: Handle the prepare_for_load/leave_copy by passing
9548 it down to the anon code.
9550 * iterators.cs: Use dummy var here
9552 * codegen.cs: Handle new vars
9554 2005-12-01 Marek Safar <marek.safar@seznam.cz>
9557 * class.cs (MethodData.Define): Set proper Obsolete context.
9559 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
9561 (FieldExpr.DoResolve): Ditto.
9563 2005-12-01 Marek Safar <marek.safar@seznam.cz>
9566 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
9567 parent is not obsolete.
9569 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
9571 * doc.cs : (FindDocumentedMember) find parameterless members first
9572 and get CS0419 in the early stage. Fixed first case of bug #76727.
9574 2005-11-30 Marek Safar <marek.safar@seznam.cz>
9577 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
9578 no error was reported.
9580 *expression.cs (Binary.DoResolve): left can be null.
9582 2005-11-22 Marek Safar <marek.safar@seznam.cz>
9585 * class.cs (MethodData.Emit): Parameters should be labeled first.
9587 2005-11-21 Marek Safar <marek.safar@seznam.cz>
9590 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
9592 2005-11-18 Marek Safar <marek.safar@seznam.cz>
9594 * attribute.cs (AreParametersCompliant): Moved to Parameter.
9596 * class.cs (MethodCore): Parameter clean up.
9597 (IMethodData): Added ParameterInfo.
9598 (MethodData): Parameter clean up.
9599 (Indexer.Define): Parameter clean up.
9611 * typemanager.cs: Parameter clean up.
9613 * delegate.cs (Define): Get rid of duplicated code.
9615 * expression.cs (ParameterReference): Removed useless parameters
9617 (Invocation): Ditto.
9619 * parameter.cs (ParamsParameter): New class, params specialization.
9620 (ArglistParameter): Attemp to separate arglist.
9621 (Parameter): Refactored to be reusable and faster.
9622 (Parameter.Modifier): Made understandable.
9623 (Parameters): Changed to be used as a class for `this' assembly
9624 parameters. Refactored to use new specialized classes.
9626 * support.cs (ParameterData): Added Types property.
9627 (InternalParameters): Deleted.
9629 2005-08-20 Martin Baulig <martin@ximian.com>
9631 Merging this patch from GMCS to fix #75867.
9633 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9634 scope if we don't already have it.
9636 2005-11-17 Martin Baulig <martin@ximian.com>
9639 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
9640 inherit the scope from our parent. Fixes #76653.
9642 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9644 * doc.cs : the previous patch does not actually fix the bug.
9645 PropertyInfo override check is now implemented and really fixed it.
9646 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
9648 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9650 * doc.cs : apply "override filter" also to properties.
9653 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9655 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
9656 no need to check overrides. For classes, omit those results from
9657 interfaces since they must exist in the class. Fixed bug #76726.
9659 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9661 * typemanager.cs : (GetFullNameSignature) differentiate indexers
9662 with different parameters. Fixed the second problem in #76685.
9664 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9666 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
9667 get expected 'protected' access in CheckValidFamilyAccess()).
9670 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9672 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
9673 Fixed bug #76705. CS1569 was incorrectly commented out.
9675 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
9677 * doc.cs : use Invocation.IsOverride() to do real override check.
9678 * expression.cs : made Invocation.IsOverride() internal.
9680 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
9682 * doc.cs : use TypeManager.FindMembers() instead of (possible)
9683 TypeBuilder.FindMembers() and filter overriden base members out.
9686 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9688 * doc.cs : ref/out parameters are represented as '@' (instead of
9689 '&' in type FullName). Fixed bug #76630 (additionally crefs).
9691 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9693 * doc.cs : when there was no '.' in cref to methods in doc comment,
9694 then parameters were missing in the output. Fixed bug #76691.
9696 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9698 * driver.cs : don't output docs when there is an error.
9701 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9704 Now it should detect indexers. Fixed primary concern in bug #76685.
9705 Fixed CS0419 message to not show the identical member signature in
9708 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9710 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
9711 instead of Type.FindMembers() since it does not handle events.
9714 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
9716 * codegen.cs: Fixed typo (speficied -> specified).
9718 2005-11-11 Marek Safar <marek.safar@seznam.cz>
9721 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
9723 2005-11-11 Marek Safar <marek.safar@seznam.cz>
9725 * attribute.cs: Changed error message.
9727 * cs-tokenizer.cs: One more check.
9729 2005-11-10 Marek Safar <marek.safar@seznam.cz>
9731 * statement.cs (Block.Resolve): Ignore empty statement.
9733 2005-11-10 Marek Safar <marek.safar@seznam.cz>
9735 * report.cs: Made error/warning methods more strict to avoid
9738 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
9739 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
9740 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
9741 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
9743 2005-11-08 Marek Safar <marek.safar@seznam.cz>
9745 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
9746 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
9748 * class.cs (TypeContainer.IsComImport): New property.
9749 (Constructor.Define): Create proper ctor for ComImport types.
9751 * expression.cs (New.CheckComImport): Fixed.
9753 2005-11-07 Miguel de Icaza <miguel@novell.com>
9755 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
9756 that a parameter has been captured does not mean that we do not
9757 have to do the rest of the processing. This fixes the second part
9758 of #76592. If there was another anonymous method capturing
9759 values in the past, the Scope would never be set for the second
9760 method that captured the same parameter.
9762 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
9763 properly manipulate the stack. Second part of fix for #76592.
9765 * expression.cs (New): Add support for invoking "new" on
9766 interfaces that have been flagged with the ComImport attribute and
9767 the CoClass. Fixes #76637
9769 * statement.cs (Try.DoEmit): When a variable is captured, do not
9770 try to emit the vi.LocalBuilder variable as it has been captured.
9771 Create a temporary variable and store the results on the
9772 FieldBuilder. Fixes #76642
9774 2005-11-07 Marek Safar <marek.safar@seznam.cz>
9776 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
9778 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
9780 * expression.cs (Binary.DoResolve): Added && optimalization.
9782 * typemanager.cs (AddUserType): Removed useless argument.
9784 2005-11-04 Marek Safar <marek.safar@seznam.cz>
9786 * statement.cs (Block.variables): Uses ListDictionary.
9788 2005-11-03 Marek Safar <marek.safar@seznam.cz>
9791 * class.cs (PartialContainer.EmitType): Customized to emit
9792 security attributes.
9793 (ClassPart.ApplyAttributeBuilder): Transform security attribute
9794 for partial classes.
9796 2005-11-03 Marek Safar <marek.safar@seznam.cz>
9799 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
9800 access has to be fixed.
9802 * typemanager.cs (IsUnmanagedType): Wrong common field type.
9804 2005-11-01 Marek Safar <marek.safar@seznam.cz>
9807 * ecore.cs (NullCast.Reduce): Implemented.
9809 * expression.cs (ArrayCreation.CheckIndices): Correcly check
9812 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
9814 (Foreach.Resolve): Catch null properly.
9816 2005-10-29 Marek Safar <marek.safar@seznam.cz>
9818 * cs-tokenizer.cs: Warning text fix.
9820 * driver.cs: AllWarningNumbers exposed on public interface.
9822 * report.cs (): Reviewed warning numbers.
9823 (IsValidWarning): Use binary search.
9825 2005-10-29 Marek Safar <marek.safar@seznam.cz>
9827 * driver.cs: Implemeted resource visibility.
9828 (Resources): New class for code sharing between /res: and
9831 2005-10-28 Marek Safar <marek.safar@seznam.cz>
9834 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
9837 * convert (Convert.ImplicitReferenceConversion): NullCast holds
9840 * ecore.cs (NullCast): Child is contant only.
9842 * literal.cs (NullLiteral.Reduce): null can be converted to any
9845 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
9847 * driver.cs: Use Encoding.Default as default code page instead
9850 2005-10-27 Raja R Harinath <rharinath@novell.com>
9853 * expression.cs (Invocation.Error_InvalidArguments): Handle
9854 __arglist parameters.
9855 (Invocation.VerifyArgumentsCompat): Likewise.
9856 * support.cs (ReflectionParameters.GetSignatureForError): Print
9857 __arglist parameters.
9858 (InternalParamters.GetSignatureForError): Likewise.
9859 * parameter.cs (Parameters.GetSignatureForError): Likewise.
9861 2005-10-26 Marek Safar <marek.safar@seznam.cz>
9863 * attribute.cs (GetPropertyValue): Made public.
9865 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
9867 Add new property WrapNonExceptionThrows to handle 2.0 assembly
9869 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
9872 * driver.cs: Reflect method name change.
9874 * statement.cs (Try.Resolve): Warn when try has both general
9877 * typemanager.cs: runtime_compatibility_attr_type new predefined
9880 2005-10-26 Raja R Harinath <harinath@gmail.com>
9883 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
9884 treat it as an empty parameter list.
9886 2005-10-26 Raja R Harinath <rharinath@novell.com>
9889 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
9890 ResolveAsTypeStep silent.
9891 * statement.cs (Block.AddConstant): Mark block as used.
9892 (Block.ResolveMeta): Avoid piling on error messages
9893 if a constant initializer resolution fails.
9895 2005-10-25 Raja R Harinath <rharinath@novell.com>
9897 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
9899 (NamespaceEntry.VerifyAllUsing): New.
9900 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
9901 behaviour. Delegates actual resolution of alias to ...
9902 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
9903 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
9905 * driver.cs (Driver.MainDriver): Update.
9907 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
9908 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
9910 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
9912 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
9913 RootNamespace.DefineNamespacesForAll.
9915 2005-10-24 Raja R Harinath <harinath@gmail.com>
9917 * typemanager.cs (assemblies, external_aliases, modules)
9918 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
9919 (ComputeNamespaces, GetRootNamespace): Remove extra staging
9920 overhead. Move resposibility ...
9921 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
9922 * driver.cs, attribute.cs, codegen.cs: Update to changes.
9924 2005-10-23 Raja R Harinath <harinath@gmail.com>
9926 * namespace.cs (RootNamespace.all_namespaces): Renamed from
9927 cached_namespaces. Improve usage.
9928 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
9929 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
9930 Move from GlobalRootNamespace and simplify.
9931 (RootNamespace.Global): Make instance variable.
9932 (RootNamespace.RootNamespace): Add "alias name" parameter.
9933 (GlobalRootNamespace): Simplify drastically.
9934 (Namespace.Lookup): Don't use GetNamespace.
9935 * typemanager.cs (GetRootNamespace): Rename from
9936 ComputeNamespaceForAlias.
9937 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
9939 2005-10-23 Marek Safar <marek.safar@seznam.cz>
9941 * anonymous.cs (AnonymousContainer): Don't crash when container
9944 2005-10-23 Marek Safar <marek.safar@seznam.cz>
9946 * expression.cs (Binary.DoResolve): Warn when comparing same
9949 2005-10-23 Marek Safar <marek.safar@seznam.cz>
9952 * expression.cs (Binary.DoResolve): It looks like there are no
9953 convetsion rules in enum context.
9955 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9957 Add support for extern alias qualifiers.
9958 * typemanager.cs: Move some LookupTypeReflection code
9959 to namespace.cs, to have cleaner code. Added some methods
9960 to help us keep track of the extern aliased references.
9961 * driver.cs: Add suport for extern alias assemblies on command
9962 line and check for their warnings/errors. Also keep track of the
9963 extern aliased assemblies.
9964 * namespace.cs: Move the global functionality of Namespace
9965 to GlobalRootNamespace/RootNamespace. Now the global namespace
9966 is GlobalRootNamespace.Globa. Also the code moved from
9967 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
9968 Finally added LocalAliasEntry (AliasEntry before) and
9969 ExternAliasEntry, to handle alias statements.
9970 * cs-parser.jay: Add support in the grammar for extern alias
9972 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
9973 Update callings to Namespace (now in GlobalRootNamespace).
9975 2005-10-18 Raja R Harinath <rharinath@novell.com>
9978 * class.cs (TypeContainer.DefineType): Move updating of
9979 topological sort earlier in the code.
9980 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
9982 2005-10-18 Marek Safar <marek.safar@seznam.cz>
9985 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
9987 * constant.cs (Constant.TryReduce): Moved from Cast class.
9988 (Reduce): Made little bit more OO and fixed missing conversions.
9990 * ecore.cs (Reduce): Implemented.
9991 (Binary.EnumLiftUp): New method to upgrade values to enum values.
9993 * literal.cs (Reduce): Implemented.
9995 * class.cs: Reverted Miguel's wrong commit.
9997 2005-10-14 Miguel de Icaza <miguel@novell.com>
9999 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
10001 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
10003 * cs-parser.jay, expression.cs : CS0214 was missing error location
10004 for constants. Fixed bug #76404.
10006 2005-10-11 Marek Safar <marek.safar@seznam.cz>
10009 * convert.cs (ExplicitConversionCore): Fixed object->enum
10012 2005-10-10 Raja R Harinath <rharinath@novell.com>
10014 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
10015 InstanceExpression.
10016 (PropertyExpr.EmitCall): Likewise.
10017 * expression.cs (Invocation.EmitArguments): Handle case where
10019 (Invocation.EmitCall): Avoid allocating temporary variable if
10020 there are no arguments.
10022 2005-10-07 Raja R Harinath <rharinath@novell.com>
10025 * convert.cs (ImplicitConversionStandard): Move conversion of
10026 void* to arbitrary pointer types ...
10027 (ExplicitConversionStandard): .. here.
10028 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
10029 error to always print typenames.
10031 2005-10-07 Raja R Harinath <rharinath@novell.com>
10033 * convert.cs (GetConversionOperator): Rename from
10034 GetConversionOperators. Move operator selection code from ...
10035 (UserDefinedConversion): ... here.
10037 2005-10-06 Marek Safar <marek.safar@seznam.cz>
10039 * convert.cs (ExplicitConversionCore): Removed duplicate enum
10042 2005-10-05 Marek Safar <marek.safar@seznam.cz>
10044 * assign.cs (Assign.DoResolve): Error method changed.
10046 * cfold.cs (DoConstantNumericPromotions): Error method changed.
10048 * const.cs (ResolveValue): Reset in_transit immediately.
10050 * constant.cs: Error method changed.
10052 * convert.cs: Removed useless location parameter.
10053 (ExplicitNumericConversion): Don't do double enum check.
10054 (ExplicitConversionCore): Renamed from ExplicitConversion.
10055 (ExplicitUnsafe): Extracted from ExplicitConversion.
10056 (ExplicitConversion): Uses for error reporting.
10058 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
10060 (ResolveBoolean): Uses common error method.
10061 (CastToDecimal): Get rid of ec.
10062 (CastFromDecimal): Optimized.
10063 (ConvCast): Get rid of ec.
10065 * enum.cs (ResolveValue): Reset in_transit immediately.
10066 (Emit): Return after first error.
10068 * expression.cs: Convert changes.
10070 * literal.cs: Error method changed.
10072 * statement.cs: Error method changed.
10074 2005-10-03 Raja R Harinath <rharinath@novell.com>
10076 * support.cs (SeekableStreamReader.Position): Don't error out when
10077 the requested position is just beyond the end of the current
10080 2005-09-28 Raja R Harinath <rharinath@novell.com>
10082 * support.cs (SeekableStreamReader): Simplify drastically. Don't
10083 try to keep in sync with the byte count of the underlying Stream.
10084 However, this limits us to a window size of 2048 characters: i.e.,
10085 the maximum lookahead of our lexer/parser can be 2048 characters.
10087 2005-09-28 Marek Safar <marek.safar@seznam.cz>
10090 * driver.cs: Fix compilation files with full root path.
10092 2005-09-25 Miguel de Icaza <miguel@novell.com>
10094 * report.cs (SymbolRelatedToPreviousError): Format the output so
10095 it does not use an open parenthesis that is never closed.
10097 * driver.cs: Follow coding guidelines
10099 2005-09-27 Marek Safar <marek.safar@seznam.cz>
10102 * const.cs (Const.ResolveValue): Check for assigning non-null
10103 value to reference type.
10105 2005-09-27 Marek Safar <marek.safar@seznam.cz>
10107 * anonymous.cs: Implemented ExprClassName.
10109 * assign.cs (Assign.DoResolve): Don't chrash when type is not
10112 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
10115 * class.cs (StaticClass.DefineContainerMembers): Report protected
10118 * codegen.cs: if(ed) PRODUCTION.
10120 * convert.cs (Error_CannotImplicitConversion): Better error
10123 * cs-parser.jay: More error checks.
10125 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
10127 * driver.cs (CSCParseOption): Enabled wrong option check.
10129 * ecore.cs (Expression.ExprClassName): Turned to property.
10130 (MemberExpr.CheckIntermediateModification): For checking boxed
10131 value types modification.
10133 * statement.cs (Fixed.Resolve): Expression type must be
10134 convertible to fixed type.
10135 (CollectionForeach.GetEnumeratorFilter,TryType):
10136 Small refactoring for easier error checking.
10138 2005-09-26 Marek Safar <marek.safar@seznam.cz>
10140 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
10143 * class.cs (GeneratedBaseInitializer): New class for customization
10144 compiler generated initializers.
10145 (MemberBase.DoDefine): Check Obsolete attribute here.
10146 (FieldMember.DoDefine): Ditto.
10148 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
10151 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
10152 (MemberCore.GetObsoleteAttribute): Removed argument.
10153 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
10154 (MemberCore.CheckObsoleteType): New helper.
10158 * statement.cs: Updates after MemberCore changes.
10160 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
10161 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
10163 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
10164 obsolete attribute for compiler construct.
10165 (As.DoResolve): Cache result.
10167 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
10169 2005-09-26 Raja R Harinath <rharinath@novell.com>
10172 * expression.cs (This.VerifyFixed): In a value type T, the type of
10173 'this' is T&, iow, 'this' is either an out or ref parameter. In a
10174 value type R, 'this' is treated as a value parameter.
10176 2005-09-22 Miguel de Icaza <miguel@novell.com>
10178 * statement.cs (Lock): Use the TemporaryVariable class instead of
10179 manually using local variables as those do not work when variables
10182 * ecore.cs: Moved the TemporaryVariable class from being a nested
10183 class inside Foreach to be a public class that can be employed in
10186 2005-09-19 Marek Safar <marek.safar@seznam.cz>
10188 * cs-parser.jay: interface_accessors replaced by
10189 accessor_declarations.
10191 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
10194 * statement.cs (GotoCase.Resolve): Convert null constant to
10196 (SwitchLabel.ResolveAndReduce): Ditto.
10197 (SwitchLabel.NullStringCase): Custom null stamp.
10198 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
10200 typemanager.cs (CSharpSignature): Don't skip first argument
10203 2005-09-18 Miguel de Icaza <miguel@novell.com>
10205 * driver.cs: Set InEmacs based on the environment variable EMACS.
10207 * location.cs (InEmacs): in this mode, do not report column
10208 location as it confuses Emacs.
10210 2005-09-16 Marek Safar <marek.safar@seznam.cz>
10212 * cfold.cs, constant.cs, convert.cs, ecore.cs,
10213 expression.cs, iterators.cs, literal.cs: Store constants and
10216 * class.cs (MemberBase.ShortName): Pass location.
10218 * cs-parser.jay: Some location fixes.
10220 * ecore.cs (Expression.Location): Made virtual.
10222 2005-09-05 Miguel de Icaza <miguel@novell.com>
10224 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
10225 if the underlying types are the same, otherwise we need to produce
10226 code that will do the proper cast.
10228 This was exposed by Marek's constant rewrite which produced
10229 invalid code for the call site:
10231 enum X : long { a }
10232 void Method (X v) {}
10236 This fixes test-49.cs
10238 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
10240 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
10241 Type/Object should be allowed as well. Fixed bug #75968.
10243 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
10245 * expression.cs : (Binary.DoResolve): when one is enum constant and
10246 another is constant 0, then return enum one *as enum type*.
10249 2005-09-02 Raja R Harinath <rharinath@novell.com>
10251 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
10255 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
10256 flow-branching for LocalVariableReferences in case we were invoked
10257 from a MemberAccess.
10258 * expression.cs (LocalVariableReference.VerifyAssigned): New.
10260 (LocalVariableReference.DoResolveBase): ... this.
10261 (MemberAccess.Resolve): Do the check that was disabled during
10264 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
10267 (PartialContainer.Create): check abstract/sealed/static strictly
10268 but abstract/sealed can exist only at one side. Fixed bug #75883.
10270 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
10273 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
10274 specified, don't default to UnmanagedType.I4.
10276 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
10278 * expression.cs : conditional operator should check possibly
10279 incorrect assign expression. Fixed bug #75946.
10281 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
10283 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
10284 Reverting the change. gmcs is much complex than mcs on this matter.
10286 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
10288 * cs-tokenizer.cs : To read another token ahead of the actual
10289 consumption, use new SavedToken and cache token instead of moving
10290 back the stream with SeekableStreamReader (it seemed problematic).
10292 driver.cs : Thus use StreamReader directly.
10293 * support.cs : Thus removed SeekableStreamReader.
10295 2005-08-30 Raja R Harinath <rharinath@novell.com>
10298 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
10299 (ScopeInfo.EmitScopeType): Use it to construct field names from
10300 names of captured locals.
10303 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
10304 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
10305 Pass 'target_type' to BoxedCast. Don't default to 'object'.
10306 (ExplicitConversion): Remove enum cases already handled by
10307 implicit conversion. Move implicit conversion check to the beginning.
10308 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
10309 * expression.cs (ArrayCreation.EmitDynamicInitializers):
10310 Don't treat System.Enum as a struct.
10312 2005-08-30 Jb Evain <jbevain@gmail.com>
10314 * attribute.cs: handles as expression in parameters.
10316 2005-08-30 Raja R Harinath <rharinath@novell.com>
10319 * class.cs (TypeContainer.VerifyClsName): Don't use a
10320 PartialContainer when verifying CLS compliance.
10321 (AbstractPropertyEventMethod): Set Parent here, ...
10322 (PropertyMethod): ... not here.
10324 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
10326 * attribute.cs : escaped attribute name should not be allowed to be
10327 resolved (e.g. @class as classAttribute). Fixed bug #75930.
10329 2005-08-29 Raja R Harinath <rharinath@novell.com>
10332 * convert.cs (ImplicitStandardConversionExists): Allow zero also
10333 when converting a long constant to unsigned long.
10334 * expression.cs (Invocation.OverloadResolve): Add sanity check to
10335 detect where IsApplicable and VerifyArgumentsCompat disagree.
10337 2005-08-29 Raja R Harinath <rharinath@novell.com>
10338 and Carlos Alberto Cortez <carlos@unixmexico.org>
10341 * class.cs (TypeContainer.CanElideInitializer): New helper.
10342 (TypeContainer.EmitFieldInitializers): Use it to determine if we
10343 can safely emitting the initializer of a field.
10345 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10347 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
10348 allowed inside a switch (without loop). Fixed bug #75433.
10350 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
10352 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
10353 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
10355 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10357 * driver.cs : kinda reverting the default encoding changes (not exact
10358 revert since I noticed that "codepage:reset" might not work fine).
10360 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10362 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
10363 Location. Now getter and setter store location correctly.
10364 (errors/cs0111-12.cs now reports the expected location.)
10366 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10368 * driver.cs : Use default encoding on the environment.
10369 Removed (now that) extra parameter for SeekableStreamReader.
10370 * support.cs : (SeekableStreamReader) third .ctor() argument for
10371 StreamReader is not required (always true). preamble size could
10372 be acquired in simpler and safe way.
10374 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
10376 * cs-parser.jay: report CS0642 at warning level 3
10377 and report CS0642 for an if else statement also
10378 fixes bug #74745. Patch by John Luke (and a bit
10380 Removed extra CS0642 warning check for "while",
10382 * statement.cs: In Block.Resolve(), CS0642 check
10383 is reimplemented to check a sequence of an empty
10384 statement and a block.
10386 Both fix bug #66777.
10388 2005-08-24 Marek Safar <marek.safar@seznam.cz>
10390 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
10391 detection until I fix it.
10393 * cs-tokenizer.cs: Changed error message.
10395 * cs-parser.jay: Fixed 2 error locations.
10397 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
10398 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
10401 * enum.cs (GetSignatureForError): Fixed.
10403 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
10407 * typemanager.cs (RegisterProperty): Removed.
10409 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
10411 2005-08-24 Raja R Harinath <rharinath@novell.com>
10414 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
10415 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
10417 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10419 * expression.cs : tiny fix is required for not warning positive ulong.
10422 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10424 * expression.cs : add CS0652 check for constant and integral
10425 expression. Fixed bug #53974.
10427 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10429 * expression.cs : in DoNumericPromotions(), check if there is implicit
10430 conversion overload for string (to check CS0034). Fixed bug #52492.
10432 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10434 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
10436 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10438 * ecore.cs : report location when it is *not* Null.
10440 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10446 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
10447 correctly. Fixed bug #75721.
10449 2005-08-23 Raja R Harinath <rharinath@novell.com>
10451 * support.cs (SeekableStreamReader.Position): Avoid an expensive
10452 loop that performs 'min (pos, char_count)'.
10455 * expression.cs (Unary.ResolveOperator): Don't discard implicit
10456 converted value in Operator.OnesComplement.
10458 2005-08-22 Ben Maurer <bmaurer@ximian.com>
10460 * anonymous.cs: If the anon method is pulled into a helper class,
10461 it needs to be `internal' not `private'. Fixes runtime behavior on
10464 2005-08-20 Martin Baulig <martin@ximian.com>
10466 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10467 scope if we don't already have it.
10469 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
10470 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
10473 2005-08-17 Marek Safar <marek.safar@seznam.cz>
10476 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
10477 is a partial class.
10479 2005-08-16 Marek Safar <marek.safar@seznam.cz>
10481 The big constants rewrite
10482 Fix #75746, #75685 and more
10483 As a side effect saved 1MB for MWF ;-)
10485 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
10486 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
10487 enum based for corlib compilation.
10489 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
10492 * class.cs (FixedField.Define): Use ResolveAsConstant.
10494 * const.cs (IConstant): Interface constants and enums.
10495 (Const.ResolveValue): New method for constant resolvning.
10496 (ExternalConstant): Constants from imported assemblies.
10498 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
10499 conversion; like enums.
10500 (Constant.ToType): Converts this constant to different type.
10501 (Constant.Increment): Adds 1.
10503 * convert.cs (ImplicitConversionRequired): Simplified.
10505 * cs-parser.jay: Create EnumMember directly.
10507 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
10509 * doc.cs (GenerateEnumDocComment): Removed.
10511 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
10512 (ConvertIntLiteral): Removed.
10513 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
10515 * enum.cs (EnumMember): Implement IConstant.
10516 (Enum.IsValidEnumConstant): Removed.
10517 (Enum.GetNextDefaultValue): Removed.
10518 (Enum.FindMembers): Updated.
10519 (Enum.GenerateDocComment): Iterate enum members.
10521 * expression.cs (Cast.TryReduce): Handle enums correctly.
10522 (New.Constantify): Made public.
10523 (MemberAccess.DoResolve): Removed contant specific if(s).
10525 * literal.cs (NullLiteral): Implement new abstract methods.
10527 * statement.cs (GotoCase.Resolve): Use new constant methods.
10528 (SwitchLabel.ResolveAndReduce): Use new constant methods.
10530 * typemanager.cs (LookupEnum): Removed.
10531 (IsEnumType): Fixed to work with corlib.
10532 (RegisterConstant): Removed.
10533 (LookupConstant): Removed.
10534 (GetConstant): Changed to work with IConstant.
10536 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
10538 * location.cs : Fixed overflown (>255) column number.
10540 2005-08-03 Raja R Harinath <rharinath@novell.com>
10542 First cut of the qualified-alias-member feature.
10543 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
10545 * cs-parser.jay (DOUBLE_COLON): New token.
10546 (namespace_or_type_name): Add rule for recognizing
10547 qualified-alias-members.
10548 (primary_expression): Likewise.
10549 (element_access): Allow QualifiedAliasMember as a possible
10550 type-bearing expression.
10551 (local_variable_type, local_variable_pointer_type): Likewise.
10552 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
10553 aliases in the current and enclosing namespace declarations.
10554 (NamespaceEntry.UsingAlias): Add CS0440 warning.
10555 * decl.cs (MemberName.is_double_colon): New.
10556 (MemberName.MemberName): Add new constructor for alias-member.
10557 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
10558 * expression.cs (QualifiedAliasMember): New expression type.
10560 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10562 * location.cs : it borked when no argument was specified.
10564 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10566 * location.cs : tiny ToString() format fix.
10568 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10570 * statement.cs : oops, it was missing.
10572 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10574 A set of fixes for precise line/column location.
10577 "token" field now holds a file/line "delta", a line number offset
10578 from the segment, and a column number. See also:
10579 http://lists.ximian.com/pipermail/mono-devel-list/2004-
10580 December/009508.html
10581 Removed static IsNull. Use instance IsNull property instead.
10582 * cs-tokenizer.cs :
10583 For some tokens it stores Location. For Identifier it stores
10584 LocatedToken which is a pair of string name and location.
10585 Column numbers are adjusted only at getChar().
10587 Use Location.ToString() for reporting (it now contains column).
10589 Largely modified to use LocatedToken instead of
10590 string (IDENTIFIER), and to acquire Location from some tokens.
10591 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
10592 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
10594 Now MemberName holds Location. DeclSpace.ctor() receives Location
10595 as a parameter. Removed extra parameters to all derived classes.
10596 Replaced Location.IsNull() with instance property.
10597 * assign.cs, expression.cs :
10598 Added .ctor() overload that omits Location.
10600 Added "nameEscaped" flag that indicates the identifier was escaped
10601 in the source file. This fixes bug #57047.
10603 2005-08-02 Marek Safar <marek.safar@seznam.cz>
10605 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
10606 New method, looking for lo-case imported cls type.
10608 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
10611 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10613 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
10615 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
10616 all_imported_types.
10617 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
10619 Optimized to save 3.5 MB for SWF compilation.
10621 2005-08-01 Marek Safar <marek.safar@seznam.cz>
10623 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
10624 (PartialContainer.Create): Moved logic AddToContainer.
10625 (PartialContainer.MarkForDuplicationCheck): Shares name.
10627 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
10630 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
10632 (Namespace.GetSignatureForError): New method.
10634 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
10635 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
10637 2005-08-01 Raja R Harinath <rharinath@novell.com>
10640 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
10641 member lookup rather than qualifier_type, since qualifier_type can
10644 2005-08-01 Marek Safar <marek.safar@seznam.cz>
10646 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
10649 2005-07-31 Miguel de Icaza <miguel@novell.com>
10651 * statement.cs: Copy the local exception into the exception
10652 captured local. Fixes 75674
10654 2005-07-31 Raja R Harinath <harinath@gmail.com>
10657 * expression.cs (Invocation.OverloadResolve): Don't report error
10658 CS1501 if error CS1502 has been reported.
10659 (New.DoResolve): Delegate CS1501 reporting to
10660 Invocation.OverloadResolve.
10663 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
10664 invariant-meaning-in-block property in an enclosing block if
10667 2005-07-29 Marek Safar <marek.safar@seznam.cz>
10669 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
10670 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
10671 (Switch.CheckSwitch): Just save 50kb for SWF.
10673 2005-07-27 Martin Baulig <martin@ximian.com>
10675 * anonymous.cs (CaptureContext.AddField): Added
10676 `AnonymousContainer am' argument; compute its toplevel scope if
10677 it's not already computed. Fixes #75649.
10679 2005-07-26 Raja R Harinath <rharinath@novell.com>
10682 * class.cs (Constructor.Emit): Reset block to null if the block
10685 2005-07-25 Marek Safar <marek.safar@seznam.cz>
10687 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
10689 2005-07-25 Marek Safar <marek.safar@seznam.cz>
10691 * class.cs (MethodData.Define): Check whether accessor implementing
10692 interface is public.
10694 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
10696 2005-07-22 Marek Safar <marek.safar@seznam.cz>
10699 * namespace.cs (LookupType): Moved same type check to...
10701 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
10702 with the same name.
10704 2005-07-21 Raja R Harinath <rharinath@novell.com>
10706 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
10707 already found a typebuilder.
10708 * class.cs (MethodCore.IsDuplicateImplementation): Compare
10709 MemberNames, not strings.
10711 * const.cs (Error_ExpressionMustBeConst):
10712 Rename from Error_EpressionMustBeConst.
10713 * const.cs, class.cs, statement.cd: Update.
10715 2005-07-21 Marek Safar <marek.safar@seznam.cz>
10719 * const.cs (Const.LookupConstantValue): Report missing contant expression
10721 (Error_EpressionMustBeConstant): Only one error method.
10723 * class.cs, statement.c: Updated.
10725 2005-07-20 Raja R Harinath <rharinath@novell.com>
10727 * statement.cs (Block.Flags): Add back HasVarargs.
10728 (Block.flags): Make protected.
10729 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
10731 * typemanager.cs (types, typecontainers, user_types): Remove.
10732 (UserTypes, TypeContainers): Likewise.
10733 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
10734 (CleanUp, Reset): Update.
10735 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
10736 (GetNestedType): Use Type.GetNestedType.
10737 (CoreLookupType): Take two arguments, the namespace and the
10738 basename of the type. Update to use the Namespace.Lookup
10740 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
10741 (RealMemberLookup): Use IsNestedChildOf instead of playing with
10742 string concatenation and substring matches.
10743 * class.cs, enum.cs, delegate.cs: Update to changes.
10745 2005-07-20 Marek Safar <marek.safar@seznam.cz>
10747 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
10748 Expression and made virtual.
10750 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
10751 (ImplicitStandardConversionExists): Fixed `byte' typo ?
10753 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
10755 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
10758 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
10761 2005-07-18 Marek Safar <marek.safar@seznam.cz>
10764 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
10765 AssemblyCultureAttribute is not used on executable.
10768 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
10770 2005-07-16 Raja R Harinath <rharinath@novell.com>
10773 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
10774 New. Reports CS0252/CS0253.
10775 Mostly taken from preliminary patch by Duncak Mak.
10776 (Binary.DoResolveOperator): Store results of operator lookup.
10777 Use them to detect if we need to warn about unintended reference
10780 2005-07-15 Raja R Harinath <rharinath@novell.com>
10783 * namespace.cs (Namespace.Lookup): Add back location parameter.
10784 (Namespace.LookupType): Add CS0436 report. Add location parameter.
10785 * delegate.cs, ecore.cs, expression.cs: Update to changes.
10787 * codegen.cs (EmitContext.DeclSpace): Make readonly.
10788 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
10789 (Namespace.LookupType): ... this.
10790 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
10792 * typemanager.cs (LookupTypeReflection): Remove buggy code that
10793 purported to handle pointers.
10794 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
10797 2005-07-15 Marek Safar <marek.safar@seznam.cz>
10799 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
10802 2005-07-15 Raja R Harinath <rharinath@novell.com>
10804 * namespace.cs (Namespace.Lookup): Drop location parameter.
10805 (NamespaceEntry.LookupAlias): Remove. Merge into ...
10806 (NamespaceEntry.Lookup): ... this.
10807 (NamespaceEntry.Error_AmbiguousTypeReference):
10808 Move here from DeclSpace.
10809 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
10811 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
10812 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
10813 Move to NamespaceEntry.
10814 * delegate.cs, expression.cs: Update to changes.
10816 2005-07-14 Marek Safar <marek.safar@seznam.cz>
10818 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
10819 CheckAttributeType and refactored.
10820 (Attribute.ResolvePossibleAttributeType): Changed to reuse
10821 ResolveAsTypeTerminal error handling.
10822 (ResolveAsTypeTerminal): Introduced because of global attributes extra
10824 (GetSignatureForError): Print errors in same way.
10827 * codegen.cs: Reflect attribute GetSignatureForError change.
10830 * expression.cs: Add silent parameter to ResolveAsTypeStep.
10832 * namespace.cs (UsingEntry): Refactored to make fields private.
10835 statement.cs: Error_UnexpectedKind has extra parameter.
10837 2005-07-14 Raja R Harinath <rharinath@novell.com>
10839 * ecore.cs (IAlias): Remove.
10840 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
10841 that implement the interface.
10842 * namespace.cs (Namespace): Likewise.
10843 (Namespace.declspaces): Renamed from 'defined_names'.
10844 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
10845 DeclSpace instead of an IAlias.
10846 * tree.cs (Tree.AddDecl): Update.
10848 2005-07-12 Raja R Harinath <rharinath@novell.com>
10850 * statement.cs (Block.Flags); Remove HasVarargs.
10851 (Block.HasVarargs): Move to ToplevelBlock.
10852 (Block.ThisVariable, Block.AddThisVariable): Likewise.
10853 (Block.Variables): Make protected. Initialize variable hashtable
10855 (Block.AddVariable): Update.
10856 (Block.Resolve): Update to changes.
10857 (ToplevelBlock.HasVarargs): New boolean.
10858 (ToplevelBlock.ThisVariable): Move here from Block.
10859 (ToplevelBlock.AddThisVariable): Likewise.
10860 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
10861 * expression.cs (This.ResolveBase): Update to changes.
10862 (ArglistAccess.DoResolve): Likewise.
10864 2005-07-11 Marek Safar <marek.safar@seznam.cz>
10867 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
10869 * class.cs (TypeContainer.VerifyMembers): Distinguish between
10870 not used and not used & assigned.
10871 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
10873 2005-07-11 Marek Safar <marek.safar@seznam.cz>
10876 * expression.cs (Is.DoResolve): null is never provided type.
10878 2005-07-08 Marek Safar <marek.safar@seznam.cz>
10881 * cs-parser.jay: Less strict event error rule to catch more errors.
10883 2005-07-08 Martin Baulig <martin@ximian.com>
10885 Fix test-iter-10.cs - distinguish whether we `yield' in a property
10886 gettter (allowed) or setter (not allowed).
10888 * class.cs (Accessor): Implement IIteratorContainer.
10889 (Accessor.Yields): New public field.
10890 (PropertyBase.PropertyMethod.Define): Handle iterators on a
10891 per-accessor basis.
10894 (get_accessor_declaration, set_accessor_declaration): Set the
10895 `yields' flag on the accessor, not the property.
10896 (property_declaration): Do the iterators check on a per-accessor
10897 basis and not for the whole property.
10899 2005-07-08 Martin Baulig <martin@ximian.com>
10901 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
10902 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
10904 2005-07-07 Marek Safar <marek.safar@seznam.cz>
10907 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
10908 (ExtractSecurityPermissionSet): Cope with self referencing security
10909 attributes properly.
10911 * driver.cs (SetOutputFile): Made public property OutputFile.
10913 2005-07-07 Raja R Harinath <rharinath@novell.com>
10916 * class.cs (TypeContainer.first_nonstatic_field): Rename from
10917 has_nonstatic_fields. Make into a FieldBase pointer.
10918 (TypeContainer.AddField): Add CS0282 check.
10919 (TypeContainer.EmitType): Update.
10921 2005-07-06 Miguel de Icaza <miguel@novell.com>
10923 * cs-tokenizer.cs (consume_identifier): Do not create strings to
10924 compare if they start with __.
10926 2005-07-06 Raja R Harinath <rharinath@novell.com>
10928 * statement.cs (Switch.SwitchGoverningType): Only look at
10929 UserCasts that don't need implicit standard conversions to one of
10930 the allowed switch types (Fixes test-322.cs).
10931 (LocalInfo.Resolve): Re-enable sanity-test.
10933 2005-07-06 Marek Safar <marek.safar@seznam.cz>
10935 * cs-tokenizer.cs (consume_identifier): Detect double undescores
10937 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
10939 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
10941 2005-07-06 Raja R Harinath <rharinath@novell.com>
10944 * ecore.cs (SimpleName.GetSignatureForError): Add.
10945 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
10946 (MemberAccess.GetSignatureForError): Add.
10948 2005-07-05 Marek Safar <marek.safar@seznam.cz>
10950 The big error and warning messages review.
10980 * typemanager.cs: Updated.
10982 * class.cs: (MethodCore.SetYields): Moved here to share.
10983 (PropertyMethod.Define): Moved iterator setup here.
10985 * iterators.cs: Add orig_method to have full access to parent
10988 2005-07-05 Raja R Harinath <rharinath@novell.com>
10990 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
10991 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
10992 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
10993 variable of struct type.
10994 * expression.cs (Unary.ResolveOperator): Update to change.
10995 (Indirection.VerifyFixed): Likewise.
10996 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
10997 (ParameterReference.VerifyFixed): Value parameters are fixed.
10998 (This.VerifyFixed): Treat 'this' as a value parameter.
10999 * statement.cs (LocalInfo.IsFixed): Remove.
11001 2005-07-01 Martin Baulig <martin@ximian.com>
11003 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
11004 `ec.EmitThis ()' to get the correct scope.
11006 2005-07-01 Martin Baulig <martin@ximian.com>
11008 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
11009 instance is a ParameterReference; fixes #75299.
11011 2005-07-01 Martin Baulig <martin@ximian.com>
11013 Reverted Marek's latest patch (r46725):
11014 - it contains structural changes which are neither mentioned in
11015 the ChangeLog nor explained anywhere; for example the additional
11016 argument of EmitContext's and Iterator's .ctor's and the
11017 TypeContainer.DefineMembers() change.
11018 - structural changes like this should go in in seperate patches
11019 and not be hidden in a huge patch which just seems to affect
11020 warnings and errors.
11021 a big and hard to understand patch.
11022 - it breaks iterators and causes regressions, for instance in
11025 2005-06-30 Raja R Harinath <rharinath@novell.com>
11028 * expression.cs (Indexers.map): Remove.
11029 (Indexers.Append): Filter out inaccessible setters and getters.
11030 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
11033 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
11034 Refactored from ...
11035 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
11036 (FieldExpr.Emit, PropertyExpr.Emit): Update.
11037 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
11038 * expression.cs (Invocation.EmitCall): Add CS0120 check.
11040 2005-06-30 Marek Safar <marek.safar@seznam.cz>
11043 * class.cs (FieldBase.GetInitializerExpression): One more field
11046 2005-06-28 Miguel de Icaza <miguel@novell.com>
11048 * pending.cs: Do not define a proxy if the base method is virtual,
11049 it will be picked up by the runtime (bug 75270).
11051 2005-06-08 Martin Baulig <martin@ximian.com>
11053 The big Iterators rewrite :-)
11055 * iterators.cs: Rewrite this to use the anonymous methods framework.
11057 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
11058 before the TypeContainers; see 2test-21.cs.
11061 (TypeContainer.DefineType): Don't create a new EmitContext if we
11062 already have one (this only happens if we're an Iterator).
11063 (TypeContainer.Define): Also call Define() on all our iterators.
11064 (Method.CreateEmitContext): Added support for iterators.
11067 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
11068 (AnonymousContainer.CreateMethodHost): Moved here from
11069 AnonymousMethod and made abstract.
11070 (AnonymousContainer.CreateScopeType): New abstract method.
11071 (AnonymousContainer.IsIterator): New public property.
11072 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
11073 get the ScopeTypeBuilder rather than manually defining it here.
11074 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
11077 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
11078 before RootContext.DefineTypes().
11080 * codegen.cs (EmitContext.RemapToProxy): Removed.
11081 (EmitContext.CurrentAnonymousMethod): Changed type from
11082 AnonymousMethod -> AnonymousContainer.
11083 (EmitContext.ResolveTopBlock): Protect from being called twice.
11084 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
11085 (EmitContext.EmitThis): Removed the iterators hacks; use the
11086 anonymous methods framework for that.
11089 (ToplevelBlock.Container): Make this a property, not a field.
11090 (ToplevelBlock.ReParent): New public method; move the
11091 ToplevelBlock into a new container.
11092 (Foreach.TemporaryVariable): Simplify.
11094 2005-06-05 Martin Baulig <martin@ximian.com>
11096 * statement.cs (LocalInfo.CompilerGenerated): New flag.
11097 (Block.AddTemporaryVariable): New public method; creates a new
11098 `LocalInfo' for a temporary variable.
11099 (Block.EmitMeta): Create the LocalBuilders for all the temporary
11101 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
11102 non-iterator variables.
11104 2005-06-05 Martin Baulig <martin@ximian.com>
11106 * statement.cs (Foreach.TemporaryVariable): Create the
11107 LocalBuilder in the Emit phase and not in Resolve since in some
11108 situations, we don't have an ILGenerator during Resolve; see
11109 2test-19.cs for an example.
11111 2005-06-04 Martin Baulig <martin@ximian.com>
11113 **** Merged r45395 from GCS ****
11115 The big Foreach rewrite - Part II.
11117 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
11118 with `PropertyInfo ienumerator_getcurrent'.
11120 * codegen.cs (VariableStorage): Removed.
11123 (Foreach): Derive from Statement, not ExceptionStatement.
11124 (Foreach.CollectionForeach): New nested class. Moved all the code
11125 dealing with collection foreach here.
11126 (Foreach.ForeachHelperMethods): Removed.
11127 (Foreach.TemporaryVariable): Implement IMemoryLocation.
11129 2005-05-23 Martin Baulig <martin@ximian.com>
11131 * statement.cs (Try.DoResolve): Don't create a `finally' if we
11132 don't need to. Fix #75014.
11134 2005-05-20 Martin Baulig <martin@ximian.com>
11136 Merged r44808 from GMCS.
11138 * class.cs (TypeContainer.CircularDepException): Removed.
11139 (TypeContainer.DefineType): Removed the `InTransit' stuff.
11140 (TypeContainer.CheckRecursiveDefinition): Check for circular class
11141 (CS0146) and interface (CS0529) dependencies here.
11143 2005-06-21 Raja R Harinath <rharinath@novell.com>
11145 * expression.cs (Invocation.EmitCall): Fix initialization
11146 'this_call' to reflect current behaviour. Fix indentation.
11148 * convert.cs (FindMostEncompassedType): Add two trivial special
11149 cases (number_of_types == 0 || number_of_types == 1).
11150 (FindMostEncompasingType): Likewise.
11152 2005-06-17 Raja R Harinath <rharinath@novell.com>
11154 Some cleanups preparing for the fix of #75283.
11155 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
11157 (EventExpr.InstanceResolve): Likewise.
11158 (EventExpr.DoResolve): Remove redundant checks.
11160 2005-06-10 Duncan Mak <duncan@novell.com>
11162 * cs-tokenizer.cs (process_directives): New flag for controlling
11163 the processing of preprocessor directives.
11164 (x_token): After seeing a '#', return Token.NONE instead of going
11165 to handle_preprocessing_directive() when not processing
11166 directives. This avoids unnecessary processing during the token peek in
11171 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
11172 the existing error reporting methods instead of Report.Error.
11174 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
11175 after Raja's rewrite.
11177 2005-06-08 Miguel de Icaza <miguel@novell.com>
11179 * class.cs: Small fix.
11181 2005-06-08 Raja R Harinath <rharinath@novell.com>
11184 * class.cs (GetPartialBases): Fix return value check of
11185 part.GetClassBases.
11187 2005-06-07 Raja R Harinath <rharinath@novell.com>
11189 Ensure that partial classes are registered in their enclosing
11190 namespace. Initial part of fix of #75160.
11191 * tree.cs (Tree.RecordDecl): Add new namespace argument.
11192 Register declspace with namespace here, not in
11193 DeclSpace.RecordDecl.
11194 * cs-parser.jay: Pass namespace to RecordDecl.
11195 * class.cs (PartialContainer.Create): Likewise.
11196 (ClassPart.DefineType): New sanity-check. Throws an exception if
11198 * decl.cs (Declspace.RecordDecl): Remove.
11199 * namespace.cs (NamespaceEntry.DefineName): Remove.
11201 2005-06-06 Marek Safar <marek.safar@seznam.cz>
11203 * rootcontext.cs: Reset TargetExt as well.
11205 2005-06-03 Raja R Harinath <rharinath@novell.com>
11207 * ecore.cs (Expression.Resolve): Emit CS0654 error when
11208 -langversion:ISO-1.
11210 2005-06-02 Raja R Harinath <rharinath@novell.com>
11212 Fix #75080, cs0119.cs.
11213 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
11215 (Expression.Resolve): ... this. Use it. Remove bogus code
11216 allowing ExprClass.Type and ExprClass.Namespace for
11217 ResolveFlags.VariableOrValue.
11218 (Expression.Resolve) [1-argument variant]: Change default resolve
11219 flags based on language version.
11220 (Expression.Error_UnexpectedKind): Use a simple string array
11221 rather than an ArrayList.
11222 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
11223 not ExprClass.Type.
11224 (TypeOfVoid.DoResolve): Likewise.
11225 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
11226 flags argument -- it always has the same value.
11228 2005-05-31 Raja R Harinath <rharinath@novell.com>
11231 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
11232 Use it in the error message.
11233 * assign.cs, expression.cs, statement.cs: Update.
11235 2005-05-30 Raja R Harinath <rharinath@novell.com>
11238 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
11239 the "almostMatchedMember" case too.
11240 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
11241 that failed the accessibility checks to 'almost_match'.
11243 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
11245 * attribute.cs: Use internal MethodBuilder methods to set
11246 ExactSpelling and SetLastError on PInvoke methods, instead
11247 of passing them via charset. Fixes #75060.
11249 2005-05-27 Raja R Harinath <rharinath@novell.com>
11251 * parameter.cs (Parameter): Remove TODO comment.
11252 (Parameter.DefineParameter): Remove Location parameter.
11253 (Parameters.LabelParameters): Likewise.
11254 * class.cs (Constructor.Emit): Update to change.
11255 (MethodData.Emit): Likewise.
11256 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
11257 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
11259 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
11262 Removed Parameters.Location and added Parameter.Location instead.
11263 Removed Location parameter from Emit() and GetSignature().
11270 Modified all related calls.
11272 2005-05-26 Raja R Harinath <rharinath@novell.com>
11274 Improve user-defined conversion handling.
11275 * convert.cs (GetConversionOperators): Rewrite. Return only the
11276 applicable operators.
11277 (AddConversionOperators): New. Helper for GetConversionOperators.
11278 (FindMostEncompassedType, FindMostEncompassingType): Verify that
11279 there is only one most encompassed/encompassing type.
11280 (FindMostSpecificSource, FindMostSpecificTarget): Remove
11281 "applicable operator" handling.
11282 (UserConversion): Move cache here from GetConversionOperators.
11283 Directly cache the chosen operator, rather than the whole
11285 (ExplicitNumericConversion): Fix buggy implementation of Decimal
11286 case. Allow conversion of decimal to sbyte and byte too.
11287 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
11288 New static methods. Used to avoid allocating EmptyExpressions in
11291 2005-05-24 Duncan Mak <duncan@novell.com>
11293 * ecore.cs (CastFromDecimal): New class for casting a decimal to
11294 another class, used in Convert.ExplicitNumericConversion.
11295 (CastToDecimal): New class, similar to above, but casts to
11296 System.Decimal, used in Convert.ImplicitNumericConversion and also
11297 in explicit convesion from double/float to decimal.
11299 * convert.cs (ImplicitNumericConversion): Handle implicit
11300 conversions to System.Decimal.
11301 (ExplicitNumericConversion): handle explicit conversions to
11306 2005-05-20 Miguel de Icaza <miguel@novell.com>
11308 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
11309 know the type at this stage, just break through. Fixes #75008
11311 2005-05-19 Martin Baulig <martin@ximian.com>
11314 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
11315 to disable error reporting.
11317 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
11318 here since we don't want to report an error; see the new test-336.cs.
11320 2005-05-19 Raja R Harinath <rharinath@novell.com>
11322 * statement.cs (ToplevelBlock.GetParameterReference)
11323 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
11324 Move here from class Block.
11325 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
11326 * expression.cs (ParameterReference.DoResolveBase): Likewise.
11328 2005-05-18 Martin Baulig <martin@ximian.com>
11333 (FlowBranching.Reachability): Add non-static public And() and Or()
11335 (FlowBranchingSwitch): New class; do the `break_origins' thing
11336 like in FlowBranchingLoop.
11337 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
11338 reachability, not just locals and parameters.
11339 (FlowBranching.MergeChild): Remove some of the hacks for loop and
11340 switch; MergeBreakOrigins() now takes care of that.
11342 2005-05-18 Martin Baulig <martin@ximian.com>
11344 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11345 a loop and may leave it, reset the barrier; fixes #74974.
11347 2005-05-17 Marek Safar <marek.safar@seznam.cz>
11349 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
11352 * cs-parser.jay: Catch more lexical errors.
11354 * report.cs: Add one more Error method.
11357 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
11359 2005-05-17 Martin Baulig <martin@ximian.com>
11361 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
11364 2005-05-16 Raja R Harinath <rharinath@novell.com>
11366 Fix test-382.cs. Emit values of decimal constants.
11367 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
11369 (TypeContainer.AddField): ... this.
11370 (TypeContainer.EmitFieldInitializers): Allow the list of fields
11371 with initializers to include 'Const's.
11372 (ClassPart.RegisterFieldForInitialization): Forward to
11374 * const.cs (Const.Const): Pass initializer to base class.
11375 (Const.Define): In case of decimal constants, register them for
11376 initialization in a static constructor.
11378 2005-05-14 Martin Baulig <martin@ximian.com>
11380 * statement.cs (Block.Resolve): Correctly handle unreachable code;
11381 do not call ResolveUnreachable() on unreachable statements in
11382 here, see the comment in the source code.
11384 2005-05-13 Raja R Harinath <rharinath@novell.com>
11387 * expression.cs (BinaryResolveOperator): If one of the operands of
11388 an equality comparison is 'null' and the other is a pointer type,
11389 convert the null to a NullPointer.
11390 * convert.cs (ImplicitReferenceConversion): If the expression is a
11391 NullLiteral and the target type is a pointer type, return a
11392 NullPointer instead.
11393 (ImplicitConversionStandard): Likewise.
11395 2005-05-13 Marek Safar <marek.safar@seznam.cz>
11397 * cs-parser.jay: Set readonly context based on special constructs.
11399 * expression.cs (LocalVariableReference.DoResolveBase): Improved
11400 readonly variable error handling.
11402 * rootcontext.cs (EmitCode): Don't verify members when error
11405 * statement.cs (LocalInfo): Add reaodnly context information.
11406 (SetReadOnlyContext, GetReadOnlyContext): New methods.
11408 2005-05-13 Raja R Harinath <rharinath@novell.com>
11410 * statement.cs (Block.Resolve): Revert change below. Modify fix
11411 for #74041 to initialize 'resolved' to false only for explicit
11412 blocks. Fixes #74873.
11414 2005-05-12 Raja R Harinath <harinath@gmail.com>
11417 * typemanager.cs (unmanaged_enclosing_types): New.
11418 (IsUnmanagedType): Avoid infloops by using
11419 'unmanaged_enclosing_types' to talk with recursive invocations.
11421 2005-05-13 Martin Baulig <martin@ximian.com>
11423 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
11424 instance variable, not a local. Fix #74873.
11425 (Block.ResolveUnreachable): Set it to true here.
11427 2005-05-11 Duncan Mak <duncan@novell.com>
11429 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
11430 continuing to process for 'arg'.
11431 (handle_preprocessing_directive): Check the argument of the #endif
11432 directive and report error CS1025 if there are any trailing
11435 According to the C# spec, having even whitespace after the #endif
11436 directive is illegal; however, because we call arg.TrimEnd ()
11437 beforehand, we have the same behavior as csc, allowing whitespace
11438 after the directive.
11442 2005-05-11 Marek Safar <marek.safar@seznam.cz>
11446 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
11447 (Constructor.GetObsoleteAttribute): Implemented correctly.
11449 2005-05-10 Martin Baulig <martin@ximian.com>
11451 * support.cs (ReflectionParameters.ParameterModifier): Use
11452 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
11453 and `ParameterAttributes.In'. Fixes #74884.
11455 2005-05-10 Marek Safar <marek.safar@seznam.cz>
11457 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
11459 * expression.cs (Argument.GetParameterModifier): Turned to property.
11460 (Invocation.Error_InvalidArguments): Add more descriptive errors.
11462 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
11465 2005-05-09 Raja R Harinath <rharinath@novell.com>
11468 * decl.cs (MemberCache.AddMethods): Register override methods,
11469 rather than non-override methods.
11470 * typemanager.cs (RegisterOverride): New.
11471 (IsOverride): Update.
11473 2005-05-09 Marek Safar <marek.safar@seznam.cz>
11477 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
11478 recursive declaration.
11480 * statement.cs (Block.ResolveMeta): Report any error in resolving.
11482 2005-05-06 Marek Safar <marek.safar@seznam.cz>
11484 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
11486 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
11488 2005-05-05 Raja R Harinath <rharinath@novell.com>
11491 * decl.cs (DeclSpace.FamilyAccessible):
11492 Use TypeManager.IsNestedFamilyAccessible.
11494 Fix reopened #64812.
11495 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
11498 2005-05-04 Raja R Harinath <rharinath@novell.com>
11499 Abin Thomas <projectmonokochi@rediffmail.com>
11500 Anoob V E <projectmonokochi@rediffmail.com>
11501 Harilal P R <projectmonokochi@rediffmail.com>
11504 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
11505 allow access to all static members.
11507 2005-05-04 Martin Baulig <martin@ximian.com>
11509 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
11511 2005-05-04 Martin Baulig <martin@ximian.com>
11515 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
11516 section at the end; make things work if `default' is not the last
11519 2005-05-04 Martin Baulig <martin@ximian.com>
11523 * statement.cs (Switch): Replaced the `got_default' field with a
11524 `default_section' one.
11525 (Switch.CheckSwitch): Set `default_section' here.
11526 (Switch.Resolve): If we're a constant switch and the constant is
11527 not found, use the default section.
11529 2005-05-03 Martin Baulig <martin@ximian.com>
11531 * expression.cs (ArrayAccess.EmitGetLength): New public method.
11533 * statement.cs (Foreach.ArrayForeach): New nested class.
11534 (Foreach.TemporaryVariable): New nested class.
11535 (Foreach.EmitArrayForeach): Removed; this is now in the new
11536 ArrayForeach class.
11538 2005-05-03 Raja R Harinath <rharinath@novell.com>
11540 * pending.cs (BaseImplements): Move the #74773 fix here. This is
11542 (VerifyPendingMethods): Revert change below.
11544 * typemanager.cs (IsOverride, RegisterNonOverride): New.
11545 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
11546 that used to trigger warning -28. Remove warning -28.
11547 * expression.cs (Invocation.OverloadResolve): Use
11548 TypeManager.IsOverride to distinguish override methods.
11551 * pending.cs (VerifyPendingMethods): If a base type implements the
11552 requested interface, don't bother checking individual methods of
11553 the base type. As a side-effect, this prevents the creation of
11554 unnecessary proxies.
11556 2005-05-02 Martin Baulig <martin@ximian.com>
11560 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11561 Also `And' the locals if the old vector is null.
11562 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
11563 null; in this case we basically reset all the variables.
11565 2005-05-02 Martin Baulig <martin@ximian.com>
11569 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
11570 Added `FlowBranching branching' argument; always `and' the
11571 variables instead of `or'ing them unless we're an infinite loop.
11573 * statement.cs (While.Resolve): Create a new sibling unless we're
11576 2005-05-02 Martin Baulig <martin@ximian.com>
11580 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
11581 arguments; use it instead of creating a new TopLevelBlock.
11582 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
11583 our ConstructorInitializer.
11586 (TopLevelBlock.TopLevelBranching): New public property.
11587 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
11588 and create our `TopLevelBranching'.
11590 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
11591 anonymous method host, use `block.TopLevelBranching' rather than
11592 creating a new branching.
11594 2005-04-20 Miguel de Icaza <miguel@novell.com>
11596 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
11597 a ScopeInfo, if any of the current children is a child of the new
11598 entry, move those children there.
11600 2005-04-30 Martin Baulig <martin@ximian.com>
11602 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
11603 at the beginning of a SwitchSection. Fix #73335.
11605 2005-04-27 Marek Safar <marek.safar@seznam.cz>
11608 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
11610 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
11611 (FieldExpr.DoResolve): Obsolete members are ignored for field
11614 2005-04-26 Marek Safar <marek.safar@seznam.cz>
11616 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
11617 of arrays detection.
11619 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
11621 (Field.VerifyClsCompliance): Volatile fields are not compliant.
11623 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
11626 2005-04-25 Ben Maurer <bmaurer@ximian.com>
11628 * cs-parser.jay: Use the prefered version of -unsafe in error
11631 2005-04-22 Marek Safar <marek.safar@seznam.cz>
11633 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
11636 2005-04-20 John Luke <john.luke@gmail.com>
11638 * driver.cs: fix typo in error message, --outout to --output
11640 2005-04-20 Marek Safar <marek.safar@seznam.cz>
11642 * codegen.cs (InRefOutArgumentResolving): New field.
11644 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
11645 fields outside contructor.
11647 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
11649 2005-04-19 Miguel de Icaza <miguel@novell.com>
11651 * anonymous.cs (CaptureContext.EmitParameterInstance): The
11652 parameter code was not completed ever, so it was not as up-to-date
11653 as local variables. Must finish it.
11655 The bug fix was to compare the Toplevel of the block, not the
11656 current block. Thanks for Ben for pointing this out.
11658 2005-04-19 Raja R Harinath <rharinath@novell.com>
11660 * decl.cs (AddMethods): Use the declaring type of the problem
11661 method to determine if we want to squash a warning.
11663 2005-04-19 Marek Safar <marek.safar@seznam.cz>
11665 * attribute.cs: Removed debug output.
11667 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
11669 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
11672 2005-04-18 Raja R Harinath <rharinath@novell.com>
11675 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
11676 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
11677 all null comparisons against reference types.
11679 2005-04-18 Marek Safar <marek.safar@seznam.cz>
11682 * class.cs (TypeContainer.CircularDepException) New nested
11684 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
11685 (TypeContainer.DefineType): Removed error, reset InTransit before
11687 (Class.DefineType): Throw exception when is in Transit.
11688 Catch exception and report error.
11689 (Struct.DefineType): Throw exception when is in Transit.
11690 Catch exception and report error.
11691 (Interface.DefineType): Throw exception when is in Transit.
11692 Catch exception and report error.
11694 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
11695 handle nested exception handlers.
11697 * flowanalysis.cs (InTryWithCatch): New method, search for try with
11700 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
11701 InFinally and InCatch storage.
11703 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
11704 (Catch.Resolve): Set and Restore ec.InCatch.
11705 (Try.Resolve): Set and Restore ec.InFinally.
11706 (Try.HasCatch): True when try has catch.
11708 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
11710 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
11711 for the same event member, so exclude such cases from warning 419.
11714 2005-04-16 Miguel de Icaza <miguel@novell.com>
11716 * expression.cs (Binary.ResolveOperator): Apply patch from John
11717 Luke to fix bug 59864: operators &, | and ^ on enumerations
11718 require that the same enum type on both sides.
11720 * driver.cs: Add warnings to old flag usage, this is to assist
11721 people who produce Makefiles and hope that the Makefiles will be
11724 * class.cs (TypeContainer.EmitType): Moved the definition of the
11725 special $PRIVATE$ field from the resolve phase to the Emit phase.
11726 During resolve we do not know if we are a struct with
11727 HasExplicitLayout, we know this only after the attributes for the
11730 Set the FieldOffset to zero on the dummy field that we create for
11731 the class. Fixes 74590.
11733 2005-04-16 Raja R Harinath <rharinath@novell.com>
11736 * ecore.cs (PropertyExpr.resolved): New.
11737 (DoResolve): Use it to handle a case of double resolution here.
11738 Handle a case of identical-name-and-type-name.
11739 * expression.cs (ArrayCreation.CheckIndices): Avoid double
11740 resolution by storing the results of expression resolution back
11741 into the "probes" array.
11743 2005-04-15 Raja R Harinath <rharinath@novell.com>
11745 Fix cs0208-7.cs and cs0208-8.cs.
11746 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
11747 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
11748 error reporting to point out the reason a struct is not unmanaged.
11750 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11752 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
11753 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
11755 2005-04-13 Raja R Harinath <rharinath@novell.com>
11758 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
11759 IdenticalNameAndTypeName here.
11760 (EventExpr.InstanceResolve): Likewise.
11762 2005-04-13 Marek Safar <marek.safar@seznam.cz>
11764 C# 2.0 DefaultCharSetAttribute implementation
11766 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
11767 which allows us to set GlobalNamespace for every resolve.
11768 (Attribute.ResolveArguments): Cut from Resolve.
11769 (Attribute.GetCharSetValue): Returns CharSet named argument.
11770 (Attribute.DefinePInvokeMethod): Gets default charset from
11772 (GlobalAttribute.ResolveAsTypeStep): Override.
11773 (GlobalAttribute.ResolveArguments): Override.
11775 * class.cs (TypeAttr): Is protected.
11777 * codegen.cs (ModuleClass.DefaultCharSet): New member.
11778 (ModuleClass.DefaultCharSetType): New memeber.
11779 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
11781 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
11782 charset from module.
11784 * delegate.cs (TypeAttr): Override.
11785 (Delegate.DefineType): Use this TypeAttr.
11787 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
11788 at very early stage (before types are defined) to resolve model
11789 module attributes. It will probably not work with corlib but it
11792 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
11793 charset from module.
11795 * typemanager.cs (default_charset_type): New type.
11797 2005-04-13 Raja R Harinath <rharinath@novell.com>
11799 * decl.cs (MemberCache.AddMethods): Don't warn if
11800 System.Object.Finalize has buggy MethodAttributes.
11802 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
11805 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11807 * doc.cs : detect ambiguous reference to overloaded members.
11808 Fixed bug #71603. MS 1.1 csc does not detect it.
11810 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11812 * doc.cs : delegates must not be referenced with parameters.
11815 2005-04-12 Miguel de Icaza <miguel@novell.com>
11817 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
11819 2005-04-10 Miguel de Icaza <miguel@novell.com>
11821 * driver.cs (MainDriver): Stop processing if the CLS stage found
11824 (CompilerCallableEntryPoint.InvokeCompiler): Always
11825 reset after execution; Take a TextWriter argument for the
11828 * report.cs: Use the error stream instead of hardcoding stderr.
11830 2005-04-09 Miguel de Icaza <miguel@novell.com>
11832 * class.cs: Reduce code paths to test, too small of an
11833 optimization to make it worth the extra testing. Always perform
11836 2005-04-08 Raja R Harinath <rharinath@novell.com>
11839 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
11840 operators that had errors reported on them.
11842 2005-04-08 Marek Safar <marek.safar@seznam.cz>
11844 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
11846 (Attribute.Resolve): Add named argument type checking.
11848 * class.cs (FixedField.Define): Use IsPrimitiveType
11850 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
11852 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
11853 unsafe parameter types.
11855 * statement.cs (Using.ResolveExpression): Add better error description.
11857 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
11859 2005-04-08 Raja R Harinath <rharinath@novell.com>
11862 * attribute.cs (Attribute.GetAttributeUsage): Resolve
11863 AttributeUsageAttribute in the emitcontext of the attribute class,
11864 not in the emitcontext of the attributable entity it was attached to.
11865 * cs-parser.jay: Use 'current_class', not 'current_container',
11866 when creating a GlobalAttribute.
11868 2005-04-08 Alp Toker <alp@atoker.com>
11870 * pending.cs: The fix to #58413 failed to compile methods implementing
11871 interfaces with/without params modifiers and vice versa, even though
11872 params modifiers aren't part of the signature. Make the modifier check
11873 less strict as in csc.
11875 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
11876 Anoob V E <projectmonokochi@rediffmail.com>
11877 Harilal P R <projectmonokochi@rediffmail.com>
11880 * pending.cs (TypeAndMethods.mods): New. Store the parameter
11881 modifiers of pending methods.
11882 (PendingImplementation.PendingImplementation): Initialize it.
11883 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
11884 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
11885 with ParameterData. Add check for modifiers.
11886 * class.cs (MethodData.Define): Update to changes.
11888 2005-04-07 Raja R Harinath <rharinath@novell.com>
11890 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
11892 2005-04-07 Marek Safar <marek.safar@seznam.cz>
11894 * class.cs (PropertyMethod.Define): Check private accessor in abstract
11897 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
11900 * typemanager.cs: Registered RequiredAttributeAttribute.
11902 2005-04-06 Marek Safar <marek.safar@seznam.cz>
11904 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
11905 Warning CS0169 is back at level 3.
11906 (IMethodData.SetMemberIsUsed): New method.
11908 * decl.cs (IsUsed): New value; moved from FieldBase.Status
11909 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
11911 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
11913 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
11915 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
11918 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
11921 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
11922 to avoid the problems with nested types.
11924 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
11925 Anoob V.E <projectmonokochi@rediffmail.com>
11926 Harilal P.R <projectmonokochi@rediffmail.com>
11927 Raja R Harinath <rharinath@novell.com>
11930 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
11932 * typemanager (GetConstructor): Make public.
11934 2005-04-05 John Luke <john.luke@gmail.com>
11935 Raja R Harinath <rharinath@novell.com>
11938 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
11939 struct too. Return false quicker in a few cases.
11940 (VerifyUnManaged): Use it.
11942 2005-04-05 Raja R Harinath <rharinath@novell.com>
11945 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
11946 not 'unreachable_seen'.
11948 2005-04-04 Marek Safar <marek.safar@seznam.cz>
11950 * attribute.cs (Attribute.GetValue): Removed unused.
11952 * codegen.cs (CodeGen.TrimExt): Removed unused.
11954 * cs-parser.jay (output): Removed unused.
11956 * cs-tokenizer.cs (hex_digits): Removed unused.
11958 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
11960 * expression.cs (Indirection.LoadExprValue): Removed unused.
11961 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
11963 * iterators.cs (Iterator.param_types): Removed unused.
11965 * statement.cs (Goto.block): Removed unused.
11966 (ToplevelBlock.did): Removed unused.
11967 (Switch.ResolveConstantSwitch): Removed unused.
11969 2005-04-01 Ben Maurer <bmaurer@ximian.com>
11971 * rootcontext.cs: Allow mcs to bootstrap with the compilation
11974 2005-04-01 Raja R Harinath <rharinath@novell.com>
11976 Fix #74232 and cs0208-3.cs.
11977 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
11978 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
11979 unmanaged type. Don't use FieldBuilders when 't' is a
11980 TypeBuilder. Use ModFlags and MemberType fields.
11981 * class.cs (MemberBase.member_type): Rename from MemberType.
11982 (MemberBase.MemberType): New property. Determines member_type on
11984 (MemberBase.DoDefine): Don't initialize MemberType here.
11985 (FieldMember.Define): Likewise.
11987 2005-04-01 Marek Safar <marek.safar@seznam.cz>
11990 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
11991 Attributes are emitted there.
11993 2005-04-01 Raja R Harinath <rharinath@novell.com>
11995 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
11996 keyword in 'partial enum' too.
11997 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
11999 Report from Kamil Skalski <nazgul@omega.pl>.
12002 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
12003 have partial containers too.
12005 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
12006 in block' checks to Block.CheckInvariantMeaningInBlock.
12007 * statement.cs (Block.GetKnownVariableInfo): Make private.
12008 (Block.IsVariableUsedInChildBlock): Remove.
12009 (Block.IsVariableUsedInBlock): Likewise.
12010 (Block.CheckInvariantMeaningInBlock): New. Show location of
12011 conflicting declaration.
12012 (Block.AddVariable): Make error messages less long-winded and more
12013 specific. Show location of conflicting declaration.
12014 * parameter.cs (Parameters.Location): New readonly property.
12016 2005-03-31 Raja R Harinath <rharinath@novell.com>
12018 Clean up semantics of invoking ResolveMemberAccess.
12019 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
12020 can have an instance, ensure that we pass in a non-TypeExpression
12021 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
12022 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
12023 argument. Update to changes and simplify.
12024 (FieldExpr.Emitinstance): Remove CS0120 check.
12025 (PropertyExpr.EmitInstance): Likewise.
12026 * expression.cs (Argument.Resolve): Likewise.
12027 (Invocation.DoResolve): Update to changes in semantics of
12028 InstanceExpression.
12030 2005-03-31 Marek Safar <marek.safar@seznam.cz>
12033 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
12036 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
12038 2005-03-31 Raja R Harinath <rharinath@novell.com>
12040 Fix difference in behaviour with commandline invocation.
12041 * driver.cs (Driver.Reset): New.
12042 (CompilerCallableEntryPoint): Call it.
12044 * statement.cs (If.Resolve): Avoid spurious "uninitialized
12045 variable" warnings if the boolean expression failed to resolve.
12047 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
12049 * attribute.cs: Fix the union of several permissions when some of them
12050 are unrestricted (so the result isn't an unrestricted permission set).
12053 2005-03-30 Raja R Harinath <rharinath@novell.com>
12055 * ecore.cs (MemberExpr): New class. Convert from interface
12057 (MemberExpr.ResolveMemberAccess): Refactor and move here from
12058 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
12060 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
12061 (MethodGroupExpr.IsExplicitImpl): Remove.
12062 (Expression.GetFieldFromEvent): Remove.
12063 (SimpleName.MemberStaticCheck): Remove.
12064 (SimpleName.DoSimpleNameResolve): Update to changes.
12065 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
12066 (MemberAccess.IdenticalNameAndTypeName): Remove.
12067 (MemberAccess.error176): Move to MemberExpr.
12068 (MemberAccess.DoResolve): Update to changes.
12069 (BaseAccess.DoResolve): Likewise.
12071 2005-03-30 Marek Safar <marek.safar@seznam.cz>
12073 C# 2.0 Conditional attribute class implementation
12075 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
12076 Analyzes class whether it has attribute which has ConditionalAttribute
12077 and its condition is not defined.
12079 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
12080 (Class.IsExcluded): New method. Search for at least one defined
12081 condition in ConditionalAttribute of attribute class.
12083 2005-03-30 Raja R Harinath <rharinath@novell.com>
12085 * ecore.cs (PropertyExpr): Derive from Expression, not
12086 ExpressionStatement.
12087 (PropertyExpr.EmitStatement): Remove.
12089 2005-03-29 Raja R Harinath <rharinath@novell.com>
12092 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
12093 internal field "value__" of an enum be private. The examples for
12094 "value__" that I found on MSDN all used FieldAttributes.Private.
12096 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
12097 Don't mention IL method attribute names.
12099 Fix #47991. Remove a TODO.
12100 * statement.cs (Block.Toplevel): Make into a field.
12101 (Block.Parameters): Move into ToplevelBlock.
12102 (Block.known_variables): Rename from child_variable_names.
12103 (Block.Block): Remove variants that take Parameters. Initialize
12104 'Toplevel' with the immediately surrounding toplevel block.
12105 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
12106 LocalInfo parameter.
12107 (Block.GetKnownVariableInfo): New.
12108 (Block.IsVariableNameUsedInChildBlock): Update.
12109 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
12110 the block, even though it may not be in scope.
12111 (Block.AddVariable): Remove Parameters parameter. Use
12112 Toplevel.Parameters instead.
12113 (Block.AddConstant): Remove Parameters parameter.
12114 (Block.GetParameterReference): Update to use Toplevel.Parameters.
12115 (Block.IsParamaterReference): Likewise.
12116 (Block.IsLocalParameter): Likewise. Simplify a lot.
12117 (ToplevelBlock.Parameters): New. Moved from Block.
12118 (ToplevelBlock.ToplevelBlock): Update to changes. Always
12119 initialize Parameters to a non-null value.
12120 * cs-parser.jay: Update to changes.
12121 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
12122 simple names that mean different things in the same block. Use
12123 Block.IsVariableNameUsedInBlock.
12125 2005-03-28 Raja R Harinath <rharinath@novell.com>
12127 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
12128 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
12129 GetTypeHandle. It is possible for a reflected type to derive from
12130 a TypeBuilder (e.g., int[] derives from the TypeBuilder
12131 System.Array during mscorlib compilation).
12132 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
12133 contain a method_hash, don't create one either. Don't create a
12134 deep copy of the base cache's method_hash.
12135 (MemberCache.SetupCache): Rename back from DeepCopy.
12136 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
12137 already initialized. If we see an override function, add its
12138 underlying base virtual function to the member_hash too.
12140 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
12142 2005-03-26 Raja R Harinath <harinath@acm.org>
12145 * assign.cs (Assign.DoResolve): When the RHS of an assignment
12146 fails to resolve, ensure that the LHS is still resolved as an
12149 2005-03-25 Raja R Harinath <harinath@acm.org>
12151 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
12153 (Enum.current_ec): Remove.
12154 (Enum.LookupEnumValue): Remove EmitContext argument.
12155 Just uses the one created during DefineType.
12156 (Enum.FindMembers): Update.
12157 * expression.cs (MemberAccess.DoResolve): Update.
12159 2005-03-22 Marek Safar <marek.safar@seznam.cz>
12161 * assign.cs (Assign.DoResolve): Check for CS1717 when
12162 source and target are same (uses Equals).
12164 * expression.cs (LocalVariableReference, ParameterReference,
12165 This): Implemented Equals, GetHashCode.
12167 * statement.cs (Block.GetParameterReference): Removed useless
12170 2005-03-22 Raja R Harinath <rharinath@novell.com>
12173 * statement.cs (Block.AddVariable): Ensure that we skip implicit
12174 blocks before deciding whether the error is cs0136 or cs0128.
12176 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
12177 (using_alias_directive, using_namespace_directive): Pass
12178 MemberName, not an expression to Namespace.UsingAlias and
12180 (MakeName): Use the MemberName of the namespace.
12181 * namespace.cs (Namespace.MemberName): New.
12182 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
12183 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
12185 * decl.cs (MemberName.Name): Make readonly.
12186 (MemberName.FromDotted): New "constructor".
12187 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
12188 (MemberCore.Name): Compute from MemberName on demand.
12189 (MemberCore.SetMemberName): Provide a way to change the
12191 (MemberCore.AddToContainer): Don't take a fullname parameter.
12192 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
12193 fully qualified name of the container to the member name.
12194 (TypeContainer.AddToTypeContainer): Use a fully qualified name
12195 only if the type is a member of the root container.
12196 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
12197 MemberName.Left rather than searching for an embedded ".".
12198 (PartialContainer.CreatePart): Update to changes in RootContext.
12199 (MemberBase.ShortName): Turn into a property. Use
12200 MemberCore.SetMemberName.
12201 (MemberBase.ExplicitInterfaceName): Remove.
12202 (MemberBase.UpdateMemberName): Remove.
12203 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
12204 (PropertyBase.SetMemberName): New override.
12205 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
12206 (Tree.GetDecl): New.
12207 (Tree.AllDecls): Rename from Decls.
12208 * attribute.cs, enum.cs, report.cs: Update to changes.
12209 * driver.cs (MainDriver): Use MemberName.FromDotted on
12210 RootContext.MainClass.
12212 2005-03-21 Marek Safar <marek.safar@seznam.cz>
12214 * class.cs (FixedField.Define): Check for CS1664 and more sanity
12217 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
12219 2005-03-18 Marek Safar <marek.safar@seznam.cz>
12221 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
12222 property accessor modifiers.
12224 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
12225 fixed buffer attribute (CS1716).
12226 (PropertyMethod.HasCustomAccessModifier): When property accessor
12227 has custom modifier.
12229 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
12231 (PropertyExpr.DoResolveLValue): Add CS0272.
12233 2005-03-17 Miguel de Icaza <miguel@novell.com>
12235 * convert.cs: When converting to a pointer, use the proper Conv.U
12236 or Conv.I depending on the source data type.
12238 * cs-tokenizer.cs: Make the size for large decimal constants,
12241 2005-03-17 Martin Baulig <martin@ximian.com>
12243 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
12244 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
12246 2005-03-17 Martin Baulig <martin@ximian.com>
12248 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
12249 to bool so we can return an error condition.
12250 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
12253 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
12255 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
12258 2005-03-16 Raja R Harinath <rharinath@novell.com>
12260 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
12261 Refactor to avoid traversing the list of assemblies, and to avoid
12262 string concatenation.
12263 * typemanager.cs (guid_attr_type): Remove.
12264 (negative_hits, pointers, references): Remove hashes.
12266 (GetConstructedType): New. Uses type_hash to handle constructed
12267 types (arrays, references, pointers).
12268 (GetReferenceType, GetPointerType): Use it.
12269 (GetNestedType): New. Uses type_hash to handle nested types of
12271 (LookupType, LookupTypeDirect): Remove.
12272 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
12273 'types' hash and LookupTypeReflection directly.
12274 (params_string, params_object): Use GetConstructedType.
12275 * namespace.cs (Namespace.cached_types): New. Cache of reflected
12277 (Namespace.Lookup): Use cached_types.
12278 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
12279 provided by old TypeManager.LookupType.
12280 * rootcontext.cs (MakeFQN): Remove.
12281 * decl.cs (DeclSpace.MakeFQN): Likewise.
12282 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
12283 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12284 TypeManager.GetConstructedType.
12285 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
12287 2005-03-15 Marek Safar <marek.safar@seznam.cz>
12289 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
12292 * cs-parser.jay: Reports CS1527 for any namespace element.
12294 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
12297 * expression.cs (ParameterReference.IsAssigned): Changed error to
12299 (Error_WrongNumArguments): Moved CS0245 detection here.
12301 * statement.cs (Return.Resolve): Add CS1622 report.
12303 2005-03-11 Marek Safar <marek.safar@seznam.cz>
12305 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
12307 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
12309 * attribute.cs expression.cs: Get rid of some allocations.
12311 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
12313 * doc.cs : just eliminate the latest change.
12315 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12317 * doc.cs : commented out the latest change. It breaks xml-030.cs
12319 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12321 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
12322 fail. So invoke CreateType() in FindDocumentedType().
12324 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12326 * cs-tokenizer.cs : added IsKeyword().
12327 * doc.cs : Detect keyword incorrectly used as identifier.
12328 Allow identifiers prefixed by @.
12330 2005-03-10 Marek Safar <marek.safar@seznam.cz>
12332 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
12333 It caused exception in namespace resolving (again!).
12335 * class.cs (Class.ctor): Removed exit.
12336 (PropertyMethod.ctor): ditto.
12338 * codegen.cs (Codegen.Reset): Reset static data.
12339 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
12341 * cs-tokenizer.cs (Cleanup): Removed.
12343 * driver.cs (GetSystemDir): Rewrote to one line command.
12344 It caused problem with unloaded dynamic modules.
12345 (UnixParseOption): Removed Exit.
12346 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
12347 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
12348 Now can be mcs used as library.
12350 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
12353 * location.cs (Reset): Reset static data.
12355 * namespace.cs (Reset): Reset static data.
12357 * report.cs (Report.Reset): Reset static data.
12359 * rootcontext.cs (RootContext.Reset): Reset static data.
12361 * tree.cs (RootTypes.ctor): Use Location.Null
12363 * typemanager.cs (TypeManager.Reset): Reset static data.
12364 (CoreLookupType): Removed Exit.
12365 (TypeHandle.Reset): Reset static data.
12367 2005-03-10 Raja R Harinath <rharinath@novell.com>
12370 * typemanager.cs (ComputeNamespaces): Import namespaces from
12371 referenced modules too.
12373 2005-03-09 Raja R Harinath <rharinath@novell.com>
12375 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
12378 2005-03-09 Raja R Harinath <rharinath@novell.com>
12380 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
12381 enclosing DeclSpace. This ensures that a name-lookup populates
12382 more caches and there are fewer 'TypeExpression's. Carve out
12383 nested type lookup into ...
12384 (LookupNestedTypeInHierarchy): ... this.
12386 2005-03-09 Raja R Harinath <rharinath@novell.com>
12388 Clean up a few partial-class semantics.
12389 Fixes test-357.cs and cs1618-2.cs.
12390 * cs-parser.jay (struct_declaration): Use 'current_class' as
12391 parent of newly-created struct. Remove call to Register ().
12392 Use 'pop_current_class' to complete handing the current struct.
12393 (interface_declaration): Likewise.
12394 (class_declaration): Likewise.
12395 (enum_declaration): Use 'current_class' as parent of newly created
12397 (delegate_declaration): Likewise.
12398 (pop_current_class): New function. This is used to handle closing
12399 up the 'current_class' and 'current_container', and pointing them
12400 to the enclosing class/container.
12401 (CSharpParser): Initialize 'current_class' too.
12402 * decl.cs (MemberCore): Add check for invariant: a partial
12403 container is not a parsed entity, and thus does not enclose any
12405 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
12406 (DeclSpace.BaseTypeExpr): Use it.
12407 (DeclSpace.LookupType): Add check for invariant.
12408 * class.cs (TypeContainer): Add check for invariant: a nested
12409 class should have the same NamespaceEntry as its enclosing class.
12410 (TypeContainer.EmitFieldInitializers): Make virtual.
12411 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
12413 (TypeContainer.Register): Remove.
12414 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
12415 null. Use TypeResolveEmitContext for resolving base types and
12416 interfaces. Move initialization of Parts.TypeBuilder here from
12418 (TypeContainer.DefineNestedTypes): ... here.
12419 (PartialContainer): Take a Namespace not a NamespaceEntry.
12420 (PartialContainer.Create): Don't use Register. Call the
12421 appropriate Add... function directly.
12422 (ClassPart): Take both the PartialContainer and the enclosing
12423 class as constructor arguments.
12424 (ClassPart.EmitFieldInitializers): Override.
12425 (ClassPart.PartFindNestedTypes): Remove.
12426 (FieldBase.GetInitializerExpression): Resolve the initializer
12427 expression in the emit context of the enclosing class.
12428 * tree.cs (RootTypes): Remove Register ().
12430 2005-03-08 Marek Safar <marek.safar@seznam.cz>
12432 * cs-parser.jay: Removed CS0134.
12434 * driver.cs: Removed CS1901.
12436 * expression.cs (SizeOf.DoResolve): Don't report CS0233
12437 for predefined types.
12439 2005-03-07 Duncan Mak <duncan@novell.com>
12441 * codegen.cs (Save): Catch UnauthorizedAccessException as
12442 well. Fixes bug #73454.
12444 2005-03-07 Marek Safar <marek.safar@seznam.cz>
12446 * cs-tokenizer.cs (xtoken): Add CS1035.
12448 * class.cs (MethodData.Define): Add CS0683.
12449 (FieldMember.ctor): Add CS0681.
12451 2005-03-07 Raja R Harinath <rharinath@novell.com>
12453 * ecore.cs (SimpleName.DoResolve): Rename from
12454 SimpleName.DoResolveAllowStatic.
12455 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
12456 Pass 'intermediate' flag to MemberStaticCheck.
12457 (SimpleName.MemberStaticCheck): Skip "static check" only in case
12458 of "intermediate" lookups via MemberAccess.
12459 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
12460 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
12462 2005-03-07 Raja R Harinath <rharinath@novell.com>
12465 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
12466 slipped in because of variable names that are identical to a
12467 builtin type's BCL equivalent ('string String;', 'int Int32;').
12468 (PropertyExpr.EmitInstance): Likewise.
12470 2005-03-04 Marek Safar <marek.safar@seznam.cz>
12472 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
12474 * report.cs (warning_ignore_table): Made public.
12476 2005-03-04 Raja R Harinath <rharinath@novell.com>
12479 * class.cs (MethodData.Emit): Pass 'container' to
12480 container.GetObsoleteAttribute instead of 'container.Parent'.
12482 2005-03-03 Marek Safar <marek.safar@seznam.cz>
12484 * cs-parser.jay: Add 1534 error test.
12486 * iterators.cs (Yield.CheckContext): Add error 1629.
12487 (Iterator.ctor): Save unsafe modifier.
12488 (MoveNextMethod.DoEmit): Restore unsafe context.
12490 * namespace.cs (UsingAlias): Better error message.
12492 2005-03-03 Dan Winship <danw@novell.com>
12494 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
12495 the warning message [#73219]
12497 2005-03-03 Raja R Harinath <rharinath@novell.com>
12499 Fix compile with MCS 1.0.0.0.
12500 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
12501 w_restore to not depend on string constant folding.
12503 2005-03-03 Raja R Harinath <rharinath@novell.com>
12505 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
12506 CS0246 check to users who passed 'silent = false'.
12507 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
12509 (SimpleName.SimpleNameResolve): Update.
12510 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
12511 (MemberAccess.IdenticalNameAndTypeName): Update.
12512 * doc.cs (FindDocumentedTypeNonArray): Update.
12514 2005-03-03 Raja R Harinath <rharinath@novell.com>
12516 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
12517 * parameters.cs (ComputeAndDefineParameters): Remove.
12518 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
12519 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
12520 Use GetParameterInfo.
12522 2005-03-02 Marek Safar <marek.safar@seznam.cz>
12524 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
12526 2005-03-02 Raja R Harinath <rharinath@novell.com>
12528 Unify DeclSpace.LookupType and DeclSpace.FindType.
12529 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
12530 is in charge of defining nested types on demand.
12531 (DeclSpace.LookupType): Use it when the current_type is a
12532 TypeBuilder. Use LookupTypeDirect for reflected types.
12533 (DeclSpace.FindType): Remove.
12534 (DeclSpace.LookupInterfaceOrClass): Likewise.
12535 (DeclSpace.DefineTypeAndParents): Likewise.
12536 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
12537 DeclSpace.LookupType.
12538 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
12539 * typemanager.cs (LookupType): Simplify.
12540 (AddUserType): Remove type from negative_hits.
12541 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
12542 * class.cs (TypeContainer.FindMembers): Move handling of nested
12544 (TypeContainer.FindMembers_NestedTypes): ... here.
12545 (TypeContainer.FindNestedType): Implement override.
12546 (ClassPart.FindNestedType): Delegate to PartialContainer.
12547 (ClassPart.PartFindNestedType): Looks up the nested types of the
12550 2005-03-02 Martin Baulig <martin@ximian.com>
12552 * class.cs (TypeContainer.DoDefineMembers): We also need a default
12553 static constructor in static classes.
12555 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
12557 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
12558 sizeParamIndex is not specified.
12560 2005-03-01 Marek Safar <marek.safar@seznam.cz>
12563 * report.cs (WarningMessage.IsEnabled): Missing null check.
12565 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12567 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
12568 in the fields and not in the properties.
12570 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
12572 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
12575 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12577 * attribute.cs: Small refactoring (improved robustness).
12578 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
12579 (ValidateGuid): Removed.
12580 (Resolve): Removed referenced to above mentioned.
12581 (GetAttributeUsage): Made private and changed to work without
12583 (GetIndexerAttributeValue): Don't crash.
12584 (GetConditionalAttributeValue): Ditto.
12585 (GetClsCompliantAttributeValue): Ditto.
12586 (ExtractSecurityPermissionSet): All attributes exceptions are
12588 (GetPropertyValue): New helper.
12589 (GetMethodImplOptions): New method.
12590 (DefinePInvokeMethod): Reuse common code. Implemented handling of
12591 some missing properties.
12593 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
12594 (Method.ApplyAttributeBuilder): Updated.
12596 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
12599 2005-02-28 Raja R Harinath <rharinath@novell.com>
12602 * report.cs (Report.SymbolRelatedToPreviousError): Handle
12603 non-simple types (array, pointer, reference).
12605 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12607 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
12609 * class.cs (MethodCore.IsDuplicateImplementation): Special error
12611 (Method.CheckBase): Catch wrong destructor here.
12612 (MethodData.Define): Add errors 550, 668.
12614 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
12616 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
12618 * pending.cs (VerifyPendingMethods): Add error 551.
12620 * typemanager.cs (CSharpName): Next error report helper.
12622 2005-02-25 Marek Safar <marek.safar@seznam.cz>
12624 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
12625 attributes. Removed useless attribute double check.
12626 It saves almost 2MBs for corlib.
12628 2005-02-25 Raja R Harinath <rharinath@novell.com>
12631 * statement.cs (ExpressionStatement.Resolve): Make robust to being
12632 called twice in case of error.
12634 2005-02-23 Chris Toshok <toshok@ximian.com>
12636 Fix compiler portions of #72827.
12637 * statement.cs (Block.Emit): call Begin/EndScope on the
12638 EmitContext instead of the ILGenerator.
12640 * codegen.cs (EmitContext.BeginScope): new method, call
12641 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
12643 (EmitContext.BeginScope): same, but EndScope and CloseScope
12645 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
12646 offset and call the superclass's OpenScope(int) with it.
12647 (SymbolWriter.CloseScope): get the current il
12648 offset and call superclass's CloseScope(int) with it.
12650 2005-02-23 Marek Safar <marek.safar@seznam.cz>
12652 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
12653 CS1677 for out and ref as well.
12655 * class.cs (Method.Define): Add error CS1599 detection.
12657 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
12659 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
12661 * delegate.cs (Delegate.Define): Add error CS1599 detection.
12663 * support.cs.cs (ModifierDesc): New helper method.
12665 2005-02-23 Raja R Harinath <rharinath@novell.com>
12666 Abin Thomas <projectmonokochi@rediffmail.com>
12667 Anoob V E <projectmonokochi@rediffmail.com>
12668 Harilal P R <projectmonokochi@rediffmail.com>
12670 Fix #57851, #72718.
12671 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
12672 MemberLookup (used for error reporting) actually returns a result.
12673 Fix error report number (122, not 112).
12675 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
12676 Anoob V E <projectmonokochi@rediffmail.com>
12677 Harilal P R <projectmonokochi@rediffmail.com>
12680 * pending.cs (PendingImplementation.GetAbstractMethods):
12681 Find NonPublic members too.
12683 2005-02-22 Marek Safar <marek.safar@seznam.cz>
12685 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
12688 * class.cs (MethodCore.CheckMethodAgainstBase):
12689 Add error 239 report.
12691 2005-02-21 Raja R Harinath <rharinath@novell.com>
12694 * expression.cs (Invocation.IsApplicable): Make public.
12695 (Invocation.IsParamsMethodApplicable): Likewise.
12696 * delegate.cs (Delegate.VerifyApplicability): Don't use
12697 Invocation.VerifyArgumentCompat for parameter applicability
12698 testing. Use Invocation.IsApplicable and
12699 Invocation.IsParamsMethodApplicable.
12701 2005-02-21 Marek Safar <marek.safar@seznam.cz>
12703 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
12705 * class.cs (Operator.Define): Add error 217 report.
12707 2005-02-21 Raja R Harinath <rharinath@novell.com>
12709 * namespace.cs (UsingEntry.Resolve): Undo change below.
12711 2005-02-21 Raja R Harinath <rharinath@novell.com>
12714 * ecore.cs (Expression.MemberLookupFailed): Add argument to
12715 disable the error message when the extended MemberLookup also
12717 (Expression.MemberLookupFinal): Update.
12718 (SimpleName.DoSimpleNameResolve): Update.
12719 * expression.cs (MemberAccess.ResolveNamespaceOrType):
12720 Don't use MemberLookupFinal.
12721 (New.DoResolve): Update.
12722 (BaseAccess.CommonResolve): Update.
12724 2005-02-21 Raja R Harinath <rharinath@novell.com>
12727 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
12728 occured previously, don't resolve again.
12730 2005-02-21 Marek Safar <marek.safar@seznam.cz>
12733 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
12734 argument. Call ResolveAttributeUsage for unresolved.
12735 when types doesn't match ctor arguments.
12737 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
12738 for nested attribute classes.
12739 (Class.attribute_usage): Removed.
12740 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
12741 for attribute class.
12743 * ecore.cs (IsAttribute): Removed.
12745 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
12747 * rootcontext.cs (RegisterAttribute): Removed, attributes are
12749 (attribute_types): Removed.
12750 (EmitCode): Global attributes are emited as the latest.
12752 2005-02-18 Marek Safar <marek.safar@seznam.cz>
12754 * class.cs (EmitFieldInitializers): Don't emit field initializer
12755 for default values when optimilization is on.
12757 * constant.cs (Constant.IsDefaultValue): New property.
12759 * driver.cs: Add /optimize handling.
12763 * literal.cs: Implement new IsDefaultValue property.
12765 * rootcontext.cs (Optimize): New field, holds /optimize option.
12767 2005-02-18 Raja R Harinath <rharinath@novell.com>
12769 Fix crasher in re-opened #72347.
12770 * namespace.cs (Namespace.Lookup): Return null if
12771 DeclSpace.DefineType returns null.
12774 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
12776 2005-02-18 Raja R Harinath <rharinath@novell.com>
12778 Fix remainder of #63202. Change semantics of DoResolveLValue: it
12779 now returns null if it cannot resolve to an lvalue.
12780 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
12781 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
12782 returned null. Remove check for SimpleName.
12783 (EventExpr.DoResolveLValue): New.
12784 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
12785 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
12787 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
12788 avoid CS0131 error.
12789 (Unary.ResolveOperator): Move CS0211 check ...
12790 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
12792 (Unary.DoResolveLValue): Simplify.
12793 (AddressOf.DoResolveLValue): New.
12794 (ArrayAccess.DoResolveLValue): New.
12796 2005-02-16 Marek Safar <marek.safar@seznam.cz>
12798 * attribute.cs (Attribute.Resolve): Add arguments casting for
12799 when types doesn't match ctor arguments.
12801 2005-02-16 Raja R Harinath <rharinath@novell.com>
12803 Fix parts of #63202.
12804 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
12805 lookup of operator in base type. Ensure that all checks happen
12806 when the operator resolves to an "op_..." method.
12808 2005-02-15 Raja R Harinath <rharinath@novell.com>
12811 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
12812 'ignore_cs0104' parameter. Pass it to ...
12813 (NamespaceEntry.Lookup): ... this.
12814 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
12815 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
12816 (TypeLookupExpression.DoResolveAsTypeStep): Update.
12817 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
12818 Update. Request that cs0104 errors be ignored.
12819 (ComposedCast.ResolveAsTypeStep): Update.
12821 2005-02-14 Raja R Harinath <rharinath@novell.com>
12824 * expression.cs (Invocation.BetterFunction): Remove support for
12825 comparing virtual functions and their overrides.
12826 (Invocation.IsOverride): New.
12827 (Invocation.OverloadResolve): Don't consider 'override' functions
12828 during candidate selection. Store them in a lookaside list.
12829 If the selected method is a 'virtual' function, use the list to
12830 find any overrides that are closer to the LHS type.
12832 2005-02-14 Marek Safar <marek.safar@seznam.cz>
12834 * expression.cs (New.DoResolve): Add complex core type reduction.
12835 (New.Constantify): Converts complex core type syntax like 'new int ()'
12836 to simple constant.
12838 2005-02-14 Raja R Harinath <rharinath@novell.com>
12840 * decl.cs (EntryType.EntryType): New constructor to create an
12841 updated copy of a cache entry.
12842 (MemberCache.AddMethods): Use it.
12843 (MemberCache.ClearDeclaredOnly): Remove.
12844 (MemberCache.MemberCache): Update.
12846 2005-02-11 Miguel de Icaza <miguel@novell.com>
12848 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
12849 variable. This one is represents the actual low-level declaration
12850 of the method, as opposed to the semantic level `IsStatic'.
12852 An anonymous method which is hosted into a static method might be
12853 actually an instance method. IsStatic would reflect the
12854 container, while MethodIsStatic represents the actual code
12857 * expression.cs (ParameterReference): Use the new MethodIsStatic
12858 instead of IsStatic.
12860 * anonymous.cs (AnonymousMethod.Compatible): Pass the
12861 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
12862 set on the current EmitContext.
12864 * expression.cs (Cast): Overload DoResolveLValue so we can pass
12865 resolve our casted expression as an LValue. This triggers the
12866 proper LValue processing that is later required by Assign.
12870 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
12872 2005-02-11 Marek Safar <marek.safar@seznam.cz>
12874 C# 2.0 Fixed buffer implementation
12876 * anonymous.cs: Update after RegisterHelperClass renaming.
12878 * attribute.cs (AttributeTester.fixed_buffer_cache):
12879 Cache of external fixed buffers.
12880 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
12881 implementation if field is fixed buffer else null.
12884 (TypeContainer.AddField): Accept FieldMember instead of Field.
12885 (FieldBase.IsFieldClsCompliant): Extracted code from
12886 VerifyClsCompliance descendant customization.
12887 (FixedField): New class handles fixed buffer fields.
12888 (FixedFieldExternal): Keeps information about imported fixed
12890 (IFixedField): Make access to internal or external fixed buffer
12893 * cs-parser.jay: Add fixed buffer parsing.
12895 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
12898 * expression.cs (Indirection): Extended implementation to accept
12899 fixed buffer field.
12900 (PointerArithmetic.Emit): Get element from fixed buffer as well.
12901 (ElementAccess.MakePointerAccess): Get type as parameter.
12902 (DoResolve): Add fixed buffer field expression conversion.
12903 (DoResolveLValue): Ditto.
12904 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
12905 (ArrayPtr): Derives from FixedBufferPtr.
12906 (ArrayPtr.Emit): Add extra emit for array elements.
12908 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
12910 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
12911 for compiler generated types.
12912 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
12914 * statement.cs (Fixed): Refactored to be easier add fixed buffer
12915 and consume less memory.
12916 (Fixed.Resolve): Add fixed buffer case.
12918 * typemanager.cs (compiler_generated_attr_ctor,
12919 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
12920 (HasElementType): Add our own implementation to work on every
12923 2005-02-11 Miguel de Icaza <miguel@novell.com>
12925 * anonymous.cs (CaptureContext): Track whether `this' has been
12928 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
12929 only captured `this' if it was implicitly done (instance
12930 methods/variables were used).
12932 * codegen.cs (EmitContext.CaptureThis): New method to flag that
12933 `this' must be captured.
12935 2005-01-30 Miguel de Icaza <miguel@novell.com>
12937 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
12938 is null it means that there has been no need to capture anything,
12939 so we just create a sibling.
12941 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
12943 Just a partial fix. The other half is fairly elusive.
12945 2005-02-10 Raja R Harinath <rharinath@novell.com>
12947 Fix #52586, cs0121-4.cs.
12948 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
12949 and return a hashtable.
12950 (MemberCache.ClearDeclaredOnly): New.
12951 (MemberCache.MemberCache): Update to change. Make a deep copy of
12952 the method_hash of a base type too.
12953 (MemberCache.AddMethods): Adapt to having a deep copy of the base
12954 type methods. Overwrite entries with the same MethodHandle so
12955 that the ReflectedType is correct. The process leaves in base
12956 virtual functions and their overrides as distinct entries.
12957 (CacheEntry): Now a class instead of a struct. It shouldn't alter
12958 matters since it was boxed in a ArrayList before.
12959 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
12961 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
12962 case of a virtual function and its override (choose the overload
12964 (Invocation.OverloadResolve): Avoid 'override' members during
12965 'applicable_type' calculation.
12967 2005-02-09 Raja R Harinath <rharinath@novell.com>
12969 Combine two near-redundant caches.
12970 * typemanager.cs (method_params): Rename from method_internal_params.
12971 (TypeManager.GetParameterData): New. Replace
12972 Invocation.GetParameterData.
12973 (TypeManager.LookupParametersByBuilder): Remove.
12974 * expression.cs (Invocation.method_parameter_cache): Remove.
12975 (Invocation.GetParameterData): Remove.
12977 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
12980 2005-02-08 Raja R Harinath <rharinath@novell.com>
12983 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
12984 TypeManager.multicast_delegate_type is null, resolve it by looking
12985 up "System.MulticastDelegate".
12986 * rootcontext.cs (RootContext.ResolveCore): Simplify.
12988 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
12989 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
12990 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
12993 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
12994 (LabeledStatement.AddReference): New. Set 'referenced'.
12995 (Goto.Resolve): Use it.
12997 2005-02-05 John Luke <john.luke@gmail.com>
12999 * driver.cs: remove duplicate -doc line in Usage ()
13001 2005-02-04 Raja R Harinath <rharinath@novell.com>
13003 * location.cs (Location.AddFile): Fix CS2002 error report.
13005 2005-02-02 Martin Baulig <martin@ximian.com>
13007 * delegate.cs (Delegate.DefineType): Report an internal error if
13008 TypeManager.multicast_delegate_type is null. See bug #72015 for
13011 2005-02-02 Raja R Harinath <rharinath@novell.com>
13013 Fix a crasher in a variant of #31984.
13014 * const.cs (Constant.CheckBase): New override that defers the
13015 new-or-override check in case the base type hasn't been populated
13017 (Constant.Define): Ensure the new-or-override check is performed.
13019 2005-02-01 Duncan Mak <duncan@ximian.com>
13021 * const.cs (LookupConstantValue): Check that `ce' is not null
13022 before calling GetValue ().
13024 2005-02-01 Raja R Harinath <rharinath@novell.com>
13026 Fix test-334.cs (#69519).
13027 * cs-parser.jay (using_alias_directive): Pass in an expression to
13028 NamespaceEntry.UsingAlias.
13029 (using_namespace_directive): Pass in an expression to
13030 NamespaceEntry.Using.
13031 (namespace_name): Don't flatten to a string.
13032 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
13033 (NamespaceEntry.AliasEntry.Resolve): Lookup using
13035 (NamespaceEntry.UsingEntry): Likewise.
13036 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
13038 (NamespaceEntry.LookupForUsing): Remove.
13039 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
13041 (NamespaceEntry.Lookup): Remove support for dotted names.
13043 2005-02-01 Raja R Harinath <rharinath@novell.com>
13045 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
13047 (NamespaceEntry.ImplicitParent): Compute on demand.
13048 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
13049 parallels the current.
13050 (NamespaceEntry.LookupForUsing): Use it.
13051 (NamespaceEntry.Lookup): If the current namespace-entry is
13052 implicit, don't search aliases and using tables.
13054 2005-02-01 Raja R Harinath <rharinath@novell.com>
13057 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
13059 (TypeContainer.BaseCache): Compute on demand.
13060 (TypeContainer.FindMembers): Define constants and types if they're
13061 not already created.
13062 (FieldMember.Define): Move resetting of ec.InUnsafe before error
13064 * const.cs (Constant.Define): Make idempotent.
13066 2005-01-29 Miguel de Icaza <miguel@novell.com>
13068 * pending.cs: Produce better code (no nops produced by using Ldarg
13071 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
13072 i - 1' it should be arg + 1.
13076 2005-01-28 Raja R Harinath <rharinath@novell.com>
13078 * attribute.cs (Attribute.CheckAttributeType): Make private
13080 (Attribute.ResolveType): Make virtual.
13081 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
13082 handling of RootContext.Tree.Types.
13084 2005-01-27 Raja R Harinath <rharinath@novell.com>
13086 Update attribute-handling to use the SimpleName/MemberAccess
13088 * cs-parser.jay (attribute): Pass in an expression to the
13089 constructors of Attribute and GlobalAttribute.
13090 * attribute.cs (Attribute): Take an expression for the name.
13091 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
13092 passed in attribute name expression.
13093 (Attribute.CheckAttributeType): Use it.
13094 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
13095 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
13096 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
13097 argument to prevent error messages if the lookup fails.
13099 2005-01-27 Marek Safar <marek.safar@seznam.cz>
13101 * expression.cs (Indirection): Implemented IVariable interface
13102 to support indirection in AddressOf operator.
13103 (PointerArithmetic.Emit): Add optimalization for case where
13104 result can be precomputed.
13106 2005-01-26 Martin Baulig <martin@ximian.com>
13108 * class.cs (TypeContainer.AttributeTargets): Return the correct
13109 AttributeTargets depending on our `Kind' instead of throwing an
13110 exception; fixes #71632.
13112 2005-01-26 Marek Safar <marek.safar@seznam.cz>
13115 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
13118 2005-01-25 Raja R Harinath <rharinath@novell.com>
13121 * expression.cs (MemberAccess.DoResolve): Don't complain with
13122 cs0572 when the LHS of a member access has identical name and type
13125 2005-01-25 Marek Safar <marek.safar@seznam.cz>
13128 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
13130 Create custom PermissionSet only for PermissionSetAttribute.
13132 2005-01-24 Marek Safar <marek.safar@seznam.cz>
13135 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
13136 delegates in static class.
13138 2005-01-24 Martin Baulig <martin@ximian.com>
13140 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13141 merging an implicit block, just use its reachability.
13143 * statement.cs (Block.Resolve): Make the unreachable code check
13144 work wrt. implicit blocks; see test-337 from #63842.
13146 2005-01-21 Alp Toker <alp@atoker.com>
13148 * cs-parser.jay: destructor_declaration's container is PartialContainer
13149 not Class when partial types are used, so use Kind prop instead of
13152 2005-01-22 Miguel de Icaza <miguel@ximian.com>
13154 * cs-parser.jay: Improve error reporting when an interface
13155 declares new types.
13157 2005-01-20 Dick Porter <dick@ximian.com>
13159 * support.cs: SeekableStreamReader fix from Sandor Dobos
13160 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
13161 chars are read. Fixes bug 70369.
13163 2005-01-20 Raja R Harinath <rharinath@novell.com>
13165 * cs-parser.jay (catch_clause): Simplify current_block handling
13168 2005-01-17 Miguel de Icaza <miguel@ximian.com>
13170 * convert.cs (ImplicitStandardConversionExists): Synchronize the
13171 code with ImplicitStandardConversion to handle the implicit
13172 conversion of method groups into valid delegate invocations.
13174 The problem is that in parameter handling we were using this code
13175 path. Fixes bug #64698
13177 2005-01-19 Raja R Harinath <rharinath@novell.com>
13179 * cs-parser.jay: Fix several infelicities.
13180 - Avoid assigning to the parser value stack. Code like
13181 '$3 = null' is unclean. Synthesize a value for the code block
13183 - Avoid using oob_stack for storing location information. Use ...
13184 (_mark_): ... this. New (empty) rule. Saves the current location
13186 (foreach_statement): Avoid using oob_stack for current_block
13187 handling. Use technique used in for_statement and
13188 using_statement. Synthesize a value for the code block to store
13189 additional intermediate information.
13191 2005-01-13 Miguel de Icaza <miguel@ximian.com>
13193 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
13194 of a different type is only allowed to private fields of a
13195 containing type, not on fields of a base class.
13197 See test-174.cs and error cs0122-9.cs
13199 2005-01-13 Raja R Harinath <rharinath@novell.com>
13201 Fix test-335.cs (bug #58126).
13202 * cs-parser.jay (argument): Split out non-expression parts of the
13203 rule into 'non_simple_argument'.
13204 (invocation_expression): Support parenthesized invocations with
13205 multiple arguments, and with single non-simple arguments.
13207 2005-01-13 Raja R Harinath <rharinath@novell.com>
13209 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
13212 2005-01-12 Raja R Harinath <rharinath@novell.com>
13214 Fix cs0038-1.cs, cs1640-6.cs.
13215 * ecore.cs (Expression.Resolve): Remove special-case for
13216 SimpleName in error-handling.
13217 (Expression.almostMatchedMembers): Relax access permission to
13219 (Expression.MemberLookupFailed): Handle duplicates in
13220 almostMatchedMembers list.
13221 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
13222 * expression.cs (New.DoResolve): Report CS1540 for more cases.
13223 * typemanager.cs (GetFullNameSignature): Use the MethodBase
13224 overload if the passed in MemberInfo is a MethodBase.
13226 2005-01-12 Marek Safar <marek.safar@seznam.cz>
13229 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
13230 for non-CAS & merge permission sets properly.
13232 2005-01-11 Raja R Harinath <rharinath@novell.com>
13234 Improve standard-compliance of simple name and member access
13235 resolution. Fixes bugs #52697, #57200, #67520, #69519.
13236 * ecore.cs (FullNamedExpression): New abstract base class
13237 for Namespaces and TypeExpressions.
13238 (ResolveFlags.SimpleName): Remove.
13239 (SimpleName): Remove support for dotted names.
13240 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
13241 DeclSpace.FindType and DeclSpace.LookupType.
13242 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
13243 (Expression.ExprClassName): Make member function.
13244 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
13245 a namespace. Remove creation of dotted "SimpleName"s.
13246 (MemberAccess.DoResolve): Likewise.
13247 * decl.cs (DeclSpace.Cache): Make private.
13248 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
13249 (DeclSpace.FindType): Update.
13250 (DeclSpace.LookupType): Move here from RootContext. Return a
13251 FullNamedExpression.
13252 * namespace.cs (Namespace): Derive from FullNamedExpression
13253 so that it can be part of expression resolution.
13254 (Namespace.Lookup): Return an FullNamedExpression.
13255 (NamespaceEntry.LookupAlias): Lookup aliases only in current
13257 * rootcontext.cs (NamespaceLookup): Remove.
13258 (LookupType): Move to DeclSpace.
13259 * attribute.cs (CheckAttributeType): Update.
13260 * doc.cs (FindDocumentedType): Remove allowAlias argument.
13261 (FindDocumentedTypeNonArray): Likewise.
13263 2005-01-11 Raja R Harinath <rharinath@novell.com>
13265 Fix cs0509.cs, cs1632.cs.
13266 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
13267 is the same as IsInterface.
13268 (TypeContainer.GetClassBases): Likewise.
13269 * statement.cs (LabeledStatement.ig): New field.
13270 (LabeledStatement.LabelTarget): Save ILGenerator which created the
13272 (LabeledStatement.DoEmit): Check that the label was created with
13273 the same ILGenerator.
13275 2005-01-10 Marek Safar <marek.safar@seznam.cz>
13278 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
13279 accessors to its properties.
13281 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
13282 from accessors to property.
13284 2005-01-10 Marek Safar <marek.safar@seznam.cz>
13287 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
13288 only for overrides.
13290 2005-01-08 Miguel de Icaza <miguel@ximian.com>
13292 * attribute.cs: Check for null and empty strings.
13294 I have lost another battle to Paolo.
13296 2005-01-07 Marek Safar <marek.safar@seznam.cz>
13299 * class.cs (PropertyMethod): Set Parent field in ctors.
13300 (SetMethod.InternalParameters): Add unsafe switch hack.
13301 Override MarkForDuplicationCheck where it is appropriate.
13303 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
13304 It says whether container allows members with the same name.
13305 Base default is no.
13306 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
13307 Removed is_method parameter.
13309 2005-01-06 Duncan Mak <duncan@ximian.com>
13311 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
13312 because the previous change led to incorrect reporting of CS1032
13313 ("Cannot define/undefine preprocessor symbols after first token in
13314 file"). Instead of using `tokens_seen' as the only flag that
13315 triggers CS1040, introduce `comments_seen'. This new flag is used
13316 to signify having seen comments on the current line, so it is
13317 unset after a newline.
13319 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
13321 * doc.cs : When searching for a type, find nested type too.
13322 This fixes bug #71040.
13324 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
13327 - Warn missing member comment on those classes which also does not
13328 have doc comments. Fixed bug #71041.
13329 - Don't warn missing doc comment on default constructor.
13332 2005-01-06 Duncan Mak <duncan@ximian.com>
13334 * cs-tokenizer.cs (xtoken): After handling traditional C-style
13335 comments, set `tokens_seen' to true. This allows us to detect
13336 misplaced preprocessor directives (i.e. not at the beginning of
13337 the a line, nor after whitespaces). In that case, report error
13338 CS1040. This fixes bug #56460.
13340 * cs-parser.jay (interface_member_declaration): Add checks for
13341 IsExplicitImpl, and report CS0541 error if an interface member is
13342 defined as an explicit interface declaration.
13344 2005-01-06 Marek Safar <marek.safar@seznam.cz>
13347 * class.cs (PropertyMethod): Set Parent field in ctors.
13348 (SetMethod.InternalParameters): Add unsafe switch hack.
13350 * decl.cs (MemberCore.Parent): Cannot be readonly.
13352 2005-01-06 Raja R Harinath <rharinath@novell.com>
13354 * decl.cs (DeclSpace.ResolveType): Remove.
13355 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
13356 Merge in code from ...
13357 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
13358 * class.cs, enum.cs: Update to changes.
13360 2005-01-06 Miguel de Icaza <miguel@ximian.com>
13362 * anonymous.cs: Ensure that we init the scope of our parent if it
13363 has not been initialized yet.
13365 2004-12-30 Duncan Mak <duncan@ximian.com>
13367 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
13368 if field.FieldBuilder is null. Fixes #70758.
13370 * convert.cs: Fixed some typos and updated some of the comments.
13371 (ImplicitStandardConversionExists):
13372 (TryImplicitIntConversion): If `target_type' is an interface and
13373 the type of `ic' implements this interface, return true or a new
13374 BoxedCast instead of null. This fixes #70468.
13376 2004-12-29 Duncan Mak <duncan@ximian.com>
13378 * expression.cs (Argument.Emit): Check that Expr is
13379 IMemoryLocation before casting to it, and report CS1510 otherwise.
13383 2004-12-21 Ben Maurer <bmaurer@ximian.com>
13385 * statement.cs (Block.ThisVariable): remove the recursion here, to
13386 make the --profile more sane.
13388 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
13390 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
13391 assembly, by JB Evain.
13393 2004-12-17 Raja R Harinath <rharinath@novell.com>
13395 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
13396 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
13397 "parent" refers to enclosing type/class. "base" refers to superclass.
13399 2004-12-17 Raja R Harinath <rharinath@novell.com>
13401 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13402 Ensure that we only have GlobalAttributes.
13403 * attribute.cs (Attribute.Emit): Make non-virtual.
13404 (GlobalAttribute.Emit): Remove.
13405 (Attribute.Resolve): Make virtual.
13406 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
13407 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
13408 the argument. Don't create one.
13409 (Attribute.GetObsoleteAttribute): Likewise.
13410 (Attribute.GetClsCompliantAttributeValue): Likewise.
13411 * class.cs, decl.cs: Update to changes.
13413 2004-12-17 Marek Safar <marek.safar@seznam.cz>
13415 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
13417 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
13419 * statement.cs (Foreach.Resolve): Add error 186 report.
13421 2004-12-16 Marek Safar <marek.safar@seznam.cz>
13423 * expression.cs (Conditional.DoResolve): Add warning 429.
13425 * statement.cs (If.Resolve): Add warning 665.
13427 2004-12-16 Raja R Harinath <rharinath@novell.com>
13429 New invariant: RootContext.Tree.Types.NamespaceEntry == null
13430 except when in the parser, and in GlobalAttribute.
13431 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
13432 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
13433 RootContext.Tree.Types.NamespaceEntry once work is done.
13434 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
13435 and resets RootContext.Tree.Types.NamespaceEntry.
13437 2004-12-15 Marek Safar <marek.safar@seznam.cz>
13439 * cs-parser.jay: Don't create a block for every variable.
13441 2004-12-14 Miguel de Icaza <miguel@ximian.com>
13443 * location.cs: Provide extra information.
13445 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
13446 variables from the captured environment, it is the ldarg_0.
13448 2004-12-14 Marek Safar <marek.safar@seznam.cz>
13450 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
13453 * class.cs: Changed warning level for 169 to avoid developer
13454 displeasure from warning flooding. It will be changed back when they
13455 fix most of current BCL warnings.
13457 * RootContext.cs: Pushed default WarningLevel to 3.
13459 * statement.cs: Removed unused variable.
13461 2004-12-14 Marek Safar <marek.safar@seznam.cz>
13463 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
13464 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
13465 Add error 502 report.
13466 (StaticClass.DefineType): Add error 441 report.
13467 (Class.AllowedModifiersProp): New virtual property as temporary
13468 extension to AllowedModifiers.
13469 (Class.DefineType): Add error 418 report. Moved ModFlags check here
13470 to share implementation with StaticClass and don't call virtual
13473 * driver.cs (MainDriver): Add error 1558 test.
13475 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
13476 report. Moved error 36 test here.
13478 * statement.cs (Throw.Resolve): Add error 724 report.
13480 * typemanager.cs: Add out_attribute_type core type.
13482 2004-12-13 Marek Safar <marek.safar@seznam.cz>
13484 * class.cs (TypeContainer.VerifyClsCompliance): Add error
13486 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
13488 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
13491 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
13493 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
13494 Add error 3023 report.
13495 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
13497 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
13500 2004-12-12 John Luke <john.luke@gmail.com>
13502 * driver.cs (AddArgs): take -- into account when
13503 adding arguments, fixes bug 65710
13505 2004-12-12 Martin Baulig <martin@ximian.com>
13507 * expression.cs (Unary.TryReduceNegative): Added support for
13508 SByteConstant and ByteConstant.
13509 (Unary.Reduce): Check error values from TryReduceNegative().
13511 2004-12-10 Marek Safar <marek.safar@seznam.cz>
13513 * attributes.cs (Attribute.Resolve): Avoid multiple error report
13514 and report exception as error 182.
13516 2004-12-10 Raja R Harinath <rharinath@novell.com>
13518 * driver.cs (Main): Fix message when there are warnings.
13520 2004-12-09 Miguel de Icaza <miguel@ximian.com>
13522 * delegate.cs: Fixed my fix from yesterday, sorry about that.
13524 2004-12-09 Marek Safar <marek.safar@seznam.cz>
13526 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
13527 Reduced number of warnings.
13529 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
13531 2004-12-08 Miguel de Icaza <miguel@ximian.com>
13533 * driver.cs: Removed message.
13535 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
13537 2004-12-08 <vargaz@freemail.hu>
13539 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
13541 2004-12-08 Martin Baulig <martin@ximian.com>
13543 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
13544 instead of a CS3002 for properties and indexer.
13546 2004-12-08 Martin Baulig <martin@ximian.com>
13548 * decl.cs (MemberName.ToString): Make this work again.
13550 2004-12-08 Marek Safar <marek.safar@seznam.cz>
13552 * attribute.cs (Resolve): Add error 591 detection.
13554 * class.cs (FieldMember.Define): Add error 1547 detection.
13555 (Indexer.Define): Add error 620 detection.
13556 (Operator.Define): Add error 590 detection.
13558 * ecore.cs: Missing argument for error 79.
13560 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
13563 2004-12-07 Marek Safar <marek.safar@seznam.cz>
13566 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
13569 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
13571 * cs-parser.jay : handle doc comments on implicit/explicit operators.
13572 Some operator comments were suppressed.
13573 * doc.cs : Implicit/explicit operator name in doc comments are like
13574 "op_Explicit(type)~returnType", so added suffix handling.
13576 2004-12-07 Martin Baulig <martin@ximian.com>
13579 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
13580 (MemberCore.GetClsCompliantAttributeValue): Likewise.
13581 (DeclSpace.ec): New protected field; store the EmitContext here.
13582 (DeclSpace.EmitContext): New public property; moved here from
13584 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
13587 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
13588 (Enum.Emit): Don't create a new EmitContext.
13590 * delegate.cs (Delegate.DefineType): Always create the
13593 * iterators.cs (Iterators.DefineIterator): Create a new
13594 EmitContext and store it in `ec'.
13596 2004-08-24 Martin Baulig <martin@ximian.com>
13599 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
13600 this for accessibility checks.
13601 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
13602 IsNestedFamilyAccessible.
13603 (TypeManager.IsSubclassOf): New method, do what the name actually
13606 2004-12-06 Raja R Harinath <rharinath@novell.com>
13608 Fix crash on cs0657-17.cs.
13609 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13610 Use RootContext.Tree.Types, not 'new RootTypes ()'.
13611 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
13612 the case where the NamespaceEntry gets overwritten.
13614 2004-12-06 Marek Safar <marek.safar@seznam.cz>
13616 Fixed #69195, #56821
13617 * ecore.cs (ResolveBoolean): Tiny refactoring.
13619 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
13620 of right expression resolving when left is false constant and
13621 operator is LogicalAnd OR true constant and operator is LogicalOr.
13623 * statement.cs (ResolveUnreachable): Always reports warning.
13625 2004-12-05 Miguel de Icaza <miguel@ximian.com>
13627 * class.cs: Distinguish between 1721 and 1722 (just a little help
13628 for the programmer).
13630 2004-12-03 Miguel de Icaza <miguel@ximian.com>
13632 * delegate.cs: Only allow this on new versions of the language.
13634 2004-12-02 Duncan Mak <duncan@ximian.com>
13636 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
13638 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
13639 here as a static method. Take an additional bool out parameter
13640 `must_do_cs1540_check' for signaling to InstanceResolve.
13641 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
13642 member field from PropertyExpr class and made it an argument of
13643 the method instead.
13644 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
13645 check for MarshalByRefObject, and report CS0122 instead of CS1540.
13646 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
13647 and `remove_accessor' as well as InstanceResolve: report CS0122
13652 2004-12-03 Raja R Harinath <rharinath@novell.com>
13654 Fix test-327.cs, test-328.cs, and put in early infrastructure
13655 for eventually fixing #52697.
13656 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
13657 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
13658 from other methods.
13659 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
13660 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
13661 (VerifyUsing, error246): Update.
13662 * rootcontext.cs (RootContext.NamespaceLookup): Just use
13663 'NamespaceEntry.LookupNamespaceOrType'.
13665 2004-12-03 Martin Baulig <martin@ximian.com>
13667 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13668 method as our child, call AnonymousMethod.Compatible() on it.
13670 2004-12-03 Raja R Harinath <rharinath@novell.com>
13672 Disable XML documentation support in 'basic' profile.
13673 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
13674 Redirect XmlElement to System.Object.
13675 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
13676 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
13677 * mcs.exe.sources: Add doc-bootstrap.cs.
13678 * doc-bootstrap.cs: New file. Contains empty stub implementation
13681 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
13683 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
13684 comments are allowed.
13686 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
13688 * delegate.cs: Add checks for subtypes in paramaters and return values
13689 in VerifyMethod () to add support for Covariance/Contravariance
13692 2004-12-02 Miguel de Icaza <miguel@ximian.com>
13694 * report.cs: Remove extra closing parenthesis.
13696 * convert.cs (Error_CannotImplicitConversion): If the name of the
13697 types are the same, provide some extra information.
13699 * class.cs (FieldBase): Use an unused bit field from the field to
13700 encode the `has_offset' property from the FieldMember. This saves
13701 a couple of Ks on bootstrap compilation.
13703 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13704 method as our child, return the AnonymousMethod resolved
13707 * expression.cs (New.DoResolve): Allow return values from
13708 NewDelegate to also include AnonymousMethods.
13712 2004-12-02 Marek Safar <marek.safar@seznam.cz>
13715 * attribute.cs (Resolve): Improved implementation of params
13716 attribute arguments.
13718 * support.cs (ParameterData): Add HasParams to be faster.
13720 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
13722 all things are for /doc support:
13724 * doc.cs: new file that supports XML documentation generation.
13725 * mcs.exe.sources: added doc.cs.
13727 Handle /doc command line option.
13728 Report error 2006 instead of 5 for missing file name for /doc.
13729 Generate XML documentation when required, after type resolution.
13731 Added support for picking up documentation (/// and /** ... */),
13732 including a new XmlCommentState enumeration.
13734 Added lines to fill Documentation element for field, constant,
13735 property, indexer, method, constructor, destructor, operator, event
13736 and class, struct, interface, delegate, enum.
13737 Added lines to warn incorrect comment.
13739 Added Documentation field (passed only when /doc was specified).
13741 Added DocComment, DocCommentHeader, GenerateDocComment() and
13742 OnGenerateDocComment() and some supporting private members for
13743 /doc feature to MemberCore.
13745 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
13747 Added overriden DocCommentHeader.
13749 Added overriden DocCommentHeader and GenerateDocComment().
13751 2004-12-01 Miguel de Icaza <miguel@ximian.com>
13753 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
13754 unwrapping the enumeration values, chain to
13755 DoConstantNumericPromotions again, so we can promote things to the
13756 fundamental types (takes care of enums that are bytes, sbytes).
13760 2004-12-01 Raja R Harinath <rharinath@novell.com>
13762 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
13763 Fix long-standing bug in type-lookup. Use FindType instead of
13764 LookupType when ec.ResolvingTypeTree.
13765 (Attribute.ResolveType, Attribute.Resolve)
13766 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
13768 (Attributes.Search): Remove internal version. Update.
13769 (Attributes.SearchMulti): Update.
13770 (Attributes.GetClsCompliantAttribute): Remove.
13771 (Attributes.GetIndexerNameAttribute): Remove.
13772 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
13773 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
13774 * class.cs (Indexer.Define): Likewise.
13776 2004-12-01 Marek Safar <marek.safar@seznam.cz>
13779 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
13780 MarshallByReference members access.
13782 * expression.cs: Use CheckMarshallByRefAccess;
13783 Better error CS0197 message.
13785 * report.cs: Print whole related error message.
13787 2004-11-30 Raja R Harinath <rharinath@novell.com>
13789 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
13790 the current directory to help debugging.
13792 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13794 * class (GetClassBases): Better error 60 report.
13795 (EventProperty): Disabled warning 67 detection.
13797 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13800 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
13802 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
13805 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13808 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
13810 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
13812 2004-11-26 Miguel de Icaza <miguel@ximian.com>
13814 * attribute.cs (Attribute.Resolve): Refine error reporting and
13815 report a cs0117 if the identifier does not exist, to distinguish
13816 from 0617 which is a miss-use of the actual identifier.
13818 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
13819 between cs0070 and cs0079.
13821 * class.cs (MemberBase.DoDefine): When reporting a wrong
13822 accessibility level, we use MethodCore to compare instead of
13823 Method (this was a regression in some refactoring effort).
13825 So now we correctly report cs0056 again.
13827 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
13828 testing the target_type (which was known to be object_type) and
13829 not the source type (which is anonymous_method).
13831 Fixed reporting of error cs1660.
13833 * expression.cs (UserCast.Source): Expose the underlying cast.
13835 * statement.cs (Switch.SwitchGoverningType): Sort the list of
13836 allowed types to find a match to int32 first (most common).
13838 In addition, it ignores any ImplicitUserConversions that did an
13839 internal implicit conversion (as the switch statement allows only
13840 one integral conversion to exist).
13842 * class.cs (PartialContainer.Create): rename `name' to
13843 `member_name' for clarity. Then replace the string calls with a
13844 call to MemberName.GetPartialName, as now using
13845 MemberName.ToString is an error (this is due to the side effects
13846 it had, that were fixed in the past).
13848 This will restore the error reporting on a number of partial class
13849 errors that were missusing this (and getting an exception as a
13850 results, which is now just a plain textual warning, because
13851 yyparse debug output would crash otherwise).
13853 2004-11-26 Raja R Harinath <rharinath@novell.com>
13855 * Makefile (PROGRAM_INSTALL_DIR): Remove.
13857 2004-11-25 Ben Maurer <bmaurer@ximian.com>
13859 * rootcontext.cs (LookupType): Make sure to cache lookups that
13860 don't give us a negative result. This saves about 5% of corlib
13863 2004-11-25 Miguel de Icaza <miguel@ximian.com>
13865 * report.cs (AbstractMessage.Print): messages are sent to stderr
13867 * class.cs (TypeContainer.GetClassBases): It is an error to have a
13868 non-interface in the list of interfaces (at this point, either
13869 parent was properly set, or a base class is being listed in the
13870 interfaces section).
13872 This flags error 1722, and resolves the crash from bug 69259.
13874 2004-11-25 Ben Maurer <bmaurer@ximian.com>
13876 * statement.cs (Using.EmitExpressionFinally): make this work right
13877 for valuetypes. Fixes 69926.
13879 2004-11-25 Miguel de Icaza <miguel@ximian.com>
13881 * const.cs (Const.ChangeType): Cope with the "0 literal can be
13882 converted to an enum" here, before we try to change the underlying
13883 type. This code exists, but it is a different code path than the
13884 one used while encoding constants.
13886 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
13887 old bug: when converting from the null literal to a pointer,
13888 return an EmptyCast, not the NullLiteral.
13890 This fixes #69921, the recent null_type changes probably made this
13891 bug more prominent.
13893 (ImplicitReferenceConversionExists): In addition, resynchronized
13894 the code here, so it matches the same code in
13895 ImplicitReferenceConversionExists for the `from any class-type S
13896 to any interface-type T'.
13899 2004-11-25 Marek Safar <marek.safar@seznam.cz>
13901 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
13903 2004-11-24 Miguel de Icaza <miguel@ximian.com>
13905 * cs-parser.jay: Use verbosity accordingly.
13907 2004-11-24 Marek Safar <marek.safar@seznam.cz>
13909 * expression.cs (Unary.ResolveOperator): Do not report warning;
13910 AddressOf reads from variable.
13912 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
13914 2004-11-24 Marek Safar <marek.safar@seznam.cz>
13918 * attribute.cs (Attributable): Removed CheckTargets.
13919 (Attributes.Emit): Explicit attribute targets are tested here.
13921 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
13922 not enabled for interfaces.
13924 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
13925 (GetAssemblyName): Ouch next bug there.
13927 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
13929 * expression.cs: Error 275 added.
13931 2004-11-23 Marek Safar <marek.safar@seznam.cz>
13933 Fix bug #69177 (Implemented decimal constant support)
13935 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
13936 (BinaryFold): Add DecimalConstant.
13938 * const.cs (Define): Decimal constant
13940 (ChangeType): Add decimal type handling.
13941 (LookupConstantValue): Don't set value for decimal type but
13942 emit DecimalConstantAttribute. Needed for constant optimization.
13944 * constant.cs (ToDecimal): New method.
13945 (ConvertToDecimal): New method.
13946 (IntConstant): Implemented ConvertToDecimal.
13947 (DecimalConstant.Emit): Emit optimized version for decimals in
13950 * expression.cs (ResolveOperator): Changed order of constant
13951 reduction to work correctly with native types which have
13952 overloaded operators.
13953 (ResolveMemberAccess): Extract constant value from attribute
13956 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
13958 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
13959 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
13960 (ChangeType): Decimal is special.
13961 (TypeToCoreType): Add decimal type.
13963 2004-11-22 Marek Safar <marek.safar@seznam.cz>
13965 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
13968 2004-11-22 Marek Safar <marek.safar@seznam.cz>
13970 * class.cs (EventField.ApplyAttributeBuilder): Fix error
13973 2004-11-19 Marek Safar <marek.safar@seznam.cz>
13975 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
13977 * pending.cs (PendingImplementation): Grab only interfaces.
13979 2004-11-19 Marek Safar <marek.safar@seznam.cz>
13981 * statement.cs (ForeachHelperMethods): Add location member and
13982 error 202 detection.
13984 2004-11-19 Raja R Harinath <rharinath@novell.com>
13986 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
13987 automatically handled by executable.make.
13988 (PROGRAM): Make profile-specific.
13990 2004-11-18 Marek Safar <marek.safar@seznam.cz>
13992 * expression.cs (DoResolveBase): Fixed wrong warning for out
13995 2004-11-18 Martin Baulig <martin@ximian.com>
13997 Merged latest changes into gmcs. Please keep this comment in
13998 here, it makes it easier for me to see what changed in MCS since
13999 the last time I merged.
14001 2004-11-17 Raja R Harinath <rharinath@novell.com>
14003 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
14004 (TypeHandle.GetMemberCache): New.
14005 (TypeHandle.TypeHandle): Update.
14006 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
14007 (TypeManager.LookupParentInterfacesCache):
14008 Rename from LookupInterfaceCache. Optimize slightly.
14009 (TypeManager.MemberLookup_FindMembers): Update.
14010 * decl.cs (MemberCache.MemberCache): Set Container to null in the
14011 multi-type variant.
14012 (AddCacheContents): Rename from AddHashtable.
14013 * class.cs (TypeContainer.parent_container): Remove.
14014 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
14015 (TypeContainer.DoDefineMembers): Don't initialize it.
14016 Update to name changes.
14018 2004-11-17 Miguel de Icaza <miguel@ximian.com>
14020 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
14021 that factors the code to check access modifiers on override.
14023 (PropertyBase): Use the code here.
14025 Patch from Lluis S'anchez, fixes bug #69361.
14027 2004-11-15 Miguel de Icaza <miguel@ximian.com>
14029 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
14030 routine that is used to report the use of a captured variable
14031 whose address has been taken.
14033 There are two checks: one when variables are being captured and
14034 the other check is when the address of a variable is taken.
14036 (because an anonymous methods might be resolved before *or* after
14037 the address has been taken) and
14039 * expression.cs (Conditional.DoResolve): Remove the special
14040 casing that Martin added to trueExpr and falseExpr being both
14041 NullLiteral. We get the right behavior now just by introducing
14042 the null_type into the compiler.
14044 * convert.cs (ExplicitConversion): Change the code to use
14045 null_type instead of testing `expr is NullLiteral'.
14046 (ImplicitConversionStandard): use null_type too.
14047 (ImplicitReferenceConversionExists): use null_type too.
14048 (ImplicitReferenceConversion): use null_type too.
14050 * literal.cs: The type of `NullLiteral' is now null_type instead
14052 (Resolve): Set the type here.
14054 * typemanager.cs: Introduce null_type.
14056 2004-11-17 Martin Baulig <martin@ximian.com>
14058 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
14059 direction, like FindMembers() does. Fixes #69546, testcase is in
14062 2004-11-16 Martin Baulig <martin@ximian.com>
14064 This is based on a patch from Marek Safar, see bug #69082.
14065 Fixes bugs #63705 and #67130.
14067 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
14068 method; create a MemberCache for an interface type and cache the
14071 * decl.cs (IMemberContainer.ParentContainer): Removed.
14072 (IMemberContainer.ParentCache): New property.
14073 (MemberCache.SetupCacheForInterface): Removed.
14074 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
14075 to create a cache for an interface's "parent".
14077 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
14080 2004-11-16 Martin Baulig <martin@ximian.com>
14082 Merged back from gmcs; these changes already went into gmcs a
14083 couple of weeks ago.
14086 (TypeManager.AddUserType): Removed the `ifaces' argument.
14087 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
14089 (TypeManager.AddUserInterface): Removed.
14090 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
14092 (TypeManager.GetInterfaces): Likewise.
14093 (TypeManager.GetExplicitInterfaces): Likewise.
14095 * ecore.cs (TypeExpr.GetInterfaces): Removed.
14097 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
14098 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
14100 2004-11-14 Ben Maurer <bmaurer@ximian.com>
14102 * statement.cs: Avoid adding bools to a hashtable.
14104 2004-11-07 Miguel de Icaza <miguel@ximian.com>
14106 * expression.cs (Invocation.OverloadResolve): Flag error if we are
14107 calling an unsafe method from a safe location.
14109 2004-11-06 Marek Safar <marek.safar@seznam.cz>
14112 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
14114 2004-11-06 Miguel de Icaza <miguel@ximian.com>
14116 * namespace.cs (VerifyUsing): use GetPartialName instead of
14119 2004-11-05 Miguel de Icaza <miguel@ximian.com>
14121 * statement.cs (Return.Resolve): Fix regression in typo: if
14122 `in_exc', we have to request a NeedReturnLabel, this was a typo
14123 introduced in the anonymous method check-in. Fixes #69131.
14125 * Indexers were using the ShortName when defining themselves,
14126 causing a regression in the compiler bootstrap when applying the
14127 patch from 2004-11-02 (first part), now they use their full name
14128 and the bug is gone.
14130 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
14132 * driver.cs: Strip the path from the names of embedded resources. Fixes
14135 2004-11-04 Raja R Harinath <rharinath@novell.com>
14137 Fix error message regression: cs0104-2.cs.
14138 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
14139 (AliasEntry.Resolve): Update.
14140 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
14142 (RootContext.LookupType): Update.
14144 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
14146 * cs-parser.jay: Add support for handling accessor modifiers
14147 * class: Add support port accessor modifiers and error checking,
14148 define PropertyMethod.Define as virtual (not abstract anymore)
14149 * ecore.cs: Add checking for proeprties access with access modifiers
14150 * iterators.cs: Modify Accessor constructor call based in the modified
14152 2004-11-02 Ben Maurer <bmaurer@ximian.com>
14154 * expression.cs (StringConcat): Handle being called twice,
14155 as when we have a concat in a field init with more than two
14158 2004-11-02 Miguel de Icaza <miguel@ximian.com>
14160 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
14161 special case explicit implementations, we should always produce
14162 the .property or .event declaration.
14164 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
14165 since it will not return correct data if people use this
14166 unresolved in the presence of using statements (see test-313).
14168 * class.cs (MethodData.Define): If we are an explicit interface
14169 implementation, set the method name to the full name of the
14170 interface plus the name of the method.
14172 Notice that using the method.MethodName.GetFullName() does not
14173 work, as it will only contain the name as declared on the source
14174 file (it can be a shorthand in the presence of using statements)
14175 and not the fully qualifed type name, for example:
14179 class D : ICloneable {
14180 object ICloneable.Clone () {
14184 Would produce a method called `ICloneable.Clone' instead of
14185 `System.ICloneable.Clone'.
14187 * namespace.cs (Alias.Resolve): Use GetPartialName.
14189 2004-11-01 Marek Safar <marek.safar@seznam.cz>
14191 * cs-parser.jay: Add error 1055 report.
14193 2004-11-01 Miguel de Icaza <miguel@ximian.com>
14195 * assign.cs (Assign.DoResolve): Only do the transform of
14196 assignment into a New if the types are compatible, if not, fall
14197 through and let the implicit code deal with the errors and with
14198 the necessary conversions.
14200 2004-11-01 Marek Safar <marek.safar@seznam.cz>
14202 * cs-parser.jay: Add error 1031 report.
14204 * cs-tokenizer.cs: Add location for error 1038.
14206 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14208 * cs-parser.jay: Add error 1016 report.
14210 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14212 * cs-parser.jay: Add errors 1575,1611 report.
14214 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14216 * cs-parser.jay: Add error 1001 report.
14218 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14221 * attribute.cs (GetMarshal): Add method argument for
14222 caller identification.
14224 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
14225 agument for GetMarshal and RuntimeMissingSupport.
14227 2004-10-31 Marek Safar <marek.safar@seznam.cz>
14229 * attribute.cs (ExtractSecurityPermissionSet): Removed
14230 TypeManager.code_access_permission_type.
14232 * typemanager.cs: Removed TypeManager.code_access_permission_type.
14234 2004-10-27 Miguel de Icaza <miguel@ximian.com>
14236 * expression.cs (LocalVariableReference.DoResolveLValue): Check
14237 for obsolete use of a variable here. Fixes regression on errors
14238 cs0619-25 and cs0619-26.
14240 2004-10-27 Marek Safar <marek.safar@seznam.cz>
14242 Fix #62358, implemented security attribute encoding.
14244 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
14245 Tests permitted SecurityAction for assembly or other types.
14246 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
14247 data from SecurityPermissionAttribute to PermisionSet class.
14249 * class.cs (ApplyAttributeBuilder): Added special handling
14250 for System.Security.Permissions.SecurityAttribute based types.
14252 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
14253 special handling for System.Security.Permissions.SecurityAttribute
14256 * enum.cs (ApplyAttributeBuilder): Added special handling
14257 for System.Security.Permissions.SecurityAttribute based types.
14259 * parameter.cs (ApplyAttributeBuilder): Added special handling
14260 for System.Security.Permissions.SecurityAttribute based types.
14262 * rootcontext.cs: Next 2 core types.
14264 * typemanager.cs (TypeManager.security_permission_attr_type):
14265 Built in type for the SecurityPermission Attribute.
14266 (code_access_permission_type): Build in type.
14268 2004-10-17 Miguel de Icaza <miguel@ximian.com>
14270 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
14271 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
14272 all of this information into
14273 EmitContext.EmitCapturedVariableInstance.
14275 * codegen.cs (EmitCapturedVariableInstance): move here the
14276 funcionality of emitting an ldarg.0 in the presence of a
14277 remapping. This centralizes the instance emit code.
14279 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
14280 then emit a load of this: it means that we have reached the
14281 topmost ScopeInfo: the one that contains the pointer to the
14282 instance of the class hosting the anonymous method.
14284 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
14285 captures to the topmost CaptureContext.
14287 2004-10-12 Miguel de Icaza <miguel@ximian.com>
14289 * expression.cs (LocalVariableReference): Move the knowledge about
14290 the iterators into codegen's EmitCapturedVariableInstance.
14292 2004-10-11 Miguel de Icaza <miguel@ximian.com>
14294 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
14295 all code paths return a value from an anonymous method (it is the
14296 same as the 161 error, but for anonymous methods).
14298 2004-10-08 Miguel de Icaza <miguel@ximian.com>
14300 The introduction of anonymous methods in the compiler changed
14301 various ways of doing things in the compiler. The most
14302 significant one is the hard split between the resolution phase
14303 and the emission phases of the compiler.
14305 For instance, routines that referenced local variables no
14306 longer can safely create temporary variables during the
14307 resolution phase: they must do so from the emission phase,
14308 since the variable might have been "captured", hence access to
14309 it can not be done with the local-variable operations from the runtime.
14313 (Block.Flags): New flag `IsTopLevel' to indicate that this block
14314 is a toplevel block.
14316 (ToplevelBlock): A new kind of Block, these are the blocks that
14317 are created by the parser for all toplevel method bodies. These
14318 include methods, accessors and anonymous methods.
14320 These contain some extra information not found in regular blocks:
14321 A pointer to an optional CaptureContext (for tracking captured
14322 local variables and parameters). A pointer to the parent
14325 (Return.Resolve): Catch missmatches when returning a value from an
14326 anonymous method (error 1662).
14327 Invoke NeedReturnLabel from the Resolve phase instead of the emit
14330 (Break.Resolve): ditto.
14332 (SwitchLabel): instead of defining the labels during the
14333 resolution phase, we now turned the public ILLabel and ILLabelCode
14334 labels into methods called GetILLabelCode() and GetILLabel() that
14335 only define the label during the Emit phase.
14337 (GotoCase): Track the SwitchLabel instead of the computed label
14338 (its contained therein). Emit the code by using
14339 SwitchLabel.GetILLabelCode ().
14341 (LocalInfo.Flags.Captured): A new flag has been introduce to track
14342 whether the Local has been captured or not.
14344 (LocalInfo.IsCaptured): New property, used to tell whether the
14345 local has been captured.
14347 * anonymous.cs: Vastly updated to contain the anonymous method
14350 The main classes here are: CaptureContext which tracks any
14351 captured information for a toplevel block and ScopeInfo used to
14352 track the activation frames for various local variables.
14354 Each toplevel block has an optional capture context associated
14355 with it. When a method contains an anonymous method both the
14356 toplevel method and the anonymous method will create a capture
14357 context. When variables or parameters are captured, they are
14358 recorded on the CaptureContext that owns them, for example:
14362 MyDelegate d = delegate {
14367 Here `a' will be recorded as captured on the toplevel
14368 CapturedContext, the inner captured context will not have anything
14369 (it will only have data if local variables or parameters from it
14370 are captured in a nested anonymous method.
14372 The ScopeInfo is used to track the activation frames for local
14373 variables, for example:
14375 for (int i = 0; i < 10; i++)
14376 for (int j = 0; j < 10; j++){
14377 MyDelegate d = delegate {
14382 At runtime this captures a single captured variable `i', but it
14383 captures 10 different versions of the variable `j'. The variable
14384 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
14385 recorded on a child.
14387 The toplevel ScopeInfo will also track information like the `this'
14388 pointer if instance variables were referenced (this is necessary
14389 as the anonymous method lives inside a nested class in the host
14390 type of the method).
14392 (AnonymousMethod): Expanded to track the Toplevel, implement
14393 `AnonymousMethod.Compatible' to tell whether an anonymous method
14394 can be converted to a target delegate type.
14396 The routine now also produces the anonymous method content
14398 (AnonymousDelegate): A helper class that derives from
14399 DelegateCreation, this is used to generate the code necessary to
14400 produce the delegate for the anonymous method that was created.
14402 * assign.cs: API adjustments for new changes in
14403 Convert.ImplicitStandardConversionExists.
14405 * class.cs: Adjustments to cope with the fact that now toplevel
14406 blocks are of type `ToplevelBlock'.
14408 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
14409 insteda of standard blocks.
14411 Flag errors if params arguments are passed to anonymous methods.
14413 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
14414 `CurrentAnonymousMethod' which points to the current Anonymous
14415 Method. The variable points to the AnonymousMethod class that
14416 holds the code being compiled. It is set in the new EmitContext
14417 created for the anonymous method.
14419 (EmitContext.Phase): Introduce a variable and an enumeration to
14420 assist in enforcing some rules about when and where we are allowed
14421 to invoke certain methods (EmitContext.NeedsReturnLabel is the
14422 only one that enfonces this right now).
14424 (EmitContext.HaveCaptureInfo): new helper method that returns
14425 whether we have a CapturedContext initialized.
14427 (EmitContext.CaptureVariable): New method used to register that a
14428 LocalInfo must be flagged for capturing.
14430 (EmitContext.CapturedParameter): New method used to register that a
14431 parameters must be flagged for capturing.
14433 (EmitContext.CapturedField): New method used to register that a
14434 field must be flagged for capturing.
14436 (EmitContext.HaveCapturedVariables,
14437 EmitContext.HaveCapturedFields): Return whether there are captured
14438 variables or fields.
14440 (EmitContext.EmitMethodHostInstance): This is used to emit the
14441 instance for the anonymous method. The instance might be null
14442 (static methods), this (for anonymous methods that capture nothing
14443 and happen to live side-by-side with the current method body) or a
14444 more complicated expression if the method has a CaptureContext.
14446 (EmitContext.EmitTopBlock): Routine that drives the emission of
14447 code: it will first resolve the top block, then emit any metadata
14448 and then emit the code. The split is done so that we can extract
14449 any anonymous methods and flag any captured variables/parameters.
14451 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
14452 during this phase, the ILGenerator should not be used as labels
14453 and local variables declared here might not be accessible to any
14454 code that is part of an anonymous method.
14456 Exceptions to this include the temporary variables that are
14457 created by some statements internally for holding temporary
14460 (EmitContext.EmitMeta): New routine, in charge of emitting all the
14463 (EmitContext.TemporaryReturn): This method is typically called
14464 from the Emit phase, and its the only place where we allow the
14465 ReturnLabel to be defined other than the EmitMeta. The reason is
14466 that otherwise we would have to duplicate a lot of logic in the
14467 Resolve phases of various methods that today is on the Emit
14470 (EmitContext.NeedReturnLabel): This no longer creates the label,
14471 as the ILGenerator is not valid during the resolve phase.
14473 (EmitContext.EmitThis): Extended the knowledge in this class to
14474 work in anonymous methods in addition to iterators.
14476 (EmitContext.EmitCapturedVariableInstance): This emits whatever
14477 code is necessary on the stack to access the instance to a local
14478 variable (the variable will be accessed as a field).
14480 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
14481 EmitContext.EmitAddressOfParameter): Routines to support
14482 parameters (not completed at this point).
14484 Removals: Removed RemapLocal and RemapLocalLValue. We probably
14485 will also remove the parameters.
14487 * convert.cs (Convert): Define a `ConstantEC' which points to a
14488 null. This is just to prefity some code that uses
14489 ImplicitStandardConversion code and do not have an EmitContext
14492 The idea is to flag explicitly that at that point in time, it is
14493 known that the conversion will not trigger the delegate checking
14494 code in implicit conversions (which requires a valid
14497 Everywhere: pass new EmitContext parameter since
14498 ImplicitStandardConversionExists now requires it to check for
14499 anonymous method conversions.
14501 (Convert.ImplicitStandardConversionExists): If the type of an
14502 expression is the anonymous_method_type, and the type is a
14503 delegate, we invoke the AnonymousMethod.Compatible method to check
14504 whether an implicit conversion is possible.
14506 (Convert.ImplicitConversionStandard): Only do implicit method
14507 group conversions if the language level is not ISO_1.
14509 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
14510 MethodInfo for the Invoke method. used by Delegate and
14513 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
14514 method conversions if the target type is a delegate.
14516 Removed extra debugging nops.
14518 (LocalVariableReference): Turn the `local_info' into a public
14521 Add `prepared' field, the same hack used for FieldExprs to cope
14522 with composed assignments, as Local variables do not necessarily
14523 operate purely on the stack as they used to: they can be captured
14526 Add `temp' for a temporary result, like fields.
14528 Refactor DoResolve and DoResolveLValue into DoResolveBase.
14530 It now copes with Local variables that are captured and emits the
14531 proper instance variable to load it from a field in the captured
14534 (ParameterReference.DoResolveBase): During the resolve phase,
14535 capture parameters if we are in an anonymous method.
14537 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
14538 anonymous method, use the EmitContext helper routines to emit the
14539 parameter reference.
14541 * iterators.cs: Set RemapToProxy to true/false during the
14544 * parameters.cs (GetParameterByName): New helper method.
14546 * typemanager.cs (anonymous_method_type) a new type that
14547 represents an anonyous method. This is always an internal type,
14548 used as a fencepost to test against the anonymous-methodness of an
14551 2004-10-20 Marek Safar <marek.safar@seznam.cz>
14553 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
14555 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
14557 2004-10-18 Martin Baulig <martin@ximian.com>
14559 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
14560 `Type' directly, but call ResolveType() on it.
14561 (Catch.Resolve): Likewise.
14562 (Foreach.Resolve): Likewise.
14564 2004-10-18 Martin Baulig <martin@ximian.com>
14566 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
14567 `Type' directly, but call ResolveType() on it.
14568 (Probe.DoResolve): Likewise.
14569 (ArrayCreation.LookupType): Likewise.
14570 (TypeOf.DoResolve): Likewise.
14571 (SizeOf.DoResolve): Likewise.
14573 2004-10-18 Martin Baulig <martin@ximian.com>
14575 * expression.cs (Invocation.BetterFunction): Put back
14576 TypeManager.TypeToCoreType().
14578 2004-10-18 Raja R Harinath <rharinath@novell.com>
14580 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
14583 2004-10-18 Martin Baulig <martin@ximian.com>
14585 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
14586 `Type' directly, but call ResolveType() on it.
14588 2004-10-18 Martin Baulig <martin@ximian.com>
14590 * class.cs (FieldMember.Define): Don't access the TypeExpr's
14591 `Type' directly, but call ResolveType() on it.
14592 (MemberBase.DoDefine): Likewise.
14594 * expression.cs (New.DoResolve): Don't access the TypeExpr's
14595 `Type' directly, but call ResolveType() on it.
14596 (ComposedCast.DoResolveAsTypeStep): Likewise.
14598 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
14599 `Type' directly, but call ResolveType() on it.
14601 2004-10-17 John Luke <john.luke@gmail.com>
14603 * class.cs (Operator.GetSignatureForError): use CSharpName
14605 * parameter.cs (Parameter.GetSignatureForError): Returns
14606 correct name even if was not defined.
14608 2004-10-13 Raja R Harinath <rharinath@novell.com>
14611 * class.cs (TypeContainer.EmitContext): New property.
14612 (DefineNestedTypes): Create an emitcontext for each part.
14613 (MethodCore.DoDefineParameters): Use container's emitcontext.
14614 Pass type array to InternalParameters.
14615 (MemberBase.DoDefine): Use container's emitcontext.
14616 (FieldMember.Define): Likewise.
14617 (Event.Define): Likewise.
14618 (SetMethod.GetParameterInfo): Change argument to EmitContext.
14619 Pass type array to InternalParameters.
14620 (SetIndexerMethod.GetParameterInfo): Likewise.
14621 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
14622 * delegate.cs (Define): Pass emitcontext to
14623 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
14624 array to InternalParameters.
14625 * expression.cs (ParameterReference.DoResolveBase): Pass
14626 emitcontext to GetParameterInfo.
14627 (ComposedCast.DoResolveAsTypeStep): Remove check on
14628 ec.ResolvingTypeTree.
14629 * parameter.cs (Parameter.Resolve): Change argument to
14630 EmitContext. Use ResolveAsTypeTerminal.
14631 (Parameter.GetSignature): Change argument to EmitContext.
14632 (Parameters.ComputeSignature): Likewise.
14633 (Parameters.ComputeParameterTypes): Likewise.
14634 (Parameters.GetParameterInfo): Likewise.
14635 (Parameters.ComputeAndDefineParameterTypes): Likewise.
14636 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
14637 * support.cs (InternalParameters..ctor): Remove variant that takes
14639 * typemanager.cs (system_intptr_expr): New.
14640 (InitExpressionTypes): Initialize it.
14642 2004-10-12 Chris Toshok <toshok@ximian.com>
14644 * cs-parser.jay: fix location for try_statement and catch_clause.
14646 2004-10-11 Martin Baulig <martin@ximian.com>
14648 * report.cs: Don't make --fatal abort on warnings, we have
14649 -warnaserror for that.
14651 2004-10-07 Raja R Harinath <rharinath@novell.com>
14653 More DeclSpace.ResolveType avoidance.
14654 * decl.cs (MemberCore.InUnsafe): New property.
14655 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
14656 with newly created EmitContext.
14657 (FieldMember.Define): Likewise.
14658 * delegate.cs (Delegate.Define): Likewise.
14659 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
14660 only if normal name-lookup fails.
14661 (TypeExpr.DoResolve): Enable error-checking.
14662 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
14663 (SizeOf.DoResolve): Likewise.
14664 (ComposedCast.DoResolveAsTypeStep): Likewise.
14665 (StackAlloc.DoResolve): Likewise.
14666 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
14667 (Block.Unsafe): New property.
14668 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
14669 (Unsafe): Set 'unsafe' flag of contained block.
14670 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
14671 (Fixed.Resolve): Likewise.
14672 (Catch.Resolve): Likewise.
14673 (Using.ResolveLocalVariableDecls): Likewise.
14674 (Foreach.Resolve): Likewise.
14676 2004-10-05 John Luke <john.luke@gmail.com>
14678 * cs-parser.jay: add location to error CS0175
14680 2004-10-04 Miguel de Icaza <miguel@ximian.com>
14682 * ecore.cs (Expression.Constantity): Add support for turning null
14685 * const.cs (Const.Define): Allow constants to be reference types
14686 as long as the value is Null.
14688 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
14690 * namespace.cs (NamespaceEntry.Using): No matter which warning
14691 level is set, check if this namespace name has already been added.
14693 2004-10-03 Ben Maurer <bmaurer@ximian.com>
14695 * expression.cs: reftype [!=]= null should always use br[true,false].
14698 2004-10-03 Marek Safar <marek.safar@seznam.cz>
14701 * attribute.cs: Enum conversion moved to
14702 GetAttributeArgumentExpression to be applied to the all
14705 2004-10-01 Raja R Harinath <rharinath@novell.com>
14707 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
14708 * class.c (TypeContainer.DefineType): Flag error if
14709 base types aren't accessible due to access permissions.
14710 * decl.cs (DeclSpace.ResolveType): Move logic to
14711 Expression.ResolveAsTypeTerminal.
14712 (DeclSpace.ResolveTypeExpr): Thin layer over
14713 Expression.ResolveAsTypeTerminal.
14714 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
14715 Refactor code into NestedAccess. Use it.
14716 (DeclSpace.NestedAccess): New.
14717 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
14718 argument to silence errors. Check access permissions.
14719 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
14720 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
14721 (Cast.DoResolve): Likewise.
14722 (New.DoResolve): Likewise.
14723 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
14724 (TypeOf.DoResolve): Likewise.
14726 * expression.cs (Invocation.BetterConversion): Return the Type of
14727 the better conversion. Implement section 14.4.2.3 more faithfully.
14728 (Invocation.BetterFunction): Make boolean. Make correspondence to
14729 section 14.4.2.2 explicit.
14730 (Invocation.OverloadResolve): Update.
14731 (Invocation): Remove is_base field.
14732 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
14733 (Invocation.Emit): Likewise.
14735 2004-09-27 Raja R Harinath <rharinath@novell.com>
14737 * README: Update to changes.
14739 2004-09-24 Marek Safar <marek.safar@seznam.cz>
14741 * cs-parser.jay: Reverted 642 warning fix.
14743 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14746 * decl.cs (FindMemberWithSameName): Indexer can have more than
14749 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14751 * expression.cs (LocalVariableReference.DoResolveLValue):
14752 Do not report warning 219 for out values.
14753 (EmptyExpression.Null): New member to avoid extra allocations.
14755 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14757 * cs-parser.jay: Fix wrong warning 642 report.
14759 * cs-tokenizer.cs (CheckNextToken): New helper;
14760 Inspect next character if is same as expected.
14762 2004-09-23 Martin Baulig <martin@ximian.com>
14764 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
14765 (Convert.ImplicitReferenceConversionExists): Likewise.
14767 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14769 * class.cs (Operator.Define): Add error 448 and 559 report.
14771 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14773 * class.cs (MemberBase.IsTypePermitted): New protected
14774 method for checking error CS0610.
14776 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14778 * class.cs (TypeContainer.HasExplicitLayout): New property
14779 Returns whether container has StructLayout attribute set Explicit.
14780 (FieldMember): New abstract class for consts and fields.
14781 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
14782 (Field): Reuse FieldMember.
14784 * const.cs (Const): Reuse FieldMember.
14786 * rootcontext.cs: EmitConstants call moved to class.
14788 2004-09-22 Martin Baulig <martin@ximian.com>
14790 Thanks to Peter Sestoft for this bug report.
14792 * expression.cs (Conditional): If both the `trueExpr' and the
14793 `falseExpr' is a NullLiteral, return a NullLiteral.
14795 2004-09-22 Martin Baulig <martin@ximian.com>
14797 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
14798 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
14799 for the "get_Current" call.
14801 2004-09-22 Martin Baulig <martin@ximian.com>
14803 Marek and me just fixed one of our oldest bugs: #28562 :-)
14805 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
14807 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
14808 we're an EnumConstant, just return that.
14809 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
14810 an EnumConstant. In this case, we need to use GetValueAsEnumType()
14811 to get the value which'll actually be written into the attribute.
14812 However, we have to use GetValue() to access the attribute's value
14815 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14817 * constant.cs (Constant.IsNegative): New abstract property
14820 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
14821 (StackAlloc.DoResolve): Reused IsNegative.
14823 2004-09-21 Martin Baulig <martin@ximian.com>
14825 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
14826 if we're used in an iterator, we may be called from different
14829 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
14830 we actually have an exception block.
14832 2004-09-20 John Luke <jluke@cfl.rr.com>
14834 * class.cs, cs-parser.jay: Improve the error report for 1520:
14835 report the actual line where the error happens, not where the
14836 class was declared.
14838 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
14839 Pass location information that was available elsewhere.
14841 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
14843 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
14844 runtime to delay sign assemblies.
14846 2004-09-19 Miguel de Icaza <miguel@ximian.com>
14848 * cs-parser.jay: Do not report the stack trace, this is barely
14851 2004-08-22 John Luke <john.luke@gmail.com>
14853 * driver.cs : check that a resource id is not already used
14854 before adding it, report CS1508 if it is, bug #63637
14856 2004-09-19 Miguel de Icaza <miguel@ximian.com>
14858 * ecore.cs: Removed dead code.
14860 2004-09-18 Marek Safar <marek.safar@seznam.cz>
14862 * class.cs: Do not report warning CS0067 on the interfaces.
14864 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14866 * cs-parser.jay: Add error 504 report.
14868 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14870 * rootcontext.cs: WarningLevel is 4 by default now.
14872 * statement.cs (Fixed.Resolve): Do not null
14875 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14878 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
14879 deep search when property is not virtual.
14880 (PropertyExpr.ResolveAccessors): Make one call for both
14883 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14886 * statement.cs: Error 152 report constains also location.
14888 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14891 * const.cs: Explicitly set constant as static.
14893 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14896 * cs-parser.jay: Add error 1017 report.
14898 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14900 Fixed bug #59980, #64224
14901 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
14903 * typemanager.cs (IsSpecialMethod): Simplified
14905 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14907 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
14908 condition with better params.
14910 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14913 * attribute.cs (Resolve): Property has to have both
14916 2004-09-14 Martin Baulig <martin@ximian.com>
14918 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
14920 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14923 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
14924 called and is obsolete then this member suppress message
14925 when call is inside next [Obsolete] method or type.
14927 * expression.cs: Use TestObsoleteMethodUsage member.
14929 2004-09-14 Martin Baulig <martin@ximian.com>
14931 * cs-parser.jay: Sync a bit with the GMCS version.
14933 2004-09-14 Martin Baulig <martin@ximian.com>
14935 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
14936 (CSharpParser.yacc_verbose_flag): New public field.
14938 * genericparser.cs: Removed.
14940 2004-09-14 Raja R Harinath <rharinath@novell.com>
14942 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
14944 2004-09-13 Marek Safar <marek.safar@seznam.cz>
14946 * class.cs (MethodCore.CheckBase): Fix bug #65757.
14948 2004-09-10 Martin Baulig <martin@ximian.com>
14950 Backported my MemberName changes from GMCS into MCS.
14952 - we are now using a special `MemberName' class instead of using
14953 strings; in GMCS, the `MemberName' also contains the type
14956 - changed the grammar rules a bit:
14957 * the old `member_name' is now a `namespace_or_type_name':
14958 The rule is that we use `namespace_or_type_name' everywhere
14959 where we expect either a "member name" (GetEnumerator) or a
14960 "member name" with an explicit interface name
14961 (IEnumerable.GetEnumerator).
14962 In GMCS, the explicit interface name may include type arguments
14963 (IEnumerable<T>.GetEnumerator).
14964 * we use `member_name' instead of just `IDENTIFIER' for
14966 The rule is that we use `member_name' wherever a member may
14967 have type parameters in GMCS.
14969 * decl.cs (MemberName): New public class.
14970 (MemberCore.MemberName): New public readonly field.
14971 (MemberCore.ctor): Take a `MemberName' argument, not a string.
14972 (DeclSpace): Likewise.
14974 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
14975 * enum.cs (Enum.ctor): Likewise.
14977 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
14979 (AliasEntry.ctor): Take a MemberName, not an Expression.
14980 (AliasEntry.UsingAlias): Likewise.
14982 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
14983 (IMethodData.MemberName): Changed type from string to MemberName.
14984 (MemberBase.ExplicitInterfaceName): Likewise.
14985 (AbstractPropertyEventMethod.SetupName): Make this private.
14986 (AbstractPropertyEventMethod.ctor): Added `string prefix'
14987 argument; compute the member name here.
14988 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
14989 on the `member.MemberName' and the `prefix'.
14991 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
14993 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
14994 thus, we get a `MemberName' instead of a `string'. These
14995 declarations may have type parameters in GMCS.
14996 (interface_method_declaration, delegate_declaration): Likewise.
14997 (class_declaration, interface_declaration): Likewise.
14998 (method_header): Use `namespace_or_type_name' instead of
14999 `member_name'. We may be an explicit interface implementation.
15000 (property_declaration, event_declaration): Likewise.
15001 (member_name): This is now just an `IDENTIFIER', not a
15002 `namespace_or_type_name'.
15003 (type_name, interface_type): Removed.
15004 (namespace_or_type_name): Return a MemberName, not an Expression.
15005 (primary_expression): Use `member_name' instead of `IDENTIFIER';
15006 call GetTypeExpression() on the MemberName to get an expression.
15007 (IndexerDeclaration.interface_type): Changed type from string to
15009 (MakeName): Operate on MemberName's instead of string's.
15011 2004-09-13 Raja R Harinath <rharinath@novell.com>
15014 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
15015 (NamespaceEntry.Lookup): Add new argument to flag if we want the
15016 lookup to avoid symbols introduced by 'using'.
15017 * rootcontext.cs (NamespaceLookup): Update.
15019 2004-09-12 Marek Safar <marek.safar@seznam.cz>
15021 * class.cs (TypeContainer.DoDefineMembers): Do not call
15022 DefineDefaultConstructor for static classes.
15024 2004-09-12 Marek Safar <marek.safar@seznam.cz>
15026 * attribute.cs (Attribute.Resolve): Add error 653 report.
15028 * class.cs (Class.ApplyAttributeBuilder): Add error 641
15030 (Method.ApplyAttributeBuilder): Add error 685 report.
15031 (Operator.Define): Add error 564 report.
15033 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15035 * expression.cs (Invocation.DoResolve): Add error
15036 245 and 250 report.
15038 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
15041 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15043 * class.cs (ConstructorInitializer.Resolve):
15044 Wrong error number (515->516).
15046 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15048 * class.cs (Indexer.Define): Add error 631 report.
15050 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15052 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
15054 2004-09-11 Marek Safar <marek.safar@seznam.cz>
15056 * expression.cs (Probe.DoResolve): Add error CS0241 report.
15058 2004-09-10 Marek Safar <marek.safar@seznam.cz>
15060 * cs-parser.jay: Added error CS0241 report.
15062 2004-09-10 Raja R Harinath <rharinath@novell.com>
15064 * cs-parser.jay (fixed_statement): Introduce a scope for the
15065 declaration in the 'fixed' statement.
15067 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15069 * cs-parser.jay: Added CS0230 error report.
15071 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15073 * cs-parser.jay: Added errors CS0231 and CS0257 report.
15075 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15077 * expression.cs (Argument.Resolve): Added error CS0192 and
15080 2004-09-09 Marek Safar <marek.safar@seznam.cz>
15082 C# 2.0 #pragma warning feature
15084 * cs-tokenizer.cs (PreProcessPragma): New method;
15085 Handles #pragma directive.
15087 * report.cs (WarningRegions): New class; Support
15088 class for #pragma warning directive. It tests whether
15089 warning is enabled for a given line.
15091 2004-09-08 Miguel de Icaza <miguel@ximian.com>
15093 * const.cs: Add more descriptive error report, tahnks to
15096 2004-09-08 Marek Safar <marek.safar@seznam.cz>
15098 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
15100 2004-09-07 Miguel de Icaza <miguel@ximian.com>
15102 * expression.cs: Apply patch from Ben: Remove dead code from
15103 ArrayCreation, and remove the TurnintoConstant call in const.cs,
15104 as that code just threw an exception anwyays.
15106 * const.cs: Remove the call to the turnintoconstant, for details
15109 * literal.cs: The type of the null-literal is the null type; So
15110 we use a placeholder type (literal.cs:System.Null, defined here)
15113 * expression.cs (Conditional.DoResolve): Remove some old code that
15114 is no longer needed, conversions have been fixed.
15116 (ArrayCreationExpression.DoResolve): Return false if we fail to
15117 resolve the inner expression.
15119 2004-09-07 Raja R Harinath <rharinath@novell.com>
15122 * cs-parser.jay (delegate_declaration): Record a delegate
15123 declaration as a type declaration.
15124 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
15126 2004-09-06 Miguel de Icaza <miguel@ximian.com>
15128 * parameter.cs: Do not crash if the type can not be resolved.
15130 * expression.cs: Report errors with unsafe pointers, fixes #64896
15132 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
15134 * expression.cs: Pointer arith always needs to do a conv.i
15135 if the operand is a long. fix 65320
15137 2004-09-04 Marek Safar <marek.safar@seznam.cz>
15139 Fixed cs0619-37.cs, cs0619-38.cs
15141 * enum.cs (GetObsoleteAttribute): Removed.
15143 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
15144 on Enum member is double staged. The first is tested member
15147 2004-09-04 Marek Safar <marek.safar@seznam.cz>
15149 Fixed #56986, #63631, #65231
15151 * class.cs: (TypeContainer.AddToMemberContainer): New method,
15152 adds member to name container.
15153 (TypeContainer.AddToTypeContainer): New method, adds type to
15155 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
15156 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
15157 AddOperator): Simplified by reusing AddToMemberContainer.
15158 (TypeContainer.UserDefinedStaticConstructor): Changed to property
15160 (Method.CheckForDuplications): Fixed implementation to test all
15162 (MemberBase): Detection whether member is explicit interface
15163 implementation is now in constructor.
15164 (MemberBase.UpdateMemberName): Handles IndexerName.
15165 (Accessor): Changed to keep also location information.
15166 (AbstractPropertyEventMethod): Is derived from MemberCore.
15167 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
15168 will be emited or not.
15169 (PropertyBase.AreAccessorsDuplicateImplementation):
15170 Tests whether accessors are not in collision with some method.
15171 (Operator): Is derived from MethodCore to simplify common
15174 * decl.cs (Flags.TestMethodDuplication): Test for duplication
15176 (DeclSpace.AddToContainer): Adds the member to defined_names
15177 table. It tests for duplications and enclosing name conflicts.
15179 * enum.cs (EnumMember): Clean up to reuse the base structures
15181 2004-09-03 Martin Baulig <martin@ximian.com>
15183 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
15184 into TypeContainer, to make partial classes work again.
15186 2004-09-03 Martin Baulig <martin@ximian.com>
15188 * rootcontext.cs (RootContext.V2): Removed.
15190 2004-03-23 Martin Baulig <martin@ximian.com>
15192 * expression.cs (Invocation.OverloadResolve): Added `bool
15193 may_fail' argument and use it instead of the Location.IsNull() hack.
15195 2004-09-03 Martin Baulig <martin@ximian.com>
15197 Merged latest changes into gmcs. Please keep this comment in
15198 here, it makes it easier for me to see what changed in MCS since
15199 the last time I merged.
15201 2004-09-03 Raja R Harinath <rharinath@novell.com>
15204 * expression.cs (BetterConversion): Don't allow either conversion
15205 to be null. Remove redundant implicit conversion test when 'q ==
15206 null' -- when this function is invoked, we already know that the
15207 implicit conversion exists.
15208 (BetterFunction): Assume that 'best' is non-null. Remove
15209 redundant reimplementation of IsApplicable when 'best' is null.
15210 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
15211 number of arguments.
15212 (IsAncestralType): Extract from OverloadResolve.
15213 (OverloadResolve): Make robust to the MethodGroupExpr being
15214 unsorted. Implement all the logic of Section 14.5.5.1, and
15215 support overloading of methods from multiple applicable types.
15216 Clean up logic somewhat. Don't pass null methods to BetterFunction.
15218 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
15219 (RealError, Warning): Append type of report to related symbol.
15221 2004-09-03 Marek Safar <marek.safar@seznam.cz>
15223 * enum.cs: Fixed CLS-Compliance checks for enum members.
15224 Error tests cs3008-8.cs, cs3014-8.cs
15226 2004-09-02 Marek Safar <marek.safar@seznam.cz>
15228 Fixed bug #62342, #63102
15229 * class.cs: ImplementIndexer uses member.IsExplicitImpl
15230 like ImplementMethod.
15232 2004-09-02 Marek Safar <marek.safar@seznam.cz>
15234 * attribute.cs (Attribute.GetAttributeArgumentExpression):
15237 2004-09-02 Martin Baulig <martin@ximian.com>
15239 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
15240 TypeManager.GetArgumentTypes() rather than calling GetParameters()
15243 2004-09-01 Marek Safar <marek.safar@seznam.cz>
15245 C# 2.0 Static classes implemented
15247 * class.cs (TypeContainer): instance_constructors,
15248 initialized_fields, initialized_static_fields,
15249 default_constructor, base_inteface_types are protected to be
15250 accessible from StaticClass.
15251 (TypeContainer.DefineDefaultConstructor): New virtual method
15252 for custom default constructor generating
15253 (StaticClass): New class to handle "Static classes" feature.
15255 * cs-parser.jay: Handle static keyword on class like instance
15258 * driver.cs: Added "/langversion" command line switch with two
15259 options (iso-1, default).
15261 2004-08-31 Marek Safar <marek.safar@seznam.cz>
15263 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
15265 2004-08-31 Miguel de Icaza <miguel@ximian.com>
15267 * delegate.cs: Style.
15269 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
15271 * delegate.cs: Add seperate instance expr field for miguel.
15273 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
15275 * PointerArithmetic (Resolve): make sure we are not doing
15276 pointer arith on void*. Also, make sure we are resolved
15277 by not setting eclass until resolve.
15279 All callers: Make sure that PointerArithmetic gets resolved.
15281 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
15283 * ArrayCreation (LookupType): If the type does not resolve
15284 to an array, give an error.
15286 2004-08-27 Marek Safar <marek.safar@seznam.cz>
15288 * statement.cs (Try.Resolve): Fixed bug #64222
15290 2004-08-27 Martin Baulig <martin@ximian.com>
15293 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
15296 2004-08-26 Marek Safar <marek.safar@seznam.cz>
15298 * ecore.cs (Constantify): Get underlying type via
15299 System.Enum.GetUnderlyingType to avoid StackOverflow on the
15300 Windows in special cases.
15302 2004-08-26 Marek Safar <marek.safar@seznam.cz>
15304 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
15305 for obtaining also private methods.
15306 (GetRemoveMethod): Used GetRemoveMethod (true)
15307 for obtaining also private methods.
15309 2004-08-24 Martin Baulig <martin@ximian.com>
15311 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
15312 MethodAttributes.HideBySig for operators.
15314 2004-08-23 Martin Baulig <martin@ximian.com>
15316 Back to the old error reporting system :-)
15318 * report.cs (Message): Removed.
15319 (Report.MessageData, ErrorData, WarningData): Removed.
15320 (Report.Error, Warning): Back to the old system.
15322 2004-08-23 Martin Baulig <martin@ximian.com>
15324 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
15326 * class.cs (TypeContainer.ParentContainer): New public virtual
15327 method; replaces the explicit interface implementation.
15328 (ClassPart.ParentContainer): Override.
15330 2004-08-23 Martin Baulig <martin@ximian.com>
15332 * statement.cs (Switch): Added support for constant switches; see
15333 #59428 or test-285.cs.
15335 2004-08-22 Marek Safar <marek.safar@seznam.cz>
15338 * statement.cs (GetEnumeratorFilter): Removed useless
15339 logic because C# specs is strict. GetEnumerator must be
15342 2004-08-22 Martin Baulig <martin@ximian.com>
15344 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15345 a switch and may break, reset the barrier. Fixes #59867.
15347 2004-08-22 Marek Safar <marek.safar@seznam.cz>
15349 CLS-Compliance speed up (~5% for corlib)
15351 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
15352 New method. Tests container for CLS-Compliant names
15354 * class.cs (TypeContainer.VerifyClsName): New method.
15355 Checks whether container name is CLS Compliant.
15356 (Constructor): Implements IMethodData.
15358 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
15359 low-case table for CLS Compliance test.
15360 (MemberCache.VerifyClsParameterConflict): New method.
15361 Checks method parameters for CS3006 error.
15363 * enum.cs (EnumMember): Is derived from MemberCore.
15364 (Enum.VerifyClsName): Optimized for better performance.
15366 2004-08-06 Marek Safar <marek.safar@seznam.cz>
15368 * report.cs: Renamed Error_T to Error and changed all
15371 2004-08-06 Marek Safar <marek.safar@seznam.cz>
15373 * class.cs (TypeContainer.IndexerArrayList): New inner class
15374 container for indexers.
15375 (TypeContainer.DefaultIndexerName): New constant for default
15376 indexer name. Replaced all "Item" with this constant.
15377 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
15379 * typemanager.cs (TypeManager.default_member_ctor): Cache here
15380 DefaultMemberAttribute constructor.
15382 2004-08-05 Martin Baulig <martin@ximian.com>
15384 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
15387 2004-08-05 Marek Safar <marek.safar@seznam.cz>
15389 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
15390 multi platforms problem.
15392 * compiler.csproj: Included shared files.
15394 2004-08-04 Marek Safar <marek.safar@seznam.cz>
15396 Fix bug 60333, 55971 in the more general way
15397 * attribute.cs (Attribute.GetAttributeArgumentExpression):
15398 Added arg_type argument for constant conversion.
15399 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
15401 2004-08-04 Marek Safar <marek.safar@seznam.cz>
15404 * class.cs (TypeContainer ): New inner classes MethodArrayList,
15405 OperatorArrayList, MethodCoreArrayList for typecontainer
15406 containers. Changed class member types to these new types.
15407 (MethodArrayList.DefineMembers): Added test for CS0659.
15409 2004-08-04 Miguel de Icaza <miguel@ximian.com>
15411 * cfold.cs: Synchronize the folding with the code in expression.cs
15412 Binary.DoNumericPromotions for uint operands.
15414 * attribute.cs: Revert patch from Raja, it introduced a regression
15415 while building Blam-1.2.1 (hard to isolate a test case).
15417 2004-08-04 Marek Safar <marek.safar@seznam.cz>
15421 (TypeContainer.Define): Renamed to DefineContainerMembers because of
15423 (MethodCore.parent_method): New member. The method we're overriding
15424 if this is an override method.
15425 (MethodCore.CheckBase): Moved from Method class and made common.
15426 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
15428 (MethodCore.CheckForDuplications): New abstract method. For custom
15429 member duplication search in a container
15430 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
15431 method and its return type.
15432 (Event.conflict_symbol): New member. Symbol with same name in the
15436 (MemberCache.FindMemberWithSameName): New method. The method
15437 is looking for conflict with inherited symbols.
15439 2004-08-04 Martin Baulig <martin@ximian.com>
15441 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
15443 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
15445 2004-08-03 Marek Safar <marek.safar@seznam.cz>
15447 * report.cs (Message): New enum for better error, warning reference in
15449 (MessageData): New inner abstract class. It generally handles printing of
15450 error and warning messages.
15451 Removed unused Error, Warning, Message methods.
15453 2004-08-03 Marek Safar <marek.safar@seznam.cz>
15455 Fix for cs0592-8.cs test
15457 (Attributable.ValidAttributeTargets): Made public.
15458 (Attribute.ExplicitTarget): New member for explicit target value.
15459 (Attribute.CheckTargets): Now we translate explicit attribute
15460 target to Target here.
15462 2004-08-03 Ben Maurer <bmaurer@ximian.com>
15464 * ecore.cs (MethodGroupExpr): new IsBase property.
15466 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
15468 * delegate.cs (DelegateCreation): store a MethodGroupExpr
15469 rather than an instance expr.
15471 (DelegateCreation.Emit): Use the method group rather than
15472 the instance expression. Also, if you have base.Foo as the
15473 method for a delegate, make sure to emit ldftn, not ldftnvirt.
15475 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
15477 (NewDelegate.DoResolve): Only check for the existance of Invoke
15478 if the method is going to be needed. Use MethodGroupExpr.
15480 (NewDelegate.Emit): Remove, DelegateCreation implements this.
15482 * expression.cs: For pointer arith., make sure to use
15483 the size of the type, not the size of the pointer to
15486 2004-08-03 Marek Safar <marek.safar@seznam.cz>
15489 * class.cs (Class): Added error CS0502 test.
15491 2004-08-03 John Luke <jluke@cfl.rr.com>
15492 Raja R Harinath <rharinath@novell.com>
15495 * attribute.cs (Attribute.complained_before): New flag.
15496 (Attribute.ResolveType, Attribute.Resolve),
15497 (Attribute.DefinePInvokeMethod): Set it.
15498 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
15500 2004-08-03 Martin Baulig <martin@ximian.com>
15502 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
15503 use a user-defined operator; we still need to do numeric
15504 promotions in case one argument is a builtin type and the other
15505 one has an implicit conversion to that type. Fixes #62322.
15507 2004-08-02 Martin Baulig <martin@ximian.com>
15509 * statement.cs (LocalInfo.Flags): Added `IsThis'.
15510 (LocalInfo.IsThis): New public property.
15511 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
15513 2004-08-01 Martin Baulig <martin@ximian.com>
15515 * class.cs (TypeContainer.GetClassBases): Don't set the default
15516 here since we may get called from GetPartialBases().
15517 (TypeContainer.DefineType): If GetClassBases() didn't return a
15518 parent, use the default one.
15520 2004-07-30 Duncan Mak <duncan@ximian.com>
15522 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
15524 2004-07-30 Martin Baulig <martin@ximian.com>
15526 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
15528 * class.cs (SourceMethod): New public class, derive from the
15529 symbol writer's ISourceMethod.
15530 (Method): Use the new symbol writer API.
15532 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
15533 as argument and use the new symbol writer.
15536 (SourceFile): Implement the symbol writer's ISourceFile.
15537 (Location.SymbolDocument): Removed.
15538 (Location.SourceFile): New public property.
15540 * symbolwriter.cs: Use the new symbol writer API.
15542 2004-07-30 Raja R Harinath <rharinath@novell.com>
15544 * Makefile (install-local): Remove. Functionality moved to
15547 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
15549 * Makefile: Install mcs.exe.config file together with mcs.exe.
15550 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
15551 correct runtime version.
15553 2004-07-25 Martin Baulig <martin@ximian.com>
15556 (TypeContainer.RegisterOrder): Removed, this was unused.
15557 (TypeContainer, interface_order): Removed.
15558 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
15559 TypeContainer as argument since we can also be called with a
15560 `PartialContainer' for a partial class/struct/interface.
15561 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
15562 of checking whether we're an `Interface' - we could be a
15563 `PartialContainer'.
15564 (PartialContainer.Register): Override; call
15565 AddClass()/AddStruct()/AddInterface() on our parent.
15567 * cs-parser.jay (interface_member_declaration): Add things to the
15568 `current_container', not the `current_class'.
15570 * rootcontext.cs (RegisterOrder): The overloaded version which
15571 takes an `Interface' was unused, removed.
15573 * typemanager.cs (TypeManager.LookupInterface): Return a
15574 `TypeContainer', not an `Interface'.
15575 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
15576 contain a `PartialContainer' for an interface, so check it's
15577 `Kind' to figure out what it is.
15579 2004-07-25 Martin Baulig <martin@ximian.com>
15581 * class.cs (Class.DefaultTypeAttributes): New public constant.
15582 (Struct.DefaultTypeAttributes): Likewise.
15583 (Interface.DefaultTypeAttributes): Likewise.
15584 (PartialContainer.TypeAttr): Override this and add the
15585 DefaultTypeAttributes.
15587 2004-07-25 Martin Baulig <martin@ximian.com>
15589 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
15590 we can just use the `Parent' field instead.
15592 2004-07-25 Martin Baulig <martin@ximian.com>
15594 * class.cs (TypeContainer.Emit): Renamed to EmitType().
15596 2004-07-25 Martin Baulig <martin@ximian.com>
15598 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
15599 our parts before defining any methods.
15600 (TypeContainer.VerifyImplements): Make this virtual.
15601 (ClassPart.VerifyImplements): Override and call VerifyImplements()
15602 on our PartialContainer.
15604 2004-07-25 Martin Baulig <martin@ximian.com>
15606 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
15608 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
15609 argument, we can just use the `Parent' field instead.
15612 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
15613 (MemberBase.DoDefine): Likewise.
15615 2004-07-24 Martin Baulig <martin@ximian.com>
15617 * decl.cs (MemberCore.Parent): New public field.
15618 (DeclSpace.Parent): Moved to MemberCore.
15620 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
15621 (MemberBase.ctor): Added TypeContainer argument, pass it to our
15623 (FieldBase, Field, Operator): Likewise.
15624 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
15625 (EventField, Event): Likewise.
15627 2004-07-23 Martin Baulig <martin@ximian.com>
15629 * class.cs (PartialContainer): New public class.
15630 (ClassPart): New public class.
15631 (TypeContainer): Added support for partial classes.
15632 (TypeContainer.GetClassBases): Splitted some of the functionality
15633 out into GetNormalBases() and GetPartialBases().
15635 * cs-tokenizer.cs (Token.PARTIAL): New token.
15636 (Tokenizer.consume_identifier): Added some hacks to recognize
15637 `partial', but only if it's immediately followed by `class',
15638 `struct' or `interface'.
15640 * cs-parser.jay: Added support for partial clases.
15642 2004-07-23 Martin Baulig <martin@ximian.com>
15644 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
15645 a `DeclSpace' and also made it readonly.
15646 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
15647 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
15648 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
15650 * cs-parser.jay: Pass the `current_class', not the
15651 `current_container' (at the moment, this is still the same thing)
15652 to a new Method, Property, Event, Indexer or Constructor.
15654 2004-07-23 Martin Baulig <martin@ximian.com>
15656 * cs-parser.jay (CSharpParser): Added a new `current_class' field
15657 and removed the `current_interface' one.
15658 (struct_declaration, class_declaration, interface_declaration):
15659 Set `current_class' to the newly created class/struct/interface;
15660 set their `Bases' and call Register() before parsing their body.
15662 2004-07-23 Martin Baulig <martin@ximian.com>
15664 * class.cs (Kind): New public enum.
15665 (TypeContainer): Made this class abstract.
15666 (TypeContainer.Kind): New public readonly field.
15667 (TypeContainer.CheckDef): New public method; moved here from
15669 (TypeContainer.Register): New public abstract method.
15670 (TypeContainer.GetPendingImplementations): New public abstract
15672 (TypeContainer.GetClassBases): Removed the `is_class' and
15673 `is_iface' parameters.
15674 (TypeContainer.DefineNestedTypes): Formerly known as
15676 (ClassOrStruct): Made this class abstract.
15678 * tree.cs (RootTypes): New public type.
15680 2004-07-20 Martin Baulig <martin@ximian.com>
15682 * tree.cs (Tree.RecordNamespace): Removed.
15683 (Tree.Namespaces): Removed.
15685 * rootcontext.cs (RootContext.IsNamespace): Removed.
15687 * cs-parser.jay (namespace_declaration): Just create a new
15688 NamespaceEntry here.
15690 2004-07-20 Martin Baulig <martin@ximian.com>
15692 * statement.cs (ExceptionStatement): New abstract class. This is
15693 now used as a base class for everyone who's using `finally'.
15694 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
15695 our local variables before using them.
15697 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
15698 virtual method. This is used by Yield.Resolve() to "steal" an
15699 outer block's `finally' clauses.
15700 (FlowBranchingException): The .ctor now takes an ExceptionStatement
15703 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
15704 version which takes an ExceptionStatement. This version must be
15705 used to create exception branchings.
15708 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
15709 (Iterator.EmitMoveNext): Added exception support; protect the
15710 block with a `fault' clause, properly handle 'finally' clauses.
15711 (Iterator.EmitDispose): Run all the `finally' clauses here.
15713 2004-07-20 Martin Baulig <martin@ximian.com>
15715 * iterator.cs: This is the first of a set of changes in the
15716 iterator code. Match the spec more closely: if we're an
15717 IEnumerable, then GetEnumerator() must be called. The first time
15718 GetEnumerator() is called, it returns the current instance; all
15719 subsequent invocations (if any) must create a copy.
15721 2004-07-19 Miguel de Icaza <miguel@ximian.com>
15723 * expression.cs: Resolve the constant expression before returning
15726 2004-07-19 Martin Baulig <martin@ximian.com>
15728 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
15729 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
15730 the return type of the new EmitContext.
15732 2004-07-18 Martin Baulig <martin@ximian.com>
15734 * class.cs (Property.Define): Fix iterators.
15736 * iterators.cs (Iterator.Define): Moved the
15737 `container.AddInterator (this)' call here from the .ctor; only do
15738 it if we resolved successfully.
15740 2004-07-17 Miguel de Icaza <miguel@ximian.com>
15742 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
15743 `true' for preprocessing directives that we parse. The return
15744 value indicates whether we should return to regular tokenizing or
15745 not, not whether it was parsed successfully.
15747 In the past if we were in: #if false ... #line #endif, we would
15748 resume parsing after `#line'. See bug 61604.
15750 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
15751 building: IsEnumType should return true only for enums, not for
15752 enums or System.Enum itself. This fixes #61593.
15754 Likely what happened is that corlib was wrong: mcs depended on
15755 this bug in some places. The bug got fixed, we had to add the
15756 hack, which caused bug 61593.
15758 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
15759 that was a workaround for the older conditions.
15761 2004-07-16 Ben Maurer <bmaurer@ximian.com>
15763 * assign.cs: IAssignMethod has a new interface, as documented
15764 inline. All assignment code now uses this new api.
15766 * ecore.cs, expression.cs: All classes which implement
15767 IAssignMethod now use the new interface.
15769 * expression.cs (Invocation): add a hack to EmitCall so that
15770 IndexerAccess can be the target of a compound assignment without
15771 evaluating its arguments twice.
15773 * statement.cs: Handle changes in Invocation api.
15775 2004-07-16 Martin Baulig <martin@ximian.com>
15777 * iterators.cs: Rewrote this. We're now using one single Proxy
15778 class for both the IEnumerable and the IEnumerator interface and
15779 `Iterator' derives from Class so we can use the high-level API.
15781 * class.cs (TypeContainer.AddIterator): New method.
15782 (TypeContainer.DoDefineType): New protected virtual method, which
15783 is called from DefineType().
15784 (TypeContainer.DoDefineMembers): Call DefineType() and
15785 DefineMembers() on all our iterators.
15786 (TypeContainer.Emit): Call Emit() on all our iterators.
15787 (TypeContainer.CloseType): Call CloseType() on all our iterators.
15789 * codegen.cs (EmitContext.CurrentIterator): New public field.
15791 2004-07-15 Martin Baulig <martin@ximian.com>
15794 (TypeManager.not_supported_exception_type): New type.
15796 2004-07-14 Martin Baulig <martin@ximian.com>
15798 * iterators.cs: Use real error numbers.
15800 2004-07-14 Martin Baulig <martin@ximian.com>
15802 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
15803 requires this to be a System.Collection.IEnumerable and not a
15804 class implementing that interface.
15805 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
15807 2004-07-13 Marek Safar <marek.safar@seznam.cz>
15809 * class.cs: Fixed previous fix, it broke some error tests.
15811 2004-07-12 Martin Baulig <martin@ximian.com>
15813 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
15816 2004-07-09 Miguel de Icaza <miguel@ximian.com>
15818 * assign.cs (LocalTemporary): Add new argument: is_address,If
15819 `is_address' is true, then the value that we store is the address
15820 to the real value, and not the value itself.
15822 * ecore.cs (PropertyExpr): use the new local temporary
15823 stuff to allow us to handle X.Y += z (where X is a struct)
15825 2004-07-08 Martin Baulig <martin@ximian.com>
15827 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
15828 not always return, just like we're doing in Using.Resolve().
15830 2004-07-07 Miguel de Icaza <miguel@ximian.com>
15832 * cs-parser.jay (fixed_statement): flag this as Pinned.
15834 2004-07-06 Miguel de Icaza <miguel@ximian.com>
15836 * typemanager.cs (TypeManager): Removed MakePinned method, this
15837 mechanism is replaced with the .NET 2.x compatible mechanism of
15838 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
15840 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
15841 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
15842 `IsFixed' property which has a different meaning.
15844 2004-07-02 Raja R Harinath <rharinath@novell.com>
15846 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
15847 visible from inside a nested class, not just the names of the
15848 immediately enclosing class.
15849 Fix for bug #60730.
15851 2004-06-24 Raja R Harinath <rharinath@novell.com>
15853 * expression.cs (BetterConversion): Remove buggy special-case
15854 handling of "implicit constant expression conversions". At this
15855 point, we already know that the conversion is possible -- we're
15856 only checking to see which is better.
15858 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15860 * cs-parser.jay: Added error CS0210 test.
15862 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15864 * cs-parser.jay: Added error CS0134 test.
15866 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15869 * cs-parser.jay: Added error CS0145 test.
15871 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15873 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
15875 2004-06-23 Ben Maurer <bmaurer@ximian.com>
15877 * expression.cs (StackAlloc.Resolve): The argument may not
15878 be a constant; deal with this case.
15880 2004-06-23 Marek Safar <marek.safar@seznam.cz>
15882 * attribute.cs (IndexerName_GetIndexerName): Renamed to
15883 GetIndexerAttributeValue.
15884 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
15886 * class.cs (Indexer.Define): Added error tests for CS0415,
15889 2004-06-23 Miguel de Icaza <miguel@ximian.com>
15891 * attribute.cs (Attribute.Resolve): Keep field code in sync with
15894 2004-06-23 Martin Baulig <martin@ximian.com>
15896 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
15897 neither return nor throw, reset the barrier as well. Fixes #60457.
15899 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
15901 * class.cs : EventAttributes is now set to None by default.
15902 This fixes bug #60459.
15904 2004-06-18 Marek Safar <marek.safar@seznam.cz>
15907 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15908 Don't throw exception but return null (it's sufficient now).
15910 2004-06-18 Marek Safar <marek.safar@seznam.cz>
15912 * typemanager.cs (GetArgumentTypes): Faster implementation.
15914 2004-06-18 Martin Baulig <martin@ximian.com>
15916 * attribute.cs (Attribute.Resolve): Check whether we're an
15917 EmptyCast which a Constant child. Fixes #60333.
15919 2004-06-17 Ben Maurer <bmaurer@ximian.com>
15921 * statement.cs (EmitCollectionForeach): Account for the fact that
15922 not all valuetypes are in areas which we can take the address of.
15923 For these variables, we store to a temporary variable. Also, make
15924 sure that we dont emit a `callvirt' on a valuetype method.
15926 2004-06-15 Marek Safar <marek.safar@seznam.cz>
15928 * expression.cs (StackAlloc.DoReSolve): Added test for
15929 negative parameter (CS0247).
15931 2004-06-15 Marek Safar <marek.safar@seznam.cz>
15934 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
15936 2004-06-15 Marek Safar <marek.safar@seznam.cz>
15939 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
15942 2004-06-14 Marek Safar <marek.safar@seznam.cz>
15944 Fix bug #58254 & cs1555.cs, cs1556.cs
15945 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
15947 2004-06-14 Marek Safar <marek.safar@seznam.cz>
15949 * cs-parser.jay: Added error CS1669 test for indexers.
15951 2004-06-11 Martin Baulig <martin@ximian.com>
15953 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
15954 call this twice: for params and varargs methods.
15956 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15959 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
15961 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15963 * attribute.cs (Attribute.GetValidTargets): Made public.
15966 (AbstractPropertyEventMethod): New class for better code sharing.
15967 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
15969 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
15971 2004-06-11 Raja R Harinath <rharinath@novell.com>
15974 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
15975 that the call to Resolve is part of a MemberAccess.
15976 (Expression.Resolve): Use it for SimpleName resolution.
15977 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
15978 Add 'intermediate' boolean argument.
15979 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
15980 error message when the SimpleName can be resolved ambiguously
15981 between an expression and a type.
15982 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
15984 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
15985 call on the left-side.
15987 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15990 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
15992 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15994 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
15996 2004-06-11 Martin Baulig <martin@ximian.com>
15998 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
15999 varargs methods if applicable.
16001 2004-06-11 Martin Baulig <martin@ximian.com>
16003 * expression.cs (Invocation.EmitCall): Don't use
16004 `method.CallingConvention == CallingConventions.VarArgs' since the
16005 method could also have `CallingConventions.HasThis'.
16007 2004-06-11 Marek Safar <marek.safar@seznam.cz>
16009 * class.cs (Event.GetSignatureForError): Implemented.
16010 Fixed crash in error test cs3010.cs
16012 2004-06-10 Miguel de Icaza <miguel@ximian.com>
16014 * cs-tokenizer.cs: Change the way we track __arglist to be
16015 consistent with the other keywords.
16017 2004-06-09 Miguel de Icaza <miguel@ximian.com>
16019 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
16022 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
16024 * codegen.cs: Check that all referenced assemblies have a strongname
16025 before strongnaming the compiled assembly. If not report error CS1577.
16026 Fix bug #56563. Patch by Jackson Harper.
16027 * typemanager.cs: Added a method to return all referenced assemblies.
16028 Fix bug #56563. Patch by Jackson Harper.
16030 2004-06-08 Marek Safar <marek.safar@seznam.cz>
16033 (Method.ApplyAttributeBuilder): Moved and added conditional
16034 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
16037 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
16039 2004-06-08 Marek Safar <marek.safar@seznam.cz>
16042 * class.cs: (EventField.attribute_targets): Changed default target.
16044 2004-06-08 Martin Baulig <martin@ximian.com>
16046 * expression.cs (Invocation.EmitCall): Enable varargs methods.
16048 2004-06-08 Martin Baulig <martin@ximian.com>
16050 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
16052 2004-06-07 Martin Baulig <martin@ximian.com>
16054 Added support for varargs methods.
16056 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
16059 * cs-parser.jay: Added support for `__arglist'.
16061 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
16063 * expression.cs (Argument.AType): Added `ArgList'.
16064 (Invocation): Added support for varargs methods.
16065 (ArglistAccess): New public class.
16066 (Arglist): New public class.
16068 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
16070 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
16071 a method's top-level block if the method has varargs.
16073 * support.cs (ReflectionParameters, InternalParameters): Added
16074 support for varargs methods.
16076 2004-06-07 Miguel de Icaza <miguel@ximian.com>
16078 * class.cs: Provide location in indexer error report.
16080 * driver.cs: Use standard names.
16082 * namespace.cs: Catch the use of using after a namespace has been
16083 declared also on using aliases.
16085 2004-06-03 Raja R Harinath <rharinath@novell.com>
16088 * typemanager.cs (closure_private_ok, closure_invocation_type)
16089 (closure_qualifier_type, closure_invocation_assembly)
16090 (FilterWithClosure): Move to ...
16091 (Closure): New internal nested class.
16092 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
16093 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
16094 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
16095 (MemberLookup, MemberLookupFailed): Use it.
16096 * expression.cs (New.DoResolve): Treat the lookup for the
16097 constructor as being qualified by the 'new'ed type.
16098 (Indexers.GetIndexersForTypeOrInterface): Update.
16100 2004-06-03 Marek Safar <marek.safar@seznam.cz>
16103 (GetConditionalAttributeValue): New method. Returns
16104 condition of ConditionalAttribute.
16105 (SearchMulti): New method. Returns all attributes of type 't'.
16106 Use it when attribute is AllowMultiple = true.
16107 (IsConditionalMethodExcluded): New method.
16110 (Method.IsExcluded): Implemented. Returns true if method has conditional
16111 attribute and the conditions is not defined (method is excluded).
16112 (IMethodData): Extended interface for ConditionalAttribute support.
16113 (PropertyMethod.IsExcluded): Implemented.
16116 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
16119 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
16122 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
16124 * expression.cs (ArrayCreationExpression): Make this just an
16125 `expression'. It can't be a statement, so the code here was
16128 2004-06-02 Marek Safar <marek.safar@seznam.cz>
16131 * typemanager.cs (GetFullNameSignature): New method for
16134 2004-06-02 Marek Safar <marek.safar@seznam.cz>
16137 * class.cs (MemberBase.GetSignatureForError): New virtual method.
16138 Use this method when MethodBuilder is null.
16139 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
16140 Added test for error CS0626 (MONO reports error for this situation).
16141 (IMethodData.GetSignatureForError): Extended interface.
16143 2004-06-01 Marek Safar <marek.safar@seznam.cz>
16146 (AttributeTester.GetObsoleteAttribute): Returns instance of
16147 ObsoleteAttribute when type is obsolete.
16150 (TypeContainer.VerifyObsoleteAttribute): Override.
16151 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
16152 (MethodCode.VerifyObsoleteAttribute): Override.
16153 (MemberBase.VerifyObsoleteAttribute): Override.
16156 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
16157 and report proper error.
16160 Delegate.VerifyObsoleteAttribute): Override.
16163 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
16164 and report proper error.
16165 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
16168 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
16172 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
16173 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
16174 Added test for ObsoleteAttribute.
16177 (Catch): Derived from Statement.
16179 2004-06-01 Marek Safar <marek.safar@seznam.cz>
16181 Fixed bug #59071 & cs0160.cs
16183 * statement.cs (Try.Resolve): Check here whether order of catch
16184 clauses matches their dependencies.
16186 2004-05-31 Miguel de Icaza <miguel@ximian.com>
16188 * Reverted patch to namespace.cs (Use lookuptypedirect). This
16189 caused a regression: #59343. Referencing nested classes from an
16190 assembly stopped working.
16192 2004-05-31 Martin Baulig <martin@ximian.com>
16194 MCS is now frozen for beta 2.
16196 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16198 * convert.cs: add a trivial cache for overload operator resolution.
16200 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16202 * decl.cs: If possible, use lookuptypedirect here. We can only do
16203 this if there is no `.' after the namespace. Avoids using
16204 LookupType, which does lots of slow processing.
16205 (FindNestedType) New method, does what it says :-).
16206 * namespace.cs: use LookupTypeDirect.
16207 * rootcontext.cs: use membercache, if possible.
16208 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
16210 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16213 According to the spec,
16215 In a member access of the form E.I, if E is a single identifier,
16216 and if the meaning of E as a simple-name (§7.5.2) is a constant,
16217 field, property, localvariable, or parameter with the same type as
16218 the meaning of E as a type-name (§3.8), then both possible
16219 meanings of E are permitted.
16221 We did not check that E as a simple-name had the same type as E as
16224 This trivial check gives us 5-7% on bootstrap time.
16226 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
16228 * expression.cs (Invocation.OverloadResolve): Avoid the
16229 use of hashtables and boxing here by allocating on demand.
16231 2004-05-30 Martin Baulig <martin@ximian.com>
16233 * rootcontext.cs (RootContext.LookupType): Don't cache things if
16234 we're doing a silent lookup. Don't try to lookup nested types in
16235 TypeManager.object_type (thanks to Ben Maurer).
16237 2004-05-30 Martin Baulig <martin@ximian.com>
16239 Committing a patch from Ben Maurer.
16241 * rootcontext.cs (RootContext.LookupType): Cache negative results.
16243 2004-05-29 Martin Baulig <martin@ximian.com>
16245 * class.cs (IMethodData.ShouldIgnore): New method.
16247 * typemanager.cs (TypeManager.MethodFlags): Don't take a
16248 `Location' argument, we don't need it anywhere. Use
16249 `IMethodData.ShouldIgnore ()' instead of
16250 `MethodData.GetMethodFlags ()'.
16251 (TypeManager.AddMethod): Removed.
16252 (TypeManager.AddMethod2): Renamed to AddMethod.
16254 2004-05-29 Martin Baulig <martin@ximian.com>
16256 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
16258 * convert.cs (Convert.ImplicitReferenceConversion): If we're
16259 converting from a class type S to an interface type and we already
16260 have an object on the stack, don't box it again. Fixes #52578.
16262 2004-05-29 Martin Baulig <martin@ximian.com>
16264 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16265 Added support for `params' parameters. Fixes #59267.
16267 2004-05-29 Martin Baulig <martin@ximian.com>
16269 * literal.cs (NullPointer): Provide a private .ctor which sets
16270 `type' to TypeManager.object_type. Fixes #59048.
16272 2004-05-29 Martin Baulig <martin@ximian.com>
16274 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
16275 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
16277 * ecore.cs (EventExpr.instance_expr): Make the field private.
16279 2004-05-26 Marek Safar <marek.safar@seznam.cz>
16281 Fixed bug #50080 & cs0214-2.cs
16282 * expression.cs (Cast.DoResolve): Check unsafe context here.
16284 * statement.cs (Resolve.DoResolve): Likewise.
16286 2004-05-26 Martin Baulig <martin@ximian.com>
16288 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
16290 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
16291 (RootContext.LookupType): Pass down the `silent' flag.
16293 2004-05-25 Martin Baulig <martin@ximian.com>
16296 (MethodGroupExpr.IdenticalTypeName): New public property.
16297 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
16298 expression actually refers to a type.
16300 2004-05-25 Martin Baulig <martin@ximian.com>
16302 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
16303 for #56176 and made it actually work.
16305 2004-05-25 Martin Baulig <martin@ximian.com>
16307 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
16308 (FieldExpr, PropertyExpr): Override and implement
16309 CacheTemporaries. Fixes #52279.
16311 2004-05-25 Miguel de Icaza <miguel@ximian.com>
16313 * location.cs: In the new compiler listing a file twice is a
16314 warning, not an error.
16316 2004-05-24 Martin Baulig <martin@ximian.com>
16318 * enum.cs (Enum.DefineType): For the `BaseType' to be a
16319 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
16321 2004-05-24 Martin Baulig <martin@ximian.com>
16323 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
16324 walking the `using' list. Fixes #53921.
16326 2004-05-24 Martin Baulig <martin@ximian.com>
16328 * const.cs (Const.LookupConstantValue): Added support for
16329 EmptyCast's; fixes #55251.
16331 2004-05-24 Martin Baulig <martin@ximian.com>
16333 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
16334 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
16335 which does the CS0135 check. The reason is that we first need to
16336 check whether the variable actually exists.
16338 2004-05-24 Martin Baulig <martin@ximian.com>
16340 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
16341 than RootContext.LookupType() to find the explicit interface
16342 type. Fixes #58584.
16344 2004-05-24 Raja R Harinath <rharinath@novell.com>
16346 * Makefile: Simplify. Use executable.make.
16347 * mcs.exe.sources: New file. List of sources of mcs.exe.
16349 2004-05-24 Anders Carlsson <andersca@gnome.org>
16353 Use the invariant culture when doing String.Compare for CLS case
16356 2004-05-23 Martin Baulig <martin@ximian.com>
16358 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
16359 don't have any dots. Fixes #52622, added cs0246-8.cs.
16361 * namespace.cs (NamespaceEntry.Lookup): Likewise.
16363 2004-05-23 Marek Safar <marek.safar@seznam.cz>
16365 * class.cs (MemberBase.Define): Reuse MemberType member for
16366 resolved type. Other methods can use it too.
16368 2004-05-23 Martin Baulig <martin@ximian.com>
16370 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
16371 the variable also exists in the current block (otherwise, we need
16372 to report a CS0103). Fixes #58670.
16374 2004-05-23 Martin Baulig <martin@ximian.com>
16376 * flowanalysis.cs (Reachability.Reachable): Compute this
16377 on-the-fly rather than storing it as a field.
16379 2004-05-23 Martin Baulig <martin@ximian.com>
16381 * flowanalysis.cs (Reachability.And): Manually compute the
16382 resulting `barrier' from the reachability.
16384 2004-05-23 Marek Safar <marek.safar@seznam.cz>
16387 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
16388 instance of ObsoleteAttribute when symbol is obsolete.
16391 (IMethodData): Extended interface for ObsoleteAttribute support.
16393 2004-05-22 Marek Safar <marek.safar@seznam.cz>
16395 * attribute.cs: Fix bug #55970
16397 2004-05-22 Marek Safar <marek.safar@seznam.cz>
16401 (GetObsoleteAttribute): New method. Creates the instance of
16403 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
16404 ObsoleteAttribute when member is obsolete.
16405 (AttributeTester.Report_ObsoleteMessage): Common method for
16406 Obsolete error/warning reporting.
16409 (TypeContainer.base_classs_type): New member for storing parent type.
16412 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
16413 for this MemberCore.
16415 2004-05-21 Marek Safar <marek.safar@seznam.cz>
16417 * attribute.cs, const.cs: Fix bug #58590
16419 2004-05-21 Martin Baulig <martin@ximian.com>
16421 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
16422 out parameters if the end of the method is unreachable. Fixes
16425 2004-05-21 Marek Safar <marek.safar@seznam.cz>
16427 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
16428 Hari was right, why extra method.
16430 2004-05-21 Marek Safar <marek.safar@seznam.cz>
16432 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
16434 2004-05-20 Martin Baulig <martin@ximian.com>
16436 Merged this back from gmcs to keep the differences to a minumum.
16438 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
16439 instead of a Declspace.
16440 (Attribute.ResolveType): Likewise.
16441 (Attributes.Search): Likewise.
16442 (Attributes.Contains): Likewise.
16443 (Attributes.GetClsCompliantAttribute): Likewise.
16445 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
16447 (MethodData.ApplyAttributes): Take an EmitContext instead of a
16450 2004-05-19 Marek Safar <marek.safar@seznam.cz>
16452 Fix bug #58688 (MCS does not report error when the same attribute
16455 * attribute.cs (Attribute.Emit): Distinction between null and default.
16457 2004-05-19 Raja R Harinath <rharinath@novell.com>
16459 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
16460 of a top-level attribute without an attribute target.
16461 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
16463 (Attribute.Conditional_GetConditionName),
16464 (Attribute.Obsolete_GetObsoleteMessage): Update.
16465 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
16466 part of ScanForIndexerName.
16467 (Attribute.CanIgnoreInvalidAttribute): New function.
16468 (Attribute.ScanForIndexerName): Move to ...
16469 (Attributes.ScanForIndexerName): ... here.
16470 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
16471 (Attributes.Search): New internal variant that can choose not to
16472 complain if types aren't resolved. The original signature now
16474 (Attributes.GetClsCompliantAttribute): Use internal variant, with
16475 complaints suppressed.
16476 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
16477 only if it not useful.
16478 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
16479 top-level for attributes that are shared between the assembly
16480 and a top-level class.
16481 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
16482 * class.cs: Update to reflect changes.
16483 (DefineIndexers): Fuse loops.
16484 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
16485 a couple more variants of attribute names.
16487 2004-05-18 Marek Safar <marek.safar@seznam.cz>
16489 Fix bug #52585 (Implemented explicit attribute declaration)
16492 (Attributable.ValidAttributeTargets): New abstract method. It gets
16493 list of valid attribute targets for explicit target declaration.
16494 (Attribute.Target): It holds target itself.
16495 (AttributeSection): Removed.
16496 (Attribute.CheckTargets): New method. It checks whether attribute
16497 target is valid for the current element.
16500 (EventProperty): New class. For events that are declared like
16501 property (with add and remove accessors).
16502 (EventField): New class. For events that are declared like field.
16505 * cs-parser.jay: Implemented explicit attribute target declaration.
16507 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
16508 Override ValidAttributeTargets.
16511 (ReturnParameter): Class for applying custom attributes on
16513 (ParameterAtribute): New class. Class for applying custom
16514 attributes on the parameter type.
16516 2004-05-17 Miguel de Icaza <miguel@ximian.com>
16518 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
16521 (Method): Allow UNSAFE here.
16523 * modifiers.cs: Support unsafe reporting.
16525 2004-05-17 Marek Safar <marek.safar@seznam.cz>
16527 * decl.cs: Fix bug #58478.
16529 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16531 * statement.cs: When checking for unreachable code on an EmptyStatement,
16532 set the location. Fixes bug #58488.
16534 2004-05-13 Miguel de Icaza <miguel@ximian.com>
16536 * driver.cs: Add -pkg handling.
16538 From Gonzalo: UseShelLExecute=false
16540 2004-05-12 Marek Safar <marek.safar@seznam.cz>
16543 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
16545 (Attribute.IsClsCompliaceRequired): Moved to base for better
16547 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
16548 when attribute is AttributeUsageAttribute.
16549 (Attribute.GetValidTargets): Simplified.
16550 (Attribute.GetAttributeUsage): New method returns AttributeUsage
16551 attribute for this type.
16552 (Attribute.ApplyAttributes): Method renamed to Emit and make
16554 (GlobalAttributeSection): New class for special handling of global
16555 attributes (assembly, module).
16556 (AttributeSection.Emit): New method.
16558 * class.cs: Implemented Attributable abstract methods.
16559 (MethodCore.LabelParameters): Moved to Parameter class.
16560 (Accessor): Is back simple class.
16561 (PropertyMethod): Implemented Attributable abstract class.
16562 (DelegateMethod): Implemented Attributable abstract class.
16563 (Event): New constructor for disctintion between normal Event
16564 and Event with accessors.
16566 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
16568 * codegen.cs, const.cs, decl.cs, delegate.cs:
16569 (CommonAssemblyModulClass): Implemented Attributable abstract class
16572 * enum.cs: Implement IAttributeSupport interface.
16573 (EnumMember): New class for emum members. Implemented Attributable
16577 (ParameterBase): Is abstract.
16578 (ReturnParameter): New class for easier [return:] attribute handling.
16580 * typemanager.cs: Removed builder_to_attr.
16582 2004-05-11 Raja R Harinath <rharinath@novell.com>
16585 * attribute.cs (Attribute.GetPositionalValue): New function.
16586 * class.cs (TypeContainer.VerifyMembers): New function.
16587 (TypeContainer.Emit): Use it.
16588 (ClassOrStruct): New base class for Class and Struct.
16589 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
16590 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
16592 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
16593 then each non-static field should have a FieldOffset attribute.
16594 Otherwise, none of the fields should have a FieldOffset attribute.
16595 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
16596 and FieldOffset attributes.
16597 * typemanager.cs (TypeManager.struct_layout_attribute_type)
16598 (TypeManager.field_offset_attribute_type): New core types.
16599 (TypeManager.InitCoreTypes): Initialize them.
16601 2004-05-11 Michal Moskal <malekith@pld-linux.org>
16603 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
16604 Return correct type.
16607 2004-05-09 Miguel de Icaza <miguel@ximian.com>
16609 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
16610 be implicitly converted to ulong.
16612 * expression.cs: The logic for allowing operator &, | and ^ worked
16613 was wrong, it worked before because we did not report an error in
16614 an else branch. Fixes 57895.
16616 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
16617 allow volatile fields to be reference types.
16619 2004-05-07 Miguel de Icaza <miguel@ximian.com>
16621 * driver.cs: Add support for /debug-
16623 2004-05-07 Raja R Harinath <rharinath@novell.com>
16625 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
16626 Add a 'complain' parameter to silence errors.
16627 (Attribute.Resolve): Update to changes. Put in sanity check to catch
16628 silently overlooked type-resolutions.
16629 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
16630 to reflect changes.
16631 (Attributes.Search): New function.
16632 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
16633 (Attributes.GetAttributeFullName): Remove hack.
16634 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
16635 Update to reflect changes.
16636 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16637 Use Attributes.Search instead of nested loops.
16639 2004-05-07 Marek Safar <marek.safar@seznam.cz>
16642 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
16643 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
16644 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
16646 * report.cs: (Report.Warning): Renamed to Warning_T because of
16647 parameter collision.
16649 2004-05-05 Raja R Harinath <rharinath@novell.com>
16651 * expression.cs (MemberAccess.ResolveMemberAccess):
16652 Exit with non-zero status after Report.Error.
16653 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
16655 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
16657 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
16659 * support.cs: Don't hang when the file is empty.
16661 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
16663 * support.cs: In SeekableStreamReader, compute the preamble size of the
16664 underlying stream. Position changes should take into account that initial
16667 2004-05-03 Todd Berman <tberman@sevenl.net>
16669 * driver.cs: remove unused GetSysVersion function.
16671 2004-05-03 Todd Berman <tberman@sevenl.net>
16673 * driver.cs: Remove the hack from saturday, as well as the hack
16674 from jackson (LoadAssemblyFromGac), also adds the CWD to the
16675 link_paths to get that bit proper.
16677 2004-05-01 Todd Berman <tberman@sevenl.net>
16679 * driver.cs: Try a LoadFrom before a Load, this checks the current
16680 path. This is currently a bug in mono that is be fixed, however, this
16681 provides a workaround for now. This will be removed when the bug
16684 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
16686 * CryptoConvert.cs: Updated to latest version. Fix issue with
16687 incomplete key pairs (#57941).
16689 2004-05-01 Todd Berman <tberman@sevenl.net>
16691 * driver.cs: Remove '.' from path_chars, now System.* loads properly
16694 2004-04-30 Jackson Harper <jackson@ximian.com>
16696 * codegen.cs: Open keys readonly.
16698 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16700 * typemanager.cs: don't report cyclic struct layout when a struct
16701 contains 2 or more fields of the same type. Failed for Pango.AttrShape
16702 which has 2 Pango.Rectangle fields.
16704 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
16706 * expression.cs: Handle IntPtr comparisons with IL code
16707 rather than a method call.
16709 2004-04-29 Martin Baulig <martin@ximian.com>
16711 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
16712 the list of PropertyInfo's in class hierarchy and find the
16713 accessor. Fixes #56013.
16715 2004-04-29 Martin Baulig <martin@ximian.com>
16717 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
16719 2004-04-29 Martin Baulig <martin@ximian.com>
16721 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16723 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
16725 2004-04-29 Martin Baulig <martin@ximian.com>
16727 * class.cs (ConstructorInitializer.Resolve): Check whether the
16728 parent .ctor is accessible. Fixes #52146.
16730 2004-04-29 Martin Baulig <martin@ximian.com>
16732 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16734 * statement.cs (Using.EmitLocalVariableDecls): Use
16735 TypeManager.idisposable_type, not typeof (IDisposable).
16736 (Foreach.EmitCollectionForeach): Added support for valuetypes.
16738 2004-04-29 Martin Baulig <martin@ximian.com>
16740 * class.cs (Event.Define): Don't emit the field and don't set
16741 RTSpecialName and SpecialName for events on interfaces. Fixes
16744 2004-04-29 Raja R Harinath <rharinath@novell.com>
16746 Refactor Attribute.ApplyAttributes.
16747 * attribute.cs (Attributable): New base class for objects that can
16748 have Attributes applied on them.
16749 (Attribute): Make AttributeUsage fields public.
16750 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
16751 (Attribute.IsInternalCall): New property.
16752 (Attribute.UsageAttr): Convert to a public read-only property.
16753 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
16754 (Attribute.ResolveType, Attribute.Resolve)
16755 (Attribute.ScanForIndexerName): Update to reflect changes.
16756 (Attribute.CheckAttributeTarget): Re-format.
16757 (Attribute.ApplyAttributes): Refactor, to various
16758 Attributable.ApplyAttributeBuilder methods.
16759 * decl.cs (MemberCore): Make Attributable.
16760 * class.cs (Accessor): Make Attributable.
16761 (MethodData.ApplyAttributes): Use proper attribute types, not
16763 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
16764 (TypeContainer.ApplyAttributeBuilder)
16765 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
16766 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
16767 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
16768 (Operator.ApplyAttributeBuilder): New factored-out methods.
16769 * const.cs (Const.ApplyAttributeBuilder): Likewise.
16770 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
16771 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
16772 * parameter.cs (ParameterBase): New Attributable base class
16773 that can also represent Return types.
16774 (Parameter): Update to the changes.
16776 2004-04-29 Jackson Harper <jackson@ximian.com>
16778 * driver.cs: Prefer the corlib system version when looking for
16779 assemblies in the GAC. This is still a hack, but its a better hack
16782 2004-04-29 Marek Safar <marek.safar@seznam.cz>
16784 * decl.cs, enum.cs: Improved error 3005 reporting.
16786 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
16787 (related_symbols): New private member for list of symbols
16788 related to reported error/warning.
16790 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
16792 2004-04-29 Martin Baulig <martin@ximian.com>
16794 * ecore.cs (Expression.Constantify): If we're an enum and
16795 TypeManager.TypeToCoreType() doesn't give us another type, use
16796 t.UnderlyingSystemType. Fixes #56178.
16798 2004-04-29 Martin Baulig <martin@ximian.com>
16800 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
16801 interfaces and for each interface, only add members directly
16802 declared in that interface. Fixes #53255.
16804 2004-04-28 Martin Baulig <martin@ximian.com>
16806 * expression.cs (ConditionalLogicalOperator): Use a temporary
16807 variable for `left' to avoid that we evaluate it more than once;
16810 2004-04-28 Martin Baulig <martin@ximian.com>
16812 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
16815 2004-04-28 Martin Baulig <martin@ximian.com>
16817 * statement.cs (LocalInfo.Resolve): Check whether the type is not
16820 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
16821 whether the type is not void (CS1547).
16823 2004-04-28 Martin Baulig <martin@ximian.com>
16825 * expression.cs (Unary.DoResolveLValue): Override this and report
16826 CS0131 for anything but Operator.Indirection.
16828 2004-04-28 Martin Baulig <martin@ximian.com>
16830 Committing a patch from Ben Maurer; see bug #50820.
16832 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16835 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16838 2004-04-28 Martin Baulig <martin@ximian.com>
16840 Committing a patch from Ben Maurer; see bug #50820.
16842 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16845 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16848 2004-04-28 Martin Baulig <martin@ximian.com>
16850 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
16851 (Block.AddLabel): Call DoLookupLabel() to only search in the
16854 2004-04-28 Martin Baulig <martin@ximian.com>
16856 * cfold.cs (ConstantFold.BinaryFold): Added special support for
16857 comparing StringConstants and NullLiterals in Equality and Inequality.
16859 2004-04-28 Jackson Harper <jackson@ximian.com>
16861 * driver.cs: Attempt to load referenced assemblies from the
16862 GAC. This is the quick and dirty version of this method that
16863 doesnt take into account versions and just takes the first
16864 canidate found. Will be good enough for now as we will not have more
16865 then one version installed into the GAC until I update this method.
16867 2004-04-28 Martin Baulig <martin@ximian.com>
16869 * typemanager.cs (TypeManager.CheckStructCycles): New public
16870 static method to check for cycles in the struct layout.
16872 * rootcontext.cs (RootContext.PopulateTypes): Call
16873 TypeManager.CheckStructCycles() for each TypeContainer.
16874 [Note: We only need to visit each type once.]
16876 2004-04-28 Martin Baulig <martin@ximian.com>
16878 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
16880 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
16881 success and added `out object value'. Use a `bool resolved' field
16882 to check whether we've already been called rather than
16883 `ConstantValue != null' since this breaks for NullLiterals.
16885 2004-04-28 Raja R Harinath <rharinath@novell.com>
16887 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
16888 setting of this flag, since the 'set' method may be non-public.
16890 2004-04-28 Raja R Harinath <rharinath@novell.com>
16892 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
16893 check on current_vector.Block.
16895 2004-04-27 Martin Baulig <martin@ximian.com>
16897 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
16898 a field initializer. Fixes #56459.
16900 2004-04-27 Martin Baulig <martin@ximian.com>
16902 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
16903 we're not attempting to use an indexer. Fixes #52154.
16905 2004-04-27 Martin Baulig <martin@ximian.com>
16907 * statement.cs (Return): Don't create a return label if we don't
16908 need it; reverts my change from January 20th. Thanks to Ben
16911 2004-04-27 Martin Baulig <martin@ximian.com>
16913 According to the spec, `goto' can only leave a nested scope, but
16916 * statement.cs (Block.LookupLabel): Only lookup in the current
16917 block, don't recurse into parent or child blocks.
16918 (Block.AddLabel): Check in parent and child blocks, report
16919 CS0140/CS0158 if we find a duplicate.
16920 (Block): Removed this indexer for label lookups.
16921 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
16922 this already does the error reporting for us.
16925 (FlowBranching.UsageVector.Block): New public variable; may be null.
16926 (FlowBranching.CreateSibling): Added `Block' argument.
16927 (FlowBranching.LookupLabel): New public virtual method. Lookup a
16928 label for the target of a `goto' and check whether we're not
16929 leaving a `finally'.
16931 2004-04-27 Martin Baulig <martin@ximian.com>
16933 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16934 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
16937 2004-04-27 Martin Baulig <martin@ximian.com>
16939 * statement.cs (Block.AddLabel): Also check for implicit blocks
16940 and added a CS0158 check.
16942 2004-04-27 Martin Baulig <martin@ximian.com>
16944 * flowanalysis.cs (FlowBranchingLoop): New class.
16945 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
16946 UsageVector's instead of an ArrayList.
16947 (FlowBranching.Label): Likewise.
16948 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
16949 (FlowBranching.AddBreakVector): New method.
16951 2004-04-27 Miguel de Icaza <miguel@ximian.com>
16953 * attribute.cs: Small regression fix: only convert the type if we
16954 the type is different, fixes System.Drawing build.
16956 2004-04-27 Martin Baulig <martin@ximian.com>
16958 * attribute.cs (Attribute.Resolve): If we have a constant value
16959 for a named field or property, implicity convert it to the correct
16962 2004-04-27 Raja R Harinath <rharinath@novell.com>
16964 * statement.cs (Block.Block): Implicit blocks share
16965 'child_variable_names' fields with parent blocks.
16966 (Block.AddChildVariableNames): Remove.
16967 (Block.AddVariable): Mark variable as "used by a child block" in
16968 every surrounding block.
16969 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
16970 been used in a child block, complain about violation of "Invariant
16971 meaning in blocks" rule.
16972 * cs-parser.jay (declare_local_variables): Don't use
16973 AddChildVariableNames.
16974 (foreach_statement): Don't create an implicit block: 'foreach'
16975 introduces a scope.
16977 2004-04-23 Miguel de Icaza <miguel@ximian.com>
16979 * convert.cs (ImplicitNumericConversion): 0 is also positive when
16980 converting from 0L to ulong. Fixes 57522.
16982 2004-04-22 Marek Safar <marek.safar@seznam.cz>
16984 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
16985 derived class hides via 'new' keyword field from base class (test-242.cs).
16986 TODO: Handle this in the more general way.
16988 * class.cs (CheckBase): Ditto.
16990 2004-04-22 Marek Safar <marek.safar@seznam.cz>
16992 * decl.cs (caching_flags): New member for storing cached values
16994 (MemberCore.Flags): New enum where bit flags for caching_flags
16996 (MemberCore.cls_compliance): Moved to caching_flags.
16997 (DeclSpace.Created): Moved to caching_flags.
16999 * class.cs: Use caching_flags instead of DeclSpace.Created
17001 2004-04-21 Miguel de Icaza <miguel@ximian.com>
17003 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
17004 if we are only a derived class, not a nested class.
17006 * typemanager.cs: Same as above, but do this at the MemberLookup
17007 level (used by field and methods, properties are handled in
17008 PropertyExpr). Allow for the qualified access if we are a nested
17011 2004-04-21 Marek Safar <marek.safar@seznam.cz>
17013 * class.cs: Refactoring.
17014 (IMethodData): New inteface; Holds links to parent members
17015 to avoid member duplication (reduced memory allocation).
17016 (Method): Implemented IMethodData interface.
17017 (PropertyBase): New inner classes for get/set methods.
17018 (PropertyBase.PropertyMethod): Implemented IMethodData interface
17019 (Event): New inner classes for add/remove methods.
17020 (Event.DelegateMethod): Implemented IMethodData interface.
17022 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
17023 EmitContext (related to class.cs refactoring).
17025 2004-04-21 Raja R Harinath <rharinath@novell.com>
17027 * delegate.cs (Delegate.VerifyApplicability): If the number of
17028 arguments are the same as the number of parameters, first try to
17029 verify applicability ignoring any 'params' modifier on the last
17033 2004-04-16 Raja R Harinath <rharinath@novell.com>
17035 * class.cs (TypeContainer.AddIndexer): Use
17036 'ExplicitInterfaceName' to determine if interface name was
17037 explicitly specified. 'InterfaceType' is not initialized at this time.
17038 (TypeContainer.DefineIndexers): Remove use of temporary list. The
17039 Indexers array is already in the required order. Initialize
17040 'IndexerName' only if there are normal indexers.
17041 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
17042 (TypeContainer.Emit): Emit DefaultMember attribute only if
17043 IndexerName is initialized.
17046 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
17048 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
17051 2004-04-15 Raja R Harinath <rharinath@novell.com>
17053 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
17057 * attribute.cs (Attribute.Resolve): Check for duplicate named
17061 2004-04-15 Miguel de Icaza <miguel@ximian.com>
17063 * iterators.cs (MarkYield): track whether we are in an exception,
17064 and generate code accordingly. Use a temporary value to store the
17065 result for our state.
17067 I had ignored a bit the interaction of try/catch with iterators
17068 since their behavior was not entirely obvious, but now it is
17069 possible to verify that our behavior is the same as MS .NET 2.0
17073 2004-04-14 Miguel de Icaza <miguel@ximian.com>
17075 * iterators.cs: Avoid creating temporaries if there is no work to
17078 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
17079 Enumerations, use TypeManager.EnumToUnderlying and call
17082 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
17085 (This.Emit): Use EmitContext.EmitThis to emit our
17088 (This.EmitAssign): Ditto.
17090 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
17091 codepaths, we will move all the functionality into
17094 (FieldExpr.EmitAssign): Ditto.
17096 This fixes several hidden bugs that I uncovered while doing a code
17097 review of this today.
17099 * codegen.cs (EmitThis): reworked so the semantics are more clear
17100 and also support value types "this" instances.
17102 * iterators.cs: Changed so that for iterators in value types, we
17103 do not pass the value type as a parameter.
17105 Initialization of the enumerator helpers is now done in the caller
17106 instead of passing the parameters to the constructors and having
17107 the constructor set the fields.
17109 The fields have now `assembly' visibility instead of private.
17111 2004-04-11 Miguel de Icaza <miguel@ximian.com>
17113 * expression.cs (Argument.Resolve): Check if fields passed as ref
17114 or out are contained in a MarshalByRefObject.
17116 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
17117 another compiler type.
17119 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
17121 * class.cs (Indexer.Define): use the new name checking method.
17122 Also, return false on an error.
17123 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
17124 (is_identifier_[start/part]_character): make static.
17126 2004-04-10 Miguel de Icaza <miguel@ximian.com>
17128 * expression.cs (Binary.ResolveOperator): Do no append strings
17129 twice: since we can be invoked more than once (array evaluation)
17130 on the same concatenation, take care of this here. Based on a fix
17131 from Ben (bug #56454)
17133 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
17135 * codegen.cs: Fix another case where CS1548 must be reported (when
17136 delay-sign isn't specified and no private is available #56564). Fix
17137 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
17138 error when MCS is used on the MS runtime and we need to delay-sign
17139 (which seems unsupported by AssemblyBuilder - see #56621).
17141 2004-04-08 Marek Safar <marek.safar@seznam.cz>
17143 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
17144 (TypeManager.ComputeNamespaces): Faster implementation for
17147 * compiler.csproj: Updated AssemblyName to mcs.
17149 2004-04-07 Miguel de Icaza <miguel@ximian.com>
17151 * rootcontext.cs: Add new types to the boot resolution.
17153 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
17154 MulticastDelegate is not allowed.
17156 * typemanager.cs: Add new types to lookup: System.TypedReference
17159 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
17160 check for TypedReference or ArgIterator, they are not allowed.
17162 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
17163 makes us properly catch 1510 in some conditions (see bug 56016 for
17166 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
17168 * CryptoConvert.cs: update from corlib version
17171 2004-04-05 Miguel de Icaza <miguel@ximian.com>
17173 * class.cs (Indexer.Define): Check indexername declaration
17175 2004-04-05 Marek Safar <marek.safar@seznam.cz>
17177 * attribute.cs (IsClsCompliant): Fixed problem with handling
17178 all three states (compliant, not-compliant, undetected).
17180 2004-03-30 Marek Safar <marek.safar@seznam.cz>
17182 * attribute.cs (Attribute): Location is now public.
17183 (Resolve): Store resolved arguments (pos_values) in attribute class.
17184 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
17185 (GetClsCompliantAttributeValue): New method that gets
17186 CLSCompliantAttribute value.
17187 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
17188 if exists else null.
17189 (AttributeTester): New class for CLS-Compliant verification routines.
17191 * class.cs (Emit): Add CLS-Compliant verification.
17192 (Method.GetSignatureForError): Implemented.
17193 (Constructor.GetSignatureForError): Implemented
17194 (Constructor.HasCompliantArgs): Returns if constructor has
17195 CLS-Compliant arguments.
17196 (Constructor.Emit): Override.
17197 (Construcor.IsIdentifierClsCompliant): New method; For constructors
17198 is needed to test only parameters.
17199 (FieldBase.GetSignatureForError): Implemented.
17200 (TypeContainer): New member for storing base interfaces.
17201 (TypeContainer.FindMembers): Search in base interfaces too.
17203 * codegen.cs (GetClsComplianceAttribute): New method that gets
17204 assembly or module CLSCompliantAttribute value.
17205 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
17207 (ModuleClass.Emit): Add error 3012 test.
17209 * const.cs (Emit): Override and call base for CLS-Compliant tests.
17211 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
17212 state for all decl types.
17213 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
17214 if CLS-Compliant tests are required.
17215 (IsClsCompliaceRequired): New method. Analyze whether code
17216 must be CLS-Compliant.
17217 (IsExposedFromAssembly): New method. Returns true when MemberCore
17218 is exposed from assembly.
17219 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
17220 value or gets cached value.
17221 (HasClsCompliantAttribute): New method. Returns true if MemberCore
17222 is explicitly marked with CLSCompliantAttribute.
17223 (IsIdentifierClsCompliant): New abstract method. This method is
17224 used to testing error 3005.
17225 (IsIdentifierAndParamClsCompliant): New method. Common helper method
17226 for identifier and parameters CLS-Compliant testing.
17227 (VerifyClsCompliance): New method. The main virtual method for
17228 CLS-Compliant verifications.
17229 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
17230 null. I don't know why is null (too many public members !).
17231 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
17232 and get value of first CLSCompliantAttribute that found.
17234 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
17235 (VerifyClsCompliance): Override and add extra tests.
17237 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
17238 clscheck- disable CLS-Compliant verification event if assembly is has
17239 CLSCompliantAttribute(true).
17241 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
17242 ApllyAttribute is now called in emit section as in the other cases.
17243 Possible future Emit integration.
17244 (IsIdentifierClsCompliant): New override.
17245 (VerifyClsCompliance): New override.
17246 (GetEnumeratorName): Returns full enum name.
17248 * parameter.cs (GetSignatureForError): Implemented.
17250 * report.cs (WarningData): New struct for Warning message information.
17251 (LocationOfPreviousError): New method.
17252 (Warning): New method. Reports warning based on the warning table.
17253 (Error_T): New method. Reports error based on the error table.
17255 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
17256 verifications are done here.
17258 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
17260 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
17261 CLSCompliantAttribute.
17262 (all_imported_types): New member holds all imported types from other
17264 (LoadAllImportedTypes): New method fills static table with exported types
17265 from all referenced assemblies.
17266 (Modules): New property returns all assembly modules.
17268 2004-03-30 Miguel de Icaza <miguel@ximian.com>
17270 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
17271 throwing a parser error.
17273 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
17274 which removes the hardcoded get_/set_ prefixes for properties, as
17275 IL allows for the properties to be named something else.
17279 * expression.cs: Do not override operand before we know if it is
17280 non-null. Fix 56207
17282 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17284 * typemanager.cs: support for pinned variables.
17286 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17288 * decl.cs, typemanager.cs: Avoid using an arraylist
17289 as a buffer if there is only one result set.
17291 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17293 * expression.cs: Make sure you cant call a static method
17294 with an instance expression, bug #56174.
17296 2004-03-29 Miguel de Icaza <miguel@ximian.com>
17298 * class.cs (IsDuplicateImplementation): Improve error reporting to
17299 flag 663 (method only differs in parameter modifier).
17301 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
17302 in preprocessor directives.
17304 * location.cs (LookupFile): Allow for the empty path.
17306 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
17307 better approach for some of that patch, but its failing with the
17308 CharSet enumeration. For now try/catch will do.
17310 * typemanager.cs: Do not crash if a struct does not have fields.
17313 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17315 * expression.cs: cs0213, cant fix a fixed expression.
17318 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17320 * cs-parser.jay: detect invalid embeded statements gracefully.
17323 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17325 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
17328 the invocation type may not be a subclass of the tye of the item/
17329 The type of the item must be a subclass of the invocation item.
17334 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
17336 * attribute.cs: Added methods to get a string and a bool from an
17337 attribute. Required to information from AssemblyKeyFileAttribute,
17338 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
17339 * codegen.cs: Modified AssemblyName creation to include support for
17340 strongnames. Catch additional exceptions to report them as CS1548.
17341 * compiler.csproj: Updated include CryptoConvert.cs.
17342 * compiler.csproj.user: Removed file - user specific configuration.
17343 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
17344 Mono.Security assembly. The original class is maintained and tested in
17345 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
17346 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
17347 like CSC 8.0 (C# v2) supports.
17348 * Makefile: Added CryptoConvert.cs to mcs sources.
17349 * rootcontext.cs: Added new options for strongnames.
17351 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
17353 * driver.cs: For --expect-error, report error code `2'
17354 if the program compiled with no errors, error code `1' if
17355 it compiled with an error other than the one expected.
17357 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
17359 * compiler.csproj: Updated for Visual Studio .NET 2003.
17360 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
17361 * compiler.sln: Updated for Visual Studio .NET 2003.
17363 2004-03-24 Ravi Pratap M <ravi@ximian.com>
17365 * expression.cs: Fix bug #47234. We basically need to apply the
17366 rule that we prefer the conversion of null to a reference type
17367 when faced with a conversion to 'object' (csc behaviour).
17369 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17371 * statement.cs: Shorter form for foreach, eliminates
17372 a local variable. r=Martin.
17374 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17376 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
17377 checks if we can use brtrue/brfalse to test for 0.
17378 * expression.cs: use the above in the test for using brtrue/brfalse.
17379 cleanup code a bit.
17381 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17383 * expression.cs: Rewrite string concat stuff. Benefits:
17385 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
17386 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
17387 rather than a concat chain.
17389 * typemanager.cs: Add lookups for more concat overloads.
17391 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17393 * expression.cs: Emit shorter il code for array init.
17410 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
17412 * statement.cs: Before, two switch blocks would be merged if the
17413 total size of the blocks (end_item - begin_item + 1) was less than
17414 two times the combined sizes of the blocks.
17416 Now, it will only merge if after the merge at least half of the
17421 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
17423 * class.cs : csc build fix for GetMethods(). See bug #52503.
17425 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
17427 * expression.cs: Make sure fp comparisons work with NaN.
17428 This fixes bug #54303. Mig approved this patch a long
17429 time ago, but we were not able to test b/c the runtime
17432 2004-03-19 Miguel de Icaza <miguel@ximian.com>
17434 * ecore.cs (TypExpr.GetHashCode): implement this overload.
17436 2004-03-19 Martin Baulig <martin@ximian.com>
17438 * class.cs (MemberCore.IsDuplicateImplementation): Report the
17439 error here and not in our caller.
17441 2004-03-19 Martin Baulig <martin@ximian.com>
17443 * interface.cs: Completely killed this file.
17444 (Interface): We're now a TypeContainer and live in class.cs.
17446 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
17447 argument; we're now also called for interfaces.
17448 (TypeContainer.DefineMembers): Allow this method being called
17450 (TypeContainer.GetMethods): New public method; formerly known as
17451 Interface.GetMethod(). This is used by PendingImplementation.
17452 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
17453 it's now private and non-static.
17454 (Interface): Moved this here; it's now implemented similar to
17456 (Method, Property, Event, Indexer): Added `bool is_interface'
17457 argument to their .ctor's.
17458 (MemberBase.IsInterface): New public field.
17460 * cs-parser.jay: Create normal Method, Property, Event, Indexer
17461 instances instead of InterfaceMethod, InterfaceProperty, etc.
17462 (opt_interface_base): Removed; we now use `opt_class_base' instead.
17463 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
17465 2004-03-19 Martin Baulig <martin@ximian.com>
17467 * class.cs (MethodCore.IsDuplicateImplementation): New private
17468 method which does the CS0111 checking.
17469 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
17470 Use IsDuplicateImplementation().
17472 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
17474 * decl.cs (FindMemberToOverride): New method to find the correct
17475 method or property to override in the base class.
17477 - Make Method/Property use the above method to find the
17478 version in the base class.
17479 - Remove the InheritableMemberSignatureCompare as it is now
17482 This patch makes large code bases much faster to compile, as it is
17483 O(n) rather than O(n^2) to do this validation.
17485 Also, it fixes bug 52458 which is that nested classes are not
17486 taken into account when finding the base class member.
17488 Reviewed/Approved by Martin.
17490 2004-03-17 Marek Safar <marek.safar@seznam.cz>
17492 * interface.cs: In all interface classes removed redundant
17493 member initialization.
17495 2004-03-16 Martin Baulig <martin@ximian.com>
17497 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
17499 2004-03-15 Miguel de Icaza <miguel@ximian.com>
17501 * decl.cs (DefineTypeAndParents): New helper method to define a
17502 type's containers before the type itself is defined; This is a
17503 bug exposed by the recent changes to Windows.Forms when an
17504 implemented interface was defined inside a class that had not been
17507 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
17509 (Check): Loop correctly to report errors modifiers
17510 (UNSAFE was not in the loop, since it was the same as TOP).
17512 * interface.cs: Every interface member now takes a ModFlags,
17513 instead of a "is_new" bool, which we set on the base MemberCore.
17515 Every place where we called "UnsafeOk" in the interface, now we
17516 call the proper member (InterfaceMethod.UnsafeOK) instead to get
17517 the unsafe settings from the member declaration instead of the
17518 container interface.
17520 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
17522 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
17523 `set_indexer_name' to the pending bits (one per type).
17525 We fixed a bug today that was picking the wrong method to
17526 override, since for properties the existing InterfaceMethod code
17527 basically ignored the method name. Now we make sure that the
17528 method name is one of the valid indexer names.
17530 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
17532 * support.cs (SeekableStreamReader): Keep track of stream byte
17533 positions and don't mix them with character offsets to the buffer.
17535 Patch from Gustavo Giráldez
17537 2004-03-15 Marek Safar <marek.safar@seznam.cz>
17539 * interface.cs (InterfaceSetGetBase): Removed double member
17540 initialization, base class does it as well.
17542 2004-03-13 Martin Baulig <martin@ximian.com>
17544 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
17545 when compiling corlib.
17547 2004-03-13 Miguel de Icaza <miguel@ximian.com>
17549 * convert.cs (ExplicitConversion): We were reporting an error on
17550 certain conversions (object_type source to a value type, when the
17551 expression was `null') before we had a chance to pass it through
17552 the user defined conversions.
17554 * driver.cs: Replace / and \ in resource specifications to dots.
17557 * class.cs: Add check for duplicate operators. Fixes 52477
17559 2004-03-11 Miguel de Icaza <miguel@ximian.com>
17561 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
17562 that are in the middle of the statements, not only at the end.
17565 * class.cs (TypeContainer.AddField): No longer set the
17566 `HaveStaticConstructor' flag, now we call it
17567 `UserDefineStaticConstructor' to diferentiate the slightly
17568 semantic difference.
17570 The situation is that we were not adding BeforeFieldInit (from
17571 Modifiers.TypeAttr) to classes that could have it.
17572 BeforeFieldInit should be set to classes that have no static
17577 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
17579 And most importantly Zoltan's comment:
17581 http://bugzilla.ximian.com/show_bug.cgi?id=44229
17583 "I think beforefieldinit means 'it's ok to initialize the type sometime
17584 before its static fields are used', i.e. initialization does not need
17585 to be triggered by the first access to the type. Setting this flag
17586 helps the JIT to compile better code, since it can run the static
17587 constructor at JIT time, and does not need to generate code to call it
17588 (possibly lots of times) at runtime. Unfortunately, mcs does not set
17589 this flag for lots of classes like String.
17591 csc sets this flag if the type does not have an explicit static
17592 constructor. The reasoning seems to be that if there are only static
17593 initalizers for a type, and no static constructor, then the programmer
17594 does not care when this initialization happens, so beforefieldinit
17597 This bug prevents the AOT compiler from being usable, since it
17598 generates so many calls to mono_runtime_class_init that the AOT code
17599 is much slower than the JITted code. The JITted code is faster,
17600 because it does not generate these calls if the vtable is type is
17601 already initialized, which is true in the majority of cases. But the
17602 AOT compiler can't do this."
17604 2004-03-10 Miguel de Icaza <miguel@ximian.com>
17606 * class.cs (MethodData.Emit): Refactor the code so symbolic
17607 information is generated for destructors; For some reasons we
17608 were taking a code path that did not generate symbolic information
17611 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
17613 * class.cs: Create a Constructor.CheckBase method that
17614 takes care of all validation type code. The method
17615 contains some code that was moved from Define.
17617 It also includes new code that checks for duplicate ctors.
17618 This fixes bug #55148.
17620 2004-03-09 Joshua Tauberer <tauberer@for.net>
17622 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
17623 a { ... }-style array creation invokes EmitStaticInitializers
17624 which is not good for reference-type arrays. String, decimal
17625 and now null constants (NullCast) are not counted toward
17626 static initializers.
17628 2004-03-05 Martin Baulig <martin@ximian.com>
17630 * location.cs (SourceFile.HasLineDirective): New public field;
17631 specifies whether the file contains or is referenced by a "#line"
17633 (Location.DefineSymbolDocuments): Ignore source files which
17634 either contain or are referenced by a "#line" directive.
17636 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
17638 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
17639 direct access to our parent, so check the method inline there.
17641 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
17643 * expression.cs (Invocation.EmitCall): Miguel's last commit
17644 caused a regression. If you had:
17649 In Foo the implict this would be null.
17651 2004-02-27 Miguel de Icaza <miguel@ximian.com>
17653 * expression.cs (Invocation.EmitCall): If the method is not
17654 virtual, do not emit a CallVirt to it, use Call.
17656 * typemanager.cs (GetFullNameSignature): Improve the method to
17657 cope with ".ctor" and replace it with the type name.
17659 * class.cs (ConstructorInitializer.Resolve): Now the method takes
17660 as an argument the ConstructorBuilder where it is being defined,
17661 to catch the recursive constructor invocations.
17663 2004-02-26 Miguel de Icaza <miguel@ximian.com>
17665 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
17666 routines to check if a type is an enumerable/enumerator allow
17667 classes that implement the IEnumerable or IEnumerator interfaces.
17669 * class.cs (Property, Operator): Implement IIteratorContainer, and
17670 implement SetYields.
17672 (Property.Define): Do the block swapping for get_methods in the
17673 context of iterators. We need to check if Properties also
17674 include indexers or not.
17676 (Operator): Assign the Block before invoking the
17677 OperatorMethod.Define, so we can trigger the Iterator code
17680 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
17681 Property and Operator classes are not created when we parse the
17682 declarator but until we have the block completed, so we use a
17683 singleton SimpleIteratorContainer.Simple to flag whether the
17684 SetYields has been invoked.
17686 We propagate this setting then to the Property or the Operator to
17687 allow the `yield' to function.
17689 2004-02-25 Marek Safar <marek.safar@seznam.cz>
17691 * codegen.cs: Implemented attribute support for modules.
17692 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
17693 Assembly/Module functionality.
17695 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
17696 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
17697 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
17699 2004-02-16 Marek Safar <marek.safar@seznam.cz>
17701 * interface.cs (FindMembers): The operation is performed on all base
17702 interfaces and not only on the first. It is required for future CLS Compliance patch.
17704 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
17706 * statement.cs, codegen.cs:
17707 This patch deals with patterns such as:
17709 public class List : IEnumerable {
17711 public MyEnumerator GetEnumerator () {
17712 return new MyEnumerator(this);
17715 IEnumerator IEnumerable.GetEnumerator () {
17719 public struct MyEnumerator : IEnumerator {
17724 Before, there were a few things we did wrong:
17725 1) we would emit callvirt on a struct, which is illegal
17726 2) we emited ldarg when we needed to emit ldarga
17727 3) we would mistakenly call the interface methods on an enumerator
17728 type that derived from IEnumerator and was in another assembly. For example:
17730 public class MyEnumerator : IEnumerator
17732 Would have the interface methods called, even if there were public impls of the
17733 method. In a struct, this lead to invalid IL code.
17735 2004-02-11 Marek Safar <marek.safar@seznam.cz>
17737 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
17740 * delegate.cs (Define): Fixed crash when delegate type is undefined.
17742 2004-02-11 Miguel de Icaza <miguel@ximian.com>
17744 * cs-parser.jay: Fix small regression: we were not testing V2
17745 compiler features correctly.
17747 * interface.cs: If the emit context is null, then create one
17749 2004-02-09 Marek Safar <marek.safar@seznam.cz>
17751 * decl.cs (GetSignatureForError): New virtual method to get full name
17752 for error messages.
17754 * attribute.cs (IAttributeSupport): New interface for attribute setting.
17755 Now it is possible to rewrite ApplyAttributes method to be less if/else.
17757 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
17758 Duplicated members and code in these classes has been removed.
17759 Better encapsulation in these classes.
17761 2004-02-07 Miguel de Icaza <miguel@ximian.com>
17763 * assign.cs (Assign.DoResolve): When dealing with compound
17764 assignments, there is a new rule in ECMA C# 2.4 (might have been
17765 there before, but it is documented here) that states that in:
17769 If b is of type int, and the `op' is a shift-operator, then the
17770 above is evaluated as:
17774 * expression.cs (Binary.ResolveOperator): Instead of testing for
17775 int/uint/long/ulong, try to implicitly convert to any of those
17776 types and use that in pointer arithmetic.
17778 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
17779 method to print information for from the type, not from the
17780 null-method we were given.
17782 2004-02-01 Duncan Mak <duncan@ximian.com>
17784 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
17785 parsing for cmd, fixes bug #53694.
17787 2004-02-04 Marek Safar <marek.safar@seznam.cz>
17789 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
17790 in the member name duplication tests. Property and operator name duplication
17791 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
17793 2004-02-03 Marek Safar <marek.safar@seznam.cz>
17795 * interface.cs (PopulateMethod): Fixed crash when interface method
17796 returns not existing type (error test cs0246-3.cs).
17798 2004-02-02 Ravi Pratap M <ravi@ximian.com>
17800 * cs-parser.jay (interface_accessors): Re-write actions to also
17801 store attributes attached to get and set methods. Fix spelling
17804 (inteface_property_declaration): Modify accordingly.
17806 (InterfaceAccessorInfo): New helper class to store information to pass
17807 around between rules that use interface_accessors.
17809 * interface.cs (Emit): Apply attributes on the get and set
17810 accessors of properties and indexers too.
17812 * attribute.cs (ApplyAttributes): Modify accordingly to use the
17813 right MethodBuilder when applying attributes to the get and set accessors.
17815 2004-01-31 Miguel de Icaza <miguel@ximian.com>
17817 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
17819 2004-01-26 Miguel de Icaza <miguel@ximian.com>
17821 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
17823 2004-01-25 Miguel de Icaza <miguel@ximian.com>
17825 * cs-parser.jay: Remove YIELD token, instead use the new grammar
17826 changes that treat `yield' specially when present before `break'
17827 or `return' tokens.
17829 * cs-tokenizer.cs: yield is no longer a keyword.
17831 2004-01-23 Marek Safar <marek.safar@seznam.cz>
17833 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
17834 setting for default constructors.
17835 For default constructors are almost every time set wrong Modifier. The
17836 generated IL code has been alright. But inside mcs this values was
17837 wrong and this was reason why several of my CLS Compliance tests
17840 2004-01-22 Martin Baulig <martin@ximian.com>
17842 * cs-parser.jay (namespace_or_type_name): Return an Expression,
17843 not a QualifiedIdentifier. This is what `type_name_expression'
17844 was previously doing.
17845 (type_name_expression): Removed; the code is now in
17846 `namespace_or_type_name'.
17847 (qualified_identifier): Removed, use `namespace_or_type_name'
17849 (QualifiedIdentifier): Removed this class.
17851 2004-01-22 Martin Baulig <martin@ximian.com>
17853 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
17854 not a string as alias name.
17856 2004-01-21 Miguel de Icaza <miguel@ximian.com>
17858 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
17859 #52730 bug, and instead compute correctly the need to use a
17860 temporary variable when requesting an address based on the
17861 static/instace modified of the field and the constructor.
17863 2004-01-21 Martin Baulig <martin@ximian.com>
17865 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
17866 class and namespace before looking up aliases. Fixes #52517.
17868 2004-01-21 Martin Baulig <martin@ximian.com>
17870 * flowanalysis.cs (UsageVector.Merge): Allow variables being
17871 assinged in a 'try'; fixes exception4.cs.
17873 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17874 * class.cs : Implemented parameter-less constructor for TypeContainer
17876 * decl.cs: Attributes are now stored here. New property OptAttributes
17878 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
17880 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
17882 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17884 * typemanager.cs (CSharpSignature): Now reports also inner class name.
17885 (CSharpSignature): New method for indexer and property signature.
17887 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17889 * pending.cs (IsVirtualFilter): Faster implementation.
17891 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17893 * typemanager.cs: Avoid inclusion of same assembly more than once.
17895 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17897 * cs-parser.jay: Fixed problem where the last assembly attribute
17898 has been applied also to following declaration (class, struct, etc.)
17900 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17902 * class.cs: Added error CS0538, CS0539 reporting.
17903 Fixed crash on Microsoft runtime when field type is void.
17905 * cs-parser.jay: Added error CS0537 reporting.
17907 * pending.cs: Added error CS0535 reporting.
17908 Improved error report for errors CS0536, CS0534.
17910 2004-01-20 Miguel de Icaza <miguel@ximian.com>
17912 Merge a few bits from the Anonymous Method MCS tree.
17914 * statement.cs (ToplevelBlock): New class for toplevel methods,
17915 will hold anonymous methods, lifted variables.
17917 * cs-parser.jay: Create toplevel blocks for delegates and for
17918 regular blocks of code.
17920 2004-01-20 Martin Baulig <martin@ximian.com>
17922 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
17923 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
17924 and `NeedExplicitReturn'; added `IsLastStatement'.
17925 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
17926 have a `ReturnLabel' or we're not unreachable.
17928 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
17929 child's reachability; don't just override ours with it. Fixes
17930 #58058 (lluis's example).
17931 (FlowBranching): Added public InTryOrCatch(), InCatch(),
17932 InFinally(), InLoop(), InSwitch() and
17933 BreakCrossesTryCatchBoundary() methods.
17935 * statement.cs (Return): Do all error checking in Resolve().
17936 Unless we are the last statement in a top-level block, always
17937 create a return label and jump to it.
17938 (Break, Continue): Do all error checking in Resolve(); also make
17939 sure we aren't leaving a `finally'.
17940 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
17941 statement in a top-level block.
17942 (Block.Flags): Added `IsDestructor'.
17943 (Block.IsDestructor): New public property.
17945 2004-01-20 Martin Baulig <martin@ximian.com>
17947 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
17949 2004-01-20 Martin Baulig <martin@ximian.com>
17951 * statement.cs (Statement.ResolveUnreachable): New public method.
17952 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
17953 (Block.Resolve): Resolve unreachable statements.
17955 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
17957 * expression.cs: We need to fix the case where we do
17958 not have a temp variable here.
17960 * assign.cs: Only expression compound assignments need
17961 temporary variables.
17963 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
17965 * flowanalysis.cs: Reduce memory allocation in a few ways:
17966 - A block with no variables should not allocate a bit
17968 - A method with no out parameters does not need any tracking
17969 for assignment of the parameters, so we need not allocate
17972 public readonly Type[] VariableTypes;
17973 public readonly string[] VariableNames;
17974 Are redundant. The data is already stored in the variable
17975 map, so we need not allocate another array for it.
17976 - We need to add alot of checks for if (params | locals) == null
17977 due to the first two changes.
17979 2004-01-18 Miguel de Icaza <miguel@ximian.com>
17981 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
17982 implement IMemoryLocation, we store a copy on a local variable and
17983 take the address of it. Patch from Benjamin Jemlich
17985 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
17986 to use a special "type_name_expression" rule which reduces the
17987 number of "QualifiedIdentifier" classes created, and instead
17988 directly creates MemberAccess expressions.
17990 2004-01-17 Miguel de Icaza <miguel@ximian.com>
17992 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
17993 that fixes #52853. Null literal assignment to ValueType
17995 * class.cs (MethodData.Emit): Instead of checking the name of the
17996 method to determine if its a destructor, create a new derived
17997 class from Method called Destructor, and test for that.
17999 * cs-parser.jay: Create a Destructor object instead of a Method.
18001 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
18005 2004-01-16 Miguel de Icaza <miguel@ximian.com>
18007 * expression.cs (Binary.ResolveOperator): Perform an implicit
18008 conversion from MethodGroups to their delegate types on the
18009 Addition operation.
18011 * delegate.cs: Introduce a new class DelegateCreation that is the
18012 base class for `NewDelegate' and `ImplicitDelegateCreation',
18013 factor some code in here.
18015 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
18016 conversion from MethodGroups to compatible delegate types.
18018 * ecore.cs (Expression.Resolve): Do not flag error 654
18019 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
18020 we allow conversions from MethodGroups to delegate types now.
18022 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
18023 assignments in v2 either.
18025 2004-01-10 Miguel de Icaza <miguel@ximian.com>
18027 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
18028 static read-only fields in ctors.
18030 Applied patch from Benjamin Jemlich
18032 * expression.cs (UnaryMutator): Avoid leaking local variables.
18034 2004-01-09 Miguel de Icaza <miguel@ximian.com>
18036 * cs-tokenizer.cs (IsCastToken): Allow the various native types
18037 here to return true, as they can be used like this:
18039 (XXX) int.MEMBER ()
18041 Fixed 49836 and all the other dups
18043 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
18045 * driver.cs: Implement /win32res and /win32icon.
18047 2004-01-08 Miguel de Icaza <miguel@ximian.com>
18049 * cs-parser.jay: Add a rule to improve error handling for the
18050 common mistake of placing modifiers after the type.
18052 2004-01-07 Miguel de Icaza <miguel@ximian.com>
18054 * cs-parser.jay (interface_event_declaration): Catch
18055 initialization of events on interfaces, and report cs0068
18057 * cs-parser.jay (interface_event_declaration): Catch
18058 initialization of events.
18060 * ecore.cs: Better report missing constructors.
18062 * expression.cs (Binary.ResolveOperator): My previous bug fix had
18063 the error reporting done in the wrong place. Fix.
18065 * expression.cs (Binary.ResolveOperator): Catch the
18066 operator + (E x, E y) error earlier, and later allow for implicit
18067 conversions in operator +/- (E e, U x) from U to the underlying
18070 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
18071 52596, if the container class is abstract, the default constructor
18072 is protected otherwise its public (before, we were always public).
18074 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
18077 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
18078 Jemlich that fixes bug #52597, MCS was generating invalid code for
18079 idisposable structs. Thanks to Ben for following up with this
18082 2004-01-06 Miguel de Icaza <miguel@ximian.com>
18084 * driver.cs: Allow assemblies without code to be generated, fixes
18087 2004-01-07 Nick Drochak <ndrochak@gol.com>
18089 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
18091 2004-01-05 Miguel de Icaza <miguel@ximian.com>
18093 * cs-parser.jay: Add rules to improve error reporting if fields or
18094 methods are declared at the namespace level (error 116)
18096 * Add rules to catch event add/remove
18098 2004-01-04 David Sheldon <dave-mono@earth.li>
18100 * expression.cs: Added matching ")" to error message for
18103 2004-01-03 Todd Berman <tberman@gentoo.org>
18105 * ecore.cs, attribute.cs:
18106 Applying fix from #52429.
18108 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18110 * ecore.cs, expression.cs, statement.cs:
18111 Total rewrite of how we handle branching. We
18112 now handle complex boolean expressions with fewer
18113 jumps. As well if (x == 0) no longer emits a ceq.
18115 if (x is Foo) is much faster now, because we generate
18118 Overall, we get a pretty big improvement on our benchmark
18119 tests. The code we generate is smaller and more readable.
18121 I did a full two-stage bootstrap. The patch was reviewed
18122 by Martin and Miguel.
18124 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18126 * cs-parser.jay: Make primary_expression not take a QI.
18127 we dont need this because the member_access rule covers
18128 us here. So we replace the rule with just IDENTIFIER.
18130 This has two good effects. First, we remove a s/r conflict.
18131 Second, we allocate many fewer QualifiedIdentifier objects.
18133 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18135 * attribute.cs: Handle MarshalAs attributes as pseudo, and
18136 set the correct information via SRE. This prevents
18137 hanging on the MS runtime. Fixes #29374.
18139 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
18141 * convert.cs: correctly handle conversions to value types
18142 from Enum and ValueType as unboxing conversions.
18144 Fixes bug #52569. Patch by Benjamin Jemlich.
18146 2004-01-02 Ravi Pratap <ravi@ximian.com>
18148 * expression.cs (BetterConversion): Prefer int -> uint
18149 over int -> ulong (csc's behaviour). This fixed bug #52046.
18151 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
18153 * decl.cs (MemberCache.FindMembers): now returns a
18156 * typemanager.cs: In general, go with with ^^.
18157 (CopyNewMethods): take an IList.
18158 (RealMemberLookup): Only allocate an arraylist
18159 if we copy from two sets of methods.
18161 This change basically does two things:
18162 1) Fewer array lists allocated due to CopyNewMethods.
18163 2) the explicit cast in MemberList costed ALOT.
18165 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
18167 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
18168 a hashtable to avoid needless string allocations when an identifier is
18169 used more than once (the common case).
18171 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
18173 * pending.cs: MS's TypeBuilder.GetInterfaces ()
18174 is broken, it will not return anything. So, we
18175 have to use the information we have in mcs to
18178 * typemanager.cs: Add a cache for GetInterfaces,
18179 since this will now be used more often (due to ^^)
18181 (GetExplicitInterfaces) New method that gets the
18182 declared, not effective, interfaces on a type
18183 builder (eg, if you have interface IFoo, interface
18184 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
18187 This patch makes MCS able to bootstrap itself on
18190 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
18192 * expression.cs: Remove the Nop's that Miguel put
18195 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18197 * report.cs, codegen.cs: Give the real stack trace to
18198 the error when an exception is thrown.
18200 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18202 * decl.cs: only allocate hashtables for ifaces if
18205 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
18207 * expression.cs: fix the error from cs0121-2.cs
18208 (a parent interface has two child interfaces that
18209 have a function with the same name and 0 params
18210 and the function is called through the parent).
18212 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
18214 * class.cs, rootcontext.cs, typmanager.cs: do not
18217 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
18219 * codegen.cs: remove stack for the ec flow branching.
18220 It is already a linked list, so no need.
18222 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
18224 * Makefile: Allow custom profiler here.
18226 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
18228 * typemanager.cs (LookupType):
18229 - Use a static char [], because split takes
18230 a param array for args, so it was allocating
18232 - Do not store true in a hashtable, it boxes.
18234 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
18236 * flowanalysis.cs: bytify common enums.
18238 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18240 * modifiers.cs: Add a new set of flags for the
18241 flags allowed on explicit interface impls.
18242 * cs-parser.jay: catch the use of modifiers in
18243 interfaces correctly.
18244 * class.cs: catch private void IFoo.Blah ().
18246 All related to bug #50572.
18248 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18250 * decl.cs: Rewrite the consistant accessability checking.
18251 Accessability is not linear, it must be implemented in
18252 a tableish way. Fixes #49704.
18254 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
18256 * expression.cs: Handle negation in a checked context.
18257 We must use subtraction from zero. Fixes #38674.
18259 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
18261 * class.cs: Ignore static void main in DLLs.
18262 * rootcontext.cs: Handle the target type here,
18263 since we are have to access it from class.cs
18264 * driver.cs: account for the above.
18266 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
18268 * report.cs: Give line numbers and files if available.
18270 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
18272 * driver.cs: Implement /addmodule.
18274 * typemanager.cs: Change 'modules' field so it now contains Modules not
18277 2003-12-20 Martin Baulig <martin@ximian.com>
18279 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
18280 (FieldBase.IsAssigned): Removed this field.
18281 (FieldBase.SetAssigned): New public method.
18282 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
18284 2003-12-20 Martin Baulig <martin@ximian.com>
18286 * expression.cs (LocalVariableReference.DoResolve): Don't set
18287 `vi.Used' if we're called from DoResolveLValue().
18289 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
18290 returns the usage vector it just merged into the current one -
18291 pass this one to UsageWarning().
18292 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
18293 of the `EmitContext', don't call this recursively on our children.
18295 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
18297 * driver.cs: Implement /target:module.
18299 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
18301 * support.cs (CharArrayHashtable): New helper class.
18303 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
18304 char arrays, not strings, so we can avoid creating a string in
18305 consume_identifier if the identifier is a keyword.
18307 2003-12-16 Martin Baulig <martin@ximian.com>
18309 * statement.cs (LocalInfo.Assigned): Removed this property.
18310 (LocalInfo.Flags): Removed `Assigned'.
18311 (LocalInfo.IsAssigned): New public method; takes the EmitContext
18312 and uses flow analysis.
18313 (Block.UsageWarning): Made this method private.
18314 (Block.Resolve): Call UsageWarning() if appropriate.
18316 * expression.cs (LocalVariableReference.DoResolve): Always set
18317 LocalInfo.Used here.
18319 2003-12-13 Martin Baulig <martin@ximian.com>
18321 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
18322 any value here; we're now using flow analysis to figure out
18323 whether a statement/block returns a value.
18325 2003-12-13 Martin Baulig <martin@ximian.com>
18327 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
18329 (FlowBranching.MergeFinally): Don't call
18330 `branching.CheckOutParameters()' here, this is called in
18332 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
18333 when adding the `finally' vector.
18335 2003-12-13 Martin Baulig <martin@ximian.com>
18338 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
18339 actually work and also fix #48962.
18341 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
18343 * decl.cs: Do not check System.Object for nested types,
18344 since we know it does not have any. Big bang for buck:
18347 Run 1: 8.35 seconds
18348 Run 2: 8.32 seconds
18349 corlib: 17.99 seconds
18351 Run 1: 8.17 seconds
18352 Run 2: 8.17 seconds
18353 corlib: 17.39 seconds
18355 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
18357 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
18358 time we are returning 0 members, so we save alot here.
18360 2003-12-11 Martin Baulig <martin@ximian.com>
18362 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
18363 `MergeChild()', also just take the `FlowBranching' as argument;
18364 call Merge() on it and return the result.
18365 (FlowBranching.Merge): We don't need to do anything if we just
18368 2003-12-11 Martin Baulig <martin@ximian.com>
18370 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
18371 them in an `ArrayList' to reduce memory usage. Thanks to Ben
18372 Maurer for this idea.
18374 2003-12-11 Martin Baulig <martin@ximian.com>
18376 * flowanalysis.cs (MergeResult): This class is now gone; we now
18377 use the `UsageVector' for this. The reason for this is that if a
18378 branching just has one sibling, we don't need to "merge" them at
18379 all - that's the next step to do.
18380 (FlowBranching.Merge): We now return a `UsageVector' instead of a
18383 2003-12-11 Martin Baulig <martin@ximian.com>
18385 Reworked flow analyis and made it more precise and bug-free. The
18386 most important change is that we're now using a special `Reachability'
18387 class instead of having "magic" meanings of `FlowReturns'. I'll
18388 do some more cleanups and optimizations and also add some more
18389 documentation this week.
18391 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
18392 largely reworked this class.
18393 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
18394 the new `Reachability' class instead of having "magic" values here.
18395 (FlowBranching): We're now using an instance of `Reachability'
18396 instead of having separate `Returns', `Breaks' etc. fields.
18398 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
18399 based on flow analysis; ignore the return value of block.Emit ().
18401 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
18403 * driver.cs typemanager.cs: Find the mono extensions to corlib even
18404 if they are private.
18406 2003-12-09 Martin Baulig <martin@ximian.com>
18408 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
18409 call them directly on the UsageVector.
18411 2003-12-09 Martin Baulig <martin@ximian.com>
18413 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
18414 Changed return type from `FlowReturns' to `Reachability'.
18416 2003-12-09 Martin Baulig <martin@ximian.com>
18418 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
18419 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
18420 `Reachable' fields with a single `Reachability' one.
18422 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18424 * class.cs (FindMembers): Remove foreach's.
18429 Run 1: 8.74 seconds
18430 Run 2: 8.71 seconds
18433 Run 1: 8.64 seconds
18434 Run 2: 8.58 seconds
18437 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18442 This patch does a few things:
18443 1. EmptyStatement is now a singleton, so it is never reallocated.
18444 2. All blah is EmptyStatement constructs have been changed to
18445 blah == EmptyStatement.Value, which is much faster and valid
18446 now that EmptyStatement is a singleton.
18447 3. When resolving a block, rather than allocating a new array for
18448 the non-empty statements, empty statements are replaced with
18449 EmptyStatement.Value
18450 4. Some recursive functions have been made non-recursive.
18451 Mainly the performance impact is from (3), however (1) and (2) are needed for
18452 this to work. (4) does not make a big difference in normal situations, however
18453 it makes the profile look saner.
18458 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18459 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18460 Total memory allocated: 56397 KB
18463 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
18464 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
18465 Total memory allocated: 55666 KB
18467 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18469 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
18470 than the hashtable in a hashtable version
18472 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
18473 we always end up concating a string. This results in a huge perf
18474 loss, because many strings have to be tracked by the GC. In this
18475 patch, we first use a hashtable that works with two keys, so that
18476 the strings do not need to be concat'ed.
18480 Run 1: 8.74 seconds
18481 Run 2: 8.71 seconds
18484 Run 1: 8.65 seconds
18485 Run 2: 8.56 seconds
18487 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18489 * Makefile: Add a new target `do-time' that does a quick and simple
18490 profile, leaving easy to parse output.
18492 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
18494 * codegen.cs (Init): Create the dynamic assembly with
18495 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
18497 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
18499 * support.cs: Make the PtrHashtable use only one
18500 instance of its comparer.
18502 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
18504 * typemanager.cs: Fix lookup of GetNamespaces.
18506 2003-11-29 Miguel de Icaza <miguel@ximian.com>
18508 * expression.cs: Removed redundant line.
18510 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
18511 ArrayLists, use for loops with bounds.
18513 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
18516 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
18517 arraylists, use for loop with bounds.
18519 The above three changes give us a 0.071 second performance
18520 improvement out of 3.294 seconds down to 3.223. On my machine
18521 the above changes reduced the memory usage by 1,387 KB during
18522 compiler bootstrap.
18524 * cs-parser.jay (QualifiedIdentifier): New class used to represent
18525 QualifiedIdentifiers. Before we created a new string through
18526 concatenation, and mostly later on, the result would be
18527 manipulated by DecomposeQI through string manipulation.
18529 This reduced the compiler memory usage for bootstrapping from
18530 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
18531 compile times in 0.05 seconds.
18533 2003-11-28 Dick Porter <dick@ximian.com>
18535 * support.cs: Do string compares with the Invariant culture.
18543 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
18544 the comparison is done with the Invariant culture.
18546 2003-11-27 Miguel de Icaza <miguel@ximian.com>
18548 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
18549 GetEnumerator method.
18551 (ProbeCollectionType): Iterate starting at the most specific type
18552 upwards looking for a GetEnumerator
18554 * expression.cs: Shift count can be up to 31 for int/uint and 63
18557 2003-11-26 Miguel de Icaza <miguel@ximian.com>
18559 * statement.cs (Block.LookupLabel): Also look for the label on the
18560 children blocks. Use a hash table to keep track of visited
18563 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
18564 we actually did transform the other operand, otherwise fall back
18565 to the common codepath that casts to long.
18567 * cs-tokenizer.cs: Use the same code pattern as the int case.
18568 Maybe I should do the parsing myself, and avoid depending on the
18569 Parse routines to get this done.
18571 2003-11-25 Miguel de Icaza <miguel@ximian.com>
18573 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
18574 which fixes bug 51347. This time test it.
18576 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
18577 attributes for example can not tell the difference between these.
18578 The difference was only a syntax feature of the language.
18580 * attribute.cs: Apply attributes to delegates.
18582 * delegate.cs: Call the apply attributes method.
18584 2003-11-24 Miguel de Icaza <miguel@ximian.com>
18586 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
18587 comparing 0 vs Byte.MinValue, not the value
18589 (ImplicitConversionRequired): When reporting a conversion error,
18590 use error 31 to print out the constant error instead of the
18593 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
18594 which fixes bug 51347.
18596 2003-11-22 Miguel de Icaza <miguel@ximian.com>
18598 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
18599 which fixes the -warnaserror command line option.
18601 2003-11-21 Miguel de Icaza <miguel@ximian.com>
18603 * cfold.cs (DoNumericPromotions): During constant folding of
18604 additions on UIntConstant, special case intconstants with
18605 IntConstants like we do on the expression binary operator.
18607 2003-11-12 Miguel de Icaza <miguel@ximian.com>
18609 * convert.cs (ImplicitReferenceConversion): We were missing a case
18610 (System.Enum are not value types or class types, so we need to
18611 classify them separatedly).
18613 * driver.cs: We do not support error 2007.
18615 2003-11-12 Jackson Harper <jackson@ximian.com>
18617 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
18618 system directory. Also use the full file name so users can
18619 libraries names mscorlib-o-tron.dll in a non system dir.
18621 2003-11-10 Martin Baulig <martin@ximian.com>
18623 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
18624 (TypeManager.InitCoreTypes): Initialize them here, but instead of
18625 calling `ResolveType()' on them, directly assign their `Type'.
18627 2003-11-08 Martin Baulig <martin@ximian.com>
18629 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
18630 return value and the `out parent' parameter.
18631 (TypeContainer.DefineType): Moved the CS0644 check into
18632 GetClassBases(). Don't pass the interface types to the
18633 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
18634 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
18636 * ecore.cs (TypeExpr.IsAttribute): New property.
18637 (TypeExpr.GetInterfaces): New method.
18639 * interface.cs (Interface.GetInterfaceTypeByName): Return a
18640 TypeExpr instead of a Type.
18641 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
18642 (Interface.DefineType): Don't pass the interface types to the
18643 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
18644 them later and then call `TypeBulider.AddInterfaceImplementation()'.
18646 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
18647 instead of a `Type[]'.
18648 (TypeManager.RegisterBuilder): Likewise.
18649 (TypeManager.AddUserInterface): Likewise.
18650 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
18651 `Type[]' and also return a `TypeExpr[]'.
18652 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
18654 2003-11-08 Martin Baulig <martin@ximian.com>
18656 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
18659 2003-11-08 Martin Baulig <martin@ximian.com>
18661 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
18662 TypeManager.ResolveExpressionTypes().
18664 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
18665 instead of an Expression.
18666 (TypeExpr): This is now an abstract base class for `TypeExpression'.
18667 (TypeExpression): New public class; formerly known as `TypeExpr'.
18669 * expression.cs (ComposedCast): Derive from TypeExpr.
18671 * typemanager.cs (TypeManager.system_*_expr): These are now
18672 TypExpr's instead of Expression's.
18673 (TypeManager.ResolveExpressionTypes): New public static function;
18674 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
18677 2003-11-06 Miguel de Icaza <miguel@ximian.com>
18679 * expression.cs (New.DoResolve): Do not dereference value that
18680 might be a null return.
18682 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
18683 sure that the constant value has the right type. Fixes an
18684 unreported bug, similar to 50425.
18686 * const.cs (Const.LookupConstantValue): Call
18687 ImplicitStandardConversionExists before doing a conversion to
18688 avoid havng the TypeManager.ChangeType do conversions.
18690 Reduced the number of casts used
18692 (Const.ChangeType): New routine to enable reuse of the constant
18693 type changing code from statement.
18695 * typemanager.cs (ChangeType): Move common initialization to
18696 static global variables.
18700 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
18701 every value type to go through, even if it was void. Fix that.
18703 * cs-tokenizer.cs: Use is_identifier_start_character on the start
18704 character of the define, and the is_identifier_part_character for
18705 the rest of the string.
18707 2003-11-05 Miguel de Icaza <miguel@ximian.com>
18709 * expression.cs (UnaryMutator.EmitCode): When I updated
18710 LocalVariableReference.DoResolve, I overdid it, and dropped an
18711 optimization done on local variable references.
18713 2003-11-04 Miguel de Icaza <miguel@ximian.com>
18715 * ecore.cs: Convert the return from Ldlen into an int.
18717 2003-10-20 Miguel de Icaza <miguel@ximian.com>
18719 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
18720 the accessibility, this is a special case for toplevel non-public
18721 classes (internal for instance).
18723 2003-10-20 Nick Drochak <ndrochak@gol.com>
18725 * ecore.cs: Fix typo and build. Needed another right paren.
18727 2003-10-19 Miguel de Icaza <miguel@ximian.com>
18729 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
18730 `internal' case regular and protected, but not allowing protected
18731 to be evaluated later. Bug 49840
18733 2003-10-15 Miguel de Icaza <miguel@ximian.com>
18735 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
18736 to kb.Nlast, and not the kb.nFirst to isolate the switch
18739 Extract the underlying type, so enumerations of long/ulong are
18740 treated like long/ulong.
18742 2003-10-14 Miguel de Icaza <miguel@ximian.com>
18744 * expression.cs (New): Overload the meaning of RequestedType to
18745 track the possible creation of the NewDelegate type, since
18746 DoResolve is invoked more than once for new constructors on field
18749 See bugs: #48800 and #37014
18751 * cs-parser.jay (declare_local_constants): Take an arraylist
18752 instead of a single constant.
18754 (local_constant_declaration): It should take a
18755 constant_declarators, not a constant_declarator. Fixes 49487
18757 * convert.cs: Fix error report.
18759 2003-10-13 Jackson Harper <jackson@ximian.com>
18761 * typemanager.cs (TypeToCoreType): Add float and double this fixes
18764 2003-10-09 Martin Baulig <martin@ximian.com>
18766 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
18768 (MethodCore.DoDefineParameters): Removed the TypeContainer
18769 argument; use the DeclSpace which was passed to the .ctor instead.
18770 (MethodCore.CheckParameter): Take a DeclSpace instead of a
18771 TypeContainer; we only need a DeclSpace here.
18773 2003-10-09 Martin Baulig <martin@ximian.com>
18775 * class.cs (MethodData): Added additional `DeclSpace ds' argument
18777 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
18778 EmitContext's .ctor.
18780 2003-10-09 Martin Baulig <martin@ximian.com>
18782 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
18783 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
18784 AsAccessible(), moved them as well.
18786 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
18788 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
18790 * cs-parser.jay : Renamed yyName to yyNames related to jay.
18792 2003-10-07 Miguel de Icaza <miguel@ximian.com>
18794 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
18795 generation for >=, as spotted by Paolo, bug 48679.
18796 Patch from David Waite.
18798 * cs-tokenizer.cs: Add handling for #pragma.
18800 * cs-parser.jay: Allow for both yield and yield return in the
18801 syntax. The anti-cobolization of C# fight will go on!
18803 * class.cs (TypeBuilder.DefineType): Catch error condition here
18804 (Parent.DefineType erroring out and returning null).
18806 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18807 coping with enumerations variables, we were mistakenly processing
18808 them as a regular value type instead of built-in types. Fixes the
18811 * typemanager.cs (IsBuiltinOrEnum): New method.
18813 2003-09-30 Miguel de Icaza <miguel@ximian.com>
18815 * cs-parser.jay: Upgrade: yield now needs the return clause.
18817 2003-09-19 Martin Baulig <martin@ximian.com>
18819 * decl.cs (MemberCache.SetupCacheForInterface): Take a
18820 `MemberCache parent' argument. Normally, an interface doesn't
18821 have a parent type except System.Object, but we use this in gmcs
18822 for generic type parameters.
18824 2003-09-18 Martin Baulig <martin@ximian.com>
18826 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
18827 on `type.IsInterface'; don't check whether the type has a parent
18828 to determine whether it's an interface.
18830 2003-09-15 Martin Baulig <martin@ximian.com>
18832 * class.cs (TypeContainer.DefineType): Added an error flag to
18833 avoid reporting duplicate CS0146's ("class definition is
18836 * driver.cs (Driver.MainDriver): Abort if
18837 RootContext.ResolveTree() reported any errors.
18839 2003-09-07 Martin Baulig <martin@ximian.com>
18841 * report.cs (Error, Warning): Added overloaded versions which take
18842 a `params object[] args' and call String.Format().
18844 2003-09-07 Martin Baulig <martin@ximian.com>
18846 * decl.cs (DeclSpace..ctor): Don't call
18847 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
18848 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
18849 (DeclSpace.RecordDecl): New method.
18851 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
18853 2003-09-02 Ravi Pratap <ravi@ximian.com>
18855 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
18856 value attributes to be applied to ParameterBuilders.
18858 * class.cs (MethodCore.LabelParameters): Make static and more
18859 generic so that it can be used from other places - like interface
18860 methods, for instance.
18862 * interface.cs (Interface.Emit): Call LabelParameters before
18863 emitting attributes on the InterfaceMethod.
18865 2003-08-26 Martin Baulig <martin@ximian.com>
18867 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
18868 resolving aliases; fixes #47927.
18870 2003-08-26 Martin Baulig <martin@ximian.com>
18872 * statement.cs (Using.DoResolve): This is internally emitting a
18873 try/finally clause, so we need to set ec.NeedExplicitReturn if we
18874 do not always return. Fixes #47681.
18876 2003-08-26 Martin Baulig <martin@ximian.com>
18878 * decl.cs (MemberCore): Moved WarningNotHiding(),
18879 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
18881 (AdditionResult): Make this nested in DeclSpace.
18882 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
18883 argument; call NamespaceEntry.Define() unless we're nested in a
18886 * namespace.cs (Namespace.DefineName): New public function. This
18887 is called from DeclSpace's .ctor to add
18888 (Namespace.Lookup): Include DeclSpaces in the lookup.
18890 * class.cs (Operator): Derive from MemberBase, not MemberCore.
18892 * const.cs (Const): Derive from MemberBase, not MemberCore.
18894 2003-08-25 Martin Baulig <martin@ximian.com>
18896 * convert.cs (Convert.ExplicitReferenceConversion): When
18897 converting from an interface type to a class, unbox if the target
18898 type is a struct type. Fixes #47822.
18900 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18902 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
18905 2003-08-22 Martin Baulig <martin@ximian.com>
18907 * class.cs (TypeManager.DefineType): When defining a nested type,
18908 call DefineType() on our parent; fixes #47801.
18910 2003-08-22 Martin Baulig <martin@ximian.com>
18912 * class.cs (MethodData.Define): While checking if a method is an
18913 interface implementation, improve the test a bit more to fix #47654.
18915 2003-08-22 Martin Baulig <martin@ximian.com>
18917 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
18918 correctly; fixes #47722.
18920 2003-08-22 Martin Baulig <martin@ximian.com>
18922 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
18923 LocalVariableReference, ensure it's not read-only. Fixes #47536.
18925 * statement.cs (Fixed.DoResolve): Make all variables read-only.
18927 2003-08-22 Martin Baulig <martin@ximian.com>
18929 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
18930 can only be assigned in static constructors. Fixes #47161.
18932 2003-08-22 Martin Baulig <martin@ximian.com>
18934 Rewrote and improved the flow analysis code.
18936 * flowbranching.cs (FlowBranching): Make this class abstract.
18937 (FlowBranching.CreateBranching): New static function to create a
18938 new flow branching.
18939 (FlowBranchingBlock, FlowBranchingException): New classes.
18940 (FlowBranching.UsageVector.Type): New public readonly field.
18941 (FlowBranching.UsageVector.Breaks): Removed the setter.
18942 (FlowBranching.UsageVector.Returns): Removed the setter.
18943 (FlowBranching.UsageVector): Added Break(), Return(),
18944 NeverReachable() and Throw() methods to modify the reachability.
18945 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
18946 done by FlowBranching.Merge().
18947 (FlowBranching.UsageVector.MergeChild): New method; merges the
18948 merge result into the current vector.
18949 (FlowBranching.Merge): New abstract method to merge a branching.
18951 2003-08-12 Martin Baulig <martin@ximian.com>
18953 * expression.cs (Indirection.CacheTemporaries): Create the
18954 LocalTemporary with the pointer type, not its element type.
18956 2003-08-10 Miguel de Icaza <miguel@ximian.com>
18958 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
18959 token was a keyword or not.
18961 Add `error' options where an IDENTIFIER was expected; Provide
18962 CheckToken and CheckIdentifierToken convenience error reporting
18965 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
18967 * decl.cs: Rename `NamespaceEntry Namespace' public field into
18968 NameSpaceEntry NameSpaceEntry.
18970 (LookupInterfaceOrClass): Avoid creating a full qualified name
18971 from namespace and name: avoid doing lookups when we know the
18972 namespace is non-existant. Use new Tree.LookupByNamespace which
18973 looks up DeclSpaces based on their namespace, name pair.
18975 * driver.cs: Provide a new `parser verbose' to display the
18976 exception thrown during parsing. This is turned off by default
18977 now, so the output of a failure from mcs is more graceful.
18979 * namespace.cs: Track all the namespaces defined in a hashtable
18982 (IsNamespace): New method
18984 2003-08-09 Miguel de Icaza <miguel@ximian.com>
18986 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
18987 we know that we need to concatenate (full typename can never be
18992 * statement.cs: Use a bitfield; Do not initialize to null things
18993 which are done by the constructor by default.
18995 * cs-parser.jay: bug fix, parameter was 4, not 3.
18997 * expression.cs: Just use the property;
18999 * statement.cs: No need for GetVariableInfo method.
19001 2003-08-08 Martin Baulig <martin@ximian.com>
19003 * flowanalysis.cs (FlowReturns): This is now nested in the
19004 `FlowBranching' class.
19005 (MyBitVector): Moved this here from statement.cs.
19006 (FlowBranching.SiblingType): New enum type.
19007 (FlowBranching.CreateSibling): Added `SiblingType' argument.
19009 2003-08-07 Martin Baulig <martin@ximian.com>
19011 * flowanalysis.cs (FlowBranchingType): This is now nested in the
19012 `FlowBranching' class and called `BranchingType'.
19014 2003-08-07 Martin Baulig <martin@ximian.com>
19016 * flowanalysis.cs: Moved all the control flow analysis code into
19019 2003-08-07 Martin Baulig <martin@ximian.com>
19021 * assign.cs (Assign.DoResolve): `target' must either be an
19022 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
19025 2003-08-07 Miguel de Icaza <miguel@ximian.com>
19027 * expression.cs (BinaryMethod): This kind of expression is created by the
19028 Binary class if it determines that the operator has to be handled
19031 (BinaryDelegate): This kind of expression is created if we are
19032 dealing with a + or - operator on delegates.
19034 (Binary): remove method, argumetns, and DelegateOperator: when
19035 dealing with methods,
19037 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
19039 * statement.cs (Block): use bitfields for the three extra booleans
19040 we had in use. Remove unused topblock parameter.
19042 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
19044 * assign.cs: Drop extra unneeded tests.
19046 2003-08-06 Miguel de Icaza <miguel@ximian.com>
19048 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
19050 * statement.cs (Foreach): Use VariableStorage instead of
19053 * codegen.cs (VariableStorage): New class used by clients that
19054 require a variable stored: locals or fields for variables that
19055 need to live across yield.
19057 Maybe provide a convenience api for EmitThis+EmitLoad?
19059 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
19062 2003-08-05 Miguel de Icaza <miguel@ximian.com>
19064 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
19065 RemapParameterLValue): New methods that are used to turn a
19066 precomputed FieldInfo into an expression like this:
19070 The idea is to use this instead of making LocalVariableReference
19071 have more than one meaning.
19073 * cs-parser.jay: Add error production to BASE.
19075 * ecore.cs: Deal with TypeManager.GetField returning null, which
19076 is now a valid return value.
19078 (FieldExprNoAddress): New expression for Fields whose address can
19081 * expression.cs (LocalVariableReference): During the resolve
19082 phases, create new expressions if we are in a remapping context.
19083 Remove code that dealt with remapping here.
19085 (ParameterReference): same.
19087 (ProxyInstance): New expression, like the `This' expression, but
19088 it is born fully resolved. We know what we are doing, so remove
19089 the errors that are targeted to user-provided uses of `this'.
19091 * statement.cs (Foreach): our variable is now stored as an
19092 Expression; During resolution, follow the protocol, dont just
19093 assume it will return this.
19095 2003-08-06 Martin Baulig <martin@ximian.com>
19097 * support.cs (SeekableStreamReader.cs): New public class.
19099 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
19100 SeekableStreamReader instead of the normal StreamReader.
19102 2003-08-04 Martin Baulig <martin@ximian.com>
19104 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
19105 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
19106 deambiguate casts and delegate invocations.
19107 (parenthesized_expression): Use the new tokens to ensure this is
19108 not a cast of method invocation.
19110 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
19111 when reading a `)' and Deambiguate_CloseParens () was previously
19114 * expression.cs (ParenthesizedExpression): New class. This is
19115 just used for the CS0075 test.
19116 (Binary.DoResolve): Check for CS0075.
19118 2003-07-29 Ravi Pratap <ravi@ximian.com>
19120 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
19121 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
19122 reference comparison.
19124 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
19125 examine the ReturnType for equality - this is necessary in the
19126 cases of implicit and explicit operators whose signature also
19127 includes the return type.
19129 2003-07-26 Miguel de Icaza <miguel@ximian.com>
19131 * namespace.cs: Cache the result of the namespace computation,
19132 instead of computing it every time.
19134 2003-07-24 Miguel de Icaza <miguel@ximian.com>
19136 * decl.cs: Use a global arraylist that we reuse over invocations
19137 to avoid excesive memory consumption. Reduces memory usage on an
19138 mcs compile by one meg (45 average).
19140 * typemanager.cs (LookupTypeReflection): In .NET pointers are
19141 private, work around that.
19143 2003-07-23 Miguel de Icaza <miguel@ximian.com>
19145 * literal.cs (IntLiteral): Define Zero and One static literals.
19147 * cs-parser.jay (integer_literal): use static literals to reduce
19148 memory usage for the most used literals (0, 1 and -1). 211kb
19149 reduced in memory usage.
19151 Replace all calls to `new ArrayList' with `new
19152 ArrayList(4)' which is a good average number for most allocations,
19153 and also requires only 16 bytes of memory for its buffer by
19156 This reduced MCS memory usage in seven megabytes for the RSS after
19159 2003-07-28 Ravi Pratap <ravi@ximian.com>
19161 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
19162 handle params methods the correct way by forming only one
19163 applicable set with params and normal methods in them. Earlier we
19164 were looking at params methods only if we found no normal methods
19165 which was not the correct thing to do.
19167 (Invocation.BetterFunction): Take separate arguments indicating
19168 when candidate and the best method are params methods in their
19171 This fixes bugs #43367 and #46199.
19173 * attribute.cs: Documentation updates.
19175 (CheckAttribute): Rename to CheckAttributeTarget.
19176 (GetValidPlaces): Rename to GetValidTargets.
19178 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
19179 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
19183 2003-07-28 Martin Baulig <martin@ximian.com>
19185 * class.cs (TypeContainer.DefineMembers): Use the base type's full
19186 name when looking up the base class of a nested class. Fixes #46977.
19188 2003-07-26 Martin Baulig <martin@ximian.com>
19190 * expression.cs (Indexers.Indexer): New nested struct; contains
19191 getter, setter and the indexer's type.
19192 (Indexers.Properties): This is now an ArrayList of
19193 Indexers.Indexer's.
19194 (IndexerAccess.DoResolveLValue): Correctly set the type if the
19195 indexer doesn't have any getters.
19197 * assign.cs (Assign.DoResolve): Also do the implicit conversions
19198 for embedded property and indexer assignments.
19200 2003-07-26 Martin Baulig <martin@ximian.com>
19202 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
19203 preprocessor directive is not the first non-whitespace character
19206 2003-07-26 Martin Baulig <martin@ximian.com>
19208 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
19209 namespace parsing, follow the spec more closely.
19211 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
19212 NamespaceEntry.Lookup().
19214 2003-07-25 Martin Baulig <martin@ximian.com>
19216 * MethodCore.cs (OverridesSomething): New public field; it's set
19217 from TypeContainer.DefineMembers if this method overrides
19218 something (which doesn't need to be a method). Fix #39462.
19220 2003-07-25 Ravi Pratap <ravi@ximian.com>
19222 * typemanager.cs (GetMembers): Ensure that the list of members is
19223 reversed. This keeps things in sync.
19225 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
19226 find an AttributeUsage attribute.
19228 * expression.cs (Invocation.OverloadResolve): Perform the check
19229 which disallows Invoke to be directly called on a Delegate.
19231 (Error_InvokeOnDelegate): Report error cs1533.
19233 2003-07-25 Martin Baulig <martin@ximian.com>
19235 * expression.cs (Indexers.GetIndexersForType): Only look in the
19236 interface hierarchy if the requested type is already an
19237 interface. Fixes #46788 while keeping #46502 fixed.
19239 2003-07-25 Martin Baulig <martin@ximian.com>
19241 * class.cs (TypeContainer.DefineMembers): Check whether all
19242 readonly fields have been assigned and report warning CS0649 if
19245 * statement.cs (LocalInfo.IsFixed): Always return true if this is
19248 2003-07-24 Ravi Pratap <ravi@ximian.com>
19250 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
19251 returned from GetMethods to make things consistent with the
19252 assumptions MCS makes about ordering of methods.
19254 This should comprehensively fix bug #45127 and it does :-)
19256 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
19257 ordering is actually reverse.
19259 * Clean up some debug messages I left lying around.
19261 * interface.cs (Populate*): Get rid of code which emits attributes
19262 since the stage in which we emit attributes is the 'Emit' stage,
19263 not the define stage.
19265 (Emit): Move attribute emission for interface members here.
19267 2003-07-22 Ravi Pratap <ravi@ximian.com>
19269 * expression.cs (Invocation.OverloadResolve): Follow the spec more
19270 closely: we eliminate methods in base types when we have an
19271 applicable method in a top-level type.
19273 Please see section 14.5.5.1 for an exact description of what goes
19276 This fixes bug #45127 and a host of other related to corlib compilation.
19278 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
19279 array is the method corresponding to the top-level type (this is
19280 because of the changes made to icall.c) so we change this
19283 (MethodGroupExpr.Name): This too.
19285 * typemanager.cs (GetElementType): New method which does the right
19286 thing when compiling corlib.
19288 * everywhere: Make use of the above in the relevant places.
19290 2003-07-22 Martin Baulig <martin@ximian.com>
19292 * cs-parser.jay (invocation_expression): Moved
19293 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
19294 `cast_expression', but create a InvocationOrCast which later
19295 resolves to either an Invocation or a Cast.
19297 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
19298 method; call this before EmitStatement() to make sure that this
19299 expression can be used as a statement.
19301 * expression.cs (InvocationOrCast): New class; resolves to either
19302 an Invocation or a Cast.
19304 * statement.cs (StatementExpression): Call ResolveStatement() on
19305 the ExpressionStatement before emitting it.
19307 2003-07-21 Martin Baulig <martin@ximian.com>
19309 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
19310 `ref' and `out' attributes match; fixes #46220.
19311 (MemberAccess.ResolveMemberAccess): You can't reference a type
19312 through an expression; fixes #33180.
19313 (Indexers.GetIndexersForType): Don't return the indexers from
19314 interfaces the class implements; fixes #46502.
19316 2003-07-21 Martin Baulig <martin@ximian.com>
19318 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
19319 CS0661 checks; fixes bug #30442.
19321 2003-07-21 Martin Baulig <martin@ximian.com>
19323 * decl.cs (AdditionResult): Added `Error'.
19325 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
19327 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
19328 makes cs0031.cs actually work.
19330 2003-07-20 Martin Baulig <martin@ximian.com>
19332 * namespace.cs: Fixed that bug which caused a crash when compiling
19333 the debugger's GUI.
19335 2003-07-20 Miguel de Icaza <miguel@ximian.com>
19337 * typemanager.cs (LookupTypeReflection): Never expose types which
19338 are NotPublic, NestedPrivate, NestedAssembly, or
19339 NestedFamANDAssem. We used to return these, and later do a check
19340 that would report a meaningful error, but the problem is that we
19341 would not get the real match, if there was a name override.
19343 2003-07-18 Miguel de Icaza <miguel@ximian.com>
19345 * namespace.cs (Namespace, Name): Do not compute the namespace
19346 name dynamically, compute it in the constructor. This reduced
19347 memory usage by 1697 KB.
19349 * driver.cs: Use --pause to pause at the end.
19351 2003-07-17 Peter Williams <peter@newton.cx>
19353 * Makefile: Change the name of the test target so that it doesn't
19354 conflict with the recursive test target.
19356 2003-07-17 Miguel de Icaza <miguel@ximian.com>
19358 * expression.cs (LocalVariableReference.Emit, EmitAssign,
19359 AddressOf): Do not use EmitThis, that was wrong, use the actual
19362 2003-07-15 Miguel de Icaza <miguel@ximian.com>
19364 * class.cs (MethodData.Define): While checking if a method is an
19365 interface implementation, improve the test: If we are not public
19366 (use new test here: use the computed MethodAttributes directly,
19367 instead of the parsed modifier flags) check if the `implementing'
19368 method comes from an interface or not.
19370 * pending.cs (VerifyPendingMethods): Slightly better error
19373 * makefile: add test target that does the mcs bootstrap.
19375 2003-07-16 Ravi Pratap <ravi@ximian.com>
19377 * interface.cs (Define): Do nothing here since there are no
19378 members to populate etc. Move the attribute emission out of here
19379 since this was just totally the wrong place to put it. Attribute
19380 application happens during the 'Emit' phase, not in the 'Define'
19383 (Emit): Add this method and move the attribute emission here
19385 * rootcontext.cs (EmitCode): Call the Emit method on interface
19388 2003-07-14 Ravi Pratap M <ravi@ximian.com>
19390 * expression.cs (OverloadResolve): Report error only if Location
19391 is not 'Null' which means that there was a probe going on.
19393 2003-07-14 Martin Baulig <martin@ximian.com>
19395 * expression.cs (ConditionalLogicalOperator): New public class to
19396 implement user defined conditional logical operators.
19397 This is section 14.11.2 in the spec and bug #40505.
19399 2003-07-14 Martin Baulig <martin@ximian.com>
19401 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
19403 2003-07-14 Martin Baulig <martin@ximian.com>
19405 * codegen.cs (EmitContext.InFixedInitializer): New public field.
19407 * ecore.cs (IVariable.VerifyFixed): New interface method.
19409 * expression.cs (Unary.ResolveOperator): When resolving the `&'
19410 operator, check whether the variable is actually fixed. Fixes bug
19411 #36055. Set a variable definitely assigned when taking its
19412 address as required by the spec.
19414 * statement.cs (LocalInfo.IsFixed): New field.
19415 (LocalInfo.MakePinned): Set `IsFixed' to true.
19417 2003-07-14 Ravi Pratap M <ravi@ximian.com>
19419 * attribute.cs (Attribute.Resolve): While doing a Member lookup
19420 for .ctors, ensure that we only ask for members declared in the
19421 attribute type (BindingFlags.DeclaredOnly).
19425 * expression.cs (Error_WrongNumArguments): Report error 1501
19426 correctly the way CSC does.
19428 2003-07-13 Martin Baulig <martin@ximian.com>
19430 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
19431 lookup on the fully qualified name, to make things like "X.X" work
19432 where "X.X" is a fully qualified type name, but we also have a
19433 namespace "X" in the using list. Fixes #41975.
19435 2003-07-13 Martin Baulig <martin@ximian.com>
19437 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
19438 function. If we're a CompoundAssign, we need to create an embedded
19439 CompoundAssign, not an embedded Assign.
19440 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
19443 2003-07-13 Martin Baulig <martin@ximian.com>
19445 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
19446 work to fix bug #46088.
19448 2003-07-13 Ravi Pratap <ravi@ximian.com>
19450 * class.cs (Operator.Emit): Do not emit attributes here - it is
19451 taken care of by the Method class that we delegate too. This takes
19452 care of bug #45876.
19454 2003-07-10 Martin Baulig <martin@ximian.com>
19456 * expression.cs (TypeOfVoid): New class.
19457 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
19459 2003-07-10 Martin Baulig <martin@ximian.com>
19461 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
19464 2003-07-10 Martin Baulig <martin@ximian.com>
19466 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
19467 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
19469 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
19471 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
19473 2003-07-10 Martin Baulig <martin@ximian.com>
19475 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
19476 of decimal. Fixes #42850.
19478 NOTE: I also fixed the created byte blob, but this doesn't work on
19479 the MS runtime and csc never produces any byte blobs for decimal
19482 2003-07-10 Martin Baulig <martin@ximian.com>
19484 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
19485 structs; fixes #32068.
19486 (Block.AddChildVariableNames): Fixed #44302.
19488 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19490 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
19492 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19494 * attribute.cs: And this test is onger needed.
19496 2003-07-08 Martin Baulig <martin@ximian.com>
19498 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
19499 inaccessible types. Fixes #36313.
19501 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
19503 * namespace.cs (NamespaceEntry): Create implicit entries for all
19504 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
19505 implicit entries for N1.N2 and N1.
19507 2003-07-08 Martin Baulig <martin@ximian.com>
19509 Rewrote the handling of namespaces to fix a lot of the issues
19510 wrt. `using' aliases etc.
19512 * namespace.cs (Namespace): Splitted this class into a
19513 per-assembly `Namespace' and a per-file `NamespaceEntry'.
19515 * typemanager.cs (TypeManager.IsNamespace): Removed.
19516 (TypeManager.ComputeNamespaces): Only compute namespaces from
19517 loaded assemblies here, not the namespaces from the assembly we're
19518 currently compiling.
19520 2003-07-08 Martin Baulig <martin@ximian.com>
19522 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
19524 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19526 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
19529 I thought about the memory savings here, but LookupTypeReflection
19530 is used under already very constrained scenarios. Compiling
19531 corlib or mcs only exposes one hit, so it would not really reduce
19532 any memory consumption.
19534 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19536 * typemanager.cs: fixes bug #45889 by only adding public types from
19537 other assemblies to the list of known types.
19539 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19541 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
19542 on the type we resolved.
19544 2003-07-05 Martin Baulig <martin@ximian.com>
19546 * pending.cs (PendingImplementation.ParentImplements): Don't
19547 create the proxy if the parent is abstract.
19549 * class.cs (TypeContainer.DefineIndexers): Process explicit
19550 interface implementations first. Fixes #37714.
19552 2003-07-04 Miguel de Icaza <miguel@ximian.com>
19554 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
19555 defined recursively; but since we modify the input parameters
19556 (left is set to `this' temporarily), we reset this value if the
19557 left_is_explicit is false, which gives the original semantics to
19560 * literal.cs (NullPointer): new class used to represent a null
19561 literal in a pointer context.
19563 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
19564 type is a pointer, use a NullPointer object instead of a
19565 NullLiteral. Closes 43687
19567 (ExplicitConversion): Convert pointer values using
19568 the conv opcode to the proper type.
19570 * ecore.cs (New): change ValueTypeVariable property into a method,
19571 that returns whether the valuetype is suitable for being used.
19573 * expression.cs (Binary.DoNumericPromotions): Only return if we
19574 the int constant was a valid uint, and we can return both left and
19575 right as uints. If not, we continue processing, to trigger the
19576 type conversion. This fixes 39018.
19578 * statement.cs (Block.EmitMeta): During constant resolution, set
19579 the CurrentBlock property on the emitcontext, so that we resolve
19580 constants propertly.
19582 2003-07-02 Martin Baulig <martin@ximian.com>
19584 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
19585 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
19587 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
19588 than emitting it here.
19590 * statement.cs: Fixed some more flow analysis bugs.
19592 2003-07-02 Martin Baulig <martin@ximian.com>
19594 * class.cs (MethodData.Define): When implementing interface
19595 methods, set Final unless we're Virtual.
19597 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
19598 check work for interface methods.
19600 2003-07-01 Martin Baulig <martin@ximian.com>
19602 * ecore.cs (EmitContext.This): Replaced this property with a
19603 GetThis() method which takes a Location argument. This ensures
19604 that we get the correct error location for a CS0188.
19606 2003-07-01 Miguel de Icaza <miguel@ximian.com>
19608 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
19609 ImplicitStandardConversion.
19611 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
19613 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
19615 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
19618 2003-06-30 Miguel de Icaza <miguel@ximian.com>
19620 * class.cs (Constructor.Define): Turn off initlocals for unsafe
19623 (MethodData.Define): Turn off initlocals for unsafe methods.
19625 2003-06-29 Miguel de Icaza <miguel@ximian.com>
19627 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
19628 complete; Fixes #37521.
19630 * delegate.cs: Use Modifiers.TypeAttr to compute the
19631 TypeAttributes, instead of rolling our own. This makes the flags
19632 correct for the delegates.
19634 2003-06-28 Miguel de Icaza <miguel@ximian.com>
19636 * class.cs (Constructor.Define): Set the private flag for static
19637 constructors as well.
19639 * cs-parser.jay (statement_expression): Set the return value to
19640 null, to avoid a crash when we catch an error.
19642 2003-06-24 Miguel de Icaza <miguel@ximian.com>
19644 * cs-parser.jay: Applied patch from Jackson that adds support for
19645 extern and unsafe modifiers to destructor declarations.
19647 * expression.cs: Report error 21 if the user is trying to index a
19650 * driver.cs: Add an error message, suggested by the bug report.
19652 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
19653 if we do not have a ": this ()" constructor initializer. Fixes 45149
19655 2003-06-14 Miguel de Icaza <miguel@ximian.com>
19657 * namespace.cs: Add some information to reduce FAQs.
19659 2003-06-13 Miguel de Icaza <miguel@ximian.com>
19661 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
19662 underlying enumeration types. Fixes #43915.
19664 * expression.cs: Treat ushort/short as legal values to be used in
19665 bitwise operations.
19667 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
19669 * delegate.cs: transfer custom attributes for paramenters from
19670 the delegate declaration to Invoke and BeginInvoke.
19672 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
19674 * attribute.cs: handle custom marshalers and emit marshal info
19677 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
19679 * makefile.gnu: Added anonymous.cs to the compiler sources.
19681 2003-05-28 Miguel de Icaza <miguel@ximian.com>
19683 * iterators.cs: Change the name of the proxy class to include two
19686 * cs-parser.jay: Update grammar to include anonymous methods.
19688 * anonymous.cs: new file.
19690 2003-05-27 Miguel de Icaza <miguel@ximian.com>
19692 * class.cs (Field.Define): Add missing test for pointers and
19695 2003-05-27 Ravi Pratap <ravi@ximian.com>
19697 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
19698 we use the stobj opcode.
19700 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
19701 since it wasn't the correct fix.
19703 It still is puzzling that we are required to use stobj for IntPtr
19704 which seems to be a ValueType.
19706 2003-05-26 Miguel de Icaza <miguel@ximian.com>
19708 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
19709 during regular simple name resolution. Now, the trick is that
19710 instead of returning for processing the simplename, we do a
19711 TypeManager.LookupType (ie, a rooted lookup as opposed to a
19712 contextual lookup type). If a match is found, return that, if
19713 not, return for further composition.
19715 This fixes long-standing 30485.
19717 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19718 using the address to initialize an object, do an Stobj instead of
19719 using the regular Stelem.
19721 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
19722 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
19723 Because if we are a BaseIndexerAccess that value will be true.
19726 * statement.cs (GotoCase.Resolve): Return after reporting an
19727 error, do not attempt to continue.
19729 * expression.cs (PointerArithmetic.Emit): If our operand is a
19730 long, convert our constants to match the operand before
19731 multiplying. Convert to I type before adding. Fixes 43670.
19733 2003-05-14 Ravi Pratap <ravi@ximian.com>
19735 * enum.cs (ImplicitConversionExists) : Rename to
19736 ImplicitEnumConversionExists to remove ambiguity.
19738 * ecore.cs (NullCast): New type of cast expression class which
19739 basically is very similar to EmptyCast with the difference being
19740 it still is a constant since it is used only to cast a null to
19742 (eg. (string) null)
19744 * convert.cs (ImplicitReferenceConversion): When casting a null
19745 literal, we return a NullCast.
19747 * literal.cs (NullLiteralTyped): Remove - I don't see why this
19748 should be around anymore.
19750 The renaming (reported was slightly wrong). Corrections:
19752 ConvertImplicitStandard -> ImplicitConversionStandard
19753 ConvertExplicitStandard -> ExplicitConversionStandard
19755 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
19756 before passing them in !
19758 * convert.cs (ImplicitConversionStandard): When comparing for
19759 equal expr and target types, ensure that expr is not a
19762 In general, we must not be checking (expr_type ==
19763 target_type) in the top level conversion methods
19764 (ImplicitConversion, ExplicitConversion etc). This checking is
19765 done in the methods that they delegate to.
19767 2003-05-20 Miguel de Icaza <miguel@ximian.com>
19769 * convert.cs: Move Error_CannotConvertType,
19770 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
19771 ImplicitNumericConversion, ImplicitConversionExists,
19772 ImplicitUserConversionExists, StandardConversionExists,
19773 FindMostEncompassedType, FindMostSpecificSource,
19774 FindMostSpecificTarget, ImplicitUserConversion,
19775 ExplicitUserConversion, GetConversionOperators,
19776 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
19777 TryImplicitIntConversion, Error_CannotConvertImplicit,
19778 ConvertImplicitRequired, ConvertNumericExplicit,
19779 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
19780 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
19783 Perform the following renames:
19785 StandardConversionExists -> ImplicitStandardConversionExists
19786 ConvertImplicit -> ImplicitConversion
19787 ConvertImplicitStandard -> ImplicitStandardConversion
19788 TryImplicitIntConversion -> ImplicitIntConversion
19789 ConvertImplicitRequired -> ImplicitConversionRequired
19790 ConvertNumericExplicit -> ExplicitNumericConversion
19791 ConvertReferenceExplicit -> ExplicitReferenceConversion
19792 ConvertExplicit -> ExplicitConversion
19793 ConvertExplicitStandard -> ExplicitStandardConversion
19795 2003-05-19 Martin Baulig <martin@ximian.com>
19797 * statement.cs (TypeInfo.StructInfo): Made this type protected.
19798 (TypeInfo): Added support for structs having structs as fields.
19800 * ecore.cs (FieldExpr): Implement IVariable.
19801 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
19802 VariableInfo for the field.
19804 2003-05-18 Martin Baulig <martin@ximian.com>
19806 * expression.cs (This.DoResolve): Report a CS0027 if we're
19807 emitting a field initializer.
19809 2003-05-18 Martin Baulig <martin@ximian.com>
19811 * expression.cs (This.ResolveBase): New public function.
19812 (This.DoResolve): Check for CS0188.
19814 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
19817 * ecore.cs (MethodGroupExpr.DoResolve): Set the
19818 `instance_expression' to null if we don't have any non-static
19821 2003-05-18 Martin Baulig <martin@ximian.com>
19823 Reworked the way how local variables and parameters are handled by
19824 the flow analysis code.
19826 * statement.cs (TypeInfo, VariableMap): New public classes.
19827 (VariableInfo): New public class. This is now responsible for
19828 checking whether a variable has been assigned. It is used for
19829 parameters and local variables.
19830 (Block.EmitMeta): Take the InternalParameters as argument; compute
19831 the layout of the flow vectors here.
19832 (Block.LocalMap, Block.ParameterMap): New public properties.
19833 (FlowBranching): The .ctor doesn't get the InternalParameters
19834 anymore since Block.EmitMeta() now computes the layout of the flow
19836 (MyStructInfo): This class is now known as `StructInfo' and nested
19837 in `TypeInfo'; we don't access this directly anymore.
19839 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
19840 property and removed IsAssigned(), IsFieldAssigned(),
19841 SetAssigned() and SetFieldAssigned(); we now call them on the
19842 VariableInfo so we don't need to duplicate this code everywhere.
19844 * expression.cs (ParameterReference): Added `Block block' argument
19846 (LocalVariableReference, ParameterReference, This): The new
19847 VariableInfo class is now responsible for all the definite
19850 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
19851 IsParameterAssigned, SetParameterAssigned): Removed.
19853 2003-05-18 Martin Baulig <martin@ximian.com>
19855 * typemanager.cs (InitCoreTypes): Try calling
19856 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
19857 the 3-args-version. Corlib now also needs our `void_type'.
19858 (GetMethod): Added overloaded version which takes an optional
19859 `bool report_errors' to allow lookups of optional methods.
19861 2003-05-12 Martin Baulig <martin@ximian.com>
19863 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
19864 only used for locals and not for parameters.
19866 2003-05-12 Miguel de Icaza <miguel@ximian.com>
19868 * support.cs (InternalParameters.ParameterType): Return the
19869 ExternalType of the parameter.
19871 * parameter.cs (Parameter.ExternalType): drop the two arguments,
19874 2003-05-11 Miguel de Icaza <miguel@ximian.com>
19876 * class.cs (MethodData.Define): Do not set the `newslot' on
19877 interface members, if they are also flagged as "override".
19879 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
19880 better code for ++i and i++. This only works for static fields
19881 and local variables.
19883 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
19884 want to pull the DeclSpace out of the builder_to_declspace instead
19885 of the TypeBuilder (like in TypeContainer.FindMembers).
19887 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
19888 instead of LookupTypeContainer. Fixes the crash on .NET for
19889 looking up interface members.
19891 * const.cs: Create our own emit context during the Definition
19892 stage, so that constants are evaluated in the proper context, when
19893 a recursive definition happens.
19895 2003-05-11 Martin Baulig <martin@ximian.com>
19897 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
19898 new block for a switch section.
19899 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
19900 the adding/lookup in the switch block. Fixes #39828.
19902 2003-05-09 Miguel de Icaza <miguel@ximian.com>
19904 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
19905 functionality: I needed to convert the data after I had performed
19906 the add/sub operation into the operands type size.
19908 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
19909 pass the type for the box operation, otherwise the resulting
19910 object would have been of type object.
19912 (BoxedCast): Add constructor to specify the type to box as.
19914 2003-05-07 Miguel de Icaza <miguel@ximian.com>
19916 * iterators.cs: I was reusing the `count' variable inadvertently,
19917 take steps to not allow this to happen.
19919 2003-05-06 Miguel de Icaza <miguel@ximian.com>
19921 * attribute.cs (Attribute.Resolve): Params attributes are encoded
19922 by creating an array at the point where the params starts and
19923 putting all those arguments there, then adjusting the size of the
19926 2003-05-05 Miguel de Icaza <miguel@ximian.com>
19928 * expression.cs (New.AddressOf): Implement interface
19929 IMemoryLocation. This is used when the `new' operator is used in
19930 the context of an invocation to a method on a value type.
19932 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
19935 * namespace.cs: Also check the using aliases here.
19937 * driver.cs: Move the test for using validity after the types have
19938 been entered, so we do a single pass that also includes the using
19941 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
19942 in the regular case. CreateSiblingForFinally is doing extra
19945 * attribute.cs (GetAttributeArgumentExpression): Store the result
19946 on an out value, and use the return value to indicate failure
19947 instead of using null (which is a valid return for Constant.GetValue).
19949 * statement.cs: Perform the analysis flow for the increment
19950 portion after the statement, because this will be the real flow of
19951 execution. Fixes #42385
19953 * codegen.cs (EmitContext.EmitArgument,
19954 EmitContext.EmitStoreArgument): New helper functions when the
19955 RemapToProxy flag is set.
19957 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
19960 Add support for remapping parameters.
19962 * iterators.cs: Propagate parameter values; Store parameter
19963 values in the proxy classes.
19965 2003-05-04 Miguel de Icaza <miguel@ximian.com>
19967 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
19968 need a proxy reference; I do not know what I was thinking
19970 * cs-parser.jay (constructor_initializer): catch another error,
19971 and display nice message.
19973 (field_declaration): catch void field declaration
19974 to flag a better error.
19976 * class.cs (MemberBase.CheckBase): Report an error instead of a
19977 warning if a new protected member is declared in a struct.
19978 (Field.Define): catch the error of readonly/volatile.
19980 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
19982 (FieldExpr.AddressOf): ditto. Catch error where the address of a
19983 volatile variable is taken
19985 2003-05-02 Miguel de Icaza <miguel@ximian.com>
19987 * statement.cs (Fixed.Resolve): Report an error if we are not in
19990 2003-05-01 Miguel de Icaza <miguel@ximian.com>
19992 * typemanager.cs: reuse the code that handles type clashes for
19993 delegates and enumerations.
19995 * class.cs (Report28): Always report.
19997 * expression.cs (EncodeAsAttribute): Allow nulls here.
19999 2003-04-28 Miguel de Icaza <miguel@ximian.com>
20001 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
20002 the functionality for testing whether an expression is valid for
20003 an attribute here. Also handle the case of arrays of elements
20006 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
20007 encoding a linear array into an array of objects that are suitable
20008 to be passed to an CustomAttributeBuilder.
20010 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
20012 * ecore.cs: (FieldExpr): Handle field remapping here.
20014 * iteratators.cs: Pass the instance variable (if the method is an
20015 instance method) to the constructors, so we can access the field
20016 variables on the class.
20018 TODO: Test this with structs. I think the THIS variable on
20019 structs might have to be a pointer, and not a refenrece
20021 2003-04-27 Miguel de Icaza <miguel@ximian.com>
20023 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
20024 local variables to fields in a proxy class.
20026 * iterators.cs (PopulateProxy): Rename our internal fields to
20028 Create a <THIS> field if we are an instance method, so we can
20029 reference our parent container variables.
20030 (MapVariable): Called back from the EmitContext code to enter a
20031 new variable to field mapping into the proxy class (we just create
20035 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
20036 for using the remapped locals to fields.
20038 I placed the code here, because that gives the same semantics to
20039 local variables, and only changes the Emit code.
20041 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
20042 statements inside iterators.
20043 (VariableInfo): Add a FieldBuilder for the cases when we are
20044 remapping local variables to fields in a proxy class
20046 * ecore.cs (SimpleNameResolve): Avoid testing two times for
20047 current_block != null.
20049 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
20050 not cope with strings, as it has been moved to the
20051 TableSwitchEmit. Fixed bug in switch generation.
20053 * expression.cs (New.DoResolve): Provide more context for the user
20054 when reporting an error.
20056 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
20059 * expression.cs (MemberAccess.DoResolve): When we get a type back,
20060 check the permissions for it. Note than in a type-resolution
20061 context the check was already present in DeclSpace.ResolveType,
20062 but was missing from the MemberAccess.
20064 (ArrayCreation.CheckIndices): warn if the user has
20065 more nested levels of expressions, but there are no more
20066 dimensions specified. Avoids crash on bug 41906.
20068 2003-04-26 Miguel de Icaza <miguel@ximian.com>
20070 * statement.cs (Block): replace Implicit bool, for a generic
20072 New flag: `Unchecked'. This is used during the EmitMeta phase
20073 (which is out-of-line with the regular Resolve/Emit process for a
20074 statement, as this is done ahead of time, but still gets a chance
20075 to call constant resolve).
20077 (Block.Flags): new enum for adding a new flag.
20079 (Block.EmitMeta): track the state of unchecked.
20081 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
20082 to enable constant resolution to work there as well.
20084 2003-04-22 Miguel de Icaza <miguel@ximian.com>
20086 * typemanager.cs (ienumerable_type): Also look up
20087 System.Collections.IEnumerable.
20089 2003-04-21 Miguel de Icaza <miguel@ximian.com>
20091 TODO: Test more than one conditional per method.
20093 * class.cs (Indexer.Define): Report the location where the user is
20094 referencing the unsupported feature.
20096 (MethodData): Overload the use of `conditionals' to
20097 minimize the creation of needless ArrayLists. This saves roughly
20098 212kb on my machine.
20100 (Method): Implement the new IIteratorContainer interface.
20101 (Method.SetYields): Implement the method by setting the ModFlags
20102 to contain METHOD_YIELDS.
20104 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
20105 which just got set to null.
20107 * iterators.cs: New file.
20109 (Yield, YieldBreak): New statements.
20111 * statement.cs (Return.Resolve): Flag an error if we are used in
20112 an iterator method.
20114 * codegen.cs (InIterator): New flag set if the code is being
20115 compiled in an iterator method.
20117 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
20118 internal modifier, and we just use it to avoid adding extra
20119 fields, as this is seldom used.
20121 * cs-parser.jay: Add yield_statement (yield and yield break).
20123 * driver.cs: New flag -v2 to turn on version 2 features.
20125 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
20126 hashtable when v2 is enabled.
20128 2003-04-20 Miguel de Icaza <miguel@ximian.com>
20130 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
20131 there is already a namespace defined with this name.
20133 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
20134 people upgraded their corlibs.
20136 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
20137 always use fully qualified types, no need to use the compiler
20140 (TypeManager.IsNamespace): Use binarysearch.
20142 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
20143 AddDelegate): I did not quite use the new IsValid API properly: I
20144 have to pass the short-name and the fullname. I was passing only
20145 the basename instead of the fullname sometimes.
20147 (TypeContainer.DefineType): call NamespaceClash.
20149 * interface.cs (Interface.DefineType): use NamespaceClash before
20152 * delegate.cs (Delegate.DefineType): use NamespaceClash before
20155 * enum.cs: (Enum.DefineType): use NamespaceClash before
20158 * typemanager.cs (: 3-line patch that gives us some tasty 11%
20159 speed increase. First, use the negative_hits cache when we get a
20160 negative. Second, add the type with its full original name
20161 instead of the new . and + encoded name (reflection uses + to
20162 separate type from a nested type). Use LookupTypeReflection
20163 directly which bypasses the type->name hashtable (that we already
20164 know does not contain the type.
20166 * decl.cs (DeclSpace.ResolveTypeExpr): track the
20167 location/container type.
20169 * driver.cs: When passing utf8, use directly the UTF8Encoding.
20171 2003-04-19 Miguel de Icaza <miguel@ximian.com>
20173 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
20175 * delegate.cs (NewDelegate.Resolve): Test whether an instance
20176 method is being referenced in the method group from a static
20177 context, and report error 120 if so.
20179 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
20182 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
20183 is created, we create the A namespace).
20185 * cs-parser.jay: A namespace also introduces a DeclarationFound.
20188 2003-04-18 Miguel de Icaza <miguel@ximian.com>
20190 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
20191 invocation to ModuleBuilder.GetType with the same values will
20192 return a new type instance, so we need to cache its return
20195 * expression.cs (Binary.ResolveOperator): Only allow the compare
20196 operators on enums if they are of the same type.
20198 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
20199 types of ValueType on their own case. Before we were giving them
20200 the same treatment as objects.
20202 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
20203 fullname. Short name is used to compare against container name.
20204 Fullname is used to check against defined namespace names.
20206 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
20207 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
20209 (Method.CheckBase): Call parent.
20210 (MemberBase.CheckBase): Check for protected members on sealed
20212 (PropertyBase.CheckBase): Call parent.
20213 (Field.Define): Call parent.
20215 * report.cs: Negative error codes are now mapped to 8000 - code,
20216 so that the display is render more nicely.
20218 * typemanager.cs: Do not use try/catch, instead report a regular
20221 (GetPointerType, GetReferenceType): These methods provide
20222 mechanisms to obtain the T* and T& from a T. We had the code
20223 previously scattered around the code base, and it also used
20224 TypeManager.LookupType that would go through plenty of caches.
20225 This one goes directly to the type source.
20227 In some places we did the Type.GetType followed by
20228 ModuleBuilder.GetType, but not in others, so this unifies the
20229 processing as well.
20231 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
20232 statements now that we have namespace information.
20234 * typemanager.cs (IsNamespace): New method, returns whether the
20235 string presented is a namespace or not.
20237 (ComputeNamespaces): New public entry point, computes the list of
20238 available namespaces, using the GetNamespaces API call in Mono, or
20239 the slower version in MS.NET.
20241 Now before we start the semantic analysis phase, we have a
20242 complete list of namespaces including everything that the user has
20245 Deleted old code to cache namespaces in .nsc files.
20247 2003-04-17 Miguel de Icaza <miguel@ximian.com>
20249 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
20250 class/struct location definition Location for the implicit
20251 constructor location.
20253 (Operator.Define): Use the location of the operator for the
20254 implicit Method definition.
20256 (Constructor.Emit): use the constructor location for the implicit
20257 base initializer constructor.
20259 * ecore.cs: Remove ITypeExpression. This interface is now gone,
20260 and the Expression class now contains two new methods:
20262 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
20263 isolate type lookup from the rest of the resolution process.
20265 Since we use Expressions to hold type definitions due to the way
20266 we parse the input we have historically overloaded Resolve to
20267 perform the Type lookups if a special flag is passed. Now this is
20268 eliminated and two methods take their place.
20270 The differences in the two methods between xStep and xTerminal is
20271 that xStep is involved in our current lookup system that uses
20272 SimpleNames to compose a name, while xTerminal is used just to
20273 catch the case where the simplename lookup failed.
20275 2003-04-16 Miguel de Icaza <miguel@ximian.com>
20277 * expression.cs (ResolveMemberAccess): Remove redundant code.
20278 TypeExpr expressions are always born fully resolved.
20280 * interface.cs (PopulateMethod): Do not lookup the types twice.
20281 We were doing it once during SemanticAnalysis and once during
20284 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
20285 in local variable type definitions, were being returned as a
20286 SimpleName (we decomposed everything into a string), that is
20287 because primary_expression was being used instead of a type in the
20288 grammar (reduce/reduce conflicts).
20290 The part that was wrong is that we converted the expression into a
20291 string (an oversimplification in one hand, compounded with primary
20292 expressions doing string concatenation).
20298 Would return "A.B.C[]" as a SimpleName. This stopped things like
20299 using clauses from working on this particular context. And a type
20300 was being matched directly against "A.B.C[]".
20302 We now use the correct approach, and allow for ComposedCast to be
20303 part of the unary expression. So the "A.B.C []" become a composed
20304 cast of "A.B.C" (as a nested group of MemberAccess with a
20305 SimpleName at the end) plus the rank composition "[]".
20309 2003-04-10 Miguel de Icaza <miguel@ximian.com>
20311 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
20312 for the access level checking.
20314 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
20315 `TypeContainer container', because I kept getting confused when I
20316 was debugging this code.
20318 * expression.cs (Indexers): Instead of tracking getters/setters,
20319 we now track them in parallel. We create one arraylist less, but
20320 most importantly it is possible now for the LValue code to find a
20321 matching get for a set.
20323 (IndexerAccess.DoResolveLValue): Update the code.
20324 GetIndexersForType has been modified already to extract all the
20325 indexers from a type. The code assumed it did not.
20327 Also make the code set the correct return type for the indexer.
20328 This was fixed a long time ago for properties, but was missing for
20329 indexers. It used to be void_type.
20331 (Binary.Emit): Test first for doubles instead of
20332 floats, as they are more common.
20334 (Binary.EmitBranchable): Use the .un version of the branch opcodes
20335 when dealing with floats and the <=, >= operators. This fixes bug
20338 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
20339 to load the array value by emitting a load on the foreach variable
20340 type. This was incorrect.
20342 We now emit the code to load an element using the the array
20343 variable type, and then we emit the conversion operator.
20347 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
20349 * attribute.cs: Avoid allocation of ArrayLists in the common case.
20351 2003-04-09 Miguel de Icaza <miguel@ximian.com>
20353 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
20354 test for protection before we test for signatures.
20356 (MethodSignature.ToString): implement.
20358 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
20359 to the case where we reduced into a LongConstant.
20361 * decl.cs (CheckAccessLevel): If the type is an array, we can not
20362 depend on whether the information is acurrate, because the
20363 Microsoft runtime will always claim that the array type is public,
20364 regardless of the real state.
20366 If the type is a pointer, another problem happens: the type is
20367 reported as non-public in Microsoft.
20369 In both cases we have to call CheckAccessLevel recursively with
20370 the underlying type as the argument to be tested.
20372 2003-04-08 Miguel de Icaza <miguel@ximian.com>
20374 * assign.cs (Assign.Emit): If we are dealing with a compound
20375 assignment expression, we should use the code path that stores the
20376 intermediate result in a temporary value. This fixes #40903.
20378 *expression.cs (Indirection.ToString): Provide ToString method for
20381 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
20383 * class.cs: Null out fields holding references to Block objects so
20384 they can be garbage collected.
20386 * expression.cs (OverloadResolve): Remove unused local.
20388 2003-04-07 Martin Baulig <martin@ximian.com>
20390 * codegen.cs (EmitContext.CurrentFile): New public field.
20391 (EmitContext.Mark): Use the CurrentFile to check whether the
20392 location is in the correct file.
20393 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
20395 2003-04-07 Martin Baulig <martin@ximian.com>
20397 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
20399 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
20400 location. [FIXME: The location argument which gets passed to this
20401 method is sometimes wrong!]
20403 2003-04-07 Nick Drochak <ndrochak@gol.com>
20405 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
20407 2003-04-07 Miguel de Icaza <miguel@ximian.com>
20409 * expression.cs (Indirection.EmitAssign): We were using the
20410 temporary, but returning immediately instead of continuing the
20413 2003-04-06 Martin Baulig <martin@ximian.com>
20415 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
20416 if it's a nested child, but also deriving from the outer class.
20419 * typemanager.cs (IsNestedChildOf): Make this work if it's a
20420 nested child, but also deriving from the outer class. See
20422 (FilterWithClosure): We may access private members of the outer
20423 class if we're a nested child and deriving from the outer class.
20424 (RealMemberLookup): Only set `closure_private_ok' if the
20425 `original_bf' contained BindingFlags.NonPublic.
20427 2003-04-05 Martin Baulig <martin@ximian.com>
20429 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
20431 2003-04-02 Miguel de Icaza <miguel@ximian.com>
20433 * class.cs (Event.Define): Do not allow abstract events to have
20436 2003-04-01 Miguel de Icaza <miguel@ximian.com>
20438 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
20439 block in event declarations.
20441 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
20442 value type, get its address.
20444 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
20445 leaving a class on the stack instead of a boolean value (int
20446 0/1). Change the code so we compare against null, and then the
20447 result against zero.
20449 * class.cs (TypeContainer.GetClassBases): We were checking for the
20450 parent class being sealed too late.
20452 * expression.cs (Binary.Emit): For <= and >= when dealing with
20453 floating point values, use cgt.un and clt.un instead of cgt and
20456 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
20458 * statement.cs: Apply the same optimization as MS: skip the
20459 GetEnumerator returning an IEnumerator, and use the one returning a
20460 CharEnumerator instead. This allows us to avoid the try-finally block
20463 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
20465 * cs-parser.jay: Attributes cannot be applied to
20466 namespaces. Fixes #40473
20468 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20471 (Add*): check if the name is valid using the full name for constants,
20472 fields, properties and events.
20474 2003-03-28 Miguel de Icaza <miguel@ximian.com>
20476 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
20477 char constants to be part of the enumeration.
20479 * expression.cs (Conditional.DoResolve): Add support for operator
20480 true. Implements the missing functionality from 14.12
20482 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
20483 operator true/false as required by the spec.
20485 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
20486 implicit conversion to boolean.
20488 * statement.cs (Statement.ResolveBoolean): A boolean expression is
20489 also one where the type implements `operator true'.
20491 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
20492 get an expression that will invoke operator true based on an
20495 (GetConversionOperators): Removed the hack that called op_True
20498 (Expression.ResolveBoolean): Move this from Statement.
20500 2003-03-17 Miguel de Icaza <miguel@ximian.com>
20502 * ecore.cs (FieldExpr): do not allow initialization of initonly
20503 fields on derived classes
20505 2003-03-13 Martin Baulig <martin@ximian.com>
20507 * statement.cs (Block.Emit): Call ig.BeginScope() and
20508 ig.EndScope() when compiling with debugging info; call
20509 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
20511 2003-03-08 Miguel de Icaza <miguel@ximian.com>
20513 * expression.cs (Indexers): Do not construct immediately, allow
20514 for new members to be appended as we go. Fixes 38143
20516 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20518 * expression.cs: save/restore context when resolving an unchecked
20521 2003-03-05 Miguel de Icaza <miguel@ximian.com>
20523 * cfold.cs: Catch division by zero in modulus operator during
20526 2003-03-03 Miguel de Icaza <miguel@ximian.com>
20528 * interface.cs (Interface.DefineMembers): Avoid defining members
20531 2003-02-27 Miguel de Icaza <miguel@ximian.com>
20533 * driver.cs: handle the +/- options for -noconfig
20535 * statement.cs (Unckeched.Resolve): Also track the state of
20536 unchecked in the Resolve phase.
20538 2003-02-27 Martin Baulig <martin@ximian.com>
20540 * ecore.cs (Expression.MemberLookup): Don't create a
20541 MethodGroupExpr for something which is not a method. Fixes #38291.
20543 2003-02-25 Miguel de Icaza <miguel@ximian.com>
20545 * class.cs (MemberBase.CheckParameters): Also check that the type
20546 is unmanaged if it is a pointer.
20548 * expression.cs (SizeOf.Resolve): Add location information.
20550 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
20551 a managed type is declared.
20553 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
20554 parameter modifiers as well. Fixes bug 38606
20556 * class.cs: Very sad. Am backing out the speed up changes
20557 introduced by the ArrayList -> Array in the TypeContainer, as they
20558 were not actually that much faster, and introduced a bug (no error
20559 reports on duplicated methods).
20561 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
20562 source first, this will guarantee that we have a valid expression
20563 before calling in lower levels functions that will require a
20564 resolved object. Then use this original_source in the
20565 target.ResolveLValue instead of the original source that was
20568 Another change. Use target.Resolve instead of LValueResolve.
20569 Although we are resolving for LValues, we will let the Assign code
20570 take care of that (it will be called again from Resolve). This
20571 basically allows code like this:
20573 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
20574 class Y { void A (X x) { x [0] += o; }
20576 The problem was that the indexer was trying to resolve for
20577 set_Item (idx, object o) and never finding one. The real set_Item
20578 was set_Item (idx, X). By delaying the process we get the right
20583 2003-02-23 Martin Baulig <martin@ximian.com>
20585 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
20586 while calling DoEmit ().
20588 * codegen.cs (EmitContext.Mark): Don't mark locations in other
20589 source files; if you use the #line directive inside a method, the
20590 compiler stops emitting line numbers for the debugger until it
20591 reaches the end of the method or another #line directive which
20592 restores the original file.
20594 2003-02-23 Martin Baulig <martin@ximian.com>
20596 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
20598 2003-02-23 Martin Baulig <martin@ximian.com>
20600 * statement.cs (Block.AddChildVariableNames): We need to call this
20601 recursively, not just for our immediate children.
20603 2003-02-23 Martin Baulig <martin@ximian.com>
20605 * class.cs (Event.Define): Always make the field private, like csc does.
20607 * typemanager.cs (TypeManager.RealMemberLookup): Make events
20608 actually work, fixes bug #37521.
20610 2003-02-23 Miguel de Icaza <miguel@ximian.com>
20612 * delegate.cs: When creating the various temporary "Parameters"
20613 classes, make sure that we call the ComputeAndDefineParameterTypes
20614 on those new parameters (just like we do with the formal ones), to
20615 allow them to be resolved in the context of the DeclSpace.
20617 This fixes the bug that Dick observed in Bugzilla #38530.
20619 2003-02-22 Miguel de Icaza <miguel@ximian.com>
20621 * expression.cs (ResolveMemberAccess): When resolving a constant,
20622 do not attempt to pull a constant if the value was not able to
20623 generate a valid constant.
20625 * const.cs (LookupConstantValue): Do not report more errors than required.
20627 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20629 * expression.cs: fixes bug #38328.
20631 2003-02-18 Miguel de Icaza <miguel@ximian.com>
20633 * class.cs: Changed all the various members that can be part of a
20634 class from being an ArrayList to be an Array of the right type.
20635 During the DefineType type_list, interface_list, delegate_list and
20636 enum_list are turned into types, interfaces, delegates and enums
20639 And during the member population, indexer_list, event_list,
20640 constant_list, field_list, instance_constructor_list, method_list,
20641 operator_list and property_list are turned into their real arrays.
20643 Although we could probably perform this operation earlier, for
20644 good error reporting we need to keep the lists and remove the
20645 lists for longer than required.
20647 This optimization was triggered by Paolo profiling the compiler
20648 speed on the output of `gen-sample-program.pl' perl script.
20650 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
20651 not crash in methods like MemberLookupFailed that use this field.
20653 This problem arises when the compiler fails to resolve a type
20654 during interface type definition for example.
20656 2003-02-18 Miguel de Icaza <miguel@ximian.com>
20658 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
20659 inherit from System.Object, so we have to stop at null, not only
20660 when reaching System.Object.
20662 2003-02-17 Miguel de Icaza <miguel@ximian.com>
20664 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
20665 DeclaredOnly because the parent indexer might have had a different
20666 name, but did not loop until the top of the hierarchy was reached.
20668 The problem this one fixes is 35492: when a class implemented an
20669 indexer from an interface, we were getting the interface method
20670 (which was abstract) and we were flagging an error (can not invoke
20673 This also keeps bug 33089 functioning, and test-148 functioning.
20675 * typemanager.cs (IsSpecialMethod): The correct way of figuring
20676 out if a method is special is to see if it is declared in a
20677 property or event, or whether it is one of the predefined operator
20678 names. This should fix correctly #36804.
20680 2003-02-15 Miguel de Icaza <miguel@ximian.com>
20682 The goal here is to remove the dependency on EmptyCast.Peel ().
20683 Killing it completely.
20685 The problem is that currently in a number of places where
20686 constants are expected, we have to "probe" for an EmptyCast, and
20687 Peel, which is not the correct thing to do, as this will be
20688 repetitive and will likely lead to errors.
20690 The idea is to remove any EmptyCasts that are used in casts that
20691 can be reduced to constants, so we only have to cope with
20694 This bug hunt was triggered by Bug 37363 and the desire to remove
20695 the duplicate pattern where we were "peeling" emptycasts to check
20696 whether they were constants. Now constants will always be
20699 * ecore.cs: Use an enumconstant here instead of wrapping with
20702 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
20703 throwing me off. By handling this we can get rid of a few hacks.
20705 * statement.cs (Switch): Removed Peel() code.
20707 2003-02-14 Miguel de Icaza <miguel@ximian.com>
20709 * class.cs: Location information for error 508
20711 * expression.cs (New.DoResolve): Add a guard against double
20712 resolution of an expression.
20714 The New DoResolve might be called twice when initializing field
20715 expressions (see EmitFieldInitializers, the call to
20716 GetInitializerExpression will perform a resolve on the expression,
20717 and later the assign will trigger another resolution
20719 This leads to bugs (#37014)
20721 * delegate.cs: The signature for EndInvoke should contain any ref
20722 or out parameters as well. We were not doing this in the past.
20724 * class.cs (Field.Define): Do not overwrite the type definition
20725 inside the `volatile' group. Turns out that volatile enumerations
20726 were changing the type here to perform a validity test, which
20729 2003-02-12 Miguel de Icaza <miguel@ximian.com>
20731 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
20732 and structs, we do not want to load the instance variable
20734 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
20735 enum_type has to be handled like an object reference (implicit
20736 conversions exists from this to object), but the regular IsClass
20737 and IsValueType tests will never return true for this one.
20739 Also we use TypeManager.IsValueType instead of type.IsValueType,
20740 just for consistency with the rest of the code (this is only
20741 needed if we ever use the construct exposed by test-180.cs inside
20742 corlib, which we dont today).
20744 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
20746 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
20749 2003-02-09 Martin Baulig <martin@ximian.com>
20751 * namespace.cs (Namespace..ctor): Added SourceFile argument.
20752 (Namespace.DefineNamespaces): New static public method; this is
20753 called when we're compiling with debugging to add all namespaces
20754 to the symbol file.
20756 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
20757 pass it to the Namespace's .ctor.
20759 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
20760 and MethodBase arguments; pass the namespace ID to the symwriter;
20761 pass the MethodBase instead of the token to the symwriter.
20762 (SymbolWriter.DefineNamespace): New method to add a namespace to
20765 2003-02-09 Martin Baulig <martin@ximian.com>
20767 * symbolwriter.cs: New file. This is a wrapper around
20768 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
20769 methods here in near future.
20771 2003-02-09 Martin Baulig <martin@ximian.com>
20773 * codegen.cs (EmitContext.Mark): Just pass the arguments to
20774 ILGenerator.MarkSequencePoint() which are actually used by the
20777 2003-02-09 Martin Baulig <martin@ximian.com>
20779 * location.cs (SourceFile): New public sealed class. This
20780 contains the name and an index which is used in the location's token.
20781 (Location): Reserve an appropriate number of bits in the token for
20782 the source file instead of walking over that list, this gives us a
20783 really huge performance improvement when compiling with debugging.
20785 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
20786 `SourceFile' argument instead of a string.
20787 (Driver.ProcessFile): Add all the files via Location.AddFile(),
20788 but don't parse/tokenize here, we need to generate the list of all
20789 source files before we do that.
20790 (Driver.ProcessFiles): New static function. Parses/tokenizes all
20793 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
20794 instead of a string.
20796 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
20799 2003-02-09 Martin Baulig <martin@ximian.com>
20801 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
20802 filename on `#line default'.
20804 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
20806 * statement.cs: don't clear the pinned var when the fixed statement
20807 returns from the method (fixes bug#37752).
20809 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
20811 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
20814 2003-02-07 Martin Baulig <martin@ximian.com>
20816 * driver.cs: Removed the `--debug-args' command line argument.
20818 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
20819 automatically by the AsssemblyBuilder.
20820 (CodeGen.InitializeSymbolWriter): We don't need to call any
20821 initialization function on the symbol writer anymore. This method
20822 doesn't take any arguments.
20824 2003-02-03 Miguel de Icaza <miguel@ximian.com>
20826 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
20827 from referenced assemblies as well.
20829 2003-02-02 Martin Baulig <martin@ximian.com>
20831 * class.cs (MethodData.Emit): Generate debugging info for external methods.
20833 2003-02-02 Martin Baulig <martin@ximian.com>
20835 * class.cs (Constructor.Emit): Open the symbol writer before
20836 emitting the constructor initializer.
20837 (ConstructorInitializer.Emit): Call ec.Mark() to allow
20838 single-stepping through constructor initializers.
20840 2003-01-30 Miguel de Icaza <miguel@ximian.com>
20842 * class.cs: Handle error 549: do not allow virtual methods in
20845 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
20847 * decl.cs: Check access levels when resolving types
20849 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
20851 * statement.cs: Add parameters and locals set in catch blocks that might
20852 return to set vector
20854 2003-01-29 Miguel de Icaza <miguel@ximian.com>
20856 * class.cs (Operator): Set the SpecialName flags for operators.
20858 * expression.cs (Invocation.DoResolve): Only block calls to
20859 accessors and operators on SpecialName methods.
20861 (Cast.TryReduce): Handle conversions from char constants.
20864 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
20866 * statement.cs: small memory and time optimization in FlowBranching.
20868 2003-01-28 Pedro Mart <yoros@wanadoo.es>
20870 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
20871 problem that the last fix but in the other sid (Set).
20873 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
20874 access when there is no indexer in the hierarchy.
20876 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
20878 * class.cs: Combine some if statements.
20880 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20882 * driver.cs: fixed bug #37187.
20884 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
20886 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
20887 any indexer, it's needed to build a list with all the indexers in the
20888 hierarchy (AllGetters), else we have problems. Fixes #35653.
20890 2003-01-23 Miguel de Icaza <miguel@ximian.com>
20892 * class.cs (MethodData.Define): It is wrong for an interface
20893 implementation to be static in both cases: explicit and implicit.
20894 We were only handling this in one case.
20896 Improve the if situation there to not have negations.
20898 * class.cs (Field.Define): Turns out that we do not need to check
20899 the unsafe bit on field definition, only on usage. Remove the test.
20901 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20903 * driver.cs: use assembly.Location instead of Codebase (the latest
20904 patch made mcs fail when using MS assemblies).
20906 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
20908 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
20909 get the path to *corlib.dll.
20911 2003-01-21 Nick Drochak <ndrochak@gol.com>
20915 * typemanager.cs: Remove compiler warnings
20917 2003-01-20 Duncan Mak <duncan@ximian.com>
20919 * AssemblyInfo.cs: Bump the version number to 0.19.
20921 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20923 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
20925 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
20927 * class.cs (Constructor::Emit): Emit debugging info for constructors.
20929 2003-01-17 Miguel de Icaza <miguel@ximian.com>
20931 * cs-parser.jay: Small fix: we were not comparing the constructor
20932 name correctly. Thanks to Zoltan for the initial pointer.
20934 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
20936 * cs-tokenizer.cs: Set file name when specified with #line
20938 2003-01-15 Miguel de Icaza <miguel@ximian.com>
20940 * cs-parser.jay: Only perform the constructor checks here if we
20941 are named like the class; This will help provider a better
20942 error. The constructor path is taken when a type definition is
20943 not found, but most likely the user forgot to add the type, so
20944 report that rather than the constructor error.
20946 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
20948 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
20951 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20953 * cs-parser.jay: Add cleanup call.
20955 2003-01-13 Duncan Mak <duncan@ximian.com>
20957 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
20958 consistent with other methods.
20960 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20962 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
20964 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
20966 * attribute.cs: only set GuidAttr to true when we have a
20969 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20973 * typemanager.cs: fixes to allow mcs compile corlib with the new
20974 Type.IsSubclassOf fix.
20976 2003-01-08 Miguel de Icaza <miguel@ximian.com>
20978 * expression.cs (LocalVariableReference.DoResolve): Classify a
20979 constant as a value, not as a variable. Also, set the type for
20982 * cs-parser.jay (fixed_statement): take a type instead of a
20983 pointer_type, so we can produce a better error message later.
20985 * statement.cs (Fixed.Resolve): Flag types that are not pointers
20988 (For.DoEmit): Make inifinite loops have a
20989 non-conditional branch back.
20991 (Fixed.DoEmit): First populate the pinned variables, then emit the
20992 statement, then clear the variables. Before I was emitting the
20993 code once for each fixed piece.
20996 2003-01-08 Martin Baulig <martin@ximian.com>
20998 * statement.cs (FlowBranching.MergeChild): A break in a
20999 SWITCH_SECTION does not leave a loop. Fixes #36155.
21001 2003-01-08 Martin Baulig <martin@ximian.com>
21003 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
21004 lives in the same number space than `param_map'. Fixes #36154.
21006 2003-01-07 Miguel de Icaza <miguel@ximian.com>
21008 * cs-parser.jay (constructor_declaration): Set the
21009 Constructor.ModFlags before probing for it. This makes the
21010 compiler report 514, 515 and 132 (the code was there, but got
21013 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
21014 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
21015 (GotoCase.Resolve): Set `Returns' to ALWAYS.
21017 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
21019 * enum.cs: create the enum static fields using the enum type.
21021 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
21023 * class.cs: don't try to create the ParamBuilder for the return
21024 type if it's not needed (and handle it breaking for the ms runtime
21027 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
21029 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
21031 2002-12-29 Miguel de Icaza <miguel@ximian.com>
21033 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
21034 the command. This showed up while compiling the JANET source
21035 code, which used \r as its only newline separator.
21037 2002-12-28 Miguel de Icaza <miguel@ximian.com>
21039 * class.cs (Method.Define): If we are an operator (because it
21040 reuses our code), then set the SpecialName and HideBySig. #36128
21042 2002-12-22 Miguel de Icaza <miguel@ximian.com>
21044 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
21045 exception, report error 120 `object reference required'.
21047 * driver.cs: Add --pause option, used during to measure the size
21048 of the process as it goes with --timestamp.
21050 * expression.cs (Invocation.DoResolve): Do not allow methods with
21051 SpecialName to be invoked.
21053 2002-12-21 Miguel de Icaza <miguel@ximian.com>
21055 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
21056 number before adding it.
21058 2002-12-21 Ravi Pratap <ravi@ximian.com>
21060 * ecore.cs (StandardImplicitConversion): When in an unsafe
21061 context, we allow conversion between void * to any other pointer
21062 type. This fixes bug #35973.
21064 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
21066 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
21067 is not thrown when extensionless outputs are used
21069 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21071 * rootcontext.cs: fixed compilation of corlib.
21073 2002-12-19 Miguel de Icaza <miguel@ximian.com>
21075 * attribute.cs (Attributes.Contains): Add new method.
21077 * class.cs (MethodCore.LabelParameters): if the parameter is an
21078 `out' parameter, check that no attribute `[In]' has been passed.
21080 * enum.cs: Handle the `value__' name in an enumeration.
21082 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
21084 * decl.cs: Added special case to allow overrides on "protected
21087 2002-12-18 Ravi Pratap <ravi@ximian.com>
21089 * attribute.cs (Attributes.AddAttributeSection): Rename to this
21090 since it makes much more sense.
21092 (Attributes.ctor): Don't require a Location parameter.
21094 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
21096 * attribute.cs (ApplyAttributes): Remove extra Location parameters
21097 since we already have that information per attribute.
21099 * everywhere : make appropriate changes.
21101 * class.cs (LabelParameters): Write the code which actually
21102 applies attributes to the return type. We can't do this on the MS
21103 .NET runtime so we flag a warning in the case an exception is
21106 2002-12-18 Miguel de Icaza <miguel@ximian.com>
21108 * const.cs: Handle implicit null conversions here too.
21110 2002-12-17 Ravi Pratap <ravi@ximian.com>
21112 * class.cs (MethodCore.LabelParameters): Remove the extra
21113 Type [] parameter since it is completely unnecessary. Instead
21114 pass in the method's attributes so that we can extract
21115 the "return" attribute.
21117 2002-12-17 Miguel de Icaza <miguel@ximian.com>
21119 * cs-parser.jay (parse): Use Report.Error to flag errors instead
21120 of ignoring it and letting the compile continue.
21122 * typemanager.cs (ChangeType): use an extra argument to return an
21123 error condition instead of throwing an exception.
21125 2002-12-15 Miguel de Icaza <miguel@ximian.com>
21127 * expression.cs (Unary.TryReduce): mimic the code for the regular
21128 code path. Perform an implicit cast in the cases where we can
21129 implicitly convert to one of the integral types, and then reduce
21130 based on that constant. This fixes bug #35483.
21132 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21134 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
21136 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21138 * namespace.cs: fixed bug #35489.
21140 2002-12-12 Miguel de Icaza <miguel@ximian.com>
21142 * class.cs: Remove some dead code.
21144 * cs-parser.jay: Estimate the number of methods needed
21145 (RootContext.MethodCount);
21147 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
21148 numbers instead of StringBuilders.
21150 * support.cs (PtrHashtable): Add constructor with initial size;
21151 We can now reduce reallocations of the method table.
21153 2002-12-10 Ravi Pratap <ravi@ximian.com>
21155 * attribute.cs (ApplyAttributes): Keep track of the emitted
21156 attributes on a per-target basis. This fixes bug #35413.
21158 2002-12-10 Miguel de Icaza <miguel@ximian.com>
21160 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
21161 default to the Windows 1252 encoding.
21163 (UnixParseOption): Support version, thanks to Alp for the missing
21166 * AssemblyInfo.cs: Add nice assembly information.
21168 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
21171 * cs-parser.jay: Allow a trailing comma before the close bracked
21172 in the attribute_section production.
21174 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
21175 address of the instance was being taken, I will take this out,
21176 because we take the address of the object immediately here.
21178 2002-12-09 Ravi Pratap <ravi@ximian.com>
21180 * typemanager.cs (AreMultipleAllowed): Take care of the most
21181 obvious case where attribute type is not in the current assembly -
21184 2002-12-08 Miguel de Icaza <miguel@ximian.com>
21186 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
21187 definitions, instead of doing that afterwards.
21189 Also we use a nice little hack, depending on the constructor, we
21190 know if we are a "composed" name or a simple name. Hence, we
21191 avoid the IndexOf test, and we avoid
21193 * codegen.cs: Add code to assist in a bug reporter to track down
21194 the source of a compiler crash.
21196 2002-12-07 Ravi Pratap <ravi@ximian.com>
21198 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
21199 types have been emitted for a given element and flag an error
21200 if something which does not have AllowMultiple set is used more
21203 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
21204 attribute types and their corresponding AllowMultiple properties
21206 (AreMultipleAllowed): Check the property for a given type.
21208 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
21209 property in the case we have a TypeContainer.
21211 (Attributes.AddAttribute): Detect duplicates and just skip on
21212 adding them. This trivial fix catches a pretty gross error in our
21213 attribute emission - global attributes were being emitted twice!
21215 Bugzilla bug #33187 is now fixed.
21217 2002-12-06 Miguel de Icaza <miguel@ximian.com>
21219 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
21220 instead of pp_and).
21222 * expression.cs (Binary.ResolveOperator): I can only use the
21223 Concat (string, string, string) and Concat (string, string,
21224 string, string) if the child is actually a concatenation of
21227 2002-12-04 Miguel de Icaza <miguel@ximian.com>
21229 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
21230 context where we need a 2-character lookahead.
21232 * pending.cs (PendingImplementation): Rework so we can keep track
21233 of interface types all the time, and flag those which were
21234 implemented by parents as optional.
21236 2002-12-03 Miguel de Icaza <miguel@ximian.com>
21238 * expression.cs (Binary.ResolveOperator): Use
21239 String.Concat(string,string,string) or
21240 String.Concat(string,string,string,string) when possible.
21242 * typemanager: More helper methods.
21245 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
21247 * pending.cs: remove the bogus return from GetMissingInterfaces()
21248 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
21250 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21252 * namespace.cs: avoid duplicated 'using xxx' being added to
21253 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
21254 when we get more than one 'using' statement for the same namespace.
21255 Report a CS0105 warning for it.
21257 2002-11-30 Miguel de Icaza <miguel@ximian.com>
21259 * cs-tokenizer.cs (consume_identifier): use read directly, instead
21260 of calling getChar/putback, uses internal knowledge of it.
21262 (xtoken): Reorder tokenizer so most common patterns are checked
21263 first. This reduces the compilation time in another 5% (from 8.11s
21264 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
21266 The parsing time is 22% of the compilation in mcs, and from that
21267 64% is spent on the tokenization process.
21269 I tried using a binary search for keywords, but this is slower
21270 than the hashtable. Another option would be to do a couple of
21273 * Not use a StringBuilder, instead use an array of chars,
21274 with a set value. Notice that this way we could catch
21275 the 645 error without having to do it *afterwards*.
21277 * We could write a hand-parser to avoid the hashtable
21278 compares altogether.
21280 The identifier consumption process takes 37% of the tokenization
21281 time. Another 15% is spent on is_number. 56% of the time spent
21282 on is_number is spent on Int64.Parse:
21284 * We could probably choose based on the string length to
21285 use Int32.Parse or Int64.Parse and avoid all the 64-bit
21288 Another 3% is spend on wrapping `xtoken' in the `token' function.
21290 Handle 0xa0 as whitespace (#34752)
21292 2002-11-26 Miguel de Icaza <miguel@ximian.com>
21294 * typemanager.cs (IsCLRType): New routine to tell whether a type
21295 is one of the builtin types.
21297 Maybe it needs to use TypeCodes to be faster. Maybe we could use
21298 typecode in more places instead of doing pointer comparissions.
21299 We could leverage some knowledge about the way the typecodes are
21302 New code to cache namespaces in assemblies, it is currently not
21303 invoked, to be used soon.
21305 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
21307 * expression.cs (Binary.ResolveOperator): specially handle
21308 strings, and do not perform user-defined operator overloading for
21311 2002-11-24 Miguel de Icaza <miguel@ximian.com>
21313 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
21314 internalcall as it is a pretty simple operation; Avoid whenever
21315 possible to call Char.IsLetter.
21317 (consume_identifier): Cut by half the number of
21318 hashtable calls by merging the is_keyword and GetKeyword behavior.
21320 Do not short-circuit, because if we do, we
21321 report errors (ie, #if false && true would produce an invalid
21325 2002-11-24 Martin Baulig <martin@ximian.com>
21327 * expression.cs (Cast.TryReduce): If we're in checked syntax,
21328 check constant ranges and report a CS0221. Fixes #33186.
21330 2002-11-24 Martin Baulig <martin@ximian.com>
21332 * cs-parser.jay: Make this work for uninitialized variable
21333 declarations in the `for' initializer. Fixes #32416.
21335 2002-11-24 Martin Baulig <martin@ximian.com>
21337 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
21338 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
21340 2002-11-24 Martin Baulig <martin@ximian.com>
21342 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
21343 argument; if true, we also check for user-defined conversions.
21344 This is only needed if both arguments are of a user-defined type.
21345 Fixes #30443, added test-175.cs.
21346 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
21348 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
21350 2002-11-24 Martin Baulig <martin@ximian.com>
21352 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
21353 function to get the store opcode.
21354 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
21355 only emit the Ldelema if the store opcode is Stobj. You must run
21356 both test-34 and test-167 to test this. Fixes #34529.
21358 2002-11-23 Martin Baulig <martin@ximian.com>
21360 * ecore.cs (Expression.MemberLookup): Added additional
21361 `qualifier_type' argument which is used when we're being called
21362 from MemberAccess.DoResolve() and null if we're called from a
21364 (Expression.MemberLookupFailed): New method to report errors; this
21365 does the CS1540 check and reports the correct error message.
21367 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
21368 argument for the CS1540 check and redone the way how we're dealing
21369 with private members. See the comment in the source code for details.
21370 (FilterWithClosure): Reverted this back to revision 1.197; renamed
21371 `closure_start_type' to `closure_qualifier_type' and check whether
21372 it's not null. It was not this filter being broken, it was just
21373 being called with the wrong arguments.
21375 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
21376 and pass it the correct `qualifier_type'; this also does the error
21379 2002-11-22 Miguel de Icaza <miguel@ximian.com>
21381 * expression.cs (Invocation.EmitParams): If the we are dealing
21382 with a non-built-in value type, load its address as well.
21384 (ArrayCreation): Use a a pretty constant instead
21385 of the hardcoded value 2. Use 6 instead of 2 for the number of
21386 static initializers.
21388 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
21389 because they are not really value types, just glorified integers.
21391 * driver.cs: Do not append .exe, the CSC compiler does not do it.
21393 * ecore.cs: Remove redundant code for enumerations, make them use
21394 the same code path as everything else, fixes the casting issue
21395 with enumerations in Windows.Forms.
21397 * attribute.cs: Do only cast to string if it is a string, the
21398 validation happens later.
21400 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
21401 people upgrade their corlibs.
21403 * ecore.cs: Oops, enumerations were not following the entire code path
21405 2002-11-21 Miguel de Icaza <miguel@ximian.com>
21407 * typemanager.cs (FilterWithClosure): Commented out the test for
21408 1540 in typemanager.cs, as it has problems when accessing
21409 protected methods from a parent class (see test-174.cs).
21411 * attribute.cs (Attribute.ValidateGuid): new method.
21412 (Attribute.Resolve): Use above.
21414 2002-11-19 Miguel de Icaza <miguel@ximian.com>
21416 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
21418 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
21419 handling for enumerations, as we only needed the TypeContainer
21420 functionality to begin with (this is required for the fix below to
21421 work for enums that reference constants in a container class for
21424 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
21426 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
21427 a valid TypeBuilder to perform lookups on.o
21429 * class.cs (InheritableMemberSignatureCompare): Use true in the
21430 call to GetGetMethod and GetSetMethod, because we are comparing
21431 the signature, and we need to get the methods *even* if they are
21434 (PropertyBase.CheckBase): ditto.
21436 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
21437 GotoCase.Resolve): Use Peel on EmpytCasts.
21439 * ecore.cs (EmptyCast): drop child, add Peel method.
21441 2002-11-17 Martin Baulig <martin@ximian.com>
21443 * ecore.cs (EmptyCast.Child): New public property.
21445 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
21446 label resolved to an EmptyCast. Fixes #34162.
21447 (GotoCase.Resolve): Likewise.
21448 (Block.EmitMeta): Likewise.
21450 2002-11-17 Martin Baulig <martin@ximian.com>
21452 * expression.cs (Invocation.BetterConversion): Prefer int over
21453 uint; short over ushort; long over ulong for integer literals.
21454 Use ImplicitConversionExists instead of StandardConversionExists
21455 since we also need to check for user-defined implicit conversions.
21456 Fixes #34165. Added test-173.cs.
21458 2002-11-16 Martin Baulig <martin@ximian.com>
21460 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
21461 with the `true' and `false' literals. Fixes #33151.
21463 2002-11-16 Martin Baulig <martin@ximian.com>
21465 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
21466 October 22nd; don't do the cs1540 check for static members.
21468 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
21469 now using our own filter here and doing the cs1540 check again.
21471 2002-11-16 Martin Baulig <martin@ximian.com>
21473 * support.cs (InternalParameters): Don't crash if we don't have
21474 any fixed parameters. Fixes #33532.
21476 2002-11-16 Martin Baulig <martin@ximian.com>
21478 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
21479 when looking up static methods to make this work on Windows.
21482 2002-11-16 Martin Baulig <martin@ximian.com>
21484 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
21485 a setter rather than using PropertyInfo.CanWrite.
21487 2002-11-15 Nick Drochak <ndrochak@gol.com>
21489 * class.cs: Allow acces to block member by subclasses. Fixes build
21492 2002-11-14 Martin Baulig <martin@ximian.com>
21494 * class.cs (Constructor.Emit): Added the extern/block check.
21497 2002-11-14 Martin Baulig <martin@ximian.com>
21499 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
21500 iteration while looking for indexers, this is needed because the
21501 indexer may have a different name in our base classes. Fixed the
21502 error reporting (no indexers at all, not get accessor, no
21503 overloaded match). Fixes bug #33089.
21504 (IndexerAccess.DoResolveLValue): Likewise.
21506 2002-11-14 Martin Baulig <martin@ximian.com>
21508 * class.cs (PropertyBase.CheckBase): Make this work for multiple
21509 indexers. Fixes the first part of bug #33089.
21510 (MethodSignature.InheritableMemberSignatureCompare): Added support
21513 2002-11-13 Ravi Pratap <ravi@ximian.com>
21515 * attribute.cs (Attribute.Resolve): Catch the
21516 NullReferenceException and report it since it isn't supposed to
21519 2002-11-12 Miguel de Icaza <miguel@ximian.com>
21521 * expression.cs (Binary.EmitBranchable): Also handle the cases for
21522 LogicalOr and LogicalAnd that can benefit from recursively
21523 handling EmitBranchable. The code now should be nice for Paolo.
21525 2002-11-08 Miguel de Icaza <miguel@ximian.com>
21527 * typemanager.cs (LookupType): Added a negative-hit hashtable for
21528 the Type lookups, as we perform quite a number of lookups on
21529 non-Types. This can be removed once we can deterministically tell
21530 whether we have a type or a namespace in advance.
21532 But this might require special hacks from our corlib.
21536 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
21537 and double which avoids a conversion from an integer to a double.
21539 * expression.cs: tiny optimization, avoid calling IsConstant,
21540 because it effectively performs the lookup twice.
21542 2002-11-06 Miguel de Icaza <miguel@ximian.com>
21544 But a bogus return here to keep the semantics of the old code
21545 until the Mono runtime is fixed.
21547 * pending.cs (GetMissingInterfaces): New method used to remove all
21548 the interfaces that are already implemented by our parent
21549 classes from the list of pending methods.
21551 * interface.cs: Add checks for calls after ResolveTypeExpr.
21553 2002-11-05 Miguel de Icaza <miguel@ximian.com>
21555 * class.cs (Class.Emit): Report warning 67: event not used if the
21556 warning level is beyond 3.
21558 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
21559 being a NullLiteral.
21561 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
21564 * class.cs (TypeContainer.GetClassBases): Cover a missing code
21565 path that might fail if a type can not be resolved.
21567 * expression.cs (Binary.Emit): Emit unsigned versions of the
21570 * driver.cs: use error 5.
21572 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
21574 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
21576 2002-11-01 Miguel de Icaza <miguel@ximian.com>
21578 * cs-parser.jay (switch_section): A beautiful patch from Martin
21579 Baulig that fixed 33094.
21581 2002-10-31 Miguel de Icaza <miguel@ximian.com>
21583 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
21584 Check whether the base is abstract and report an error if so.
21586 * expression.cs (IndexerAccess.DoResolveLValue,
21587 IndexerAccess.DoResolve): ditto.
21589 (Invocation.DoResolve): ditto.
21591 (Invocation.FullMethodDesc): Improve the report string.
21593 * statement.cs (Block): Eliminate IsVariableDefined as it is
21594 basically just a wrapper for GetVariableInfo.
21596 * ecore.cs (SimpleName): Use new
21598 * support.cs (ReflectionParamter.ParameterType): We unwrap the
21599 type, as we return the actual parameter ref/unref state on a
21602 2002-10-30 Miguel de Icaza <miguel@ximian.com>
21604 * support.cs: Return proper flags REF/OUT fixing the previous
21607 * expression.cs: Reverted last patch, that was wrong. Is_ref is
21608 not used to mean `ref' but `ref or out' in ParameterReference
21610 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
21611 full type signature instead of calling TypeManger.CSharpName
21614 * support.cs (InternalParameters.ParameterDesc): Do not compare
21615 directly to the modflags, because REF/OUT will actually be bitsets
21618 * delegate.cs (VerifyMethod): Check also the modifiers.
21620 * cs-tokenizer.cs: Fix bug where floating point values with an
21621 exponent where a sign was missing was ignored.
21623 * driver.cs: Allow multiple assemblies to be specified in a single
21626 2002-10-28 Miguel de Icaza <miguel@ximian.com>
21628 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
21629 because identifiers after a parenthesis would end up in this kind
21630 of production, and we needed to desamiguate it for having casts
21633 (UserDefinedType *) xxx
21635 2002-10-24 Miguel de Icaza <miguel@ximian.com>
21637 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
21638 we should set on the Bindingflags.NonPublic, but not turn on
21639 private_ok. private_ok controls whether a Private member is
21640 returned (this is chekced on the filter routine), while the
21641 BindingFlags.NonPublic just controls whether private/protected
21642 will be allowed. This fixes the problem part of the problem of
21643 private properties being allowed to be used in derived classes.
21645 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
21646 so we can call the children DoResolveLValue method (this will
21647 properly signal errors on lvalue assignments to base properties)
21649 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
21650 getter are null, and we have a property info, we know that this
21651 happened because the lookup failed, so we report an error 122 for
21652 protection level violation.
21654 We also silently return if setter and getter are null in the
21655 resolve functions, this condition only happens if we have flagged
21656 the error before. This is the other half of the problem.
21658 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
21659 not have accessibility information, that is why we were returning
21660 true in the filter function in typemanager.cs.
21662 To properly report 122 (property is inaccessible because of its
21663 protection level) correctly, we report this error in ResolveAccess
21664 by failing if both the setter and the getter are lacking (ie, the
21667 DoResolve and DoLResolve have been modified to check for both
21668 setter/getter being null and returning silently, the reason being
21669 that I did not want to put the knowledge about this error in upper
21672 int old = Report.Errors;
21673 x = new PropertyExpr (...);
21674 if (old != Report.Errors)
21679 So the property expr is returned, but it is invalid, so the error
21680 will be flagged during the resolve process.
21682 * class.cs: Remove InheritablePropertySignatureCompare from the
21683 class, as we no longer depend on the property signature to compute
21684 whether it is possible to implement a method or not.
21686 The reason is that calling PropertyInfo.GetGetMethod will return
21687 null (in .NET, in Mono it works, and we should change this), in
21688 cases where the Get Method does not exist in that particular
21693 class X { public virtual int A { get { return 1; } } }
21695 class Z : Y { public override int A { get { return 2; } } }
21697 Would fail in Z because the parent (Y) would not have the property
21698 defined. So we avoid this completely now (because the alternative
21699 fix was ugly and slow), and we now depend exclusively on the
21702 (PropertyBase.CheckBase): Use a method-base mechanism to find our
21703 reference method, instead of using the property.
21705 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
21706 routines are gone now.
21708 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
21709 names, they were incorrectly named.
21711 * cs-tokenizer.cs: Return are more gentle token on failure.
21713 * pending.cs (PendingImplementation.InterfaceMethod): This routine
21714 had an out-of-sync index variable, which caused it to remove from
21715 the list of pending methods the wrong method sometimes.
21717 2002-10-22 Miguel de Icaza <miguel@ximian.com>
21719 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
21720 CanWrite, because those refer to this particular instance of the
21721 property, and do not take into account the fact that we can
21722 override single members of a property.
21724 Constructor requires an EmitContext. The resolution process does
21725 not happen here, but we need to compute the accessors before,
21726 because the resolution does not always happen for properties.
21728 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
21729 subclass, before we did not update this flag, but we did update
21732 (GetAccessors): Drop this routine, as it did not work in the
21733 presence of partially overwritten set/get methods.
21735 Notice that this broke the cs1540 detection, but that will require
21738 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21742 * driver.cs: issue a warning instead of an error if we don't support
21743 debugging for the platform. Also ignore a couple of errors that may
21744 arise when trying to write the symbols. Undo my previous patch.
21746 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21748 * driver.cs: ignore /debug switch except for Unix platforms.
21750 2002-10-23 Nick Drochak <ndrochak@gol.com>
21752 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
21754 2002-10-21 Miguel de Icaza <miguel@ximian.com>
21756 * driver.cs: Do not make mcs-debug conditional, so we do not break
21757 builds that use it.
21759 * statement.cs (UsageVector.MergeChildren): I would like Martin to
21760 review this patch. But basically after all the children variables
21761 have been merged, the value of "Breaks" was not being set to
21762 new_breaks for Switch blocks. I think that it should be set after
21763 it has executed. Currently I set this to the value of new_breaks,
21764 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
21765 conservative, but I do not understand this code very well.
21767 I did not break anything in the build, so that is good ;-)
21769 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
21771 2002-10-20 Mark Crichton <crichton@gimp.org>
21773 * cfold.cs: Fixed compile blocker. Really fixed it this time.
21775 2002-10-20 Nick Drochak <ndrochak@gol.com>
21777 * cfold.cs: Fixed compile blocker.
21779 2002-10-20 Miguel de Icaza <miguel@ximian.com>
21781 * driver.cs: I was chekcing the key, not the file.
21783 2002-10-19 Ravi Pratap <ravi@ximian.com>
21785 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
21786 message that we were generating - we just need to silently return
21789 2002-10-19 Miguel de Icaza <miguel@ximian.com>
21791 * class.cs (Event.Define): Change my previous commit, as this
21792 breaks the debugger. This is a temporary hack, as it seems like
21793 the compiler is generating events incorrectly to begin with.
21795 * expression.cs (Binary.ResolveOperator): Added support for
21796 "U operator - (E x, E y)"
21798 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
21801 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
21802 init-only variables, but this path did not take into account that
21803 there might be also instance readonly variables. Correct this
21806 This fixes bug 32253
21808 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
21811 * driver.cs: Change the extension for modules to `netmodule'
21813 * cs-parser.jay: Improved slightly the location tracking for
21814 the debugger symbols.
21816 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
21817 modifiers that were specified instead of the hardcoded value
21818 (FamAndAssem). This was basically ignoring the static modifier,
21819 and others. Fixes 32429.
21821 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
21822 fixed a bug in the process (32476)
21824 * expression.cs (ArrayAccess.EmitAssign): Patch from
21825 hwang_rob@yahoo.ca that fixes bug 31834.3
21827 2002-10-18 Miguel de Icaza <miguel@ximian.com>
21829 * driver.cs: Make the module extension .netmodule.
21831 2002-10-16 Miguel de Icaza <miguel@ximian.com>
21833 * driver.cs: Report an error if the resource file is not found
21834 instead of crashing.
21836 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
21837 false, like Emit does.
21839 2002-10-16 Nick Drochak <ndrochak@gol.com>
21841 * typemanager.cs: Remove unused private member. Also reported mcs
21842 bug to report this as a warning like csc.
21844 2002-10-15 Martin Baulig <martin@gnome.org>
21846 * statement.cs (Statement.Emit): Made this a virtual method; emits
21847 the line number info and calls DoEmit().
21848 (Statement.DoEmit): New protected abstract method, formerly knows
21849 as Statement.Emit().
21851 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
21853 2002-10-11 Miguel de Icaza <miguel@ximian.com>
21855 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
21856 have fixed a remaining problem: not every AddXXXX was adding a
21857 fully qualified name.
21859 Now everyone registers a fully qualified name in the DeclSpace as
21860 being defined instead of the partial name.
21862 Downsides: we are slower than we need to be due to the excess
21863 copies and the names being registered this way.
21865 The reason for this is that we currently depend (on the corlib
21866 bootstrap for instance) that types are fully qualified, because
21867 we dump all the types in the namespace, and we should really have
21868 types inserted into the proper namespace, so we can only store the
21869 basenames in the defined_names array.
21871 2002-10-10 Martin Baulig <martin@gnome.org>
21873 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
21874 from bug #31834, see the bug report for a testcase which is
21877 2002-10-10 Martin Baulig <martin@gnome.org>
21879 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
21880 flow analysis code for this.
21882 * statement.cs (Do, While, For): Tell the flow analysis code about
21884 (FlowBranching.UsageVector): Added support for infinite loops.
21885 (Block.Resolve): Moved the dead code elimination here and use flow
21888 2002-10-09 Miguel de Icaza <miguel@ximian.com>
21890 * class.cs (Field.Define): Catch cycles on struct type
21893 * typemanager.cs (IsUnmanagedtype): Do not recursively check
21894 fields if the fields are static. We only need to check instance
21897 * expression.cs (As.DoResolve): Test for reference type.
21899 * statement.cs (Using.ResolveExpression): Use
21900 ConvertImplicitRequired, not ConvertImplicit which reports an
21902 (Using.ResolveLocalVariableDecls): ditto.
21904 * expression.cs (Binary.ResolveOperator): Report errors in a few
21905 places where we had to.
21907 * typemanager.cs (IsUnmanagedtype): Finish implementation.
21909 2002-10-08 Miguel de Icaza <miguel@ximian.com>
21911 * expression.cs: Use StoreFromPtr instead of extracting the type
21912 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
21914 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
21915 an enumeration value to a System.Enum, but System.Enum is not a
21916 value type, but an class type, so we need to box.
21918 (Expression.ConvertExplicit): One codepath could return
21919 errors but not flag them. Fix this. Fixes #31853
21921 * parameter.cs (Resolve): Do not allow void as a parameter type.
21923 2002-10-06 Martin Baulig <martin@gnome.org>
21925 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
21926 if it's a class type and not a struct. Fixes #31815.
21928 2002-10-06 Martin Baulig <martin@gnome.org>
21930 * statement.cs: Reworked the flow analysis code a bit to make it
21931 usable for dead code elimination.
21933 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21935 * cs-parser.jay: allow empty source files. Fixes bug #31781.
21937 2002-10-04 Miguel de Icaza <miguel@ximian.com>
21939 * expression.cs (ComposedCast.DoResolveType): A quick workaround
21940 to fix the test 165, will investigate deeper.
21942 2002-10-04 Martin Baulig <martin@gnome.org>
21944 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
21945 finally blocks actually work.
21946 (Try.Resolve): We don't need to create a sibling for `finally' if
21947 there is no finally block.
21949 2002-10-04 Martin Baulig <martin@gnome.org>
21951 * class.cs (Constructor.Define): The default accessibility for a
21952 non-default constructor is private, not public.
21954 2002-10-04 Miguel de Icaza <miguel@ximian.com>
21956 * class.cs (Constructor): Make AllowedModifiers public, add
21959 * cs-parser.jay: Perform the modifiers test here, as the
21960 constructor for the Constructor class usually receives a zero
21961 because of the way we create it (first we create, later we
21962 customize, and we were never checking the modifiers).
21964 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
21965 is a version of LookupTypeReflection that includes the type-name
21966 cache. This can be used as a fast path for functions that know
21967 the fully qualified name and are only calling into *.GetType() to
21968 obtain a composed type.
21970 This is also used by TypeManager.LookupType during its type
21973 (LookupType): We now also track the real type name, as sometimes
21974 we can get a quey for the real type name from things like
21975 ComposedCast. This fixes bug 31422.
21977 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
21978 complete type fullname, it does not have to go through the type
21979 resolution system to obtain the composed version of the type (for
21980 obtaining arrays or pointers).
21982 (Conditional.Emit): Use the EmitBoolExpression to
21983 generate nicer code, as requested by Paolo.
21985 (ArrayCreation.CheckIndices): Use the patch from
21986 hwang_rob@yahoo.ca to validate the array initializers.
21988 2002-10-03 Miguel de Icaza <miguel@ximian.com>
21990 * class.cs (ConstructorInitializer.Emit): simplify code by using
21991 Invocation.EmitCall, and at the same time, fix the bugs in calling
21992 parent constructors that took variable arguments.
21994 * ecore.cs (Expression.ConvertNumericExplicit,
21995 Expression.ImplicitNumericConversion): Remove the code that
21996 manually wrapped decimal (InternalTypeConstructor call is now gone
21999 * expression.cs (Cast.TryReduce): Also handle decimal types when
22000 trying to perform a constant fold on the type.
22002 * typemanager.cs (IsUnmanagedtype): Partially implemented.
22004 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
22005 that only turned off an error report, and did nothing else.
22007 2002-10-02 Miguel de Icaza <miguel@ximian.com>
22009 * driver.cs: Handle and ignore /fullpaths
22011 2002-10-01 Miguel de Icaza <miguel@ximian.com>
22013 * expression.cs (Binary.ResolveOperator): Catch the case where
22014 DoNumericPromotions returns true,
22016 (Binary.DoNumericPromotions): Simplify the code, and the tests.
22018 2002-09-27 Miguel de Icaza <miguel@ximian.com>
22020 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
22023 2002-09-26 Miguel de Icaza <miguel@ximian.com>
22025 * ecore.cs (ConvertNumericExplicit): It is not enough that the
22026 conversion exists, but it is also required that the conversion be
22027 performed. This manifested in "(Type64Enum) 2".
22029 * class.cs (TypeManager.AddMethod): The fix is not to change
22030 AddEnum, because that one was using a fully qualified name (every
22031 DeclSpace derivative does), but to change the AddMethod routine
22032 that was using an un-namespaced name. This now correctly reports
22033 the duplicated name.
22035 Revert patch until I can properly fix it. The issue
22036 is that we have a shared Type space across all namespaces
22037 currently, which is wrong.
22039 Options include making the Namespace a DeclSpace, and merge
22040 current_namespace/current_container in the parser.
22042 2002-09-25 Miguel de Icaza <miguel@ximian.com>
22044 * cs-parser.jay: Improve error reporting when we get a different
22045 kind of expression in local_variable_type and
22046 local_variable_pointer_type.
22048 Propagate this to avoid missleading errors being reported.
22050 * ecore.cs (ImplicitReferenceConversion): treat
22051 TypeManager.value_type as a target just like object_type. As
22056 Is valid, and needs to result in the int 1 being boxed before it
22057 is assigned to the value type v.
22059 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
22060 to validate the enumeration name.
22062 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
22063 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
22064 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
22066 * ecore.cs (TryImplicitIntConversion): When doing an
22067 implicit-enumeration-conversion, check if the type is 64-bits and
22068 perform a conversion before passing to EnumConstant.
22070 2002-09-23 Miguel de Icaza <miguel@ximian.com>
22072 * decl.cs (Error_AmbiguousTypeReference); New routine used to
22073 report ambiguous type references. Unlike the MS version, we
22074 report what the ambiguity is. Innovation at work ;-)
22076 (DeclSpace.FindType): Require a location argument to
22077 display when we display an ambiguous error.
22079 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
22081 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
22083 * expression.cs (EmitDynamicInitializers): Apply patch from
22084 hwang_rob@yahoo.ca that fixes the order in which we emit our
22087 2002-09-21 Martin Baulig <martin@gnome.org>
22089 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
22090 delegate takes no arguments.
22092 2002-09-20 Miguel de Icaza <miguel@ximian.com>
22094 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
22097 * expression.cs: Extract the underlying type.
22099 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
22101 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
22103 2002-09-19 Miguel de Icaza <miguel@ximian.com>
22105 * class.cs (TypeContainer.DefineType): We can not use the nice
22106 PackingSize with the size set to 1 DefineType method, because it
22107 will not allow us to define the interfaces that the struct
22110 This completes the fixing of bug 27287
22112 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
22113 means also structs. This fixes part of the problem.
22114 (Expresion.ImplicitReferenceConversionExists): ditto.
22116 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
22117 error if there were no errors reported during the type lookup
22118 process, to avoid duplicates or redundant errors. Without this
22119 you would get an ambiguous errors plus a type not found. We have
22120 beaten the user enough with the first error.
22122 (DeclSparce.FindType): Emit a warning if we have an ambiguous
22125 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
22126 during the resolution process, stop the lookup, this avoids
22127 repeated error reports (same error twice).
22129 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
22131 * typemanager.cs (LookupType): Redo the type lookup code to match
22132 the needs of System.Reflection.
22134 The issue is that System.Reflection requires references to nested
22135 types to begin with a "+" sign instead of a dot. So toplevel
22136 types look like: "NameSpace.TopLevelClass", and nested ones look
22137 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
22140 2002-09-19 Martin Baulig <martin@gnome.org>
22142 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
22143 says that a method always returns or always throws an exception,
22144 don't report the CS0161.
22146 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
22147 set `Returns = new_returns'.
22149 2002-09-19 Martin Baulig <martin@gnome.org>
22151 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
22152 to an enum constant, check for a CS0176.
22154 2002-09-18 Miguel de Icaza <miguel@ximian.com>
22156 * class.cs (TypeContainer.CheckPairedOperators): Now we check
22157 for operators that must be in pairs and report errors.
22159 * ecore.cs (SimpleName.DoResolveType): During the initial type
22160 resolution process, when we define types recursively, we must
22161 check first for types in our current scope before we perform
22162 lookups in the enclosing scopes.
22164 * expression.cs (MakeByteBlob): Handle Decimal blobs.
22166 (Invocation.VerifyArgumentsCompat): Call
22167 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
22168 I thought we were supposed to always call this, but there are a
22169 few places in the code where we dont do it.
22171 2002-09-17 Miguel de Icaza <miguel@ximian.com>
22173 * driver.cs: Add support in -linkres and -resource to specify the
22174 name of the identifier.
22176 2002-09-16 Miguel de Icaza <miguel@ximian.com>
22178 * ecore.cs (StandardConversionExists): Sync with the conversion
22179 code: allow anything-* to void* conversions.
22181 (FindMostSpecificSource): Use an Expression argument
22182 instead of a Type, because we might be handed over a Literal which
22183 gets a few more implicit conversions that plain types do not. So
22184 this information was being lost.
22186 Also, we drop the temporary type-holder expression when not
22189 2002-09-17 Martin Baulig <martin@gnome.org>
22191 * class.cs (PropertyBase.CheckBase): Don't check the base class if
22192 this is an explicit interface implementation.
22194 2002-09-17 Martin Baulig <martin@gnome.org>
22196 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
22197 different `IndexerName' attributes.
22199 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
22200 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
22201 virtual CommonResolve().
22203 2002-09-16 Miguel de Icaza <miguel@ximian.com>
22205 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
22206 and convert that to the UnderlyingType.
22208 * statement.cs (Foreach.Resolve): Indexers are just like variables
22209 or PropertyAccesses.
22211 * cs-tokenizer.cs (consume_string): Track line numbers and columns
22212 inside quoted strings, we were not doing this before.
22214 2002-09-16 Martin Baulig <martin@gnome.org>
22216 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
22217 resolve it. This is needed for the definite assignment check of the
22218 instance expression, fixes bug #29846.
22219 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
22221 2002-09-16 Nick Drochak <ndrochak@gol.com>
22223 * parameter.cs: Fix compile error. Cannot reference static member
22224 from an instance object. Is this an mcs bug?
22226 2002-09-14 Martin Baulig <martin@gnome.org>
22228 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
22229 multiple times. Fixes bug #30295, added test-166.cs.
22231 2002-09-14 Martin Baulig <martin@gnome.org>
22233 * statement.cs (Block.Emit): Don't emit unreachable code.
22234 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
22235 `break' statements.
22236 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
22238 2002-09-14 Martin Baulig <martin@gnome.org>
22240 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
22243 2002-09-14 Martin Baulig <martin@gnome.org>
22245 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
22246 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
22247 be false on the ms runtime.
22249 2002-09-13 Martin Baulig <martin@gnome.org>
22251 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
22252 the CS0038 error message.
22254 2002-09-12 Miguel de Icaza <miguel@ximian.com>
22256 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
22257 constant inside, return it.
22259 2002-09-12 Martin Baulig <martin@gnome.org>
22261 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
22262 implicit conversion can be done between enum types.
22264 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
22265 check whether an implicit conversion to the current enum's UnderlyingType
22266 exists and report an error if not.
22268 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
22269 without debugging support.
22271 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
22272 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
22274 2002-09-12 Martin Baulig <martin@gnome.org>
22276 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
22278 * ecore.cs (IMemberExpr.DeclaringType): New property.
22279 (SimpleName.SimpleNameResolve): Check whether we're accessing a
22280 nonstatic member of an outer type (CS0038).
22282 2002-09-11 Miguel de Icaza <miguel@ximian.com>
22284 * driver.cs: Activate the using-error detector at warning level
22285 4 (at least for MS-compatible APIs).
22287 * namespace.cs (VerifyUsing): Small buglett fix.
22289 * pending.cs (PendingImplementation): pass the container pointer.
22291 * interface.cs (GetMethods): Allow for recursive definition. Long
22292 term, I would like to move every type to support recursive
22293 definitions, not the current ordering mechanism that we have right
22296 The situation is this: Attributes are handled before interfaces,
22297 so we can apply attributes to interfaces. But some attributes
22298 implement interfaces, we will now handle the simple cases
22299 (recursive definitions will just get an error).
22301 * parameter.cs: Only invalidate types at the end if we fail to
22304 2002-09-09 Martin Baulig <martin@gnome.org>
22306 * ecore.cs (PropertyExpr.Emit): Also check for
22307 TypeManager.system_int_array_get_length so this'll also work when
22308 compiling corlib. Fixes #30003.
22310 2002-09-09 Martin Baulig <martin@gnome.org>
22312 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
22313 and throw an exception if we can't get the type's size. Fixed #30040,
22316 2002-09-09 Martin Baulig <martin@gnome.org>
22318 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
22320 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
22321 context. Fixes bug #30027.
22323 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
22324 virtual functions. Fixes bug #30043, added test-164.cs.
22326 2002-09-08 Ravi Pratap <ravi@ximian.com>
22328 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
22330 2002-09-08 Nick Drochak <ndrochak@gol.com>
22332 * driver.cs: Use an object to get the windows codepage since it's not a
22335 2002-09-08 Miguel de Icaza <miguel@ximian.com>
22337 * statement.cs (For.Emit): for infinite loops (test == null)
22338 return whether there is a break inside, not always "true".
22340 * namespace.cs (UsingEntry): New struct to hold the name of the
22341 using definition, the location where it is defined, and whether it
22342 has been used in a successful type lookup.
22344 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
22349 2002-09-06 Ravi Pratap <ravi@ximian.com>
22351 * attribute.cs : Fix incorrect code which relied on catching
22352 a NullReferenceException to detect a null being passed in
22353 where an object was expected.
22355 2002-09-06 Miguel de Icaza <miguel@ximian.com>
22357 * statement.cs (Try): flag the catch variable as assigned
22359 * expression.cs (Cast): Simplified by using ResolveType instead of
22360 manually resolving.
22362 * statement.cs (Catch): Fix bug by using ResolveType.
22364 2002-09-06 Ravi Pratap <ravi@ximian.com>
22366 * expression.cs (BetterConversion): Special case for when we have
22367 a NullLiteral as the argument and we have to choose between string
22368 and object types - we choose string the way csc does.
22370 * attribute.cs (Attribute.Resolve): Catch the
22371 NullReferenceException and report error #182 since the Mono
22372 runtime no more has the bug and having this exception raised means
22373 we tried to select a constructor which takes an object and is
22376 2002-09-05 Ravi Pratap <ravi@ximian.com>
22378 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
22379 message (1502, 1503) when we can't locate a method after overload
22380 resolution. This is much more informative and closes the bug
22383 * interface.cs (PopulateMethod): Return if there are no argument
22384 types. Fixes a NullReferenceException bug.
22386 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
22387 expressions too. Previously we were checking only in one place for
22388 positional arguments leaving out named arguments.
22390 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
22391 type to the enum type is not allowed. Remove code corresponding to
22394 (ConvertNumericExplicit): Allow explicit conversions from
22395 the underlying type to enum type. This precisely follows the spec
22396 and closes a bug filed by Gonzalo.
22398 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22401 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
22403 2002-09-03 Miguel de Icaza <miguel@ximian.com>
22405 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
22406 it was important that we stored the right value after the
22407 reduction in `converted'.
22409 2002-09-04 Martin Baulig <martin@gnome.org>
22411 * location.cs (Location.SymbolDocument): Use full pathnames for the
22414 2002-08-30 Miguel de Icaza <miguel@ximian.com>
22416 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
22417 of the expression resolve mechanism, because that will catch the
22418 SimpleName error failures.
22420 (Conditional): If we can not resolve the
22421 expression, return, do not crash.
22423 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22426 (location): display token name instead of its number.
22428 2002-08-28 Martin Baulig <martin@gnome.org>
22430 * expression.cs (Binary.ResolveOperator): Don't silently return
22431 but return an error if an operator cannot be applied between two
22434 2002-08-28 Martin Baulig <martin@gnome.org>
22436 * class.cs (Constructor.Define): Set the permission attributes
22437 correctly instead of making all constructors public.
22439 2002-08-28 Martin Baulig <martin@gnome.org>
22441 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
22442 for private members before reporting a CS0103; if we find anything,
22445 2002-08-28 Martin Baulig <martin@gnome.org>
22447 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
22448 to check whether `closure_start_type == closure_invocation_type',
22449 we also need to check whether `m.DeclaringType == closure_invocation_type'
22450 before bypassing the permission checks. We might be accessing
22451 protected/private members from the base class.
22452 (TypeManager.RealMemberLookup): Only set private_ok if private
22453 members were requested via BindingFlags.NonPublic.
22455 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
22457 * expression.cs (MemberAccess.ResolveMemberAccess): Set
22458 MethodGroupExpr.IsExplicitImpl if appropriate.
22459 (Invocation.DoResolve): Don't report the CS0120 for explicit
22460 interface implementations.
22462 2002-08-27 Martin Baulig <martin@gnome.org>
22464 * expression.cs (Invocation.DoResolve): If this is a static
22465 method and we don't have an InstanceExpression, we must report
22468 2002-08-25 Martin Baulig <martin@gnome.org>
22470 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
22471 `==' between a valuetype and an object.
22473 2002-08-25 Miguel de Icaza <miguel@ximian.com>
22475 * ecore.cs (TypeExpr): Provide a ToString method.
22477 2002-08-24 Martin Baulig <martin@gnome.org>
22479 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
22480 now called proggie.dbg and it's a binary file.
22482 2002-08-23 Martin Baulig <martin@gnome.org>
22484 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
22486 2002-08-23 Martin Baulig <martin@gnome.org>
22488 * struct.cs (MyStructInfo.ctor): Make this work with empty
22489 structs; it's not allowed to use foreach() on null.
22491 2002-08-23 Martin Baulig <martin@gnome.org>
22493 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
22494 writer the full pathname of the generated assembly.
22496 2002-08-23 Martin Baulig <martin@gnome.org>
22498 * statements.cs (FlowBranching.UsageVector.MergeChildren):
22499 A `finally' block never returns or breaks; improved handling of
22502 2002-08-23 Martin Baulig <martin@gnome.org>
22504 * statement.cs (Throw.Resolve): Allow `throw null'.
22506 2002-08-23 Martin Baulig <martin@gnome.org>
22508 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
22509 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
22510 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
22511 MemberLookup would return a wrong event if this is an explicit
22512 interface implementation and the class has an event with the same
22515 2002-08-23 Martin Baulig <martin@gnome.org>
22517 * statement.cs (Block.AddChildVariableNames): New public method.
22518 (Block.AddChildVariableName): Likewise.
22519 (Block.IsVariableNameUsedInChildBlock): Likewise.
22520 (Block.AddVariable): Check whether a variable name has already
22521 been used in a child block.
22523 * cs-parser.jay (declare_local_variables): Mark all variable names
22524 from the current block as being used in a child block in the
22527 2002-08-23 Martin Baulig <martin@gnome.org>
22529 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
22530 find the symbol writer.
22532 * driver.cs: csc also allows the arguments to /define being
22533 separated by commas, not only by semicolons.
22535 2002-08-23 Martin Baulig <martin@gnome.org>
22537 * interface.cs (Interface.GetMembers): Added static check for events.
22539 2002-08-15 Martin Baulig <martin@gnome.org>
22541 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
22542 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
22544 * ecore.cs (Expression.MemberLookup): Added documentation and explained
22545 why the MethodData.EmitDestructor() change was necessary.
22547 2002-08-20 Martin Baulig <martin@gnome.org>
22549 * class.cs (TypeContainer.FindMembers): Added static check for events.
22551 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
22553 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
22554 use Type.GetEvents(), not Type.FindMembers().
22556 2002-08-20 Martin Baulig <martin@gnome.org>
22558 * decl.cs (MemberCache): Added a special method cache which will
22559 be used for method-only searched. This ensures that a method
22560 search will return a MethodInfo with the correct ReflectedType for
22563 2002-08-20 Martin Baulig <martin@gnome.org>
22565 * decl.cs (DeclSpace.FindMembers): Made this public.
22567 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22569 * delegate.cs: fixed build on windows.
22570 [FIXME: Filed as bug #29150: MCS must report these errors.]
22572 2002-08-19 Ravi Pratap <ravi@ximian.com>
22574 * ecore.cs (StandardConversionExists): Return a false
22575 if we are trying to convert the void type to anything else
22576 since that is not allowed.
22578 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
22579 we flag error 70 in the event an event is trying to be accessed
22580 directly from outside the declaring type.
22582 2002-08-20 Martin Baulig <martin@gnome.org>
22584 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
22585 MemberCache from typemanager.cs to decl.cs.
22587 2002-08-19 Martin Baulig <martin@gnome.org>
22589 * class.cs (TypeContainer): Implement IMemberContainer.
22590 (TypeContainer.DefineMembers): Create the MemberCache.
22591 (TypeContainer.FindMembers): Do better BindingFlags checking; only
22592 return public members if BindingFlags.Public was given, check
22593 whether members are static.
22595 2002-08-16 Martin Baulig <martin@gnome.org>
22597 * decl.cs (DeclSpace.Define): Splitted this in Define and
22598 DefineMembers. DefineMembers is called first and initializes the
22601 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
22602 DefineMembers() on all our DeclSpaces.
22604 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
22605 but call DefineMembers() on all nested interfaces. We call their
22606 Define() in our new Define() function.
22608 * interface.cs (Interface): Implement IMemberContainer.
22609 (Interface.Define): Moved all code except the attribute stuf to
22611 (Interface.DefineMembers): Initialize the member cache.
22613 * typemanager.cs (IMemberFinder): Removed this interface, we don't
22614 need this anymore since we can use MemberCache.FindMembers directly.
22616 2002-08-19 Martin Baulig <martin@gnome.org>
22618 * typemanager.cs (MemberCache): When creating the cache for an
22619 interface type, add all inherited members.
22620 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
22621 to `out bool used_cache' and documented it.
22622 (TypeManager.MemberLookup): If we already used the cache in the first
22623 iteration, we don't need to do the interfaces check.
22625 2002-08-19 Martin Baulig <martin@gnome.org>
22627 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
22628 here from IMemberFinder and don't implement this interface anymore.
22629 (DeclSpace.MemberCache): Moved here from IMemberFinder.
22631 * typemanager.cs (IMemberFinder): This interface is now only used by
22632 classes which actually support the member cache.
22633 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
22634 since we only put DeclSpaces into this Hashtable.
22635 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
22636 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
22638 2002-08-16 Martin Baulig <martin@gnome.org>
22640 * typemanager.cs (ICachingMemberFinder): Removed.
22641 (IMemberFinder.MemberCache): New property.
22642 (TypeManager.FindMembers): Merged this with RealFindMembers().
22643 This function will never be called from TypeManager.MemberLookup()
22644 so we can't use the cache here, just the IMemberFinder.
22645 (TypeManager.MemberLookup_FindMembers): Check whether the
22646 IMemberFinder has a MemberCache and call the cache's FindMembers
22648 (MemberCache): Rewrote larger parts of this yet another time and
22649 cleaned it up a bit.
22651 2002-08-15 Miguel de Icaza <miguel@ximian.com>
22653 * driver.cs (LoadArgs): Support quoting.
22655 (Usage): Show the CSC-like command line arguments.
22657 Improved a few error messages.
22659 2002-08-15 Martin Baulig <martin@gnome.org>
22661 * typemanager.cs (IMemberContainer.Type): New property.
22662 (IMemberContainer.IsInterface): New property.
22664 The following changes are conditional to BROKEN_RUNTIME, which is
22665 defined at the top of the file.
22667 * typemanager.cs (MemberCache.MemberCache): Don't add the base
22668 class'es members, but add all members from TypeHandle.ObjectType
22669 if we're an interface.
22670 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
22671 is the current type.
22672 (MemberCache.CacheEntry.Container): Removed this field.
22673 (TypeHandle.GetMembers): Include inherited members.
22675 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22677 * typemanager.cs: fixed compilation and added a comment on a field that
22680 2002-08-15 Martin Baulig <martin@gnome.org>
22682 * class.cs (ConstructorInitializer.Resolve): In the
22683 Expression.MemberLookup call, use the queried_type as
22686 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
22687 declared' attribute, it's always true.
22688 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
22689 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
22690 temporary wrapper for FindMembers which tells MemberLookup whether
22691 members from the base classes are included in the return value.
22692 This will go away soon.
22693 (TypeManager.MemberLookup): Use this temporary hack here; once the
22694 new MemberCache is completed, we don't need to do the DeclaredOnly
22695 looping here anymore since the MemberCache will take care of this.
22696 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
22697 (MemberCache): When creating the MemberCache for a class, get
22698 members from the current class and all its base classes.
22699 (MemberCache.CacheEntry.Container): New field. This is a
22700 temporary hack until the Mono runtime is fixed to distinguish
22701 between ReflectedType and DeclaringType. It allows us to use MCS
22702 with both the MS runtime and the unfixed Mono runtime without
22703 problems and without accecting performance.
22704 (MemberCache.SearchMembers): The DeclaredOnly looping from
22705 TypeManager.MemberLookup is now done here.
22707 2002-08-14 Martin Baulig <martin@gnome.org>
22709 * statement.cs (MyStructInfo.MyStructInfo): Don't call
22710 Type.GetFields on dynamic types but get the fields from the
22711 corresponding TypeContainer.
22712 (MyStructInfo.GetStructInfo): Added check for enum types.
22714 * typemanager.cs (MemberList.IsSynchronized): Implemented.
22715 (MemberList.SyncRoot): Implemented.
22716 (TypeManager.FilterWithClosure): No need to check permissions if
22717 closure_start_type == closure_invocation_type, don't crash if
22718 closure_invocation_type is null.
22720 2002-08-13 Martin Baulig <martin@gnome.org>
22722 Rewrote TypeContainer.FindMembers to use a member cache. This
22723 gives us a speed increase of about 35% for the self-hosting MCS
22724 build and of about 15-20% for the class libs (both on GNU/Linux).
22726 * report.cs (Timer): New class to get enhanced profiling. This
22727 whole class is "TIMER" conditional since it remarkably slows down
22730 * class.cs (MemberList): New class. This is an IList wrapper
22731 which we're now using instead of passing MemberInfo[]'s around to
22732 avoid copying this array unnecessarily.
22733 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
22734 (ICachingMemberFinder, IMemberContainer): New interface.
22735 (TypeManager.FilterWithClosure): If `criteria' is null, the name
22736 has already been checked, otherwise use it for the name comparision.
22737 (TypeManager.FindMembers): Renamed to RealMemberFinder and
22738 provided wrapper which tries to use ICachingMemberFinder.FindMembers
22739 if possible. Returns a MemberList, not a MemberInfo [].
22740 (TypeHandle): New class, implements IMemberContainer. We create
22741 one instance of this class per type, it contains a MemberCache
22742 which is used to do the member lookups.
22743 (MemberCache): New class. Each instance of this class contains
22744 all members of a type and a name-based hash table.
22745 (MemberCache.FindMembers): This is our new member lookup
22746 function. First, it looks up all members of the requested name in
22747 the hash table. Then, it walks this list and sorts out all
22748 applicable members and returns them.
22750 2002-08-13 Martin Baulig <martin@gnome.org>
22752 In addition to a nice code cleanup, this gives us a performance
22753 increase of about 1.4% on GNU/Linux - not much, but it's already
22754 half a second for the self-hosting MCS compilation.
22756 * typemanager.cs (IMemberFinder): New interface. It is used by
22757 TypeManager.FindMembers to call FindMembers on a TypeContainer,
22758 Enum, Delegate or Interface.
22759 (TypeManager.finder_to_member_finder): New PtrHashtable.
22760 (TypeManager.finder_to_container): Removed.
22761 (TypeManager.finder_to_delegate): Removed.
22762 (TypeManager.finder_to_interface): Removed.
22763 (TypeManager.finder_to_enum): Removed.
22765 * interface.cs (Interface): Implement IMemberFinder.
22767 * delegate.cs (Delegate): Implement IMemberFinder.
22769 * enum.cs (Enum): Implement IMemberFinder.
22771 * class.cs (TypeContainer): Implement IMemberFinder.
22773 2002-08-12 Martin Baulig <martin@gnome.org>
22775 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
22777 2002-08-12 Martin Baulig <martin@gnome.org>
22779 * ecore.cs (ITypeExpression): New interface for expressions which
22781 (TypeExpression): Renamed to TypeLookupExpression.
22782 (Expression.DoResolve): If we're doing a types-only lookup, the
22783 expression must implement the ITypeExpression interface and we
22784 call DoResolveType() on it.
22785 (SimpleName): Implement the new ITypeExpression interface.
22786 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
22787 hack, the situation that we're only looking up types can't happen
22788 anymore when this method is called. Moved the type lookup code to
22789 DoResolveType() and call it.
22790 (SimpleName.DoResolveType): This ITypeExpression interface method
22791 is now doing the types-only lookup.
22792 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
22793 (ResolveFlags): Added MaskExprClass.
22795 * expression.cs (MemberAccess): Implement the ITypeExpression
22797 (MemberAccess.DoResolve): Added support for a types-only lookup
22798 when we're called via ITypeExpression.DoResolveType().
22799 (ComposedCast): Implement the ITypeExpression interface.
22801 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
22802 Expression.Resolve() with ResolveFlags.Type instead.
22804 2002-08-12 Martin Baulig <martin@gnome.org>
22806 * interface.cs (Interface.Define): Apply attributes.
22808 * attribute.cs (Attribute.ApplyAttributes): Added support for
22809 interface attributes.
22811 2002-08-11 Martin Baulig <martin@gnome.org>
22813 * statement.cs (Block.Emit): Only check the "this" variable if we
22814 do not always throw an exception.
22816 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
22817 whether the property has a set accessor.
22819 2002-08-11 Martin Baulig <martin@gnome.org>
22821 Added control flow analysis support for structs.
22823 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
22824 with control flow analysis turned off.
22825 (IVariable): New interface.
22826 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
22827 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
22828 (FieldExpr.DoResolve): Resolve the instance expression with flow
22829 analysis turned off and do the definite assignment check after the
22830 resolving when we know what the expression will resolve to.
22832 * expression.cs (LocalVariableReference, ParameterReference):
22833 Implement the new IVariable interface, only call the flow analysis
22834 code if ec.DoFlowAnalysis is true.
22835 (This): Added constructor which takes a Block argument. Implement
22836 the new IVariable interface.
22837 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
22838 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
22839 This does the definite assignment checks for struct members.
22841 * class.cs (Constructor.Emit): If this is a non-static `struct'
22842 constructor which doesn't have any initializer, call
22843 Block.AddThisVariable() to tell the flow analysis code that all
22844 struct elements must be initialized before control returns from
22847 * statement.cs (MyStructInfo): New public class.
22848 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
22849 argument to this indexer. If non-zero, check an individual struct
22850 member, not the whole struct.
22851 (FlowBranching.CheckOutParameters): Check struct members.
22852 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
22853 overloaded versions of these methods which take an additional
22854 `int field_idx' argument to check struct members.
22855 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
22856 overloaded versions of these methods which take an additional
22857 `string field_name' argument to check struct member.s
22858 (VariableInfo): Implement the IVariable interface.
22859 (VariableInfo.StructInfo): New public property. Returns the
22860 MyStructInfo instance of the variable if it's a struct or null.
22861 (Block.AddThisVariable): New public method. This is called from
22862 Constructor.Emit() for non-static `struct' constructor which do
22863 not have any initializer. It creates a special variable for the
22864 "this" instance variable which will be checked by the flow
22865 analysis code to ensure that all of the struct's fields are
22866 initialized before control returns from the constructor.
22867 (UsageVector): Added support for struct members. If a
22868 variable/parameter is a struct with N members, we reserve a slot
22869 in the usage vector for each member. A struct is considered fully
22870 initialized if either the struct itself (slot 0) or all its
22871 members are initialized.
22873 2002-08-08 Martin Baulig <martin@gnome.org>
22875 * driver.cs (Driver.MainDriver): Only report an error CS5001
22876 if there were no compilation errors.
22878 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
22879 `UnsafeContext' property to determine whether the parent is in
22880 unsafe context rather than checking the parent's ModFlags:
22881 classes nested in an unsafe class are unsafe as well.
22883 2002-08-08 Martin Baulig <martin@gnome.org>
22885 * statement.cs (UsageVector.MergeChildren): Distinguish between
22886 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
22887 we return. Added test17() and test18() to test-154.cs.
22889 2002-08-08 Martin Baulig <martin@gnome.org>
22891 * typemanager.cs (TypeManager.FilterWithClosure): If we have
22892 Family access, make sure the invoking type isn't a subclass of the
22893 queried type (that'd be a CS1540).
22895 * ecore.cs (Expression.MemberLookup): Added overloaded version of
22896 this method which takes an additional `Type invocation_type'.
22898 * expression.cs (BaseAccess.DoResolve): Use the base type as
22899 invocation and query type.
22900 (MemberAccess.DoResolve): If the lookup failed and we're about to
22901 report a CS0122, try a lookup with the ec.ContainerType - if this
22902 succeeds, we must report a CS1540.
22904 2002-08-08 Martin Baulig <martin@gnome.org>
22906 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
22907 (MethodGroupExpr): Implement the IMemberExpr interface.
22909 * expression (MemberAccess.ResolveMemberAccess): No need to have
22910 any special code for MethodGroupExprs anymore, they're now
22913 2002-08-08 Martin Baulig <martin@gnome.org>
22915 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
22916 Family, FamANDAssem and FamORAssem permissions.
22917 (TypeManager.IsSubclassOrNestedChildOf): New public method.
22919 2002-08-08 Martin Baulig <martin@gnome.org>
22921 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
22922 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
22925 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
22927 * driver.cs: implemented /resource option to embed managed resources.
22929 2002-08-07 Martin Baulig <martin@gnome.org>
22931 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
22932 (FieldBase.HasFieldInitializer): New public property.
22933 (FieldBase.GetInitializerExpression): New public method. Resolves and
22934 returns the field initializer and makes sure it is only resolved once.
22935 (TypeContainer.EmitFieldInitializers): Call
22936 FieldBase.GetInitializerExpression to get the initializer, this ensures
22937 that it isn't resolved multiple times.
22939 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
22940 the resolving process (SimpleName/MemberLookup) that we're currently
22941 emitting a field initializer (which must not access any instance members,
22942 this is an error CS0236).
22944 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
22945 argument, if the `IsFieldInitializer' flag is set, we must report and
22946 error CS0236 and not an error CS0120.
22948 2002-08-07 Martin Baulig <martin@gnome.org>
22950 * ecore.cs (IMemberExpr): New public interface.
22951 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
22952 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
22953 if the expression is an IMemberExpr.
22955 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
22956 to be null, implicitly default to `this' if we're non-static in
22957 this case. Simplified the code a lot by using the new IMemberExpr
22958 interface. Also fixed bug #28176 here.
22960 2002-08-06 Martin Baulig <martin@gnome.org>
22962 * cs-parser.jay (SimpleLookup): Removed. We need to create
22963 ParameterReferences during semantic analysis so that we can do a
22964 type-only search when resolving Cast, TypeOf and SizeOf.
22965 (block): Pass the `current_local_parameters' to the Block's
22968 * class.cs (ConstructorInitializer): Added `Parameters parameters'
22969 argument to the constructor.
22970 (ConstructorInitializer.Resolve): Create a temporary implicit
22971 block with the parameters.
22973 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
22974 references here if we aren't doing a type-only search.
22976 * statement.cs (Block): Added constructor which takes a
22977 `Parameters parameters' argument.
22978 (Block.Parameters): New public property.
22980 * support.cs (InternalParameters.Parameters): Renamed `parameters'
22981 to `Parameters' and made it public readonly.
22983 2002-08-06 Martin Baulig <martin@gnome.org>
22985 * ecore.cs (Expression.Warning): Made this public as well.
22987 * report.cs (Report.Debug): Print the contents of collections.
22989 2002-08-06 Martin Baulig <martin@gnome.org>
22991 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
22992 used to tell Resolve() which kinds of expressions it may return.
22993 (Expression.Resolve): Added overloaded version of this method which
22994 takes a `ResolveFlags flags' argument. This can be used to tell
22995 Resolve() which kinds of expressions it may return. Reports a
22997 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
22998 ResolveFlags.SimpleName.
22999 (Expression.Error118): Added overloaded version of this method which
23000 takes a `ResolveFlags flags' argument. It uses the flags to determine
23001 which kinds of expressions are allowed.
23003 * expression.cs (Argument.ResolveMethodGroup): New public method.
23004 Resolves an argument, but allows a MethodGroup to be returned.
23005 This is used when invoking a delegate.
23007 * TODO: Updated a bit.
23009 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23011 Fixed compilation with csc.
23013 * ecore.cs: Expression.Error made public. Is this correct? Should
23014 Warning be made public too?
23016 * expression.cs: use ea.Location instead of ea.loc.
23017 [FIXME: Filed as bug #28607: MCS must report these errors.]
23019 2002-08-06 Martin Baulig <martin@gnome.org>
23021 * ecore.cs (Expression.loc): Moved the location here instead of
23022 duplicating it in all derived classes.
23023 (Expression.Location): New public property.
23024 (Expression.Error, Expression.Warning): Made them non-static and
23025 removed the location argument.
23026 (Expression.Warning): Added overloaded version which takes an
23027 `int level' argument.
23028 (Expression.Error118): Make this non-static and removed the
23029 expression and location arguments.
23030 (TypeExpr): Added location argument to the constructor.
23032 * expression.cs (StaticCallExpr): Added location argument to
23034 (Indirection, PointerArithmetic): Likewise.
23035 (CheckedExpr, UnCheckedExpr): Likewise.
23036 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
23037 (StringPtr): Likewise.
23040 2002-08-05 Martin Baulig <martin@gnome.org>
23042 * expression.cs (BaseAccess.DoResolve): Actually report errors.
23044 * assign.cs (Assign.DoResolve): Check whether the source
23045 expression is a value or variable.
23047 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
23048 while resolving the corresponding blocks.
23050 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
23051 an error, don't silently return null.
23053 * statement.cs (Block.AddVariable): Do the error reporting here
23054 and distinguish between CS0128 and CS0136.
23055 (Block.DoResolve): Report all unused labels (warning CS0164).
23056 (LabeledStatement): Pass the location to the constructor.
23057 (LabeledStatement.HasBeenReferenced): New property.
23058 (LabeledStatement.Resolve): Set it to true here.
23060 * statement.cs (Return.Emit): Return success even after reporting
23061 a type mismatch error (CS0126 or CS0127), this is what csc does and
23062 it avoids confusing the users with any consecutive errors.
23064 2002-08-05 Martin Baulig <martin@gnome.org>
23066 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
23068 * const.cs (Const.LookupConstantValue): Catch circular definitions.
23070 * expression.cs (MemberAccess.DoResolve): Silently return if an
23071 error has already been reported.
23073 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
23074 error has already been reported.
23076 2002-08-05 Martin Baulig <martin@gnome.org>
23078 * statement.cs (UsageVector): Only initialize the `parameters'
23079 vector if we actually have any "out" parameters.
23081 2002-08-05 Martin Baulig <martin@gnome.org>
23083 * expression.cs (Binary.ResolveOperator): When combining delegates,
23084 they must have the same type.
23086 2002-08-05 Martin Baulig <martin@gnome.org>
23088 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
23089 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
23090 work with the ms runtime and we also don't need it: if we're a
23091 PropertyBuilder and not in the `indexer_arguments' hash, then we
23092 are a property and not an indexer.
23094 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
23095 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
23096 since the latter one doesn't work with the ms runtime.
23098 2002-08-03 Martin Baulig <martin@gnome.org>
23100 Fixed bugs #27998 and #22735.
23102 * class.cs (Method.IsOperator): New public field.
23103 (Method.CheckBase): Report CS0111 if there's already a method
23104 with the same parameters in the current class. Report CS0508 when
23105 attempting to change the return type of an inherited method.
23106 (MethodData.Emit): Report CS0179 if a method doesn't have a body
23107 and it's not marked abstract or extern.
23108 (PropertyBase): New abstract base class for Property and Indexer.
23109 (PropertyBase.CheckBase): Moved here from Property and made it work
23111 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
23112 the same so we can reuse it there.
23113 (Property, Indexer): Derive from PropertyBase.
23114 (MethodSignature.inheritable_property_signature_filter): New delegate
23115 to find properties and indexers.
23117 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
23118 argument and improved error reporting.
23120 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
23121 EmptyReadOnlyParameters and made it a property.
23123 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
23124 version of this method which takes a `PropertyInfo indexer'.
23125 (TypeManager.RegisterIndexer): New method.
23127 * class.cs: Added myself as author of this file :-)
23129 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23131 * class.cs: fixed compilation on windoze.
23133 2002-08-03 Martin Baulig <martin@gnome.org>
23135 * interface.cs (Interface.GetInterfaceBases): Check whether all
23136 base interfaces are at least as accessible than the current one.
23138 * class.cs (TypeContainer.GetClassBases): Check whether base types
23139 are at least as accessible than the current type.
23140 (TypeContainer.AsAccessible): Implemented and made non-static.
23141 (MemberBase.CheckParameters): Report errors if the accessibility
23144 * delegate.cs (Delegate.Delegate): The default visibility is
23145 internal for top-level types and private for nested types.
23146 (Delegate.Define): Report errors if the accessibility checks fail.
23148 * enum.cs (Enum.Enum): The default visibility is internal for
23149 top-level types and private for nested types.
23150 (Enum.DefineType): Compute the correct visibility.
23152 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
23153 function which takes a `bool is_toplevel' instead of a TypeContainer.
23155 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
23158 2002-08-02 Martin Baulig <martin@gnome.org>
23160 * expression.cs (LocalVariableReferenc): Added constructor which
23161 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
23162 (LocalVariableReference.IsReadOnly): New property.
23163 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
23164 variable is readonly, use our own readonly flag to do this; you can
23165 use the new constructor to get a writable reference to a read-only
23168 * cs-parser.jay (foreach_statement, using_statement): Get a writable
23169 reference to the local variable.
23171 2002-08-01 Miguel de Icaza <miguel@ximian.com>
23173 * rootcontext.cs (ResolveCore): Also include System.Exception
23175 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
23176 we reach an EmptyStatement.
23178 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
23181 * expression.cs (Binary.ResolveOperator): Check error result in
23184 use brtrue/brfalse directly and avoid compares to null.
23186 2002-08-02 Martin Baulig <martin@gnome.org>
23188 * class.cs (TypeContainer.Define): Define all nested interfaces here.
23189 Fixes bug #28407, added test-155.cs.
23191 2002-08-01 Martin Baulig <martin@gnome.org>
23193 * class.cs (Event.EmitDefaultMethod): Make this work with static
23194 events. Fixes #28311, added verify-3.cs.
23196 2002-08-01 Martin Baulig <martin@gnome.org>
23198 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
23199 `is_disposable' fields.
23200 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
23201 `hm.is_disposable' if we're using the collection pattern.
23202 (Foreach.EmitCollectionForeach): Use the correct type for the
23203 enumerator's local variable, only emit the try/finally block if
23204 necessary (fixes #27713).
23206 2002-08-01 Martin Baulig <martin@gnome.org>
23208 * ecore.cs (Expression.report118): Renamed to Error118 and made
23211 * statement.cs (Throw.Resolve): Check whether the expression is of
23212 the correct type (CS0118) and whether the type derives from
23213 System.Exception (CS0155).
23214 (Catch.Resolve): New method. Do the type lookup here and check
23215 whether it derives from System.Exception (CS0155).
23216 (Catch.CatchType, Catch.IsGeneral): New public properties.
23218 * typemanager.cs (TypeManager.exception_type): Added.
23220 2002-07-31 Miguel de Icaza <miguel@ximian.com>
23222 * driver.cs: Updated About function.
23224 2002-07-31 Martin Baulig <martin@gnome.org>
23226 Implemented Control Flow Analysis.
23228 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
23229 (EmitContext.CurrentBranching): Added.
23230 (EmitContext.StartFlowBranching): Added.
23231 (EmitContext.EndFlowBranching): Added.
23232 (EmitContext.KillFlowBranching): Added.
23233 (EmitContext.IsVariableAssigned): Added.
23234 (EmitContext.SetVariableAssigned): Added.
23235 (EmitContext.IsParameterAssigned): Added.
23236 (EmitContext.SetParameterAssigned): Added.
23237 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
23238 Added control flow analysis stuff here.
23240 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
23241 resolve the expression as lvalue.
23242 (LocalVariableReference.DoResolve): Check whether the variable has
23243 already been assigned.
23244 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
23245 the parameter as assigned here.
23246 (ParameterReference.DoResolve): Check whether the parameter has already
23248 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
23249 expression as lvalue.
23251 * statement.cs (FlowBranching): New class for the flow analysis code.
23252 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
23253 (LabeledStatement.IsDefined): New public property.
23254 (LabeledStatement.AddUsageVector): New public method to tell flow
23255 analyis that the label may be reached via a forward jump.
23256 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
23258 (VariableInfo.Number): New public field. This is used by flow analysis
23259 to number all locals of a block.
23260 (Block.CountVariables): New public property. This is the number of
23261 local variables in this block (including the locals from all parent
23263 (Block.EmitMeta): Number all the variables.
23265 * statement.cs: Added flow analysis support to all classes.
23267 2002-07-31 Martin Baulig <martin@gnome.org>
23269 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
23270 To get debugging messages, compile mcs with /define:MCS_DEBUG and
23271 then use this argument.
23273 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
23275 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
23276 use this to specify /define options.
23278 2002-07-29 Martin Baulig <martin@gnome.org>
23280 * statement.cs (Fixed): Moved all code that does variable lookups
23281 and resolvings from Emit to Resolve.
23283 * statement.cs (For): Moved all code that does variable lookups
23284 and resolvings from Emit to Resolve.
23286 * statement.cs (Using): Moved all code that does variable lookups
23287 and resolvings from Emit to Resolve.
23289 2002-07-29 Martin Baulig <martin@gnome.org>
23291 * attribute.cs (Attribute.Resolve): Explicitly catch a
23292 System.NullReferenceException when creating the
23293 CustromAttributeBuilder and report a different warning message.
23295 2002-07-29 Martin Baulig <martin@gnome.org>
23297 * support.cs (ParameterData.ParameterName): Added method to
23298 get the name of a parameter.
23300 * typemanager.cs (TypeManager.IsValueType): New public method.
23302 2002-07-29 Martin Baulig <martin@gnome.org>
23304 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
23305 is a flag which specifies that it's either ref or out.
23306 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
23307 the out parameter to `out Parameter.Modifier mod', also set the
23308 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
23310 * support.cs (InternalParameters.ParameterModifier): Distinguish
23311 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23312 Parameter.Modifier.ISBYREF flag if it's either ref or out.
23314 * expression.cs (Argument.GetParameterModifier): Distinguish
23315 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23316 Parameter.Modifier.ISBYREF flag if it's either ref or out.
23318 2002-07-29 Martin Baulig <martin@gnome.org>
23320 * expression.cs (ParameterReference.ParameterReference): Added
23321 `Location loc' argument to the constructor.
23323 * cs-parser.jay: Pass location to ParameterReference.
23325 2002-07-28 Miguel de Icaza <miguel@ximian.com>
23327 * statement.cs (Try): Initialize the location.
23329 * cs-parser.jay: pass location to Try.
23331 * expression.cs (Unary.Reduce): Change the prototype to return
23332 whether a constant fold could be performed or not. The result is
23333 returned in an out parameters. In the case of Indirection and
23334 AddressOf, we want to perform the full tests.
23336 2002-07-26 Miguel de Icaza <miguel@ximian.com>
23338 * statement.cs (Statement.Emit): Flag dead code.
23340 2002-07-27 Andrew Birkett <andy@nobugs.org>
23342 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
23344 2002-07-27 Martin Baulig <martin@gnome.org>
23346 * class.cs (MethodData.Define): Put back call to
23347 TypeManager.AddMethod(), accidentally commented this out.
23349 * report.cs (Debug): New public method to print debugging information,
23350 this is `[Conditional ("DEBUG")]'.
23352 2002-07-26 Martin Baulig <martin@gnome.org>
23354 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
23355 (switch_statement): Push the current_block to the switch_stack and
23356 pop it again when we're done with the switch.
23357 (switch_section): The new block is a child of the current_block.
23358 Fixes bug #24007, added test-152.cs.
23360 2002-07-27 Martin Baulig <martin@gnome.org>
23362 * expression.cs (Invocation.EmitArguments): When calling a varargs
23363 function with only its fixed arguments, we need to pass an empty
23366 2002-07-27 Martin Baulig <martin@gnome.org>
23368 Mono 0.13 has been released.
23370 2002-07-25 Miguel de Icaza <miguel@ximian.com>
23372 * driver.cs: Rename --resource to --linkres, because that is what
23373 we do currently, we dont support --resource yet.
23375 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
23377 2002-07-25 Martin Baulig <martin@gnome.org>
23379 * class.cs (MethodData): New public class. This is a `method builder'
23380 class for a method or one accessor of a Property/Indexer/Event.
23381 (MethodData.GetMethodFlags): Moved here from MemberBase.
23382 (MethodData.ApplyAttributes): Likewise.
23383 (MethodData.ApplyObsoleteAttribute): Likewise.
23384 (MethodData.ApplyConditionalAttribute): Likewise.
23385 (MethodData.ApplyDllImportAttribute): Likewise.
23386 (MethodData.CheckAbstractAndExternal): Likewise.
23387 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
23388 (MethodData.Emit): Formerly known as Method.Emit().
23389 (MemberBase): Moved everything which was specific to a single
23390 accessor/method to MethodData.
23391 (Method): Create a new MethodData and call Define() and Emit() on it.
23392 (Property, Indexer, Event): Create a new MethodData objects for each
23393 accessor and call Define() and Emit() on them.
23395 2002-07-25 Martin Baulig <martin@gnome.org>
23397 Made MethodCore derive from MemberBase to reuse the code from there.
23398 MemberBase now also checks for attributes.
23400 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
23401 (MemberBase.GetMethodFlags): Moved here from class Method and marked
23403 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
23404 `CallingConventions cc' and `Attributes opt_attrs' arguments.
23405 (MemberBase.ApplyAttributes): New virtual method; applies the
23406 attributes to a method or accessor.
23407 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
23408 (MemberBase.ApplyConditionalAttribute): Likewise.
23409 (MemberBase.ApplyDllImportAttribute): Likewise.
23410 (MemberBase.CheckAbstractAndExternal): Likewise.
23411 (MethodCore.ParameterTypes): This is now a property instead of a
23412 method, it's initialized from DoDefineParameters().
23413 (MethodCore.ParameterInfo): Removed the set accessor.
23414 (MethodCore.DoDefineParameters): New protected virtual method to
23415 initialize ParameterTypes and ParameterInfo.
23416 (Method.GetReturnType): We can now simply return the MemberType.
23417 (Method.GetMethodFlags): Override the MemberBase version and add
23418 the conditional flags.
23419 (Method.CheckBase): Moved some code from Define() here, call
23420 DoDefineParameters() here.
23421 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
23422 here to avoid some larger code duplication.
23423 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
23424 ensure that abstract and external accessors don't declare a body.
23426 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
23427 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
23428 lookup in the attribute's parent classes, so we need to abort as soon
23429 as we found the first match.
23430 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
23431 the attribute has no arguments.
23433 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
23436 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23438 * cs-parser.jay: reverted previous patch.
23440 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23442 * cs-parser.jay: fixed bug #22119.
23444 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23446 * attribute.cs: fixed compilation. The error was:
23447 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
23448 be assigned to before control leaves the current method."
23449 [FIXME: Filed as bug #28186: MCS must report this error.]
23451 2002-07-25 Martin Baulig <martin@gnome.org>
23453 * attribute.cs (Attribute.Conditional_GetConditionName): New static
23454 method to pull the condition name ouf of a Conditional attribute.
23455 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
23456 the obsolete message and error flag out of an Obsolete attribute.
23458 * class.cs (Method.GetMethodFlags): New public method to get the
23459 TypeManager.MethodFlags for this method.
23460 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
23462 (Method.Define): Get and apply the Obsolete and Conditional attributes;
23463 if we're overriding a virtual function, set the new private variable
23464 `parent_method'; call the new TypeManager.AddMethod().
23466 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
23467 the MethodBuilder and the Method in a PtrHashtable.
23468 (TypeManager.builder_to_method): Added for this purpose.
23469 (TypeManager.MethodFlags): Added IsObsoleteError.
23470 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
23471 Obsolete and Conditional arguments in MethodBuilders. If we discover
23472 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
23473 the message from the attribute.
23475 2002-07-24 Martin Baulig <martin@gnome.org>
23477 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
23478 preprocessor directives, ensure that the argument to #define/#undef is
23479 exactly one identifier and that it's actually an identifier.
23481 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
23484 2002-07-24 Martin Baulig <martin@gnome.org>
23486 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
23487 initialize it to TypeManager.object_type in the constructor.
23488 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
23489 of the `hm.get_current' method if we're using the collection pattern.
23490 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
23491 for the explicit conversion to make it work when we're using the collection
23492 pattern and the `Current' property has a different return type than `object'.
23495 2002-07-24 Martin Baulig <martin@gnome.org>
23497 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
23498 does not match, but don't report any errors. This method is called in
23499 order for all methods in a MethodGroupExpr until a matching method is
23500 found, so we don't want to bail out if the first method doesn't match.
23501 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
23502 matches, report the 123. Fixes #28070.
23504 2002-07-24 Martin Baulig <martin@gnome.org>
23506 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
23507 TypeManager.TypeToCoreType() to the top of the method so the
23508 following equality checks will work. Fixes #28107.
23510 2002-07-24 Martin Baulig <martin@gnome.org>
23512 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
23513 operand is of type uint, and the other operand is of type sbyte,
23514 short or int, the operands are converted to type long." -
23515 Actually do what this comment already told us. Fixes bug #28106,
23518 2002-07-24 Martin Baulig <martin@gnome.org>
23520 * class.cs (MethodBase): New abstract class. This is now a base
23521 class for Property, Indexer and Event to avoid some code duplication
23522 in their Define() and DefineMethods() methods.
23523 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
23524 generic methods for Define() and DefineMethods().
23525 (FieldBase): Derive from MemberBase, not MemberCore.
23526 (Property): Derive from MemberBase, not MemberCore.
23527 (Property.DefineMethod): Moved all the code from this method to the
23528 new MethodBase.DefineAccessor(), just call it with appropriate
23530 (Property.Define): Call the new Property.DoDefine(), this does some
23531 sanity checks and we don't need to duplicate the code everywhere.
23532 (Event): Derive from MemberBase, not MemberCore.
23533 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
23534 accessors, this will also make them work with interface events.
23535 (Indexer): Derive from MemberBase, not MemberCore.
23536 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
23537 (Indexer.Define): Use the new MethodBase functions.
23539 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
23540 argument to the constructor.
23541 (Interface.FindMembers): Added support for interface events.
23542 (Interface.PopluateEvent): Implemented.
23544 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
23546 2002-07-22 Miguel de Icaza <miguel@ximian.com>
23548 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
23549 but this is required to check for a method name being the same as
23550 the containing class.
23554 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23556 * interface.cs: initialize variable.
23558 2002-07-23 Martin Baulig <martin@gnome.org>
23560 Implemented the IndexerName attribute in interfaces.
23562 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
23563 name if this is an explicit interface implementation.
23564 (Indexer.InterfaceIndexerName): New public variable. If we're
23565 implementing an interface indexer, this is the IndexerName in that
23566 interface. Otherwise, it's the IndexerName.
23567 (Indexer.DefineMethod): If we're implementing interface indexer,
23568 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
23569 and Pending.ImplementIndexer methods.
23570 (Indexer.Define): Also define the PropertyBuilder if we're
23571 implementing an interface indexer and this is neither an explicit
23572 interface implementation nor do the IndexerName match the one in
23575 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
23576 If a method is defined here, then we always need to create a proxy
23577 for it. This is used when implementing interface indexers.
23578 (Pending.IsInterfaceIndexer): New public method.
23579 (Pending.ImplementIndexer): New public method.
23580 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
23581 This is used when implementing interface indexers to define a proxy
23583 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
23584 define a proxy if necessary.
23586 * interface.cs (Interface.IndexerName): New public variable.
23587 (Interface.PopulateIndexer): Set the IndexerName.
23588 (Interface.DefineIndexers): New private method. Populate all the
23589 indexers and make sure their IndexerNames match.
23591 * typemanager.cs (IndexerPropertyName): Added support for interface
23594 2002-07-22 Martin Baulig <martin@gnome.org>
23596 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
23597 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
23598 ret if HasReturnLabel.
23599 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
23602 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
23603 and set the ec.LoopBeginTryCatchLevel.
23604 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
23605 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
23606 the current ec.TryCatchLevel, the branch goes out of an exception
23607 block. In this case, we need to use Leave and not Br.
23609 2002-07-22 Martin Baulig <martin@gnome.org>
23611 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
23612 block unless the block does not always return or it is contained in
23613 another try { ... } catch { ... } block. Fixes bug #26506.
23614 Added verify-1.cs to the test suite.
23616 2002-07-22 Martin Baulig <martin@gnome.org>
23618 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
23619 then we do not always return. Fixes bug #24985.
23621 2002-07-22 Martin Baulig <martin@gnome.org>
23623 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
23624 lookup on a per-class level; ie. walk up the class hierarchy until we
23625 found at least one applicable method, then choose the best among them.
23626 Fixes bug #24463 and test-29.cs.
23628 2002-07-22 Martin Baulig <martin@gnome.org>
23630 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
23631 return types of the methods. The return type is not part of the
23632 signature and we must not check it to make the `new' modifier work.
23633 Fixes bug #27999, also added test-147.cs.
23634 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
23636 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
23637 on the method's return type.
23639 2002-07-21 Martin Baulig <martin@gnome.org>
23641 * assign.cs: Make this work if the rightmost source is a constant and
23642 we need to do an implicit type conversion. Also adding a few more tests
23643 to test-38.cs which should have caught this.
23645 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
23646 target in the makefile for this. The makefile.gnu is primarily intended
23647 for end-users who don't want to debug the compiler.
23649 2002-07-21 Martin Baulig <martin@gnome.org>
23651 * assign.cs: Improved the Assign class so it can now handle embedded
23652 assignments (X = Y = Z = something). As a side-effect this'll now also
23653 consume less local variables. test-38.cs now passes with MCS, added
23654 a few new test cases to that test.
23656 2002-07-20 Martin Baulig <martin@gnome.org>
23658 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
23659 instructions. Fixes bug #27977, also added test-146.cs.
23661 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23663 * cs-tokenizer.cs: fixed getHex ().
23665 2002-07-19 Martin Baulig <martin@gnome.org>
23667 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
23668 not Type.GetType() to lookup the array type. This is needed when
23669 we're constructing an array of a user-defined type.
23670 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
23671 single-dimensional arrays, but also for single-dimensial arrays of
23674 2002-07-19 Martin Baulig <martin@gnome.org>
23676 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
23677 this function is called, it's not allowed to share LocalBuilders
23678 among ILGenerators.
23680 2002-07-19 Martin Baulig <martin@gnome.org>
23682 * expression.cs (Argument.Resolve): Report an error 118 when trying
23683 to pass a type as argument.
23685 2002-07-18 Martin Baulig <martin@gnome.org>
23687 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
23688 Conv_R_Un for the signed `long' type.
23690 2002-07-15 Miguel de Icaza <miguel@ximian.com>
23692 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
23693 `expr' for the temporary result, as that will fail if we do
23694 multiple resolves on the same expression.
23696 2002-07-05 Miguel de Icaza <miguel@ximian.com>
23698 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
23699 ec.TypeContainer for looking up aliases.
23701 * class.cs (TypeContainer): Remove LookupAlias from here.
23703 * decl.cs (DeclSpace); Move here.
23705 2002-07-01 Miguel de Icaza <miguel@ximian.com>
23707 * class.cs (FindMembers): Only call filter if the constructor
23708 bulider is not null.
23710 Also handle delegates in `NestedTypes' now. Now we will perform
23711 type lookups using the standard resolution process. This also
23714 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
23715 This uses Expressions (the limited kind that can be parsed by the
23716 tree) instead of strings.
23718 * expression.cs (ComposedCast.ToString): Implement, used to flag
23719 errors since now we have to render expressions.
23721 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
23724 * ecore.cs (SimpleName.ToString): ditto.
23726 * cs-parser.jay: Instead of using strings to assemble types, use
23727 Expressions to assemble the type (using SimpleName, ComposedCast,
23728 MemberAccess). This should fix the type lookups in declarations,
23729 because we were using a different code path for this.
23731 * statement.cs (Block.Resolve): Continue processing statements
23732 even when there is an error.
23734 2002-07-17 Miguel de Icaza <miguel@ximian.com>
23736 * class.cs (Event.Define): Also remove the `remove' method from
23737 the list of pending items.
23739 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
23740 generate more compact code.
23742 2002-07-17 Martin Baulig <martin@gnome.org>
23744 * const.cs (Const.LookupConstantValue): Add support for constant
23745 `unchecked' and `checked' expressions.
23746 Also adding test case test-140.cs for this.
23748 2002-07-17 Martin Baulig <martin@gnome.org>
23750 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
23751 check whether mi.ReturnType implements the IEnumerator interface; the
23752 `==' and the IsAssignableFrom() will fail in this situation.
23754 2002-07-16 Ravi Pratap <ravi@ximian.com>
23756 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
23759 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23761 * expression.cs: fixed bug #27811.
23763 2002-07-14 Miguel de Icaza <miguel@ximian.com>
23765 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
23766 Molaro: when we are a ref, the value already contains a pointer
23767 value, do not take the address of it.
23769 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23770 * removed mb-parser.jay and mb-tokenizer.cs
23772 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23774 * expression.cs: check against the building corlib void type.
23776 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
23778 * ecore.cs: fix for valuetype static readonly fields: when
23779 initializing them, we need their address, not the address of a copy.
23781 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23783 * typemanager.cs: register also enum_type in corlib.
23785 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23787 * class.cs: allow calling this (but not base) initializers in structs.
23789 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
23791 * ecore.cs: make sure we compare against the building base types
23794 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
23796 * typemanager.cs: fix TypeToCoreType() to handle void and object
23797 (corlib gets no more typerefs after this change).
23799 2002-07-12 Miguel de Icaza <miguel@ximian.com>
23801 * expression.cs (ArrayCreation.EmitArrayArguments): use
23802 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
23804 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
23805 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
23806 array indexes, the runtime actually forbids them.
23808 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
23809 for array arguments here.
23811 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
23812 instead of the default for ValueTypes.
23814 (New.DoEmit): Use IsValueType instead of
23815 IsSubclassOf (value_type)
23816 (New.DoResolve): ditto.
23817 (Invocation.EmitCall): ditto.
23819 * assign.cs (Assign): ditto.
23821 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
23822 Statements *are* currently doing part of their resolution during
23825 Expressions do always resolve during resolve, but statements are
23826 only required to propagate resolution to their children.
23828 2002-07-11 Miguel de Icaza <miguel@ximian.com>
23830 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
23832 (LoadAssembly): Do not add the dll if it is already specified
23834 (MainDriver): Add the System directory to the link path at the end,
23835 after all the other -L arguments.
23837 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
23838 wrong opcode for loading bytes and bools (ldelem.i1 instead of
23839 ldelem.u1) and using the opposite for sbytes.
23841 This fixes Digger, and we can finally run it.
23843 * driver.cs (UnixParseOption): Move the option parsing here.
23844 (CSCParseOption): Implement CSC-like parsing of options.
23846 We now support both modes of operation, the old Unix way, and the
23847 new CSC-like way. This should help those who wanted to make cross
23848 platform makefiles.
23850 The only thing broken is that /r:, /reference: and /lib: are not
23851 implemented, because I want to make those have the same semantics
23852 as the CSC compiler has, and kill once and for all the confussion
23853 around this. Will be doing this tomorrow.
23855 * statement.cs (Unsafe.Resolve): The state is checked during
23856 resolve, not emit, so we have to set the flags for IsUnsfe here.
23858 2002-07-10 Miguel de Icaza <miguel@ximian.com>
23860 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
23861 not catch the Error_ObjectRefRequired in SimpleName (as it is
23862 possible to have a class/instance variable name that later gets
23863 deambiguated), we have to check this here.
23865 2002-07-10 Ravi Pratap <ravi@ximian.com>
23867 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
23868 make static and put into Expression.
23870 (Event.Define): Register the private field of the event with the
23871 TypeManager so that GetFieldFromEvent can get at it.
23873 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
23874 keep track of the private field associated with an event which
23877 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
23880 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
23882 2002-07-10 Miguel de Icaza <miguel@ximian.com>
23884 * expression.cs (Binary.EmitBranchable): this routine emits the
23885 Binary expression in a branchable context. This basically means:
23886 we need to branch somewhere, not just get the value on the stack.
23888 This works together with Statement.EmitBoolExpression.
23890 * statement.cs (Statement.EmitBoolExpression): Use
23893 2002-07-09 Miguel de Icaza <miguel@ximian.com>
23895 * statement.cs (For): Reduce the number of jumps in loops.
23897 (For): Implement loop inversion for the For statement.
23899 (Break): We can be breaking out of a Try/Catch controlled section
23900 (foreach might have an implicit try/catch clause), so we need to
23901 use Leave instead of Br.
23903 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
23904 now). If the instace expression supports IMemoryLocation, we use
23905 the AddressOf method from the IMemoryLocation to extract the
23906 address instead of emitting the instance.
23908 This showed up with `This', as we were emitting the instance
23909 always (Emit) instead of the Address of This. Particularly
23910 interesting when This is a value type, as we dont want the Emit
23911 effect (which was to load the object).
23913 2002-07-08 Miguel de Icaza <miguel@ximian.com>
23915 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
23917 * statement.cs (Checked): Set the CheckedState during the resolve
23918 process too, as the ConvCast operations track the checked state on
23919 the resolve process, and not emit.
23921 * cs-parser.jay (namespace_member_declaration): Flag that we have
23922 found a declaration when we do. This is used to flag error 1529
23924 * driver.cs: Report ok when we display the help only.
23926 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
23928 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
23930 2002-07-04 Miguel de Icaza <miguel@ximian.com>
23932 * cs-tokenizer.cs (define): We also have to track locally the
23933 defines. AllDefines is just used for the Conditional Attribute,
23934 but we also need the local defines for the current source code.
23936 2002-07-03 Miguel de Icaza <miguel@ximian.com>
23938 * statement.cs (While, For, Do): These loops can exit through a
23939 Break statement, use this information to tell whether the
23940 statement is the last piece of code.
23942 (Break): Flag that we break.
23944 * codegen.cs (EmitContexts): New `Breaks' state variable.
23946 2002-07-03 Martin Baulig <martin@gnome.org>
23948 * class.cs (TypeContainer.MethodModifiersValid): Allow override
23949 modifiers in method declarations in structs. Otherwise, you won't
23950 be able to override things like Object.Equals().
23952 2002-07-02 Miguel de Icaza <miguel@ximian.com>
23954 * class.cs (Method, Property, Indexer): Do not allow the public
23955 modifier to be used in explicit interface implementations.
23957 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
23958 override modifiers in method declarations in structs
23960 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
23962 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
23963 integer or real overflow, report an error
23965 2002-07-02 Martin Baulig <martin@gnome.org>
23967 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
23968 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
23969 to tell the runtime about our newly created System.Object and
23970 System.ValueType types.
23972 2002-07-02 Miguel de Icaza <miguel@ximian.com>
23974 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
23975 struct instead of Ldarg/Starg.
23977 2002-07-02 Martin Baulig <martin@gnome.org>
23979 * expression.cs (Indirection.Indirection): Call
23980 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
23982 2002-07-02 Martin Baulig <martin@gnome.org>
23984 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
23985 ValueType, call TypeManager.TypeToCoreType() on it.
23986 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
23987 the OpCodes.Newarr argument.
23989 2002-07-02 Martin Baulig <martin@gnome.org>
23991 * expression.cs (Invocation.EmitCall): When compiling corlib,
23992 replace all calls to the system's System.Array type to calls to
23993 the newly created one.
23995 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
23996 System.Array methods.
23997 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
23998 from the system's System.Array type which must be replaced.
24000 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
24002 * typemanager.cs: load unverifiable_code_ctor so we can build
24003 corlib using the correct type. Avoid using GetTypeCode() with
24005 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
24006 TypeManager.object_type to allow building corlib.
24008 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24010 * ecore.cs: handle System.Enum separately in LoadFromPtr().
24012 2002-07-01 Martin Baulig <martin@gnome.org>
24014 * class.cs: Make the last change actually work, we need to check
24015 whether `ifaces != null' to avoid a crash.
24017 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24019 * class.cs: when we build structs without fields that implement
24020 interfaces, we need to add the interfaces separately, since there is
24021 no API to both set the size and add the interfaces at type creation
24024 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24026 * expression.cs: the dimension arguments to the array constructors
24027 need to be converted if they are a long.
24029 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24031 * class.cs: don't emit ldarg.0 if there is no parent constructor
24032 (fixes showstopper for corlib).
24034 2002-06-29 Martin Baulig <martin@gnome.org>
24036 MCS now compiles corlib on GNU/Linux :-)
24038 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
24039 ie. check for MethodImplOptions.InternalCall.
24041 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
24042 and TypeManager.attribute_type are null, so we must explicitly check
24043 whether parent is not null to find out whether it's an attribute type.
24044 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
24045 and SetBuilder, not only if the property is neither abstract nor external.
24046 This is necessary to set the MethodImplOptions on the accessor methods.
24047 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
24048 SetBuilder, see Property.Emit().
24050 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
24051 populate "System.Object", "System.ValueType" and "System.Attribute" since
24052 they've already been populated from BootCorlib_PopulateCoreTypes().
24054 2002-06-29 Martin Baulig <martin@gnome.org>
24056 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
24057 is the NullLiteral, we also need to make sure that target_type is not
24060 2002-06-29 Martin Baulig <martin@gnome.org>
24062 * rootcontext.cs (RootContext.ResolveCore): We must initialize
24063 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
24064 before calling BootstrapCorlib_ResolveDelegate ().
24066 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24068 * statement.cs: fixed build-breaker. All tests passed ok.
24070 2002-06-27 Martin Baulig <martin@gnome.org>
24072 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
24073 for System.Decimal when compiling corlib.
24075 2002-06-27 Martin Baulig <martin@gnome.org>
24077 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
24078 switch blocks which contain nothing but a default clause.
24080 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
24082 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
24084 2002-06-27 Martin Baulig <martin@gnome.org>
24086 * ecore.cs (PropertyExpr.PropertyExpr): Call
24087 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
24089 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
24090 is already a TypeBuilder.
24092 2002-06-27 Martin Baulig <martin@gnome.org>
24094 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
24095 `target_type == TypeManager.array_type', not IsAssignableFrom() in
24096 the "from an array-type to System.Array" case. This makes it work
24097 when compiling corlib.
24099 2002-06-27 Martin Baulig <martin@gnome.org>
24101 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
24102 non-static PropertyExpr, set its InstanceExpression. This makes
24103 the `ICollection.Count' property work in System/Array.cs.
24105 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
24107 * driver.cs: Made error handling more consistent. Errors now
24108 tracked by Report class, so many methods which used to return int
24109 now return void. Main() now prints success/failure and
24110 errors/warnings message.
24112 Renamed '--probe' compiler argument to '--expect-error'. Removed
24113 the magic number return values (123 and 124). Now, if the
24114 expected error occurs, the compiler exits with success (exit value
24115 0). If the compilation completes without seeing that particular
24116 error, the compiler exits with failure (exit value 1). The
24117 makefile in mcs/errors has been changed to handle the new behaviour.
24119 * report.cs: Made 'expected error' number a property and renamed
24120 it from 'Probe' to 'ExpectedError'.
24122 * genericparser.cs: Removed error handling support, since it is
24123 now all done by Report class.
24125 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
24126 class, so parse() no longer returns an int.
24128 * namespace.cs: Use Report.Error instead of GenericParser.error
24130 2002-06-22 Miguel de Icaza <miguel@ximian.com>
24132 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
24133 TypeContainer.AddOperator): At the front of the list put the
24134 explicit implementations, so they get resolved/defined first.
24136 2002-06-21 Miguel de Icaza <miguel@ximian.com>
24138 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
24139 interface type is implemented by this TypeContainer. Used during
24140 explicit interface implementation.
24142 (Property.Define, Indexer.Define, Method.Define): Validate that
24143 the given interface in the explicit implementation is one of the
24144 base classes for the containing type.
24146 Also if we are explicitly implementing an interface, but there is
24147 no match in the pending implementation table, report an error.
24149 (Property.Define): Only define the property if we are
24150 not explicitly implementing a property from an interface. Use the
24151 correct name also for those properties (the same CSC uses,
24152 although that is really not needed).
24154 (Property.Emit): Do not emit attributes for explicitly implemented
24155 properties, as there is no TypeBuilder.
24157 (Indexer.Emit): ditto.
24159 Hiding then means that we do not really *implement* a pending
24160 implementation, which makes code fail.
24162 2002-06-22 Martin Baulig <martin@gnome.org>
24164 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
24165 the return value of Object.GetType(). [FIXME: we need to do this whenever
24166 we get a type back from the reflection library].
24168 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24170 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
24172 2002-06-20 Miguel de Icaza <miguel@ximian.com>
24174 * attribute.cs: Return null if we can not look up the type.
24176 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
24177 the interface types found.
24179 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
24180 interface types found.
24182 * typemanager.cs (GetInterfaces): Make this routine returns alll
24183 the interfaces and work around the lame differences between
24184 System.Type and System.Reflection.Emit.TypeBuilder in the results
24185 result for GetInterfaces.
24187 (ExpandInterfaces): Given an array of interface types, expand and
24188 eliminate repeated ocurrences of an interface. This expands in
24189 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
24192 2002-06-21 Martin Baulig <martin@gnome.org>
24194 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
24197 2002-06-21 Martin Baulig <martin@gnome.org>
24199 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
24200 and called with one of the core types, return the corresponding typebuilder for
24203 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
24206 2002-06-21 Martin Baulig <martin@gnome.org>
24208 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
24209 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
24210 (Expression.ConvertReferenceExplicit): Likewise.
24212 * expression.cs (ElementAccess.DoResolve): Likewise.
24213 (ElementAccess.DoResolveLValue): Likewise.
24215 2002-06-10 Martin Baulig <martin@gnome.org>
24217 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
24218 add the "value" parameter to the parameter list.
24220 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
24223 2002-06-19 Miguel de Icaza <miguel@ximian.com>
24225 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
24226 the argument to an int, uint, long or ulong, per the spec. Also
24227 catch negative constants in array creation.
24229 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24231 * class.cs: do not allow the same interface to appear twice in
24232 the definition list.
24234 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24236 * ecore.cs: don't use ldlen with System.Array.
24238 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
24240 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
24242 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
24244 * modifiers.cs: produce correct field attributes for protected
24245 internal. Easy fix so miguel can work on ther harder stuff:-)
24247 2002-06-18 Miguel de Icaza <miguel@ximian.com>
24249 * pending.cs: New file. Move the code from class.cs here.
24250 Support clearning the pending flag for all methods (when not doing
24251 explicit interface implementation).
24253 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
24255 * rootcontext.cs: added a couple more types needed to bootstrap.
24257 2002-06-17 Miguel de Icaza <miguel@ximian.com>
24259 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
24260 constructor in the type, instead of any constructor in the type
24261 hierarchy. Thanks to Paolo for finding this bug (it showed up as
24262 a bug in the Mono runtime when applying the params attribute).
24264 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24265 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
24267 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
24269 * expression.cs (Unary.ResolveOperator): Use TypeManager
24270 to resolve the type.
24272 2002-06-13 Ravi Pratap <ravi@ximian.com>
24274 * cs-parser.jay (enum_member_declaration): Pass in the attributes
24277 * enum.cs (AddEnumMember): Add support to store the attributes associated
24278 with each member too.
24280 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
24281 field builders too - this takes care of the enum member case.
24283 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
24285 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
24286 address-of operator on both value types and pointers.
24288 2002-06-10 Martin Baulig <martin@gnome.org>
24290 * interface.cs (Interface.PopulateIndexer): Add the indexer's
24291 PropertyBuilder to the `property_builders' list.
24293 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
24294 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
24295 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
24296 find any indexers which are inherited from an interface.
24298 2002-06-09 Martin Baulig <martin@gnome.org>
24300 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
24301 the same type as the constant if necessary. There's also a test-130.cs
24304 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
24306 * typemanager.cs (TypeManager.ChangeType): Previously known as
24307 Enum.ChangeEnumType().
24309 2002-06-09 Martin Baulig <martin@gnome.org>
24311 * expression.cs (Cast.TryReduce): Added support for consts.
24313 2002-06-08 Ravi Pratap <ravi@ximian.com>
24315 * class.cs (Accessor): Hold attributes information so we can pass
24318 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
24319 Modify to pass in attributes attached to the methods.
24321 (add_accessor_declaration, remove_accessor_declaration): Ditto.
24323 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
24324 to handle the Accessor kind :-)
24326 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
24328 2002-06-08 Martin Baulig <martin@gnome.org>
24330 * expression.cs (Unary.TryReduceNegative): Added support for
24333 2002-06-08 Martin Baulig <martin@gnome.org>
24335 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
24336 name can't be found in the `defined_names' - the caller will do a
24337 MemberLookup in this case and thus find methods in System.Enum
24338 such as Enum.IsDefined().
24340 2002-06-08 Martin Baulig <martin@gnome.org>
24342 * enum.cs (Enum.ChangeEnumType): This is a custom version of
24343 Convert.ChangeType() which works with TypeBuilder created types.
24344 (Enum.LookupEnumValue, Enum.Define): Use it here.
24346 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
24347 `TypeBuilder.BaseType != null' check.
24348 (TypeContainer.FindMembers): Only lookup parent members if we
24349 actually have a parent.
24350 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
24351 (ConstructorInitializer.Resolve): Likewise.
24353 * interface.cs (Interface.FindMembers): Added
24354 `TypeBuilder.BaseType != null' check.
24356 * rootcontext.cs (RootContext.ResolveCore): Added
24357 "System.Runtime.CompilerServices.IndexerNameAttribute" to
24358 classes_second_stage.
24360 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
24361 debug_type and trace_type when compiling with --nostdlib.
24363 2002-06-07 Martin Baulig <martin@gnome.org>
24365 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
24366 (AddField): Set it to true when adding a non-static field.
24367 (DefineType): Use `have_nonstatic_fields' to find out whether we
24368 have non-static fields, not `Fields != null'.
24370 2002-06-02 Miguel de Icaza <miguel@ximian.com>
24372 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
24373 dereferencing a null on the static-field code path)
24375 2002-05-30 Martin Baulig <martin@gnome.org>
24377 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
24378 to take command line arguments. Use reflection to call the new
24379 custom `Initialize' function on the symbol writer and pass it the
24380 command line arguments.
24382 * driver.cs (--debug-args): New command line argument to pass command
24383 line arguments to the symbol writer.
24385 2002-05-28 Miguel de Icaza <miguel@ximian.com>
24387 * assign.cs (DoResolve): Forgot to do the implicit conversion to
24388 the target type for indexers and properties. Thanks to Joe for
24391 2002-05-27 Miguel de Icaza <miguel@ximian.com>
24393 * typemanager.cs (MethodFlags): returns the method flags
24394 (Obsolete/ShouldIgnore) that control warning emission and whether
24395 the invocation should be made, or ignored.
24397 * expression.cs (Invocation.Emit): Remove previous hack, we should
24398 not do this on matching a base type, we should do this based on an attribute
24400 Only emit calls to System.Diagnostics.Debug and
24401 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
24402 on the command line.
24404 * rootcontext.cs: Global settings for tracing and debugging.
24406 * cs-tokenizer.cs (define): New utility function to track
24407 defines. Set the global settings for TRACE and DEBUG if found.
24409 2002-05-25 Ravi Pratap <ravi@ximian.com>
24411 * interface.cs (Populate*): Pass in the TypeContainer as well as
24412 the DeclSpace as parameters so that we can create EmitContexts and
24413 then use that to apply attributes etc.
24415 (PopulateMethod, PopulateEvent, PopulateProperty)
24416 (PopulateIndexer): Apply attributes everywhere.
24418 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
24421 (ApplyAttributes): Update accordingly.
24423 We now apply interface attributes for all members too.
24425 2002-05-26 Miguel de Icaza <miguel@ximian.com>
24427 * class.cs (Indexer.Define); Correctly check if we are explicit
24428 implementation (instead of checking the Name for a ".", we
24429 directly look up if the InterfaceType was specified).
24431 Delay the creation of the PropertyBuilder.
24433 Only create the PropertyBuilder if we are not an explicit
24434 interface implementation. This means that explicit interface
24435 implementation members do not participate in regular function
24436 lookups, and hence fixes another major ambiguity problem in
24437 overload resolution (that was the visible effect).
24439 (DefineMethod): Return whether we are doing an interface
24442 * typemanager.cs: Temporary hack until we get attributes in
24443 interfaces (Ravi is working on that) and we get IndexerName
24444 support in interfaces.
24446 * interface.cs: Register the indexers as properties.
24448 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
24449 warning, I have verified that this is a bug in the .NET runtime
24450 (JavaScript suffers of the same problem).
24452 * typemanager.cs (MemberLookup): When looking up members for
24453 interfaces, the parent of an interface is the implicit
24454 System.Object (so we succeed in searches of Object methods in an
24455 interface method invocation. Example: IEnumerable x; x.ToString
24458 2002-05-25 Miguel de Icaza <miguel@ximian.com>
24460 * class.cs (Event): Events should also register if they do
24461 implement the methods that an interface requires.
24463 * typemanager.cs (MemberLookup); use the new GetInterfaces
24466 (GetInterfaces): The code used to lookup interfaces for a type is
24467 used in more than one place, factor it here.
24469 * driver.cs: Track the errors at the bottom of the file, we kept
24472 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
24473 instance if the method we are calling is static!
24475 2002-05-24 Miguel de Icaza <miguel@ximian.com>
24477 * attribute.cs (ApplyAttributes): Make this function filter out
24478 the IndexerName attribute (as that attribute in reality is never
24479 applied) and return the string constant for the IndexerName
24482 * class.cs (TypeContainer.Emit): Validate that all the indexers
24483 have the same IndexerName attribute, and if so, set the
24484 DefaultName attribute on the class.
24486 * typemanager.cs: The return value might contain other stuff (not
24487 only methods). For instance, consider a method with an "Item"
24488 property and an Item method.
24490 * class.cs: If there is a problem with the parameter types,
24493 2002-05-24 Ravi Pratap <ravi@ximian.com>
24495 * ecore.cs (ImplicitConversionExists): Wrapper function which also
24496 looks at user defined conversion after making a call to
24497 StandardConversionExists - we need this for overload resolution.
24499 * expression.cs : Update accordingly the various method calls.
24501 This fixes 2 bugs filed against implicit user defined conversions
24503 2002-05-22 Miguel de Icaza <miguel@ximian.com>
24505 * statement.cs: Track the result of the assignment.
24507 2002-05-21 Miguel de Icaza <miguel@ximian.com>
24509 * expression.cs (MemberAccess): Improved error reporting for
24510 inaccessible members.
24512 2002-05-22 Martin Baulig <martin@gnome.org>
24514 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
24515 itself with debugging support.
24517 2002-05-22 Martin Baulig <martin@gnome.org>
24519 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
24520 Removed, this isn't needed anymore.
24522 2002-05-20 Martin Baulig <martin@gnome.org>
24524 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
24525 be underlying type for an enum.
24527 2002-05-20 Miguel de Icaza <miguel@ximian.com>
24529 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
24530 that splits out the loading of just the core types.
24532 * rootcontext.cs (ResolveCore): Split the struct resolution in
24533 two, so we can load the enumeration underlying types before any
24536 * expression.cs (Is): Bandaid until we fix properly Switch (see
24537 bug #24985 for details).
24539 * typemanager.cs (ImplementsInterface): The hashtable will contain
24540 a null if there are no interfaces implemented.
24542 2002-05-18 Miguel de Icaza <miguel@ximian.com>
24544 * cs-parser.jay (indexer_declarator): It is fine to have array
24547 2002-05-17 Miguel de Icaza <miguel@ximian.com>
24549 * typemanager.cs: (RegisterBuilder): New function used to register
24550 TypeBuilders that implement interfaces. Since
24551 TypeBuilder.GetInterfaces (as usual) does not work with lame
24553 (AddUserType): register interfaces.
24555 (ImplementsInterface): Use the builder_to_ifaces hash if we are
24556 dealing with TypeBuilder. Also, arrays are showing up as
24557 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
24558 methods can not be invoked on them!
24560 * ecore.cs (ExplicitReferenceConversionExists): Made public.
24561 (ImplicitReferenceConversionExists): Split out from
24562 StandardConversionExists.
24564 * expression.cs (As): We were only implementing one of the three
24565 cases for the as operator. We now implement them all.
24566 (Is): Implement the various other cases for Is as well.
24568 * typemanager.cs (CACHE): New define used to control if we want or
24569 not the FindMembers cache. Seems to have a negative impact on
24570 performance currently
24572 (MemberLookup): Nested types have full acess to
24573 enclosing type members
24575 Remove code that coped with instance/static returns for events, we
24576 now catch this in RealFindMembers.
24578 (RealFindMembers): only perform static lookup if the instance
24579 lookup did not return a type or an event.
24581 2002-05-17 Miguel de Icaza <miguel@ximian.com>
24583 * assign.cs (CompoundAssign): We pass more semantic information
24584 now to Compound Assignments than we did before: now we have all
24585 the information at hand, and now we resolve the target *before* we
24586 do the expression expansion, which allows the "CacheValue" method
24587 to have the effect we intended (before, a [x] += 1 would generate
24588 two differen ArrayAccess expressions from the ElementAccess,
24589 during the resolution process).
24591 (CompoundAssign.DoResolve): Resolve target and original_source here.
24593 2002-05-16 Miguel de Icaza <miguel@ximian.com>
24595 * expression.cs (ArrayAccess): dropped debugging information.
24597 * typemanager.cs: Small bug fix: I was always returning i_members,
24598 instead of one of i_members or s_members (depending on which had
24601 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
24602 method is invoked before any code generation takes place, and it
24603 is a mechanism to inform that the expression will be invoked more
24604 than once, and that the method should use temporary values to
24605 avoid having side effects
24607 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
24609 * ecore.cs (Expression.CacheTemporaries): Provide empty default
24612 * expression.cs (Indirection, ArrayAccess): Add support for
24613 CacheTemporaries in these two bad boys.
24615 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
24616 ldobj or ldind_ref.
24617 (StoreFromPtr): Handle stobj as well.
24619 * expression.cs (UnaryMutator): Share more code.
24621 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
24622 down: I was not tracking the Filter function as well, which
24623 was affecting the results of the cache.
24625 2002-05-15 Miguel de Icaza <miguel@ximian.com>
24627 * attribute.cs: Remove the hack to handle the CharSet property on
24630 2002-05-14 Miguel de Icaza <miguel@ximian.com>
24632 * attribute.cs (DoResolve): More uglyness, we now only try to
24633 resolve the attribute partially, to extract the CharSet
24634 information (only if we are a StructLayout attribute). Otherwise
24636 (GetExtraTypeInfo): Add some code to conditionally kill in the
24637 future this. I am more and more convinced that the .NET
24638 framework has special code to handle the attribute setting on
24641 * expression.cs (IsParamsMethodApplicable): Revert my previous
24642 foreach change here, it was wrong.
24644 2002-05-13 Miguel de Icaza <miguel@ximian.com>
24646 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
24647 (pp_expr): do not abort on unknown input, just return.
24648 (eval): abort if there are pending chars.
24650 * attribute.cs (Attribute.Resolve): Positional parameters are
24651 optional. Deal with that case.
24653 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
24654 the Ansi/Unicode/Auto information for the type.
24656 (TypeContainer.DefineType): instantiate the EmitContext here, as
24657 we will be using it during the type definition (to resolve
24658 attributes) and during the emit phase.
24660 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
24661 to pull type information out of the attributes
24663 (Attribute.Resolve): track the constructor builder, and allow for
24664 multiple invocations (structs and classes will use this).
24666 * ecore.cs (MemberLookupFinal): new version with all the
24667 parameters customizable.
24669 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
24670 constructors. Return if the result value is null (as the error
24671 would have been flagged already by MemberLookupFinal)
24673 Do not allow instances of abstract classes or interfaces to be
24676 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
24677 We have to compare the assembly property here when dealing with
24678 FamANDAssem and Assembly access modifiers, because we might be
24679 creating an assembly from *modules* (that means that we are not
24680 getting TypeBuilders for types defined in other modules that are
24681 part of this assembly).
24683 (Method.Emit): If the method is marked abstract and has a body,
24686 (TypeContainer.DefineMembers): If both the defined member and the
24687 parent name match are methods, then do not emit any warnings: let
24688 the Method.Define routine take care of flagging warnings. But if
24689 there is a mismatch (method overrides something else, or method is
24690 overriwritten by something, then emit warning).
24692 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
24693 set to null, this means `do not check for the return type on the
24696 (Method.Define): set the return type for the method signature to
24697 null, so that we get methods with the same name and parameters and
24698 different return types. This is used to flag warning 114 (you are
24699 hiding a method, and you probably want to use the new/override
24702 * typemanager.cs (MemberLookup): Implemented proper access
24703 control, closing a long standing set of bug reports. The problem
24704 was that the Framework only has two bits: Public and NonPublic,
24705 and NonPublic includes private and protected methods, but we need
24706 to enforce the FamANDAssem, FamOrAssem and Family.
24708 2002-05-11 Miguel de Icaza <miguel@ximian.com>
24710 * statement.cs (GotoCase): Return true: Ammounts to giving up
24711 knowledge on whether we return or not, and letting the other case
24712 be responsible for it.
24714 2002-05-10 Miguel de Icaza <miguel@ximian.com>
24716 * driver.cs: Do not load directories for each file processed, only
24717 do it if there is a pattern.
24719 * ecore.cs: Report readonly assigns here as well, as we might have
24720 been resolved only by MemberAccess.
24722 (SimpleName.SimpleNameResolve): Also be useful for LValue
24723 resolution. We need this to propagate assign to local readonly variables
24725 * typemanager.cs: Use a ptrhashtable for the criteria, because we
24726 do not want to reuse potential criteria memory.
24728 * class.cs (MyEventBuilder): Set reflected_type;
24730 * ecore.cs (Constantify): Added support for constifying bools.
24732 (RootContext.LookupType): Added a cache for values looked up in
24733 the declaration space.
24735 * typemanager.cs (FindMembers): Now is a front-end to
24736 RealFindMembers, and provides a two-level hashtable-based cache to
24739 15% performance improvement: from 22.5 to 19.2 seconds.
24741 * expression.cs (IsParamsMethodApplicable): use foreach.
24742 (Invocation.DoResolve): ditto.
24743 (New.DoResolve): ditto.
24744 (ArrayCreation.DoResolve): ditto.
24746 * ecore.cs (FindMostEncompassingType): use foreach.
24748 * delegate.cs (NewDelegate.DoResolve): Use foreach
24750 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
24751 (RemoveMethods): use foreach.
24753 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
24754 nested foreach statements instead of for, and also break out of
24755 the inner loop once a match is found.
24757 (Invocation.OverloadResolve): Use foreach, simplify the code.
24759 2002-05-08 Miguel de Icaza <miguel@ximian.com>
24761 * cfold.cs (BinaryFold): During an enumeration evaluation context,
24762 we actually unwrap the expression to allow for extra information
24765 * expression.cs: Use Shr_Un on unsigned operations.
24767 2002-05-08 Ravi Pratap <ravi@ximian.com>
24769 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
24770 applicable operators was not being considered correctly. This closes
24771 the bug Miguel reported.
24773 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
24775 * attribute.cs: check that the type derives from System.Attribute
24776 and report the correct error in that case (moved the duplicate code to
24777 its own method, too).
24779 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
24781 * attribute.cs: lookup attribute type name as the spec says: first the
24782 bare attribute name and then name + "Attribute" (nant compiles with
24783 mcs after this fix).
24785 2002-05-07 Miguel de Icaza <miguel@ximian.com>
24787 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
24788 Because of the way we parse things, we should try to see if a
24789 UIntConstant can fit in an integer.
24791 2002-05-07 Ravi Pratap <ravi@ximian.com>
24793 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
24794 when we are in an explicit context.
24796 (ConvertReferenceExplicit): When converting from Iface type S to Class
24797 T make sure the rules are implemented as an OR.
24799 * parameter.cs (ParameterType): Make it a property for now although the
24800 purpose really isn't anything immediate.
24802 * expression.cs (Is*Applicable): Do better checking on the parameter type
24803 of a ref/out parameter. The ones from the system assemblies are already
24804 marked with the correct type so we don't need to do any correction.
24806 * ecore.cs (StandardConversionExists): Conversion from Interface types to
24807 the object type is standard too so include that.
24809 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24811 * ecore.cs (StandardConversionExists): Augment with missing code:
24812 deal with IntConstant, LongConstants and Enumerations.
24814 * assign.cs: Report the error, instead of failing silently
24816 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
24817 typecontainer that they are declared, because the
24818 typecontainer/namespace will have the list of using clauses that
24819 need to be applied.
24821 Assembly Attributes were escaping the normal registration
24824 (EmitCode): Apply attributes within an EmitContext that represents
24825 the container they were declared on.
24827 * cs-parser.jay: Track bases for structs. How did I get this wrong?
24829 2002-05-06 Ravi Pratap <ravi@ximian.com>
24831 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
24832 Revamp completely - make much cleaner as we now operate only
24835 (FindMostSpecificSource, FindMostSpecificTarget): New methods
24836 to implement the logic detailed in the spec more correctly.
24838 (UserDefinedConversion): Update accordingly.
24840 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24842 * statement.cs: Return flow analysis information up.
24844 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
24847 (token): Do not consume an extra character before calling
24850 2002-05-06 Piers Haken <piersh@friskit.com>
24852 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
24854 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24856 * class.cs (Constructor.Emit): Set the IsStatic flag in the
24857 EmitContext during the instance constructor initializer
24858 resolution, to stop access to instance variables.
24860 This is mandated by the spec, last paragraph of the `constructor
24861 initializers' section.
24863 2002-05-05 Miguel de Icaza <miguel@ximian.com>
24865 * cs-parser.jay, class.cs (Accessor): new class used to represent
24866 an accessor (get or set). In the past we used `null' to represent
24867 a missing accessor. But this is ambiguous because there was no
24868 way to tell in abstract indexers/properties if one of them was
24871 Now there is a way of addressing that.
24873 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
24874 instead of FindMembers.
24876 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
24877 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
24879 * attribute.cs: Treat indexers and properties as the same in terms
24880 of applying attributes
24882 * ecore.cs (FindMostEncompassedType): Use statically initialized
24883 EmptyExpressions()s like we do elsewhere to avoid creating useless
24884 objects (and we take this out of the tight loop).
24886 (GetConversionOperators): Move the code to extract the actual
24887 operators to a separate routine to clean things up.
24889 2002-05-04 Miguel de Icaza <miguel@ximian.com>
24891 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
24892 events are always registered FieldBuilders.
24894 * class.cs (FieldBase): New class shared by Fields
24896 * delegate.cs: If we are a toplevel delegate, use our full name.
24897 If we are a nested delegate, then only use our tail name.
24899 2002-05-02 Ravi Pratap <ravi@ximian.com>
24901 * expression.cs (IsApplicable): Ensure that we add the "&" to
24902 ref/out types before comparing it with the type of the argument.
24904 (IsParamsMethodApplicable): Ditto.
24906 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
24909 * delegate.cs : Handle the case when we have more than one applicable
24910 method. Flag an error only when we finish checking all.
24912 2002-05-02 Miguel de Icaza <miguel@ximian.com>
24914 * expression.cs: Add support for boolean static initializers.
24916 2002-05-01 Miguel de Icaza <miguel@ximian.com>
24918 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
24920 * parameter.cs (ComputeParameterTypes,
24921 ComputeAndDefineParameterTypes): Better error handling: now we
24922 clear the `types' cache if we fail during any of the type lookups.
24923 We also return the status code correctly to our caller
24925 * delegate.cs: If we fail to define a delegate, abort the extra
24928 * expression.cs (Binary.ResolveOperator): for
24929 operator==(object,object) and operator !=(object, object) we also
24930 have to verify that there is an implicit conversion from one to
24933 (ArrayAccess.DoResolve): Array Access can operate on
24936 2002-04-30 Miguel de Icaza <miguel@ximian.com>
24938 * assign.cs (CompoundAssign): A new class used as a "flag" that
24939 the assignment actually is happening as part of a compound
24940 assignment operator.
24942 During compound assignment, a few new rules exist to enable things
24949 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
24950 to the type of x) if y is implicitly convertible to the type of x,
24951 and the operator is a builtin operator and the return type of the
24952 operator is explicitly convertible to the type of x.
24954 * rootcontext.cs: Reset warning level to 2. 4 catches various
24955 "interesting" features in mcs, we must clean this up at some
24956 point, but currently am trying to kill other bugs ;-)
24958 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
24959 in container classes as well.
24961 * expression.cs (Binary.ResolveOperator): Handle string case
24962 before anything else (as operator overloading does emit an error
24963 before doing anything else).
24965 This code could go away when we move to a table driven model, but
24966 i could not come up with a good plan last night.
24968 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
24970 * typemanager.cs (CSharpName): reimplementation using regex.
24971 * class.cs: added null check for fields in Emit
24972 * rootcontext.cs: set warninglevel to 4
24974 2002-04-29 Miguel de Icaza <miguel@ximian.com>
24976 * typemanager.cs (CSharpName): reimplemented with Lupus
24979 2002-04-28 Miguel de Icaza <miguel@ximian.com>
24981 * statement.cs (If): correclty implement Resolve, because we were
24982 not catching sem errors in there. The same process is needed
24984 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
24987 (Statement.Warning_DeadCodeFound): Factorize code.
24988 (While): Report dead code here too.
24990 (Statement): Added Resolve virtual method to allow
24991 for resolution split from the emit code.
24993 2002-04-26 Miguel de Icaza <miguel@ximian.com>
24995 * statement.cs (EmitBoolExpression): No longer try to resolve the
24997 (MakeBoolean): New utility function that resolve, implicitly
24998 converts to boolean and tags the expression.
25001 (If, Do): Implement dead code elimination.
25002 (While): Implement loop inversion
25004 (Do, While, For, If): Resolve the expression prior to calling our
25007 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
25010 - added method Report28 (warning: program has more than one entry point)
25011 - added method IsEntryPoint, implements paragraph 10.1 of the spec
25012 - modified method Method.Define, the part at the end of the method
25014 * rootcontext.cs: added static public Location EntryPointLocation;
25016 * ../errors/cs0028.cs : Add test case for the above warning.
25019 - modified method CSharpName to allow arrays of primitive type to
25020 be printed nicely (e.g. instead of System.Int32[][] it now prints
25022 - added method CSharpSignature: returns the signature of a method
25023 in string format to be used in reporting errors, warnings, etc.
25025 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
25028 2002-04-26 Ravi Pratap <ravi@ximian.com>
25030 * delegate.cs (Define): Fix extremely silly bug where I was
25031 setting the type of the 'object' parameter of the BeginInvoke
25032 method to System.IAsyncResult instead of System.Object ;-)
25034 2002-04-26 Miguel de Icaza <miguel@ximian.com>
25036 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
25039 (Constructor.Emit): return if we fail to initialize the
25040 constructor. Another door closed!
25042 * expression.cs (New.DoResolve): Improve error message (from -6 to
25043 1501). Use DeclaredOnly lookup to find the exact constructor.
25045 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
25046 loop. This is useful.
25048 * cs-parser.jay: Adjust the default parameters so that destructors
25049 have the proper signature.
25051 2002-04-26 Martin Baulig <martin@gnome.org>
25053 * driver.cs (LoadAssembly): If `assembly' contains any characters
25054 which are only valid in path names and not in assembly names
25055 (currently slash, backslash and point), use Assembly.LoadFrom ()
25056 instead of Assembly.Load () on the `assembly' (before iteration
25057 over the link_paths).
25059 2002-04-26 Martin Baulig <martin@gnome.org>
25061 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
25063 2002-04-25 Miguel de Icaza <miguel@ximian.com>
25065 * class.cs (Property): use the new typemanager.MemberLookup
25067 (TypeContainer.MemberLookup): Implement using the
25068 TypeManager.MemberLookup now.
25070 * typemanager.cs: Make MemberLookup a function of the TypeManager,
25071 and return MemberInfos, so that these can be used without an
25072 EmitContext (what we had before).
25074 2002-04-24 Miguel de Icaza <miguel@ximian.com>
25076 * expression.cs: Fix the case where the argument to params if the
25077 type of the params. I omitted handling this before. Fixed
25079 2002-04-22 Miguel de Icaza <miguel@ximian.com>
25081 * driver.cs: Call BootCorlib_PopulateCoreType
25083 * class.cs (Property.CheckBase): Check for properties only, not
25086 * interface.cs: Temporary hack: try/catch around the
25087 CustomAttributeBuilder, because I am getting an exception that I
25090 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
25091 types whose definitions are required to be there (attributes are
25092 defined before standard types).
25094 Compute definitions as we boot the various types, as they are used
25095 immediately (value_type class will need object_type, but if we do
25096 not initialize object_type, we will pass a null, which will let
25097 the runtime pick the System.Object from the existing corlib, which
25098 is not what we want).
25100 2002-04-22 Patrik Torstensson <totte@labs2.com>
25102 * cs-tokenizer.cs: fixed a number of trim() issues.
25104 2002-04-22 Ravi Pratap <ravi@ximian.com>
25106 * expression.cs (Argument.Type): Ensure that we return the correct
25107 type when we have out or ref parameters [in which case we
25110 2002-04-22 Miguel de Icaza <miguel@ximian.com>
25112 * class.cs (Property, Indexer): Allow extern modifier in there.
25114 * typemanager.cs (InitBaseTypes): Initializes object_type and
25115 value_type, since those will be used early on during the bootstrap
25116 process to compile corlib.
25118 (InitCoreTypes): Move code from here to InitBaseTypes.
25120 2002-04-21 Miguel de Icaza <miguel@ximian.com>
25122 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
25123 single-dimension arrays as using the ldlen opcode.
25125 Daniel Lewis discovered this optimization.
25127 * typemanager.cs: Add signature for System.Array::get_Length
25129 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25131 * statement.cs: report the error when the foreach does not apply to an
25132 array nor a collection.
25134 2002-04-19 Miguel de Icaza <miguel@ximian.com>
25136 * expression.cs: Add implicit conversions to the operator ~.
25138 * constant.cs (DecimalConstant.Emit): Emit decimal value.
25140 * typemanager.cs: Locate the decimal constructor.
25142 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25144 * attribute.cs: use the new property of TypeOf.
25145 * expression.cs: added 'get' property around typearg.
25147 These changes fix a build breaker reported by NickD. Is this the
25148 correct way to fix? If not, please, revert my changes and make it
25151 2002-04-17 Miguel de Icaza <miguel@ximian.com>
25153 * attribute.cs: Add support for typeof in attribute invocations.
25154 I am not sure that this is right though.
25156 2002-04-14 Duncan Mak <duncan@ximian.com>
25158 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
25159 Binary.Operator.Division case.
25161 2002-04-13 Ravi Pratap <ravi@ximian.com>
25163 * class.cs (DefineType): Ensure that we do a proper check on
25164 attribute types and also register it with the TypeManager.
25166 (TypeContainer.Targets): The default for attribute types is
25167 AttributeTargets.All.
25169 * attribute.cs (ApplyAttributes): Registering the attribute type
25170 is done elsewhere, not when we discover we have a Usage attribute.
25172 2002-04-12 Ravi Pratap <ravi@ximian.com>
25174 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
25175 and get rid of is_delegate parameter.
25177 * everywhere : update.
25179 2002-04-12 Ravi Pratap <ravi@ximian.com>
25181 * cs-parser.jay (compilation_unit): Revamp completely to use
25182 some new ideas that I got from Rhys' grammar to solve the problems
25183 with assembly level attributes.
25185 (outer_declaration): New grammar production.
25187 (attribute_sections): Add.
25189 (opt_attributes): Base on attribute_sections
25191 (namespace_declaration): Allow opt_attributes to tackle the case
25192 when we have assembly level attributes - we are clever in this
25195 * attribute.cs (ApplyAttributes): Do not worry about assembly
25196 attributes in the non-global context.
25198 * rootcontext.cs (AddGlobalAttributes): Go back to using this
25199 instead of SetGlobalAttributes.
25201 * class.cs, rootcontext.cs : Ensure we define and generate
25202 attribute types before anything else.
25204 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
25205 and flag the new error -20 for the case when the attribute type
25206 does not have valid targets specified. csc does not catch this.
25208 * ../errors/errors.txt : update for error # -20
25210 2002-04-11 Ravi Pratap <ravi@ximian.com>
25212 * support.cs (InternalParameters.ParameterModifier): Do some null
25213 checking and return sane values.
25215 * class.cs (Method.Define): If we are a PInvoke method, ensure
25216 that we are static and extern. Report error # 601
25218 * ../errors/cs0601.cs : Add test case for the above error.
25220 2002-04-07 Ravi Pratap <ravi@ximian.com>
25222 * rootcontext.cs (attribute_types): We need to keep type of
25223 all attribute types separately and emit code for them first.
25225 (RegisterAttribute) : Implement.
25227 * class.cs (DefineType): Check if the current Type is a custom
25228 attribute type and register it accordingly.
25230 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
25231 adding the first attribute twice and rename to
25233 (SetGlobalAttributes): this.
25235 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
25238 * attribute.cs (ApplyAttributes): Take an additional argument telling us
25239 if we are processing global arguments. Hmm, I am unsure of this.
25241 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25243 * expression.cs: added static array of strings to avoid calling
25244 Enum.ToString () for Operator in Binary. Significant recover of
25247 2002-04-10 Miguel de Icaza <miguel@ximian.com>
25249 * class.cs (FindMembers): Allow the Builders of the various
25250 members to be null. If they are skip them. This only happens
25251 during the PInvoke declaration.
25253 2002-04-09 Miguel de Icaza <miguel@ximian.com>
25255 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
25256 failure, so we do not keep going afterwards.
25258 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
25259 wanted to pass `false' as the `is_delegate' argument. If this is
25260 the case, why not use delegate_type == null to mean `is_delegate =
25261 false' and anything else as is_delegate = true.
25263 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
25265 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
25266 code for the section, not the beginning of the tests.
25268 2002-04-08 Miguel de Icaza <miguel@ximian.com>
25270 * cfold.cs: Handle operator + (Enum x, Underlying x)
25272 * expression.cs (Binary): same. Warn about errors where we have
25273 Enum/Enum in operator + as well.
25275 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
25278 - added support for switch(bool)
25279 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
25280 - add TableSwitchEmit() to handle table-based switch statements
25282 2002-04-05 Ravi Pratap <ravi@ximian.com>
25284 * expression.cs (Invocation.OverloadResolve): Factor out code which
25285 does parameter compatibility checking with arguments so that we can
25286 re-use the code even from Delegate.VerifyApplicability
25288 (VerifyArgumentsCompat): Move above code here.
25290 * delegate.cs (VerifyApplicability): Get rid of duplicate code
25291 and instead make a call to the above method.
25293 2002-03-31 Ravi Pratap <ravi@ximian.com>
25295 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
25296 We use it to keep track of classes which are attribute types.
25298 2002-04-02 Miguel de Icaza <miguel@ximian.com>
25300 * delegate.cs (Delegate.Define): Correctly define the types in the
25301 presence of fixed and array parameters.
25303 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
25306 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
25307 include NonPublic after the first iteration.
25309 * class.cs (Indexer.CheckBase): Only check if both parents are
25312 * cs-parser.jay (accessor_body): If empty, set to null.
25314 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
25315 same code path here to resolve constants names that we did have in
25316 MemberAccess.DoResolve. There is too much code duplicated here.
25318 2002-04-01 Miguel de Icaza <miguel@ximian.com>
25320 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
25322 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
25325 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
25326 tokens, numbers and strings.
25328 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
25331 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
25332 asyncronous parameters and the regular parameters.
25334 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
25335 specify the target directory.
25337 * expression.cs: (This.DoResolve): Simplify
25338 (As.Emit): Optimize, do not generate IsInst if the expression is
25339 always of the given type.
25341 (Is.DoResolve): Bug fix, we were reporting both always/never for
25344 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
25345 creating too many unnecessary arrays.
25347 2002-03-31 Miguel de Icaza <miguel@ximian.com>
25349 * class.cs (EmitFieldInitializer): Use Assign expression to assign
25350 fields instead of rolling our own initializer. Takes care of all
25351 implicit conversions, and drops unnecessary static checks/argument.
25353 2002-03-31 Dick Porter <dick@ximian.com>
25355 * driver.cs: use the GetDirectories() return values properly, and
25356 use "/" as path separator.
25358 2002-03-30 Miguel de Icaza <miguel@ximian.com>
25360 * expression.cs (Unary): Optimize - - expr into expr.
25361 (Binary): Optimize a + (-b) into a -b.
25363 * codegen.cs (CodeGen): Made all methods static.
25365 2002-03-29 Miguel de Icaza <miguel@ximian.com>
25369 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
25370 TypeBuilder property.
25372 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
25375 * tree.cs: Removed the various RecordXXXX, and replaced with a
25376 single RecordDecl. Removed all the accessor methods, and just
25377 left a single access point Type
25379 * enum.cs: Rename DefineEnum to DefineType.
25381 * decl.cs: New abstract method `DefineType' used to unify the
25382 Defines for Enumerations, Interfaces, TypeContainers and
25385 (FindType): Moved LookupInterfaceOrClass here. Moved the
25386 LookupBaseClasses method that used to live in class.cs and
25387 interface.cs here, and renamed to FindType.
25389 * delegate.cs: Implement DefineType. Take advantage of the
25390 refactored pattern for locating the parent builder without taking
25391 the parent_builder argument (which we know does not work if we are
25392 nested, and triggering a toplevel definition).
25394 2002-03-28 Miguel de Icaza <miguel@ximian.com>
25396 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
25397 accessibility of a member has changed during override and report
25400 * class.cs (Method.Define, Property.Define): Only complain on
25401 overrides if the method is private, any other accessibility is
25402 fine (and since we just checked the permission is the same, we are
25405 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
25406 and elif are processed always. The other pre-processing
25407 directives are only processed if we are "taking" the path
25409 2002-03-29 Martin Baulig <martin@gnome.org>
25411 * class.cs (Method.Emit): Only emit symbolic debugging info if the
25412 current location is not Null.
25414 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
25415 a separate method so we can profile it.
25417 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
25418 `span.Seconds' are just seconds, but no minutes or hours.
25419 (MainDriver): Profile the CodeGen.SaveSymbols calls.
25421 2002-03-28 Miguel de Icaza <miguel@ximian.com>
25423 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
25424 Remove the gratuitous set of Final:
25426 // If an interface implementation, then we can set Final.
25427 if (((flags & MethodAttributes.Abstract) == 0) &&
25428 implementing.DeclaringType.IsInterface)
25429 flags |= MethodAttributes.Final;
25431 I do not know what I was smoking when I used that.
25434 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
25435 step into fixing the name resolution issues for delegates and
25436 unifying the toplevel name resolution.
25438 2002-03-28 Martin Baulig <martin@gnome.org>
25440 * class.cs (Method.Emit): If we have a symbol writer, call its
25441 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
25442 tell it about the current method.
25444 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
25445 writer that we're going to emit the first byte of IL code for a new
25446 statement (a new source line).
25447 (EmitContext.EmitTopBlock): If we have a symbol writer, call
25448 EmitContext.Mark() before emitting any code.
25450 * location.cs (SymbolDocument): Return null when we're Null.
25452 * statement.cs (Statement): Moved the `Location loc' variable here.
25453 (Statement.EmitBoolExpression): If we have a symbol writer, call
25454 ec.Mark() before emitting any code to tell it that we're at the
25455 beginning of a new statement.
25456 (StatementExpression): Added `Location' argument to the constructor.
25457 (Block): Added public readonly variable `StartLocation' and public
25458 variable `EndLocation'. The latter is to be set using SetEndLocation().
25459 (Block): Added constructor which takes a start and end location.
25460 (Block.SetEndLocation): New method. This sets the end location.
25461 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
25462 local variables we create.
25463 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
25464 each statement and do also mark the begin and end of the block.
25466 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
25467 tell it the current lexer.Location, use Location.Null for the end of the
25469 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
25470 current block, set its end location using SetEndLocation().
25471 (statement_expression): StatementExpression constructor now takes the
25472 lexer.Location as additional argument.
25473 (for_statement, declare_local_variables): Likewise.
25474 (declare_local_variables): When creating a new implicit block, use the
25475 new Block constructor and pass it the lexer.Location.
25477 2002-03-28 Miguel de Icaza <miguel@ximian.com>
25479 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
25480 members also on the parent interfaces recursively.
25482 2002-03-27 Miguel de Icaza <miguel@ximian.com>
25484 * report.cs: Use new formats, since Gonzalo finished the missing
25487 * expression.cs (Binary.ResolveOperator): added missing operator|
25488 operator& and operator^ for bool/bool.
25490 * cs-parser.jay: CheckDef now takes a Location argument that is
25491 used to report errors more precisly (instead of reporting the end
25492 of a definition, we try to track something which is a lot closer
25493 to the source of the problem).
25495 * cs-tokenizer.cs: Track global token use, so we can properly flag
25496 the use of #define/#undef after the first token has been seen.
25498 Also, rename the reportXXXX to Error_DescriptiveName
25500 * decl.cs (DeclSpace.IsTopLevel): Move property here from
25501 TypeContainer, so that Enum and Interface can use this too.
25503 * class.cs (TypeContainer.LookupInterfaceOrClass,
25504 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
25505 `builder' argument. Typically this was used to pass the parent
25506 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
25509 The problem is that a nested class could trigger the definition of
25510 a toplevel class, and the builder would be obviously wrong in that
25513 So we drop this argument, and we compute dynamically the
25514 TypeBuilder/ModuleBuilder (the correct information was available
25515 to us anyways from DeclSpace.Parent)
25517 * interface.cs (Interface.DefineInterface): Drop builder
25518 parameter cleanup like class.cs
25520 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
25523 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
25526 (Try.Emit): Propagate the returns value from the statement.
25528 (Return.Emit): Even if we are leavning
25530 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
25532 * modifiers.cs: Fix the computation of MethodAttributes flags.
25534 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
25536 * driver.cs: allow compilation of files that start with '/'.
25537 Add a default case when checking the argument of --target.
25539 2002-03-25 Miguel de Icaza <miguel@ximian.com>
25541 * interface.cs: Implement the same search algorithm for types in
25542 the interface code.
25544 * delegate.cs: Do not allow multiple definition.
25546 * Recovered ChangeLog that got accidentally amputated
25548 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
25550 * rootcontext.cs: Load manually enum to allow core classes to
25551 contain enumerations.
25553 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
25554 Update to new static methods in TypeManager.
25556 * typemanager.cs (GetMethod, GetConstructor): Use our
25557 implementation of FindMembers to find the members, since during
25558 corlib compilation, the types are TypeBuilders and GetMethod and
25559 GetConstructor do not work.
25561 Make all methods in TypeManager static.
25563 (InitCodeHelpers): Split the functionality from
25564 the InitCodeTypes function.
25566 * driver.cs: Call InitCodeHelpers after we have populated the
25569 * cs-parser.jay (delegate_declaration): we did not used to compute
25570 the delegate name correctly for void delegates.
25572 2002-03-24 Miguel de Icaza <miguel@ximian.com>
25574 * rootcontext.cs (RootContext): Init the interface_resolve_order
25575 and type_container_resolve_order always.
25577 (ResolveCore, BootstrapCorlib_ResolveClass,
25578 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
25579 compiler when compiling with --nostdlib
25581 * class.cs (TypeContainer.DefineType): Check that our parent is
25582 not null. This test is most important when we are bootstraping
25585 * codegen.cs: Split out the symbol writing code.
25587 2002-03-25 Martin Baulig <martin@gnome.org>
25589 * driver.cs (-g): Made -g an alias for --debug.
25591 2002-03-24 Martin Baulig <martin@gnome.org>
25593 * codegen.cs (SymbolWriter): New public variable. Returns the
25594 current symbol writer.
25595 (CodeGen): Added `bool want_debugging_support' argument to the
25596 constructor. If true, tell the ModuleBuild that we want debugging
25597 support and ask it for the ISymbolWriter.
25598 (Save): If we have a symbol writer, call it's Close() method after
25599 saving the assembly.
25601 * driver.c (--debug): New command line argument to create a
25602 debugger information file.
25604 * location.cs (SymbolDocument): New public property. Returns an
25605 ISymbolDocumentWriter object for the current source file or null
25606 if we don't have a symbol writer.
25608 2002-03-21 Miguel de Icaza <miguel@ximian.com>
25610 * driver.cs (LoadAssembly): Correctly return when all the paths
25611 have been tried and not before.
25613 * statement.cs (Switch.Emit): return the actual coverage for this
25614 statement (returns/not-returns)
25616 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
25617 switch of the statement if we are the last switch section. That
25618 kills two problems: try/catch problems (we used to emit an empty
25619 nop at the end) and switch statements where all branches would
25622 2002-03-19 Miguel de Icaza <miguel@ximian.com>
25624 * driver.cs: Add default assemblies (the equivalent to the
25625 Microsoft CSC.RSP file)
25627 * cs-tokenizer.cs: When updating `cols and setting it to zero,
25628 also update tokens_seen and set it to false.
25630 * driver.cs: Implement --recurse for Mike.
25632 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
25633 correctly splitting out the paths.
25635 2002-03-18 Miguel de Icaza <miguel@ximian.com>
25637 * interface.cs (Interface.PopulateProperty): Instead of using
25638 `parent' as the declaration space for the set parameters, use
25641 * support.cs (InternalParameters): InternalParameters constructor
25642 takes a DeclSpace instead of a TypeContainer.
25644 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
25645 types are being initialized, load the address of it before calling
25648 (New): Provide a mechanism to disable the generation of local
25649 value type temporaries when the caller will be providing us with
25650 an address to store it.
25652 (ArrayCreation.EmitDynamicInitializers): Use it.
25654 2002-03-17 Miguel de Icaza <miguel@ximian.com>
25656 * expression.cs (Invocation.EmitArguments): Only probe for array
25657 property if there is more than one argument. Sorry about that.
25659 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
25660 empty param arrays.
25662 * class.cs (Method.LabelParameters): Fix incorrect code path that
25663 prevented the `ParamArrayAttribute' from being applied to the
25666 2002-03-16 Miguel de Icaza <miguel@ximian.com>
25668 * support.cs (ReflectionParameters): Correctly compute whether the
25669 last argument is a params array. Fixes the problem with
25672 * typemanager.cs: Make the assemblies array always be non-null
25673 (empty, but non-null)
25675 * tree.cs (RecordDecl): New function that abstracts the recording
25676 of names. This reports error 101, and provides a pointer to the
25677 previous declaration. Fixes a crash in the compiler.
25679 * cs-parser.jay (constructor_declaration): Update to new grammar,
25680 and provide a constructor_body that can be empty.
25682 2002-03-15 Miguel de Icaza <miguel@ximian.com>
25684 * driver.cs: Add support for --resources.
25686 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
25687 Make all types for the various array helper methods be integer.
25689 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
25690 CheckState to ConvCast.
25692 (ConvCast): Now it takes a `checked' state argument, to avoid
25693 depending on the emit context for the conversion, and just using
25694 the resolve time setting.
25696 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
25697 instead of Invocation.EmitArguments. We do not emit the original
25698 arguments, instead we emit those which have been converted to
25699 unsigned int expressions.
25701 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
25703 * codegen.cs: ditto.
25705 * expression.cs (LocalVariableReference): Drop the use of the
25706 Store function that depended on the variable index.
25708 * statement.cs (VariableInfo): Drop the `Idx' property from this
25709 class, as this is not taking into account the indexes for
25710 temporaries tat we generate during the execution, getting the
25713 * class.cs: First emit class initializers, then call the parent
25716 * expression.cs (Binary): Fix opcode emision.
25717 (UnaryMutator.EmitCode): Support checked code generation
25719 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
25720 matches for events for both the Static and Instance scans,
25721 pointing to the same element. Fix that.
25723 2002-03-14 Miguel de Icaza <miguel@ximian.com>
25725 * rootcontext.cs (ResolveTree): Always set the
25726 interface_resolve_order, because nested interfaces will be calling
25729 * class.cs (GetInterfaceOrClass): Track the same resolution
25730 process used by TypeManager.LookupType. This fixes the nested
25731 type lookups in class declarations (separate path from
25734 (TypeContainer.DefineType): Also define nested interfaces.
25735 (TypeContainer.RegisterOrder): New public function used to
25736 register the order in which child interfaces need to be closed.
25738 Nested interfaces need to be closed after their parents have been
25741 * interface.cs (InterfaceAttr): Put all the logic for computing
25742 the interface attribute here.
25744 (DefineInterface): Register our interface order with the
25745 RootContext or with the TypeContainer depending on the case.
25747 2002-03-12 Miguel de Icaza <miguel@ximian.com>
25749 * cs-parser.jay: rework foreach statement to work with the new
25750 changes to the policy on SimpleNames.
25752 * report.cs: support Stacktrace on warnings as well.
25754 * makefile: drop --unsafe and /unsafe from the compile.
25756 2002-03-13 Ravi Pratap <ravi@ximian.com>
25758 * ecore.cs (StandardConversionExists): Modify to take an Expression
25759 as the first parameter. Ensure we do null -> reference type conversion
25762 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
25763 temporary Expression objects.
25765 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
25767 * interface.cs: workaround bug in method overloading resolution
25768 (there is already a bugzilla bug for it).
25770 2002-03-12 Miguel de Icaza <miguel@ximian.com>
25772 We could also solve this problem by having a separate path for
25773 performing type lookups, instead of DoResolve, we could have a
25774 ResolveType entry point, and only participating pieces of the
25775 production (simplename, deref, array) would implement this.
25777 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
25778 signal SimpleName to only resolve type names and not attempt to
25779 resolve anything else.
25781 * expression.cs (Cast): Set the flag.
25783 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
25785 * class.cs: Only report 108 if there is no `new' modifier.
25787 * cs-parser.jay: rework foreach statement to work with the new
25788 changes to the policy on SimpleNames.
25790 * report.cs: support Stacktrace on warnings as well.
25792 * makefile: drop --unsafe and /unsafe from the compile.
25794 2002-03-11 Miguel de Icaza <miguel@ximian.com>
25796 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25797 lookups here, instead of doing that at parse time. This means
25798 that our grammar will not introduce `LocalVariableReferences' as
25799 expressions at this point. That solves the problem of code like
25803 static void Main ()
25807 This is only half the fix. The full fix requires parameters to
25808 also be handled in this way.
25810 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
25811 makes the use more obvious of the DeclSpace. The
25812 ec.TypeContainer.TypeBuilder is now only used to pull the
25813 TypeBuilder for it.
25815 My theory is that I can get rid of the TypeBuilder completely from
25816 the EmitContext, and have typecasts where it is used (from
25817 DeclSpace to where it matters).
25819 The only pending problem is that the code that implements Aliases
25820 is on TypeContainer, and probably should go in DeclSpace.
25822 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25823 lookups here, instead of doing that at parse time. This means
25824 that our grammar will not introduce `LocalVariableReferences' as
25825 expressions at this point. That solves the problem of code like
25829 static void Main ()
25833 This is only half the fix. The full fix requires parameters to
25834 also be handled in this way.
25836 * class.cs (Property.DefineMethod): When implementing an interface
25837 method, set newslot, when implementing an abstract method, do not
25838 set the flag (before we tried never setting it, or always setting
25839 it, which is the difference).
25840 (Indexer.DefineMethod): same.
25841 (Method.DefineMethod): same.
25843 * ecore.cs: Only set the status used flag if we get back a Field.
25845 * attribute.cs: Temporary hack, so Paolo can keep working.
25847 2002-03-08 Ravi Pratap <ravi@ximian.com>
25849 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
25850 the unmanaged type in the case we have a MarshalAs attribute.
25852 (Resolve): Handle the case when we are parsing the special MarshalAs
25853 attribute [we need to store the unmanaged type to use later]
25855 * typemanager.cs (marshal_as_attr_type): Built in type for the
25856 MarshalAs Attribute.
25858 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
25859 on parameters and accordingly set the marshalling info.
25861 2002-03-09 Miguel de Icaza <miguel@ximian.com>
25863 * class.cs: Optimizing slightly by removing redundant code after
25864 we switched to the `NoTypes' return value.
25865 (Property.DefineMethod): use NoTypes here too.
25867 This fixes the bug I introduced in my last batch of changes.
25869 2002-03-05 Ravi Pratap <ravi@ximian.com>
25871 * tree.cs (RecordEnum): Add. We now keep track of enums too.
25873 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
25874 Enums since those are types too.
25876 * cs-parser.jay (enum_declaration): Record enums as we parse them.
25878 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
25879 thanks to a call during the lookup process.
25881 2002-03-07 Miguel de Icaza <miguel@ximian.com>
25883 * statement.cs (Foreach): Lots of work to accomodate a particular
25884 kind of foreach statement that I had not kept in mind. It is
25885 possible to have foreachs on classes that provide a GetEnumerator
25886 method that return objects that implement the "pattern" for using
25887 a foreach, there is no need to support GetEnumerator
25890 This is needed to compile nant.
25892 * decl.cs: Only report 114 if the member is not `Finalize' and if
25893 the warning level is at least 2.
25895 * class.cs: Moved the compare function from Method to
25898 (MethodSignature.InheritableMemberSignatureCompare): Add new
25899 filter function that is used to extract inheritable methods from a
25902 (Method.Define): Use the new `inheritable_method_signature_filter'
25905 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
25908 2002-03-06 Miguel de Icaza <miguel@ximian.com>
25910 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
25912 * cs-parser.jay: Add opt_semicolon to the interface declaration.
25914 * expression.cs: Pass location information to
25915 ConvertImplicitStandard.
25917 * class.cs: Added debugging code to track return values from
25920 2002-03-05 Miguel de Icaza <miguel@ximian.com>
25922 * expression.cs (Is.DoResolve): If either side of the `is' is an
25923 interface, do not flag the warning.
25925 * ecore.cs (ImplicitReferenceConversion): We need a separate test
25928 * report.cs: Allow for --fatal to be used with --probe.
25930 * typemanager.cs (NoTypes): Move the definition for the empty Type
25933 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
25935 (TypeContainer.DefineProxy): New function used to proxy to parent
25936 implementations when implementing interfaces.
25937 (TypeContainer.ParentImplements): used to lookup if our parent
25938 implements a public function that is required by an interface.
25939 (TypeContainer.VerifyPendingMethods): Hook this up.
25941 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
25942 `modules' and `assemblies' arraylists into arrays. We only grow
25943 these are the very early start up of the program, so this improves
25944 the speedof LookupType (nicely measured).
25946 * expression.cs (MakeByteBlob): Replaced unsafe code with
25947 BitConverter, as suggested by Paolo.
25949 * cfold.cs (ConstantFold.Binary): Special case: perform constant
25950 folding of string concatenation, but if either side is a string,
25951 and the other is not, then return null, and let the runtime use
25952 the concatenation on the string plus the object (using
25953 `Object.ToString').
25955 2002-03-04 Miguel de Icaza <miguel@ximian.com>
25957 Constant Folding has been implemented now.
25959 * expression.cs (Unary.Reduce): Do not throw an exception, catch
25960 the error instead on types that are not supported in one's
25963 * constant.cs (Constant and all children): New set of functions to
25964 perform implict and explicit conversions.
25966 * ecore.cs (EnumConstant): Implement the new functions to perform
25967 conversion by proxying to the child expression.
25969 * codegen.cs: (ConstantCheckState): Constant evaluation has its
25970 own separate setting that can not be turned off from the command
25971 line using --unchecked or --checked and is only controlled using
25972 the checked/unchecked statements and expressions. This setting is
25973 used by the constant folder to flag errors.
25975 * expression.cs (CheckedExpr, UncheckedExpr): Set the
25976 ConstantCheckState as well.
25978 During Resolve, they also have to flag the state, because the
25979 constant folder runs completely in the Resolve phase.
25981 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
25984 2002-03-01 Miguel de Icaza <miguel@ximian.com>
25986 * cfold.cs: New file, this file contains the constant folder.
25988 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
25989 argument to track whether we are using the resulting address to
25990 load or store a value and provide better error messages.
25992 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
25993 new AddressOf arguments.
25995 * statement.cs (Foreach.EmitCollectionForeach): Update
25997 * expression.cs (Argument.Emit): Call AddressOf with proper
25998 arguments to track usage.
26000 (New.DoEmit): Call AddressOf with new arguments.
26002 (Unary.Emit): Adjust AddressOf call.
26004 2002-03-01 Ravi Pratap <ravi@ximian.com>
26006 * cs-parser.jay (member_access): Change the case for pre-defined types
26007 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
26010 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
26013 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
26014 essentially like methods and apply attributes like MethodImplOptions to them too.
26016 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
26019 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
26020 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
26023 * Update code everywhere accordingly.
26025 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
26027 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
26029 2002-02-28 Ravi Pratap <ravi@ximian.com>
26031 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
26032 try performing lookups against those instead of jumping straight into using
26033 the 'using' clauses.
26035 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
26037 (LookupType): Perform lookups in implicit parents too.
26039 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
26040 sequence as RootContext.LookupType.
26042 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
26043 the various cases of namespace lookups into this method.
26045 2002-03-01 Miguel de Icaza <miguel@ximian.com>
26047 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
26048 in positional arguments)
26050 * class.cs (Operator): Update the AllowedModifiers to contain
26053 * cs-parser.jay: Update operator declaration to allow for the
26054 operator body to be empty.
26056 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
26059 2002-02-27 Miguel de Icaza <miguel@ximian.com>
26061 * class.cs (Method.Emit): Label parameters.
26063 * driver.cs: Return 1 or 0 as the program exit code.
26065 2002-02-26 Miguel de Icaza <miguel@ximian.com>
26067 * expression.cs: Special case the `null' object when trying to
26068 auto-compute the type, as anything can be explicitly converted to
26071 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
26072 spotting this Paolo.
26074 (Expression.ImplicitNumericConversion): Perform comparissions of
26075 the type using the underlying type in the case of an enumeration
26076 rather than using the enumeration type for the compare.
26078 Cope with the underlying == type case, which is not possible to
26081 (Expression.ConvertNumericExplicit): Perform comparissions of
26082 the type using the underlying type in the case of an enumeration
26083 rather than using the enumeration type for the compare.
26085 * driver.cs: If the user does not supply an extension, assume .exe
26087 * cs-parser.jay (if_statement): Rewrote so that we can track the
26088 location for the if statement.
26090 * expression.cs (Binary.ConstantFold): Only concat strings when
26091 the operation is "+", not everything ;-)
26093 * statement.cs (Statement.EmitBoolExpression): Take a location
26095 (If, While, Do): Track location.
26097 * expression.cs (Binary.ResolveOperator): In the object + string
26098 case, I was missing a call to ConvertImplicit
26100 2002-02-25 Ravi Pratap <ravi@ximian.com>
26102 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
26103 Location arguments. Ensure we use RootContext.LookupType to do our work
26104 and not try to do a direct Type.GetType and ModuleBuilder.GetType
26106 * interface.cs (PopulateMethod): Handle the type of the parameter being
26109 * expression.cs (Invocation.BetterFunction): Handle the case when we
26110 have a params method with no fixed arguments and a call is made with no
26113 2002-02-25 Miguel de Icaza <miguel@ximian.com>
26115 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
26116 the verbatim-string-literal
26118 * support.cs (InternalParameters.ParameterModifier): handle null
26120 (InternalParameters.ParameterType): ditto.
26122 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
26123 duplicating the name of the variable parameter.
26124 (GetParameterByName): Fix bug where we were not looking up array
26125 paramters if they were the only present (thanks Paolo!).
26126 (GetParameterInfo): We only have an empty set of types if both
26127 fixed and array are set to null.
26128 (GetParameterInfo-idx): Handle FixedParameter == null
26130 * cs-parser.jay: Handle the case where there is no catch
26131 statements (missing null test).
26133 2002-02-22 Miguel de Icaza <miguel@ximian.com>
26135 * driver.cs (MainDriver): Be conservative on our command line
26138 Catch DirectoryNotFoundException when calling GetFiles.
26140 (SplitPathAndPattern): Used to split the input specification into
26141 a path and a pattern that we can feed to Directory.GetFiles.
26143 2002-02-21 Miguel de Icaza <miguel@ximian.com>
26145 * statement.cs (Fixed): Implement the last case of the Fixed
26146 statement (string handling).
26148 * expression.cs (StringPtr): New class used to return a char * to
26149 a string; Used by the Fixed statement.
26151 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
26153 * expression.cs (Binary.ResolveOperator): Remove redundant
26154 MemberLookup pn parent type.
26155 Optimize union call, we do not need a union if the types are the same.
26156 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
26159 Specialize the use of MemberLookup everywhere, instead of using
26160 the default settings.
26162 (StackAlloc): Implement stackalloc keyword.
26164 * cs-parser.jay: Add rule to parse stackalloc.
26166 * driver.cs: Handle /h, /help, /?
26168 * expression.cs (MakeByteBlob): Removed the hacks we had in place
26169 before we supported unsafe code.
26171 * makefile: add --unsafe to the self compilation of mcs.
26173 2002-02-20 Miguel de Icaza <miguel@ximian.com>
26175 * expression.cs (PointerArithmetic): New class that is used to
26176 perform pointer arithmetic.
26177 (Binary.Resolve): Handle pointer arithmetic
26178 Handle pointer comparission.
26179 (ArrayPtr): Utility expression class that is used to take the
26180 address of an array.
26182 (ElementAccess): Implement array access for pointers
26184 * statement.cs (Fixed): Implement fixed statement for arrays, we
26185 are missing one more case before we are done.
26187 * expression.cs (Indirection): Implement EmitAssign and set the
26188 ExprClass to Variable. This allows pointer dereferences to be
26189 treated as variables, and to have values assigned to them.
26191 * ecore.cs (Expression.StoreFromPtr): New utility function to
26192 store values dereferencing.
26194 2002-02-20 Ravi Pratap <ravi@ximian.com>
26196 * expression.cs (Binary.ResolveOperator): Ensure that we are
26197 not trying to operate on a void type - this fixes the reported
26200 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
26201 the parent implementation is sealed.
26203 * ../errors/cs0239.cs : Add.
26205 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
26207 * typemanager.cs (unverifiable_code_type): Corresponds to
26208 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
26209 which have unsafe code in them.
26211 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
26214 2002-02-19 Miguel de Icaza <miguel@ximian.com>
26216 * cs-tokenizer.cs: Add support for @"litreal strings"
26218 Make tokenizer accept pre-processor directives
26219 on any column (remove the old C-like limitation).
26221 * rootcontext.cs (EmitCode): Emit any global attributes.
26222 (AddGlobalAttributes): Used to keep track of assembly attributes.
26224 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
26226 * cs-parser.jay: Add support for global attributes.
26228 2002-02-17 Miguel de Icaza <miguel@ximian.com>
26230 * expression.cs (Indirection): New helper class. Unary will
26231 create Indirection classes to be able to implement the
26232 IMemoryLocation interface on it.
26234 2002-02-16 Miguel de Icaza <miguel@ximian.com>
26236 * cs-parser.jay (fixed_statement): reference the right statement.
26238 * statement.cs (Fixed.Emit): Finish implementing the fixed
26239 statement for the &x case.
26241 2002-02-14 Miguel de Icaza <miguel@ximian.com>
26243 * class.cs (Property.Define, Method.Define): Remove newslot when
26246 * modifiers.cs: My use of NewSlot when `Abstract' was set was
26247 wrong. NewSlot should only be used if the `new' keyword is present.
26249 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
26250 locating our system dir. Sorry about this.
26252 2002-02-13 Miguel de Icaza <miguel@ximian.com>
26254 * driver.cs (GetSystemDir): Compute correctly the location of our
26255 system assemblies. I was using the compiler directory instead of
26256 the library directory.
26258 2002-02-13 Ravi Pratap <ravi@ximian.com>
26260 * expression.cs (BetterFunction): Put back in what Miguel commented out
26261 since it is the correct fix. The problem is elsewhere ;-)
26263 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
26264 parameters of the parms method are themselves compatible or not !
26266 (StandardConversionExists): Fix very dangerous bug where we were forgetting
26267 to check that a class implements an interface before saying that an implicit
26268 conversion was allowed. Use ImplementsInterface to do the checking.
26270 2002-02-13 Miguel de Icaza <miguel@ximian.com>
26272 * class.cs (Method.Define): Track whether we are an explicit
26273 implementation or not. And only call DefineMethodOverride if we
26274 are an explicit implementation.
26276 (Property.DefineMethod): Ditto.
26278 2002-02-11 Ravi Pratap <ravi@ximian.com>
26280 * expression.cs (BetterFunction): Catch hideous bug which was
26281 preventing us from detecting ambiguous calls due to implicit casts i.e
26284 2002-01-29 Miguel de Icaza <miguel@ximian.com>
26286 * support.cs (Pair): Remove un-needed method. I figured why I was
26287 getting the error in cs-parser.jay, the variable in a foreach loop
26288 is readonly, and the compiler does not really treat this as a variable.
26290 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
26291 instead of EQUALS in grammar.
26293 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
26295 * expression.cs (Unary.DoResolve): Check whether the argument is
26298 2002-01-28 Miguel de Icaza <miguel@ximian.com>
26300 * support.cs: Api for Pair to set a value. Despite the fact that
26301 the variables are public the MS C# compiler refuses to compile
26302 code that accesses the field if the variable is part of a foreach
26305 * statement.cs (Fixed): Begin implementation of the fixed
26308 (Block.AddVariable): Return the VariableInfo on success and null
26309 on failure instead of true/false.
26311 * cs-parser.jay (foreach): Catch errors on variables already
26312 defined (we were ignoring this value before) and properly unwind
26313 the block hierarchy
26315 (fixed_statement): grammar for the fixed statement.
26317 2002-01-25 Miguel de Icaza <miguel@ximian.com>
26319 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
26320 pointer types to be incretemented.
26322 (SizeOf): Implement.
26324 * cs-parser.jay (pointer_member_access): Implement
26325 expr->IDENTIFIER production.
26327 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
26328 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
26331 (Unary): Implement indirection.
26333 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
26334 use in non-unsafe context).
26336 (SimpleName.DoResolve): Check for pointers in field access on safe
26339 (Expression.LoadFromPtr): Factor the load-indirect code in this
26340 function. This was duplicated in UnboxCast and ParameterReference
26342 2002-01-24 Miguel de Icaza <miguel@ximian.com>
26344 * expression.cs (ComposedCast): report an error if a pointer cast
26345 is used in a safe region.
26347 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
26348 pointer type casts in unsafe context.
26350 * codegen.cs (EmitContext): Set up IsUnsafe.
26352 * cs-parser.jay (non_expression_type): Add productions for pointer
26355 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
26356 code. We should not use force into static mode if the method is
26357 not virtual. Fixes bug in MIS
26359 * statement.cs (Do.Emit, While.Emit, For.Emit,
26360 Statement.EmitBoolExpression): Add support to Do and While to
26361 propagate infinite loop as `I do return' semantics.
26363 Improve the For case to also test for boolean constants.
26365 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
26366 to the list of attributes we can add.
26368 Remove `EmitContext' argument.
26370 * class.cs (Method.Define): Apply parameter attributes.
26371 (Constructor.Define): Apply parameter attributes.
26372 (MethodCore.LabelParameters): Move here the core of labeling
26375 * support.cs (ReflectionParameters.ParameterModifier,
26376 InternalParameters.ParameterModifier): Use IsByRef on the type and
26377 only return the OUT bit for these parameters instead of in/out/ref
26380 This is because I miss-understood things. The ParameterInfo.IsIn
26381 and IsOut represent whether the parameter has the [In] and [Out]
26384 2002-01-22 Miguel de Icaza <miguel@ximian.com>
26386 * ecore.cs (FieldExpr.Emit): Release temporaries.
26388 * assign.cs (LocalTemporary.Release): new function.
26390 * codegen.cs (EmitContext.GetTemporaryStorage,
26391 EmitContext.FreeTemporaryStorage): Rework the way we deal with
26392 temporary storage. Now we can "put back" localbuilders when we
26395 2002-01-21 Miguel de Icaza <miguel@ximian.com>
26397 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
26398 need to make a copy of the variable to generate verifiable code.
26400 2002-01-19 Miguel de Icaza <miguel@ximian.com>
26402 * driver.cs: Compute dynamically the system directory.
26404 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
26405 Slower, but more generally useful. Used by the abstract
26406 registering implementation.
26408 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
26409 the rules for the special rule on Type/instances. First check if
26410 we have the same name, and if so, try that special static path
26411 rather than the instance path.
26413 2002-01-18 Miguel de Icaza <miguel@ximian.com>
26415 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
26418 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
26419 Enum, ValueType, Delegate or Array for non-corlib compiles.
26421 * cs-tokenizer.cs: Catch long identifiers (645)
26423 * typemanager.cs (IndexerPropetyName): Ravi never tested this
26426 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
26427 fix, we were returning too early, so we were not registering
26428 pending methods from abstract classes.
26430 Do not register pending methods if the class is abstract.
26432 * expression.cs (Conditional.DoResolve): Report circular implicit
26433 conversions when we neecd to compute it for conditional
26436 (Is.DoResolve): If the expression is always of the provided type,
26437 flag warning 183. If the expression can not ever be of the
26438 provided type flag warning 184.
26440 * class.cs: Catch 169 as well.
26442 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
26445 2002-01-18 Nick Drochak <ndrochak@gol.com>
26447 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
26449 2002-01-17 Miguel de Icaza <miguel@ximian.com>
26451 * interface.cs: (PopulateMethod): Check for pointers being defined
26452 only if the unsafe context is active.
26453 (PopulateProperty): ditto.
26454 (PopulateIndexer): ditto.
26456 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
26457 specified. If pointers are present, make sure that they are
26458 present in an unsafe context.
26459 (Constructor, Constructor.Define): ditto.
26460 (Field, Field.Define): ditto.
26461 (Property, Property.Define): ditto.
26462 (Event, Event.Define): ditto.
26464 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
26465 hashtable if there are classes or structs defined.
26467 * expression.cs (LocalVariableReference.DoResolve): Simplify this
26468 code, as the constant resolution moved.
26470 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
26471 the metadata, so we can flag error 133.
26473 * decl.cs (MemberCore.UnsafeOK): New function to test that a
26474 pointer is being declared in an unsafe context.
26476 2002-01-16 Miguel de Icaza <miguel@ximian.com>
26478 * modifiers.cs (Modifiers.Check): Require a Location argument.
26479 Report error 227 for Unsafe use.
26481 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
26483 * statement.cs (For.Emit): If the test is null, then report that
26484 we do `return', as we wont reach anything afterwards.
26486 (Switch.SwitchGoverningType): Track the expression that matched
26489 * driver.cs: Allow negative numbers as an error code to flag.
26491 * cs-parser.jay: Handle 1551.
26493 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
26495 2002-01-15 Miguel de Icaza <miguel@ximian.com>
26497 * cs-parser.jay: Report 1518 (type declaration can only contain
26498 class, struct, interface, enum or delegate)
26500 (switch_label): Report 1523 (keywords `case' or `default' must
26503 (opt_switch_sections): Report 1522 (empty switch)
26505 * driver.cs: Report 1515 (response file specified multiple times)
26506 Report 1516 (Source file specified multiple times).
26508 * expression.cs (Argument.Resolve): Signal 1510
26510 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
26511 access not allowed in static code)
26513 2002-01-11 Ravi Pratap <ravi@ximian.com>
26515 * typemanager.cs (IsPointerType): Utility method which we are going
26518 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
26519 the object type, so we take care of that.
26521 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
26523 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
26524 added to non-params parameters :-)
26526 * typemanager.cs (CSharpName): Include 'void' type too.
26528 (void_ptr_type): Include in the set of core types.
26530 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
26533 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
26536 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
26537 completely forgotten about it.
26539 2002-01-10 Ravi Pratap <ravi@ximian.com>
26541 * cs-parser.jay (pointer_type): Add. This begins our implementation
26542 of parsing rules for unsafe code.
26544 (unsafe_statement): Implement.
26546 (embedded_statement): Modify to include the above.
26548 * statement.cs (Unsafe): Implement new class for unsafe blocks.
26550 * codegen.cs (EmitContext.InUnsafe): Add. This determines
26551 if the current context is an unsafe one.
26553 * cs-parser.jay (local_variable_pointer_type): Since local variable types
26554 are handled differently, we need separate rules for them.
26556 (local_variable_declaration): Update to use local_variable_pointer_type
26557 to allow variable declarations of unmanaged pointer types.
26559 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
26560 in unsafe contexts.
26562 * ../errors/cs0214.cs : Add.
26564 2002-01-16 Nick Drochak <ndrochak@gol.com>
26566 * makefile: remove 'response' file when cleaning.
26568 2002-01-15 Miguel de Icaza <miguel@ximian.com>
26570 * cs-parser.jay: Report 1524.
26572 2002-01-14 Miguel de Icaza <miguel@ximian.com>
26574 * typemanager.cs (RegisterMethod): drop checking if we have
26575 registered this from here
26577 2002-01-12 Miguel de Icaza <miguel@ximian.com>
26579 * class.cs (Method.EmitDestructor): Implement calling our base
26582 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
26583 value of InFinally.
26585 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
26586 this routine and will wrap the call in a try/catch block. Deal
26589 2002-01-11 Miguel de Icaza <miguel@ximian.com>
26591 * ecore.cs (Expression.MemberLookup): instead of taking a
26592 parameter `same_type' that was used to tell whether we could
26593 access private members we compute our containing type from the
26596 (FieldExpr): Added partial support for volatile fields. This does
26597 not work for volatile fields exposed from assemblies, as I can not
26598 figure out how to extract the modreq from it.
26600 Updated all the source files to use this.
26602 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
26603 because it is referenced by MemberLookup very often.
26605 2002-01-09 Ravi Pratap <ravi@ximian.com>
26607 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
26608 TypeBuilder.GetCustomAttributes to retrieve what we need.
26610 Get rid of redundant default_member_attr_type as this is the same as
26611 default_member_type which already exists.
26613 * interface.cs, attribute.cs : Update accordingly.
26615 2002-01-08 Miguel de Icaza <miguel@ximian.com>
26617 * typemanager.cs: Enable IndexerPropertyName again. It does not
26618 work for TYpeBuilders though. Ravi, can you please fix this?
26620 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
26622 * expression.cs (Argument.Emit): Handle the case of ref objects
26623 being passed to ref functions;
26625 (ParameterReference.EmitLoad): Loads the content of the pointer
26626 without dereferencing.
26628 2002-01-07 Miguel de Icaza <miguel@ximian.com>
26630 * cs-tokenizer.cs: Implemented the pre-processing expressions.
26632 2002-01-08 Ravi Pratap <ravi@ximian.com>
26634 * class.cs (Indexer.DefineMethod): Incorporate the interface
26635 type in the name of the method if we are doing explicit interface
26638 * expression.cs (ConversionExists): Remove as it is completely obsolete.
26640 (BetterConversion): Fix extremely trivial bug where we were referring to
26641 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
26644 * ../errors/bug16.cs : Add although we have fixed it.
26646 2002-01-07 Miguel de Icaza <miguel@ximian.com>
26648 * expression.cs (BaseIndexer): Begin implementation.
26650 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
26652 * cs-parser.jay (indexer_declarator): Use qualified_identifier
26653 production directly to remove a shift/reduce, and implement
26654 explicit interface implementation.
26656 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
26657 after a floating point suffix.
26659 * expression.cs (DoNumericPromotions): Improved the conversion for
26660 uint/uint. If we have a constant, we avoid doing a typecast to a
26663 * class.cs (Indexer): Implement explicit interface implementation
26666 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
26668 * class.cs: make the default instance constructor public and hidebysig.
26670 2001-01-03 Ravi Pratap <ravi@ximian.com>
26672 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
26673 so we can call it from elsewhere.
26675 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
26676 we emit it internally if the class has a defined indexer; otherwise the user
26677 emits it by decorating the class definition with the DefaultMemberAttribute.
26679 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
26680 attribute is not used on a type which defines an indexer.
26682 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
26683 character when we skip whitespace.
26685 * ../errors/cs0646.cs : Add.
26687 2002-01-03 Miguel de Icaza <miguel@ximian.com>
26689 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
26692 * makefile: Add practical target `mcs3.exe' which builds the third
26693 generation compiler.
26695 * expression.cs (New): Fix structures constructor calling.
26697 * class.cs (Property, Method, Indexer): Emit Final flag on the
26698 method if we are an interface implementation and we are not
26701 * ecore.cs (PropertyExpr): New public field `IsBase', tells
26702 whether this property is referencing a `base' method.
26704 * expression.cs (Invocation.EmitCall): take an extra argument:
26705 is_base, this is used to determine whether the `call' or
26706 `callvirt' opcode should be used.
26709 * delegate.cs: update EmitCall.
26711 * class.cs (Method.Define): Set NewSlot for the cases where we are
26712 not implementing an interface method.
26714 (Property.Define): ditto.
26716 2002-01-02 Miguel de Icaza <miguel@ximian.com>
26718 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
26719 'r'. Allows mcs to parse itself fully.
26721 2002-01-02 Ravi Pratap <ravi@ximian.com>
26723 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
26724 of the number of initializers that require the InitializeArray method.
26726 (CheckIndices): Store the Expression in all cases - not the plain value. Also
26727 update the above field where necessary.
26729 (MakeByteBlob): Update accordingly.
26731 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
26734 (EmitDynamicInitializers): Update in accordance with the new optimization.
26736 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
26737 same OpCode applies.
26739 * cs-parser.jay : Fix some glaring errors I introduced.
26741 2002-01-01 Ravi Pratap <ravi@ximian.com>
26743 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
26744 so that we can check for name clashes there too.
26746 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
26747 for interface indexers.
26749 * interfaces.cs (Define): Emit the default member attribute.
26751 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
26752 variable was being referred to while setting the value ;-)
26754 2002-01-01 Miguel de Icaza <miguel@ximian.com>
26756 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
26757 byte-by-byte information when we know the data is zero.
26759 Make the block always a multiple of 4, because
26760 DefineInitializedData has a bug.
26762 * assign.cs: Fix, we should assign from the temporary, not from
26765 * expression.cs (MakeByteBlob): Fix my incorrect code.
26767 2001-12-31 Miguel de Icaza <miguel@ximian.com>
26769 * typemanager.cs (EnumToUnderlying): This function is used to get
26770 the underlying type from an enumeration, because it does not
26773 * constant.cs: Use the I4_S form for values between -128 and 127.
26775 * statement.cs (Block.LookupLabel): Looks up a label.
26776 (Block): Drop support for labeled blocks.
26778 (LabeledStatement): New kind of statement that represents a label
26781 (Goto): Finally implement this bad boy.
26783 * cs-parser.jay: Update to reflect new mechanism to implement
26786 2001-12-30 Miguel de Icaza <miguel@ximian.com>
26788 * codegen.cs (EmitContext.This): a codegen property that keeps the
26789 a single instance of this instead of creating many different this
26792 * delegate.cs (Delegate.DoResolve): Update to use the property;
26794 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
26796 * expression.cs (BaseAccess.DoResolve): Ditto.
26798 2001-12-29 Ravi Pratap <ravi@ximian.com>
26800 * typemanager.cs (methodimpl_attr_type): Add to hold the type
26801 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
26803 (InitCoreTypes): Update accordingly.
26805 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
26806 so we can quickly store the state.
26808 (ApplyAttributes): Set the correct implementation flags
26809 for InternalCall methods.
26811 2001-12-29 Miguel de Icaza <miguel@ximian.com>
26813 * expression.cs (EmitCall): if a method is not virtual, then do
26814 not use callvirt on it.
26816 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
26817 user defined stuff) requires the use of stobj, which takes an
26818 address on the stack instead of an array and an index. So emit
26819 the Ldelema operation for it.
26821 (EmitStoreOpcode): Use stobj for valuetypes.
26823 (UnaryMutator.EmitCode): Use the right 1 value depending on
26824 whether we are dealing with int64/uint64, float or doubles.
26826 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
26827 constructors that I implemented last night.
26829 (Constructor.IsDefault): Fix to work properly for static
26832 * cs-parser.jay (CheckDef): report method signature errors.
26833 Update error number 103 to be 132.
26835 * decl.cs: New AdditionResult enumeration value: MethodExists.
26836 Although we do this check for methods later on in the semantic
26837 analysis, catching repeated default constructors is so easy that
26838 we catch these here.
26840 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
26843 (ParameterReference.EmitAssign, Emit): handle
26846 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
26847 (ArrayAccess.EmitStoreOpcode): ditto.
26849 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
26851 * expression.cs (MakeByteBlob): Complete all the missing types
26852 (uint, short, ushort, byte, sbyte)
26854 * class.cs: Only init instance field initializers on instance
26857 Rename `constructors' to instance_constructors.
26859 (TypeContainer.AddConstructor): Only add constructors to the list
26860 if it is not static.
26862 Make sure that we handle default_static_constructor independently
26863 everywhere where we handle instance_constructors
26865 2001-12-28 Miguel de Icaza <miguel@ximian.com>
26867 * class.cs: Do not lookup or create a base initializer for a
26868 static constructor.
26870 (ConstructorInitializer.Resolve): use the proper type to lookup
26873 * cs-parser.jay: Report error 1585 (modifiers between type and name).
26875 * enum.cs, interface.cs: Remove CloseType, this is taken care by
26878 * decl.cs: CloseType is now an virtual method, the default
26879 implementation just closes this type.
26881 2001-12-28 Ravi Pratap <ravi@ximian.com>
26883 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
26884 to PreserveSig by default. Also emit HideBySig on such methods.
26886 Basically, set the defaults to standard values.
26888 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
26889 argument, if candidate is better, it can't be worse than the best !
26891 (Invocation): Re-write bits to differentiate between methods being
26892 applicable in their expanded form and their normal form - for params
26895 Get rid of use_standard everywhere as only standard conversions are allowed
26896 in overload resolution.
26898 More spec conformance.
26900 2001-12-27 Miguel de Icaza <miguel@ximian.com>
26902 * driver.cs: Add --timestamp, to see where the compiler spends
26905 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
26906 `this' in static code.
26908 (SimpleName.DoResolve): Implement in terms of a helper function
26909 that allows static-references to be passed upstream to
26912 (Expression.ResolveWithSimpleName): Resolve specially simple
26913 names when called by MemberAccess to implement the special
26916 (Expression.ImplicitReferenceConversion): Handle conversions from
26917 Null to reference types before others, as Null's type is
26920 * expression.cs (Invocation.EmitCall): Handle the special case of
26921 calling methods declared on a reference type from a ValueType
26922 (Base classes System.Object and System.Enum)
26924 (MemberAccess.Resolve): Only perform lookups on Enumerations if
26925 the left hand side is a TypeExpr, not on every enumeration.
26927 (Binary.Resolve): If types are reference types, then do a cast to
26928 object on operators != and == of both arguments.
26930 * typemanager.cs (FindMembers): Extract instance and static
26931 members if requested.
26933 * interface.cs (PopulateProperty): Use void_type instead of null
26934 as the return type for the setter method.
26936 (PopulateIndexer): ditto.
26938 2001-12-27 Ravi Pratap <ravi@ximian.com>
26940 * support.cs (ReflectionParameters): Fix minor bug where we
26941 were examining the wrong parameter for the ParamArray attribute.
26943 Cope with requests for the type of the parameter at position
26944 greater than the params parameter's. We now return the element
26945 type of the params array as that makes more sense.
26947 * expression.cs (Invocation.IsParamsMethodApplicable): Update
26948 accordingly as we no longer have to extract the element type
26951 (Invocation.OverloadResolve): Update.
26953 2001-12-27 Miguel de Icaza <miguel@ximian.com>
26955 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
26956 against IEnumerator, test whether the return value is a descendant
26957 of the IEnumerator interface.
26959 * class.cs (Indexer.Define): Use an auxiliary method to implement
26960 the other bits of the method definition. Begin support for
26961 explicit interface implementation.
26963 (Property.DefineMethod): Use TypeManager.void_type instead of null
26964 for an empty return value.
26966 2001-12-26 Miguel de Icaza <miguel@ximian.com>
26968 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
26969 dealing with a FieldExpr which is composed of a FieldBuilder, in
26970 the code path we did extract the constant, but we should have
26971 obtained the underlying value to be able to cast it (otherwise we
26972 end up in an infinite loop, this is what Ravi was running into).
26974 (ArrayCreation.UpdateIndices): Arrays might be empty.
26976 (MemberAccess.ResolveMemberAccess): Add support for section
26977 14.5.4.1 that deals with the special case of E.I when E is a type
26978 and something else, that I can be a reference to a static member.
26980 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
26981 handle a particular array type to create byte blobs, it is just
26982 something we dont generate byteblobs for.
26984 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
26987 * location.cs (Push): remove the key from the hashtable that we
26988 are about to add. This happens for empty files.
26990 * driver.cs: Dispose files after we have parsed them.
26992 (tokenize): new function that only runs the tokenizer on its
26993 input, for speed testing.
26995 2001-12-26 Ravi Pratap <ravi@ximian.com>
26997 * class.cs (Event.Define): Define the private field only if there
26998 are no accessors defined.
27000 * expression.cs (ResolveMemberAccess): If there is no associated
27001 field with the event, that means we have an event defined with its
27002 own accessors and we should flag error cs0070 since transforming
27003 ourselves into a field is not valid in that case.
27005 * ecore.cs (SimpleName.DoResolve): Same as above.
27007 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
27008 and charset to sane values.
27010 2001-12-25 Ravi Pratap <ravi@ximian.com>
27012 * assign.cs (DoResolve): Perform check on events only if they
27013 are being accessed outside the declaring type.
27015 * cs-parser.jay (event_declarations): Update rules to correctly
27016 set the type of the implicit parameter etc.
27018 (add_accessor, remove_accessor): Set current local parameters.
27020 * expression.cs (Binary): For delegate addition and subtraction,
27021 cast the return value from the method into the appropriate delegate
27024 2001-12-24 Ravi Pratap <ravi@ximian.com>
27026 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
27027 of these as the workaround is unnecessary.
27029 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
27030 delegate data - none of that is needed at all.
27032 Re-write bits to extract the instance expression and the delegate method
27035 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
27038 * attribute.cs (ApplyAttributes): New method to take care of common tasks
27039 of attaching attributes instead of duplicating code everywhere.
27041 * everywhere : Update code to do attribute emission using the above method.
27043 2001-12-23 Miguel de Icaza <miguel@ximian.com>
27045 * expression.cs (IsParamsMethodApplicable): if there are not
27046 parameters, return immediately.
27048 * ecore.cs: The 0 literal can be implicity converted to an enum
27051 (SimpleName.DoResolve): First lookup the type, then lookup the
27054 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
27055 want to get its address. If the InstanceExpression is not
27056 addressable, store the result in a temporary variable, then get
27059 * codegen.cs: Only display 219 errors on warning level or above.
27061 * expression.cs (ArrayAccess): Make it implement the
27062 IMemoryLocation interface.
27064 (Binary.DoResolve): handle the operator == (object a, object b)
27065 and operator != (object a, object b) without incurring into a
27066 BoxedCast (because 5 != o should never be performed).
27068 Handle binary enumerator operators.
27070 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
27071 value type, otherwise use Ldelem_ref.
27073 Use precomputed names;
27075 (AddressOf): Implement address of
27077 * cs-parser.jay (labeled_statement): Fix recursive block
27078 addition by reworking the production.
27080 * expression.cs (New.DoEmit): New has a special case:
27082 If we are dealing with a ValueType, we have a few
27083 situations to deal with:
27085 * The target of New is a ValueType variable, that is
27086 easy, we just pass this as the variable reference
27088 * The target of New is being passed as an argument,
27089 to a boxing operation or a function that takes a
27092 In this case, we need to create a temporary variable
27093 that is the argument of New.
27096 2001-12-23 Ravi Pratap <ravi@ximian.com>
27098 * rootcontext.cs (LookupType): Check that current_type is not null before
27099 going about looking at nested types.
27101 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
27102 not implement the IAssignMethod interface any more.
27104 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
27105 where we tranform them into FieldExprs if they are being resolved from within
27106 the declaring type.
27108 * ecore.cs (SimpleName.DoResolve): Do the same here.
27110 * assign.cs (DoResolve, Emit): Clean up code considerably.
27112 * ../errors/bug10.cs : Add.
27114 * ../errors/cs0070.cs : Add.
27116 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
27118 * assign.cs : Get rid of EventIsLocal everywhere.
27120 2001-12-23 Miguel de Icaza <miguel@ximian.com>
27122 * ecore.cs (ConvertIntLiteral): finished the implementation.
27124 * statement.cs (SwitchLabel): Convert the value we are using as a
27125 key before looking up the table.
27127 2001-12-22 Miguel de Icaza <miguel@ximian.com>
27129 * codegen.cs (EmitTopBlock): Require a Location argument now.
27131 * cs-parser.jay (constructor_declarator): We need to setup
27132 current_local_parameters before we parse the
27133 opt_constructor_initializer, to allow the variables to be bound
27134 to the constructor arguments.
27136 * rootcontext.cs (LookupType): First lookup nested classes in our
27137 class and our parents before we go looking outside our class.
27139 * expression.cs (ConstantFold): Extract/debox the values at the
27142 * rootcontext.cs (EmitCode): Resolve the constants first before we
27143 resolve the types. This is not really needed, but it helps debugging.
27145 * statement.cs: report location.
27147 * cs-parser.jay: pass location to throw statement.
27149 * driver.cs: Small bug fix.
27151 * report.cs: Updated format to be 4-zero filled digits.
27153 2001-12-22 Ravi Pratap <ravi@ximian.com>
27155 * expression.cs (CheckIndices): Fix minor bug where the wrong
27156 variable was being referred to ;-)
27158 (DoEmit): Do not call EmitStaticInitializers when the
27159 underlying type is System.Object.
27161 2001-12-21 Ravi Pratap <ravi@ximian.com>
27163 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
27164 and do the usual workaround for SRE.
27166 * class.cs (MyEventBuilder.EventType): New member to get at the type
27167 of the event, quickly.
27169 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
27171 * assign.cs (Assign.DoResolve): Handle the case when the target
27172 is an EventExpr and perform the necessary checks.
27174 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
27177 (SimpleName.MemberStaticCheck): Include check for EventExpr.
27179 (EventExpr): Set the type in the constructor itself since we
27180 are meant to be born fully resolved.
27182 (EventExpr.Define): Revert code I wrote earlier.
27184 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
27185 instance expression is null. The instance expression is a This in that case
27186 or a null, depending on whether it is a static method or not.
27188 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
27189 refers to more than one method.
27191 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
27192 and accordingly flag errors.
27194 2001-12-21 Miguel de Icaza <miguel@ximian.com>
27196 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
27198 2001-12-22 Miguel de Icaza <miguel@ximian.com>
27200 * location.cs (ToString): Provide useful rutine.
27202 2001-12-21 Miguel de Icaza <miguel@ximian.com>
27204 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
27205 objects, return the actual integral boxed.
27207 * statement.cs (SwitchLabel): define an ILLabel for each
27210 (Switch.CheckSwitch): If the value is a Literal, extract
27211 the underlying literal.
27213 Also in the unused hashtable we had, add the SwitchLabel so we can
27214 quickly look this value up.
27216 * constant.cs: Implement a bunch of new constants. Rewrite
27217 Literal based on this. Made changes everywhere to adapt to this.
27219 * expression.cs (Expression.MakeByteBlob): Optimize routine by
27220 dereferencing array only once, and also copes with enumrations.
27222 bytes are two bytes wide, not one.
27224 (Cast): Perform constant conversions.
27226 * ecore.cs (TryImplicitIntConversion): Return literals instead of
27227 wrappers to the literals here.
27229 * expression.cs (DoNumericPromotions): long literals can converted
27230 to ulong implicity (this is taken care of elsewhere, but I was
27231 missing this spot).
27233 * ecore.cs (Expression.Literalize): Make the return type Literal,
27234 to improve type checking.
27236 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
27238 2001-12-20 Miguel de Icaza <miguel@ximian.com>
27240 * literal.cs: Revert code from ravi that checked the bounds. The
27241 bounds are sane by the definition of the type itself.
27243 * typemanager.cs: Fix implementation of ImplementsInterface. We
27244 need to actually look up in our parent hierarchy for interfaces
27247 * const.cs: Use the underlying type for enumerations
27249 * delegate.cs: Compute the basename for the delegate creation,
27250 that should fix the delegate test case, and restore the correct
27251 Type Lookup semantics in rootcontext
27253 * rootcontext.cs: Revert Ravi's last patch. The correct way of
27254 referencing a nested type with the Reflection API is using the "+"
27257 * cs-parser.jay: Do not require EOF token at the end.
27259 2001-12-20 Ravi Pratap <ravi@ximian.com>
27261 * rootcontext.cs (LookupType): Concatenate type names with
27262 a '.' instead of a '+' The test suite passes again.
27264 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
27265 field of the enumeration.
27267 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
27268 the case when the member is an EventExpr.
27270 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
27271 static has an associated instance expression.
27273 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
27275 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
27277 * class.cs (Event.Define): Register event and perform appropriate checks
27280 We define the Add and Remove methods even if the use provides none because
27281 in that case, we provide default implementations ourselves.
27283 Define a private field of the type of the event. This is done by the CSC compiler
27284 and we should be doing it too ;-)
27286 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
27287 More methods we use in code we generate.
27289 (multicast_delegate_type, delegate_type): Two separate types since the distinction
27292 (InitCoreTypes): Update accordingly for the above.
27294 * class.cs (Event.Emit): Generate code for default accessors that we provide
27296 (EmitDefaultMethod): Do the job in the above.
27298 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
27301 2001-12-20 Miguel de Icaza <miguel@ximian.com>
27303 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
27304 builders even if we were missing one.
27306 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
27307 pass the Basename as our class name instead of the Name. The
27308 basename will be correctly composed for us.
27310 * parameter.cs (Paramters): Now takes a Location argument.
27312 * decl.cs (DeclSpace.LookupType): Removed convenience function and
27313 make all the code call directly LookupType in RootContext and take
27314 this chance to pass the Location information everywhere.
27316 * Everywhere: pass Location information.
27318 2001-12-19 Miguel de Icaza <miguel@ximian.com>
27320 * class.cs (Constructor.Define): Updated way of detecting the
27321 length of the parameters.
27323 (TypeContainer.DefineType): Use basename as the type name for
27326 (TypeContainer.Define): Do not recursively define types here, as
27327 definition is taken care in order by the RootContext.
27329 * tree.cs: Keep track of namespaces in a per-file basis.
27331 * parameter.cs (Parameter.ComputeSignature): Update to use
27334 (Parameters.GetSignature): ditto.
27336 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
27337 instead of a TypeContainer.
27339 (Interface.SemanticAnalysis): Use `this' instead of our parent to
27340 resolve names. Because we need to be resolve in our context, not
27343 * driver.cs: Implement response files.
27345 * class.cs (TypeContainer.DefineType): If we are defined, do not
27346 redefine ourselves.
27348 (Event.Emit): Emit the code for add/remove handlers.
27349 (Event.Define): Save the MethodBuilders for add/remove.
27351 * typemanager.cs: Use pair here too.
27353 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
27354 DictionaryEntry requires the first argument to be non-null.
27356 (enum_declaration): Compute full name for registering the
27359 (delegate_declaration): Instead of using
27360 formal_parameter_list, use opt_formal_parameter_list as the list
27363 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
27364 (EventParsing): New property that controls whether `add' and
27365 `remove' are returned as tokens or identifiers (for events);
27367 2001-12-19 Ravi Pratap <ravi@ximian.com>
27369 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
27370 use MyEventBuilder only and let it wrap the real builder for us.
27372 (MyEventBuilder): Revamp constructor etc.
27374 Implement all operations that we perform on EventBuilder in precisely the same
27377 (FindMembers): Update to use the EventBuilder member.
27379 (Event.Emit): Update accordingly.
27381 2001-12-18 Ravi Pratap <ravi@ximian.com>
27383 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
27384 by calling the appropriate methods.
27386 (GetCustomAttributes): Make stubs as they cannot possibly do anything
27389 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
27391 2001-12-17 Ravi Pratap <ravi@ximian.com>
27393 * delegate.cs (Delegate.Populate): Check that the return type
27394 and various parameters types are indeed accessible.
27396 * class.cs (Constructor.Define): Same here.
27398 (Field.Define): Ditto.
27400 (Event.Define): Ditto.
27402 (Operator.Define): Check that the underlying Method defined itself
27403 correctly - so it's MethodBuilder should not be null.
27405 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
27406 expression happens to be null.
27408 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
27409 members but as of now we don't seem to be able to do anything really useful with it.
27411 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
27412 not the EventBuilder.
27414 2001-12-18 Miguel de Icaza <miguel@ximian.com>
27416 * cs-tokenizer.cs: Add support for defines.
27417 Add support for #if, #elif, #else, #endif
27419 (eval_var): evaluates a variable.
27420 (eval): stubbed for evaluating functions.
27422 * cs-parser.jay: Pass the defines information
27424 * driver.cs: Add --define command line option.
27426 * decl.cs: Move MemberCore here.
27428 Make it the base class for DeclSpace. This allows us to catch and
27429 report 108 and 109 for everything now.
27431 * class.cs (TypeContainer.Define): Extract all the members
27432 before populating and emit the warning 108 (new keyword required
27433 to override) instead of having each member implement this.
27435 (MemberCore.Define): New abstract method, we will be using this in
27436 the warning reporting engine in Populate.
27438 (Operator.Define): Adjust to new MemberCore protocol.
27440 * const.cs (Const): This does not derive from Expression, it is a
27441 temporary object we use to create fields, it is a MemberCore.
27443 * class.cs (Method.Define): Allow the entry point to be in a
27446 * driver.cs: Rewrite the argument handler to clean it up a bit.
27448 * rootcontext.cs: Made it just an auxiliary namespace feature by
27449 making everything static.
27451 * driver.cs: Adapt code to use RootContext type name instead of
27454 * delegate.cs: Remove RootContext argument.
27456 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
27459 * class.cs (Event.Define): The lookup can fail.
27461 * cs-tokenizer.cs: Begin implementation of pre-procesor.
27463 * expression.cs: Resolve the this instance before invoking the code.
27465 2001-12-17 Miguel de Icaza <miguel@ximian.com>
27467 * cs-parser.jay: Add a production in element_access that allows
27468 the thing to become a "type" reference. This way we can parse
27469 things like "(string [])" as a type.
27471 Note that this still does not handle the more complex rules of
27475 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
27477 * ecore.cs: (CopyNewMethods): new utility function used to
27478 assemble the list of methods from running FindMembers.
27480 (MemberLookup): Rework FindMembers so that
27482 2001-12-16 Miguel de Icaza <miguel@ximian.com>
27484 * class.cs (TypeContainer): Remove Delegates who fail to be
27487 * delegate.cs (Populate): Verify that we dont get null return
27488 values. TODO: Check for AsAccessible.
27490 * cs-parser.jay: Use basename to emit error 574 (destructor should
27491 have the same name as container class), not the full name.
27493 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
27494 possible representation.
27496 Also implements integer type suffixes U and L.
27498 2001-12-15 Miguel de Icaza <miguel@ximian.com>
27500 * expression.cs (ArrayCreation.DoResolve): We need to do the
27501 argument resolution *always*.
27503 * decl.cs: Make this hold the namespace. Hold the root context as
27505 (LookupType): Move here.
27507 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
27509 * location.cs (Row, Name): Fixed the code, it was always returning
27510 references to the first file.
27512 * interface.cs: Register properties defined through interfaces.
27514 * driver.cs: Add support for globbing on the command line
27516 * class.cs (Field): Make it derive from MemberCore as well.
27519 2001-12-15 Ravi Pratap <ravi@ximian.com>
27521 * class.cs (Event::Define): Check that the type of the event is a delegate
27522 type else flag error #66.
27524 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
27527 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
27528 values of EntryPoint, CharSet etc etc.
27530 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
27532 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
27533 be null and we should ignore this. I am not sure if this is really clean. Apparently,
27534 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
27535 which needs this to do its work.
27537 * ../errors/cs0066.cs : Add.
27539 2001-12-14 Miguel de Icaza <miguel@ximian.com>
27541 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
27544 * class.cs: (MethodSignature.MethodSignature): Removed hack that
27545 clears out the parameters field.
27546 (MemberSignatureCompare): Cleanup
27548 (MemberCore): New base class used to share code between MethodCore
27551 (RegisterRequiredImplementations) BindingFlags.Public requires
27552 either BindingFlags.Instace or Static. Use instance here.
27554 (Property): Refactored code to cope better with the full spec.
27556 * parameter.cs (GetParameterInfo): Return an empty array instead
27559 * class.cs (Property): Abstract or extern properties have no bodies.
27561 * parameter.cs (GetParameterInfo): return a zero-sized array.
27563 * class.cs (TypeContainer.MethodModifiersValid): Move all the
27564 method modifier validation to the typecontainer so we can reuse
27565 this on properties.
27567 (MethodCore.ParameterTypes): return an empty sized array of types.
27569 (Property.Define): Test property modifier validity.
27571 Add tests for sealed/override too.
27573 (Method.Emit): abstract or extern methods have no bodies.
27575 2001-12-14 Ravi Pratap <ravi@ximian.com>
27577 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
27580 (Method::Define, ::Emit): Modify accordingly.
27582 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
27584 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
27586 * makefile: Pass in /unsafe.
27588 2001-12-13 Miguel de Icaza <miguel@ximian.com>
27590 * class.cs (MakeKey): Kill routine.
27592 * class.cs (TypeContainer.Define): Correctly define explicit
27593 method implementations (they require the full interface name plus
27596 * typemanager.cs: Deply the PtrHashtable here and stop using the
27597 lame keys. Things work so much better.
27599 This of course broke everyone who depended on `RegisterMethod' to
27600 do the `test for existance' test. This has to be done elsewhere.
27602 * support.cs (PtrHashtable): A hashtable that avoid comparing with
27603 the object stupid Equals method (because, that like fails all over
27604 the place). We still do not use it.
27606 * class.cs (TypeContainer.SetRequiredInterface,
27607 TypeContainer.RequireMethods): Killed these two routines and moved
27608 all the functionality to RegisterRequiredImplementations.
27610 (TypeContainer.RegisterRequiredImplementations): This routine now
27611 registers all the implementations required in an array for the
27612 interfaces and abstract methods. We use an array of structures
27613 which can be computed ahead of time to reduce memory usage and we
27614 also assume that lookups are cheap as most classes will not
27615 implement too many interfaces.
27617 We also avoid creating too many MethodSignatures.
27619 (TypeContainer.IsInterfaceMethod): Update and optionally does not
27620 clear the "pending" bit if we find that there are problems with
27623 (TypeContainer.VerifyPendingMethods): Update to report errors of
27624 methods that look like implementations but are not.
27626 (TypeContainer.Define): Add support for explicit interface method
27629 2001-12-12 Miguel de Icaza <miguel@ximian.com>
27631 * typemanager.cs: Keep track of the parameters here instead of
27632 being a feature of the TypeContainer.
27634 * class.cs: Drop the registration of parameters here, as
27635 InterfaceMethods are also interface declarations.
27637 * delegate.cs: Register methods with the TypeManager not only with
27638 the TypeContainer. This code was buggy.
27640 * interface.cs: Full registation here.
27642 2001-12-11 Miguel de Icaza <miguel@ximian.com>
27644 * expression.cs: Remove reducer for binary expressions, it can not
27647 * const.cs: Put here the code that used to go into constant.cs
27649 * constant.cs: Put here the code for constants, this is a new base
27650 class for Literals.
27652 * literal.cs: Make Literal derive from Constant.
27654 2001-12-09 Miguel de Icaza <miguel@ximian.com>
27656 * statement.cs (Return.Emit): Report error 157 if the user
27657 attempts to return from a finally block.
27659 (Return.Emit): Instead of emitting a return, jump to the end of
27662 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
27663 LocalBuilder to store the result of the function. ReturnLabel is
27664 the target where we jump.
27667 2001-12-09 Radek Doulik <rodo@ximian.com>
27669 * cs-parser.jay: remember alias in current namespace
27671 * ecore.cs (SimpleName::DoResolve): use aliases for types or
27674 * class.cs (LookupAlias): lookup alias in my_namespace
27676 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
27678 (LookupAlias): lookup alias in this and if needed in parent
27681 2001-12-08 Miguel de Icaza <miguel@ximian.com>
27685 * rootcontext.cs: (ModuleBuilder) Made static, first step into
27686 making things static. I need this to avoid passing the
27687 TypeContainer when calling ParameterType.
27689 * support.cs (InternalParameters.ParameterType): Remove ugly hack
27690 that did string manipulation to compute the type and then call
27691 GetType. Use Parameter.ParameterType instead.
27693 * cs-tokenizer.cs: Consume the suffix for floating values.
27695 * expression.cs (ParameterReference): figure out whether this is a
27696 reference parameter or not. Kill an extra variable by computing
27697 the arg_idx during emission.
27699 * parameter.cs (Parameters.GetParameterInfo): New overloaded
27700 function that returns whether a parameter is an out/ref value or not.
27702 (Parameter.ParameterType): The type of the parameter (base,
27703 without ref/out applied).
27705 (Parameter.Resolve): Perform resolution here.
27706 (Parameter.ExternalType): The full type (with ref/out applied).
27708 * statement.cs (Using.Emit, Using.EmitExpression): Implement
27709 support for expressions on the using statement.
27711 2001-12-07 Miguel de Icaza <miguel@ximian.com>
27713 * statement.cs (Using.EmitLocalVariableDecls): Split the
27714 localvariable handling of the using statement.
27716 (Block.EmitMeta): Keep track of variable count across blocks. We
27717 were reusing slots on separate branches of blocks.
27719 (Try.Emit): Emit the general code block, we were not emitting it.
27721 Check the type of the declaration to be an IDisposable or
27722 something that can be implicity converted to it.
27724 Emit conversions if required.
27726 * ecore.cs (EmptyExpression): New utility class.
27727 (Expression.ImplicitConversionExists): New utility function.
27729 2001-12-06 Miguel de Icaza <miguel@ximian.com>
27731 * statement.cs (Using): Implement.
27733 * expression.cs (LocalVariableReference): Support read only variables.
27735 * statement.cs: Remove the explicit emit for the Leave opcode.
27736 (VariableInfo): Add a readonly field.
27738 2001-12-05 Miguel de Icaza <miguel@ximian.com>
27740 * ecore.cs (ConvCast): new class used to encapsulate the various
27741 explicit integer conversions that works in both checked and
27742 unchecked contexts.
27744 (Expression.ConvertNumericExplicit): Use new ConvCast class to
27745 properly generate the overflow opcodes.
27747 2001-12-04 Miguel de Icaza <miguel@ximian.com>
27749 * statement.cs: The correct type for the EmptyExpression is the
27750 element_type, not the variable type. Ravi pointed this out.
27752 2001-12-04 Ravi Pratap <ravi@ximian.com>
27754 * class.cs (Method::Define): Handle PInvoke methods specially
27755 by using DefinePInvokeMethod instead of the usual one.
27757 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
27758 above to do the task of extracting information and defining the method.
27760 2001-12-04 Ravi Pratap <ravi@ximian.com>
27762 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
27763 of the condition for string type.
27765 (Emit): Move that here.
27767 (ArrayCreation::CheckIndices): Keep string literals in their expression
27770 (EmitDynamicInitializers): Handle strings appropriately.
27772 2001-12-04 Miguel de Icaza <miguel@ximian.com>
27774 * codegen.cs (EmitContext): Replace multiple variables with a
27775 single pointer to the current Switch statement.
27777 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
27780 2001-12-03 Miguel de Icaza <miguel@ximian.com>
27784 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
27787 (Foreach.Emit): Foreach on arrays was not setting
27788 up the loop variables (for break/continue).
27790 (GotoCase): Semi-implented.
27792 2001-12-03 Ravi Pratap <ravi@ximian.com>
27794 * attribute.cs (CheckAttribute): Handle system attributes by using
27795 Attribute.GetAttributes to examine information we need.
27797 (GetValidPlaces): Same here.
27799 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
27801 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
27803 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
27805 (Method::Define): Set appropriate flags if we have a DllImport attribute.
27807 (Method::Emit): Handle the case when we are a PInvoke method.
27809 2001-12-03 Miguel de Icaza <miguel@ximian.com>
27811 * expression.cs: Use ResolveWithSimpleName on compound names.
27813 2001-12-02 Ravi Pratap <ravi@ximian.com>
27815 * constant.cs (EmitConstant): Make sure we resolve the associated expression
27816 before trying to reduce it.
27818 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
27820 * constant.cs (LookupConstantValue): Implement.
27822 (EmitConstant): Use the above in emitting the constant.
27824 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
27825 that are user-defined by doing a LookupConstantValue on them.
27827 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
27830 2001-11-29 Miguel de Icaza <miguel@ximian.com>
27832 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
27834 (BaseAccess.DoResolve): Implement.
27836 (MemberAccess.DoResolve): Split this routine into a
27837 ResolveMemberAccess routine that can be used independently
27839 2001-11-28 Miguel de Icaza <miguel@ximian.com>
27841 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
27842 As that share bits of the implementation. Is returns a boolean,
27843 while As returns the Type that is being probed.
27845 2001-12-01 Ravi Pratap <ravi@ximian.com>
27847 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
27848 instead of a Literal - much easier.
27850 (EnumInTransit): Remove - utterly useless :-)
27852 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
27854 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
27856 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
27857 chain when we have no associated expression.
27859 2001-11-30 Ravi Pratap <ravi@ximian.com>
27861 * constant.cs (Define): Use Location while reporting the errror.
27863 Also emit a warning when 'new' is used and there is no inherited
27866 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
27869 (LookupEnumValue): Implement to lookup an enum member's value and define it
27872 (Populate): Re-write accordingly to use the above routine.
27874 2001-11-27 Miguel de Icaza <miguel@ximian.com>
27876 * expression.cs (This): Fix prototype for DoResolveLValue to
27877 override the base class DoResolveLValue.
27879 * cs-parser.cs: Report errors cs574 and cs575 (destructor
27882 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
27883 (we need to load the address of the field here). This fixes
27886 (FieldExpr.DoResolveLValue): Call the DoResolve
27887 function to initialize the Instance expression.
27889 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
27890 correctly the GetEnumerator operation on a value type.
27892 * cs-parser.jay: Add more simple parsing error catches.
27894 * statement.cs (Switch): Add support for string switches.
27895 Handle null specially.
27897 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
27899 2001-11-28 Ravi Pratap <ravi@ximian.com>
27901 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
27903 (declare_local_constant): New helper function.
27905 * statement.cs (AddConstant): Keep a separate record of constants
27907 (IsConstant): Implement to determine if a variable is a constant.
27909 (GetConstantExpression): Implement.
27911 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
27913 * statement.cs (IsVariableDefined): Re-write.
27915 2001-11-27 Ravi Pratap <ravi@ximian.com>
27917 * class.cs (TypeContainer::FindMembers): Look for constants
27918 in the case when we are looking for MemberTypes.Field
27920 * expression.cs (MemberAccess::DoResolve): Check that in the
27921 case we are a FieldExpr and a Literal, we are not being accessed
27922 by an instance reference.
27924 * cs-parser.jay (local_constant_declaration): Implement.
27926 (declaration_statement): Implement for constant declarations.
27928 2001-11-26 Miguel de Icaza <miguel@ximian.com>
27930 * statement.cs (Switch): Catch double defaults.
27932 (Switch): More work on the switch() statement
27933 implementation. It works for integral values now, need to finish
27937 2001-11-24 Miguel de Icaza <miguel@ximian.com>
27939 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
27940 integer literals into other integer literals. To be used by
27943 2001-11-24 Ravi Pratap <ravi@ximian.com>
27945 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
27948 (EmitDynamicInitializers): Cope with the above since we extract data
27949 directly from ArrayData now.
27951 (ExpectInitializers): Keep track of whether initializers are mandatory
27954 (Bounds): Make it a hashtable to prevent the same dimension being
27955 recorded for every element in that dimension.
27957 (EmitDynamicInitializers): Fix bug which prevented the Set array method
27960 Also fix bug which was causing the indices to be emitted in the reverse
27963 2001-11-24 Miguel de Icaza <miguel@ximian.com>
27965 * expression.cs (ArrayCreation): Implement the bits that Ravi left
27966 unfinished. They do not work, because the underlying code is
27969 2001-11-22 Miguel de Icaza <miguel@ximian.com>
27971 * cs-parser.jay: Remove bogus fixme.
27973 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
27974 on Switch statement.
27976 2001-11-23 Ravi Pratap <ravi@ximian.com>
27978 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
27981 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
27982 parameter. Apparently, any expression is allowed.
27984 (ValidateInitializers): Update accordingly.
27986 (CheckIndices): Fix some tricky bugs thanks to recursion.
27988 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
27989 I was being completely brain-dead.
27991 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
27992 and re-write acordingly.
27994 (DelegateInvocation): Re-write accordingly.
27996 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
27998 (MakeByteBlob): Handle types more correctly.
28000 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
28001 initialization from expressions but it is incomplete because I am a complete
28004 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28006 * statement.cs (If.Emit): Fix a bug that generated incorrect code
28007 on If. Basically, we have to return `true' (ie, we do return to
28008 our caller) only if both branches of the if return.
28010 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
28011 short-circuit operators, handle them as short circuit operators.
28013 (Cast.DoResolve): Resolve type.
28014 (Cast.Cast): Take an expression as the target type.
28016 * cs-parser.jay (cast_expression): Remove old hack that only
28017 allowed a limited set of types to be handled. Now we take a
28018 unary_expression and we resolve to a type during semantic
28021 Use the grammar productions from Rhys to handle casts (this is
28022 not complete like Rhys syntax yet, we fail to handle that corner
28023 case that C# has regarding (-x), but we will get there.
28025 2001-11-22 Ravi Pratap <ravi@ximian.com>
28027 * class.cs (EmitFieldInitializer): Take care of the case when we have a
28028 field which is an array type.
28030 * cs-parser.jay (declare_local_variables): Support array initialization too.
28032 * typemanager.cs (MakeKey): Implement.
28034 (everywhere): Use the above appropriately.
28036 * cs-parser.jay (for_statement): Update for array initialization while
28037 declaring variables.
28039 * ecore.cs : The error message was correct, it's the variable's names that
28040 were misleading ;-) Make the code more readable.
28042 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
28043 the correct type etc.
28045 (ConvertExplicit): Handle Enum types by examining the underlying type.
28047 2001-11-21 Ravi Pratap <ravi@ximian.com>
28049 * parameter.cs (GetCallingConvention): Always return
28050 CallingConventions.Standard for now.
28052 2001-11-22 Miguel de Icaza <miguel@ximian.com>
28054 * expression.cs (Binary.ResolveOperator): Update the values of `l'
28055 and `r' after calling DoNumericPromotions.
28057 * ecore.cs: Fix error message (the types were in the wrong order).
28059 * statement.cs (Foreach.ProbeCollectionType): Need to pass
28060 BindingFlags.Instance as well
28062 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
28063 implicit int literal conversion in an empty cast so that we
28064 propagate the right type upstream.
28066 (UnboxCast): new class used to unbox value types.
28067 (Expression.ConvertExplicit): Add explicit type conversions done
28070 (Expression.ImplicitNumericConversion): Oops, forgot to test for
28071 the target type before applying the implicit LongLiterals to ULong
28074 2001-11-21 Miguel de Icaza <miguel@ximian.com>
28076 * cs-parser.jay (for_statement): Reworked the way For works: now
28077 we declare manually any variables that are introduced in
28078 for_initializer to solve the problem of having out-of-band code
28079 emition (that is what got for broken).
28081 (declaration_statement): Perform the actual variable declaration
28082 that used to be done in local_variable_declaration here.
28084 (local_variable_declaration): Do not declare anything, just pass
28085 the information on a DictionaryEntry
28087 2001-11-20 Ravi Pratap <ravi@ximian.com>
28089 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
28090 re-write of the logic to now make it recursive.
28092 (UpdateIndices): Re-write accordingly.
28094 Store element data in a separate ArrayData list in the above methods.
28096 (MakeByteBlob): Implement to dump the array data into a byte array.
28098 2001-11-19 Ravi Pratap <ravi@ximian.com>
28100 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
28103 * constant.cs (Define): Implement.
28105 (EmitConstant): Re-write fully.
28107 Pass in location info.
28109 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
28112 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
28113 DictionaryEntry since we need location info too.
28115 (constant_declaration): Update accordingly.
28117 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
28118 code into another method : UpdateIndices.
28120 2001-11-18 Ravi Pratap <ravi@ximian.com>
28122 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
28123 some type checking etc.
28125 2001-11-17 Ravi Pratap <ravi@ximian.com>
28127 * expression.cs (ArrayCreation::ValidateInitializers): Implement
28128 bits to provide dimension info if the user skips doing that.
28130 Update second constructor to store the rank correctly.
28132 2001-11-16 Ravi Pratap <ravi@ximian.com>
28134 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
28135 and try to implement.
28137 * ../errors/cs0150.cs : Add.
28139 * ../errors/cs0178.cs : Add.
28141 2001-11-16 Miguel de Icaza <miguel@ximian.com>
28143 * statement.cs: Implement foreach on multi-dimensional arrays.
28145 * parameter.cs (Parameters.GetParameterByName): Also lookup the
28146 name of the params argument.
28148 * expression.cs: Use EmitStoreOpcode to get the right opcode while
28149 initializing the array.
28151 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
28152 we can use this elsewhere.
28154 * statement.cs: Finish implementation of foreach for single
28157 * cs-parser.jay: Use an out-of-band stack to pass information
28158 around, I wonder why I need this.
28160 foreach_block: Make the new foreach_block the current_block.
28162 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
28163 function used to return a static Parameters structure. Used for
28164 empty parameters, as those are created very frequently.
28166 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
28168 2001-11-15 Ravi Pratap <ravi@ximian.com>
28170 * interface.cs : Default modifier is private, not public. The
28171 make verify test passes again.
28173 2001-11-15 Ravi Pratap <ravi@ximian.com>
28175 * support.cs (ReflectionParameters): Fix logic to determine
28176 whether the last parameter is a params one. Test 9 passes again.
28178 * delegate.cs (Populate): Register the builders we define with
28179 RegisterParameterForBuilder. Test 19 passes again.
28181 * cs-parser.jay (property_declaration): Reference $6 instead
28182 of $$ to get at the location.
28184 (indexer_declaration): Similar stuff.
28186 (attribute): Ditto.
28188 * class.cs (Property): Register parameters for the Get and Set methods
28189 if they exist. Test 23 passes again.
28191 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
28192 call to EmitArguments as we are sure there aren't any params arguments.
28193 Test 32 passes again.
28195 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
28196 IndexOutOfRangeException.
28198 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
28199 Test 33 now passes again.
28201 2001-11-15 Miguel de Icaza <miguel@ximian.com>
28203 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
28204 broke a bunch of things. Will have to come up with a better way
28205 of tracking locations.
28207 * statement.cs: Implemented foreach for single dimension arrays.
28209 2001-11-09 Miguel de Icaza <miguel@ximian.com>
28211 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
28212 an error. This removes the lookup from the critical path.
28214 * cs-parser.jay: Removed use of temporary_loc, which is completely
28217 2001-11-14 Miguel de Icaza <miguel@ximian.com>
28219 * support.cs (ReflectionParameters.ParameterModifier): Report
28220 whether the argument is a PARAMS argument or not.
28222 * class.cs: Set the attribute `ParamArrayAttribute' on the
28223 parameter argument.
28225 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
28226 and cons_param_array_attribute (ConstructorInfo for
28227 ParamArrayAttribute).,
28229 * codegen.cs: Emit the return using the `Return' statement, that
28230 way we can report the error correctly for missing return values.
28232 * class.cs (Method.Emit): Clean up.
28234 * expression.cs (Argument.Resolve): Take another argument: the
28235 location where this argument is used. Notice that this is not
28236 part of the "Argument" class as to reduce the size of the
28237 structure (we know the approximate location anyways).
28239 Test if the argument is a variable-reference, if not, then
28240 complain with a 206.
28242 (Argument.Emit): Emit addresses of variables.
28244 (Argument.FullDesc): Simplify.
28246 (Invocation.DoResolve): Update for Argument.Resolve.
28248 (ElementAccess.DoResolve): ditto.
28250 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
28251 method should be virtual, as this method is always virtual.
28253 (NewDelegate.DoResolve): Update for Argument.Resolve.
28255 * class.cs (ConstructorInitializer.DoResolve): ditto.
28257 * attribute.cs (Attribute.Resolve): ditto.
28259 2001-11-13 Miguel de Icaza <miguel@ximian.com>
28261 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
28263 * expression.cs (ParameterReference): Drop IStackStorage and implement
28264 IAssignMethod instead.
28266 (LocalVariableReference): ditto.
28268 * ecore.cs (FieldExpr): Drop IStackStorage and implement
28269 IAssignMethod instead.
28271 2001-11-13 Miguel de Icaza <miguel@ximian.com>
28273 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
28274 enumerations that are used in heavily used structures derive from
28275 byte in a laughable and pathetic attempt to reduce memory usage.
28276 This is the kind of pre-optimzations that you should not do at
28277 home without adult supervision.
28279 * expression.cs (UnaryMutator): New class, used to handle ++ and
28280 -- separatedly from the other unary operators. Cleans up the
28281 code, and kills the ExpressionStatement dependency in Unary.
28283 (Unary): Removed `method' and `Arguments' from this class, making
28284 it smaller, and moving it all to SimpleCall, so I can reuse this
28285 code in other locations and avoid creating a lot of transient data
28286 strucutres when not required.
28288 * cs-parser.jay: Adjust for new changes.
28290 2001-11-11 Miguel de Icaza <miguel@ximian.com>
28292 * enum.cs (Enum.Populate): If there is a failure during
28295 * cs-parser.jay (opt_enum_base): we used to catch type errors
28296 here, but this is really incorrect. The type error should be
28297 catched during semantic analysis.
28299 2001-12-11 Ravi Pratap <ravi@ximian.com>
28301 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
28302 current_local_parameters as expected since I, in my stupidity, had forgotten
28305 * attribute.cs (GetValidPlaces): Fix stupid bug.
28307 * class.cs (Method::Emit): Perform check on applicability of attributes.
28309 (Constructor::Emit): Ditto.
28311 (Field::Emit): Ditto.
28313 (Field.Location): Store location information.
28315 (Property, Event, Indexer, Operator): Ditto.
28317 * cs-parser.jay (field_declaration): Pass in location for each field.
28319 * ../errors/cs0592.cs : Add.
28321 2001-11-12 Ravi Pratap <ravi@ximian.com>
28323 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
28325 (InitCoreTypes): Update accordingly.
28327 (RegisterAttrType, LookupAttr): Implement.
28329 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
28330 info about the same.
28332 (Resolve): Update to populate the above as necessary.
28334 (Error592): Helper.
28336 (GetValidPlaces): Helper to the above.
28338 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
28340 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
28342 2001-11-12 Ravi Pratap <ravi@ximian.com>
28344 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
28346 * ../errors/cs0617.cs : Add.
28348 2001-11-11 Ravi Pratap <ravi@ximian.com>
28350 * enum.cs (Emit): Rename to Populate to be more consistent with what
28351 we expect it to do and when exactly it is called.
28353 * class.cs, rootcontext.cs : Update accordingly.
28355 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
28356 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
28358 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
28360 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
28361 of a fieldinfo using the above, when dealing with a FieldBuilder.
28363 2001-11-10 Ravi Pratap <ravi@ximian.com>
28365 * ../errors/cs0031.cs : Add.
28367 * ../errors/cs1008.cs : Add.
28369 * ../errrors/cs0543.cs : Add.
28371 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
28374 (FindMembers): Implement.
28376 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
28377 enums and delegates too.
28379 (enum_types): Rename to builder_to_enum.
28381 (delegate_types): Rename to builder_to_delegate.
28383 * delegate.cs (FindMembers): Implement.
28385 2001-11-09 Ravi Pratap <ravi@ximian.com>
28387 * typemanager.cs (IsEnumType): Implement.
28389 * enum.cs (Emit): Re-write parts to account for the underlying type
28390 better and perform checking etc.
28392 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
28393 of the underlying type.
28395 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
28398 * enum.cs (error31): Helper to report error #31.
28400 * cs-parser.jay (enum_declaration): Store location of each member too.
28402 * enum.cs (member_to_location): New hashtable.
28404 (AddEnumMember): Update location hashtable.
28406 (Emit): Use the location of each member while reporting errors.
28408 2001-11-09 Miguel de Icaza <miguel@ximian.com>
28410 * cs-parser.jay: A for_initializer if is a
28411 local_variable_declaration really ammount to have an implicit
28412 block with the variable declaration and no initializer for for.
28414 * statement.cs (For.Emit): Cope with null initializers.
28416 This fixes the infinite loop on for initializers.
28418 2001-11-08 Miguel de Icaza <miguel@ximian.com>
28420 * enum.cs: More cleanup.
28422 * ecore.cs: Remove dead code.
28424 * class.cs (Property.Emit): More simplification.
28425 (Event.Emit): ditto.
28427 Reworked to have less levels of indentation.
28429 2001-11-08 Ravi Pratap <ravi@ximian.com>
28431 * class.cs (Property): Emit attributes.
28441 * enum.cs (Emit): Ditto.
28443 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
28446 * class.cs (Field, Event, etc.): Move attribute generation into the
28447 Emit method everywhere.
28449 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
28450 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
28451 as we had no way of defining nested enums !
28453 * rootcontext.cs : Adjust code accordingly.
28455 * typemanager.cs (AddEnumType): To keep track of enum types separately.
28457 2001-11-07 Ravi Pratap <ravi@ximian.com>
28459 * expression.cs (EvalConstantExpression): Move into ecore.cs
28461 * enum.cs (Enum): Rename some members and make them public and readonly
28462 according to our convention.
28464 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
28467 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
28469 (Enum::Emit): Write a simple version for now which doesn't try to compute
28470 expressions. I shall modify this to be more robust in just a while.
28472 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
28474 (TypeContainer::CloseType): Create the Enum types too.
28476 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
28478 * expression.cs (EvalConstantExpression): Get rid of completely.
28480 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
28481 user-defined values and other cases.
28483 (IsValidEnumLiteral): Helper function.
28485 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
28486 out there in the case we had a literal FieldExpr.
28488 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
28490 (Literalize): Revamp a bit to take two arguments.
28492 (EnumLiteral): New class which derives from Literal to wrap enum literals.
28494 2001-11-06 Ravi Pratap <ravi@ximian.com>
28496 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
28498 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
28500 (Resolve): Use the above to ensure we have proper initializers.
28502 2001-11-05 Ravi Pratap <ravi@ximian.com>
28504 * expression.cs (Expression::EvalConstantExpression): New method to
28505 evaluate constant expressions.
28507 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
28509 2001-11-07 Miguel de Icaza <miguel@ximian.com>
28511 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
28514 (Binary.ResolveOperator): Handle operator != (object a, object b)
28515 and operator == (object a, object b);
28517 (Binary.DoNumericPromotions): Indicate whether the numeric
28518 promotion was possible.
28520 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
28523 Made the ArrayAccess implement interface IAssignMethod instead of
28524 IStackStore as the order in which arguments are passed reflects
28527 * assign.cs: Instead of using expr.ExprClass to select the way of
28528 assinging, probe for the IStackStore/IAssignMethod interfaces.
28530 * typemanager.cs: Load InitializeArray definition.
28532 * rootcontext.cs (RootContext.MakeStaticData): Used to define
28533 static data that can be used to initialize arrays.
28535 2001-11-05 Miguel de Icaza <miguel@ximian.com>
28537 * expression.cs: Handle operator== and operator!= for booleans.
28539 (Conditioal.Reduce): Implement reducer for the ?: operator.
28541 (Conditional.Resolve): Implement dead code elimination.
28543 (Binary.Resolve): Catch string literals and return a new
28544 concatenated string.
28546 (Unary.Reduce): Implement reduction of unary expressions.
28548 * ecore.cs: Split out the expression core handling here.
28550 (Expression.Reduce): New method used to perform constant folding
28551 and CSE. This is needed to support constant-expressions.
28553 * statement.cs (Statement.EmitBoolExpression): Pass true and false
28554 targets, and optimize for !x.
28556 2001-11-04 Ravi Pratap <ravi@ximian.com>
28558 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
28559 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
28560 set custom atttributes.
28562 * literal.cs (Literal::GetValue): New abstract method to return the actual
28563 value of the literal, cast as an object.
28565 (*Literal): Implement GetValue method.
28567 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
28568 expressions to the arraylist but objects of type Argument.
28570 * class.cs (TypeContainer::Emit): Emit our attributes too.
28572 (Method::Emit, Constructor::Emit): Ditto.
28574 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
28575 to be ignoring earlier.
28577 2001-11-03 Ravi Pratap <ravi@ximian.com>
28579 * attribute.cs (AttributeSection::Define): Implement to do the business
28580 of constructing a CustomAttributeBuilder.
28582 (Attribute): New trivial class. Increases readability of code.
28584 * cs-parser.jay : Update accordingly.
28586 (positional_argument_list, named_argument_list, named_argument): New rules
28588 (attribute_arguments): Use the above so that we are more correct.
28590 2001-11-02 Ravi Pratap <ravi@ximian.com>
28592 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
28593 to perform all checks for a method with a params parameter.
28595 (Invocation::OverloadResolve): Update to use the above method and therefore
28596 cope correctly with params method invocations.
28598 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
28601 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
28602 constructors in our parent too because we can't afford to miss out on
28605 * attribute.cs (AttributeSection): New name for the class Attribute
28607 Other trivial changes to improve readability.
28609 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
28610 use the new class names.
28612 2001-11-01 Ravi Pratap <ravi@ximian.com>
28614 * class.cs (Method::Define): Complete definition for params types too
28616 (Indexer::Define): Ditto.
28618 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
28619 Cope everywhere with a request for info about the array parameter.
28621 2001-11-01 Ravi Pratap <ravi@ximian.com>
28623 * tree.cs (RecordNamespace): Fix up to check for the correct key.
28625 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
28626 local_variable_type to extract the string corresponding to the type.
28628 (local_variable_type): Fixup the action to use the new helper method.
28630 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
28633 * expression.cs : Clean out code which uses the above.
28635 2001-10-31 Ravi Pratap <ravi@ximian.com>
28637 * typemanager.cs (RegisterMethod): Check if we already have an existing key
28638 and bale out if necessary by returning a false.
28640 (RegisterProperty): Ditto.
28642 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
28643 and print out appropriate error messages.
28645 * interface.cs (everywhere): Ditto.
28647 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
28648 location to constructor.
28650 * class.cs (Property, Event, Indexer): Update accordingly.
28652 * ../errors/cs111.cs : Added.
28654 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
28655 of a method, as laid down by the spec.
28657 (Invocation::OverloadResolve): Use the above method.
28659 2001-10-31 Ravi Pratap <ravi@ximian.com>
28661 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
28662 now take a TypeContainer and a Parameters object.
28664 (ParameterData): Modify return type of ParameterModifier method to be
28665 Parameter.Modifier and not a string.
28667 (ReflectionParameters, InternalParameters): Update accordingly.
28669 * expression.cs (Argument::GetParameterModifier): Same here.
28671 * support.cs (InternalParameters::ParameterType): Find a better way of determining
28672 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
28673 symbol in it at all so maybe this is only for now.
28675 2001-10-30 Ravi Pratap <ravi@ximian.com>
28677 * support.cs (InternalParameters): Constructor now takes an extra argument
28678 which is the actual Parameters class.
28680 (ParameterDesc): Update to provide info on ref/out modifiers.
28682 * class.cs (everywhere): Update call to InternalParameters to pass in
28683 the second argument too.
28685 * support.cs (ParameterData): Add ParameterModifier, which is a method
28686 to return the modifier info [ref/out etc]
28688 (InternalParameters, ReflectionParameters): Implement the above.
28690 * expression.cs (Argument::ParameterModifier): Similar function to return
28691 info about the argument's modifiers.
28693 (Invocation::OverloadResolve): Update to take into account matching modifiers
28696 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
28697 a new SetFormalParameters object which we pass to InternalParameters.
28699 2001-10-30 Ravi Pratap <ravi@ximian.com>
28701 * expression.cs (NewArray): Merge into the ArrayCreation class.
28703 2001-10-29 Ravi Pratap <ravi@ximian.com>
28705 * expression.cs (NewArray): Merge classes NewBuiltinArray and
28706 NewUserdefinedArray into one as there wasn't much of a use in having
28709 * expression.cs (Argument): Change field's name to ArgType from Type.
28711 (Type): New readonly property which returns the proper type, taking into
28712 account ref/out modifiers.
28714 (everywhere): Adjust code accordingly for the above.
28716 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
28717 whether we are emitting for a ref or out parameter.
28719 * expression.cs (Argument::Emit): Use the above field to set the state.
28721 (LocalVariableReference::Emit): Update to honour the flag and emit the
28724 * parameter.cs (Attributes): Set the correct flags for ref parameters.
28726 * expression.cs (Argument::FullDesc): New function to provide a full desc.
28728 * support.cs (ParameterData): Add method ParameterDesc to the interface.
28730 (ReflectionParameters, InternalParameters): Implement the above method.
28732 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
28735 (Invocation::FullMethodDesc): Ditto.
28737 2001-10-29 Miguel de Icaza <miguel@ximian.com>
28739 * cs-parser.jay: Add extra production for the second form of array
28742 * expression.cs (ArrayCreation): Update to reflect the above
28745 * Small changes to prepare for Array initialization.
28747 2001-10-28 Miguel de Icaza <miguel@ximian.com>
28749 * typemanager.cs (ImplementsInterface): interface might be null;
28750 Deal with this problem;
28752 Also, we do store negative hits on the cache (null values), so use
28753 this instead of calling t.GetInterfaces on the type everytime.
28755 2001-10-28 Ravi Pratap <ravi@ximian.com>
28757 * typemanager.cs (IsBuiltinType): New method to help determine the same.
28759 * expression.cs (New::DoResolve): Get rid of array creation code and instead
28760 split functionality out into different classes.
28762 (New::FormArrayType): Move into NewBuiltinArray.
28764 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
28767 (NewBuiltinArray): New class to handle creation of built-in arrays.
28769 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
28770 account creation of one-dimensional arrays.
28772 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
28774 (NewUserdefinedArray::DoResolve): Implement.
28776 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
28778 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
28779 we maintain inside the TypeManager. This is necessary to perform lookups on the
28782 (LookupType): Update to perform GetType on the module builders too.
28784 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
28786 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
28788 2001-10-23 Ravi Pratap <ravi@ximian.com>
28790 * expression.cs (New::DoResolve): Implement guts of array creation.
28792 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
28794 2001-10-27 Miguel de Icaza <miguel@ximian.com>
28796 * expression.cs: Fix bug I introduced lsat night that broke
28799 (Expression.Resolve): Report a 246 error (can not resolve name)
28800 if we find a SimpleName in the stream.
28802 (Expression.ResolveLValue): Ditto.
28804 (Expression.ResolveWithSimpleName): This function is a variant of
28805 ResolveName, this one allows SimpleNames to be returned without a
28806 warning. The only consumer of SimpleNames is MemberAccess
28808 2001-10-26 Miguel de Icaza <miguel@ximian.com>
28810 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
28811 might arrive here. I have my doubts that this is correct.
28813 * statement.cs (Lock): Implement lock statement.
28815 * cs-parser.jay: Small fixes to support `lock' and `using'
28817 * cs-tokenizer.cs: Remove extra space
28819 * driver.cs: New flag --checked, allows to turn on integer math
28822 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
28823 Threading.Monitor.Exit
28825 2001-10-23 Miguel de Icaza <miguel@ximian.com>
28827 * expression.cs (IndexerAccess::DoResolveLValue): Set the
28828 Expression Class to be IndexerAccess.
28830 Notice that Indexer::DoResolve sets the eclass to Value.
28832 2001-10-22 Miguel de Icaza <miguel@ximian.com>
28834 * class.cs (TypeContainer::Emit): Emit code for indexers.
28836 * assign.cs (IAssignMethod): New interface implemented by Indexers
28837 and Properties for handling assignment.
28839 (Assign::Emit): Simplify and reuse code.
28841 * expression.cs (IndexerAccess, PropertyExpr): Implement
28842 IAssignMethod, clean up old code.
28844 2001-10-22 Ravi Pratap <ravi@ximian.com>
28846 * typemanager.cs (ImplementsInterface): New method to determine if a type
28847 implements a given interface. Provides a nice cache too.
28849 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
28852 (ConvertReferenceExplicit): Ditto.
28854 * delegate.cs (Delegate::Populate): Update to define the parameters on the
28855 various methods, with correct names etc.
28857 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
28858 Operator.UnaryNegation.
28860 * cs-parser.jay (operator_declarator): Be a little clever in the case where
28861 we have a unary plus or minus operator.
28863 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
28866 * everywhere : update accordingly.
28868 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
28871 * class.cs (Method::Define): For the case where we are implementing a method
28872 inherited from an interface, we need to set the MethodAttributes.Final flag too.
28873 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
28875 2001-10-21 Ravi Pratap <ravi@ximian.com>
28877 * interface.cs (FindMembers): Implement to work around S.R.E
28880 * typemanager.cs (IsInterfaceType): Implement.
28882 (FindMembers): Update to handle interface types too.
28884 * expression.cs (ImplicitReferenceConversion): Re-write bits which
28885 use IsAssignableFrom as that is not correct - it doesn't work.
28887 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
28888 and accordingly override EmitStatement.
28890 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
28891 using the correct logic :-)
28893 2001-10-19 Ravi Pratap <ravi@ximian.com>
28895 * ../errors/cs-11.cs : Add to demonstrate error -11
28897 2001-10-17 Miguel de Icaza <miguel@ximian.com>
28899 * assign.cs (Assign::Resolve): Resolve right hand side first, and
28900 then pass this as a hint to ResolveLValue.
28902 * expression.cs (FieldExpr): Add Location information
28904 (FieldExpr::LValueResolve): Report assignment to readonly
28907 (Expression::ExprClassFromMemberInfo): Pass location information.
28909 (Expression::ResolveLValue): Add new method that resolves an
28912 (Expression::DoResolveLValue): Default invocation calls
28915 (Indexers): New class used to keep track of indexers in a given
28918 (IStackStore): Renamed from LValue, as it did not really describe
28919 what this did. Also ResolveLValue is gone from this interface and
28920 now is part of Expression.
28922 (ElementAccess): Depending on the element access type
28924 * typemanager.cs: Add `indexer_name_type' as a Core type
28925 (System.Runtime.CompilerServices.IndexerNameAttribute)
28927 * statement.cs (Goto): Take a location.
28929 2001-10-18 Ravi Pratap <ravi@ximian.com>
28931 * delegate.cs (Delegate::VerifyDelegate): New method to verify
28932 if two delegates are compatible.
28934 (NewDelegate::DoResolve): Update to take care of the case when
28935 we instantiate a delegate from another delegate.
28937 * typemanager.cs (FindMembers): Don't even try to look up members
28938 of Delegate types for now.
28940 2001-10-18 Ravi Pratap <ravi@ximian.com>
28942 * delegate.cs (NewDelegate): New class to take care of delegate
28945 * expression.cs (New): Split the delegate related code out into
28946 the NewDelegate class.
28948 * delegate.cs (DelegateInvocation): New class to handle delegate
28951 * expression.cs (Invocation): Split out delegate related code into
28952 the DelegateInvocation class.
28954 2001-10-17 Ravi Pratap <ravi@ximian.com>
28956 * expression.cs (New::DoResolve): Implement delegate creation fully
28957 and according to the spec.
28959 (New::DoEmit): Update to handle delegates differently.
28961 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
28962 because of which we were printing out arguments in reverse order !
28964 * delegate.cs (VerifyMethod): Implement to check if the given method
28965 matches the delegate.
28967 (FullDelegateDesc): Implement.
28969 (VerifyApplicability): Implement.
28971 * expression.cs (Invocation::DoResolve): Update to accordingly handle
28972 delegate invocations too.
28974 (Invocation::Emit): Ditto.
28976 * ../errors/cs1593.cs : Added.
28978 * ../errors/cs1594.cs : Added.
28980 * delegate.cs (InstanceExpression, TargetMethod): New properties.
28982 2001-10-16 Ravi Pratap <ravi@ximian.com>
28984 * typemanager.cs (intptr_type): Core type for System.IntPtr
28986 (InitCoreTypes): Update for the same.
28988 (iasyncresult_type, asynccallback_type): Ditto.
28990 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
28993 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
28996 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
28997 the builders for the 4 members of a delegate type :-)
28999 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
29002 * expression.cs (New::DoResolve): Implement guts for delegate creation.
29004 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
29006 2001-10-15 Miguel de Icaza <miguel@ximian.com>
29008 * statement.cs (Break::Emit): Implement.
29009 (Continue::Emit): Implement.
29011 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
29012 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
29013 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
29014 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
29017 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
29018 properties that track the label for the current loop (begin of the
29019 loop and end of the loop).
29021 2001-10-15 Ravi Pratap <ravi@ximian.com>
29023 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
29024 use of emitting anything at all.
29026 * class.cs, rootcontext.cs : Get rid of calls to the same.
29028 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
29030 (Populate): Define the constructor correctly and set the implementation
29033 * typemanager.cs (delegate_types): New hashtable to hold delegates that
29036 (AddDelegateType): Implement.
29038 (IsDelegateType): Implement helper method.
29040 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
29042 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
29043 and accordingly handle it.
29045 * delegate.cs (Populate): Take TypeContainer argument.
29046 Implement bits to define the Invoke method. However, I still haven't figured out
29047 how to take care of the native int bit :-(
29049 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
29050 Qualify the name of the delegate, not its return type !
29052 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
29055 (StandardConversionExists): Checking for array types turns out to be recursive.
29057 (ConvertReferenceExplicit): Implement array conversion.
29059 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
29061 2001-10-12 Ravi Pratap <ravi@ximian.com>
29063 * cs-parser.jay (delegate_declaration): Store the fully qualified
29064 name as it is a type declaration.
29066 * delegate.cs (ReturnType, Name): Rename members to these. Make them
29069 (DefineDelegate): Renamed from Define. Does the same thing essentially,
29070 as TypeContainer::DefineType.
29072 (Populate): Method in which all the definition of the various methods (Invoke)
29075 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
29078 (CloseDelegate): Finally creates the delegate.
29080 * class.cs (TypeContainer::DefineType): Update to define delegates.
29081 (Populate, Emit and CloseType): Do the same thing here too.
29083 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
29084 delegates in all these operations.
29086 2001-10-14 Miguel de Icaza <miguel@ximian.com>
29088 * expression.cs: LocalTemporary: a new expression used to
29089 reference a temporary that has been created.
29091 * assign.cs: Handle PropertyAccess back here, so that we can
29092 provide the proper semantic access to properties.
29094 * expression.cs (Expression::ConvertReferenceExplicit): Implement
29095 a few more explicit conversions.
29097 * modifiers.cs: `NEW' modifier maps to HideBySig.
29099 * expression.cs (PropertyExpr): Make this into an
29100 ExpressionStatement, and support the EmitStatement code path.
29102 Perform get/set error checking, clean up the interface.
29104 * assign.cs: recognize PropertyExprs as targets, and if so, turn
29105 them into toplevel access objects.
29107 2001-10-12 Miguel de Icaza <miguel@ximian.com>
29109 * expression.cs: PropertyExpr::PropertyExpr: use work around the
29112 * typemanager.cs: Keep track here of our PropertyBuilders again to
29113 work around lameness in SRE.
29115 2001-10-11 Miguel de Icaza <miguel@ximian.com>
29117 * expression.cs (LValue::LValueResolve): New method in the
29118 interface, used to perform a second resolution pass for LValues.
29120 (This::DoResolve): Catch the use of this in static methods.
29122 (This::LValueResolve): Implement.
29124 (This::Store): Remove warning, assigning to `this' in structures
29127 (Invocation::Emit): Deal with invocation of
29128 methods on value types. We need to pass the address to structure
29129 methods rather than the object itself. (The equivalent code to
29130 emit "this" for structures leaves the entire structure on the
29131 stack instead of a pointer to it).
29133 (ParameterReference::DoResolve): Compute the real index for the
29134 argument based on whether the method takes or not a `this' pointer
29135 (ie, the method is static).
29137 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
29138 value types returned from functions when we need to invoke a
29139 method on the sturcture.
29142 2001-10-11 Ravi Pratap <ravi@ximian.com>
29144 * class.cs (TypeContainer::DefineType): Method to actually do the business of
29145 defining the type in the Modulebuilder or Typebuilder. This is to take
29146 care of nested types which need to be defined on the TypeBuilder using
29147 DefineNestedMethod.
29149 (TypeContainer::GetClassBases): Implement. Essentially the code from the
29150 methods in RootContext, only ported to be part of TypeContainer.
29152 (TypeContainer::GetInterfaceOrClass): Ditto.
29154 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
29156 * interface.cs (Interface::DefineInterface): New method. Does exactly
29157 what RootContext.CreateInterface did earlier, only it takes care of nested types
29160 (Interface::GetInterfaces): Move from RootContext here and port.
29162 (Interface::GetInterfaceByName): Same here.
29164 * rootcontext.cs (ResolveTree): Re-write.
29166 (PopulateTypes): Re-write.
29168 * class.cs (TypeContainer::Populate): Populate nested types too.
29169 (TypeContainer::Emit): Emit nested members too.
29171 * typemanager.cs (AddUserType): Do not make use of the FullName property,
29172 instead just use the name argument passed in as it is already fully
29175 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
29176 to TypeContainer mapping to see if a type is user-defined.
29178 * class.cs (TypeContainer::CloseType): Implement.
29180 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
29181 the default constructor.
29183 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
29186 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
29188 * interface.cs (CloseType): Create the type here.
29190 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
29193 Remove all the methods which are now in TypeContainer.
29195 2001-10-10 Ravi Pratap <ravi@ximian.com>
29197 * delegate.cs (Define): Re-write bits to define the delegate
29200 2001-10-10 Miguel de Icaza <miguel@ximian.com>
29202 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
29204 * expression.cs (ImplicitReferenceConversion): handle null as well
29205 as a source to convert to any reference type.
29207 * statement.cs (Return): Perform any implicit conversions to
29208 expected return type.
29210 Validate use of return statement.
29212 * codegen.cs (EmitContext): Pass the expected return type here.
29214 * class.cs (Method, Constructor, Property): Pass expected return
29215 type to EmitContext.
29217 2001-10-09 Miguel de Icaza <miguel@ximian.com>
29219 * expression.cs: Make DoResolve take an EmitContext instead of a
29222 Replaced `l' and `location' for `loc', for consistency.
29224 (Error, Warning): Remove unneeded Tc argument.
29226 * assign.cs, literal.cs, constant.cs: Update to new calling
29229 * codegen.cs: EmitContext now contains a flag indicating whether
29230 code is being generated in a static method or not.
29232 * cs-parser.jay: DecomposeQI, new function that replaces the old
29233 QualifiedIdentifier. Now we always decompose the assembled
29234 strings from qualified_identifier productions into a group of
29237 2001-10-08 Miguel de Icaza <miguel@ximian.com>
29239 * rootcontext.cs: Deal with field-less struct types correctly now
29240 by passing the size option to Define Type.
29242 * class.cs: Removed hack that created one static field.
29244 2001-10-07 Miguel de Icaza <miguel@ximian.com>
29246 * statement.cs: Moved most of the code generation here.
29248 2001-10-09 Ravi Pratap <ravi@ximian.com>
29250 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
29253 (ElementAccess): Remove useless bits for now - keep checks as the spec
29256 2001-10-08 Ravi Pratap <ravi@ximian.com>
29258 * expression.cs (ElementAccess::DoResolve): Remove my crap code
29259 and start performing checks according to the spec.
29261 2001-10-07 Ravi Pratap <ravi@ximian.com>
29263 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
29264 rank_specifiers instead.
29266 (rank_specifiers): Change the order in which the rank specifiers are stored
29268 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
29270 * expression.cs (ElementAccess): Implement the LValue interface too.
29272 2001-10-06 Ravi Pratap <ravi@ximian.com>
29274 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
29275 except that user defined conversions are not included.
29277 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
29278 perform the conversion of the return type, if necessary.
29280 (New::DoResolve): Check whether we are creating an array or an object
29281 and accordingly do the needful.
29283 (New::Emit): Same here.
29285 (New::DoResolve): Implement guts of array creation.
29287 (New::FormLookupType): Helper function.
29289 2001-10-07 Miguel de Icaza <miguel@ximian.com>
29291 * codegen.cs: Removed most of the code generation here, and move the
29292 corresponding code generation bits to the statement classes.
29294 Added support for try/catch/finalize and throw.
29296 * cs-parser.jay: Added support for try/catch/finalize.
29298 * class.cs: Catch static methods having the flags override,
29299 virtual or abstract.
29301 * expression.cs (UserCast): This user cast was not really doing
29302 what it was supposed to do. Which is to be born in fully resolved
29303 state. Parts of the resolution were being performed at Emit time!
29307 2001-10-05 Miguel de Icaza <miguel@ximian.com>
29309 * expression.cs: Implicity convert the result from UserCast.
29311 2001-10-05 Ravi Pratap <ravi@ximian.com>
29313 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
29314 prevented it from working correctly.
29316 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
29317 merely ConvertImplicit.
29319 2001-10-05 Miguel de Icaza <miguel@ximian.com>
29321 * typemanager.cs: Make the LookupTypeContainer function static,
29322 and not per-instance.
29324 * class.cs: Make static FindMembers (the one that takes a Type
29327 * codegen.cs: Add EmitForeach here.
29329 * cs-parser.jay: Make foreach a toplevel object instead of the
29330 inline expansion, as we need to perform semantic analysis on it.
29332 2001-10-05 Ravi Pratap <ravi@ximian.com>
29334 * expression.cs (Expression::ImplicitUserConversion): Rename to
29335 UserDefinedConversion.
29337 (Expression::UserDefinedConversion): Take an extra argument specifying
29338 whether we look for explicit user conversions too.
29340 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
29342 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
29344 (ExplicitUserConversion): Make it a call to UserDefinedConversion
29345 with the appropriate arguments.
29347 * cs-parser.jay (cast_expression): Record location too.
29349 * expression.cs (Cast): Record location info.
29351 (Expression::ConvertExplicit): Take location argument.
29353 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
29354 to determine if we are doing explicit conversions.
29356 (UserCast::Emit): Update accordingly.
29358 (Expression::ConvertExplicit): Report an error if everything fails.
29360 * ../errors/cs0030.cs : Add.
29362 2001-10-04 Miguel de Icaza <miguel@ximian.com>
29364 * modifiers.cs: If the ABSTRACT keyword is present, also set the
29365 virtual and newslot bits.
29367 * class.cs (TypeContainer::RegisterRequiredImplementations):
29368 Record methods we need.
29370 (TypeContainer::MakeKey): Helper function to make keys for
29371 MethodBases, since the Methodbase key is useless.
29373 (TypeContainer::Populate): Call RegisterRequiredImplementations
29374 before defining the methods.
29376 Create a mapping for method_builders_to_methods ahead of time
29377 instead of inside a tight loop.
29379 (::RequireMethods): Accept an object as the data to set into the
29380 hashtable so we can report interface vs abstract method mismatch.
29382 2001-10-03 Miguel de Icaza <miguel@ximian.com>
29384 * report.cs: Make all of it static.
29386 * rootcontext.cs: Drop object_type and value_type computations, as
29387 we have those in the TypeManager anyways.
29389 Drop report instance variable too, now it is a global.
29391 * driver.cs: Use try/catch on command line handling.
29393 Add --probe option to debug the error reporting system with a test
29396 * report.cs: Add support for exiting program when a probe
29397 condition is reached.
29399 2001-10-03 Ravi Pratap <ravi@ximian.com>
29401 * expression.cs (Binary::DoNumericPromotions): Fix the case when
29402 we do a forcible conversion regardless of type, to check if
29403 ForceConversion returns a null.
29405 (Binary::error19): Use location to report error.
29407 (Unary::error23): Use location here too.
29409 * ../errors/cs0019.cs : Check in.
29411 * ../errors/cs0023.cs : Check in.
29413 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
29414 case of a non-null MethodInfo object with a length of 0 !
29416 (Binary::ResolveOperator): Flag error if overload resolution fails to find
29417 an applicable member - according to the spec :-)
29418 Also fix logic to find members in base types.
29420 (Unary::ResolveOperator): Same here.
29422 (Unary::report23): Change name to error23 and make first argument a TypeContainer
29423 as I was getting thoroughly confused between this and error19 :-)
29425 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
29426 (::FindMostEncompassedType): Implement.
29427 (::FindMostEncompassingType): Implement.
29428 (::StandardConversionExists): Implement.
29430 (UserImplicitCast): Re-vamp. We now need info about most specific
29431 source and target types so that we can do the necessary conversions.
29433 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
29434 mathematical union with no duplicates.
29436 2001-10-03 Miguel de Icaza <miguel@ximian.com>
29438 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
29439 in order from base classes to child classes, so that we can in
29440 child classes look up in our parent for method names and
29441 attributes (required for handling abstract, virtual, new, override
29442 constructs: we need to instrospect our base class, and if we dont
29443 populate the classes in order, the introspection might be
29444 incorrect. For example, a method could query its parent before
29445 the parent has any methods and would determine that the parent has
29446 no abstract methods (while it could have had them)).
29448 (RootContext::CreateType): Record the order in which we define the
29451 2001-10-02 Miguel de Icaza <miguel@ximian.com>
29453 * class.cs (TypeContainer::Populate): Also method definitions can
29454 fail now, keep track of this.
29456 (TypeContainer::FindMembers): Implement support for
29457 DeclaredOnly/noDeclaredOnly flag.
29459 (Constructor::Emit) Return the ConstructorBuilder.
29461 (Method::Emit) Return the MethodBuilder.
29462 Check for abstract or virtual methods to be public.
29464 * rootcontext.cs (RootContext::CreateType): Register all the
29465 abstract methods required for the class to be complete and the
29466 interface methods that must be implemented.
29468 * cs-parser.jay: Report error 501 (method requires body if it is
29469 not marked abstract or extern).
29471 * expression.cs (TypeOf::Emit): Implement.
29473 * typemanager.cs: runtime_handle_type, new global type.
29475 * class.cs (Property::Emit): Generate code for properties.
29477 2001-10-02 Ravi Pratap <ravi@ximian.com>
29479 * expression.cs (Unary::ResolveOperator): Find operators on base type
29480 too - we now conform exactly to the spec.
29482 (Binary::ResolveOperator): Same here.
29484 * class.cs (Operator::Define): Fix minor quirk in the tests.
29486 * ../errors/cs0215.cs : Added.
29488 * ../errors/cs0556.cs : Added.
29490 * ../errors/cs0555.cs : Added.
29492 2001-10-01 Miguel de Icaza <miguel@ximian.com>
29494 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
29495 single integer which is really efficient
29497 2001-10-01 Ravi Pratap <ravi@ximian.com>
29499 * expression.cs (Expression::ImplicitUserConversion): Use location
29500 even in the case when we are examining True operators.
29502 * class.cs (Operator::Define): Perform extensive checks to conform
29503 with the rules for operator overloading in the spec.
29505 * expression.cs (Expression::ImplicitReferenceConversion): Implement
29506 some of the other conversions mentioned in the spec.
29508 * typemanager.cs (array_type): New static member for the System.Array built-in
29511 (cloneable_interface): For System.ICloneable interface.
29513 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
29514 we start resolving the tree and populating types.
29516 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
29518 2001-10-01 Miguel de Icaza <miguel@ximian.com>
29520 * expression.cs (Expression::ExprClassFromMemberInfo,
29521 Expression::Literalize): Create literal expressions from
29522 FieldInfos which are literals.
29524 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
29525 type casts, because they were wrong. The test suite in tests
29528 (ImplicitNumericConversion): ushort to ulong requires a widening
29531 Int32 constant to long requires widening cast as well.
29533 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
29534 for integers because the type on the stack is not i4.
29536 2001-09-30 Miguel de Icaza <miguel@ximian.com>
29538 * expression.cs (report118): require location argument.
29540 * parameter.cs: Do not dereference potential null value.
29542 * class.cs: Catch methods that lack the `new' keyword when
29543 overriding a name. Report warnings when `new' is used without
29544 anything being there to override.
29546 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
29548 * class.cs: Only add constructor to hashtable if it is non-null
29549 (as now constructors can fail on define).
29551 (TypeManager, Class, Struct): Take location arguments.
29553 Catch field instance initialization in structs as errors.
29555 accepting_filter: a new filter for FindMembers that is static so
29556 that we dont create an instance per invocation.
29558 (Constructor::Define): Catch errors where a struct constructor is
29561 * cs-parser.jay: Pass location information for various new
29564 * delegate.cs (Delegate): take a location argument.
29566 * driver.cs: Do not call EmitCode if there were problesm in the
29567 Definition of the types, as many Builders wont be there.
29569 * decl.cs (Decl::Decl): Require a location argument.
29571 * cs-tokenizer.cs: Handle properly hex constants that can not fit
29572 into integers, and find the most appropiate integer for it.
29574 * literal.cs: Implement ULongLiteral.
29576 * rootcontext.cs: Provide better information about the location of
29577 failure when CreateType fails.
29579 2001-09-29 Miguel de Icaza <miguel@ximian.com>
29581 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
29584 * expression.cs (Binary::CheckShiftArguments): Add missing type
29586 (Binary::ResolveOperator): Add type to the logical and and logical
29587 or, Bitwise And/Or and Exclusive Or code paths, it was missing
29590 (Binary::DoNumericPromotions): In the case where either argument
29591 is ulong (and most signed types combined with ulong cause an
29592 error) perform implicit integer constant conversions as well.
29594 2001-09-28 Miguel de Icaza <miguel@ximian.com>
29596 * expression.cs (UserImplicitCast): Method should always be
29598 (Invocation::BetterConversion): Simplified test for IntLiteral.
29600 (Expression::ImplicitNumericConversion): Split this routine out.
29601 Put the code that performs implicit constant integer conversions
29604 (Expression::Resolve): Become a wrapper around DoResolve so we can
29605 check eclass and type being set after resolve.
29607 (Invocation::Badness): Remove this dead function
29609 (Binary::ResolveOperator): Do not compute the expensive argumnets
29610 unless we have a union for it.
29612 (Probe::Emit): Is needs to do an isinst and then
29613 compare against null.
29615 (::CanConvert): Added Location argument. If the Location argument
29616 is null (Location.Null), then we do not report errors. This is
29617 used by the `probe' mechanism of the Explicit conversion. We do
29618 not want to generate an error for something that the user
29619 explicitly requested to be casted. But the pipeline for an
29620 explicit cast first tests for potential implicit casts.
29622 So for now, if the Location is null, it means `Probe only' to
29623 avoid adding another argument. Might have to revise this
29626 (ClassCast): New class used to type cast objects into arbitrary
29627 classes (used in Explicit Reference Conversions).
29629 Implement `as' as well.
29631 Reverted all the patches from Ravi below: they were broken:
29633 * The use of `level' as a mechanism to stop recursive
29634 invocations is wrong. That was there just to catch the
29635 bug with a strack trace but not as a way of addressing
29638 To fix the problem we have to *understand* what is going
29639 on and the interactions and come up with a plan, not
29640 just get things going.
29642 * The use of the type conversion cache that I proposed
29643 last night had an open topic: How does this work across
29644 protection domains. A user defined conversion might not
29645 be public in the location where we are applying the
29646 conversion, a different conversion might be selected
29647 (ie, private A->B (better) but public B->A (worse),
29648 inside A, A->B applies, but outside it, B->A will
29651 * On top of that (ie, even if the above is solved),
29652 conversions in a cache need to be abstract. Ie, `To
29653 convert from an Int to a Short use an OpcodeCast', not
29654 `To convert from an Int to a Short use the OpcodeCast on
29655 the variable 5' (which is what this patch was doing).
29657 2001-09-28 Ravi Pratap <ravi@ximian.com>
29659 * expression.cs (Invocation::ConversionExists): Re-write to use
29660 the conversion cache
29662 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
29663 cache all conversions done, not just user-defined ones.
29665 (Invocation::BetterConversion): The real culprit. Use ConversionExists
29666 to determine if a conversion exists instead of acutually trying to
29667 perform the conversion. It's faster too.
29669 (Expression::ConvertExplicit): Modify to use ConversionExists to check
29670 and only then attempt the implicit conversion.
29672 2001-09-28 Ravi Pratap <ravi@ximian.com>
29674 * expression.cs (ConvertImplicit): Use a cache for conversions
29675 already found. Check level of recursion and bail out if necessary.
29677 2001-09-28 Miguel de Icaza <miguel@ximian.com>
29679 * typemanager.cs (string_concat_string_string, string_concat_object_object):
29680 Export standard methods that we expect for string operations.
29682 * statement.cs (Block::UsageWarning): Track usage of variables and
29683 report the errors for not used variables.
29685 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
29688 2001-09-27 Miguel de Icaza <miguel@ximian.com>
29690 * codegen.cs: remove unnneded code
29692 * expression.cs: Removed BuiltinTypeAccess class
29694 Fix the order in which implicit conversions are
29697 The previous fixed dropped support for boxed conversions (adding a
29698 test to the test suite now)
29700 (UserImplicitCast::CanConvert): Remove test for source being null,
29701 that code is broken. We should not feed a null to begin with, if
29702 we do, then we should track the bug where the problem originates
29703 and not try to cover it up here.
29705 Return a resolved expression of type UserImplicitCast on success
29706 rather than true/false. Ravi: this is what I was talking about,
29707 the pattern is to use a static method as a "constructor" for
29710 Also, do not create arguments until the very last minute,
29711 otherwise we always create the arguments even for lookups that
29712 will never be performed.
29714 (UserImplicitCast::Resolve): Eliminate, objects of type
29715 UserImplicitCast are born in a fully resolved state.
29717 * typemanager.cs (InitCoreTypes): Init also value_type
29718 (System.ValueType).
29720 * expression.cs (Cast::Resolve): First resolve the child expression.
29722 (LValue): Add new method AddressOf to be used by
29725 Change the argument of Store to take an EmitContext instead of an
29726 ILGenerator, because things like FieldExpr need to be able to call
29727 their children expression to generate the instance code.
29729 (Expression::Error, Expression::Warning): Sugar functions for
29732 (Expression::MemberLookup): Accept a TypeContainer instead of a
29733 Report as the first argument.
29735 (Expression::ResolvePrimary): Killed. I still want to improve
29736 this as currently the code is just not right.
29738 (Expression::ResolveMemberAccess): Simplify, but it is still
29741 (Unary::Resolve): Catch errors in AddressOf operators.
29743 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
29744 index to a byte for the short-version, or the compiler will choose
29745 the wrong Emit call, which generates the wrong data.
29747 (ParameterReference::Emit, ::Store): same.
29749 (FieldExpr::AddressOf): Implement.
29751 * typemanager.cs: TypeManager: made public variable instead of
29754 * driver.cs: document --fatal.
29756 * report.cs (ErrorMessage, WarningMessage): new names for the old
29757 Error and Warning classes.
29759 * cs-parser.jay (member_access): Turn built-in access to types
29760 into a normal simplename
29762 2001-09-27 Ravi Pratap <ravi@ximian.com>
29764 * expression.cs (Invocation::BetterConversion): Fix to cope
29765 with q being null, since this was introducing a bug.
29767 * expression.cs (ConvertImplicit): Do built-in conversions first.
29769 2001-09-27 Ravi Pratap <ravi@ximian.com>
29771 * expression.cs (UserImplicitCast::Resolve): Fix bug.
29773 2001-09-27 Ravi Pratap <ravi@ximian.com>
29775 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
29776 I had introduced long ago (what's new ?).
29778 * expression.cs (UserImplicitCast::CanConvert): Static method to do
29779 the work of all the checking.
29780 (ConvertImplicit): Call CanConvert and only then create object if necessary.
29781 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
29783 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
29784 that is the right way.
29786 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
29787 overloading resolution. Use everywhere instead of cutting and pasting code.
29789 (Binary::ResolveOperator): Use MakeUnionSet.
29791 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
29792 we have to convert to bool types. Not complete yet.
29794 2001-09-27 Miguel de Icaza <miguel@ximian.com>
29796 * typemanager.cs (TypeManager::CSharpName): support ushort.
29798 * expression.cs (Expression::TryImplicitIntConversion): Attempts
29799 to provide an expression that performsn an implicit constant int
29800 conversion (section 6.1.6).
29801 (Expression::ConvertImplicitRequired): Reworked to include
29802 implicit constant expression conversions.
29804 (Expression::ConvertNumericExplicit): Finished.
29806 (Invocation::Emit): If InstanceExpression is null, then it means
29807 that we perform a call on this.
29809 2001-09-26 Miguel de Icaza <miguel@ximian.com>
29811 * expression.cs (Unary::Emit): Remove some dead code.
29812 (Probe): Implement Resolve and Emit for `is'.
29813 (Expression::ConvertImplicitRequired): Attempt to do constant
29814 expression conversions here. Maybe should be moved to
29815 ConvertImplicit, but I am not sure.
29816 (Expression::ImplicitLongConstantConversionPossible,
29817 Expression::ImplicitIntConstantConversionPossible): New functions
29818 that tell whether is it possible to apply an implicit constant
29819 expression conversion.
29821 (ConvertNumericExplicit): Started work on explicit numeric
29824 * cs-parser.jay: Update operator constants.
29826 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
29827 (Parameters::GetSignature): Hook up VerifyArgs here.
29828 (Parameters::VerifyArgs): Verifies that no two arguments have the
29831 * class.cs (Operator): Update the operator names to reflect the
29832 ones that the spec expects (as we are just stringizing the
29835 * expression.cs (Unary::ResolveOperator): Fix bug: Use
29836 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
29837 previous usage did only work for our methods.
29838 (Expression::ConvertImplicit): Handle decimal implicit numeric
29839 conversions as well.
29840 (Expression::InternalTypeConstructor): Used to invoke constructors
29841 on internal types for default promotions.
29843 (Unary::Emit): Implement special handling for the pre/post
29844 increment/decrement for overloaded operators, as they need to have
29845 the same semantics as the other operators.
29847 (Binary::ResolveOperator): ditto.
29848 (Invocation::ConversionExists): ditto.
29849 (UserImplicitCast::Resolve): ditto.
29851 2001-09-26 Ravi Pratap <ravi@ximian.com>
29853 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
29854 operator, return after emitting body. Regression tests pass again !
29856 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
29857 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
29858 (Invocation::OverloadResolve): Ditto.
29859 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
29861 * everywhere : update calls to the above methods accordingly.
29863 2001-09-26 Miguel de Icaza <miguel@ximian.com>
29865 * assign.cs (Assign): Make it inherit from ExpressionStatement.
29867 * expression.cs (ExpressionStatement): New base class used for
29868 expressions that can appear in statements, so that we can provide
29869 an alternate path to generate expression that do not leave a value
29872 (Expression::Emit, and all the derivatives): We no longer return
29873 whether a value is left on the stack or not. Every expression
29874 after being emitted leaves a single value on the stack.
29876 * codegen.cs (EmitContext::EmitStatementExpression): Use the
29877 facilties of ExpressionStatement if possible.
29879 * cs-parser.jay: Update statement_expression.
29881 2001-09-25 Miguel de Icaza <miguel@ximian.com>
29883 * driver.cs: Change the wording of message
29885 2001-09-25 Ravi Pratap <ravi@ximian.com>
29887 * expression.cs (Binary::ResolveOperator): Had forgottten to set
29888 the type of the expression to the return type of the method if
29889 we have an overloaded operator match ! The regression tests pass again !
29890 (Unary::ResolveOperator): Ditto.
29892 * expression.cs (Invocation::ConversionExists): Correct the member lookup
29893 to find "op_Implicit", not "implicit" ;-)
29894 (UserImplicitCast): New class to take care of user-defined implicit conversions.
29895 (ConvertImplicit, ForceConversion): Take TypeContainer argument
29897 * everywhere : Correct calls to the above accordingly.
29899 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
29900 (ConvertImplicit): Do user-defined conversion if it exists.
29902 2001-09-24 Miguel de Icaza <miguel@ximian.com>
29904 * assign.cs: track location.
29905 (Resolve): Use implicit conversions on assignment.
29907 * literal.cs: Oops. Not good, Emit of short access values should
29908 pass (Bytes) or the wrong argument will be selected.
29910 * expression.cs (Unary::Emit): Emit code for -expr.
29912 (Unary::ResolveOperator): Handle `Substract' for non-constants
29913 (substract from zero from the non-constants).
29914 Deal with Doubles as well.
29916 (Expression::ConvertImplicitRequired): New routine that reports an
29917 error if no implicit conversion exists.
29919 (Invocation::OverloadResolve): Store the converted implicit
29920 expressions if we make them
29922 2001-09-24 Ravi Pratap <ravi@ximian.com>
29924 * class.cs (ConstructorInitializer): Take a Location argument.
29925 (ConstructorBaseInitializer): Same here.
29926 (ConstructorThisInitializer): Same here.
29928 * cs-parser.jay : Update all calls accordingly.
29930 * expression.cs (Unary, Binary, New): Take location argument.
29931 Update accordingly everywhere.
29933 * cs-parser.jay : Update all calls to the above to take a location
29936 * class.cs : Ditto.
29938 2001-09-24 Ravi Pratap <ravi@ximian.com>
29940 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
29941 (Invocation::BetterConversion): Same here
29942 (Invocation::ConversionExists): Ditto.
29944 (Invocation::ConversionExists): Implement.
29946 2001-09-22 Ravi Pratap <ravi@ximian.com>
29948 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
29949 Also take an additional TypeContainer argument.
29951 * All over : Pass in TypeContainer as argument to OverloadResolve.
29953 * typemanager.cs (CSharpName): Update to check for the string type and return
29956 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
29959 2001-09-21 Ravi Pratap <ravi@ximian.com>
29961 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
29962 (Invocation::BetterFunction): Implement.
29963 (Invocation::BetterConversion): Implement.
29964 (Invocation::ConversionExists): Skeleton, no implementation yet.
29966 Okay, things work fine !
29968 2001-09-21 Miguel de Icaza <miguel@ximian.com>
29970 * typemanager.cs: declare and load enum_type, delegate_type and
29973 * expression.cs (Expression::Emit): Now emit returns a value that
29974 tells whether a value is left on the stack or not. This strategy
29975 might be reveted tomorrow with a mechanism that would address
29976 multiple assignments.
29977 (Expression::report118): Utility routine to report mismatches on
29980 (Unary::Report23): Report impossible type/operator combination
29983 (Unary::IsIncrementableNumber): Whether the type can be
29984 incremented or decremented with add.
29985 (Unary::ResolveOperator): Also allow enumerations to be bitwise
29987 (Unary::ResolveOperator): Implement ++, !, ~,
29989 (Invocation::Emit): Deal with new Emit convetion.
29991 * All Expression derivatives: Updated their Emit method to return
29992 whether they leave values on the stack or not.
29994 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
29995 stack for expressions that are statements.
29997 2001-09-20 Miguel de Icaza <miguel@ximian.com>
29999 * expression.cs (LValue): New interface. Must be implemented by
30001 (LocalVariableReference, ParameterReference, FieldExpr): Implement
30004 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
30005 interface for generating code, simplifies the code.
30007 2001-09-20 Ravi Pratap <ravi@ximian.com>
30009 * expression.cs (everywhere): Comment out return statements in ::Resolve
30010 methods to avoid the warnings.
30012 2001-09-20 Miguel de Icaza <miguel@ximian.com>
30014 * driver.cs (parse): Report error 2001 if we can not open the
30017 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
30020 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
30023 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
30024 otherwise nested blocks end up with the same index.
30026 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
30028 * expression.cs: Instead of having FIXMEs in the Resolve
30029 functions, throw exceptions so it is obvious that we are facing a
30032 * cs-parser.jay (invocation_expression): Pass Location information.
30034 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
30035 Use a basename for those routines because .NET does not like paths
30038 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
30041 2001-09-19 Miguel de Icaza <miguel@ximian.com>
30043 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
30044 are loading the correct data types (throws an exception if not).
30045 (TypeManager::InitCoreTypes): Use CoreLookupType
30047 * expression.cs (Unary::ResolveOperator): return the child
30048 expression for expressions which are just +expr.
30049 (Unary::ResolveOperator): Return negative literals for -LITERAL
30050 expressions (otherwise they are Unary {Literal}).
30051 (Invocation::Badness): Take into account `Implicit constant
30052 expression conversions'.
30054 * literal.cs (LongLiteral): Implement long literal class.
30055 (IntLiteral): export the `Value' of the intliteral.
30057 2001-09-19 Ravi Pratap <ravi@ximian.com>
30059 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
30061 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
30062 instead of 'Operator'
30064 * expression.cs (Binary::ResolveOperator): Update accordingly.
30065 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
30068 * cs-parser.jay (unary_expression): Update to use the new names.
30070 * gen-treedump.cs (GetUnary): Same here.
30072 * expression.cs (Unary::Resolve): Implement.
30073 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
30074 operators are found instead of making noise ;-)
30075 (Unary::ResolveOperator): New method to do precisely the same thing which
30076 Binary::ResolveOperator does for Binary expressions.
30077 (Unary.method, .Arguments): Add.
30078 (Unary::OperName): Implement.
30079 (Unary::ForceConversion): Copy and Paste !
30081 * class.cs (Operator::Define): Fix a small bug for the case when we have
30084 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
30085 for the inbuilt operators. Only overloading works for now ;-)
30087 2001-09-18 Miguel de Icaza <miguel@ximian.com>
30089 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
30090 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
30092 * expression.cs (This::Emit): Implement.
30093 (This::Resolve): Implement.
30094 (TypeOf:Resolve): Implement.
30095 (Expression::ResolveSimpleName): Add an implicit this to instance
30097 (MemberAccess::Resolve): Deal with Parameters and Fields.
30098 Bind instance variable to Field expressions.
30099 (FieldExpr::Instance): New field used to track the expression that
30100 represents the object instance.
30101 (FieldExpr::Resolve): Track potential errors from MemberLookup not
30103 (FieldExpr::Emit): Implement.
30105 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
30106 the last instruction contains a return opcode to avoid generating
30107 the last `ret' instruction (this generates correct code, and it is
30108 nice to pass the peverify output).
30110 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
30111 initializer for static and instance variables.
30112 (Constructor::Emit): Allow initializer to be null in the case of
30113 static constructors. Only emit initializer for instance
30116 (TypeContainer::FindMembers): Return a null array if there are no
30119 Also fix the code for the MemberTypes.Method branch, as it was not
30120 scanning that for operators (or tried to access null variables before).
30122 * assign.cs (Assign::Emit): Handle instance and static fields.
30126 * driver.cs: Stop compilation if there are parse errors.
30128 * cs-parser.jay (constructor_declaration): Provide default base
30129 initializer for non-static constructors.
30130 (constructor_declarator): Do not provide a default base
30131 initializers if none was specified.
30132 Catch the fact that constructors should not have parameters.
30134 * class.cs: Do not emit parent class initializers for static
30135 constructors, that should be flagged as an error.
30137 2001-09-18 Ravi Pratap <ravi@ximian.com>
30139 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
30140 Move back code into TypeContainer::Populate.
30142 2001-09-18 Ravi Pratap <ravi@ximian.com>
30144 * class.cs (TypeContainer::AddConstructor): Fix the check to
30145 compare against Name, not Basename.
30146 (Operator::OpType): Change Plus and Minus to Add and Subtract.
30148 * cs-parser.jay : Update accordingly.
30150 * class.cs (TypeContainer::FindMembers): For the case where we are searching
30151 for methods, don't forget to look into the operators too.
30152 (RegisterMethodBuilder): Helper method to take care of this for
30153 methods, constructors and operators.
30154 (Operator::Define): Completely revamp.
30155 (Operator.OperatorMethod, MethodName): New fields.
30156 (TypeContainer::Populate): Move the registering of builders into
30157 RegisterMethodBuilder.
30158 (Operator::Emit): Re-write.
30160 * expression.cs (Binary::Emit): Comment out code path to emit method
30161 invocation stuff for the case when we have a user defined operator. I am
30162 just not able to get it right !
30164 2001-09-17 Miguel de Icaza <miguel@ximian.com>
30166 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
30169 (Expression::MemberLookup): Provide a version that allows to
30170 specify the MemberTypes and BindingFlags.
30172 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
30173 so it was not fetching variable information from outer blocks.
30175 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
30176 Beforefieldinit as it was buggy.
30178 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
30179 that Ravi put here.
30181 * class.cs (Constructor::Emit): Only emit if block is not null.
30182 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
30183 deal with this by semantically definining it as if the user had
30186 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
30187 constructors as we now "emit" them at a higher level.
30189 (TypeContainer::DefineDefaultConstructor): Used to define the
30190 default constructors if none was provided.
30192 (ConstructorInitializer): Add methods Resolve and Emit.
30194 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
30196 2001-09-17 Ravi Pratap <ravi@ximian.com>
30198 * class.cs (TypeContainer::EmitDefaultConstructor): Register
30199 the default constructor builder with our hashtable for methodbuilders
30202 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
30203 and argument_count is 0 in which case we have a match.
30204 (Binary::ResolveOperator): More null checking and miscellaneous coding
30207 2001-09-17 Ravi Pratap <ravi@ximian.com>
30209 * rootcontext.cs (IsNameSpace): Compare against null.
30211 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
30213 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
30214 and Unary::Operator.
30216 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
30219 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
30220 we have overloaded operators.
30221 (Binary::ResolveOperator): Implement the part which does the operator overload
30224 * class.cs (Operator::Emit): Implement.
30225 (TypeContainer::Emit): Emit the operators we have too.
30227 * expression.cs (Binary::Emit): Update to emit the appropriate code for
30228 the case when we have a user-defined operator.
30230 2001-09-17 Miguel de Icaza <miguel@ximian.com>
30232 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
30234 2001-09-16 Ravi Pratap <ravi@ximian.com>
30236 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
30237 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
30238 (Constructor::Emit): Implement.
30239 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
30240 if we have no work to do.
30241 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
30244 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
30245 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
30247 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
30250 2001-09-15 Ravi Pratap <ravi@ximian.com>
30252 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
30254 (Tree::RecordNamespace): Method to do what the name says ;-)
30255 (Tree::Namespaces): Property to get at the namespaces hashtable.
30257 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
30260 * rootcontext.cs (IsNamespace): Fixed it :-)
30262 2001-09-14 Miguel de Icaza <miguel@ximian.com>
30264 * class.cs (TypeContainer::FindMembers): Add support for
30266 (MethodCore): New class that encapsulates both the shared aspects
30267 of a Constructor and a Method.
30268 (Method, Constructor): Factored pieces into MethodCore.
30270 * driver.cs: Added --fatal which makes errors throw exceptions.
30271 Load System assembly as well as part of the standard library.
30273 * report.cs: Allow throwing exceptions on errors for debugging.
30275 * modifiers.cs: Do not use `parent', instead use the real type
30276 container to evaluate permission settings.
30278 * class.cs: Put Ravi's patch back in. He is right, and we will
30279 have to cope with the
30281 2001-09-14 Ravi Pratap <ravi@ximian.com>
30283 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
30284 FamORAssem, not FamANDAssem.
30286 2001-09-14 Miguel de Icaza <miguel@ximian.com>
30288 * driver.cs: Added --parse option that only parses its input files
30291 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
30292 incorrect. IsTopLevel is not used to tell whether an object is
30293 root_types or not (that can be achieved by testing this ==
30294 root_types). But to see if this is a top-level *class* (not
30295 necessarly our "toplevel" container).
30297 2001-09-14 Ravi Pratap <ravi@ximian.com>
30299 * enum.cs (Enum::Define): Modify to call the Lookup method on the
30300 parent instead of a direct call to GetType.
30302 2001-09-14 Ravi Pratap <ravi@ximian.com>
30304 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
30305 Modifiers.TypeAttr. This should just be a call to that method.
30307 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
30308 object so that we can determine if we are top-level or not.
30310 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
30313 * enum.cs (Enum::Define): Ditto.
30315 * modifiers.cs (FieldAttr): Re-write.
30317 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
30318 (TypeContainer::HaveStaticConstructor): New property to provide access
30319 to precisely that info.
30321 * modifiers.cs (MethodAttr): Re-write.
30322 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
30324 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
30325 of top-level types as claimed.
30327 2001-09-13 Miguel de Icaza <miguel@ximian.com>
30329 * expression.cs (MemberLookup): Fruitless attempt to lookup
30330 constructors. Maybe I need to emit default constructors? That
30331 might be it (currently .NET emits this for me automatically).
30332 (Invocation::OverloadResolve): Cope with Arguments == null.
30333 (Invocation::EmitArguments): new function, shared by the new
30334 constructor and us.
30335 (Invocation::Emit): Handle static and instance methods. Emit
30336 proper call instruction for virtual or non-virtual invocations.
30337 (New::Emit): Implement.
30338 (New::Resolve): Implement.
30339 (MemberAccess:Resolve): Implement.
30340 (MethodGroupExpr::InstanceExpression): used conforming to the spec
30341 to track instances.
30342 (FieldExpr::Resolve): Set type.
30344 * support.cs: Handle empty arguments.
30346 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
30347 SimpleLookup): Auxiliary routines to help parse a qualifier
30350 Update qualifier_identifier rule.
30352 * codegen.cs: Removed debugging messages.
30354 * class.cs: Make this a global thing, this acts just as a "key" to
30355 objects that we might have around.
30357 (Populate): Only initialize method_builders_to_methods once.
30359 * expression.cs (PropertyExpr): Initialize type from the
30362 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
30363 Resolve pattern. Attempt to implicitly convert value to boolean.
30366 * expression.cs: Set the type for the int32/int32 argument case.
30367 (Binary::ResolveOperator): Set the return type to boolean for
30368 comparission operators
30370 * typemanager.cs: Remove debugging print code.
30372 (Invocation::Resolve): resolve type.
30374 * class.cs: Allocate a MemberInfo of the correct size, as the code
30375 elsewhere depends on the test to reflect the correct contents.
30377 (Method::) Keep track of parameters, due to System.Reflection holes
30379 (TypeContainer::Populate): Keep track of MethodBuilders to Method
30382 (TypeContainer::FindMembers): Use ArrayList and then copy an array
30383 of the exact size and return that.
30385 (Class::LookupMethodByBuilder): New function that maps
30386 MethodBuilders to its methods. Required to locate the information
30387 on methods because System.Reflection bit us again.
30389 * support.cs: New file, contains an interface ParameterData and
30390 two implementations: ReflectionParameters and InternalParameters
30391 used to access Parameter information. We will need to grow this
30394 * expression.cs (Invocation::GetParameterData): implement a cache
30395 and a wrapper around the ParameterData creation for methods.
30396 (Invocation::OverloadResolve): Use new code.
30398 2001-09-13 Ravi Pratap <ravi@ximian.com>
30400 * class.cs (TypeContainer::EmitField): Remove and move into
30401 (Field::Define): here and modify accordingly.
30402 (Field.FieldBuilder): New member.
30403 (TypeContainer::Populate): Update accordingly.
30404 (TypeContainer::FindMembers): Implement.
30406 2001-09-13 Miguel de Icaza <miguel@ximian.com>
30408 * statement.cs: (VariableInfo::VariableType): New field to be
30409 initialized with the full type once it is resolved.
30411 2001-09-12 Miguel de Icaza <miguel@ximian.com>
30413 * parameter.cs (GetParameterInfo): Use a type cache to compute
30414 things only once, and to reuse this information
30416 * expression.cs (LocalVariableReference::Emit): Implement.
30417 (OpcodeCast::Emit): fix.
30419 (ParameterReference::Resolve): Implement.
30420 (ParameterReference::Emit): Implement.
30422 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
30423 that are expressions need to stay as Expressions.
30425 * typemanager.cs (CSharpName): Returns the C# name of a type if
30428 * expression.cs (Expression::ConvertImplicit): New function that
30429 implements implicit type conversions.
30431 (Expression::ImplicitReferenceConversion): Implements implicit
30432 reference conversions.
30434 (EmptyCast): New type for transparent casts.
30436 (OpcodeCast): New type for casts of types that are performed with
30437 a sequence of bytecodes.
30439 (BoxedCast): New type used for casting value types into reference
30440 types. Emits a box opcode.
30442 (Binary::DoNumericPromotions): Implements numeric promotions of
30443 and computation of the Binary::Type.
30445 (Binary::EmitBranchable): Optimization.
30447 (Binary::Emit): Implement code emission for expressions.
30449 * typemanager.cs (TypeManager): Added two new core types: sbyte
30452 2001-09-12 Ravi Pratap <ravi@ximian.com>
30454 * class.cs (TypeContainer::FindMembers): Method which does exactly
30455 what Type.FindMembers does, only we don't have to use reflection. No
30456 implementation yet.
30458 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
30459 typecontainer objects as we need to get at them.
30460 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
30462 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
30463 typecontainer object.
30465 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
30466 of just a Report object.
30468 2001-09-11 Ravi Pratap <ravi@ximian.com>
30470 * class.cs (Event::Define): Go back to using the prefixes "add_" and
30472 (TypeContainer::Populate): Now define the delegates of the type too.
30473 (TypeContainer.Delegates): Property to access the list of delegates defined
30476 * delegates.cs (Delegate::Define): Implement partially.
30478 * modifiers.cs (TypeAttr): Handle more flags.
30480 2001-09-11 Ravi Pratap <ravi@ximian.com>
30482 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
30484 (Operator::Define): Re-write logic to get types by using the LookupType method
30485 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
30486 (Indexer::Define): Ditto.
30487 (Event::Define): Ditto.
30488 (Property::Define): Ditto.
30490 2001-09-10 Ravi Pratap <ravi@ximian.com>
30492 * class.cs (TypeContainer::Populate): Now define operators too.
30493 (TypeContainer.Operators): New property to access the list of operators
30495 (Operator.OperatorMethodBuilder): New member to hold the method builder
30496 for the operator we are defining.
30497 (Operator::Define): Implement.
30499 2001-09-10 Ravi Pratap <ravi@ximian.com>
30501 * class.cs (Event::Define): Make the prefixes of the accessor methods
30502 addOn_ and removeOn_
30504 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
30505 of the location being passed in too. Ideally, this should go later since all
30506 error reporting should be done through the Report object.
30508 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
30509 (Populate): Iterate thru the indexers we have and define them too.
30510 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
30511 for the get and set accessors.
30512 (Indexer::Define): Implement.
30514 2001-09-09 Miguel de Icaza <miguel@ximian.com>
30516 * expression.cs (Binary::Resolve): Beginning of it. I scratched
30517 my previous implementation, did not work.
30519 * typemanager.cs: Add a couple of missing types (the longs).
30521 * literal.cs: Use TypeManager.bool_type instead of getting it.
30523 * expression.cs (EventExpr): New kind of expressions.
30524 (Expressio::ExprClassFromMemberInfo): finish
30526 2001-09-08 Miguel de Icaza <miguel@ximian.com>
30528 * assign.cs: Emit stores to static fields differently.
30530 2001-09-08 Ravi Pratap <ravi@ximian.com>
30532 * Merge in changes and adjust code to tackle conflicts. Backed out my
30533 code in Assign::Resolve ;-)
30535 2001-09-08 Ravi Pratap <ravi@ximian.com>
30537 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
30538 instead Report.Error and also pass in the location.
30539 (CSharpParser::Lexer): New readonly property to return the reference
30540 to the Tokenizer object.
30541 (declare_local_variables): Use Report.Error with location instead of plain
30545 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
30546 (Operator.CheckBinaryOperator): Ditto.
30548 * cs-parser.jay (operator_declarator): Update accordingly.
30550 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
30551 (CheckBinaryOperator): Same here.
30553 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
30554 on the name without any prefixes of namespace names etc. This is because we
30555 already might have something already fully qualified like
30556 'System.Console.WriteLine'
30558 * assign.cs (Resolve): Begin implementation. Stuck ;-)
30560 2001-09-07 Ravi Pratap <ravi@ximian.com>
30562 * cs-tokenizer.cs (location): Return a string which also contains
30565 * expression.cs (ElementAccess): New class for expressions of the
30566 type 'element access.'
30567 (BaseAccess): New class for expressions of the type 'base access.'
30568 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
30571 * cs-parser.jay (element_access): Implement action.
30572 (base_access): Implement actions.
30573 (checked_expression, unchecked_expression): Implement.
30575 * cs-parser.jay (local_variable_type): Correct and implement.
30576 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
30578 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
30580 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
30581 name and the specifiers.
30583 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
30585 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
30586 making them all public ;-)
30588 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
30591 2001-09-07 Miguel de Icaza <miguel@ximian.com>
30593 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
30595 (FieldExpr, PropertyExprs): New resolved expressions.
30596 (SimpleName::MemberStaticCheck): Perform static checks for access
30597 to non-static fields on static methods. Maybe this should be
30598 generalized for MemberAccesses.
30599 (SimpleName::ResolveSimpleName): More work on simple name
30602 * cs-parser.jay (primary_expression/qualified_identifier): track
30603 the parameter index.
30605 * codegen.cs (CodeGen::Save): Catch save exception, report error.
30606 (EmitContext::EmitBoolExpression): Chain to expression generation
30607 instead of temporary hack.
30608 (::EmitStatementExpression): Put generic expression code generation.
30610 * assign.cs (Assign::Emit): Implement variable assignments to
30611 local variables, parameters and fields.
30613 2001-09-06 Miguel de Icaza <miguel@ximian.com>
30615 * statement.cs (Block::GetVariableInfo): New method, returns the
30616 VariableInfo for a variable name in a block.
30617 (Block::GetVariableType): Implement in terms of GetVariableInfo
30619 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
30620 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
30622 2001-09-06 Ravi Pratap <ravi@ximian.com>
30624 * cs-parser.jay (operator_declaration): Continue on my quest : update
30625 to take attributes argument.
30626 (event_declaration): Ditto.
30627 (enum_declaration): Ditto.
30628 (indexer_declaration): Ditto.
30630 * class.cs (Operator::Operator): Update constructor accordingly.
30631 (Event::Event): Ditto.
30633 * delegate.cs (Delegate::Delegate): Same here.
30635 * enum.cs (Enum::Enum): Same here.
30637 2001-09-05 Ravi Pratap <ravi@ximian.com>
30639 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
30641 * ../tests/cs0658.cs : New file to demonstrate error 0658.
30643 * attribute.cs (Attributes): New class to encapsulate all attributes which were
30644 being passed around as an arraylist.
30645 (Attributes::AddAttribute): Method to add attribute sections.
30647 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
30648 (struct_declaration): Update accordingly.
30649 (constant_declaration): Update.
30650 (field_declaration): Update.
30651 (method_header): Update.
30652 (fixed_parameter): Update.
30653 (parameter_array): Ditto.
30654 (property_declaration): Ditto.
30655 (destructor_declaration): Ditto.
30657 * class.cs (Struct::Struct): Update constructors accordingly.
30658 (Class::Class): Ditto.
30659 (Field::Field): Ditto.
30660 (Method::Method): Ditto.
30661 (Property::Property): Ditto.
30662 (TypeContainer::OptAttribute): update property's return type.
30664 * interface.cs (Interface.opt_attributes): New member.
30665 (Interface::Interface): Update to take the extra Attributes argument.
30667 * parameter.cs (Parameter::Parameter): Ditto.
30669 * constant.cs (Constant::Constant): Ditto.
30671 * interface.cs (InterfaceMemberBase): New OptAttributes field.
30672 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
30673 the attributes as a parameter.
30674 (InterfaceProperty): Update constructor call.
30675 (InterfaceEvent): Ditto.
30676 (InterfaceMethod): Ditto.
30677 (InterfaceIndexer): Ditto.
30679 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
30680 pass the attributes too.
30681 (interface_event_declaration): Ditto.
30682 (interface_property_declaration): Ditto.
30683 (interface_method_declaration): Ditto.
30684 (interface_declaration): Ditto.
30686 2001-09-05 Miguel de Icaza <miguel@ximian.com>
30688 * class.cs (Method::Define): Track the "static Main" definition to
30689 create an entry point.
30691 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
30692 EntryPoint if we find it.
30694 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
30695 (EmitContext::ig): Make this variable public.
30697 * driver.cs: Make the default output file be the first file name
30698 with the .exe extension.
30700 Detect empty compilations
30702 Handle various kinds of output targets. Handle --target and
30703 rename -t to --dumper.
30705 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
30706 methods inherited from Expression return now an Expression. This
30707 will is used during the tree rewriting as we resolve them during
30710 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
30711 the spec. Missing entirely is the information about
30712 accessability of elements of it.
30714 (Expression::ExprClassFromMemberInfo): New constructor for
30715 Expressions that creates a fully initialized Expression based on
30716 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
30719 (Invocation::Resolve): Begin implementing resolution of invocations.
30721 * literal.cs (StringLiteral): Implement Emit.
30723 2001-09-05 Ravi Pratap <ravi@ximian.com>
30725 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
30728 2001-09-04 Ravi Pratap <ravi@ximian.com>
30730 * cs-parser.jay (attribute_arguments): Implement actions.
30731 (attribute): Fix bug in production. Implement action.
30732 (attribute_list): Implement.
30733 (attribute_target): Implement.
30734 (attribute_target_specifier, opt_target_specifier): Implement
30735 (CheckAttributeTarget): New method to check if the attribute target
30737 (attribute_section): Implement.
30738 (opt_attributes): Implement.
30740 * attribute.cs : New file to handle attributes.
30741 (Attribute): Class to hold attribute info.
30743 * cs-parser.jay (opt_attribute_target_specifier): Remove production
30744 (attribute_section): Modify production to use 2 different rules to
30745 achieve the same thing. 1 s/r conflict down !
30746 Clean out commented, useless, non-reducing dimension_separator rules.
30748 * class.cs (TypeContainer.attributes): New member to hold list
30749 of attributes for a type.
30750 (Struct::Struct): Modify to take one more argument, the attribute list.
30751 (Class::Class): Ditto.
30752 (Field::Field): Ditto.
30753 (Method::Method): Ditto.
30754 (Property::Property): Ditto.
30756 * cs-parser.jay (struct_declaration): Update constructor call to
30757 pass in the attributes too.
30758 (class_declaration): Ditto.
30759 (constant_declaration): Ditto.
30760 (field_declaration): Ditto.
30761 (method_header): Ditto.
30762 (fixed_parameter): Ditto.
30763 (parameter_array): Ditto.
30764 (property_declaration): Ditto.
30766 * constant.cs (Constant::Constant): Update constructor similarly.
30767 Use System.Collections.
30769 * parameter.cs (Parameter::Parameter): Update as above.
30771 2001-09-02 Ravi Pratap <ravi@ximian.com>
30773 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
30774 (TypeContainer.delegates): New member to hold list of delegates.
30776 * cs-parser.jay (delegate_declaration): Implement the action correctly
30777 this time as I seem to be on crack ;-)
30779 2001-09-02 Miguel de Icaza <miguel@ximian.com>
30781 * rootcontext.cs (RootContext::IsNamespace): new function, used to
30782 tell whether an identifier represents a namespace.
30784 * expression.cs (NamespaceExpr): A namespace expression, used only
30785 temporarly during expression resolution.
30786 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
30787 utility functions to resolve names on expressions.
30789 2001-09-01 Miguel de Icaza <miguel@ximian.com>
30791 * codegen.cs: Add hook for StatementExpressions.
30793 * class.cs: Fix inverted test for static flag in methods.
30795 2001-09-02 Ravi Pratap <ravi@ximian.com>
30797 * class.cs (Operator::CheckUnaryOperator): Correct error number used
30798 to make it coincide with MS' number.
30799 (Operator::CheckBinaryOperator): Ditto.
30801 * ../errors/errors.txt : Remove error numbers added earlier.
30803 * ../errors/cs1019.cs : Test case for error # 1019
30805 * ../errros/cs1020.cs : Test case for error # 1020
30807 * cs-parser.jay : Clean out commented cruft.
30808 (dimension_separators, dimension_separator): Comment out. Ostensibly not
30809 used anywhere - non-reducing rule.
30810 (namespace_declarations): Non-reducing rule - comment out.
30812 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
30813 with TypeContainer::AddEnum.
30815 * delegate.cs : New file for delegate handling classes.
30816 (Delegate): Class for declaring delegates.
30818 * makefile : Update.
30820 * cs-parser.jay (delegate_declaration): Implement.
30822 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
30824 * class.cs (Event::Define): Implement.
30825 (Event.EventBuilder): New member.
30827 * class.cs (TypeContainer::Populate): Update to define all enums and events
30829 (Events): New property for the events arraylist we hold. Shouldn't we move to using
30830 readonly fields for all these cases ?
30832 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
30834 * class.cs (Property): Revamp to use the convention of making fields readonly.
30835 Accordingly modify code elsewhere.
30837 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
30838 the Define method of the Property class.
30840 * class.cs : Clean up applied patch and update references to variables etc. Fix
30842 (TypeContainer::Populate): Update to define all the properties we have. Also
30843 define all enumerations.
30845 * enum.cs (Define): Implement.
30847 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
30849 * cs-parser.jay (overloadable_operator): The semantic value is an
30850 enum of the Operator class.
30851 (operator_declarator): Implement actions.
30852 (operator_declaration): Implement.
30854 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
30855 validity of definitions.
30856 (Operator::CheckBinaryOperator): Static method to check for binary operators
30857 (TypeContainer::AddOperator): New method to add an operator to a type.
30859 * cs-parser.jay (indexer_declaration): Added line to actually call the
30860 AddIndexer method so it gets added ;-)
30862 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
30863 already taken care of by the MS compiler ?
30865 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
30867 * class.cs (Operator): New class for operator declarations.
30868 (Operator::OpType): Enum for the various operators.
30870 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
30872 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
30873 ostensibly handle this in semantic analysis.
30875 * cs-parser.jay (general_catch_clause): Comment out
30876 (specific_catch_clauses, specific_catch_clause): Ditto.
30877 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
30878 (catch_args, opt_catch_args): New productions.
30879 (catch_clause): Rewrite to use the new productions above
30880 (catch_clauses): Modify accordingly.
30881 (opt_catch_clauses): New production to use in try_statement
30882 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
30883 and re-write the code in the actions to extract the specific and
30884 general catch clauses by being a little smart ;-)
30886 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
30887 Hooray, try and catch statements parse fine !
30889 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30891 * statement.cs (Block::GetVariableType): Fix logic to extract the type
30892 string from the hashtable of variables.
30894 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
30895 I end up making that mistake ;-)
30896 (catch_clauses): Fixed gross error which made Key and Value of the
30897 DictionaryEntry the same : $1 !!
30899 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30901 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
30903 * cs-parser.jay (event_declaration): Correct to remove the semicolon
30904 when the add and remove accessors are specified.
30906 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30908 * cs-parser.jay (IndexerDeclaration): New helper class to hold
30909 information about indexer_declarator.
30910 (indexer_declarator): Implement actions.
30911 (parsing_indexer): New local boolean used to keep track of whether
30912 we are parsing indexers or properties. This is necessary because
30913 implicit_parameters come into picture even for the get accessor in the
30914 case of an indexer.
30915 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
30917 * class.cs (Indexer): New class for indexer declarations.
30918 (TypeContainer::AddIndexer): New method to add an indexer to a type.
30919 (TypeContainer::indexers): New member to hold list of indexers for the
30922 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
30924 * cs-parser.jay (add_accessor_declaration): Implement action.
30925 (remove_accessor_declaration): Implement action.
30926 (event_accessors_declaration): Implement
30927 (variable_declarators): swap statements for first rule - trivial.
30929 * class.cs (Event): New class to hold information about event
30931 (TypeContainer::AddEvent): New method to add an event to a type
30932 (TypeContainer::events): New member to hold list of events.
30934 * cs-parser.jay (event_declaration): Implement actions.
30936 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
30938 * cs-parser.jay (dim_separators): Implement. Make it a string
30939 concatenating all the commas together, just as they appear.
30940 (opt_dim_separators): Modify accordingly
30941 (rank_specifiers): Update accordingly. Basically do the same
30942 thing - instead, collect the brackets here.
30943 (opt_rank_sepcifiers): Modify accordingly.
30944 (array_type): Modify to actually return the complete type string
30945 instead of ignoring the rank_specifiers.
30946 (expression_list): Implement to collect the expressions
30947 (variable_initializer): Implement. We make it a list of expressions
30948 essentially so that we can handle the array_initializer case neatly too.
30949 (variable_initializer_list): Implement.
30950 (array_initializer): Make it a list of variable_initializers
30951 (opt_array_initializer): Modify accordingly.
30953 * expression.cs (New::NType): Add enumeration to help us
30954 keep track of whether we have an object/delegate creation
30955 or an array creation.
30956 (New:NewType, New::Rank, New::Indices, New::Initializers): New
30957 members to hold data about array creation.
30958 (New:New): Modify to update NewType
30959 (New:New): New Overloaded contructor for the array creation
30962 * cs-parser.jay (array_creation_expression): Implement to call
30963 the overloaded New constructor.
30965 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
30967 * class.cs (TypeContainer::Constructors): Return member
30968 constructors instead of returning null.
30970 2001-08-26 Miguel de Icaza <miguel@ximian.com>
30972 * typemanager.cs (InitCoreTypes): Initialize the various core
30973 types after we have populated the type manager with the user
30974 defined types (this distinction will be important later while
30975 compiling corlib.dll)
30977 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
30978 on Expression Classification. Now all expressions have a method
30979 `Resolve' and a method `Emit'.
30981 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
30982 generation from working. Also add some temporary debugging
30985 2001-08-24 Miguel de Icaza <miguel@ximian.com>
30987 * codegen.cs: Lots of code generation pieces. This is only the
30988 beginning, will continue tomorrow with more touches of polish. We
30989 handle the fundamentals of if, while, do, for, return. Others are
30990 trickier and I need to start working on invocations soon.
30992 * gen-treedump.cs: Bug fix, use s.Increment here instead of
30995 * codegen.cs (EmitContext): New struct, used during code
30996 emission to keep a context. Most of the code generation will be
30999 * cs-parser.jay: Add embedded blocks to the list of statements of
31000 this block. So code generation proceeds in a top down fashion.
31002 2001-08-23 Miguel de Icaza <miguel@ximian.com>
31004 * statement.cs: Add support for multiple child blocks.
31006 2001-08-22 Miguel de Icaza <miguel@ximian.com>
31008 * codegen.cs (EmitCode): New function, will emit the code for a
31009 Block of code given a TypeContainer and its ILGenerator.
31011 * statement.cs (Block): Standard public readonly optimization.
31012 (Block::Block constructors): Link children.
31013 (Block::Child): Child Linker.
31014 (Block::EmitVariables): Emits IL variable declarations.
31016 * class.cs: Drop support for MethodGroups here, delay until
31018 (Method::): Applied the same simplification that I did before, and
31019 move from Properties to public readonly fields.
31020 (Method::ParameterTypes): Returns the parameter types for the
31021 function, and implements a cache that will be useful later when I
31022 do error checking and the semantic analysis on the methods is
31024 (Constructor::GetCallingConvention): Renamed from CallingConvetion
31025 and made a method, optional argument tells whether this is a class
31026 or a structure to apply the `has-this' bit.
31027 (Method::GetCallingConvention): Implement, returns the calling
31029 (Method::Define): Defines the type, a second pass is performed
31030 later to populate the methods.
31032 (Constructor::ParameterTypes): implement a cache similar to the
31033 one on Method::ParameterTypes, useful later when we do semantic
31036 (TypeContainer::EmitMethod): New method. Emits methods.
31038 * expression.cs: Removed MethodGroup class from here.
31040 * parameter.cs (Parameters::GetCallingConvention): new method.
31042 2001-08-21 Miguel de Icaza <miguel@ximian.com>
31044 * class.cs (TypeContainer::Populate): Drop RootContext from the
31047 (Constructor::CallingConvention): Returns the calling convention.
31048 (Constructor::ParameterTypes): Returns the constructor parameter
31051 (TypeContainer::AddConstructor): Keep track of default constructor
31052 and the default static constructor.
31054 (Constructor::) Another class that starts using `public readonly'
31055 instead of properties.
31057 (Constructor::IsDefault): Whether this is a default constructor.
31059 (Field::) use readonly public fields instead of properties also.
31061 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
31062 track of static constructors; If none is used, turn on
31063 BeforeFieldInit in the TypeAttributes.
31065 * cs-parser.jay (opt_argument_list): now the return can be null
31066 for the cases where there are no arguments.
31068 (constructor_declarator): If there is no implicit `base' or
31069 `this', then invoke the default parent constructor.
31071 * modifiers.cs (MethodAttr): New static function maps a set of
31072 modifiers flags into a MethodAttributes enum
31073 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
31074 MethodAttr, TypeAttr to represent the various mappings where the
31075 modifiers are used.
31076 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
31078 2001-08-19 Miguel de Icaza <miguel@ximian.com>
31080 * parameter.cs (GetParameterInfo): Fix bug where there would be no
31083 * interface.cs (PopulateIndexer): Implemented the code generator
31084 for interface indexers.
31086 2001-08-17 Miguel de Icaza <miguel@ximian.com>
31088 * interface.cs (InterfaceMemberBase): Now we track the new status
31091 (PopulateProperty): Implement property population. Woohoo! Got
31092 Methods and Properties going today.
31094 Removed all the properties for interfaces, and replaced them with
31095 `public readonly' fields.
31097 2001-08-16 Miguel de Icaza <miguel@ximian.com>
31099 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
31100 initialize their hashtables/arraylists only when they are needed
31101 instead of doing this always.
31103 * parameter.cs: Handle refs and out parameters.
31105 * cs-parser.jay: Use an ArrayList to construct the arguments
31106 instead of the ParameterCollection, and then cast that to a
31109 * parameter.cs: Drop the use of ParameterCollection and use
31110 instead arrays of Parameters.
31112 (GetParameterInfo): Use the Type, not the Name when resolving
31115 2001-08-13 Miguel de Icaza <miguel@ximian.com>
31117 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
31118 and instead use public readonly fields.
31120 * class.cs: Put back walking code for type containers.
31122 2001-08-11 Miguel de Icaza <miguel@ximian.com>
31124 * class.cs (MakeConstant): Code to define constants.
31126 * rootcontext.cs (LookupType): New function. Used to locate types
31129 2001-08-08 Miguel de Icaza <miguel@ximian.com>
31131 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
31132 this System.Reflection code is. Kudos to Microsoft
31134 * typemanager.cs: Implement a type cache and avoid loading all
31135 types at boot time. Wrap in LookupType the internals. This made
31136 the compiler so much faster. Wow. I rule!
31138 * driver.cs: Make sure we always load mscorlib first (for
31139 debugging purposes, nothing really important).
31141 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
31142 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
31144 * rootcontext.cs: Lookup types on their namespace; Lookup types
31145 on namespaces that have been imported using the `using' keyword.
31147 * class.cs (TypeContainer::TypeAttr): Virtualize.
31148 (Class::TypeAttr): Return attributes suitable for this bad boy.
31149 (Struct::TypeAttr): ditto.
31150 Handle nested classes.
31151 (TypeContainer::) Remove all the type visiting code, it is now
31152 replaced with the rootcontext.cs code
31154 * rootcontext.cs (GetClassBases): Added support for structs.
31156 2001-08-06 Miguel de Icaza <miguel@ximian.com>
31158 * interface.cs, statement.cs, class.cs, parameter.cs,
31159 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
31160 Drop use of TypeRefs, and use strings instead.
31162 2001-08-04 Miguel de Icaza <miguel@ximian.com>
31166 * class.cs (Struct::Struct): set the SEALED flags after
31167 checking the modifiers.
31168 (TypeContainer::TypeAttr): new property, returns the
31169 TypeAttributes for a class.
31171 * cs-parser.jay (type_list): Oops, list production was creating a
31172 new list of base types.
31174 * rootcontext.cs (StdLib): New property.
31175 (GetInterfaceTypeByName): returns an interface by type name, and
31176 encapsulates error handling here.
31177 (GetInterfaces): simplified.
31178 (ResolveTree): Encapsulated all the tree resolution here.
31179 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
31182 * driver.cs: Add support for --nostdlib, to avoid loading the
31183 default assemblies.
31184 (Main): Do not put tree resolution here.
31186 * rootcontext.cs: Beginning of the class resolution.
31188 2001-08-03 Miguel de Icaza <miguel@ximian.com>
31190 * rootcontext.cs: Provide better error reporting.
31192 * cs-parser.jay (interface_base): set our $$ to be interfaces.
31194 * rootcontext.cs (CreateInterface): Handle the case where there
31195 are no parent interfaces.
31197 (CloseTypes): Routine to flush types at the end.
31198 (CreateInterface): Track types.
31199 (GetInterfaces): Returns an array of Types from the list of
31200 defined interfaces.
31202 * typemanager.c (AddUserType): Mechanism to track user types (puts
31203 the type on the global type hash, and allows us to close it at the
31206 2001-08-02 Miguel de Icaza <miguel@ximian.com>
31208 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
31209 RecordInterface instead.
31211 * cs-parser.jay: Updated to reflect changes above.
31213 * decl.cs (Definition): Keep track of the TypeBuilder type that
31214 represents this type here. Not sure we will use it in the long
31215 run, but wont hurt for now.
31217 * driver.cs: Smaller changes to accomodate the new code.
31219 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
31222 * rootcontext.cs (CreateInterface): New method, used to create
31223 the System.TypeBuilder type for interfaces.
31224 (ResolveInterfaces): new entry point to resolve the interface
31226 (CodeGen): Property, used to keep track of the code generator.
31228 2001-07-26 Miguel de Icaza <miguel@ximian.com>
31230 * cs-parser.jay: Add a second production for delegate_declaration
31233 (enum_body): Put an opt_comma here instead of putting it on
31234 enum_body or enum_member_declarations so we can handle trailing
31235 commas on enumeration members. Gets rid of a shift/reduce.
31237 (type_list): Need a COMMA in the middle.
31239 (indexer_declaration): Tell tokenizer to recognize get/set
31241 * Remove old targets.
31243 * Re-add the parser target.
31245 2001-07-13 Simon Cozens <simon@simon-cozens.org>
31247 * cs-parser.jay: Add precendence rules for a number of operators
31248 ot reduce the number of shift/reduce conflicts in the grammar.
31250 2001-07-17 Miguel de Icaza <miguel@ximian.com>
31252 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
31255 Get rid of old crufty code.
31257 * rootcontext.cs: Use this to keep track of the parsed
31258 representation and the defined types available to the program.
31260 * gen-treedump.cs: adjust for new convention.
31262 * type.cs: Split out the type manager, and the assembly builder
31265 * typemanager.cs: the type manager will live here now.
31267 * cil-codegen.cs: And the code generator here.
31269 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
31271 * makefile: Fixed up for easy making.
31273 2001-07-13 Simon Cozens <simon@simon-cozens.org>
31275 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
31278 (unary_expression): Expand pre_increment_expression and
31279 post_decrement_expression to reduce a shift/reduce.
31281 2001-07-11 Simon Cozens
31283 * cs-tokenizer.cs: Hex numbers should begin with a 0.
31285 Improve allow_keyword_as_indent name.
31287 2001-06-19 Miguel de Icaza <miguel@ximian.com>
31289 * Adjustments for Beta2.
31291 2001-06-13 Miguel de Icaza <miguel@ximian.com>
31293 * decl.cs: Added `Define' abstract method.
31294 (InTransit): new property, used to catch recursive definitions.
31296 * interface.cs: Implement `Define'.
31298 * modifiers.cs: Map Modifiers.constants to
31299 System.Reflection.TypeAttribute flags.
31301 * class.cs: Keep track of types and user-defined types.
31302 (BuilderInit): New method for creating an assembly
31303 (ResolveType): New function to launch the resolution process, only
31304 used by interfaces for now.
31306 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
31307 that are inserted into the name space.
31309 2001-06-08 Miguel de Icaza <miguel@ximian.com>
31311 * ARGH. I have screwed up my tree so many times due to the use of
31312 rsync rather than using CVS. Going to fix this at once.
31314 * driver.cs: Objetify driver. Load assemblies, use assemblies to
31317 2001-06-07 Miguel de Icaza <miguel@ximian.com>
31319 * Experiment successful: Use System.Type rather that our own
31322 2001-05-25 Miguel de Icaza <miguel@ximian.com>
31324 * cs-parser.jay: Removed nsAliases from here.
31326 Use new namespaces, handle `using XXX;'
31328 * namespace.cs: Reimplemented namespace handling, use a recursive
31329 definition of the class. Now we can keep track of using clauses
31330 and catch invalid using clauses.
31332 2001-05-24 Miguel de Icaza <miguel@ximian.com>
31334 * gen-treedump.cs: Adapted for all the renaming.
31336 * expression.cs (Expression): this class now has a Type property
31337 which returns an expression Type.
31339 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
31340 `Type', as this has a different meaning now in the base
31342 2001-05-22 Miguel de Icaza <miguel@ximian.com>
31344 * interface.cs, class.cs: Removed from all the sources the
31345 references to signature computation, as we can not do method
31346 signature computation during the parsing time, as we are not
31347 trying to solve at that point distinguishing:
31351 void a (NS.Blah x) {}
31354 Which depending on the context might be valid or not, as we do not
31355 know if Blah is the same thing as NS.Blah at that point.
31357 * Redid everything so the code uses TypeRefs now instead of
31358 Types. TypeRefs are just temporary type placeholders, that need
31359 to be resolved. They initially have a pointer to a string and the
31360 current scope in which they are used. This is used later by the
31361 compiler to resolve the reference to an actual Type.
31363 * DeclSpace is no longer a CIR.Type, and neither are
31364 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
31365 are all DeclSpaces, but no Types.
31367 * type.cs (TypeRefManager): This implements the TypeRef manager,
31368 which keeps track of all the types that need to be resolved after
31369 the parsing has finished.
31371 2001-05-13 Miguel de Icaza <miguel@ximian.com>
31373 * ARGH. We are going to have to store `foreach' as a class rather
31374 than resolving it, as we need to verify error 1579 after name
31375 resolution. *OR* we could keep a flag that says `This request to
31376 IEnumerator comes from a foreach statement' which we can then use
31377 to generate the error.
31379 2001-05-10 Miguel de Icaza <miguel@ximian.com>
31381 * class.cs (TypeContainer.AddMethod): we now add methods to the
31382 MethodGroup instead of the method hashtable.
31384 * expression.cs: Add MethodGroup abstraction, which gets us one
31385 step closer to the specification in the way we handle method
31388 * cs-parser.jay (primary_expression): qualified_identifier now
31389 tried to match up an identifier to a local variable reference or
31390 to a parameter reference.
31392 current_local_parameters is now a parser global variable that
31393 points to the current parameters for the block, used during name
31396 (property_declaration): Now creates an implicit `value' argument to
31399 2001-05-09 Miguel de Icaza <miguel@ximian.com>
31401 * parameter.cs: Do not use `param' arguments as part of the
31402 signature, per the spec.
31404 2001-05-08 Miguel de Icaza <miguel@ximian.com>
31406 * decl.cs: Base class for classes, structs and interfaces. This
31407 is the "Declaration Space"
31409 * cs-parser.jay: Use CheckDef for checking declaration errors
31410 instead of having one on each function.
31412 * class.cs: Factor out some code for handling error handling in
31413 accordance to the "Declarations" section in the "Basic Concepts"
31414 chapter in the ECMA C# spec.
31416 * interface.cs: Make all interface member classes derive from
31417 InterfaceMemberBase.
31419 2001-05-07 Miguel de Icaza <miguel@ximian.com>
31421 * Many things: all interfaces are parsed and generated in
31422 gen-treedump. Support for member variables, constructors,
31423 destructors, properties, constants is there.
31425 Beginning of the IL backend, but very little done, just there for
31428 2001-04-29 Miguel de Icaza <miguel@ximian.com>
31430 * cs-parser.jay: Fix labeled statement.
31432 * cs-tokenizer.cs (escape): Escape " and ' always.
31433 ref_line, ref_name: keep track of the line/filename as instructed
31434 by #line by the compiler.
31437 2001-04-27 Miguel de Icaza <miguel@ximian.com>
31439 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
31440 to match the values in System.CodeDOM.
31442 Divid renamed to Divide.
31444 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
31446 (Statements.set): remove.
31448 * System.CodeDOM/CodeCatchClause.cs: always have a valid
31451 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
31452 falseStatements always have valid values.
31454 * cs-parser.jay: Use System.CodeDOM now.