1 2008-12-30 Marek Safar <marek.safar@gmail.com>
3 * expression.cs (As): Mutate all type arguments.
5 2008-12-29 Marek Safar <marek.safar@gmail.com>
8 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
11 2008-12-29 Marek Safar <marek.safar@gmail.com>
14 * ecore.cs: Consider more variables of form V.I to be fixed.
16 2008-12-18 Marek Safar <marek.safar@gmail.com>
19 * generic.cs: Don't crash when constraint comes from type
22 2008-12-03 Marek Safar <marek.safar@gmail.com>
24 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
25 to be imported from any assembly.
27 2008-11-25 Marek Safar <marek.safar@gmail.com>
30 * anonymous.cs (HoistedVariable): Cache also outer access to deal
31 with context variables stored as expression instances.
33 2008-11-17 Marek Safar <marek.safar@gmail.com>
36 * location.cs (IsConditionalDefined): Handle undefined global
39 2008-11-17 Marek Safar <marek.safar@gmail.com>
42 * expression.cs (TryReduceConstant): Always create new constant
45 2008-11-17 Marek Safar <marek.safar@gmail.com>
48 * ecore.cs: Ignore open generic types when used as generic type
51 2008-11-13 Marek Safar <marek.safar@gmail.com>
54 * anonymous.cs: Rescan parent storeys when best candidate was
57 2008-11-10 Marek Safar <marek.safar@gmail.com>
60 * anonymous.cs (MutateConstructor): More SRE hacking.
62 2008-11-10 Marek Safar <marek.safar@gmail.com>
65 * ecore.cs: Also initialize expanded form of a method with 1 params
68 2008-11-06 Marek Safar <marek.safar@gmail.com>
70 * expression.cs (UnaryMutator): Do early l-side check.
72 2008-11-05 Miguel de Icaza <miguel@novell.com>
74 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
75 Init, otherwise we would crash later on when checking for friend
78 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
79 Otherwise we never get any meaningful information as to what
82 2008-11-05 Marek Safar <marek.safar@gmail.com>
85 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
87 2008-11-05 Miguel de Icaza <miguel@novell.com>
89 * namespace.cs: Turns out that it was a really bad idea to hide
90 the errors for namespaces not found here in eval mode.
92 * eval.cs: When we process using clauses, only enter those into
93 the list of valid using clauses after they have been validated.
95 The above change gives the proper semantics: it does not
96 senselessly report the same errors with broken using statements by
97 never storing them in the first place when they are invalid.
99 2008-11-05 Marek Safar <marek.safar@gmail.com>
101 A fix for bug #421839
102 * cs-parser.jay: Remove expression from coalesce rule to force lower
103 priority than the assignment operator.
105 2008-11-05 Marek Safar <marek.safar@gmail.com>
107 A fix for bug #437875
108 * nullable.cs: Compile correctly method group operand used with null
111 2008-11-04 Marek Safar <marek.safar@gmail.com>
113 A fix for bug #434589
114 * expression.cs (Binary): Ignore lifted conversions when at least
115 one operand is of reference type.
117 2008-11-04 Marek Safar <marek.safar@gmail.com>
119 * cs-parser.jay: Better syntax error report.
121 2008-11-03 Marek Safar <marek.safar@gmail.com>
123 A fix for bug #436792
124 * cs-parser.jay: Use GetLocation to access location.
126 2008-11-03 Marek Safar <marek.safar@gmail.com>
128 A fix for bug #440774
129 * cs-parser.jay: Also set current_array_type when parsing local
132 2008-11-03 Marek Safar <marek.safar@gmail.com>
134 A fix for bug #440785
135 * expression.cs (As): Don't resolve self modifing expression
138 2008-11-03 Marek Safar <marek.safar@gmail.com>
140 A fix for bug #439447
141 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
143 2008-11-03 Marek Safar <marek.safar@gmail.com>
145 A fix for bug #437571
146 * cs-parser.jay: Fixes internal error for invalid expression
149 2008-10-17 Marek Safar <marek.safar@gmail.com>
151 * ecore.cs: Resolve correctly ambiguous params delegate methods.
153 2008-10-17 Marek Safar <marek.safar@gmail.com>
155 * generic.cs, anonymous.cs: Simplified GetDeclarations.
157 2008-10-17 Marek Safar <marek.safar@gmail.com>
159 * cs-tokenizer.cs: More precise cast parsing.
161 2008-10-16 Martin Baulig <martin@ximian.com>
163 * anonymous.cs (AnonymousMethodStorey): Put back the
164 `hoisted_locals' hashtable and use it in EmitType().
166 2008-10-15 Marek Safar <marek.safar@gmail.com>
168 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
169 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
172 2008-10-14 Marek Safar <marek.safar@gmail.com>
174 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
176 2008-10-14 Marek Safar <marek.safar@gmail.com>
178 * statement.cs: Mutate scope initializers.
180 2008-10-14 Marek Safar <marek.safar@gmail.com>
182 * expression.cs: Use typeless value for This constant.
184 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
186 2008-10-14 Marek Safar <marek.safar@gmail.com>
188 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
191 2008-10-13 Marek Safar <marek.safar@gmail.com>
193 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
196 2008-10-13 Marek Safar <marek.safar@gmail.com>
198 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
199 parser and tokenizer. Fixes many ambiguities including #433258.
201 2008-10-10 Marek Safar <marek.safar@gmail.com>
203 * cs-parser.jay: Fixed missing accessor recovery.
205 2008-10-10 Marek Safar <marek.safar@gmail.com>
207 A fix for bug #433701
208 * expression.cs: Better error message.
210 2008-10-10 Marek Safar <marek.safar@gmail.com>
212 * cs-parser.jay, expression.cs: Start reporting real parser errors.
214 * Makefile: Disabled unused debug symbols.
216 Also fixes: #320556, #321097, #321656, #321876, #351316
218 2008-10-09 Miguel de Icaza <miguel@novell.com>
220 * eval.cs: rename "<interactive>" to "{interactive}", to work
221 around a requirement in the compiler that this be a valid
222 filename, and in Windows it is not (433886).
224 2008-10-09 Marek Safar <marek.safar@gmail.com>
226 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
228 2008-10-08 Marek Safar <marek.safar@gmail.com>
230 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
231 cs-parser.jay: Generic type declaration and type arguments cleanup.
233 2008-10-05 Marek Safar <marek.safar@gmail.com>
235 * cs-parser.jay: Allow parsing weird array creation construct.
237 2008-10-05 Marek Safar <marek.safar@gmail.com>
239 * cs-parser.jay: Conflicts reduction.
241 2008-10-04 Marek Safar <marek.safar@gmail.com>
243 * cs-parser.jay: Conflicts reduction.
245 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
248 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
249 property. Add a 'count' hint about the use of the shared vector.
250 Ensure that we don't leak out dirty bits.
251 (UsageVector.MergeChild): Throw away information about variables
253 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
255 2008-10-03 Marek Safar <marek.safar@gmail.com>
257 A fix for bug #431746
258 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
259 parameters when iterator is created.
261 2008-10-03 Marek Safar <marek.safar@gmail.com>
263 A fix for bug #431827
264 * expression.cs: Fixed right based pointer arithmetic operations
267 2008-10-03 Marek Safar <marek.safar@gmail.com>
269 A fix for bug #353779
270 * assign.cs, expression.cs: Fixed compound assignment conversions.
272 2008-10-02 Marek Safar <marek.safar@gmail.com>
274 A fix for bug #375262
275 * statement.cs: Refactor ArrayForeach to be usable with string
276 indexer. Optimized single dimentional arrays foreach.
278 2008-10-02 Marek Safar <marek.safar@gmail.com>
280 A fix for bug #431255
281 * anonymous.cs, expression.cs: Removed broken optimization.
283 2008-10-01 Marek Safar <marek.safar@gmail.com>
285 * anonymous.cs: Use full type parameters of parent generic
286 containers. Removed unnecessary AddParentStoreyReference call.
288 2008-10-01 Marek Safar <marek.safar@gmail.com>
290 A fix for bug #324702
291 * class.cs: Use better shorter names for explicit interface member
294 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
296 2008-10-01 Marek Safar <marek.safar@gmail.com>
298 * expression.cs: Use new interface to check fixed expression.
300 2008-10-01 Marek Safar <marek.safar@gmail.com>
302 A fix for bug #421101
303 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
304 interface to check for fixed fixed-buffers.
306 2008-10-01 Marek Safar <marek.safar@gmail.com>
308 A fix for bug #429264
309 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
311 * delegate.cs: Removed unnecessary casts.
313 2008-09-30 Marek Safar <marek.safar@gmail.com>
315 A fix for bug #352151
316 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
317 class.cs: Fixed already defined explicit interface members check.
319 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
321 cs-tokenizer.cs: Fix typo.
323 2008-09-28 Miguel de Icaza <miguel@novell.com>
325 * eval.cs (InteractiveBase): The quit command now just sets a
326 flag, instead of calling Environment.Exit(), it is milder on
329 CompiledMethod is now in Mono.CSharp, not nested inside
330 the Evaluator, it was inconvenient to use.
332 2008-09-27 Miguel de Icaza <miguel@novell.com>
334 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
335 code to be invoked without having to reparse.
337 2008-09-27 Miguel de Icaza <miguel@novell.com>
339 * ecore.cs: The recent changes to FieldExpr broke this as well.
340 Fixes LINQ queries in the interactive shell.
342 * Multiple files: indentation fixing for the Mono coding
343 guidelines for the switch statement.
345 * eval.cs: Make the Evaluator API thread safe.
347 2008-09-26 Marek Safar <marek.safar@gmail.com>
349 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
352 2008-09-26 Marek Safar <marek.safar@gmail.com>
354 A fix for bug #325326
355 * statement.cs: Check possible mistaken empty statement using
356 explicit blocks only.
358 2008-09-25 Miguel de Icaza <miguel@novell.com>
360 * eval.cs (LoadAssembly, ReferenceAssembly): Call
361 RootNamespace.ComputeNamespaces to update the internal list of
362 namespaces, this is no longer done for us.
364 (InteractiveBase): Use the Evaluator APIs instead of calling into
367 2008-09-25 Marek Safar <marek.safar@gmail.com>
369 A fix for bug #429264
370 * expression.cs: Missing mutator for access to multidimensional
373 2008-09-25 Marek Safar <marek.safar@gmail.com>
375 * class.cs, statement: Emit DebuggerHidden attribute for iterator
378 * driver.cs: Missing input argument check.
380 2008-09-25 Marek Safar <marek.safar@gmail.com>
382 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
383 expression.cs, statement.cs, rootcontext.cs, class.cs,
384 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
387 2008-09-24 Miguel de Icaza <miguel@novell.com>
389 * ecore.cs (FieldExpr): Only initialize eclass when we return a
390 fully constructed FieldExpr, fixes the regression introduced in
393 * ecore.cs, expression.cs: Plug back the eclass initialization as
394 otherwise it regresses `csharp'.
396 2008-09-24 Marek Safar <marek.safar@gmail.com>
398 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
399 ecore.cs, attribute.cs: Moved obsolete method checks from emit
400 phase to resolve phase. It resolves problems with expression trees
401 and fixes bugs #323796, #325156.
403 2008-09-23 Marek Safar <marek.safar@gmail.com>
405 * codegen.cs: Report better error when symbol writer is missing.
407 2008-09-23 Marek Safar <marek.safar@gmail.com>
409 * codegen.cs: Set .NET symbol writer.
411 * decl.cs: Guard against null generic arguments.
413 * report.cs: Don't report exactly same additional details.
415 2008-09-22 Marek Safar <marek.safar@gmail.com>
417 A fix for bug #324917
418 * cs-parser.jay: Add missing multidimensional non-expression type
421 2008-09-22 Marek Safar <marek.safar@gmail.com>
423 A fix for bug #428191
424 * anonymous.cs: Create an outer generic fields also for non-storey
427 2008-09-22 Marek Safar <marek.safar@gmail.com>
429 A fix for bug #378294
430 * class.cs: Make fixed size buffers gmcs feature only.
432 2008-09-22 Marek Safar <marek.safar@gmail.com>
434 A fix for bug #355622, #324993
435 * assign.cs, const.cs, class.cs: Create new EmitContext for each
438 2008-09-19 Marek Safar <marek.safar@gmail.com>
440 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
443 2008-09-19 Marek Safar <marek.safar@gmail.com>
445 A fix for bug #416110
446 * generic.cs: Struct constraint results in default ctor and
447 ValueType base type constraint to be set.
449 2008-09-19 Marek Safar <marek.safar@gmail.com>
451 A fix for bug #423791
452 * generic.cs: Fixed params output type type-inference.
454 2008-09-19 Marek Safar <marek.safar@gmail.com>
456 * cs-parser.jay, expression.cs: Fixed few expression crashes.
458 2008-09-19 Marek Safar <marek.safar@gmail.com>
460 * cs-tokenizer.cs: Don't break on extra partial modifier.
462 2008-09-19 Marek Safar <marek.safar@gmail.com>
464 A fix for bug #427592
465 * generic.cs: Use common parameter resolve method.
467 2008-09-18 Marek Safar <marek.safar@gmail.com>
469 A fix for bug #414758
470 * expression.cs, ecore.cs: Fixed crash when accessing non-static
473 2008-09-18 Marek Safar <marek.safar@gmail.com>
475 * driver.cs, namespace.cs: Read types and namespaces after all
476 requested assemblies are loaded, fixes issues with System.Core
477 auto-reference, and #419888.
479 2008-09-18 Marek Safar <marek.safar@gmail.com>
481 A fix for bug #417705
482 * cs-parser.jay: Fixed as/is operator expression split.
484 2008-09-18 Marek Safar <marek.safar@gmail.com>
486 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
487 Fixed expression tree representation of empty new expression and
488 new initializer expression.
490 2008-09-18 Miguel de Icaza <miguel@novell.com>
492 * eval.cs: Remove warning, keep reference to driver around.
494 * Hide fields that do not need to be public.
496 2008-09-17 Marek Safar <marek.safar@gmail.com>
498 A fix for bug #426385
499 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
500 conversion for array elements.
502 2008-09-17 Marek Safar <marek.safar@gmail.com>
504 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
505 void parsing conflicts.
507 2008-09-15 Marek Safar <marek.safar@gmail.com>
509 A fix for bug #425601
510 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
511 System.Core only when there is no custom ExtensionAttribute
514 2008-09-15 Miguel de Icaza <miguel@novell.com>
516 * namespace.cs: Do not report CS0246 (name
518 2008-09-12 Marek Safar <marek.safar@gmail.com>
520 A fix for bug #425669
521 * generic.cs: Don't cache generic static anonymous method
524 2008-09-12 Marek Safar <marek.safar@gmail.com>
526 * generic.cs, class.cs, delegate.cs: Check recursive inherited
527 conflicting constraints.
529 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
531 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
534 2008-09-12 Marek Safar <marek.safar@gmail.com>
536 * literal.cs, convert.cs, expression.cs, statement.cs: More null
537 to null pointer conversion fixes.
539 2008-09-11 Marek Safar <marek.safar@gmail.com>
541 * cs-parser.jay, expression.cs: An implicitly typed local variable
542 declarator cannot use an array initializer.
544 2008-09-11 Marek Safar <marek.safar@gmail.com>
546 * cs-parser.jay: Reduced number of printed tokens, add sorting.
548 2008-09-11 Marek Safar <marek.safar@gmail.com>
550 * generic.cs (InflatedConstraints): Don't crash when constraints
553 * cs-parser.jay: const_declarator is a block.
555 * constant.cs: Check for not allowed NaN conversions.
557 2008-09-10 Miguel de Icaza <miguel@novell.com>
559 * driver.cs: Drop --shell argument, the compiler is no longer a
562 * eval.cs: Move most of the code that deals with evaluation into
563 this file and document the public API from repl.cs
565 * repl.cs: Remove from here.
567 2008-09-10 Marek Safar <marek.safar@gmail.com>
569 A fix for bug #424684
570 * generic.cs: Generic class constraints must come first.
572 2008-09-09 Miguel de Icaza <miguel@novell.com>
574 * cs-parser.jay: Improve error reporting for syntax errors in
575 statements and expressions, we now report the expected tokens
576 instead of reporting the useless "; expected".
578 Drop the strings from the token declaration, it turns out that
579 they did not do what I thought they did. Instead they were adding
580 two sets of tokens to the tables.
582 2008-09-09 Marek Safar <marek.safar@gmail.com>
584 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
585 delegate.cs: Share special type check.
587 2008-09-09 Marek Safar <marek.safar@gmail.com>
589 A fix for bug #423981
590 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
592 2008-09-09 Marek Safar <marek.safar@gmail.com>
594 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
597 2008-09-09 Marek Safar <marek.safar@gmail.com>
599 A fix for bugs: #324750, #335946
600 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
601 lookup rule to determine ?-based tokens.
603 2008-09-08 Miguel de Icaza <miguel@novell.com>
605 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
606 expressions (like event adding or removing) end up here, so we
607 need to treat those as statements.
609 Add LoadAssembly method.
611 2008-09-04 Miguel de Icaza <miguel@novell.com>
613 * repl.cs: Add Time method.
615 2008-09-05 Marek Safar <marek.safar@gmail.com>
617 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
619 2008-09-05 Miguel de Icaza <miguel@novell.com>
621 * repl.cs: Add workaround for old compilers.
623 2008-09-04 Jb Evain <jbevain@novell.com>
625 * repl.cs (PrettyPrint): pretty print everything that
626 implements IDictionary, as well as IEnumerables. Also,
627 add a quit helper property.
629 2008-09-04 Marek Safar <marek.safar@gmail.com>
631 * constant.cs: Better error reporting for decimal literals.
633 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
636 2008-09-04 Marek Safar <marek.safar@gmail.com>
637 Miguel de Icaza <miguel@novell.com>
639 A fix for bug #422951
640 * assign.cs (Assign.DoResolve): Perform the type conversions
641 checks before we attempt to initialize `New' initializers.
643 2008-09-04 Marek Safar <marek.safar@gmail.com>
645 A fix for bug #422853
646 * delegate.cs (DelegateCreation): Add special handling for
647 EmptyExpression.Null instance expression which is just another
648 hack for undecided member instance exression.
650 2008-09-04 Marek Safar <marek.safar@gmail.com>
652 * expression.cs, ecore.cs: Emit full expression tree for reduced
655 2008-09-04 Marek Safar <marek.safar@gmail.com>
657 * expression.cs (This): Guard against multi-resolving.
659 * ecore.cs, statement.cs (Throw): Simplified.
661 * flowanalysis.cs: Also verify event fields.
663 2008-09-04 Miguel de Icaza <miguel@novell.com>
665 * assign.cs (Assign.DoResolve): Perform the type conversions
666 checks before we attempt to initialize `New' initializers.
668 * repl.cs (PrettyPrint): Add Hashtable prettyprint
670 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
673 * repl.cs: Update help.
675 2008-09-03 Miguel de Icaza <miguel@novell.com>
677 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
678 handling of the default config handling, including the special
679 treatment of System.Core assembly.
681 Fixes the REPL processing for LINQ.
683 2008-09-03 Marek Safar <marek.safar@gmail.com>
685 A fix for bug #422507
686 * expression.cs (UnboxCast): Add missing child expression mutator.
688 2008-09-03 Marek Safar <marek.safar@gmail.com>
690 * driver.cs: Don't self reference System.Core assembly.
692 2008-09-03 Marek Safar <marek.safar@gmail.com>
694 A fix for bug #422507
695 * expression.cs (StringConcat): Add missing type mutator.
697 2008-09-03 Marek Safar <marek.safar@gmail.com>
699 * generic.cs (TypeInferenceContext): Follow equality rule for
700 constructed type lower bound type inference.
702 2008-09-02 Miguel de Icaza <miguel@novell.com>
704 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
705 <dblank@cs.brynmawr.edu> which updates the cursor position on
708 2008-09-02 Marek Safar <marek.safar@gmail.com>
710 A fix for bug #367145
711 * driver.cs: Fixed import of extension methods when using -noconfig
714 2008-09-02 Marek Safar <marek.safar@gmail.com>
716 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
717 version from non-generic implementation instead.
719 2008-09-01 Marek Safar <marek.safar@gmail.com>
721 A fix for bug #418908
722 * class.cs: Use AddScopeStatement for field initializers.
724 2008-09-01 Marek Safar <marek.safar@gmail.com>
726 A fix for bug #415385
727 * ecore.cs, convert.cs: Do method group conversion for equal group types.
729 2008-09-01 Marek Safar <marek.safar@gmail.com>
731 A fix for bug #421736
732 * iterators.cs: Don't crash on unreachable iterators.
734 2008-09-01 Marek Safar <marek.safar@gmail.com>
736 A fix for bug #421628
737 * parameter.cs, attribute.cs: Clone also parameter attributes.
739 2008-08-30 Miguel de Icaza <miguel@novell.com>
741 * namespace.cs (LookupType): In EvalMode, try to replace
742 the TypeBuilder from our cache with a Type as Reflection.Emit does
743 not like to mix code from older assemblies emitted and new
746 This sounds like a serious Mono bug that prevents multiple
747 assemblies to be generated and consumed at the same time.
749 * cs-parser.jay (push_current_class): Do not make interactive
750 classes internal or private, make them public as we currently
751 generate each new class in a new assembly.
753 2008-08-29 Miguel de Icaza <miguel@novell.com>
755 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
756 remove types that are entered into the global namespace during
757 parsing so that we can remove them on failure.
759 * cs-parser.jay: Parsing: we now keep track of types that are
760 entered into global variables and queue those in case the parsing
763 This happens in a few situations: during partial-input, we invoke
764 the parser repeatedly for example with the string "class X", this
765 would cause X to be registed, and we need to remove this
766 registration so that another parse attempt later with say "class X {"
769 Additionally, if there is an error in the resolution phase, for
770 example: "class X : NonExistant {}" th
772 * cs-parser.jay: Be more precise with the errors being raised,
773 instead of flagging all exceptions during parsing to be attributed
774 to the parsing process, distinguish those from errors happening in
775 the actions and hint that using -v would produce the actual
778 * repl.cs: Do not load all compiler references on each reset,
779 doing the partial reset takes care of this.
781 2008-08-28 Miguel de Icaza <miguel@novell.com>
783 * repl.cs: Add support for loading all the files from
784 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
787 Introduce a micro-parser that is able to deambiguate on its input
788 whether we are dealing with a compilation unit (namespace, class,
789 interface, struct, delegate) declaration or a statement. This
790 allows both declarations and statements to be entered.
792 Set history size by default to 300 lines.
794 Instead of distinguishing based on the parser.InteractiveResult,
795 have only two cases: statements were parsed, or a compilation unit
796 was. Always pull the Using statement additions from the
797 compilation unit parse.
799 * cs-tokenizer.cs: Rename tokens to better describe their intent
800 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
802 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
803 EvalMode is used to trigger the lookup of global variables while
804 StatementMode is used turn variable declarations into static
807 * getline.cs: Allow history size to be set.
809 2008-08-29 Marek Safar <marek.safar@gmail.com>
811 A fix for bug #360755
812 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
814 2008-08-29 Marek Safar <marek.safar@gmail.com>
816 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
818 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
819 member name, it is too confusing
821 * decl.cs, class.cs: Don't report unused fields with attached attribute.
823 * rootcontext.cs: Finally default to warning level 4.
825 2008-08-28 Marek Safar <marek.safar@gmail.com>
827 * class.cs (CheckBase): Ignore overloaded operators.
829 2008-08-28 Marek Safar <marek.safar@gmail.com>
831 A fix for bug #420830
832 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
834 2008-08-28 Marek Safar <marek.safar@gmail.com>
836 A fix for bug #420832
837 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
839 2008-08-28 Marek Safar <marek.safar@gmail.com>
841 A fix for bug #420386
842 * nullables.cs: Fixed logic of nullable user comparison operators involving
845 2008-08-28 Marek Safar <marek.safar@gmail.com>
847 * attribute (IsClsCompliant): Use FALSE value for pointer types.
849 2008-08-27 Miguel de Icaza <miguel@novell.com>
851 * repl.cs: Add support for aborting the running code with C-c.
853 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
855 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
857 2008-08-27 Miguel de Icaza <miguel@novell.com>
859 * cs-parser.jay (interactive_statement_list): A new set of rules
860 for hosting statements that uses the "interactive_" prefix.
862 * repl.cs: Add support for parsing `using' as a statement or as a
863 directive. Deambiguating before passing this to the parser.
865 We need to distinguish statement_expressions that occur at the
866 toplevel vs those that occur embedded into expressions.
868 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
869 that fixes the cursor key handling, and a history bug.
871 2008-08-26 Miguel de Icaza <miguel@novell.com>
873 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
874 limitations in Console, instead the 2.0 bootstrap libraries now
875 include the Console bits.
877 Also, remove the use of Nullables from getline.cs
881 Interactive support for the C# compiler. Use gmcs --shell to
882 enter a read-eval-print loop shell.
884 Docs: http://www.mono-project.com/CsharpRepl
886 * sources: include repl.cs here and getline.cs for gmcs.exe,
887 everything else is getline.cs impaired.
889 * Makefile: when bootstrapping pass a special flag
890 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
891 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
892 This distinguishes those two cases.
894 * repl.cs: Support for a read-eval-print loop. Will be soon
895 refactored into eval support and then REPL on top of it.
897 * ecore.cs: If a simplename lookup fails, before erroring out,
898 if we are in EvalMode to resolve the name to a declaration in the
901 This means that variable declarations that happened in previous
902 classes (as repl puts every statement in a separate class) are
903 made visible in this way.
905 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
906 triggered an error due to the end of file being reached. This is
907 used to do multi-line input, and notify the caller that the user
908 needs to provide more text before a successful parse.
910 Add new grammar rules after the INTERACTIVE_PARSER token is seen
911 to drive the evaluation with a custom wrapper.
913 * driver.cs: Add support for --shell, and refactor some code to be
916 * namespace.cs: Add support for serializing the contents of the
917 namespaces and reloading them.
919 * getline.cs: A managed implementation of ReadLine under
920 X11/Apache2 license terms. Easy to embed in other applications as
923 * namespace.cs: Add some functions to save and restore the
926 * rootcontext.cs: New public field.
928 * cs-tokenizer.cs: Add support for one of the possible characters
929 we introduce into the token stream.
931 This patch does not affect the regular tokenization process, the
932 only performance hit would happen if there is an invalid character
935 * support.cs: Move isatty helper routine here.
937 * codegen.cs: Small cleanup, and add a mechanism to initialize the
938 code generator for in-memory assemblies.
940 2008-08-26 Marek Safar <marek.safar@gmail.com>
942 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
943 parameter cannot be always used as a type.
945 2008-08-21 Marek Safar <marek.safar@gmail.com>
947 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
949 2008-08-21 Marek Safar <marek.safar@gmail.com>
951 * convert.cs: Implement explicit array to IList<T> conversion.
953 2008-08-20 Marek Safar <marek.safar@gmail.com>
955 A fix for bug #362740
956 * cs-tokenizer.cs: Handle UTF-16 surrogates.
958 2008-08-20 Marek Safar <marek.safar@gmail.com>
960 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
961 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
962 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
963 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
964 handling to use just one type of infrastructure and deal with generics
967 2008-07-23 Martin Baulig <martin@ximian.com>
969 *** Merged this from trunk revision 108527 ***
972 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
973 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
976 2008-08-15 Marek Safar <marek.safar@gmail.com>
978 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
981 2008-08-15 Marek Safar <marek.safar@gmail.com>
983 * delegate.cs: Fixed compiler crash when creating delegate using partial
986 * typemanager.cs: MulticastDelegate is not a delegate.
988 2008-08-14 Marek Safar <marek.safar@gmail.com>
990 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
993 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
995 * cs-parser.jay (type): Allow 'var' in mcs too.
996 (local_variable_type): Likewise.
998 2008-08-14 Marek Safar <marek.safar@gmail.com>
1000 * driver.cs: Removed broken -noconfig variants.
1002 2008-08-14 Marek Safar <marek.safar@gmail.com>
1004 A fix for bug #417078
1005 * expression.cs: Emit correctly left side pointer operators.
1007 2008-08-13 Marek Safar <marek.safar@gmail.com>
1009 * generic.cs, lambda.cs: Inflate method generic arguments only.
1011 2008-08-12 Marek Safar <marek.safar@gmail.com>
1013 * class.cs: Fixed struct layout check regression.
1015 2008-08-12 Marek Safar <marek.safar@gmail.com>
1017 * cs-parser.jay, enum.cs: Simplified enum parsing.
1019 * decl.cs: Check all type parameters conflicts.
1021 * expression.cs, statement.cs, attribute.cs: More expression checks.
1023 2008-08-11 Marek Safar <marek.safar@gmail.com>
1025 * generic.cs: Add type inference types restriction.
1027 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
1028 anonymous.cs, expression.cs: Allocate less accessor parameters.
1030 2008-08-08 Marek Safar <marek.safar@gmail.com>
1032 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
1035 2008-08-08 Marek Safar <marek.safar@gmail.com>
1037 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
1039 2008-08-07 Marek Safar <marek.safar@gmail.com>
1041 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
1042 Also fixes #362146 and #381592.
1044 2008-08-07 Marek Safar <marek.safar@gmail.com>
1046 * ecore.cs: Reduced constant cannot be used as an attribute value.
1048 * cs-parser.jay: Base expression has to be a type.
1050 * expression.cs (Conditional): Uses ReducedExpression.
1052 2008-08-06 Marek Safar <marek.safar@gmail.com>
1054 A fix for bug #376826
1055 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
1056 address of hoisted local variable or parameter cannot be taken.
1058 2008-08-05 Marek Safar <marek.safar@gmail.com>
1060 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
1061 anonymous method inside checked/unchecked expression.
1063 2008-08-05 Marek Safar <marek.safar@gmail.com>
1065 * typemanager.cs (IsEqual): Guard against null.
1067 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
1068 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
1069 routine. Fixed few misleading conversion errors.
1071 2008-08-04 Marek Safar <marek.safar@gmail.com>
1073 * class.cs: Consider generics when checking cycles in struct layout.
1075 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
1077 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
1079 2008-08-04 Marek Safar <marek.safar@gmail.com>
1081 A fix for bug #414165
1082 * anonymous.cs: Use same anonymous implementation method for all anonymous
1085 2008-08-04 Marek Safar <marek.safar@gmail.com>
1087 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
1090 2008-08-04 Marek Safar <marek.safar@gmail.com>
1092 * cs-parser.jay: Typeof argument has to be a type expression.
1094 * namespace.cs: Check alias and namespace definitions collisions.
1096 * class.cs, pending.cs: Moved explicit interface accessor implementation
1099 * delegate.cs, expression.cs: Verify special name invocations.
1101 2008-08-01 Marek Safar <marek.safar@gmail.com>
1103 * cs-parser.jay: Don't choke on empty generic type arguments.
1105 * cs-tokenizer.cs: Handle escaped preprocessor directives.
1107 * expression.cs, ecore.cs: Minor expressions bugs.
1109 2008-08-01 Marek Safar <marek.safar@gmail.com>
1111 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
1112 and added more error handling.
1114 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
1116 * modifiers.cs, enum.cs: Fixed.
1118 2008-07-31 Jb Evain <jbevain@novell.com>
1120 * driver.cs: remove -pkg ability of smcs.
1122 2008-07-30 Marek Safar <marek.safar@gmail.com>
1124 * statement.cs (Switch): Correctly set empty default target for single
1127 2008-07-30 Marek Safar <marek.safar@gmail.com>
1129 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
1130 string switch statement implementation to use string dictionary which
1131 significantly (2-8x) improves performance of generated code.
1133 2008-07-29 Marek Safar <marek.safar@gmail.com>
1135 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
1136 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
1138 2008-07-29 Marek Safar <marek.safar@gmail.com>
1140 A fix for bug #412595
1141 * typemanager.cs, convert.cs, expression.cs: Some types are never
1142 convertible to each other.
1144 2008-07-29 Marek Safar <marek.safar@gmail.com>
1146 * nullable.cs (CreateNullConstant): An error messages update.
1148 2008-07-29 Marek Safar <marek.safar@gmail.com>
1150 A fix for bug #412595
1151 * cfold.cs: Don't cast undefined bool constant.
1153 2008-07-29 Martin Baulig <martin@ximian.com>
1156 (SymbolWriter.Reset): New public static method.
1159 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
1161 2008-07-28 Marek Safar <marek.safar@gmail.com>
1163 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
1165 * expression.cs (ElementAccess): Exact size allocation.
1167 2008-07-26 Marek Safar <marek.safar@gmail.com>
1169 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
1171 2008-07-25 Marek Safar <marek.safar@gmail.com>
1173 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
1175 * class.cs: Removed $PRIVATE$ field hack which caused problems during
1178 2008-07-25 Marek Safar <marek.safar@gmail.com>
1180 A fix for bug #412217
1181 * assign.cs: Mutate also assignment type.
1183 2008-07-25 Marek Safar <marek.safar@gmail.com>
1185 A fix for bug #323644
1186 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
1189 2008-07-25 Marek Safar <marek.safar@gmail.com>
1191 A fix for bug #412134
1192 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
1193 non-enumerable operands when overloading equality or bitwise operators.
1195 2008-07-25 Marek Safar <marek.safar@gmail.com>
1197 * anonymous.cs: Cache closed generic anonymous method delegates.
1199 2008-07-24 Marek Safar <marek.safar@gmail.com>
1201 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
1202 anonymous.cs, statement.cs: Always emit anonymous method as static method
1203 when is instance free. Use nesting for nested anynomous methods blocks.
1205 2008-07-23 Marek Safar <marek.safar@gmail.com>
1207 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
1210 2008-07-23 Marek Safar <marek.safar@gmail.com>
1212 * expression.cs: Removed MakeSimpleCall.
1214 2008-07-23 Marek Safar <marek.safar@gmail.com>
1216 A fix for bug #323012
1217 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
1218 Base method implementing interface has to be public.
1220 2008-07-23 Marek Safar <marek.safar@gmail.com>
1222 * cs-parser.jay: Don't break on missing argument.
1224 2008-07-22 Marek Safar <marek.safar@gmail.com>
1226 A fix for bug #320993
1227 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
1228 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
1230 2008-07-22 Marek Safar <marek.safar@gmail.com>
1232 A fix for bug #320748
1233 * convert.cs: Implicit user operators cannot convert to interfaces
1235 2008-07-22 Marek Safar <marek.safar@gmail.com>
1237 A fix for bug #312686
1238 * driver.cs: Ignore empty assembly references.
1240 2008-07-22 Marek Safar <marek.safar@gmail.com>
1242 A fix for bug #387040
1243 * ecore.cs: Skip constrains check for an explicit implementation.
1245 2008-07-21 Marek Safar <marek.safar@gmail.com>
1247 A fix for bug #409045
1248 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
1249 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
1250 identifiers are file specific unless passed as input arguments.
1252 2008-07-21 Marek Safar <marek.safar@gmail.com>
1254 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
1255 to emit UnmanagedMarshal data under 2.0 profile.
1257 2008-07-21 Marek Safar <marek.safar@gmail.com>
1259 A fix for bug #410369
1260 * parameter.cs: Clone correctly ParamsParameter.
1262 2008-07-21 Marek Safar <marek.safar@gmail.com>
1264 * expression.cs (Argument): Always report type for type based expressions
1267 2008-07-18 Marek Safar <marek.safar@gmail.com>
1269 A fix for bug #410666
1270 * anonymous.cs: Correctly initialize generic storey reference.
1272 2008-07-18 Marek Safar <marek.safar@gmail.com>
1274 * convert.cs: Don't box same type arguments.
1276 2008-07-18 Marek Safar <marek.safar@gmail.com>
1278 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
1279 Finished missing generic type mutators.
1281 2008-07-18 Marek Safar <marek.safar@gmail.com>
1283 * iterators.cs, statement.cs: Finished statements CloneTo.
1285 2008-07-18 Marek Safar <marek.safar@gmail.com>
1287 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
1289 * expression.cs: Emit optimized default value expressions in expression tree
1292 2008-07-18 Marek Safar <marek.safar@gmail.com>
1294 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
1296 2008-07-17 Marek Safar <marek.safar@gmail.com>
1298 A fix for bug #367536
1299 * cs-parser.jay: Check static constructor of generic types for an access
1302 2008-07-17 Marek Safar <marek.safar@gmail.com>
1304 A fix for bug #353800
1305 * lambda.cs: Emit ret for contextual statements.
1307 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
1308 up emitting redundant ret for all anonymous methods with return.
1310 2008-07-17 Marek Safar <marek.safar@gmail.com>
1312 A fix for bug #365188
1313 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
1314 create anonymous method storey in unreachable block.
1316 2008-07-17 Marek Safar <marek.safar@gmail.com>
1318 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
1319 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
1320 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
1321 statement.cs: Fixed relevant defects found by Gendarme.
1323 2008-07-17 Marek Safar <marek.safar@gmail.com>
1325 A fix for bug #325291
1326 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
1327 statement.cs: Replaced IAnonymousHost with top level block flag.
1329 2008-07-17 Marek Safar <marek.safar@gmail.com>
1331 * cs-parser.jay: Clean up unused open_parens.
1333 2008-07-17 Marek Safar <marek.safar@gmail.com>
1335 * ecore.cs: Custom error message for a range variable assignment.
1337 2008-07-16 Marek Safar <marek.safar@gmail.com>
1339 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
1342 2008-07-16 Marek Safar <marek.safar@gmail.com>
1344 * literal.cs: Null literal is of object type.
1346 2008-07-16 Marek Safar <marek.safar@gmail.com>
1348 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
1349 expression of nullable equality comparison.
1351 2008-07-15 Marek Safar <marek.safar@gmail.com>
1353 * expression.cs(PointerArithmetic): Removed redundant assignment.
1355 2008-07-15 Marek Safar <marek.safar@gmail.com>
1357 * decl.cs (GetSignatureForError): Report full namespace name for containers.
1359 2008-07-14 Marek Safar <marek.safar@gmail.com>
1361 A fix for bug #408361
1362 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
1363 they are replaced by GetMethod.
1365 2008-07-14 Marek Safar <marek.safar@gmail.com>
1367 A fix for bug #408721 by jeremie.laval@gmail.com
1368 * expression.cs (Indirection): Implemented CloneTo.
1370 2008-07-14 Marek Safar <marek.safar@gmail.com>
1372 * statement.cs (AssignableSlots): Temporary disabled variable initialization
1375 2008-07-14 Marek Safar <marek.safar@gmail.com>
1377 * report.cs (EnableReporting): Don't reinitialize 0-based values.
1379 2008-07-11 Marek Safar <marek.safar@gmail.com>
1381 * linq.cs: Reset tranparent parameter counter in probing mode.
1383 2008-07-11 Marek Safar <marek.safar@gmail.com>
1385 * anonymous.cs: Mutate anonymous method type.
1387 2008-07-11 Marek Safar <marek.safar@gmail.com>
1389 * ecore.cs, anonymous.cs: Mutate field expressions.
1391 2008-07-10 Marek Safar <marek.safar@gmail.com>
1393 A fix for bug #369670
1394 * linq.cs, statement.cs: Use explicit block for query expressions variables.
1396 2008-07-10 Marek Safar <marek.safar@gmail.com>
1398 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
1400 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
1403 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
1404 only one '>', and finds a '>>', abort the generic lookahead.
1406 2008-07-10 Marek Safar <marek.safar@gmail.com>
1408 A fix for bug #319902
1409 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
1411 2008-07-10 Marek Safar <marek.safar@gmail.com>
1413 A fix for bug #406371
1414 * statement.cs: Moved EmitSymbolInfo to Block.
1416 2008-07-09 Marek Safar <marek.safar@gmail.com>
1418 * ecore.cs: Report better error for extension method overload failures.
1420 2008-07-09 Marek Safar <marek.safar@gmail.com>
1422 * expression.cs (Is): No need to box reference values.
1424 2008-07-09 Marek Safar <marek.safar@gmail.com>
1426 * class.cs: Use event resolve context when initializing CreateEmitContext.
1428 2008-07-09 Marek Safar <marek.safar@gmail.com>
1430 A fix for bug #394436
1431 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
1432 method used inside expression trees. Added more LINQ to expression tree
1435 2008-07-08 Marek Safar <marek.safar@gmail.com>
1437 A fix for bug #378189, #370577
1438 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
1441 2008-07-08 Marek Safar <marek.safar@gmail.com>
1443 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
1446 2008-07-08 Marek Safar <marek.safar@gmail.com>
1448 A fix for bug #406702
1449 * anonymous.cs: Always park anonymous method in the nearest parent storey.
1451 2008-07-07 Marek Safar <marek.safar@gmail.com>
1453 A fix for bug #406648
1454 * cs-parser.jay: Report nullable use in mcs for some cases.
1456 2008-07-07 Marek Safar <marek.safar@gmail.com>
1458 * ecore.cs: Improved argument mismatch error messages.
1460 2008-07-07 Marek Safar <marek.safar@gmail.com>
1462 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
1464 2008-07-07 Marek Safar <marek.safar@gmail.com>
1466 * expression.cs (TypeOf): Mutate type argument.
1468 2008-07-04 Marek Safar <marek.safar@gmail.com>
1470 * class.cs: Report missing partial modifier for correct type.
1472 2008-07-04 Marek Safar <marek.safar@gmail.com>
1474 * ecore.cs, expression.cs (VariableReference): Variable property is
1477 2008-07-04 Marek Safar <marek.safar@gmail.com>
1479 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
1481 2008-07-04 Marek Safar <marek.safar@gmail.com>
1483 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
1486 2008-07-04 Marek Safar <marek.safar@gmail.com>
1488 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
1489 anonymous method storey to an instance method when only "this" is hoisted.
1491 2008-07-03 Marek Safar <marek.safar@gmail.com>
1493 A fix for bug #321615
1494 * expression.cs: Pointer comparisons use unsigned operator.
1496 2008-07-03 Marek Safar <marek.safar@gmail.com>
1498 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
1500 2008-07-02 Marek Safar <marek.safar@gmail.com>
1502 A fix for bug #404905
1503 * class.cs: Always initialize local unsafe variables.
1505 2008-06-30 Marek Safar <marek.safar@gmail.com>
1507 A fix for bug #396987
1508 * expression.cs (NewInitialize): Clear local temporary variable for next run
1510 2008-06-27 Marek Safar <marek.safar@gmail.com>
1512 A fix for bug #401020
1513 * ecore.cs: Both types and modifiers have to match for ref and out arguments
1515 2008-06-27 Marek Safar <marek.safar@gmail.com>
1517 A fix for bug #398319
1518 * cs-parser.jay: Implemented undocumented base access expression inside
1521 2008-06-26 Marek Safar <marek.safar@gmail.com>
1523 A fix for bug #404227
1524 * cs-parser.jay: Parse namespace declaration using qualified identifier.
1526 2008-06-26 Marek Safar <marek.safar@gmail.com>
1528 A fix for bug #404227
1529 * convert.cs: Fixed explicit array to interface cast.
1531 2008-06-26 Marek Safar <marek.safar@gmail.com>
1533 A fix for bug #403894
1534 * delegate.cs: Mutate DelegateInvocation type.
1536 2008-06-26 Marek Safar <marek.safar@gmail.com>
1538 A fix for bug #379348
1539 * delegate.cs: Box a load of generic parameters.
1541 2008-06-26 Marek Safar <marek.safar@gmail.com>
1543 * expression.cs: Add an array creation arguments mutate.
1545 2008-06-26 Marek Safar <marek.safar@gmail.com>
1547 A fix for bug #386068
1548 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
1551 2008-06-25 Marek Safar <marek.safar@gmail.com>
1553 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
1556 2008-06-25 Marek Safar <marek.safar@gmail.com>
1558 A fix for bug #403518
1559 * delegate.cs: Type correctly anonymous method new invocation.
1561 2008-06-24 Marek Safar <marek.safar@gmail.com>
1563 A fix for bug #394826
1564 * anonymous.cs: Fully qualify members when resolving anonymous type internal
1567 2008-06-24 Marek Safar <marek.safar@gmail.com>
1569 A fix for bug #394826
1570 * anonymous.cs, iterators.cs: Construct generic storey only when is really
1573 2008-06-24 Marek Safar <marek.safar@gmail.com>
1575 * class.cs: Clone indexer parameters for localized capturing.
1577 2008-06-24 Marek Safar <marek.safar@gmail.com>
1579 A fix for bug #402379
1580 * expression.cs: Don't crash when an object initializer resolve fails.
1582 2008-06-24 Marek Safar <marek.safar@gmail.com>
1584 A fix for bug #402888
1585 * expression.cs: Mutate conditional expression.
1587 2008-06-24 Marek Safar <marek.safar@gmail.com>
1589 A fix for bug #401012
1590 * class.cs: Keep StructLayout in shared container.
1592 2008-06-24 Marek Safar <marek.safar@gmail.com>
1594 A fix for bug #400438
1595 * decl.cs, class.cs: Only properties can be automatically implemented.
1597 2008-06-24 Marek Safar <marek.safar@gmail.com>
1599 * statement.cs (ChangeToIterator): Copy also labels.
1601 2008-06-23 Marek Safar <marek.safar@gmail.com>
1603 * ecore.cs: Pass type argument details to parent extension method.
1605 2008-06-23 Marek Safar <marek.safar@gmail.com>
1607 A fix for bug #375966
1608 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
1610 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
1612 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
1614 2008-06-22 Marek Safar <marek.safar@gmail.com>
1616 A fix for bug #394347
1617 * anonymous.cs: Cache compatible delegates as compatibility check produces
1618 a new method every time.
1620 2008-06-20 Marek Safar <marek.safar@gmail.com>
1622 * anonymous.cs: Propagate storey reference for single references.
1624 2008-06-20 Marek Safar <marek.safar@gmail.com>
1626 A fix for bug #387615
1627 * assign.cs, expression.cs: Correctly clone compound assignment.
1629 2008-06-19 Marek Safar <marek.safar@gmail.com>
1631 A fix for bug #359611, #359604
1632 * anonymous.cs: Mutate all types of hoisted parameters.
1634 2008-06-19 Marek Safar <marek.safar@gmail.com>
1636 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
1637 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
1638 expression.cs, codegen.cs, statement.cs
1640 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
1641 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
1643 ** Anonymous methods, lambda expressions rewrite **
1645 Anonymous expressions are now resolved when an explicit block is resolved
1646 and they don't require any registration procedure anymore. Further,
1647 anonymous methods are defined when explicit block is emitted which allows
1648 better control of whole process and opens possibilities for more
1649 optimizations as well as alternative to reverse whole process.
1651 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
1652 process consistent and to correctly emit hoisted generic methods when they
1653 have at least 1 hoisted variable.
1655 2008-06-17 Martin Baulig <martin@ximian.com>
1657 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
1659 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
1660 virtual property; check it in Emit().
1661 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
1663 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
1665 (Indexer.Define): Likewise.
1667 2008-06-17 Marek Safar <marek.safar@gmail.com>
1669 * convert.cs: Don't use IsInterface on type arguments.
1671 * delegate.cs: DelegateInvocation uses MethodInfo.
1673 * parameter.cs: Removed IsTypeParameter.
1675 * generic-mcs.cs: More missing stuff.
1677 2008-06-16 Martin Baulig <martin@ximian.com>
1680 (Modifiers.DEBUGGER_HIDDEN): New public const.
1683 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
1686 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
1687 (AbstractPropertyEventMethod): Likewise.
1688 (Constructor.Emit): Likewise.
1689 (SourceMethod.SetCompilerGenerated): Removed.
1691 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
1695 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
1696 if we're an `IteratorHost'.
1697 (AnonymousMethodMethod..ctor): Don't set
1698 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
1701 2008-06-16 Marek Safar <marek.safar@gmail.com>
1703 * statement.cs: Clean-up foreach statements.
1705 2008-06-12 Marek Safar <marek.safar@gmail.com>
1707 * class.cs: Stop using public method which should not exist
1708 (MethodBuilder.SetGenericMethodSignature).
1710 2008-06-11 Martin Baulig <martin@ximian.com>
1713 (Location.LookupFile): Add `CompilationUnit' argument; when given
1714 a relative file name, make it relative to the directory the .cs
1715 file is located in instead of using the current directory.
1717 2008-06-11 Martin Baulig <martin@ximian.com>
1720 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
1721 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
1722 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
1723 (SourceMethod.SetCompilerGenerated): Likewise.
1725 2008-06-11 Marek Safar <marek.safar@gmail.com>
1727 * codegen.cs, driver: Only write symbol file when it's asked for.
1729 2008-06-11 Marek Safar <marek.safar@gmail.com>
1731 * codegen.cs: Don't use assembly writer error handling for symbol writer.
1733 2008-06-10 Martin Baulig <martin@ximian.com>
1735 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
1737 2008-06-09 Marek Safar <marek.safar@gmail.com>
1739 A fix for bug #316290
1740 * expression.cs: Include decimal operators in predefined table.
1742 * parameters.cs: More readonlyness.
1744 2008-06-09 Marek Safar <marek.safar@gmail.com>
1746 A fix for bug #397213
1747 * cs-parser.jay: One more missing current_local_parameters reset.
1749 2008-06-09 Marek Safar <marek.safar@gmail.com>
1751 A fix for bug #396633
1752 * class.cs: Host backing field in partial container.
1754 2008-06-09 Marek Safar <marek.safar@gmail.com>
1756 A fix for bug #397068
1757 * expression.cs: Check both operand types when predefined operator is used.
1759 2008-06-05 Martin Baulig <martin@ximian.com>
1761 Merged the `debugger-kahalo' branch.
1764 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
1765 we're an iterator method.
1766 (SourceMethod): Reflect latest symbol writer changes;
1767 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
1768 now `start_row' and `end_row'.
1769 (Constructor.Emit): Fix the logic whether to emit symbol information.
1771 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
1775 (CompilationUnit): New public class; derives from `SourceFile'.
1776 (SourceFileEntry.DefineSymbolInfo): New public method.
1777 (SourceFileEntry.SetChecksum): New public method.
1778 (Location): Encode hidden line numbers by using `column == 255';
1779 the .ctor now accepts `column == -1' to mark a hidden line number.
1780 (Location.Hidden): New public property.
1781 (Location.CheckPoint): Add `CompilationUnit'.
1782 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
1783 (Location.Push): Add `CompilationUnit compile_unit' argument.
1784 (Location.CompilationUnit): New public property.
1787 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
1789 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
1791 * driver.cs: `SourceFile' -> `CompilationUnit'.
1793 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
1795 * namespace.cs: `SourceFile' -> `CompilationUnit'.
1797 * cs-tokenizer.cs: Add support for `#pragma checksum' and
1801 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
1802 new symbol writer API to also pass the file.
1804 2008-06-05 Marek Safar <marek.safar@gmail.com>
1806 * statement.cs: Emit catch variable assignment using variable expression.
1808 2008-06-05 Marek Safar <marek.safar@gmail.com>
1810 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
1811 with other variable types.
1813 2008-06-04 Marek Safar <marek.safar@gmail.com>
1815 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
1816 GetLength method emit, it breaks resolve rules.
1818 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
1819 Marek Safar <marek.safar@gmail.com>
1821 A fix for bug #395542
1822 * cs-parser.jay: The trailing comma is allowed in anonymous type member
1825 2008-06-02 Marek Safar <marek.safar@gmail.com>
1827 A fix for bug #395287
1828 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
1830 2008-05-31 Marek Safar <marek.safar@gmail.com>
1832 A fix for bug #395845
1833 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
1834 non-nullable parameter type.
1836 2008-05-31 Marek Safar <marek.safar@gmail.com>
1838 * class.cs: Handle contructor initializer as a statement in top-level block.
1840 2008-05-30 Marek Safar <marek.safar@gmail.com>
1842 * attribute.cs: Don't mix old and new corlib types when emitting corlib
1843 security attributes.
1845 2008-05-24 Marek Safar <marek.safar@gmail.com>
1847 * ecore.cs, expression.cs: Small IVariable refactoring.
1849 2008-05-22 Marek Safar <marek.safar@gmail.com>
1851 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
1853 2008-05-21 Marek Safar <marek.safar@gmail.com>
1855 * cs-parser.jay: Removed redundant catch type check.
1857 2008-05-21 Marek Safar <marek.safar@gmail.com>
1859 A fix for bug #390372
1860 * nullable.cs: Set correct return type.
1862 2008-05-21 Marek Safar <marek.safar@gmail.com>
1864 A fix for bug #391062
1865 * typemanager.cs: Fixed crash when comparing null types.
1867 2008-05-21 Marek Safar <marek.safar@gmail.com>
1869 A fix for bug #391871
1870 * cs-parser.jay: Better error handling for invalid catch type.
1872 2008-05-20 Marek Safar <marek.safar@gmail.com>
1874 A fix for bug #392155
1875 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
1877 2008-05-15 Marek Safar <marek.safar@gmail.com>
1879 A fix for bug #390666
1880 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
1883 2008-05-15 Marek Safar <marek.safar@gmail.com>
1885 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
1888 2008-05-13 Marek Safar <marek.safar@gmail.com>
1890 A fix for bug #389625
1891 * delegate.cs, generic.cs: Some progress on method group return type
1894 2008-05-13 Marek Safar <marek.safar@gmail.com>
1896 A fix for bug #378419
1897 * namespace.cs: Inspect also parent namespaces not only namespace entries.
1899 2008-05-12 Marek Safar <marek.safar@gmail.com>
1901 * class.cs (Constructor): Added IsCompilerGenerated.
1903 2008-05-12 Marek Safar <marek.safar@gmail.com>
1905 * expression.cs: Enum binary operators can accept non-enum operand only when
1906 is implicitly convertible to underlying type.
1908 2008-05-12 Marek Safar <marek.safar@gmail.com>
1910 A fix for bug #389272
1911 * support.cs: Workaround System.InvalidOperationException for enums.
1913 2008-05-12 Marek Safar <marek.safar@gmail.com>
1915 A fix for bug #389073
1916 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
1918 2008-05-10 Marek Safar <marek.safar@gmail.com>
1920 * driver.cs: Split Parse.
1922 * location.cs (LookupFile): Uses string.Empty.
1924 2008-05-07 Marek Safar <marek.safar@gmail.com>
1926 * expression.cs, parameter.cs: Small ParameterReference clean up.
1928 2008-05-07 Marek Safar <marek.safar@gmail.com>
1930 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
1931 hack. Fixes #387502.
1933 2008-05-06 Martin Baulig <martin@ximian.com>
1935 * class.cs (Constructor.Emit): Fix the logic whether to emit
1938 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
1941 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
1942 InvalidOperationException when the iterator is before the start or
1945 2008-05-06 Marek Safar <marek.safar@gmail.com>
1947 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
1948 when left is nullable type.
1950 2008-05-06 Marek Safar <marek.safar@gmail.com>
1952 A fix for bug #386628
1953 * expression.cs (LocalVariableReference): Continue in resolving when
1954 variable is not assigned.
1956 2008-05-05 Marek Safar <marek.safar@gmail.com>
1958 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
1959 nullable operations.
1961 2008-05-04 Marek Safar <marek.safar@gmail.com>
1963 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
1964 it saves many redundant temporary variables for nullable operations.
1966 2008-05-03 Marek Safar <marek.safar@gmail.com>
1968 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
1970 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
1973 * nullable.cs: Constant coalescing operator optimizations.
1975 2008-05-03 Marek Safar <marek.safar@gmail.com>
1977 * constant.cs: Use unsigned conversion for values which are unsigned only.
1979 2008-05-03 Marek Safar <marek.safar@gmail.com>
1981 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
1982 coalescing operator as it should be.
1984 2008-05-02 Marek Safar <marek.safar@gmail.com>
1986 A fix for bug #371016
1987 * expression.cs: All predefined delegate operators require implicit method
1990 2008-05-02 Marek Safar <marek.safar@gmail.com>
1992 * constant.cs: Emit long constant as uint when fits the range.
1994 * convert.cs, expression.cs: Fixed few unsafe conversions.
1996 2008-05-02 Marek Safar <marek.safar@gmail.com>
1998 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
2000 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
2003 * convert.cs (ImplicitNumericConversion): Don't modify the type of
2005 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
2007 2008-05-01 Marek Safar <marek.safar@gmail.com>
2009 * constant.cs, literal.cs: IsLiteral property for error reporting.
2011 * ecore.cs, expression.cs: Implemented Property expression.
2013 2008-05-01 Marek Safar <marek.safar@gmail.com>
2015 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
2017 * nullable.cs: Implemented nullable coalescing null operator.
2019 * ecore.cs, expression.cs: Expression trees work.
2021 2008-05-01 Marek Safar <marek.safar@gmail.com>
2023 * ecore.cs: CreateExpressionTree is finally abstract.
2025 * expression.cs, linq.cs: Updated.
2027 2008-05-01 Marek Safar <marek.safar@gmail.com>
2029 * expression.cs, ecore.cs: Block base access expression inside expression
2032 2008-05-01 Marek Safar <marek.safar@gmail.com>
2034 A fix for bug #385058
2035 * expression.cs: User-defined operator implementations always take
2036 precedence over predefined operator implementations.
2038 2008-04-30 Marek Safar <marek.safar@gmail.com>
2040 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
2041 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
2042 expression tree conversions.
2044 2008-04-30 Marek Safar <marek.safar@gmail.com>
2046 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
2047 operators method details to Operator class.
2049 2008-04-30 Marek Safar <marek.safar@gmail.com>
2051 * anonymous.cs: Pass unsafe flags to anonymous container.
2053 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
2054 inside expression tree.
2056 2008-04-29 Martin Baulig <martin@ximian.com>
2058 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
2059 (Tokenizer.PopPosition): Also restore the `line'.
2061 2008-04-29 Marek Safar <marek.safar@gmail.com>
2063 * delegate.cs: Implemented Invoke expression.
2065 2008-04-29 Marek Safar <marek.safar@gmail.com>
2067 * expression.cs: Fixed equality reference comparison regression.
2069 2008-04-29 Marek Safar <marek.safar@gmail.com>
2071 * ecore.cs: Clean up EmptyCast hack.
2073 * expression.cs, nullable.cs: Implemented enum binary and unary operations
2074 using correct conversion rules. Also fixes #383993.
2076 2008-04-28 Martin Baulig <martin@ximian.com>
2078 * class.cs (Constructor.Emit): Don't emit debugging information
2079 for generated default .ctor's.
2081 2008-04-28 Marek Safar <marek.safar@gmail.com>
2083 * convert.cs: Empty-cast ushort to int conversion.
2085 2008-04-28 Marek Safar <marek.safar@gmail.com>
2087 A fix for bug #384191
2088 * ecore.cs, expression.cs: Fixed expression cloning.
2090 2008-04-28 Marek Safar <marek.safar@gmail.com>
2092 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
2094 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
2096 Fix #381559, test-638.cs, test-639.cs
2097 * assign.cs (CompoundAssign.Helper): New wrapper.
2098 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
2100 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
2101 Pass unconverted expressions to the params array creation expression.
2102 (FieldExpr.EmitAssign): Don't special-case StringConcat.
2103 (PropertyExpr.EmitAssign): Likewise.
2104 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
2105 element if it is of kind CompoundAssign.Helper.
2106 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
2107 first before anything else.
2108 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
2109 (ArrayAccess.LoadArrayAndArguments): Simplify.
2111 2008-04-27 Marek Safar <marek.safar@gmail.com>
2113 * expression.cs: Fixed cloning of typeof(void).
2115 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
2117 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
2118 (Assign.Emit): Likewise. Move it to ...
2119 (CompoundAssign.DoResolve): ... here and ...
2120 (CompoundAssign.Emit): ... here.
2121 (EventAddOrRemove): New helper to handle += and -= on events, and
2122 avoid the use of BinaryDelegates.
2123 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
2124 (EventExpr.EmitAddOrRemove): Improve.
2125 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
2127 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
2128 create VarExprs for 'foo.bar.var'.
2129 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
2130 is a highly inappropriate name for its functionality.
2132 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
2134 Simplify handling of multiple assignments
2135 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
2137 (SimpleAssign): New. Class to be used for normal assignments.
2138 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
2139 * expression.cs, parameter.cs, statement.cs: Likewise.
2141 2008-04-25 Marek Safar <marek.safar@gmail.com>
2143 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
2144 for incompatible underlying types, more to come, uff.
2146 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
2149 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
2150 Handle 'leave_copy'.
2152 2008-04-25 Marek Safar <marek.safar@gmail.com>
2154 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
2156 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
2158 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
2159 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
2160 * statement.cs (While, Do, For): Allow test to have side effects.
2161 (For.DoEmit): Always emit InitStatement.
2164 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
2165 Always create SideEffectConstant.
2166 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
2167 of type EnumConstant.
2169 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2170 Handle 'right' being SideEffectConstant of type 'bool'.
2172 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2173 Use left.EmitBranchable instead of open coding it, so as to
2174 improve optimization opportunities.
2176 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
2178 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
2180 (Expression.EmitSideEffect): Document.
2182 2008-04-23 Marek Safar <marek.safar@gmail.com>
2184 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
2186 2008-04-23 Marek Safar <marek.safar@gmail.com>
2188 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
2190 2008-04-23 Marek Safar <marek.safar@gmail.com>
2192 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
2193 conversion to expression tree.
2195 2008-04-23 Marek Safar <marek.safar@gmail.com>
2197 * ecore.cs: Removed unused expression.
2199 2008-04-22 Marek Safar <marek.safar@gmail.com>
2201 * expression.cs: Implemented NegateChecked and New expressions.
2203 2008-04-22 Marek Safar <marek.safar@gmail.com>
2205 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
2207 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
2210 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
2211 needing final 'ret' instruction.
2213 2008-04-22 Marek Safar <marek.safar@gmail.com>
2215 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
2217 2008-04-21 Marek Safar <marek.safar@gmail.com>
2219 * expression.cs: Emit ldnull and not null expression as an instance argument
2220 of static method expression calls.
2222 2008-04-21 Marek Safar <marek.safar@gmail.com>
2224 A fix for bug #378200
2225 * expression.cs: Fixed crash when creating parameterless expression tree
2228 2008-04-21 Marek Safar <marek.safar@gmail.com>
2230 A fix for bug #375297
2231 * anonymous.cs: Fixed crash when inferring from null argument anonymous
2234 2008-04-21 Marek Safar <marek.safar@gmail.com>
2236 A fix for bug #377596
2237 * decl.cs, class.cs: Emit delegate type argument attributes.
2239 2008-04-21 Marek Safar <marek.safar@gmail.com>
2241 A fix for bug #365314
2242 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
2244 2008-04-21 Marek Safar <marek.safar@gmail.com>
2246 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
2249 2008-04-21 Marek Safar <marek.safar@gmail.com>
2251 * generic.cs (TypeParameter): Removed redundant location.
2253 2008-04-19 Marek Safar <marek.safar@gmail.com>
2255 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
2256 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
2257 FullNamedExpression in all declaration type expression, statements will come
2260 2008-04-18 Marek Safar <marek.safar@gmail.com>
2262 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
2263 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
2265 2008-04-18 Marek Safar <marek.safar@gmail.com>
2267 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
2270 2008-04-17 Marek Safar <marek.safar@gmail.com>
2272 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
2275 2008-04-17 Marek Safar <marek.safar@gmail.com>
2277 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
2281 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
2283 Hook up 'EmitSideEffect'
2284 * constant.cs (Constant.EmitSideEffect): New.
2285 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
2286 (SideEffectConstant.EmitSideEffect): New.
2287 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
2288 unconditional branch in EmitBranchable.
2289 (FieldExpr.EmitBranchable): New.
2290 * expression.cs (Unary.EmitSideEffect): New.
2291 (Binary.EmitSideEffect): New.
2292 (VariableReference.EmitSideEffect): New. Do nothing.
2294 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
2296 Introduce 'EmitSideEffect'
2297 * ecore.cs (Expression.EmitSideEffect): New.
2298 (TypeCast): Rename from EmptyCast.
2300 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
2301 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
2302 * convert.cs, nullable.cs: Update to changes.
2304 2008-04-16 Marek Safar <marek.safar@gmail.com>
2306 * class.cs, cs-parser.jay: Early check for base types expression.
2308 2008-04-16 Marek Safar <marek.safar@gmail.com>
2310 * decl.cs (MemberName): Declare PrettyName as obsolete.
2312 2008-04-16 Marek Safar <marek.safar@gmail.com>
2314 * namespace.cs: Use MemberName comparison.
2316 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
2319 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
2321 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
2322 (MemberName.FullyQualifiedName): New. Provides the functionality
2323 that users assume FullName would have.
2324 * ecore.cs, namespace.cs: Update to changes.
2326 * statement.cs (Using.assign): Make into ExpressionStatement.
2327 (Using.EmitPreTryBody): Simplify.
2329 2008-04-16 Marek Safar <marek.safar@gmail.com>
2331 * report.cs: ColorFormat is protected.
2333 * rootcontext.cs: Unused fields clean-up.
2335 * namespace.cs: Made UsingEntry name private.
2337 2008-04-16 Marek Safar <marek.safar@gmail.com>
2339 * cs-tokenizer.cs, location.cs: Removed unused field.
2341 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
2342 Raja R Harinath <harinath@hurrynot.org>
2345 * constant.cs (SideEffectConstant.value): Rename from 'left'.
2346 (SideEffectConstant.side_effect): Rename from 'right'.
2347 (SideEffectConstant..ctor): Normalize 'side_effect'.
2348 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
2349 value of this constant.
2350 * cfold.cs: Update to changes.
2352 2008-04-15 Marek Safar <marek.safar@gmail.com>
2354 * cs-paser.jay: Removed unused variable.
2356 * driver.cs: Made Compile instance method.
2358 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
2360 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
2362 2008-04-15 Marek Safar <marek.safar@gmail.com>
2364 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
2366 2008-04-13 Jb Evain <jbevain@novell.com>
2368 * namespace.cs: update the System.Core fullname for 2.1
2369 * driver.cs: update the list of required assemblies for 2.1.
2370 Merged from the Moonlight 2 branch.
2372 2008-04-11 Marek Safar <marek.safar@gmail.com>
2374 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
2375 types and user defined operators. User operators arguments has to be checked
2376 for null value before invocation, which also means no operator is called
2377 when any argument is not convertible to unwrapped nullable type.
2379 2008-04-09 Marek Safar <marek.safar@gmail.com>
2381 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
2382 of Unary expressions to follow operator overloading rules precisely.
2383 Also fixes #321794, #323794
2385 2008-04-08 Marek Safar <marek.safar@gmail.com>
2387 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
2390 2008-04-08 Marek Safar <marek.safar@gmail.com>
2392 * expression.cs, ecore.cs: Implemented MemberInit expression.
2394 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
2396 Fix mono/tests/exception4.cs
2397 * statement.cs (ExceptionStatement, TryCatch): Revert to using
2398 ec.NeedReturnLabel () rather emitting a 'nop'.
2400 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
2402 (TryCatch.SomeCodeFollows): Likewise.
2403 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
2404 for 'break', 'continue' and 'return' statements inside a try.
2405 We're fairly sure that the generated IL stream will have more
2406 instructions textually following the try.
2407 (FlowBranchingTryCatch): Likewise.
2409 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
2410 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
2413 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
2414 wrapper -- forward everything to CollectionForeach.
2415 (CollectionForeach.NonDisposableWrapper): New.
2416 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
2417 instead of a pop + branch to end.
2419 2008-04-07 Marek Safar <marek.safar@gmail.com>
2421 A fix for bug #377485
2422 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
2423 Propagate location for extension method groups. Report conversion failure at
2426 2008-04-07 Marek Safar <marek.safar@gmail.com>
2428 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
2429 ListInit and Field expressions.
2431 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
2433 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
2434 Since $PC is always -1 inside the body of MoveNext, the fault
2436 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
2437 * statement.cs (ExceptionStatement.emit_finally): Likewise.
2438 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
2440 The denouement! Fix #324708
2441 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
2442 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
2443 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
2444 'finally' inside the finally clause.
2446 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
2447 inside an iterator. Don't emit the body of the 'finally' inside
2448 the finally clause yet.
2450 Use the ResumableStatement infrastructure for MoveNext ()
2451 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
2452 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
2453 'old_resume_points'. Move dispatcher upfront.
2454 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
2455 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
2456 in an enumerator. This encodes the main fix in this patch series
2457 -- we can only jump into the first instruction of a try from the
2458 outside, but we want to emit try/finally regions in iterators and
2459 resume in the middle of them.
2461 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
2463 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
2464 of NeedReturnLabel here.
2466 Introduce a common point for emitting try/finally to IL
2467 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
2468 features of the various subclasses, which are now driven by ...
2469 (ExceptionStatement.EmitPreTryBody): ... this and ...
2470 (ExceptionStatement.EmitTryBody): ... this and the original
2472 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
2473 Remove DoEmit and update to follow above protocol.
2475 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
2476 of the dispatcher are the same, skip emitting the 'switch'.
2477 * iterator.cs (Iterator.EmitDispose): Update to changes.
2479 Clean up handling of 'using' statement
2480 * statement.cs (UsingTemporary): New. Carved out of ...
2481 (Using): ... this. Simplify drastically. Handle exactly
2483 * cs-parser.jay (using_statement): Split. Create UsingTemporary
2484 or Using as appropriate. If there are multiple variable declared,
2485 create nested Using statements.
2486 (resource_acquisition): Kill.
2488 * statement.cs (ExceptionStatement.EmitForDispose): Use
2489 EmitFinallyBody, not EmitFinally.
2491 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
2492 * iterator.cs: Update to changes.
2494 Start using the ResumableStatement infrastructure
2495 * statement.cs (ResumeableStatement.PrepareForDispose): New.
2496 (ResumableStatement.EmitForDispose): New.
2497 (ExceptionStatement): Override them.
2498 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
2499 EmitForDispose to create the body of the Dispose method. Don't
2502 * iterator.cs (Iterator.AddResumePoint): Move here from ...
2503 * statement.cs (Toplevel.AddResumePoint): ... here.
2504 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
2505 * flowanalysis.cs (FlowBranchingIterator): New.
2506 * codegen.cs (EmitContext): Update to changes.
2508 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
2509 (Iterator.old_resume_points): Rename from 'resume_points'.
2510 (Iterator.MoveNextStatement): Remove unused class.
2512 New infrastructure for try/finally in iterators (still unused)
2513 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
2514 (FlowBranchingToplevel.AddResumePoint): Hook into
2515 ToplevelBlock.AddResumePoint.
2516 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
2517 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
2518 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
2519 resume points and assign program-counter values.
2520 (ExceptionBlock.AddResumePoint): Collect resume points for
2521 de-muxer at the top of try block.
2522 * iterators.cs (Yield.CheckContext): Simplify.
2523 (Yield.Resolve): Use FlowBranching.AddResumePoint.
2525 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
2527 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
2528 argument to an ExitStatement.
2529 (FlowBranchingException): Refactor saved origins code.
2530 * statement.cs (ExitStatement): Update to cahges.
2531 * iterator.cs (YieldBreak): Likewise.
2533 * statement.cs (ResumableStatement): New. Common base class for
2534 YieldReturn and ExceptionStatement.
2535 (ExitStatement): New. Common base class for Return and YieldBreak.
2536 (Return): Update to changes.
2537 * iterator.cs (YieldBreak): Likewise.
2538 * lambda.cs (ContextualReturn): Likewise.
2541 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
2542 emit a meaningful error message.
2544 Fix #324765, #319508
2545 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
2546 (VariableInfo.SetAssigned): Set it.
2547 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
2548 determine if CS0219 or CS0168 is appropriate. Don't use
2549 flow-analysis information.
2550 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
2551 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
2552 (EmitContext.EndFlowBranching): ... this.
2554 2008-04-03 Marek Safar <marek.safar@gmail.com>
2556 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
2558 2008-04-03 Marek Safar <marek.safar@gmail.com>
2560 A fix for bug #376508
2561 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
2562 ImplicitConversionExists.
2564 2008-04-03 Marek Safar <marek.safar@gmail.com>
2566 * expression.cs (Binary): Added remaining binary operators to expression
2569 * nullable.cs: Optimize shift with null argument.
2571 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
2573 Fix minor IL regression
2574 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
2575 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
2576 * cs-parser.jay (try_statement): Update to changes.
2578 * statement.cs (TryFinally.need_exc_block): Delete.
2579 (TryFinally): Update to changes.
2581 Now all ExceptionStatements are unconditional
2582 * statement.cs (CollectionForeach.DisposableWrapper): New.
2583 Extract out the try/finally code into a new wrapper.
2584 (CollectionForeach.Resolve): Use it to simplify the code.
2586 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
2588 Start at simplifying ExceptionStatement semantics a bit
2589 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
2590 * cs-parser.jay (try_statement): Update to changes.
2591 (opt_catch_clauses): Remove.
2592 * flowanalysis.cs: Update to changes.
2593 (FlowBranching.BranchingType.TryCatch): New.
2594 (FlowBranchingTryCatch): New.
2596 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
2597 (FlowBranching.CreateBranching): Update to changes.
2598 (FlowBranchingBlock.AddSibling): Add sanity check.
2599 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
2602 * iterators.cs (Iterator.MarkFinally): Remove.
2603 * statement.cs (ExceptionStatement): Update to changes.
2605 Add support for skipping over finally blocks at runtime. First
2606 in a series to fix #324708
2607 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
2608 (Iterator.EmitMoveNext): Initialize it.
2609 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
2610 branch over the body of the 'finally' clause.
2612 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
2614 Avoid lopsided use of Foo/DoFoo names
2615 * statement.cs (ExpressionStatement.EmitFinallyBody):
2616 Rename from EmitFinally.
2617 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
2618 * iterator.cs: Update to changes.
2620 2008-04-02 Marek Safar <marek.safar@gmail.com>
2622 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
2623 based on UserOperatorCall. More binary nullable operators clean up.
2625 2008-04-02 Martin Baulig <martin@ximian.com>
2627 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
2629 2008-04-02 Marek Safar <marek.safar@gmail.com>
2631 * nullable.cs: Merge user and empty conversions when lifting expression
2634 * expression.cs (StringConcat): Implemented expression tree representation.
2636 2008-04-01 Marek Safar <marek.safar@gmail.com>
2638 * nullable.cs: When lifting null literal and a user operator exists, no call
2641 2008-04-01 Marek Safar <marek.safar@gmail.com>
2643 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
2646 2008-04-01 Marek Safar <marek.safar@gmail.com>
2648 * nullable.cs, expression.cs: Use namespace instead heavily nested
2649 monster abstract class.
2651 2008-04-01 Marek Safar <marek.safar@gmail.com>
2653 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
2654 lifting of null literal and user operators. Clean up of some temporary
2657 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
2659 Fix #368224, test-629.cs
2660 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
2661 if it crossed an unwind-protect boundary.
2662 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
2663 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
2664 inside an unwind-protected region.
2665 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
2666 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
2667 'leave' instead of a 'br' if unwind-protected.
2668 (Iterator.EmitYieldBreak): Likewise.
2670 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
2672 * driver.cs: Only define versioninfo resources if no win32 resource
2675 2008-03-28 Marek Safar <marek.safar@gmail.com>
2677 A fix for bug #372375
2678 * convert.cs: Fixed boxing of nullable types.
2680 2008-03-28 Marek Safar <marek.safar@gmail.com>
2682 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
2685 2008-03-28 Marek Safar <marek.safar@gmail.com>
2687 A fix for bug #374619
2688 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
2690 2008-03-27 Marek Safar <marek.safar@gmail.com>
2692 * lambda.cs: Check return type only for invocation.
2694 2008-03-27 Marek Safar <marek.safar@gmail.com>
2696 A fix for bug #374214
2697 * ecore.cs: Correctly report argument type mismatch.
2699 2008-03-27 Marek Safar <marek.safar@gmail.com>
2701 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
2702 and not rely on broken IsEnum.
2704 2008-03-27 Marek Safar <marek.safar@gmail.com>
2706 * nullable.cs: New file, extracted from generic.cs.
2708 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
2710 2008-03-27 Marek Safar <marek.safar@gmail.com>
2712 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
2713 predefined comparison operators and null literals.
2715 * report.cs: New warning ID.
2717 2008-03-25 Marek Safar <marek.safar@gmail.com>
2719 A fix for bug #370577
2720 * lambda.cs: Check return type too.
2722 2008-03-25 Marek Safar <marek.safar@gmail.com>
2724 A fix for bug #372846
2725 * class.cs: Automatic properties can be declared as unsafe.
2727 2008-03-20 Marek Safar <marek.safar@gmail.com>
2729 * location.cs: Use string based concatenation.
2731 * expression.cs: LiftedBinaryOperator is gmcs only.
2733 2008-03-20 Marek Safar <marek.safar@gmail.com>
2735 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
2736 conversions rules and expression trees.
2738 2008-03-19 Marek Safar <marek.safar@gmail.com>
2740 * delegate.cs: Use extension method source as delegate target.
2742 2008-03-19 Marek Safar <marek.safar@gmail.com>
2744 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
2745 binary operations to be purely based on binary operations and optimized
2746 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
2747 and other ET refactoring.
2749 * typemanager.cs: Fixed warning.
2751 2008-03-17 Marek Safar <marek.safar@gmail.com>
2753 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
2755 * symbolwriter.cs: Fixed.
2757 2008-03-17 Marek Safar <marek.safar@gmail.com>
2759 * anonymous.cs, driver.cs: Reset anonymous types counters.
2761 2008-03-17 Marek Safar <marek.safar@gmail.com>
2763 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
2765 * class.cs: Use fullname for all type member definitions.
2767 2008-02-19 Martin Baulig <martin@ximian.com>
2770 (IMethodData.EmitExtraSymbolInfo): New interface method.
2771 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
2772 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
2773 interface method here as an empty public virtual method.
2776 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
2777 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
2778 CodeGen.SymbolWriter.SetRealMethodName().
2780 2008-02-18 Martin Baulig <martin@ximian.com>
2783 (ScopeInfo.EmitType): Override this and emit debugging
2784 information for captured variables.
2785 (RootScopeInfo.EmitType): Override this and emit symbol
2786 information for a captured `this'.
2788 2008-02-15 Martin Baulig <martin@ximian.com>
2790 * iterators.cs: Emit debugging info.
2793 (EmitContext.Flags): Add `OmitDebuggingInfo'.
2794 (EmitContext.OmitDebuggingInfo): New public property.
2797 (While): Override Emit() and don't emit symbol info there; do it
2798 inside DoEmit() instead.
2799 (Block.Emit): Omit symbol information while emitting the scope
2800 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
2802 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
2803 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
2804 .ctor to make `IsIterator' work.
2806 2008-03-14 Martin Baulig <martin@ximian.com>
2808 * symbolwriter.cs: Added the new symbol writer function from the
2809 debugger's `terrania' branch; temporarily enclose them inside
2810 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
2813 2008-03-14 Martin Baulig <martin@ximian.com>
2816 (SymbolWriter): Make this a public static class.
2819 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
2820 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
2822 2008-03-14 Marek Safar <marek.safar@gmail.com>
2824 A fix for bug #370577
2825 * statement.cs, lambda.cs: Added extra limitations when dealing with void
2828 2008-03-14 Marek Safar <marek.safar@gmail.com>
2830 * typemanager.cs (CSharpName): Made 250 times faster.
2832 2008-03-13 Marek Safar <marek.safar@gmail.com>
2834 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
2836 2008-03-12 Marek Safar <marek.safar@gmail.com>
2838 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
2839 crash when predefined field does not exist.
2841 2008-03-12 Marek Safar <marek.safar@gmail.com>
2843 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
2845 2008-03-12 Marek Safar <marek.safar@gmail.com>
2847 * class.cs (FixedField): Don't crash when contructors are missing.
2849 2008-03-11 Marek Safar <marek.safar@gmail.com>
2851 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
2852 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
2853 check internal types accessibility for internal and external types.
2854 Replaced EnumToUnderlying by GetEnumUnderlyingType.
2856 2008-03-11 Marek Safar <marek.safar@gmail.com>
2858 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
2859 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
2860 attribute.cs, statement: Use corect instance of predefined types (work
2861 related to #364674).
2863 2008-03-07 Marek Safar <marek.safar@gmail.com>
2865 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
2867 2008-03-07 Marek Safar <marek.safar@gmail.com>
2869 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
2870 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
2871 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
2872 predefined types clean up, delayed predefined types members initialization
2873 (work related to #364674).
2875 2008-03-05 Marek Safar <marek.safar@gmail.com>
2877 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
2879 2008-03-05 Marek Safar <marek.safar@gmail.com>
2881 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
2882 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
2883 predefined types clean up (work related to #364674).
2885 2008-03-04 Marek Safar <marek.safar@gmail.com>
2887 * ecore.cs: Print an error message instead of throwing exception.
2889 2008-03-04 Marek Safar <marek.safar@gmail.com>
2891 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
2892 expression.cs, statement.cs: Unififed null literal representation.
2894 2008-03-03 Marek Safar <marek.safar@gmail.com>
2896 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
2897 expression.cs: Refactored binary operators resolve phase and improved speed.
2898 The nullable code is still missing and won't work correctly, more fixes
2901 It also fixes #323726, #324312, #324248, and many other unreported issues.
2903 2008-02-29 Zoltan Varga <vargaz@gmail.com>
2905 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
2908 2008-02-27 Marek Safar <marek.safar@gmail.com>
2910 * ecore.cs: Clean-up and split BetterConversion.
2912 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
2915 * enum.cs (EnumMember.Value): Only access 'value' if
2916 ResolveValue says it's ok.
2917 (EnumMember.DoResolveValue): Don't set prev_member.value.
2918 (Enum.GetDefinition): Reverse arguments of Equals --
2919 EnumMember.Value can return 'null'.
2921 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
2923 2008-02-22 Marek Safar <marek.safar@gmail.com>
2925 * generic.cs, expression.cs: More ongoing work on expression trees.
2927 2008-02-21 Marek Safar <marek.safar@gmail.com>
2929 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
2930 handle missing matches when mutiple operators exist.
2932 2008-02-20 Marek Safar <marek.safar@gmail.com>
2934 A fix for bug #363218
2935 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
2938 2008-02-20 Marek Safar <marek.safar@gmail.com>
2940 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
2941 update. This time to deal correctly with SideEffectConstant expression used
2942 as an argument for another constant folding.
2944 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
2946 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
2949 2008-02-19 Marek Safar <marek.safar@gmail.com>
2951 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
2953 2008-02-19 Marek Safar <marek.safar@gmail.com>
2955 A fix for bug #328136
2956 * expression.cs: Do not fold immediately LogicalAnd operators when the left
2957 side is a false constant, because we still need to evaluate the right-hand
2960 * statement.cs (If): Emit two types of boolean constants (simple constant,
2961 side-effect constant).
2963 2008-02-19 Marek Safar <marek.safar@gmail.com>
2965 * constant.cs (SideEffectConstant): Don't emit boolean constant.
2967 * expression.cs: Fold immediately LogicalAnd operators when both sides are
2970 2008-02-18 Marek Safar <marek.safar@gmail.com>
2972 A fix for bug #361457
2973 * ecore.cs (IsApplicable): Params methods have lower priority.
2975 * support.cs: Return correct parameter modifier for params types.
2977 2008-02-18 Marek Safar <marek.safar@gmail.com>
2979 * generic.cs (TypeParameter): Cache attribute target name.
2981 * support.cs: Removed unused variable.
2983 * typemanager.cs: Removed debugging leftover.
2985 * ecore.cs: Use local type instead of a property;
2987 * class.cs (VerifyMembers): Consider also parent to test whether type member
2990 * expression.cs (FullMethodDesc): Removed.
2992 * attribute.cs (IsValidArgumentType): Made static.
2994 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
2996 Cleanup to be more readable.
2997 * Makefile (GMCS_PROFILE): Remove.
2998 (COMPILER_NAME): New helper.
3000 2008-02-15 Miguel de Icaza <miguel@novell.com>
3002 * cs-tokenizer.cs: if a conditional expression happens inside a
3003 (...) this also means that we do not need to de-ambiguate between
3004 an parenthesized expression and a cast.
3008 * constant.cs (SideEffectConstant): a constant value that happens
3009 to have a side effect.
3011 Fixes the build regressions introduced by the fix for #359789
3013 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
3015 * expression.cs (Conditional.Emit): when emitting the ternary
3016 operator, use local variables to generate code verifiable code.
3018 The verifier cannot infer that the type on stack before the
3019 stloc.0 is executed is of type ParentB. This happens because the
3020 stack merge algorithm uses only parent types when deciding which
3021 is the common type. This is described in Part III 1.8.1.3 of ECMA
3024 This code compiled with mcs is not verifiable under MS. The MS
3025 verifier picks the first common interface of Foo and Bar, which is
3026 wrong, but doesn't use a full join type of the 2 interfaces.
3028 CSC uses a clever hack to compile such code in a verifiable
3029 way. It stores the intermediate values in a local variable with
3034 2008-02-14 Miguel de Icaza <miguel@novell.com>
3036 * expression.cs: Do not fold BitwiseAnd operators when the left
3037 side is a false constant, because we still need to evaluate the
3042 * support.cs: Instead of throwing an InternalErrorException when
3043 the position of the stream is outside the boundary of our buffer,
3044 reset the state of the reader, and restart the reading from the
3045 beginning of the file.
3047 2008-02-14 Marek Safar <marek.safar@gmail.com>
3049 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
3051 2008-02-14 Marek Safar <marek.safar@gmail.com>
3053 A fix for bug #361686
3054 * decl.cs: A protected types used inside a private class which parents
3055 derives from the protected class are accessible.
3057 2008-02-13 Marek Safar <marek.safar@gmail.com>
3059 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
3060 the parameterless constructor.
3062 2008-02-13 Marek Safar <marek.safar@gmail.com>
3064 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
3065 lookup methods to use standard member cache when doing member lookup.
3067 2008-02-12 Marek Safar <marek.safar@gmail.com>
3069 * driver.cs: Don't report full path for referenced module as assembly error.
3071 2008-02-12 Marek Safar <marek.safar@gmail.com>
3073 * Makefile: Fixed `qh' target to work on all machines.
3075 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
3076 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
3077 and HasElementType with TypeManager implementation.
3079 2008-02-08 Marek Safar <marek.safar@gmail.com>
3081 A fix for bugs #325134, #359749
3082 * expression.cs, ecore.cs: Try to resolve an extension method even if the
3083 first binds point to non-method member expression.
3085 2008-02-08 Marek Safar <marek.safar@gmail.com>
3087 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
3089 2008-02-08 Marek Safar <marek.safar@gmail.com>
3091 A fix for bugs #321394, #323028
3092 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
3093 Reworked naive IsAccessibleAs implementation to handle nested types.
3095 2008-02-05 Jb Evain <jbevain@novell.com>
3097 * class.cs: use generic type comparison for parameters
3100 2008-02-05 Marek Safar <marek.safar@gmail.com>
3102 A fix for bug #325372
3103 * class.cs: Use generic type comparison when testing method signatures.
3105 2008-02-05 Marek Safar <marek.safar@gmail.com>
3107 A fix for bug #357047
3108 * ecore.cs: Applied C# 3.0 changes to better conversion.
3110 2008-02-05 Marek Safar <marek.safar@gmail.com>
3112 A fix for bug #358374
3113 * cs-parser.jay: Correctly set modifiers for all constructor types.
3115 2008-02-04 Marek Safar <marek.safar@gmail.com>
3117 A fix for bug #355251
3118 * generic.cs: Added base class constraint based type inference.
3120 2008-02-01 Marek Safar <marek.safar@gmail.com>
3122 A fix for bug #357255
3123 * decl.cs: One more missing visibility check.
3125 2008-02-01 Marek Safar <marek.safar@gmail.com>
3127 * support.cs: Fixed broken return.
3129 2008-01-25 Marek Safar <marek.safar@gmail.com>
3131 * report.cs: Correctly reset warnings count after probing.
3133 2008-01-25 Martin Baulig <martin@ximian.com>
3136 (NamespaceEntry.SymbolFileID): Make this work again after
3137 MemberName.ToString() is gone.
3139 2008-01-25 Marek Safar <marek.safar@gmail.com>
3141 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
3144 2008-01-25 Marek Safar <marek.safar@gmail.com>
3146 * generic.cs: Use full implicit conversion for type inference fixing.
3148 2008-01-24 Marek Safar <marek.safar@gmail.com>
3150 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
3151 Fixed user operator conversions.
3153 2008-01-24 Marek Safar <marek.safar@gmail.com>
3155 * generic.cs: Do nullable type to null comparison optimization during
3158 2008-01-24 Marek Safar <marek.safar@gmail.com>
3160 A fix for bug #355163
3161 * generic.cs: Enabled l-value resolve on nullable expressions.
3163 2008-01-24 Marek Safar <marek.safar@gmail.com>
3165 A fix for bug #353986
3166 * class.cs: Ingore static ctors with parameters for any further checks.
3168 2008-01-24 Marek Safar <marek.safar@gmail.com>
3170 A fix for bug #354310
3171 * namespace.cs: Removed redundant check.
3173 2008-01-24 Marek Safar <marek.safar@gmail.com>
3175 A fix for bug #354928
3176 * expression.cs: ElementInitializers can be resolved only once.
3178 2008-01-24 Marek Safar <marek.safar@gmail.com>
3180 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
3181 Condition expressions.
3183 2008-01-23 Marek Safar <marek.safar@gmail.com>
3185 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
3187 2008-01-22 Marek Safar <marek.safar@gmail.com>
3189 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
3192 * generic.cs: Implemented coalesce expression.
3194 2008-01-22 Marek Safar <marek.safar@gmail.com>
3196 A fix for bug #355145
3197 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
3198 expression tree type inference.
3200 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
3203 * expression.cs (Binary.IsUnsignedType): Fix typo.
3205 2008-01-22 Marek Safar <marek.safar@gmail.com>
3207 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
3209 2008-01-22 Marek Safar <marek.safar@gmail.com>
3211 A fix for bug #355161
3212 * ecore.cs, expression.cs: Wider range of extension method supported
3215 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
3217 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
3218 AssemblyBuilder to operate in compiler context. Fixes mcs part of
3221 2008-01-22 Marek Safar <marek.safar@gmail.com>
3223 A fix for bug #355148
3224 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
3226 2008-01-22 Miguel de Icaza <miguel@novell.com>
3228 * expression.cs (CreateExpressionTree): Add support for or and
3229 logical or, and indent following the coding conventions.
3231 * typemanager.cs (LinqExpression): renamed from
3232 ExpressionTreeManager, for a shorter name.
3234 Use TypeManager.CoreLookupType to lookup types from our core
3235 assemblies and turn those into "Type" variables.
3237 Consumers that previously used "Namespace" and "Type" from this
3238 class should instead use the TypeExpression which is a type that
3239 is fully resolved (without involving the regular C# resolution
3242 This typically looks like this:
3244 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
3245 new MemberAccess (texpr, name, type_arguments, loc)
3247 This avoids the problem in: #355178
3249 2008-01-21 Marek Safar <marek.safar@gmail.com>
3251 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
3252 feature in parser only as we do in other cases.
3254 2008-01-21 Marek Safar <marek.safar@gmail.com>
3256 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
3257 typemanager.cs: A refactoring of params arguments to reuse existing
3258 expressions (params -> array initializer) to emit params argument instead
3259 of specialized handling.
3260 It was required by expression tree implementation and it has other benefits
3261 as well, we now apply same optimization for params arguments as we do for
3264 2008-01-18 Marek Safar <marek.safar@gmail.com>
3266 A fix for bug #353526
3267 * generic.cs: A type inference of params arguments may not required any
3268 temporary array creation.
3270 2008-01-18 Marek Safar <marek.safar@gmail.com>
3272 A fix for bug #353534
3273 * generic.cs, ecore.cs, expression.cs: A method group type inference is
3274 supported for delegates only.
3276 2008-01-18 Marek Safar <marek.safar@gmail.com>
3278 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
3279 type for more than 1 candidates.
3281 2008-01-18 Marek Safar <marek.safar@gmail.com>
3283 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
3286 2008-01-16 Marek Safar <marek.safar@gmail.com>
3288 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
3289 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
3290 operator) expressions.
3292 2008-01-16 Zoltan Varga <vargaz@gmail.com>
3294 * statement.cs: Avoid declaring an IL variable for this_variable since it is
3295 not accessed from the generated IL.
3297 2008-01-14 Marek Safar <marek.safar@gmail.com>
3299 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
3300 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
3301 statement.cs: The first expression tree implementation drop, mostly
3302 infrastructure work.
3304 2008-01-14 Marek Safar <marek.safar@gmail.com>
3306 * ecore.cs (IsNestedChild): Refactored.
3308 2008-01-11 Marek Safar <marek.safar@gmail.com>
3310 * lambda.cs: Don't use a cast on unknown expression statement.
3312 2008-01-10 Geoff Norton <gnorton@novell.com>
3314 * cs-tokenizer.cs: One more token to distinguish between method and lambda
3317 2008-01-09 Marek Safar <marek.safar@gmail.com>
3319 * doc.cs: Report better /doc crash details.
3321 2008-01-09 Marek Safar <marek.safar@gmail.com>
3323 A fix for bug #352536
3324 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
3326 2008-01-08 Marek Safar <marek.safar@gmail.com>
3328 A fix for bug #352287
3329 * ecore.cs, expression.cs: Do `this' access checking in all member access
3332 2008-01-08 Marek Safar <marek.safar@gmail.com>
3334 * rootcontext.cs, driver.cs: Switch to linq mode by default.
3336 * report.cs: Reset message stacks.
3338 2008-01-08 Marek Safar <marek.safar@gmail.com>
3340 * generic.cs (InferInPhases): Correctly calculate params position.
3342 2008-01-08 Marek Safar <marek.safar@gmail.com>
3344 * cs-tokenizer.cs: No need to parse full string when parsing lambda
3347 2008-01-07 Marek Safar <marek.safar@gmail.com>
3349 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
3351 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
3353 * driver.cs: Updated --help option.
3355 2008-01-07 Marek Safar <marek.safar@gmail.com>
3357 * generic.cs (InferParamsTypeArguments): Removed.
3358 (InferInPhases): Add params type inference.
3359 (LowerBoundInference): Fixed scoring mechanism.
3361 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
3363 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
3365 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
3366 byte array for unsigned "baked" assemblies.
3368 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
3370 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
3371 array for assemblies that are not strongnamed.
3373 2008-01-04 Marek Safar <marek.safar@gmail.com>
3375 A fix for bug #351481
3376 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
3377 declaring type for nested generic types.
3379 2008-01-04 Marek Safar <marek.safar@gmail.com>
3381 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
3382 instead of ToString.
3384 2008-01-03 Marek Safar <marek.safar@gmail.com>
3386 A fix for bug #351047
3387 * expression.cs (Binary.ResolveOperator): Allow equality operators between
3388 null and structs only when equality and inequality operators are defined
3389 either as an user-operators or predefined operators.
3391 2008-01-03 Marek Safar <marek.safar@gmail.com>
3393 A fix for bug #351047
3394 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
3396 2008-01-03 Marek Safar <marek.safar@gmail.com>
3398 A fix for bug #351257
3399 * cs-tokenizer.cs: Advance line number for '\r' correctly.
3401 2008-01-03 Marek Safar <marek.safar@gmail.com>
3403 A fix for bug #351157
3404 * class.cs (Using): Fixed yet another broken cloning.
3406 (Block): Put back more sensible default value for statements.
3408 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
3410 * codegen.cs: Allow AssemblyVersion with only major version component.
3413 2007-12-29 Marek Safar <marek.safar@gmail.com>
3415 A fix for bug #324654
3416 * class.cs: Use FullName property as member name.
3418 2007-12-28 Marek Safar <marek.safar@gmail.com>
3420 A fix for bug #342117
3421 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
3422 constructor constraint.
3424 2007-12-28 Marek Safar <marek.safar@gmail.com>
3426 A fix for bug #338273
3427 * class.cs (ProbertyBase): Access modifier checks are required for overrides
3430 2007-12-28 Marek Safar <marek.safar@gmail.com>
3432 A fix for bug #350839
3433 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
3435 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
3437 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3440 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
3442 * statement.cs: Changed some Hashtables to use HybridDictionaries
3443 instead. It was observed that some HashTables only contained a few
3444 items in the vast majority of cases. Since HybridDictionary is
3445 more efficient on small sets (<10 elements), "known_variables"
3446 from class ExplicitBlock as well as "labels" and "constants " from
3447 class Block were changed to HybridDictionaries.
3449 Atsai results: (56216kb->54987kb)
3451 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
3454 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
3456 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3459 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
3461 * expression.cs: foreach loop to for loop, saved on allocation of
3462 enumerator (59333kb->59141kb)
3464 * statement.cs. Changed foreach loops to for loops, saved on
3465 allocation of enumerator (59141kb->59006kb)
3467 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
3468 when constructed with no specified capacity. This was causing a
3469 few ArrayLists to allocate more memory than they would potentially
3470 need in the Block class and MemberCache class. Setting the
3471 ArrayLists to construct with a capacity of 1 saves some
3472 memory. (56216kb->55585kb)
3474 2007-12-27 Marek Safar <marek.safar@gmail.com>
3476 A fix for bug #347189 (2nd issue)
3477 * expression.cs (MemberAccess): Nested type can be found in base non-generic
3480 2007-12-27 Miguel de Icaza <miguel@novell.com>
3482 * report.cs: Do not use colors if stdout and stderr are not a
3485 2007-12-27 Marek Safar <marek.safar@gmail.com>
3487 A fix for bug #346998
3488 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
3491 2007-12-27 Marek Safar <marek.safar@gmail.com>
3493 A fix for bug #343465
3494 * class.cs: Explicit method name for nested types uses dots only.
3496 2007-12-27 Marek Safar <marek.safar@gmail.com>
3498 A fix for bug #343707
3499 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
3501 2007-12-27 Marek Safar <marek.safar@gmail.com>
3503 * ecore.cs: Report type inference errors only when arguments count matches
3506 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
3508 * expression.cs, report.cs: New warning.
3510 * typemanager.cs: Catch anonymous method type too.
3512 2007-12-23 Marek Safar <marek.safar@gmail.com>
3514 A fix for bug #346379
3515 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
3517 2007-12-23 Marek Safar <marek.safar@gmail.com>
3519 A fix for bug #347359
3520 * expression.cs (Invocation): Don't resolve already resolved expression.
3522 2007-12-23 Marek Safar <marek.safar@gmail.com>
3524 A fix for bug #347189
3525 * class.cs (FixedField): Use non-dependent code only in the define phase.
3527 2007-12-23 Marek Safar <marek.safar@gmail.com>
3529 A fix for bug #348076
3530 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
3532 2007-12-22 Marek Safar <marek.safar@gmail.com>
3534 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
3535 discovered extension methods.
3537 2007-12-22 Marek Safar <marek.safar@gmail.com>
3539 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
3542 2007-12-21 Miguel de Icaza <miguel@novell.com>
3544 * report.cs (ErrorMessage): Add support for using colors on
3545 terminals that support it.
3547 2007-12-21 Marek Safar <marek.safar@gmail.com>
3549 * ecore.cs: Use information about expanded params for error reporting.
3551 2007-12-21 Marek Safar <marek.safar@gmail.com>
3553 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
3554 and logic for params overloads.
3556 2007-12-15 Miguel de Icaza <miguel@novell.com>
3558 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
3559 as this is also created from the parser. Fixes #349034
3561 2007-12-12 Miguel de Icaza <miguel@novell.com>
3563 * statement.cs (Throw.CloneTo): it is valid to have empty
3564 expressions for throw.
3566 2007-12-03 Marek Safar <marek.safar@gmail.com>
3568 * cs-parser.jay: Set delegate constraint parsing region correctly.
3570 2007-12-03 Marek Safar <marek.safar@gmail.com>
3572 A fix for bug #345467
3573 * typemanager.cs (IsEqual): Compare generic parameters position only.
3575 2007-11-28 Marek Safar <marek.safar@gmail.com>
3577 * expression.cs (BaseAccess): Type arguments can be null.
3579 2007-11-27 Raja R Harinath <harinath@gmail.com>
3581 * statement.cs (Block.Resolve): Ensure flow-branching tree is
3582 consistent even when an error has occured.
3583 (Switch.Resolve): Likewise.
3585 2007-11-22 Marek Safar <marek.safar@gmail.com>
3587 A fix for bug #334505
3588 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
3591 2007-11-22 Marek Safar <marek.safar@gmail.com>
3593 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
3594 refactorings required to resolve extension methods correctly when mixing
3595 generics and non-generics members.
3597 2007-11-20 Marek Safar <marek.safar@gmail.com>
3599 A fix for bug #342584
3600 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
3603 2007-11-19 Marek Safar <marek.safar@gmail.com>
3605 A fix for bug #342512
3606 * delegate.cs: Use delegate argument expression when is available. Don't
3607 emit virtual call when class is sealed.
3609 2007-11-16 Marek Safar <marek.safar@gmail.com>
3611 A fix for bug #325423
3612 * assign.cs (FieldInitializer): Use resolved expression for emit.
3614 * class.cs: Print less confusing error message.
3616 2007-11-16 Marek Safar <marek.safar@gmail.com>
3618 * cs-tokenizer.cs: Removed GMCS ifdefs.
3620 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
3623 * cs-parser.jay: Disabled nullable check.
3625 * generic-mcs: Copied more generic stuff.
3627 2007-11-16 Marek Safar <marek.safar@gmail.com>
3629 * gcs-parser.jay: Merged to cs-parser.jay.
3631 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
3632 * *.csproj, *.sources: Updated to use only jay parser file.
3634 2007-11-16 Marek Safar <marek.safar@gmail.com>
3636 * gcs-parser.jay: Added nullable and default expression feature checks.
3638 2007-11-16 Marek Safar <marek.safar@gmail.com>
3640 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
3641 it fixes many TODOs and hidden bugs.
3643 * expression: Removed duplicate error check.
3645 2007-11-15 Marek Safar <marek.safar@gmail.com>
3647 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
3648 implicitly type local variable only when it is used in a declaration.
3650 2007-11-15 Marek Safar <marek.safar@gmail.com>
3652 * attribute.cs: Use CS0612 for empty strings.
3654 2007-11-14 Marek Safar <marek.safar@gmail.com>
3656 * lambda.cs, statement.cs: Contextual return may act as a statement.
3658 2007-11-14 Marek Safar <marek.safar@gmail.com>
3660 A fix for a regression cause by #324222
3661 * class.cs: Don't report unused even when it implements an interface.
3663 2007-11-13 Marek Safar <marek.safar@gmail.com>
3665 A fix for bug #341205
3666 * ecore.cs, expression.cs: Method group expression cannot do static
3667 method access with an instance reference check before overloading takes
3670 2007-11-13 Marek Safar <marek.safar@gmail.com>
3672 A fix for bug #325359
3673 * class.cs: Use predictable name for automatically generated property.
3675 2007-11-12 Marek Safar <marek.safar@gmail.com>
3677 A fix for bug #324996
3678 * expression.cs (Is): Handle case where D is nullable and T is not
3681 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
3683 2007-11-12 Marek Safar <marek.safar@gmail.com>
3685 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
3686 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
3687 Flush small error reporting changes.
3689 2007-11-09 Marek Safar <marek.safar@gmail.com>
3691 A fix for bug #324996
3692 * expression.cs: Rewrote Is expression implementation to work with
3693 generics, nullable types, anonymous method. A const result expression
3694 uses existing infrastructure instead of custom not fully-featured one.
3696 2007-11-08 Marek Safar <marek.safar@gmail.com>
3698 A fix for bug #340202
3699 * class.cs: Consider generics for volatile field.
3701 2007-11-08 Marek Safar <marek.safar@gmail.com>
3703 A fix for bug #335594
3704 * expression.cs: Use conversion rules when handling string addition.
3706 2007-11-07 Marek Safar <marek.safar@gmail.com>
3708 A fix for bug #336651
3709 * expression.cs: Fixed a crash when probing is on.
3711 2007-11-07 Marek Safar <marek.safar@gmail.com>
3713 A fix for bug #324242
3714 * covert.cs: Added a conversion from any nullable-type with an
3715 underlying enum-type to the type System.Enum.
3717 2007-11-07 Marek Safar <marek.safar@gmail.com>
3719 A fix for bug #324222
3720 * class.cs: Report all non-used event fields.
3722 2007-11-07 Marek Safar <marek.safar@gmail.com>
3724 A fix for bug #325161
3725 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
3726 qualifier for generic types.
3728 2007-11-07 Marek Safar <marek.safar@gmail.com>
3730 A fix for bug #322971
3731 * expression.cs, ecore.cs: Added intermediate result value check for
3734 2007-11-07 Marek Safar <marek.safar@gmail.com>
3736 A fix for bug #324754
3737 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
3738 when it was requested.
3740 2007-11-07 Marek Safar <marek.safar@gmail.com>
3742 A fix for bug #325101
3743 * expression.cs: Do type not value comparison for `is' expression.
3745 2007-11-07 Marek Safar <marek.safar@gmail.com>
3747 A fix for bug #320236
3748 * convert.cs: Don't apply user conversion on underlying target type.
3750 2007-11-06 Marek Safar <marek.safar@gmail.com>
3752 * expression.cs: Don't use unresolved expression for error reporting.
3754 2007-11-06 Marek Safar <marek.safar@gmail.com>
3756 A fix for bugs #337712, #324490
3757 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
3758 overloading resolution too.
3760 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
3761 the process consistent and more robust.
3763 * expression.cs, linq.cs, report.cs: Update.
3765 2007-11-02 Marek Safar <marek.safar@gmail.com>
3767 A fix for bug #332909
3768 * attribute.cs: Resolve attributes in correct context using error
3771 * rootcontext.cs: Define Obsolete attribute members as core members.
3773 2007-11-02 Marek Safar <marek.safar@gmail.com>
3775 * statement.cs: Removed unused methods.
3777 2007-10-31 Wade Berrier <wberrier@novell.com>
3779 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
3780 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
3783 2007-10-31 Marek Safar <marek.safar@gmail.com>
3785 A fix for bug #338102
3786 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
3787 methods registered as non-generics.
3789 2007-10-31 Marek Safar <marek.safar@gmail.com>
3791 A fix for bugs #337712, #324490
3792 * delegate.cs: Delegate covariance and contravariance is not allowed for
3795 2007-10-31 Marek Safar <marek.safar@gmail.com>
3797 A fix for bug #337719
3798 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
3801 2007-10-30 Marek Safar <marek.safar@gmail.com>
3803 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
3805 2007-10-29 Marek Safar <marek.safar@gmail.com>
3807 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
3810 2007-10-29 Raja R Harinath <rharinath@novell.com>
3812 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
3814 2007-10-29 Marek Safar <marek.safar@gmail.com>
3816 A fix for bug #334652
3817 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
3818 extension methods when we have not found the best candidate in normal
3821 2007-10-27 Marek Safar <marek.safar@gmail.com>
3823 * AssemblyInfo.cs: Keep up-to-date.
3825 2007-10-27 Marek Safar <marek.safar@gmail.com>
3827 * Makefile: Fixed generics compiler name.
3829 2007-10-27 Marek Safar <marek.safar@gmail.com>
3831 * lambda.test: removed, lambda parsing is done differently.
3833 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
3835 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
3837 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
3839 2007-10-27 Marek Safar <marek.safar@gmail.com>
3841 * Makefile, *.sources : All C# compilers are in mcs folder.
3843 * *.cs: Use existing 2_1 define for smcs.
3845 2007-10-26 Marek Safar <marek.safar@gmail.com>
3847 A fix for bug #335847
3848 * assign.cs, expression.cs: Couple of changes to avoid creating a
3849 temporary variable for each object initializer assignment statement. It
3850 simplifies struct initialization too, otherwise two temporary variables
3852 Implemented optimization of redundant default element initializers.
3854 2007-10-25 Marek Safar <marek.safar@gmail.com>
3856 A fix for bug #336766
3857 * expression.cs (Class.CheckBase): Use generic name when method is
3860 2007-10-25 Marek Safar <marek.safar@gmail.com>
3862 A fix for bug #334737
3863 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
3864 variable and not variable argument for prepared copies.
3866 2007-10-24 Marek Safar <marek.safar@gmail.com>
3868 A fix for bug #325110
3869 * class.cs, expression.cs, attribute.cs: Use open generic method when
3870 checking conditional attribute.
3872 2007-10-24 Marek Safar <marek.safar@gmail.com>
3874 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
3875 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
3876 FeatureIsNotAvailable.
3878 2007-10-24 Marek Safar <marek.safar@gmail.com>
3880 ** C# 3.0 Partial methods
3882 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
3883 methods support. Because of member cache issue with generics only
3884 non-generics partial methods are fully supported.
3886 2007-10-23 Marek Safar <marek.safar@gmail.com>
3888 * class.cs, decl.cs: Rewrote member overloads check to cope with
3889 generics and to use member cache for member checking. It also improves
3890 performance and fixes remaining overloads issues.
3892 2007-10-20 Marek Safar <marek.safar@gmail.com>
3894 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
3895 roottypes.cs, typemanager.cs:
3897 A member cache creation logic changed to add members immediately and
3898 not rely on fallback. The member cache is now only prefered way
3899 how to access and find type declaration members. It saves 5 MB of memory
3900 during MWF compilation and makes code ready for more optimizations and
3901 clean-ups, it's also a pre-requirement for partial methods.
3903 2007-10-18 Raja R Harinath <harinath@gmail.com>
3905 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
3906 handling for generic parameters.
3908 2007-10-15 Marek Safar <marek.safar@gmail.com>
3910 * class.cs (FixedField): Removed redundant volatile check.
3912 2007-10-15 Marek Safar <marek.safar@gmail.com>
3914 * class.cs, decl.cs: Fixed overload members verification to do only one
3915 check per possible collision.
3917 2007-10-13 Marek Safar <marek.safar@gmail.com>
3919 A fix for bug #325478
3920 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
3921 and create only one disposable flags container.
3923 2007-10-12 Marek Safar <marek.safar@gmail.com>
3925 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
3926 * statement.cs (Fixed): Fixed variables cloning.
3928 2007-10-12 Marek Safar <marek.safar@gmail.com>
3930 A fix for bug #333342
3931 * class.cs (EventField): Don't mark value type event as synchronized.
3933 2007-10-12 Marek Safar <marek.safar@gmail.com>
3935 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
3936 inference to identify best candidate method correctly.
3937 (ProperyExpr): A range variable is read only and cannot be modified.
3939 2007-10-11 Marek Safar <marek.safar@gmail.com>
3941 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
3942 logic to identify best candidate method correctly.
3944 2007-10-11 Marek Safar <marek.safar@gmail.com>
3946 * location.cs (Equals, GetHashCode): Removed.
3948 2007-10-11 Marek Safar <marek.safar@gmail.com>
3950 * report.cs: Implemented message recorder. It is used mainly for lambda
3951 expressions to capture otherwise swallowed error messages.
3953 * anonymous.cs, lambda.cs.cs: Do full parameters check.
3955 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
3957 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
3959 * expression.cs (MemberAccess): Always report lookup failure.
3961 * location.cs: Implemented Equals, GetHashCode.
3963 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
3965 2007-10-10 Jb Evain <jbevain@novell.com>
3967 * codegen.cs: re-enable assembly version check.
3969 2007-10-09 Marek Safar <marek.safar@gmail.com>
3971 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
3974 * namespace.cs (UsingAlias): Do correct version check.
3976 2007-10-08 Marek Safar <marek.safar@gmail.com>
3978 * expresison.cs, ecore.cs: Issue extension method error message when
3981 * rootcontext.cs: Added ISO_2 compiler mode option.
3983 2007-10-08 Marek Safar <marek.safar@gmail.com>
3985 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
3988 2007-10-08 Marek Safar <marek.safar@gmail.com>
3990 * attribute.cs (GetString, GetBoolean): Work with both literal and
3993 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
3994 Moved method overload specific methods to MethodGroupExpr.
3996 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
3997 it should be less memory consuming.
3999 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
4001 * codegen.cs: remove the assembly version check until the buildbot is
4004 2007-10-07 Jb Evain <jbevain@novell.com>
4006 * attribute.cs (Attribute.GetString): if the value
4007 expression is a StringConstant, return its string value.
4009 2007-10-07 Jb Evain <jbevain@novell.com>
4011 * typemanager.cs: add `assembly_version_attribute_type`.
4012 * codegen.cs: on attribute emission, check that the
4013 AssemblyVersionAttribute doesn't overflow.
4015 2007-10-05 Marek Safar <marek.safar@gmail.com>
4017 A fix for bug #324677
4018 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
4019 parent container of a scope container with currently resolved one.
4021 2007-10-05 Marek Safar <marek.safar@gmail.com>
4023 A fix for bug #325534
4024 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
4027 2007-10-05 Marek Safar <marek.safar@gmail.com>
4029 A fix for bug #327504
4030 * class.cs (Operator.Define): Refactored implicit and explicit user
4031 operator conversion rules.
4033 2007-10-05 Marek Safar <marek.safar@gmail.com>
4035 A fix for bug #327520
4036 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
4038 2007-10-04 Marek Safar <marek.safar@gmail.com>
4040 A fix for bug #328022
4041 * class.cs (MethodData.Define): Use correct method to check whether
4042 a method implementents an accessor.
4044 2007-10-04 Marek Safar <marek.safar@gmail.com>
4046 A fix for bug #330069
4047 * statement.cs (Fixed.Resolve): Read the first array element only when
4048 an array is instantiated.
4050 2007-10-04 Marek Safar <marek.safar@gmail.com>
4052 * expression.cs, assign.cs, generics.cs: Print correct operator when
4053 compound assignment is used.
4055 2007-10-04 Marek Safar <marek.safar@gmail.com>
4057 A fix for bug #325841
4058 * expression.cs (ArrayAccess): Use full argument cloning only for
4059 string compound concatenation.
4061 2007-10-03 Marek Safar <marek.safar@gmail.com>
4063 A fix for bug #328774
4064 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
4066 (PropertyExpr.EmitAssign): Fixed string concatenation compound
4069 2007-10-03 Raja R Harinath <rharinath@novell.com>
4072 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
4073 Event accessibility checks here. Remove some bogus code that
4074 accidently made GenericMethods work.
4075 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
4077 2007-09-25 Marek Safar <marek.safar@gmail.com>
4079 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
4081 * statement.cs (Block): Refactored AddVariable to allow error handling
4084 * generic.cs: New stub.
4086 2007-09-23 Marek Safar <marek.safar@gmail.com>
4088 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
4091 2007-09-17 Marek Safar <marek.safar@gmail.com>
4093 * class.cs: Use partial container to record whether any partial part
4094 contains static field initializer and therefore default contructor has
4097 2007-09-14 Marek Safar <marek.safar@gmail.com>
4099 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
4100 mono-list when only one of two partial parts has defined accessibility
4103 2007-09-14 Marek Safar <marek.safar@gmail.com>
4105 A fix for bug #82845
4107 * class.cs (TypeContainer): Set correct resolve context for all field
4110 2007-09-13 Marek Safar <marek.safar@gmail.com>
4112 * assign.cs: Fixed a crash when field is resolved twice with an error.
4114 * codegen.cs: Changed InFieldInitializer to be flag.
4116 * anonymous.cs, ecore.cs, expression.cs: Update after
4117 IsInFieldInitializer rename.
4119 * const.cs: Removed unused parameter.
4121 * class.cs: Changed the way how we resolve and emit field initializers.
4122 The field initilizers have to have access to contructor block to emit
4123 compiler generated code.
4125 2007-09-13 Marek Safar <marek.safar@gmail.com>
4127 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
4128 generics use TypeContainer instead.
4130 2007-09-12 Marek Safar <marek.safar@gmail.com>
4132 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
4134 * lambda.cs (ResolveParameters): Use more powerful
4135 InflateGenericArgument.
4137 * parameters.cs: Better exception message.
4139 2007-09-10 Marek Safar <marek.safar@gmail.com>
4141 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
4142 correct expression block type.
4144 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
4146 * expression.cs (Invocation): Extracted method group resolve to
4149 2007-09-07 Marek Safar <marek.safar@gmail.com>
4151 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
4152 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
4154 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
4155 generic extension methods.
4157 2007-09-06 Marek Safar <marek.safar@gmail.com>
4159 A fix for bug #82676 (Do I get it right now?)
4160 * convert.cs (Binary.ResolveOperator): An interface is converted to the
4161 object before a standard conversion is applied.
4163 2007-09-06 Marek Safar <marek.safar@gmail.com>
4165 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
4168 2007-09-05 Marek Safar <marek.safar@gmail.com>
4170 A fix for bug #82676
4171 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
4172 non-generic interface types.
4174 2007-09-05 Marek Safar <marek.safar@gmail.com>
4176 A fix for bug #82690
4177 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
4179 2007-09-05 Marek Safar <marek.safar@gmail.com>
4181 A fix for bug #82571
4182 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
4183 modifier for container based methods.
4185 2007-09-05 Marek Safar <marek.safar@gmail.com>
4187 A fix for bug #82676
4188 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
4189 any interface-type T means to any of interface type T.
4191 2007-09-04 Marek Safar <marek.safar@gmail.com>
4193 * namespace.cs: We have 2 versions of System.Core assembly.
4195 2007-09-04 Marek Safar <marek.safar@gmail.com>
4197 A fix for bug #82652
4198 * class.cs (Class.GetClassBases): Compare types and not expressions.
4200 2007-09-04 Marek Safar <marek.safar@gmail.com>
4202 A fix for bug #82620
4203 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
4204 actually never worked before.
4205 (IndexerAccess): Emit prepared arguments before they are modified.
4207 2007-09-04 Marek Safar <marek.safar@gmail.com>
4209 A fix for bug #82563
4210 * assign.cs: Revert wrong fix.
4212 * expression.cs (VariableReference.EmitAssign): Handle ref reference
4214 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
4215 Instead of ldelema/stdind we have to use temporary variables to handle
4216 cases like String.Concat (params string[]).
4218 2007-08-31 Marek Safar <marek.safar@gmail.com>
4220 * class.cs: EmitAttributes to Emit rename.
4222 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
4224 (MemberCore.HasClsCompliantAttribute): Don't depend on
4225 GetClsCompliantAttributeValue execution.
4227 2007-08-31 Marek Safar <marek.safar@gmail.com>
4229 * anonymous.cs: Use shorter type prefix.
4231 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
4234 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
4235 variables when probing is on.
4237 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
4238 unresolved variables.
4239 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
4240 handle transparent identifiers.
4242 2007-08-26 Marek Safar <marek.safar@gmail.com>
4244 * attribute.cs (IsClsCompliant): Add nullable types test.
4246 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
4248 * doc.cs : catch other types of exception than XmlException to
4249 report CS1570. Fixed bug #82565.
4251 2007-08-23 Marek Safar <marek.safar@gmail.com>
4253 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
4254 The number of delegate parameters has to match.
4255 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
4258 2007-08-21 Marek Safar <marek.safar@gmail.com>
4260 * anonymous.cs (AnonymousMethod): Generate private anonymous method
4261 to fix problem with private arguments.
4263 2007-08-20 Marek Safar <marek.safar@gmail.com>
4265 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
4267 * decl.cs (MemberName): Ignore generic type with no generic arguments.
4269 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
4270 empty. Add cloning suport.
4272 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
4274 2007-08-20 Marek Safar <marek.safar@gmail.com>
4276 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
4277 to create EmptyCast. It handles EmptyConstantCast specialization for
4280 2007-08-18 Marek Safar <marek.safar@gmail.com>
4282 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
4283 (EmitArrayArgument): One routine for array arguments.
4284 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
4286 2007-08-17 Marek Safar <marek.safar@gmail.com>
4288 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
4290 2007-08-17 Marek Safar <marek.safar@gmail.com>
4292 * anonymous.cs: MemberLookupFinal update.
4294 * class.cs (ConstructorInitializer): Is expression based.
4296 * delegate.cs: MethodGroupExpr update.
4298 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
4300 (Error_MemberLookupFailed): Customizable error override.
4301 (MethodGroupExpr): Keep queried type for later usage.
4302 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
4305 * expression.cs: Error_MemberLookupFailed refactoring.
4306 (New.DoResolve): Resolve as much as possible.
4307 (ElementInitializer.Error_MemberLookupFailed): Object initializer
4308 customization for invalid member types.
4310 * statement.cs: MethodGroupExpr update.
4312 2007-08-16 Marek Safar <marek.safar@gmail.com>
4314 * modifier.cs (Check): Check all modifiers and not only accessibility
4317 2007-08-16 Marek Safar <marek.safar@gmail.com>
4319 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
4320 type and not an expression.
4322 2007-08-16 Marek Safar <marek.safar@gmail.com>
4324 * statement.cs (Catch.Clone): Type and variable can be null.
4326 2007-08-16 Marek Safar <marek.safar@gmail.com>
4328 A fix for bug #81979
4329 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
4330 I am really not sure whether this is the best fix.
4332 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
4335 2007-08-14 Marek Safar <marek.safar@gmail.com>
4337 ** C# 3.0 Object and collection initializers (major re-write)
4339 * assign.cs (DoResolve): Initializers are not assign related.
4341 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
4342 used during collection or object initialization.
4344 * expression.cs (Error_InvalidArguments): Add initializers specific
4345 messages. More will come later because it requires some general
4347 (New.DoResolve): Better error handling for unsafe types.
4348 (EmptyExpressionStatement): New class.
4349 (ElementInitializer): An object initializer expression.
4350 (CollectionElementInitializer): A collection initializer expression.
4351 (CollectionOrObjectInitializers): A block of object or collection
4353 (NewInitialize): New expression with element/object initializers.
4355 * statement.cs: Reverted object/collection initializer hacks.
4357 * typemanager.cs (CSharpName): Filter __arglist type.
4359 2007-08-09 Marek Safar <marek.safar@gmail.com>
4361 ** C# 3.0 Anonymous Types (update to the latest standard)
4363 * expression.cs (Binary.ResolveOperator): Threat all null based types
4365 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
4366 (AnonymousTypeParameter): Updated.
4368 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
4369 (AnonymousTypeClass): New anonymous type container.
4371 * class.cs (AddField): Return operation result.
4373 * generic.cs: Another empty TypeArguments overload.
4375 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
4376 are stored at top of normal hierarchy.
4378 * typemanager.cs (CSharpName): Filter anonymous types.
4380 2007-08-09 Marek Safar <marek.safar@gmail.com>
4382 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
4383 as single Concat call. How could we miss that :-(
4385 2007-08-08 Marek Safar <marek.safar@gmail.com>
4387 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
4389 2007-08-07 Miguel de Icaza <miguel@novell.com>
4391 * expression.cs: Fix the previous commit, the creation of the
4392 arguments array list needs also to be conditional on the arguments
4395 * class.cs: Add a little bit of help to help narrow down problems.
4397 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
4398 not try to copy in that case.
4400 * driver.cs: When building SMCS, include a new different set of
4401 default assemblies here. Do this here so we can control whether
4402 to include the default assemblies with /noconfig.
4404 2007-08-03 Marek Safar <marek.safar@gmail.com>
4406 A fix for bug #81979
4407 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
4410 2007-08-03 Marek Safar <marek.safar@gmail.com>
4412 A fix for bug #82300
4414 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
4415 we are in probing scope.
4417 2007-08-03 Marek Safar <marek.safar@gmail.com>
4419 A fix for bug #82301
4421 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
4422 (Statement.CloneTo): Clone and not map children blocks.
4424 2007-08-03 Marek Safar <marek.safar@gmail.com>
4426 A fix for bug #82299
4428 * expression.cs (LocalVariableReference.CloneTo): Remap local info
4431 * statement.cs (Statement.CloneTo): Clone variables before statements
4432 to allow remaping of local variables.
4434 2007-08-03 Marek Safar <marek.safar@gmail.com>
4436 A fix for bug #82296
4439 * report.cs: Log crash details for future clone problems.
4441 * statement.cs (Return.Clone): Don't clone non-existent expression.
4443 2007-08-03 Raja R Harinath <harinath@gmail.com>
4445 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
4446 (Class.AddBasesForPart): Move CS0537 check here from ...
4447 * cs-parser.jay (class_declaration): ... here. Move calling of
4448 'AddBasesForPart' to ...
4449 (class_bases): ... here.
4450 (struct_declaration, interface_declaration): Update to changes.
4452 2007-08-02 Marek Safar <marek.safar@gmail.com>
4454 A fix for bug #81923
4456 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
4457 conversion is allowed.
4459 2007-08-02 Marek Safar <marek.safar@gmail.com>
4461 A fix for bug #81564
4463 * ecore.cs (EventExpr): Add IsBase handling.
4465 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
4468 2007-08-02 Raja R Harinath <harinath@gmail.com>
4470 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
4471 * cs-parser.jay: Some whitespace cleanups.
4472 (current_delegate): New.
4474 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
4475 a dummy code block, and use 'type_name' instead of 'member_name'.
4476 (interface_declaration, class_declaration): Likewise.
4477 (delegate_declaration): Likewise. Rearrange slightly and use
4479 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
4480 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
4482 2007-08-02 Marek Safar <marek.safar@gmail.com>
4484 A fix for bug #82039
4486 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
4489 * typemanager.cs (CSharpName): Split to string overload.
4491 2007-08-02 Marek Safar <marek.safar@gmail.com>
4494 * report.cs: Updated warning CS0472.
4496 2007-08-01 Marek Safar <marek.safar@gmail.com>
4498 A fix for bug #82181
4500 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
4502 2007-08-01 Marek Safar <marek.safar@gmail.com>
4504 A fix for bug #82277
4505 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
4507 2007-08-01 Marek Safar <marek.safar@gmail.com>
4509 ** C# 3.0 Type Inference (major bits are working)
4511 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
4512 (.ImplicitStandardConversionExists): Uses compatible.
4513 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
4514 (.InferReturnType): New method.
4515 (.Compatible): Refactored.
4516 (.ResolveParameters): Uses factory to create resolved parameters.
4517 (.CompatibleMethod): Add probing mode support.
4518 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
4519 clearly distinguish between 2 different operations.
4520 (LambdaMethod): Moved to lambda.cs.
4521 (AnonymousMethod): Removed unused fields and methods.
4522 (AnonymousDelegate): Simplified.
4524 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
4526 * convert. cs (ImplicitConversionStandard): Compatible works differently.
4528 * delegate.cs (Delegate): New mehods to reduce code duplication.
4529 (.GetConstructor): New method.
4530 (.GetInvokeMethod): New method.
4531 (DelegateCreation): Updated.
4533 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
4535 (OverloadResolve): Made probing little bit faster.
4537 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
4540 * generic.cs (TypeInferenceContext): Dummy implementation.
4542 * iterators.cs: Updated after Resolve/Define rename.
4544 * lambda.cs (LambdaExpression)
4545 (.ResolveParameters): Handles both type of arguments and type inference too.
4547 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
4548 (InflateTypes): Updated.
4550 * support.cs (InflateTypes): Changed signature and updated.
4552 * typemanager.cs (LookupMemberCache): Better dynamic type check.
4553 (MemberLookup_FindMembers): More MS tricks.
4554 (GetParameterData): Ditto.
4555 (GetDelegateParameters): Uses quick path for dynamic types.
4557 2007-08-01 Marek Safar <marek.safar@gmail.com>
4559 * class.cs (MethodData.Define): EmitContext is required for generic stuff
4562 2007-07-31 Marek Safar <marek.safar@gmail.com>
4564 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
4567 2007-07-26 Jb Evain <jbevain@novell.com>
4569 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
4570 which takes a boolean 'report_errors', similar to the GetMethod.
4571 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
4572 in .net 2.1, do not report errors here.
4574 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
4575 System.Runtime.CompilerServices.RequiredAttributeAttribute and
4576 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
4579 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
4580 of the type InternalsVisibleToAttribute before the first call
4581 to CoreLookupType which is allowed to fail (third boolean parameter
4582 to true). Because, during the resolution for a type that is not
4583 immediately found, we try to check if the type is not defined in
4584 a friend assembly, and to do so, we need the
4585 InternalVisibleToAttribute.
4587 2007-07-23 Miguel de Icaza <miguel@novell.com>
4589 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
4590 feature that allows structs to be compared against null and inline
4591 the result as true or false.
4593 Notice that the same code is not permitted inside a generic block
4594 of code that would do:
4596 class Foo<T> where T : struct {
4603 It is only allowed if the type of T is not bound (no where
4604 clause). In my opinion, this CSC 2 behavior is broken but people
4605 seem to be using it (IronRuby does, a few bug reports on bugzilla
4606 have it and some people have complained about it).
4608 All of the users that depend on this behavior have code that is
4611 * report.cs (Warning, Error): make these take object arguments,
4612 not strings, as that allows us to take advantage of Format.
4614 2007-07-20 William Holmes <billholmes54@gmail.com>
4616 * decl.cs: Changed MemberName.CountTypeArguments to also check the
4617 Left member variable for the Count.
4618 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
4619 MemberName.CountTypeArguments to avoid a NRE.
4621 This code is contributed under the MIT X11 license
4623 2007-07-18 Marek Safar <marek.safar@gmail.com>
4625 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
4627 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
4629 * doc.cs : generic method arguments are written as ``x while generic
4630 type arguments are `x. Combined with the previous change, fixed bug
4633 2007-07-18 Raja R Harinath <rharinath@novell.com>
4636 * expression.cs (Binary.ResolveOperator): When converting
4637 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
4639 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
4641 * doc.cs : when T: or whatever x: is specified, it does not really
4642 check the doc comment's syntax correctness. Fixed bug #82006.
4644 2007-07-18 Marek Safar <marek.safar@gmail.com>
4646 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
4647 LambdaExpression better.
4649 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
4651 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
4653 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
4654 as it can be generated.
4656 * expression.cs (Invocation.Error_InvalidArguments): Show correct
4659 * lambda.cs (LambdaExpression): Refactored to share same code with
4660 AnonymousMethodExpression.
4662 2007-07-17 Marek Safar <marek.safar@gmail.com>
4664 * anonymous.cs (MakeName): Include host name for easier debugging.
4665 (LambdaMethod): New class for lambda spcecific stuff.
4667 * attribute.cs: Set EmitContext return type.
4669 * class.cs: Set EmitContext return type.
4671 * codegen.cs (EmitContext): Return type cannot be null to stop messing
4672 with null/void meaning.
4674 * iterators.cs (ContainerType): Implemented.
4676 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
4678 * statement.cs (Return): Updated to lambda expressions.
4679 (Block.CloneTo): Parent can be null.
4681 2007-07-13 Marek Safar <marek.safar@gmail.com>
4683 A fix for bug #81917
4684 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
4686 * class.cs (FixedField): Check whether field is in unsafe scope.
4688 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
4689 (FieldExpr.Emit): Fixed buffers cannot be volatile.
4691 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
4694 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
4696 2007-07-13 Marek Safar <marek.safar@gmail.com>
4698 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
4699 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
4702 2007-07-13 Marek Safar <marek.safar@gmail.com>
4704 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
4706 2007-07-13 Marek Safar <marek.safar@gmail.com>
4708 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
4709 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
4711 * codegen.cs(EmitContext): Add ProbingMode flag.
4713 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
4715 * driver.cs: For now set both warning values.
4717 * ecore.cs (SimpleName): Name is readonly.
4718 (MethodGroup.OverloadResolve): One quick path for probing.
4720 * expression.cs (Unary): Set Oper r/o.
4721 (Binary): Set Oper r/o.
4722 (ParameterReference): Set few instance variables as r/o.
4723 (ParameterReference.DoResolveBase): Don't capture aruments when
4725 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
4726 (Arglist): arguments are private.
4727 (SizeOf): type is private and r/o.
4728 (MemberAccess): arguments are private.
4730 * report.cs: Enhanced reporting on/off capabilities.
4732 * lambda.cs: Uses ec.IsInProbingMode.
4733 (ContextualReturn): Derives from return.
4735 * rootcontext.cs: For now set both warning values.
4737 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
4739 (Return.Resolve): Don't die immediately.
4740 (Block.Resolve): Speed-up probing.
4741 (Block.CloneTo): Clone only child blocks.
4743 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
4745 * iterators.cs: reverted Miguel's latest change (r81925) as it
4746 breaks the build in System.
4748 2007-07-13 Miguel de Icaza <miguel@novell.com>
4750 * iterators.cs (Yield.CheckContext): Check for the iterator type
4751 also here as we can call into Yield even in codepaths that are not
4753 (MethodOrOperator is the only path that was checked).
4755 In addition to the standard check, use a more specific check for
4756 constructors to report a more verbose error.
4758 2007-07-12 Miguel de Icaza <miguel@novell.com>
4760 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
4761 report the warning and continue
4763 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
4764 values on the stack on the call to Emit. Use EmitStatement if
4765 possible, or using Emit + Pop if not possible. Fixes #82064
4767 2007-07-12 Raja R Harinath <rharinath@novell.com>
4769 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
4770 avoid try...finally in some cases.
4772 2007-07-10 Marek Safar <marek.safar@gmail.com>
4774 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
4776 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
4777 instead of method. Re-use standard error handling.
4778 (ConstructorInitializer.Emit): Simplified.
4780 * delegate.cs: Updated after Invocation.EmitCall change.
4782 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
4783 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
4784 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
4785 method and don't permanently changing input arguments.
4786 (MethodGroupExpr): Introduced resolved best_candidate, when method group
4787 is resolved it has one of the candidates is the best one which is later
4788 used to emit. Removed a few unused method.
4789 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
4791 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
4792 (Binary.ResolveOperator): Ditto.
4793 (ConditionalLogicalOperator.DoResolve): Ditto.
4794 (Invocation): Uses method group.
4795 (Invocation.DoResolve): Simplified.
4796 (Invocation.EmitCall): Removed useless is_static.
4797 (Invocation.Emit): Delegate to method group.
4798 (Invocation.EmitStatement): Simplified.
4799 (New): Uses method group.
4800 (MemberAccess.DoResolve): Don't destroy original expression.
4802 * statement.cs (ForEach.Resolve): Use null for no method arguments.
4804 2007-07-04 Marek Safar <marek.safar@gmail.com>
4806 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
4809 * lambda.cs: Add custom error message type.
4811 2007-07-03 Marek Safar <marek.safar@gmail.com>
4813 * lambda.cs: Simplified little bit.
4815 * parameter.cs: Introduced ImplicitLambdaParameter.
4816 (Parameters.CreateFullyResolved): New factory instead of ctor.
4820 * delegate.cs: Updated parameter creation.
4822 2007-07-03 Marek Safar <marek.safar@gmail.com>
4824 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
4827 * generic.cs: Synchronized with gmcs.
4829 2007-07-03 Marek Safar <marek.safar@gmail.com>
4831 * class.cs (Indexer): Check return type as soon as possible.
4833 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
4836 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
4838 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
4840 * parameter.cs (Parameter): Use expression type when it is available.
4842 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
4843 method modifier for the first parameter only.
4845 2007-06-24 Marek Safar <marek.safar@gmail.com>
4847 A fix for bug #81938
4848 * typemanager.cs (ChangeType): Fixed couple of char conversions.
4850 * constant.cs: Tide up an exception message.
4852 2007-06-22 Marek Safar <marek.safar@gmail.com>
4854 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
4855 an uninitialized variable is used.
4857 * expression.cs (LocalVariableReference.DoResolve): Ditto.
4859 2007-06-22 Marek Safar <marek.safar@gmail.com>
4861 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
4862 not found error handling.
4864 * expression.cs (ArrayCreation): Removed redundant fields and little bit
4866 (ArrayCreation.ResolveArrayElement): To be ready to customization.
4867 (ArrayCreation.DoResolve): Simplified.
4868 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
4869 its own resolve process.
4870 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
4872 2007-06-20 Marek Safar <marek.safar@gmail.com>
4874 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
4877 2007-06-20 Marek Safar <marek.safar@gmail.com>
4879 * cs-tokenizer.cs: Removed var related stuff.
4881 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
4882 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
4883 a type and a keyword at same time.
4885 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
4888 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
4889 implicitly typed arrays, more changes will follow.
4891 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
4893 2007-06-19 Marek Safar <marek.safar@gmail.com>
4895 * ecore.cs (VarExpr): Removed Handled field.
4897 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
4898 build-in assign functionality.
4899 (ForEach.Resolve): Removed all implicitly typed local variable code and
4901 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
4902 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
4904 2007-06-18 Marek Safar <marek.safar@gmail.com>
4906 * assign.cs: Removed implicitly typed local variable check.
4908 * expression.cs (LocalVariableReference.DoResolve): Add check for self
4909 referencing implicitly typed local variable.
4910 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
4913 * statement.cs (Fixed): Removed unsupported implicitly typed local
4916 2007-06-15 Marek Safar <marek.safar@gmail.com>
4918 * decl.cs (MemberName): Moved all Unbound stuff to parser.
4920 2007-06-14 Marek Safar <marek.safar@gmail.com>
4922 A fix for bugs #81855 and #76274
4923 * attribute.cs (AttachTo): Always set owner for global attributes to
4926 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
4929 * cs-parser.jay: Assembly and module attributes must precede all other
4930 elements except using clauses and extern alias declarations.
4932 2007-06-13 Marek Safar <marek.safar@gmail.com>
4934 A fix for bug #81748
4936 * expression.cs: More checks for non ISO-1 features.
4938 2007-06-12 Marek Safar <marek.safar@gmail.com>
4940 A fix for bug #81807
4941 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
4942 present inside switch statement and it is required by nullable check.
4944 2007-06-12 Marek Safar <marek.safar@gmail.com>
4946 A fix for bug #81840
4947 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
4948 when type matching fails.
4950 * namespace.cs: Tiny error message change.
4952 2007-06-12 Marek Safar <marek.safar@gmail.com>
4954 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
4955 reporting. Added automatic property check.
4957 * class.cs: Updated after CheckAbstractAndExtern relocation.
4958 (AEventPropertyAccessor.GetSignatureForError): Customized.
4960 2007-06-11 Marek Safar <marek.safar@gmail.com>
4962 * class.cs (DefineBaseTypes): Base type can be undefined.
4964 * ecore.cs (TypeLookup): Minor refactoring.
4965 (DoResolveAsTypeStep): Removed redundant check.
4967 * namespace.cs (Lookup): Removed redundant check.
4969 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
4970 ResolveAsTypeTerminal step.
4971 (BootstrapCorlib_*): Simplified.
4972 (PopulateCoreType): Core types can be now external.
4974 2007-06-07 Marek Safar <marek.safar@gmail.com>
4976 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
4978 (InferTypeArguments): Infers anonymous expression type arguments.
4979 (Compatible): Split to Compatible and InferTypeArguments.
4981 * lambda.cs: Updated.
4983 2007-06-08 Marek Safar <marek.safar@gmail.com>
4985 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
4987 2007-06-07 Raja R Harinath <harinath@gmail.com>
4989 Fix #80477, cs0135-2.cs, cs0135-3.cs
4990 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
4991 names to the "known" variables list.
4992 (Block.CheckInvariantMeaningInBlock): Handle the fact the
4993 parameter names are also "known".
4994 (Block.CheckError136): Remove.
4995 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
4998 2007-06-07 Marek Safar <marek.safar@gmail.com>
5000 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
5002 2007-06-06 Marek Safar <marek.safar@gmail.com>
5004 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
5005 internal error not an user error.
5007 * expression.cs (IsApplicable): Refactored to make debugging easier.
5009 * support.cs: More tricks for non-mono runtimes.
5011 * typemanager.cs (CoreLookupType): Made public.
5012 (InitSystemCore): All linq specific stuff moved to linq.cs
5014 2007-06-05 Marek Safar <marek.safar@gmail.com>
5016 * typemanager.cs (CSharpSignature): One more missing build-in types
5018 More tricks for non-mono runtime.
5020 2007-06-05 Raja R Harinath <harinath@gmail.com>
5022 * statement.cs (Block.CheckError136_InParents): Remove.
5023 (Block.AddVariable): Use GetParameterInfo instead.
5024 (ToplevelBlock.ProcessArguments): Likewise.
5026 2007-06-04 Raja R Harinath <rharinath@novell.com>
5028 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
5030 (ToplevelBlock.GetParameterInfo): Split out of ...
5031 (ToplevelBlock.GetParameterRefernce): ... this.
5032 (ToplevelBlock.ParameterMap): Remove.
5033 * expression.cs (ParameterReference): Update to use
5034 ToplevelParameterInfo.
5036 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
5039 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
5040 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
5042 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
5043 (ToplevelBlock.ProcessParameters) ... here.
5044 (ToplevelBlock..ctor): Invoke it.
5046 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
5049 * statement.cs (IKnownVariable): New interface.
5050 (LocalInfo): Implement it.
5051 (ToplevelParameterInfo): New class.
5052 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
5053 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
5054 GetKnownVariableInfo.
5056 2007-06-03 Raja R Harinath <harinath@gmail.com>
5058 Partly speed up CS0136 error checks.
5059 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
5060 'recurse' parameter.
5061 (Block.DoCheckError136): Only check errors in parameters. Move
5062 local variable checks ...
5063 (Block.AddVariable): ... here, and ...
5064 (ToplevelBlock.ResolveMeta): ... here.
5066 2007-06-02 Raja R Harinath <harinath@gmail.com>
5068 * statement.cs (Block.IsChildOf): Remove.
5070 * statement.cs (Statement.Clone): Move special case code ...
5071 (Block.CloneTo): ... here.
5073 2007-05-29 Raja R Harinath <rharinath@novell.com>
5075 * statement.cs (ToplevelBlock.container): Remove field. It's
5076 redundant with 'Parent'.
5077 (ToplevelBlock.ContainerBlock): Remove accessor.
5078 (ToplevelBlock..ctor): Update to changes. Register anonymous
5079 child with parent here, ...
5080 * cs-parser.jay (end_anonymous): ... not here. Don't modify
5082 (start_anonymous): Don't save current_block.
5083 (top_current_block): Remove.
5085 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
5086 (Block.Resolve): Update to changes.
5087 (Block..ctor): Move setting of "correct" 'Toplevel'
5088 and 'Explicit' fields to ...
5089 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
5091 2007-05-27 Raja R Harinath <harinath@gmail.com>
5094 * statement.cs (Block.Implicit): Remove.
5095 (Block): Update to changes.
5096 * flowanalysis.cs: Likewise.
5098 Mildly speed up CheckInvariantMeaningInBlock
5099 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
5100 Recursively call AddKnownVariable to all enclosing blocks.
5101 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
5102 Remove recursive calls.
5103 (Block): Update to changes.
5105 New ExplicitBlock invariants
5106 * statement.cs (Block.Explicit): New field. It points to the
5107 immediately enclosing non-implicit block.
5108 (Block..ctor): Maintain the invariant.
5109 * cs-parser.jay: Take advantage of invariant.
5111 Introduce ExplicitBlock
5112 * statement.cs (ExplicitBlock): New.
5113 (ToplevelBlock): Derive from it.
5114 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
5116 (Block.Implicit): Update to changes.
5117 * cs-parser.jay: Update to changes.
5120 * codegen.cs (EmitContext.IsLastStatement): Remove.
5121 * statement.cs (Block.DoEmit): Update to changes.
5123 2007-05-25 Raja R Harinath <rharinath@novell.com>
5125 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
5126 modifying current_block directly.
5128 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
5130 * class.cs: Implemented automatic properties (C# 3.0)
5131 Thanks to Marek for the help.
5133 2007-05-23 Raja R Harinath <rharinath@novell.com>
5135 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
5136 variable as assigned, note also that all its components are
5138 (MyBitVector.SetRange): New. Function to set multiple bits to true.
5140 2007-05-19 Marek Safar <marek.safar@gmail.com>
5142 * anonymous.cs, class.cs: Emit Compiler generated attribute when
5143 member is marked as compiler generated.
5145 * decl.cs (MemberCore): Refactored ModFlags into property.
5147 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
5148 (Check): Check only accessibility modifiers.
5150 2007-05-18 Raja R Harinath <rharinath@novell.com>
5152 Track all assignable slots in one bit array
5153 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
5154 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
5155 logic from VariableMap constructor here. Use the same 'offset'
5156 variable that's later used for computing offsets of local
5158 * flowanalysis.cs (UsageVector.parameters): Remove.
5159 (UsageVector): Update to changes.
5160 (VariableMap): Remove.
5162 Avoid creating ParameterMap in every block
5163 * statement.cs (Block.ParameterMap): Move ...
5164 (ToplevelBlock.ParameterMap): ... here.
5165 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
5167 * flowanalysis.cs (FlowBranching.param_map): Remove.
5168 (FlowBranching.UsageVector): Update to changes.
5169 (FlowBranchingToplevel.CheckOutParameters): Likewise.
5171 * statement.cs (Block.CloneTo): Clone Toplevel field too.
5173 * expression.cs (ParameterReference): Distinguish between block
5174 where parameter was referenced and declared.
5176 2007-05-18 Marek Safar <marek.safar@gmail.com>
5178 * flowanalysis.cs, statement.cs: Put back improved error handling.
5180 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
5184 Imporved object and collection initialization (C# 3.0).
5186 2007-05-15 Marek Safar <marek.safar@gmail.com>
5188 A fix for bug #81380
5189 * expression.cs (Is.DoResolve): Only value types have constant `is'
5192 2007-05-15 Raja R Harinath <rharinath@novell.com>
5194 * statement.cs (ToplevelBlock.child): Remove.
5196 2007-05-15 Raja R Harinath <harinath@gmail.com>
5198 Rationalize ResolveMeta: refactoring
5199 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
5200 out constant handling code into ...
5201 (Block.DoResolveConstants): ... this.
5203 Rationalize ResolveMeta: kill local_map
5204 * statement.cs (Block.local_map, Block.LocalMap): Remove.
5205 (Block.AssignableSlots): New.
5206 (Block.ResolveMeta): Make protected. Don't create a VariableMap
5207 for locals -- move code from VariableMap here. Avoid unnecessary
5209 * flowanalysis.cs (FlowBranching.local_map): Remove.
5210 (FlowBranching..ctor): Use Block.AssignableSlots.
5211 (VariableMap): Remove unused constructors.
5213 2007-05-11 Raja R Harinath <rharinath@novell.com>
5215 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
5217 2007-05-11 Marek Safar <marek.safar@gmail.com>
5219 * typemanager.cs (IsFriendAssembly): Should not be called for building
5222 2007-05-09 Marek Safar <marek.safar@gmail.com>
5224 * literal.cs (NullConstant): Print null in all cases.
5226 * expression.cs (Binary.ResolveOperator): Implemented delegate
5227 comparison based on C# 2.0 changes.
5229 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
5231 This code is contributed under the MIT X11 license
5233 The following enables support for several C# 3.0 language features:
5235 * cs-tokenizer.cs: Added support for the "var" keyword.
5237 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
5238 Added VarExpr class to facilitate type inferencing.
5240 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
5241 to support anonymous types.
5243 * assign.cs: Added support for type inferencing and initialization.
5245 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
5247 * expression.cs: Added implicit array support to ArrayCreation.
5248 Added 5 types and 1 interface:
5250 IInitializable Implementing classes can inject initializing
5251 statements after object instantiation.
5253 Initializer Stores data for object initialization.
5255 AnonymousType An expression for anonymous types.
5257 AnonymousTypeParameter Stores data about an anonymous type's field.
5259 NewInitialize An expression for object initialization.
5261 CollectionInitialize An expression for collection initialization.
5263 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
5266 2007-05-06 Marek Safar <marek.safar@gmail.com>
5268 A fix for bug #81500
5269 * cs-tokenizer.cs: Add special handling for coalescing operator.
5271 2007-05-06 Marek Safar <marek.safar@gmail.com>
5273 A fix for bug #81529
5274 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
5275 its value from base class until it is redefined.
5277 2007-05-02 Raja R Harinath <rharinath@novell.com>
5279 Fix regression in cs0631-3.cs
5280 * cs-parser.jay (operator_declarator): Add opt_attributes to error
5281 fallback. Make error fallback catch more cases.
5283 2007-05-01 Miguel de Icaza <miguel@novell.com>
5285 * cs-parser.jay: Allow parameters in operator declarations to have
5288 2007-04-27 Miguel de Icaza <miguel@novell.com>
5290 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
5293 * lambda.cs (ContextualReturn.Resolve): An expression is valid
5294 inside the ContextualReturn, it does not have to be an
5295 ExpressionStatement.
5297 2007-04-24 Miguel de Icaza <miguel@novell.com>
5299 * lambda.cs (ContextualReturn.Resolve): if the return type is not
5302 2007-04-23 Miguel de Icaza <miguel@novell.com>
5304 * anonymous.cs (AnonymousContainer): split the virtual Resolve
5305 method in two methods: ResolveNoDefine and Resolve.
5307 ResolveNoDefine will stop just after ResolveTopBlock has been
5310 Resolve will then continue by creating a method and issuing the
5311 call to method.Define ().
5313 (AnonymousMethod): Split and implement the new Resolve and
5314 ResolveNoDefine as well.
5316 * lambda.cs (LambdaExpression): Split the anonymous method
5317 resolution code into a separate routine (CoreCompatibilityTest)
5318 from DoCompatibleTest.
5320 (LambdaExpression.TryBuild): New method, this method tries to
5321 build the LambdaExpression with the given set of types to be used
5322 as the types for the various parameters of the lambda expression.
5324 If the compilation succeed with the given types, the infered type
5325 of the Anonymous method is returned, otherwise null is returned.
5327 2007-04-23 Marek Safar <marek.safar@gmail.com>
5329 A fix for bug #81414
5330 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
5332 2007-04-22 Miguel de Icaza <miguel@novell.com>
5334 * cs-tokenizer.cs: Change various identifiers here from the
5335 camelCasing to the recommended Linux-like style for instance
5336 variables from the Coding Guidelines.
5338 2007-04-19 Martin Baulig <martin@ximian.com>
5341 (Convert.ImplicitReferenceConversionCore): Allow conversions from
5342 System.Enum to System.ValueType.
5344 2007-04-13 Martin Baulig <martin@ximian.com>
5346 Rewrote implicit reference conversions. We need to distinguish
5347 between implicit reference conversions (13.1.4) and implicit
5348 boxing conversions (13.1.5).
5350 According to the spec, there's an an implicit conversion
5351 "From a one-dimensional array-type S[] to IList<T> and base
5352 interfaces of this interface, provided there is an implicit
5353 reference conversion from S to T." Note that this does not
5354 include boxing conversions.
5357 (Convert.ImplicitTypeParameterBoxingConversion): New method.
5358 (Convert.ImplicitReferenceConversion): Split into
5359 ImplicitReferenceConversionCore() and
5360 ImplicitBoxingConversionExist().
5361 (Convert.ImplicitReferenceConversionExists): Use the new
5362 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
5364 2007-04-12 Martin Baulig <martin@ximian.com>
5366 * convert.cs (Convert.ImplicitReferenceConversion): Move the
5367 `TypeManager.null_type' checks up to the top of the method.
5369 2007-04-11 Marek Safar <marek.safar@gmail.com>
5371 A fix for bug #81350
5372 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
5375 2007-04-11 Martin Baulig <martin@ximian.com>
5377 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
5378 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
5379 to make this work for generic classes; fixes #79561.
5381 2007-04-11 Martin Baulig <martin@ximian.com>
5383 * expression.cs (As): Add support for nullable types; fixes #79371.
5385 2007-04-11 Martin Baulig <martin@ximian.com>
5387 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
5388 `type.FullName' is null; fixes #80243.
5390 2007-04-11 Martin Baulig <martin@ximian.com>
5392 * expression.cs (Invocation.IsApplicable): Don't modify the method
5393 if type inference succeeded, but the method was not applicable.
5396 2007-04-10 Marek Safar <marek.safar@gmail.com>
5398 A fix for bug #81324
5399 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
5400 internal and external namespaces containers.
5402 2007-04-10 Martin Baulig <martin@ximian.com>
5404 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
5405 TypeManager.DropGenericMethodArguments() so we also call
5406 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
5408 2007-04-10 Martin Baulig <martin@ximian.com>
5410 * iterators.cs (Iterator.CreateIterator): Don't crash if
5411 `method.ReturnType' is null. This happens if something went wrong
5412 while resolving that typ (we already reported an error in this case).
5414 2007-04-10 Martin Baulig <martin@ximian.com>
5416 * expression.cs (New.DoResolve): Don't call CheckComImport() on
5417 generic interfaces; report the CS0144 directly.
5419 2007-04-10 Martin Baulig <martin@ximian.com>
5421 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
5422 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
5424 2007-04-10 Martin Baulig <martin@ximian.com>
5426 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
5428 2007-04-09 Raja R Harinath <rharinath@novell.com>
5431 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
5432 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
5435 * statement.cs (For.Resolve): If resolution fails, use
5438 2007-04-08 Marek Safar <marek.safar@gmail.com>
5440 * anonymous.cs (MakeName): Make faster and zero-based.
5441 (VerifyExplicitParameterCompatibility): Back to mode where generic
5442 parameter is ignored.
5443 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
5445 * class.cs (EmitType): Method can emit another new method.
5447 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
5449 * driver.cs: Updated.
5451 * lambda.cs: Reuse predefined empty parameters.
5453 * parameter.cs: Updated
5455 * support.cs: Implemented InflateTypes.
5457 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
5458 (InitSystemCore): Introduced to isolate 3.0 dependencies.
5460 2007-04-03 Martin Baulig <martin@ximian.com>
5464 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
5465 version of TypeManager.IsOverride() which also works with generic
5468 2007-04-03 Martin Baulig <martin@ximian.com>
5473 (Convert.ExplicitReferenceConversion): We need to cast when
5474 converting from IList<T> to S[].
5476 2007-04-01 Marek Safar <marek.safar@gmail.com>
5478 * decl.cs (FindExtensionMethods): Consider all candidates with same name
5481 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
5483 2007-03-31 Marek Safar <marek.safar@gmail.com>
5485 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
5486 argument and return type inferring.
5488 * codegen.cs (InferReturnType): Flag whether return can be inferred.
5489 (ReturnType): Turned to property.
5491 * statement.cs (Return): Implemented return type inferring.
5493 * support.cs (ReflectionParameters): Use local types if possible.
5495 2007-03-30 Raja R Harinath <rharinath@novell.com>
5497 * flowanalysis.cs (FlowBranching.Reachability): Remove.
5498 (FlowBranching.UsageVector): Update to changes.
5500 Prepare to kill 'Reachability'
5501 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
5502 argument of constructor.
5504 2007-03-29 Raja R Harinath <rharinath@novell.com>
5506 Prepare to kill 'Reachability'
5507 * flowanalysis.cs (UsageVector.is_unreachable): New.
5508 (UsageVector): Update to maintain 'is_unreachable' in parallel to
5509 'reachability', and verify they're consistent.
5512 * expression.cs (New.EmitStatement): Handle type parameters here too.
5514 2007-03-29 Martin Baulig <martin@ximian.com>
5519 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
5520 CompilerGeneratedClass.
5521 (ScopeInfo.EmitScopeInstance): Make this protected.
5522 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
5523 `ec.CurrentAnonymousMethod.Scope == Scope'.
5525 * statement.cs (Block.ScopeInfo): Make this a property.
5527 2007-03-27 Raja R Harinath <harinath@gmail.com>
5529 Prepare to kill 'Reachability'
5530 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
5531 (FlowBranching.UsageVector.Reachability): Remove property.
5532 (FlowBranching.UsageVector.IsUnreachable): New property.
5533 (FlowBranching.UsageVector.ResetBarrier): New.
5534 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
5535 * codegen.cs, statement.cs: Update to changes.
5537 2007-03-27 Martin Baulig <martin@ximian.com>
5542 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
5545 2007-03-26 Raja R Harinath <rharinath@novell.com>
5547 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
5548 instead of TriState. Remove all mention of TriState.
5550 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
5551 replaced by a boolean. Add boolean 'is_unreachable' field, check
5552 and maintain invariants.
5554 2007-03-25 Marek Safar <marek.safar@gmail.com>
5556 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
5558 2007-03-25 Marek Safar <marek.safar@gmail.com>
5560 * expression.cs: Stop using obsolete 2.0 opcodes.
5562 2007-03-25 Marek Safar <marek.safar@gmail.com>
5564 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
5565 one of the latests Martin's fixes.
5567 2007-03-23 Miguel de Icaza <miguel@novell.com>
5569 * expression.cs: On BigEndian systems, swap the bytes, temporary
5570 solution until we get a new bitconverter class.
5572 2007-03-23 Martin Baulig <martin@ximian.com>
5576 * decl.cs (MemberCache.AddMembers): Add generic methods both as
5577 "Method" and "Method`1". Normally, a cache lookup is done on the
5578 "Method" form (ie. without the generic arity), but this one makes
5579 lookups on the full form work as well.
5581 2007-03-22 Raja R Harinath <rharinath@novell.com>
5583 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
5586 2007-03-20 Bill Holmes <billholmes54@gmail.com>
5588 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
5589 ordered_member_list, to TypeBuilder to store members to be defined
5590 in the order they were parsed in.
5591 - ordered_explicit_member_list contains all properties indexers
5592 and methods that are defined as explicit implementation of an
5593 interface or base class.
5594 - ordered_member_list contains all properties indexers and methods
5595 that are not defined as explicit implementation of an interface
5598 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
5599 functionality in these removed classes has been replaced with
5600 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
5601 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
5603 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
5604 to CheckForDuplications inside GetMethod and SetMethod Define Method
5605 to handle method property and indexer name conflicts.
5609 All code is contributed under the MIT/X11 license.
5611 2007-03-20 Martin Baulig <martin@ximian.com>
5613 * class.cs (TypeContainer.Interfaces): Removed; they're now
5614 included in `TypeContainer.Types'.
5616 2007-03-20 Martin Baulig <martin@ximian.com>
5618 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
5620 * class.cs (TypeContainer.CreateType): New public method. This is
5621 now called before DefineType() to create the TypeBuilders.
5622 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
5623 has already been created by CreateType().
5624 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
5625 don't resolve our base classes here; this has been moved into
5626 DefineBaseTypes(). We're now called from CreateType().
5627 (TypeContainer.DefineBaseTypes): New private method; resolve our
5628 base classes here. We're now called from DefineType().
5631 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
5632 our types first to create all the TypeBuilders. After that, call
5633 TypeContainer.DefineType() on all the types which'll resolve their
5634 base classes and setup the resolve order.
5636 2007-03-20 Martin Baulig <martin@ximian.com>
5638 * class.cs (TypeContainer.Enums): Removed; they're now included in
5639 `TypeContainer.Types'.
5641 2007-03-20 Martin Baulig <martin@ximian.com>
5644 (TypeContainer.DefineType): Don't call ResolveMembers() here.
5645 (TypeContainer.DoResolveMembers): Call DefineType() on our
5646 `compiler_generated' classes; moved here from DefineNestedTypes().
5649 (RootContext.ResolveTree): Call ResolveMembers() on all
5650 TypeContainer's in the `type_container_resolve_order'.
5652 2007-03-19 Marek Safar <marek.safar@gmail.com>
5654 * class.cs: Use corlib to handle InternalMethodImplAttribute.
5656 2007-03-17 Marek Safar <marek.safar@gmail.com>
5658 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
5659 implementation flags.
5661 2007-03-17 Marek Safar <marek.safar@gmail.com>
5663 * class.cs: More optimizations for type parameters.
5665 2007-03-15 Marek Safar <marek.safar@gmail.com>
5667 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
5669 * ecore.cs, parameter.cs: More common code for both corlibs.
5671 * typemanager.cs (IsGenericMethod): Simplified.
5673 2007-03-15 Raja R Harinath <rharinath@novell.com>
5675 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5677 * statement.cs, iterators.cs, lambda.cs: Update to changes.
5679 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
5680 unconditionally. Simplify explanation.
5681 (Try.Resolve, Using.Resolve): Likewise.
5683 2007-03-15 Martin Baulig <martin@ximian.com>
5687 * decl.cs (DeclSpace): If we're a partial class, use our
5688 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
5690 2007-03-15 Raja R Harinath <rharinath@novell.com>
5692 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5694 (FlowBranching.UsageVector): Update to changes.
5695 (FlowBranching.MergeSiblings): Likewise.
5696 * statement.cs: Likewise.
5698 2007-03-15 Martin Baulig <martin@ximian.com>
5703 (MemberCache): Added a special .ctor for type parameters.
5706 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
5709 2007-03-09 Martin Baulig <martin@ximian.com>
5711 * enum.cs (Enum): Make this a TypeContainer.
5712 (EnumMember): Derive from `Const'.
5715 (Const.DoResolveValue): New protected virtual method; move most of
5716 the functionality of ResolveValue() here so we can override it in
5718 (Const.CreateConstantReference): Make this virtual.
5720 * class.cs (Kind): Add `Kind.Enum'.
5721 (TypeContainer.Emit): Don't emit the enums here; they're already
5722 in the `RootContext.typecontainer_resolve_order'.
5724 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
5725 here; they're already in the `typecontainer_resolve_order'.
5727 * ecore.cs (EnumConstant.ConvertImplicitly): Add
5728 TypeManager.DropGenericTypeArguments().
5731 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
5732 (TypeManager.IsEnumType): Likewise.
5733 (TypeManager.EnumToUnderlying): Likewise.
5734 (TypeManager.IsEqual): Add support for enums.
5736 2007-03-12 Raja R Harinath <rharinath@novell.com>
5738 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
5739 DefaultParameterValueAttribute to be undefined, say if System.dll
5742 2007-03-11 Marek Safar <marek.safar@gmail.com>
5744 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
5747 2007-03-10 Marek Safar <marek.safar@gmail.com>
5749 * class.cs, parameter.cs: Unified parameters verification.
5751 2007-03-08 Martin Baulig <martin@ximian.com>
5753 * cs-parser.jay (constructor_header): Pass the location to the
5754 newly created TopLevelBlock.
5756 2007-03-07 Martin Baulig <martin@ximian.com>
5758 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
5760 2007-03-06 Miguel de Icaza <miguel@novell.com>
5762 * convert.cs (ExplicitReferenceConversionExists): Sync this method
5763 with the changes from David, fixes the build.
5765 2007-03-05 David Mitchell <dmitchell@logos.com>
5767 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
5768 and its base interfaces to a one-dimensional array type S[],
5769 provided there is an implicit or explicit reference conversion
5772 2007-03-03 Marek Safar <marek.safar@gmail.com>
5774 * cs-tokenizer.cs: Implemented basic linq grammar.
5776 * driver.cs: Set linq lang version on demand.
5778 2007-02-26 Marek Safar <marek.safar@gmail.com>
5780 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
5782 2007-02-25 Marek Safar <marek.safar@gmail.com>
5784 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
5787 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
5789 Check property and event extern attributes.
5791 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
5794 2007-02-24 Marek Safar <marek.safar@gmail.com>
5796 A fix for bug #80407
5797 * ecore.cs: Don't report ambiguity error when methods have same parent.
5799 2007-02-23 Marek Safar <marek.safar@gmail.com>
5801 A fix for bug #80878
5802 * class.cs, cs-parser.jay: Event property can host anonymous methods.
5804 2007-02-22 Marek Safar <marek.safar@gmail.com>
5806 * attribute.cs: Enable ExtensionAttribute presence test.
5808 2007-02-22 Marek Safar <marek.safar@gmail.com>
5810 * class.cs: Warn about missing GetHashCode only when Equals is override.
5812 * decl.cs: Check accessibility of type arguments.
5814 * typemanager.cs: Correctly report nullable array.
5816 2007-02-20 Marek Safar <marek.safar@gmail.com>
5818 * class.cs, report.cs: Capture more details when things go wrong.
5820 2007-02-20 Marek Safar <marek.safar@gmail.com>
5822 A fix for bug #80650
5823 * cs-parser.jay: Anonymous container starts at constructor declaration
5824 and not at block beginning because it has to be usable in constructor
5827 * statement.cs: Use context location and not block one for error reporting.
5829 2007-02-18 Marek Safar <marek.safar@gmail.com>
5831 A fix for bug #78712
5832 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
5835 2007-02-18 Marek Safar <marek.safar@gmail.com>
5837 A fix for bug #80493 by Atsushi Enomoto
5838 * cs-parser.jay: Ignore invalid attribute target.
5840 2007-02-18 Marek Safar <marek.safar@gmail.com>
5842 * cs-tokenizer.cs: Ignore '\0' as white space character.
5844 2007-02-17 Miguel de Icaza <miguel@novell.com>
5846 * cs-parser.jay: Add support for lambda expressions to the mcs
5849 * lambda.cs: Only clone when we are probing, not on the final call
5850 (Compatible is the final call).
5852 * statement.cs (CloneContext): Introduce class to provide block
5853 remapping during clone.
5855 All statements Clone themselves now.
5857 (Clone): special handling for blocks, when we clone a block, we
5858 register the block inside this routine, as children of the block
5859 might trigger a lookup.
5861 * expression.cs: Add support for CloneContext in all expressions.
5863 2007-02-17 Marek Safar <marek.safar@gmail.com>
5865 A fix for bug #80493
5866 * statement.cs: Report ambiguous warning when interfaces are not related.
5868 2007-02-15 Marek Safar <marek.safar@gmail.com>
5870 C# 3.0 extension methods.
5872 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
5873 cannot be used directly.
5875 * class.cs (Class.Emit): Emit extension attribute if any class method
5876 is extension method.
5877 (Method.Define): Add basic extension method validation conditions.
5878 (Method.Emit): Emit extension attribute for method.
5880 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
5881 extension method exists. Currently we follow same approach as Microsoft
5882 does, emit even if a method or a class are private but this can change
5885 * cs-parser.jay: Add handling of `this' keyword in method parameters
5888 * decl.cs (DeclSpace.IsStaticClass): New property.
5889 (MemberCache.FindExtensionMethods): Looks for extension methods with
5890 defined name and extension type.
5892 * doc.cs: Updated after OverloadResolve changes.
5894 * driver.cs: Add new soft reference to System.Core.dll.
5896 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
5897 (ExtensionMethodGroupExpr): Represents group of extension methods.
5899 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
5900 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
5901 to MethodGroupExpr and made non-static for easier customization.
5902 (Invocation.DoResolve): Add extension method lookup when no standard
5904 (MemberAccess.DoResolve): Try extension methods if no member exists.
5906 * modifiers.cs: Add METHOD_EXTENSION modifier.
5908 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
5909 as well as candidate extension type.
5910 (ComputeNamespaces): When assembly constains extension methods registers
5912 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
5913 extension method lookup.
5914 (Namespace.LookupExtensionMethod): Looks for extension method in this
5916 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
5917 find a method which matches name and extensionType.
5919 * parameter.cs (Parameter): Add This modifer.
5920 (HasExtensionMethodModifier): New property.
5921 (Resolve): Add extension parameter check.
5922 (ModFlags): turned to property to exclude this modifier as it is not real
5924 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
5926 * support.cs (ParameterData): Add ExtensionMethodType.
5927 (ReflectionParameters): Implemented ExtensionMethodType interface property.
5929 * typemanager.cs: Add type and ctor extension attribute type.
5931 2007-02-15 Miguel de Icaza <miguel@novell.com>
5933 * report.cs (DisableErrors, EnableErrors): used to prevent error
5934 output when we are "trying" to compile various methods with
5937 * ecore.cs (Expression): Add Clone method that calls the virtual
5938 CloneTo method. The current CloneTo method in Expression throws
5939 an exception so we can track down all the places where this must
5940 be implemented (not using abstract, because that would be a lot of
5941 up-front-work before we can start testing the implementation
5944 Important: we only need Clone capabilities for expressions created
5945 by the parser, as the expressions we will be cloning are
5946 expressions in the pre-resolved state. This vastly simplifies
5949 (SimpleName): Add CloneTo that does nothing.
5950 (EmptyCast): Add CloneTo.
5952 * expression.cs (Binary): Implement CloneTo.
5953 (Invocation.IsApplicable): Store the current ec in
5954 EmitContext.TempEc and restore it on return. This is used so we
5955 do not have to sprinkle hundres of methods with an extra
5956 EmitContext, we know that the only user is the lambda expression
5957 ImplicitConversionExists code.
5959 (Argument): Add Cloning capabilities.
5960 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
5961 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
5962 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
5963 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
5964 IndexerAccess): Add Clone capability.
5966 (LocalVariableReference, This): TODO: needs cloned Block mapping.
5968 (Argument): Add cloning capability.
5970 * assign.cs (Assign): Implement CloneTo.
5972 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
5974 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
5975 version by calling Convert with the EmitContext (that we are
5976 currently storing in ec, this is not great, but will do for now,
5977 to avoid passing EmitContext parameters to hundreds of functions
5978 that do not need them now).
5980 (SetExpression): Remove, it is not needed.
5982 (ContextualReturn): Implement CloneTo.
5984 * statement.cs (Statement): Implement cloning infrastructure,
5985 similar to expressions.
5987 (Block): Partial implementation of Clone for statements.
5989 (Return): Implement clone.
5991 * constant.cs (Constant.CloneTo): New method, does nothing.
5993 * codegen.cs (TempEc): Add a static EmitContext as a temporary
5994 solution, until we decide how to exactly do this.
5996 2007-02-14 Marek Safar <marek.safar@gmail.com>
5998 A fix for bug #80493
5999 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
6000 a property is override we need to use second accessor.
6002 2007-02-13 Marek Safar <marek.safar@gmail.com>
6004 A fix for bug #80418
6005 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
6008 2007-02-13 Marek Safar <marek.safar@gmail.com>
6010 Another fix for bug #80749
6011 * pending.cs: Abstract class has priority over interfaces.
6013 2007-02-13 Marek Safar <marek.safar@gmail.com>
6015 Another fix for bug #80749
6016 * pending.cs: Abstract class has priority over interfaces.
6018 2007-02-13 Marek Safar <marek.safar@gmail.com>
6020 Another fix for bug #80749
6021 * pending.cs: Abstract class has priority over interfaces.
6023 2007-02-13 Marek Safar <marek.safar@gmail.com>
6025 Another fix for bug #80749
6026 * pending.cs: Abstract class has priority over interfaces.
6028 2007-02-13 Marek Safar <marek.safar@gmail.com>
6030 * class.cs Better error message.
6032 * driver.cs: Add shorter versions of -optimize option.
6034 2007-02-13 Martin Baulig <martin@ximian.com>
6036 * class.cs (Constructor.Emit): Check the return value of
6037 ec.ResolveTopBlock() and return on error.
6039 2007-02-13 Raja R Harinath <rharinath@novell.com>
6041 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
6042 message to fix error message regression.
6044 2007-02-12 Marek Safar <marek.safar@gmail.com>
6046 * delegate.cs: Delegate creation expression cannot be of Nullable type.
6048 2007-02-12 Marek Safar <marek.safar@gmail.com>
6050 A fix for bug #80749
6051 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
6052 its parent container.
6054 * class.cs (DefineFieldInitializers): Each initializer can has different
6057 * const.cs: Updated.
6059 2007-02-11 Miguel de Icaza <miguel@novell.com>
6061 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
6062 now all the heavy lifting to check that embedded statements or
6063 expressions have the right form is done in the ContextualReturn.
6065 (ContextualReturn): New class.
6067 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
6068 method that can be invoked to report 201, so we do not replicate
6071 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
6073 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
6074 treating tabs as spaces.
6076 2007-02-09 Marek Safar <marek.safar@gmail.com>
6078 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
6079 * assign.cs: Use full implicit conversion for right side check.
6081 2007-02-09 Marek Safar <marek.safar@gmail.com>
6083 * statement.cs (Switch): Switch over boolean type is not standardized.
6085 2007-02-08 Marek Safar <marek.safar@gmail.com>
6087 A fix for bug #80755
6088 * decl.cs (FindBaseEvent): Don't use method cache for events.
6090 2007-02-07 Marek Safar <marek.safar@gmail.com>
6092 * cs-parser.jay: Better syntax error handling.
6094 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
6095 instead of underlying type value.
6097 2007-02-06 Marek Safar <marek.safar@gmail.com>
6099 * driver.cs: Check define identifier before is registered.
6101 * namespace.cs: Use existing error message.
6103 * report.cs: New warning.
6105 2007-02-06 Marek Safar <marek.safar@gmail.com>
6107 A fix for bug #80742
6108 * expression.cs: Delegate Invoke method can be called directly.
6110 2007-02-06 Marek Safar <marek.safar@gmail.com>
6112 A fix for bug #80676
6113 * class.cs (IsEntryPoint): The Main method can have params modifier.
6115 2007-02-04 Miguel de Icaza <miguel@novell.com>
6117 * parameter.cs (Parameter, Parameters): Add Clone method.
6119 * anonymous.cs (Compatible): Turn method into virtual method, so
6120 LambdaExpression can implement a different behavior.
6122 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
6123 out the basic checking here, so it can be used by
6126 * lambda.cs: Introduce "Compatible" function that will do the
6129 2007-02-02 Marek Safar <marek.safar@gmail.com>
6131 * attribute.cs: Unified one error message.
6133 * class.cs (Class): Use type attributes and not properties to test static
6135 (IsEntryPoint): Don's pass local variable.
6137 * convert.cs: Removed duplicate check.
6139 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
6141 * driver.cs: Don't crash when soft reference does not exist.
6143 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
6144 (UsingEntry): Removed redundant allocation.
6146 * parameter.cs: Add fast path for type parameters.
6148 * support.cs: Don't allocate attribute when it's not used.
6150 2007-01-30 Miguel de Icaza <miguel@novell.com>
6153 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
6154 this into a virtual method, so we can override it in LambdaExpression.
6156 * driver.cs: Improve diagnostics in case of failure.
6158 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
6159 write a function that is slightly more complex and that parses:
6161 type identifier [, type identifier]* )
6163 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
6166 (canEmpty ? i >= 0 : i > 0)
6168 2007-01-30 Raja R Harinath <rharinath@novell.com>
6170 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
6171 exception on possibly valid code.
6173 2007-01-29 Raja R Harinath <rharinath@novell.com>
6175 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
6177 (parse_opt_type_arguments): Remove. It's almost the same as
6179 (parse_namespace_or_typename): Use parse_less_than.
6181 2007-01-28 Miguel de Icaza <miguel@novell.com>
6183 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
6184 this bug took a few hours to find, because the state saved and
6185 restored by PushPosition and PopPosition was ignoring the state of
6186 parse_generic_less_than.
6188 I can also now remove the handling of OP_LT and OP_GT, this solves
6191 * cs-tokenizer.cs: store the location for the ARROW token, we use
6194 (PushPosition, PopPosition): save/restore also `current_token',
6195 restore `parse_generic_less_than' (was missing).
6197 (parse_opt_type_arguments): use parse_type, not
6198 parse_namespace_or_typename to parse types.
6200 * lambda.cs: Empty new file, will eventually have the lambda
6201 expression implementation.
6203 * lambda.test: used to test the internal tokenizer.
6205 * report.cs (FeatureIsNotISO1): Rename from
6206 FeatureIsNotStandardized, because it was about the language level
6207 (1 vs 2) it was not about standarization.
6209 (FeatureRequiresLINQ): New.
6211 * support.cs (SeekableStreamReader): Only require that the reader
6212 is a TextReader, not a StreamReader, so we can plug StringReader.
6214 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
6215 given position in the input stream the following tokens can be
6216 parsed as a type followed by an identifier.
6218 (is_punct): after a '(' if parse_type_and_parameter returns true,
6219 then return a special token OPEN_PARENS_LAMBDA which is used to
6220 avoid reduce/reduce errors in the grammar for the
6221 lambda_expression rules.
6223 (parse_type): implement a type parser inside the
6224 tokenizer, the parser only returns true or false depending on
6225 whether the input at a given position can be parsed as a type.
6227 (peek_token): new method used during type parsing.
6229 2007-01-28 Raja R Harinath <rharinath@novell.com>
6232 * anonymous.cs (ScopeInfo.InflateParameters): New.
6233 (AnonymousContainer.Resolve): Use it to redirect types of
6234 delegate parameters.
6236 2007-01-27 Raja R Harinath <rharinath@novell.com>
6239 * expression.cs (Error_InvalidArguments): Don't use two different
6240 messages for CS1503. Use ExtraInformation and
6241 SymbolRelatedToPreviousError instead.
6244 * decl.cs (DeclSpace.initialize_type_params): Don't access
6245 'type_params' of a partial class directly.
6247 2007-01-26 Miguel de Icaza <miguel@novell.com>
6249 * constant.cs: Removed a handful of out-of-range checks that were
6252 2007-01-25 Marek Safar <marek.safar@gmail.com>
6254 * expression.cs (CheckUselessComparison): Add additional check for char
6257 * namespace.cs: Fixed typo.
6259 2007-01-23 Miguel de Icaza <miguel@novell.com>
6261 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
6262 gone, instead we inline the test, preventing the needless casts to
6263 longs, ulongs and doubles for the parameters, avoiding calls to
6264 methods that overchecked stuff, and instead inlined things
6267 2007-01-20 Marek Safar <marek.safar@gmail.com>
6269 * cs-parser.jay: Better parameter error handling.
6271 2007-01-17 Marek Safar <marek.safar@gmail.com>
6273 A fix for bug #80368, #80522
6274 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
6275 whether array initializer contains constants only.
6276 (ArrayCreation.Emit): Use better formula to decide when
6277 are array initializers for static initialization.
6278 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
6279 have to emit even constants otherwise they are pre-initialized.
6281 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
6282 Raja R Harinath <rharinath@novell.com>
6284 Fix emit order of 'get' vs. 'set'.
6285 * support.cs (Accessors): New.
6286 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
6287 Note the order in which accessors are declared in the source.
6288 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
6289 Refactored from Property.Define and Indexer.Define.
6290 (PropertyBase.DefineAccessors): New helper that calls the above in
6291 appropriate order as noted by the parser.
6292 (Property.Define, Indexer.Define): Update to changes.
6293 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
6295 2007-01-17 Raja R Harinath <rharinath@novell.com>
6297 Fix cs0029-6.cs and gcs0029-2.cs (regression)
6298 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
6299 there's an implicit conversion from the current type to the target
6300 type before converting the underlying constant.
6302 2007-01-16 Marek Safar <marek.safar@gmail.com>
6304 * const.cs (ResolveValue): Updated after constant conversion was made more
6307 * constant.cs (GetAttributableValue): constant to object conversion is
6308 used for attributes only.
6309 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
6310 constant conversions.
6311 (LongConstant.ConvertImplicitly): Ditto.
6313 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
6314 (ImplicitConversionStandard): Handle constant conversion as extra step.
6315 It solves the issue when constant conversion was called indirectly like
6316 inside array initializer and constant folding was skipped.
6318 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
6321 * statement.cs(ImplicitConversionStandard): Updated after constant
6322 conversion was made more generic.
6324 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
6326 * expression.cs (As.DoResolve): Use GenericConstraints instead of
6327 Constraints, solves the problem where the compiler incorrectly
6328 reported that a type parameter was not constrained to a class (Bug
6331 2007-01-14 Marek Habersack <grendello@gmail.com>
6333 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
6335 2007-01-14 Marek Safar <marek.safar@gmail.com>
6337 A fix for bug #80368
6338 * assign.cs (FieldInitializer): New class implements field
6339 initializer statement.
6341 * attribute.cs: Update after FieldMember rename.
6343 * class.cs (PropertyBasedMember): New common class for property based
6345 (InterfaceMemberBase): New base class for all members which can be used as
6346 an interface members.
6347 (MethodCore): Moved really common code to InterfaceMemberBase.
6348 (Method.Define): Equal and GetHasCode detection is relevant for methods
6350 (MethodData.Define): Don't assume that public event implements an
6351 interface automatically.
6352 (MethodData.DefineMethodBuilder): Issue an error even if only extern
6354 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
6355 (FieldMember): Merged with FieldBase.
6356 (EventProperty.AEventPropertyAccessor): New specialization to check whether
6357 event extern modifier can be used.
6358 (EventField.EventFieldAccessor): Moved event field specific code here.
6359 (Event.AllowedModifiers): Even event can be extern.
6360 (Event.FindOutBaseMethod): New override specific to events.
6361 (Indexer.parameters): Reintroduce parameters because base class holds
6362 only properties common data.
6363 (Indexer.CheckForDuplications): Indexers are threated as methods so we
6364 need do extra parameters check.
6366 * const.cs: Update after FieldMember rename.
6368 * decl.cs (MemberCache.FindBaseEvent): New method.
6370 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
6371 to reflect that indexer is now derived from PropertyBased.
6373 * ecore.cs (GetMemberType): Made public.
6374 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
6377 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
6379 * typemanager.cs (CSharpSignature): Correctly print event accessors.
6380 (RegisterEvent): Removed.
6381 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
6382 (GetPrivateFieldOfEvent): Renamed to GetEventField.
6384 2007-01-11 Raja R Harinath <rharinath@novell.com>
6387 * statement.cs (CollectionForeach.TryType): Prefer generic
6388 GetEnumerator over non-generic variant. Fix code to follow comments.
6390 2007-01-09 Raja R Harinath <rharinath@novell.com>
6393 * support.cs (ReflectionParameter): Don't use an invalid index on
6394 the generic parameter data.
6396 2007-01-08 Miguel de Icaza <miguel@novell.com>
6398 * driver.cs: Just add a tiny bit of infrastructure.
6400 2007-01-02 Marek Safar <marek.safar@gmail.com>
6402 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
6403 where field type is struct from current assembly.
6405 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
6408 2007-01-02 Marek Safar <marek.safar@gmail.com>
6410 A fix for bug #80381
6411 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
6414 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
6416 (Namespace.LookupType): Always use core types from corlib when speficied.
6418 * report.cs: A new warning.
6420 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
6421 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
6422 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
6424 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
6425 (InitCoreTypes): Set expression type of object_type and value_type
6426 immediately after lookup.
6428 2007-01-01 Miguel de Icaza <miguel@novell.com>
6430 * cs-tokenizer.cs: Accept Pc class characters (Connector
6431 Punctuation) as valid identifiers. Fixes #78259
6433 * expression.cs (Invocation.DoResolve): Moved the check for the
6434 use of `this' for doing method calls to the Invocation resolution
6435 step, after overload resolution has taken place instead of doing
6436 the check at the low-level `This.DoResolve' level.
6438 The `This.DoResolve'(appens before overload resolution, so it has
6439 no way of knowing if the method that will be called will be
6440 instace or static, triggering an erroneous report for cs0188 (Bug
6443 We now do the check for instance method invocations after we know
6444 what method will be called.
6446 (This.CheckThisUsage): Move the actual use of this structure
6447 checking into its own method and expose it.
6449 * Everywhere that called Error_ValueCannotBeConverted: pass a new
6452 Exceptions: Null.ConvertImplicitly,
6453 Constant.ImplicitConversionRequired as there are too many call
6454 sites for passing the ec.
6456 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
6457 EmitContext, if the value is null, then we do not try to provide
6458 the extra information from the error (If a userdefined conversion
6459 exists, as UserDefinedConversion requires a non null-EmitContext).
6463 2006-12-30 Raja R Harinath <rharinath@novell.com>
6465 * flowanalysis.cs (MyBitVector): Document some invariants.
6466 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
6467 introduced below, and add a couple of others,
6469 2006-12-30 Marek Safar <marek.safar@gmail.com>
6471 * attribute.cs (GetMethodObsoleteAttribute): Uses new
6472 GetPropertyFromAccessor and GetEventFromAccessor.
6474 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
6475 overrides non-obsolete one.
6476 (Indexer.Define): Error message has been moved to the parser.
6478 * cs-parser.jay: Better syntax errors handling.
6480 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
6481 when an invocation has no arguments.
6483 * ecore.cs: Removed not used caching.
6485 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
6488 * report.cs: Add a new warning.
6490 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
6492 * typemanager.cs (enumeration_type): Removed.
6493 (CSharpSignature): Reuses IsSpecialMethod.
6494 (IsEqual): Hack for MS BCL.
6495 (GetPropertyFromAccessor): New method.
6496 (GetEventFromAccessor): New method.
6497 (IsSpecialMethod): Fixed to handle more cases.
6499 2006-12-30 Marek Safar <marek.safar@gmail.com>
6501 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
6502 Made white spaces array static.
6504 * ecore.cs (RemoveGenericArity): Optimized.
6506 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
6508 (MyBitVector.initialize_vector): Simplified.
6510 2006-12-22 Miguel de Icaza <miguel@novell.com>
6512 * ecore.cs: Am not entirely happy with this hack, but it seems to
6513 address the issue in 80257 (a small test case for
6516 I set the MethodGroupExpr.Type to an internal compiler type
6517 (itself in this case) to force the resolution to take place. Why
6518 it does not take place with a null is beyond me.
6520 2006-12-20 Marek Safar <marek.safar@gmail.com>
6522 A fix for bug #80288
6523 * expression.cs (ResolveOperator): Consider user defined conversion for
6524 logical and operator too.
6525 (EmitBranchable): Optimization for logical and when full constant folding
6526 could not be applied but one operand is constant.
6528 2006-12-19 Marek Safar <marek.safar@gmail.com>
6530 * class.cs (GetClassBases): Write 5 times every day, will never use
6531 FullName for error reporting.
6533 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
6535 2006-12-19 Martin Baulig <martin@ximian.com>
6537 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
6538 the symbol file info here.
6540 2006-12-18 Marek Safar <marek.safar@gmail.com>
6542 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
6543 of `elseif' is taking then following sections are not taking.
6544 Fixes an issue reported on mono mailing list.
6546 2006-12-18 Marek Safar <marek.safar@gmail.com>
6548 A fix for bug #80300
6549 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
6550 a caller is not taking.
6552 2006-12-18 Raja R Harinath <rharinath@novell.com>
6554 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
6555 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
6556 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
6557 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
6558 * class.cs: Update to changes.
6560 2006-12-17 Marek Safar <marek.safar@gmail.com>
6562 A fix for bug #79934
6563 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
6566 * class.cs (ResolveMembers): Register an iterator in current container and
6569 2006-12-16 Raja R Harinath <rharinath@novell.com>
6572 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
6573 satisfy a params annotated parameter.
6575 2006-12-16 Marek Safar <marek.safar@gmail.com>
6577 A fix for bug #77014
6578 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
6579 paramters correctly and not rely on hacks in Parameters class.
6580 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
6582 (Invocation.VerifyArgumentsCompat): Ditto.
6583 (Invocation.EmitArguments): Changed to correctly emit params arguments at
6586 * parameter.cs (HasParams): Don't assume that params is the last one.
6588 * support.cs (ReflectionParameters.ctor): Look for params attribute
6590 (ReflectionParameters.ParameterType): Removed hack when we returned last
6591 parameter for out of range parameters.
6592 (ParameterName, ParameterModifier): Ditto.
6594 2006-12-14 Marek Safar <marek.safar@gmail.com>
6596 A fix for bug #79987
6597 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
6598 when assembly is not CLS compliant but type is. I have no idea why is this
6601 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
6603 2006-12-13 Miguel de Icaza <miguel@novell.com>
6605 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
6606 in struct constructors, they are basically no-ops.
6608 2006-12-12 Marek Safar <marek.safar@gmail.com>
6610 * cs-tokenizer.cs (Position): Save preprocessor status too.
6612 2006-12-12 Marek Safar <marek.safar@gmail.com>
6614 A fix for bug #77794
6615 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
6617 2006-12-12 Marek Safar <marek.safar@gmail.com>
6619 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
6621 (pp_expr): Report error for an invalid expression.
6622 (handle_preprocessing_directive): Simplified; add more error checking.
6624 2006-12-11 Marek Safar <marek.safar@gmail.com>
6626 A fix for bug #74939
6627 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
6628 directives handling.
6630 2006-12-10 Marek Safar <marek.safar@gmail.com>
6632 A fix for bugs #80093, and #75984
6633 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
6634 logic, it seems to me as it worked before "by coincidence".
6635 (xtoken): Simplified to use reworked handle_preprocessing_directive.
6636 (cleanup): Enabled endif check.
6638 2006-12-09 Marek Safar <marek.safar@gmail.com>
6640 A fix for bug #80162
6641 * statement.cs (CollectionForeach.TryType): Generics and non-generics
6642 enumerators are never ambiguous.
6644 2006-12-08 Raja R Harinath <rharinath@novell.com>
6647 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
6649 2006-12-06 Marek Safar <marek.safar@gmail.com>
6651 A fix for bug #80144
6652 * class.cs (EventProperty.Define): Explicit implementation means
6653 that an even is used.
6655 2006-12-06 Marek Safar <marek.safar@gmail.com>
6657 Fixes the operators implementation (part II)
6659 * cfold.cs (DoConstantNumericPromotions): Renamed to
6660 DoBinaryNumericPromotions and simplified.
6661 (BinaryFold): Couple of conversion fixes; simplified.
6663 * constant.cs, ecore.cs, literal.cs
6664 (ToType): Renamed to ConvertImplicitly.
6665 (Reduce): Renamed to ConvertExplicitly.
6667 * class.cs, convert.cs: Updated.
6669 * expression.cs: TryReduce doesn't throw an exception.
6671 2006-12-01 Marek Safar <marek.safar@gmail.com>
6673 A fix for bug #80108
6674 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
6677 2006-11-30 Marek Safar <marek.safar@gmail.com>
6679 Fixes unary operators implementation (part I)
6682 * cfold.cs (Error_CompileTimeOverflow): Made internal
6684 * const.cs (IConstant): Changed to use reference to constant and
6685 not constant itself.
6686 Updated IConstant implementations.
6688 * constant.cs (CreateConstant): New factory method.
6689 Updated IConstant implementation.
6691 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
6693 * ecore.cs: Updated to use CreateConstantReference.
6695 * enum.cs: Reflects IConstant changes.
6697 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
6699 * literal.cs (NullConstant): Change to be independently usable.
6701 2006-11-29 Martin Baulig <martin@ximian.com>
6703 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
6704 we need to emit the scope initializer before calling the base .ctor.
6706 * anonymous.cs: Merged back from the new anonymous methods branch.
6707 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
6709 * expression.cs (ParameterReference.DoResolveBase): Create a
6710 "normal" ScopeInfo when capturing parameters rather than using the
6711 root scope; this makes things work with anonymous methods having
6715 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
6717 2006-11-22 Marek Safar <marek.safar@gmail.com>
6719 A fix for bug #79987
6720 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
6721 check to a base class.
6722 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
6723 only when assembly has missing attribute.
6724 * report.cs: Update.
6726 2006-11-21 Marek Safar <marek.safar@gmail.com>
6728 * cs-tokenizer.cs: Merged with gmcs version.
6730 2006-11-20 Marek Safar <marek.safar@gmail.com>
6733 * cs-parser.jay: Better error message when partial keyword is misplaced.
6735 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
6737 A fix for bug #79810
6738 report.cs: CS1058 only applies to 2.0 profile (gmcs).
6739 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
6740 a RuntimeWrappedException by default.
6742 2006-11-18 Marek Safar <marek.safar@gmail.com>
6744 A fix for bug #79843
6745 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
6747 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
6749 2006-11-18 Marek Safar <marek.safar@gmail.com>
6751 * driver.cs, namespace.cs: Uses faster IndexOf version.
6753 2006-11-17 Marek Safar <marek.safar@gmail.com>
6755 A fix for bug #79941
6756 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
6758 (Operator.Define): Implicit/Explicit operator of same type is duplicate
6759 even if internal name is different.
6760 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
6761 (UserDefinedConversion): Simplified as the operators cannot be internal.
6762 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
6764 (MethodLookup): Replaced EmitContext with parentType.
6765 * expression.cs: Updated.
6767 2006-11-09 Raja R Harinath <rharinath@novell.com>
6769 * driver.cs (BadAssembly): Handle all the ugliness of
6770 DefineDynamicAssembly.
6772 2006-11-08 Raja R Harinath <rharinath@novell.com>
6774 Address parts of #58244 -- most of what's left is in the runtime
6775 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
6776 CS1509 error checks, and handle them for all assembly loads, not
6777 just the first invocation.
6778 (LoadModule): Likewise. Move handling of 'adder_method' ...
6779 * codegen.cs (AssemblyClass.AddModule): ... here.
6781 2006-11-02 Marek Safar <marek.safar@gmail.com>
6783 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
6784 IEnumerable<T> is ambiguous.
6786 2006-10-31 Marek Safar <marek.safar@gmail.com>
6788 A fix for bug #67689
6789 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
6790 GetEnumerator is ambiguous.
6792 * report.cs: Add new warning.
6794 2006-10-29 Marek Safar <marek.safar@gmail.com>
6796 A fix for bug #78602
6797 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
6798 to protected member can be nested type.
6800 2006-10-28 Marek Safar <marek.safar@gmail.com>
6802 A fix for bug #78965
6803 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
6804 to protected member must derive from current type.
6806 2006-10-27 Marek Safar <marek.safar@gmail.com>
6808 assign.cs: Reuses error method.
6810 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
6811 instead of type for constants.
6812 (Expression.Error_ValueAssignment): Common error method.
6814 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
6817 2006-10-27 Marek Safar <marek.safar@gmail.com>
6819 A fix for bug #79081
6820 * expression.cs (MemberAccess.DoResolve): Check nested type
6823 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
6825 * doc.cs : nested delegates were not handled. Fixed bug #79754.
6827 2006-10-26 Marek Safar <marek.safar@gmail.com>
6829 A fix for bug #76591
6830 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
6832 2006-10-26 Marek Safar <marek.safar@gmail.com>
6834 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
6835 type forwarder of the same type multiple times.
6837 2006-10-26 Raja R Harinath <rharinath@novell.com>
6840 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
6841 instance as an rvalue, even when we later resolve as an lvalue.
6843 2006-10-25 Martin Baulig <martin@ximian.com>
6845 * anonymous.cs: Fix #79673.
6847 2006-10-24 Marek Safar <marek.safar@seznam.cz>
6849 A fix for bug #79666
6850 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
6851 ignored when is optimized (= default value) as its value is already set.
6853 2006-10-23 Marek Safar <marek.safar@seznam.cz>
6855 A fix for bug #79724
6856 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
6857 TypeContainer for type lookup.
6859 2006-10-23 Marek Safar <marek.safar@seznam.cz>
6861 A fix for bug #79231
6862 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
6863 * expression.cs (OverloadResolve): Always convert type name for
6865 (ResolveNamespaceOrType): Don't confuse a nested type with any
6868 2006-10-18 Martin Baulig <martin@ximian.com>
6870 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
6872 2006-10-17 Miguel de Icaza <miguel@novell.com>
6874 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
6875 an int32, but requesting an int64 from the conversion
6877 2006-10-12 Martin Baulig <martin@ximian.com>
6880 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
6882 2006-10-12 Martin Baulig <martin@ximian.com>
6885 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
6887 2006-10-11 Miguel de Icaza <miguel@novell.com>
6889 * convert.cs: Remove broken code: I was doing the "Existance"
6890 tests for Implicit conversions.
6892 2006-10-10 Miguel de Icaza <miguel@novell.com>
6894 * convert.cs: Added one missing case in
6895 ImplicitStandardConversionExists uint64 to intptr.
6899 * typemanager.cs (uintptr_type): another core known type.
6901 * ecore.cs (OperatorCast): routine used to do cast operations that
6902 depend on op_Explicit. We could change some of the Decimal
6903 conversions to use this.
6905 This one has a probe mechanism that checks both types for an op_
6906 which it coudl be used to eliminate two classes: CastToDecimal
6907 and CastFromDecimal.
6909 * convert.cs: Implement the conversions documented in #59800
6911 2006-10-10 Martin Baulig <martin@ximian.com>
6913 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
6914 before RootScope.ResolveMembers().
6916 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
6917 `CurrentType' if appropriate.
6919 2006-10-09 Marek Safar <marek.safar@seznam.cz>
6921 A fix for bug #78568
6922 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
6923 when contains binary operators.
6924 * cs-parser.jay: Updated.
6926 2006-10-09 Martin Baulig <martin@ximian.com>
6929 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
6930 moved that into Define() and also do the other type parameter
6931 checks there. Fixes #79094. Added gtest-292.cs.
6934 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
6935 since that doesn't include type parameters; don't use `Ldelema'
6936 for type parameters. Fixes #78980. Added gtest-293.cs.
6938 2006-10-08 Marek Safar <marek.safar@seznam.cz>
6941 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
6942 conversion is allowed.
6944 2006-10-06 Marek Safar <marek.safar@seznam.cz>
6946 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
6947 error reporting when no error occurs.
6949 2006-10-06 Marek Safar <marek.safar@seznam.cz>
6951 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
6954 2006-10-06 Raja R Harinath <rharinath@novell.com>
6957 * class.cs (DefineTypeBuilder): Check circular dependencies before
6958 setting the parent of the TypeBuilder.
6959 (CheckRecursiveDefinition): Don't use 'BaseType', since
6960 it may not be valid until after DefineTypeBuilder. Use
6961 'base_type' instead.
6963 2006-10-04 Martin Baulig <martin@ximian.com>
6965 Merged the Anonymous Methods patch.
6967 * anonymous.cs, iterators.cs: The new anonymous methods code.
6969 * statement.cs (Variable): New public abstract class.
6970 (LocalInfo.Variable): New public property.
6971 (LocalInfo.ResolveVariable): New public method.
6972 (Block.Flags): Add `IsIterator'.
6973 (Block.AddVariable): Improved the CS0136 check.
6974 (Block.AnonymousChildren): New public property.
6975 (Block.AddAnonymousChild): New public method.
6976 (ToplevelBlock): Update to use the new anonymous method framework.
6977 (ToplevelBlock.ctor): `container' is now a `Block' and not a
6978 `ToplevelBlock'; this is required to correctly implement the
6980 (Fixed, Using): Use `TemporaryVariable' instead of directly
6981 creating the `LocalBuilder'.
6983 * parameter.cs (Parameter.ResolveVariable): New public method.
6984 (Parameters.ResolveVariable): Likewise.
6986 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
6988 * class.cs (TypeContainer): Replaced the `iterators' list and
6989 corresponding methods with a list of `CompilerGeneratedClass'es.
6990 (TypeContainer.ResolveMembers): New public method.
6991 (Method): `IIteratorContainer' has been replaced by
6994 * expression.cs (VariableReference): New public abstract base
6995 class for `LocalVariableReference', `ParameterReference' and
6998 * codegen.cs (EmitContext): Removed `capture_context',
6999 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
7000 (EmitContext.EmitThis): Removed.
7002 * cs-parser.jay: Replace `iterator_container' with
7005 2006-10-04 Martin Baulig <martin@ximian.com>
7007 * generic.cs (GenericMethod): Don't make this abstract.
7008 (Constraints.Clone): Added dummy implementation.
7010 2006-10-04 Raja R Harinath <harinath@gmail.com>
7013 * namespace.cs (LookForAnyGenericType): Avoid nullref on
7014 'declspaces'. Avoid allocating arrays willy-nilly.
7017 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
7018 cases out of the switch.
7020 2006-09-28 Marek Safar <marek.safar@seznam.cz>
7022 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
7023 message when non-generic type is used with the type arguments.
7024 * expression.cs: Updated.
7026 2006-09-28 Raja R Harinath <rharinath@novell.com>
7029 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
7030 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7031 Change semantics slightly. Don't insist on having only one
7032 temporary EmptyExpression -- just throttle the creation of new ones.
7035 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
7036 non-interfaces too. If no methods are found, don't try to create
7039 2006-09-28 Marek Safar <marek.safar@seznam.cz>
7041 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
7044 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
7045 us produce better error message.
7047 2006-09-27 Marek Safar <marek.safar@seznam.cz>
7049 * expression.cs (Binary.ResolveOperator): Warn about a side effect
7050 of the `|' operator.
7052 * report.cs: A new warning added.
7054 2006-09-27 Martin Baulig <martin@ximian.com>
7056 * generic.cs (GenericMethod): Don't make this abstract.
7058 2006-09-27 Martin Baulig <martin@ximian.com>
7061 (InternalErrorException): Added overloaded ctor taking a params array.
7063 2006-09-26 Marek Safar <marek.safar@seznam.cz>
7065 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
7066 Fixed the cases when same error was reported twice.
7068 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
7069 now report symbol information.
7071 2006-09-25 Martin Baulig <martin@ximian.com>
7073 * class.cs: Completely unified with the gmcs version.
7075 2006-09-25 Martin Baulig <martin@ximian.com>
7077 * typemanager.cs (TypeManager.IsNullableType): New public function.
7078 (TypeManager.IsNullableTypeOf): Likewise.
7079 (TypeManager.IsNullableValueType): Likewise.
7081 * class.cs (MethodCore): Added the `GenericMethod' argument from
7082 gmcs and also unified all classes derived from `MethodCore' with gmcs.
7084 2006-09-24 Raja R Harinath <harinath@gmail.com>
7086 * convert.cs: Unify with gmcs version.
7088 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7090 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
7091 verify them as well.
7093 * report.cs: New warning.
7095 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7097 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
7098 for anonymous block with out argument.
7100 2006-09-24 Marek Safar <marek.safar@seznam.cz>
7102 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
7103 not used private events only.
7105 2006-09-23 Marek Safar <marek.safar@seznam.cz>
7107 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
7109 * const.cs (Const.Define): Check for constant type.
7110 (Const.IsConstantTypeValid): Looks for valid constant types.
7112 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
7114 * ecore.cs (EmptyConstantCast): New common class for all constant based
7117 * expression.cs (Is.DoResolve): Handle null constant especially.
7118 (New.DoResolve): Check for new void().
7119 (MemberAccess.DoResolve): Cope with all kind of nulls.
7121 * literal.cs (NullConstant): Uses EmptyConstantCast.
7122 (NullDefault): Based on EmptyConstantCast.
7123 (NullLiteral): Uses EmptyConstantCast.
7125 * statement.cs (Block.ResolveMeta): Check for constant type.
7127 2006-09-22 Martin Baulig <martin@ximian.com>
7129 * delegate.cs, attribute.cs: Merged with the gmcs versions.
7131 2006-09-22 Raja R Harinath <rharinath@novell.com>
7133 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
7137 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
7138 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
7141 2006-09-22 Martin Baulig <martin@ximian.com>
7143 * ecore.cs: Merged with the gmcs version.
7145 * generic.cs (ConstructedType): New dummy class.
7146 (TypeArguments): Don't make this abstract.
7149 (TypeManager.IsGenericTypeDefinition): New method.
7150 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
7152 2006-09-22 Raja R Harinath <rharinath@novell.com>
7154 * expression.cs (ComposedCast): Check for arrays of TypedReference
7155 before creating the type, not after.
7157 2006-09-21 Marek Safar <marek.safar@seznam.cz>
7159 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
7160 after ToType change.
7162 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
7163 when constant must be implicitly convertible.
7165 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
7167 * ecore.cs (NullCast): Derives from NullConstant.
7169 * expression.cs (Is.DoResolve): Removed useless variables.
7170 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
7171 (New.Constantify): Add enum support.
7172 (MemberAccess.DoResolve): Add warning when accessing null constant or
7175 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
7178 * literal.cs (NullConstant): New abstract class with common
7179 functionality for all null specializations.
7180 (NullDefault): Represents default(X) when result can be
7182 (NullLiteral): Updated.
7184 * report.cs: Add new warning.
7186 2006-09-21 Martin Baulig <martin@ximian.com>
7188 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
7190 2006-09-21 Martin Baulig <martin@ximian.com>
7192 * generic.cs (GenericConstraints): New dummy class.
7193 (Constraints): Likewise.
7194 (TypeParameter): Likewise.
7195 (TypeParameterName): Likewise.
7196 (GenericMethod): Likewise.
7198 * typemanager.cs (TypeManager.GetGenericArguments): New method.
7200 * decl.cs: Merged with the gmcs version.
7202 2006-09-21 Raja R Harinath <rharinath@novell.com>
7204 * generic.cs (TypeParameter): Implement IMemberContainer.
7205 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
7207 * rootcontext.cs: Unify with gmcs version.
7209 * report.cs: Unify with gmcs version.
7210 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
7211 from gmcs/generics.cs.
7212 * generics.cs (TypeParameter): New dummy class.
7214 * support.cs: Unify with gmcs version.
7216 2006-09-20 Raja R Harinath <rharinath@novell.com>
7218 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
7219 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
7221 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
7222 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
7223 * mcs.exe.sources: Add generic.cs.
7225 * codegen.cs: Unify with gmcs version.
7227 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
7228 (EmitContext): Add GenericDeclContainer implementation.
7229 * decl.cs (MemberCore, DeclSpace): Likewise.
7230 * namespace.cs: Remove #ifdef GMCS_SOURCE.
7232 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
7233 MCS TypeManager has a corresponding dummy method.
7235 2006-09-19 Martin Baulig <martin@ximian.com>
7237 * expression.cs: Completely merged with the gmcs version.
7239 2006-09-19 Martin Baulig <martin@ximian.com>
7241 * expression.cs (Invocation): Merged with the gmcs version.
7242 (ArrayAccess.GetStoreOpcode): Likewise.
7244 2006-09-19 Martin Baulig <martin@ximian.com>
7247 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
7248 (TypeManager.IsGenericMethodDefinition): Likewise.
7250 2006-09-19 Martin Baulig <martin@ximian.com>
7253 (TypeManager.IsEqual): Moved the gmcs implementation here.
7254 (TypeManager.DropGenericTypeArguments): Likewise.
7255 (TypeManager.DropGenericMethodArguments): Likewise.
7256 (TypeManager.GetTypeArguments): Moved here from gmcs.
7257 (TypeManager.HasGenericArguments): Likewise.
7259 2006-09-19 Martin Baulig <martin@ximian.com>
7261 * expression.cs (Binary): Merged with the gmcs version.
7263 2006-09-19 Martin Baulig <martin@ximian.com>
7265 * expression.cs (Probe, As, Is): Merged with the gmcs version.
7267 2006-09-19 Martin Baulig <martin@ximian.com>
7269 * typemanager.cs: Merged with the gmcs version.
7271 2006-09-16 Raja R Harinath <rharinath@novell.com>
7273 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
7274 * driver.cs: Likewise.
7276 2006-09-16 Marek Safar <marek.safar@seznam.cz>
7279 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
7280 only if parent type is class.
7281 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
7284 2006-09-15 Marek Safar <marek.safar@seznam.cz>
7287 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
7289 * typemanager.cs(CSharpName): Converts NullType to null.
7291 2006-09-15 Martin Baulig <martin@ximian.com>
7294 (TypeManager.GetMethodName): Added mcs implementation.
7295 (TypeManager.IsEqual): Likewise.
7298 (SimpleName.RemoveGenericArity): Added dummy implementation.
7300 * pending.cs: Merged with the gmcs version.
7302 2006-09-15 Martin Baulig <martin@ximian.com>
7304 * statement.cs: Merge with the gmcs version.
7306 2006-09-15 Martin Baulig <martin@ximian.com>
7308 * statement.cs (Switch): Merge with the gmcs implementation
7309 (without nullables), which is newer.
7311 2006-09-15 Martin Baulig <martin@ximian.com>
7313 * statement.cs (Block.Variables): Make this public.
7314 (ToplevelBlock.Parameters): Make this a property.
7315 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
7317 2006-09-15 Martin Baulig <martin@ximian.com>
7319 * namespace.cs: Merge with the gmcs version.
7321 2006-09-15 Martin Baulig <martin@ximian.com>
7323 * decl.cs (MemberName): Minor code cleanups.
7325 2006-09-15 Martin Baulig <martin@ximian.com>
7327 * parameter.cs: Merge with the gmcs version.
7329 2006-09-15 Martin Baulig <martin@ximian.com>
7331 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
7332 and an error in mcs.
7334 2006-09-15 Martin Baulig <martin@ximian.com>
7336 * flowanalysis.cs: Merged from GMCS; added the generics code into
7337 a `GMCS_SOURCE' conditional so we can share this file.
7339 2006-09-08 Martin Baulig <martin@ximian.com>
7341 * typemanager.cs (TypeManager.interlocked_type): New public field.
7342 (TypeManager.int_interlocked_compare-exchange): New public field.
7343 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
7344 enumerator types here and call InitGenericCoreTypes().
7345 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
7346 after calling InitEnumUnderlyingTypes().
7349 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
7350 `classes_second_stage'.
7352 2006-09-14 Marek Safar <marek.safar@seznam.cz>
7354 * assign.cs, ecore.cs, expression.cs: Share error message text.
7355 * class.cs (FieldMember.Define): Check for varible of static type.
7356 * driver.cs (LoadAssembly): Uses error output for errors.
7357 * statement.cs: Updated.
7359 2006-09-08 Marek Safar <marek.safar@seznam.cz>
7361 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
7364 2006-09-07 Martin Baulig <martin@ximian.com>
7367 (MainDriver): Revert r62663 from Marek; see #70506 for details.
7369 2006-08-29 Miguel de Icaza <miguel@novell.com>
7371 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
7373 2006-08-17 Miguel de Icaza <miguel@novell.com>
7375 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
7376 #52019 and #79064, the use of the \uXXXX sequence in source code
7377 to represent unicode characters.
7379 2006-08-15 Marek Safar <marek.safar@seznam.cz>
7381 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
7383 * class.cs, ecore.cs, statement.cs: Merged to one error message.
7385 2006-08-13 Miguel de Icaza <miguel@novell.com>
7387 * assign.cs: Catch attempts to assign to a method groups in += and
7390 2006-08-13 Marek Safar <marek.safar@seznam.cz>
7393 * cs-parser.jay: Don't destroy current array type by typeof of array's.
7395 2006-08-12 Marek Safar <marek.safar@seznam.cz>
7397 * class.cs (Method.Define): Issue a warning when generic method looks like
7399 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
7402 2006-08-09 Marek Safar <marek.safar@seznam.cz>
7404 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
7406 * decl.cs (MemberCache.FindMembers): When container is interface we need to
7407 search all base interfaces as a member can be ambiguous.
7408 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
7409 Constructor member type filter.
7410 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
7411 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
7412 reporting for returned memberinfos.
7413 * report.cs: Updated.
7414 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
7415 version to work on all runtimes.
7416 (TypeManager.RealMemberLookup): Removed members filtering.
7418 2006-08-08 Raja R Harinath <rharinath@novell.com>
7420 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
7421 (PropertyExpr.EmitAssign): Likewise.
7422 * expression.cs (Indirection.EmitAssign): Likewise.
7423 (LocalVariableReference.EmitAssign): Likewise.
7424 (ParameterReference.EmitAssign): Likewise.
7425 (Invocation.EmitArguments): Likewise.
7426 (ArrayAccess.EmitAssign): Likewise.
7427 (IndexerAccess.EmitAssign): Likewise.
7428 (This.EmitAssign): Likewise.
7429 (ConditionalLogicalOperator.Emit): Likewise.
7432 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
7433 instead of ArrayList. If the hashtable has a LocalBuilder, don't
7434 leave it in after returning it.
7435 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
7437 2006-08-06 Marek Safar <marek.safar@seznam.cz>
7439 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
7442 2006-08-03 Raja R Harinath <rharinath@novell.com>
7444 Fix cs0146-3.cs and cs0146-4.cs.
7445 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
7446 enclosing types don't depend on the current type.
7448 2006-08-02 Raja R Harinath <rharinath@novell.com>
7451 * class.cs (TypeContainer.DoDefineMembers): Use
7452 FindBaseMemberWithSameName on Parent, since we're interested in
7453 whether we hide inherited members or not.
7454 (FindBaseMemberWithSameName): Make slightly more robust.
7456 Fix the non-generic testcase from #77396
7457 * decl.cs (DeclSpace.DeclContainer): Remove override.
7459 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
7460 declspaces for doppelgangers too.
7461 (UsingEntry): Implement IResolveContext.
7462 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
7463 'this' as the resolve context.
7464 (LocalAliasEntry): Likewise.
7466 Implement parts of #77403
7467 * roottypes.cs (RootDeclSpace): New. Used to represent the
7468 toplevel declaration space. Each namespace declaration introduces
7469 a "partial" root declaretion space.
7470 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
7471 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
7472 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
7473 from 'current_namespace.SlaveDeclSpace'.
7474 (namespace_declaration): Likewise.
7475 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
7476 check. It can't happen now.
7477 * decl.cs (DeclSpace.LookupType): Likewise.
7478 * driver.cs (MainDriver): Sanity check.
7480 2006-08-01 Raja R Harinath <rharinath@novell.com>
7482 * decl.cs (DeclSpace.FindNestedType): Remove.
7483 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
7484 LookupTypeContainer to get the container of the nested type.
7485 * class.cs (TypeContainer.FindNestedType): Make non-override.
7487 2006-07-31 Raja R Harinath <rharinath@novell.com>
7489 * decl.cs (DeclSpace.PartialContainer): Move field from ...
7490 * class.cs (TypeContainer.PartialContainer): ... here.
7491 (TypeContainer.AddBasesForPart): New helper.
7492 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
7494 * cs-parser.jay (current_class): Convert to DeclSpace.
7495 (struct_declaration, interface_declaration, class_declaration):
7496 Use AddBasesForPart instead of .Bases directly.
7497 * const.cs, iterators.cs: Update to changes.
7499 2006-07-28 Raja R Harinath <rharinath@novell.com>
7501 * class.cs (TypeContainer.AddMemberType): Rename from
7503 (TypeContainer.AddMember): Rename from AddToMemberContainer.
7504 (AddTypeContainer): New. Combine AddClassOrStruct and
7506 (AddPartial): Update. Add 'is_partial' argument.
7507 * roottypes.cs: Update to changes.
7508 * cs-parser.jay (push_current_class): New helper for handling
7509 current_container and current_class.
7510 (struct_declaration, interface_declaration, class_declaration):
7513 2006-07-26 Raja R Harinath <rharinath@novell.com>
7515 * roottypes.cs: Rename from tree.cs.
7517 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
7518 * tree.cs (Tree, ITreeDump): Remove types.
7519 * rootcontext.cs (tree, Tree): Remove fields.
7520 (root, ToplevelTypes): New.
7521 * *.cs: Update to rename.
7523 * tree.cs (Tree.RecordDecl): Remove.
7524 (RootTypes.AddToTypeContainer): Record the toplevel type in its
7526 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
7528 2006-07-23 Raja R Harinath <harinath@gmail.com>
7530 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
7531 DoFlowAnalysis and OmitStructFlowAnalysis here.
7532 (ec.With): Rename from WithUnsafe and generalize.
7533 (ec.WithCheckState): Remove. All users can be handled by 'With'.
7534 (ec.WithFlowAnalyis): New.
7535 * ecore.cs, expression.cs, statement.cs: Update.
7537 2006-07-22 Raja R Harinath <harinath@gmail.com>
7539 * statement.cs (Block.ResolveMeta): Simplify slightly.
7541 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
7542 multiple boolean fields. Convert InUnsafe, constant_check_state,
7543 check_state to flags.
7544 (CheckState, ConstantCheckState): Update.
7545 (InUnsafe): New read-only property.
7546 (FlagsHandle): Rename from CheckStateHandle and convert to handle
7548 (WithUnsafe): New helper similar to WithCheckState.
7549 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
7550 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
7552 2006-07-21 Raja R Harinath <rharinath@novell.com>
7554 Make comparisons use the same IL irrespective of whether they're
7555 in a 'checked' or 'unchecked' context: one of the issues in #78899
7556 * codegen.cs (EmitContext.CheckState): Make read-only property.
7557 (EmitContext.ConstantCheckState): Likewise.
7558 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
7559 helper that implement a save/restore stack for CheckState
7560 values. This is the only way to change check-state.
7561 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
7562 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
7563 (CheckedExpr.EmitBranchable): New forwarding method.
7564 (UnCheckedExpr): Likewise.
7565 * statement.cs (Block.ResolveMeta): Use WithCheckState.
7566 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
7567 (Checked.Resolve, checked.DoEmit): Likewise.
7569 2006-07-20 Miguel de Icaza <miguel@novell.com>
7571 * anonymous.cs: Cache the resolved anonymous delegate, and return
7572 this so that the ResolveTopBlock is only triggered once, not
7575 Currently we trigger ResolvetopBlock twice due to a first pass of
7576 argument check compatibility, and a second pass that does the
7579 2006-07-15 Marek Safar <marek.safar@seznam.cz>
7581 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
7583 * rootcontext.cs (Reset): Add helper_classes.
7585 2006-07-15 Marek Safar <marek.safar@seznam.cz>
7588 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
7591 2006-07-13 Miguel de Icaza <miguel@novell.com>
7593 * statement.cs (Lock): Handle expressions of type
7594 TypeManager.null_type specially. Fixes #78770
7596 2006-07-08 Marek Safar <marek.safar@seznam.cz>
7598 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
7601 2006-07-08 Marek Safar <marek.safar@seznam.cz>
7603 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
7604 for accessors as well.
7605 * ecore.cs (EventExpr): Add AccessorTable.
7607 2006-07-01 Marek Safar <marek.safar@seznam.cz>
7610 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
7611 for CS0122 where appropriate.
7612 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
7614 (Filter): Assembly can be null in the case of top level attributes.
7616 2006-06-25 Marek Safar <marek.safar@seznam.cz>
7620 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
7621 is done at global level.
7623 2006-06-24 Marek Safar <marek.safar@seznam.cz>
7625 A fix for #77002, Implemented TypeForwarder support.
7627 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
7628 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
7629 * typemanager.cs (): Add type_forwarder_attr_type.
7631 2006-06-24 Marek Safar <marek.safar@seznam.cz>
7633 * report.cs: Add CS0469 warning.
7635 2006-06-21 Martin Baulig <martin@ximian.com>
7637 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
7638 the `try'-block, so we also report CS0016 etc. there.
7640 2006-06-21 Martin Baulig <martin@ximian.com>
7643 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
7645 2006-06-21 Martin Baulig <martin@ximian.com>
7647 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
7648 also report CS1686 for parameters.
7650 2006-06-21 Martin Baulig <martin@ximian.com>
7652 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
7653 instead of an error if the value is not implicitly convertible to
7654 the switch types; fixes #77964.
7656 2006-06-21 Raja R Harinath <rharinath@novell.com>
7659 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
7660 FieldBuilder is null.
7663 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
7664 'left' and 'right' before error-checking.
7666 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
7668 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
7670 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
7671 (FieldExpr.DoResolve): likewise.
7672 (PropertyExpr.InstanceResolve): likewise.
7673 (EventExpr.InstanceResolve): likewise.
7675 2006-06-04 Marek Safar <marek.safar@seznam.cz>
7677 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
7678 attribute applicable tests for attribute argument.
7680 2006-06-02 Raja R Harinath <rharinath@novell.com>
7683 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
7684 (Binary.OverloadResolve_PredefinedIntegral): New.
7685 (Binary.OverloadResolve_PredefinedFloating): New.
7686 (Binary.OverloadResolve_PredefinedString): New.
7687 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
7688 Follow the standard more closely, and treat numeric promotions in
7689 terms of overload resolution.
7690 (Binary.CheckShiftArguments): Simplify.
7692 2006-06-01 Raja R Harinath <rharinath@novell.com>
7694 * flowanalysis.cs (MyBitVector): Simplify representation.
7695 (MyBitVector.Clone): Avoid allocating BitArray.
7696 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
7697 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
7698 (*): Update. Change all references to MyBitVector.And and
7699 MyBitVector.Or to &= and |=.
7701 2006-05-29 Raja R Harinath <rharinath@novell.com>
7704 * cs-parser.jay (formal_parameter_list): Extend the pattern below
7705 to param arguments too.
7707 2006-05-26 Miguel de Icaza <miguel@novell.com>
7709 * cs-parser.jay: Catch another parsing form for arglist being
7710 followed by other arguments. Fixes #78313.
7712 2006-05-24 Raja R Harinath <rharinath@novell.com>
7714 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
7715 checking of out parameters to ...
7716 (FlowBranchingToplevel.Merge): ... here.
7717 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
7718 set, propagate the origin upward, and only complain if there was
7720 (FlowBranchingException.AddContinueOrigin): Likewise.
7721 (FlowBranchingException.AddReturnOrigin): Likewise.
7722 (FlowBranchingException.AddGotoOrigin): Likewise.
7724 2006-05-23 Raja R Harinath <rharinath@novell.com>
7726 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
7727 unreachable, skip it.
7728 (FlowBranchingException.Merge): Always propagate jumps, even if
7729 the finally block renders subsequent code unreachable.
7731 2006-05-18 Raja R Harinath <rharinath@novell.com>
7734 * statement.cs (Goto.Resolve): Move responsibility for resolving
7735 'goto' to FlowBranching.AddGotoOrigin.
7736 (Goto.SetResolvedTarget): New. Callback to set the
7737 LabeledStatement that's the target of the goto.
7738 (Goto.DoEmit): Use Leave instead of Br when crossing an
7739 unwind-protect boundary.
7740 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
7741 LookupLabel and adjust to new semantics.
7742 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
7743 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
7744 Goto.SetResolvedTarget to update target.
7745 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
7746 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
7747 AddBreakOrigin & co. Delay propagation until ...
7748 (FlowBranchingException.Merge): ... this.
7750 * statement.cs (Block.Resolve): Always depend on flow-branching to
7751 determine unreachability. Kill workaround that originally emitted
7752 only one statement after an "unreachable" label (see infloop in
7755 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
7756 This is still "wrong", but anything better would probably need a
7757 multi-pass algorithm.
7758 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
7759 usage vector. Force current usage vector to be reachable, to
7760 optimistically signify backward jumps.
7761 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
7763 (FlowBranchingLabeled.Merge): New. If no backward jump was
7764 detected, return the original salted-away usage vector instead,
7765 updated with appropriate changes. Print unreachable warning if
7767 * statement.cs (Block.Resolve): Don't print unreachable warning on
7768 a labeled statement.
7770 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
7772 * driver.cs: Pass filename without path to AssemblyBuilder's
7773 AddResourceFile. Fixes bug #78407.
7775 2006-05-17 Raja R Harinath <rharinath@novell.com>
7777 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
7778 * flowanalysis.cs (FlowBranchingLabeled): ... here.
7779 (FlowBranching.MergeChild): Overwrite
7780 reachability information from Labeled branchings too.
7782 2006-05-16 Raja R Harinath <rharinath@novell.com>
7784 * statement.cs (Goto.Resolve): Merge jump origins here ...
7785 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
7787 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
7788 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
7789 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
7790 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
7792 * statement.cs (Goto.Resolve): ... not here.
7793 (Goto.Emit): Remove CS1632 check.
7795 2006-05-14 Marek Safar <marek.safar@seznam.cz>
7797 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
7800 2006-05-11 Raja R Harinath <rharinath@novell.com>
7802 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
7803 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
7804 (FlowBranchingException.Label): Likewise.
7806 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
7808 (MyBitVector.Or): Use it to avoid losing information (Count).
7809 (FlowBranching.MergeOrigins): Likewise.
7811 * flowanalysis.cs (UsageVector.IsDirty): Remove.
7812 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
7813 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
7814 (UsageVector.ToString): Simplify.
7815 (UsageVector.MergeSiblings): Move here from ...
7816 (FlowBranching.Merge): ... here.
7817 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
7820 2006-05-10 Raja R Harinath <rharinath@novell.com>
7822 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
7823 null bitvector is treated as all-true.
7825 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
7826 (MyBitVector): Rationalize invariants. 'vector != null' implies
7827 that we have our own copy of the bitvector. Otherwise,
7828 'InheritsFrom == null' implies all inherited bits are true.
7830 2006-05-09 Marek Safar <marek.safar@seznam.cz>
7832 * statement.cs (LocalInfo): Add IsConstant.
7833 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
7834 local variable for constants.
7836 2006-05-09 Raja R Harinath <rharinath@novell.com>
7838 * flowanalysis.cs (MyBitVector.Empty): New.
7839 (MyBitVector): Don't allow InheritedFrom to be null.
7840 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
7841 (UsageVector, FlowBranching): Update to changes.
7843 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
7844 recursion. The 'Parent == null' condition isn't sufficient for
7846 (FlowBranching.AddBreakOrigin): Likewise.
7847 (FlowBranching.AddContinueOrigin): Likewise.
7848 (FlowBranching.AddReturnOrigin): Likewise.
7849 (FlowBranching.StealFinallyClauses): Likewise.
7850 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
7851 (FlowBranching.CheckOutParameters): Likewise.
7852 (FlowBranchingToplevel): Terminate all the above recursions here.
7853 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
7854 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
7856 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
7858 (FlowBranchingToplevel): New. Empty for now.
7859 (FlowBranching.MergeTopBlock): Update.
7860 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
7861 branching for the anonymous delegate.
7862 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
7864 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
7865 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
7866 information at the start of the merge. Reorganize.
7868 2006-05-07 Marek Safar <marek.safar@seznam.cz>
7870 * class.cs (MethodData.Define): Method cannot implement interface accessor.
7872 2006-05-07 Marek Safar <marek.safar@seznam.cz>
7874 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
7875 to newly introduced ctor.
7877 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
7878 message to one place.
7879 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
7882 2006-05-07 Marek Safar <marek.safar@seznam.cz>
7884 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
7886 * ecore.cs (Expression.ResolveAsConstant): Updated.
7888 * statement.cs (ResolveMeta): Updated.
7890 2006-05-06 Marek Safar <marek.safar@seznam.cz>
7892 * cs-parser.jay: __arglist cannot be used in initializer.
7894 2006-05-06 Marek Safar <marek.safar@seznam.cz>
7897 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
7900 2006-05-05 Raja R Harinath <rharinath@novell.com>
7902 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
7903 (LabeledStatement): Add 'name' parameter.
7904 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
7905 (Block.AddLabel): Update to changes.
7906 * cs-parser.jay (labeled_statement): Likewise.
7908 * flowanalysis.cs (BranchingType.Labeled): New.
7909 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
7910 (FlowBranchingLabeled): New. Does nothing for now, but will
7911 eventually handle 'goto' flows.
7912 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
7913 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
7914 that's terminated ...
7915 (Block.Resolve): ... here.
7917 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
7918 (UsageVector.MergeFinallyOrigins): Likewise.
7919 (FlowBranching.InTryOrCatch): Likewise.
7920 (FlowBranching.AddFinallyVector): Likewise.
7921 (FlowBranchingException): Update to changes.
7924 * statement.cs (Return.Resolve): Move error checking to ...
7925 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
7926 (FlowBranchingException): Handle return origins like break and
7928 (FlowBranching.UsageVector.CheckOutParameters): Remove.
7930 2006-05-04 Marek Safar <marek.safar@seznam.cz>
7933 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
7936 2006-05-04 Marek Safar <marek.safar@seznam.cz>
7939 * class.cs (MethodData.Define): Do public accessor check only when method
7940 implements an interface.
7942 2006-05-04 Raja R Harinath <rharinath@novell.com>
7944 Remove special handling of 'break'
7945 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
7946 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
7947 (UsageVector.Break): Remove.
7948 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
7950 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
7952 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
7953 UsageVector.Breaks (). Don't set NeedsReturnLabel.
7955 2006-05-03 Marek Safar <marek.safar@seznam.cz>
7958 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
7959 be the interface member.
7961 2006-05-03 Marek Safar <marek.safar@seznam.cz>
7964 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
7965 for emitting small (int) values.
7967 2006-05-03 Raja R Harinath <rharinath@novell.com>
7970 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
7971 control-flow passes through the 'finally' after merging-in all the
7972 control-flows from 'try' and the 'catch' clauses.
7974 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
7975 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
7976 always true at the only non-recursive entry point.
7977 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
7978 FlowBranchingBreakable.
7979 (FlowBranchingLoop): Remove.
7980 * statement.cs (Return.DoResolve): Update to changes.
7983 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
7984 (FlowBranching.CreateBranching): Handle it: create a
7985 FlowBranchingContinuable.
7986 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
7987 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
7988 except that it handles the 'continue' command.
7989 (FlowBranching.UsageVector.MergeOrigins): Rename from
7991 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
7992 except that it overrides AddContinueOrigin.
7993 (FlowBranchingException): Override AddContinueOrigin, similar to
7995 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
7996 Create a new branching around the embedded statement.
7997 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
7998 control flow after the embedded statement.
7999 (Continue.Resolve): Move all error checking to AddContinueOrigin.
8001 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
8002 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
8003 FlowBranchingBreakable.
8004 (FlowBranchingSwitch): Remove.
8007 * statement.cs (Break.Resolve): Simplify. Move responsibility for
8008 error reporting to ...
8009 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
8010 Rename from 'AddBreakVector'. Add new location argument. Return
8011 a bool indicating whether the 'break' crosses an unwind-protect.
8012 (FlowBranchingException.AddBreakOrigin): Add.
8013 (FlowBranchingException.Merge): Propagate 'break's to surrounding
8014 flowbranching after updating with the effects of the 'finally'
8016 (FlowBranchingBreakable): New common base class for
8017 FlowBranchingLoop and FlowBranchingSwitch.
8019 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
8021 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
8023 2006-05-02 Raja R Harinath <rharinath@novell.com>
8025 * statement.cs (Do.Resolve): If the loop is infinite, set the
8027 (While.Resolve, For.Resolve): Set a barrier after the embedded
8028 statement. There's no direct control flow that goes from the end
8029 of the embedded statement to the end of the loop.
8030 * flowanalysis.cs (FlowBranching.Infinite): Remove.
8031 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
8032 above ensure that the reachability is correctly computed.
8034 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
8035 (UsageVector.MergeBreakOrigins): If the current path is
8036 unreachable, treat it as if all parameters/locals are initialized.
8037 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
8038 infinite loops before merging-in break origins.
8040 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
8041 (Reachability.Reachable): Split part into ...
8042 (Reachability.Unreachable): ... this. Simplify.
8043 (Reachability.IsUnreachable): Use 'Unreachable' instead.
8045 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
8046 (Reachability.SetThrowsSometimes): Likewise.
8047 (FlowBranchingBlock.MergeTopBlock): Don't compare against
8048 TriState.Always, use corresponding property.
8049 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
8050 (Block.Resolve): Likewise. Remove some redundant checks.
8052 2006-05-02 Raja R Harinath <harinath@gmail.com>
8054 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
8055 (Reachability.Meet): Don't bother checking AlwaysThrows --
8056 barrier is always set.
8057 (FlowBranchingBlock.Merge): Likewise.
8059 2006-05-01 Raja R Harinath <harinath@gmail.com>
8061 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
8062 checks for unreachable.
8064 2006-05-01 Marek Safar <marek.safar@seznam.cz>
8067 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
8069 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
8070 whether field is really assigned.
8072 2006-04-30 Raja R Harinath <harinath@gmail.com>
8074 * flowanalysis.cs (Reachability): Make 4-argument constructor
8076 (Reachability.Meet): Rename from 'And'. Remove static variant.
8077 (Reachability.Always): Rename from the highly misleading
8078 'Reachability.Never'.
8079 (FlowBranching.Merge): Update to changes. Mark an impossible
8080 situation with a 'throw'.
8081 (*): Update to changes.
8083 2006-04-29 Raja R Harinath <harinath@gmail.com>
8085 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
8087 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
8088 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
8089 (*): Update to changes.
8090 * statement.cs: Update to changes.
8092 2006-04-28 Marek Safar <marek.safar@seznam.cz>
8095 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
8097 2006-04-28 Raja R Harinath <harinath@gmail.com>
8099 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
8102 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
8103 argument to two arguments: an usage-vector and a bool. Move call
8104 to FlowBranching.Merge () ...
8105 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
8107 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
8108 handling of loop and switch reachability to ...
8109 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
8111 2006-04-27 Raja R Harinath <harinath@gmail.com>
8113 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
8114 handling to FlowBranchingLoop.InLoop.
8115 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
8117 2006-04-26 Marek Safar <marek.safar@seznam.cz>
8120 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
8121 anonymous method is allowed from AnonymousContainer here.
8123 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
8125 2006-04-24 Raja R Harinath <rharinath@novell.com>
8128 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
8130 2006-04-23 Marek Safar <marek.safar@seznam.cz>
8133 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
8134 (DoubleConstant.Reduce): Ditto.
8136 2006-04-23 Raja R Harinath <rharinath@novell.com>
8138 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
8139 Remove 'lvalue_right_side' argument. Move parts to ...
8140 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
8141 (LocalVariable.DoResolveLValue): ... these.
8143 2006-04-21 Raja R Harinath <rharinath@novell.com>
8146 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
8147 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
8148 (LocalVariableReference.DoResolveBase): Use it to implement new
8150 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
8151 (Argument.Resolve): Simplify. Move CS1510 check ...
8152 * ecore.cs (Expression.ResolveLValue): ... here.
8153 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
8154 (PropertyExpr.DoResolveLValue): Likewise.
8155 (FieldExpr.Report_AssignToReadonly): Likewise.
8156 (FieldExpr.DoResolve): Add 'out_access' argument. Use
8157 LValueMemberAccess or LValueMemberOutAccess on instance depending
8159 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
8160 DoResolve as appropriate.
8162 2006-04-20 Raja R Harinath <rharinath@novell.com>
8165 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
8166 implicit conversions on 'out' and 'ref' arguments.
8168 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
8169 improve clarity. Remove dead code.
8172 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
8173 (Catch.Resolve): Resolve VarBlock if it exists.
8175 2006-04-19 Miguel de Icaza <miguel@novell.com>
8177 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
8178 twice, this was some residual code, the enumerator was emitted
8179 properly in the two branche of if later.
8181 2006-04-19 Raja R Harinath <rharinath@novell.com>
8183 * expression.cs (Cast.ResolveLValue): Remove. The result of a
8184 cast is never an lvalue.
8185 (Cast.DoResolve, Cast.ResolveRest): Combine.
8186 (Argument.Emit): Simplify slightly. Move 'Expr is
8187 IMemoryLocation' check ...
8188 (Argument.Resolve): ... here.
8189 (Argument.Error_LValueRequired): Remove. Inline into only user.
8191 Simplifications. Fix cs0191-2.cs
8192 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
8193 CS1649 and CS1651 to ...
8194 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
8195 the actual selection of the error code and message to a lookup
8196 table. Add a dummy return value to simplify callsites.
8197 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
8198 readonly fields of other instances of the same type. Move CS0197
8200 * expression.cs (Argument.Resolve): ... here. Simplify code.
8201 Ensure that ec.InRefOutArgumentResolving is only set during LValue
8202 resolution of an out or ref argument. The code simplification
8203 above uses this invariant.
8205 2006-04-18 Raja R Harinath <rharinath@novell.com>
8207 Possibly fix #77752. Fix cs1690-[4-7].cs.
8208 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
8209 CheckMarshallByRefAccess. Drop parameter.
8210 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
8212 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
8214 * report.cs (AllWarnings): Add CS1690.
8215 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
8217 (LocalVariableReference.DoResolveBase): Update.
8219 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8221 * class.cs (MethodOrOperator): Moved common parts from method class.
8222 detect obsolete attributes.
8223 (Method.Define): Simplified as it reuses code from base.
8224 (Constructor.ValidAttributeTargets): Fixed issue found during
8226 (Destructor.ValidAttributeTargets): Fixed issue found during
8228 (Operator): Finished refactoring set off by #78020. Operator class is now
8229 ordinary method class.
8231 * anonymous.cs: Updated.
8233 * decl.cs (DeclSpace): Add IsGeneric
8235 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8237 * class.cs (Constructor.Emit): Don't emit the attributes twice.
8239 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8241 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
8242 detect obsolete attributes.
8243 (Method.CreateEmitContext): Moved to MethodOrOperator.
8245 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8248 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
8249 customized exception to make crash detection easier.
8250 (MethodOrOperator): Started to work on new base class for methods and
8252 (Method): Derives from MethodOrOperator.
8253 (Constructor.Emit): Emits its own attributes.
8254 (AbstractPropertyEventMethod.Emit): Ditto.
8255 (Operator): Derives from MethodOrOperator, will refactor fully in extra
8257 (Operator.Emit): It's temporary more tricky than should be.
8259 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
8261 * report.cs (InternalErrorException): Add ctor with inner exception.
8263 2006-04-08 Marek Safar <marek.safar@seznam.cz>
8266 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
8269 2006-04-07 Marek Safar <marek.safar@seznam.cz>
8272 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
8275 2006-04-06 Marek Safar <marek.safar@seznam.cz>
8277 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
8278 attribute is present and Guid not.
8279 (Interface.ApplyAttributeBuilder): Ditto.
8281 * attribute.cs: Add error message.
8283 2006-04-06 Marek Safar <marek.safar@seznam.cz>
8287 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
8288 sources (it's composite) so hold them in extra array as they are used in
8289 Emit phase only. It worked in the previous versions by mistake.
8290 (Attribute.Emit): Emit attribute for more owners when exist.
8292 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
8293 it has now different behaviour.
8295 2006-04-04 Marek Safar <marek.safar@seznam.cz>
8297 * constant.cs (Constant.IsDefaultInitializer): New method.
8299 * class.cs: Updated.
8301 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
8302 re-initialize default values. It saves KBs almost for every assembly.
8303 Thanks Zoltan for the idea.
8304 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
8305 (ArrayCreation.DoResolve): Resolve only once.
8306 (ArrayCreation.Emit): Emit static initializer only when it is faster.
8307 (ArrayCreation.GetAttributableValue): Cope with optimized values.
8309 2006-04-03 Zoltan Varga <vargaz@gmail.com>
8311 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
8314 2006-04-01 Marek Safar <marek.safar@seznam.cz>
8316 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
8317 in an embedded statement too.
8319 2006-04-01 Raja R Harinath <rharinath@novell.com>
8322 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
8324 2006-04-01 Marek Safar <marek.safar@seznam.cz>
8328 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
8331 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
8333 2006-03-31 Marek Safar <marek.safar@seznam.cz>
8335 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
8338 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
8339 LocalTemporary change.
8341 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
8343 (ClassOrStruct.DefineFieldInitializers): Implemented static field
8344 initializers optimization.
8345 (ClassOrStruct.TypeAttr): Moved from modifiers.
8346 (Constructor.CheckBase): Don't crash when static ctor has parameters.
8347 (FieldBase.ResolveInitializer): Resolves initializer.
8348 (FieldBase.HasDefaultInitializer): New property.
8350 * cs-parser.jay: Removed message.
8352 * expression.cs (CompilerGeneratedThis): New specialization.
8354 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
8356 2006-03-28 Marek Safar <marek.safar@seznam.cz>
8358 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
8360 2006-03-27 Marek Safar <marek.safar@seznam.cz>
8362 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
8363 be now EnumConstants only.
8365 2006-03-27 Marek Safar <marek.safar@seznam.cz>
8367 * attribute.cs, driver.cs: Reset more caches.
8369 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8371 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
8373 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8375 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
8376 for easier reuse. Updated all overrides.
8377 (IntegralConstant): New base class for all integral constants.
8378 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
8379 of the constant range, report custom error.
8380 (UIntConstant.Reduce): Fixed uint conversion.
8382 * ecore.cs, literal.cs: Reduce updates.
8384 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8388 * class.cs (Constructor.Define): Removed extra if for default ctors.
8389 A patch from Atsushi Enomoto.
8391 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8393 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
8394 GetAttributableValue.
8396 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
8399 * convert.cs (ImplicitConversionRequired): Error message moved to
8402 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
8403 automatic implicit conversion of an output value.
8404 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
8406 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
8408 (TypeOf.GetAttributableValue): Add extra handling for object type.
8410 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
8411 special error message.
8413 2006-03-25 Marek Safar <marek.safar@seznam.cz>
8415 * class.cs (Constructor.Emit): Don't crash when struct ctor is
8417 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
8418 compatible with MS runtime.
8420 2006-03-23 Marek Safar <marek.safar@seznam.cz>
8422 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
8423 attribute arguments here.
8425 * class.cs (Indexer.Define): The check was moved to attribute class.
8427 2006-03-22 Marek Safar <marek.safar@seznam.cz>
8429 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
8430 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
8433 2006-03-22 Raja R Harinath <rharinath@novell.com>
8435 Support ParameterDefaultValueAttribute in gmcs. Also applied to
8436 mcs to keep code differences small.
8437 * attribute.cs (Attribute.GetParameterDefaultValue): New.
8438 * typemanager.cs (parameter_default_value_attribute_type): New.
8439 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
8442 2006-03-21 Marek Safar <marek.safar@seznam.cz>
8444 * expression.cs (StringConcat.Append): Reverted back to no warning state.
8446 2006-03-21 Marek Safar <marek.safar@seznam.cz>
8448 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
8450 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
8453 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
8455 * doc-bootstrap.cs : fix build.
8457 2006-03-20 Marek Safar <marek.safar@seznam.cz>
8459 * expression.cs (StringConcat.Append): Issue a warning when empty string
8462 2006-03-20 Marek Safar <marek.safar@seznam.cz>
8464 * assign.cs (CompoundAssign.ResolveSource): Removed.
8466 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
8469 * class.cs (TypeContainer.FindMethods): Removed.
8470 (TypeContainer.CheckMemberUsage): Made static.
8472 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
8474 * constant.cs (CheckRange): Removed unused type argument.
8475 (CheckUnsigned): Removed unused type argument.
8477 * cs-parser.jay: Updated after MemberAccess clean up.
8478 Uses Length for empty string test.
8480 * cs-tokenizer.cs: Uses Length for empty string test.
8481 (IsCastToken): Made static.
8482 (is_hex): Made static.
8483 (real_type_suffix): Made static.
8485 * decl.cs (SetupCache): Made static.
8486 (OnGenerateDocComment): Removed unused ds argument.
8488 * delegate.cs (VerifyDelegate): Removed unused argument.
8490 * doc.cs: Uses Length for empty string test.
8492 * driver.cs: Uses Length for empty string test.
8494 * enum.cs (IsValidEnumType): Made static
8496 * expression.cs (EnumLiftUp): Removed unused argument.
8497 (ResolveMethodGroup): Ditto.
8498 (BetterConversion): Ditto.
8499 (GetVarargsTypes): Ditto.
8500 (UpdateIndices): Ditto.
8501 (ValidateInitializers): Ditto.
8502 (MemberAccess.ctor): Ditto.
8503 (GetIndexersForType): Ditto.
8505 * flowanalysis.cs: (MergeFinally): Removed unused argument.
8507 * iterators.cs: Updated after MemberAccess clean up.
8509 * location.cs: Uses Length for empty string test.
8511 * namespace.cs: Uses Length for empty string test.
8513 * report.cs (CheckWarningCode): Made static.
8515 * statement.cs (LabeledStatement): Removed unused argument.
8517 * typemanager.cs (FilterNone): Removed.
8519 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8521 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
8524 * class.cs: Updated.
8526 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8528 * cs-parser.jay.cs: __arglist is not allowed for delegates.
8530 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8534 * expression.cs (VerifyArgumentsCompat): Reverted to double error
8535 reporting, it's more tricky than I thought.
8537 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8541 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
8543 (AnonymousMethod.ImplicitStandardConversionExists): New method.
8544 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
8545 Add more error reporting; Fixed issue with params.
8547 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
8549 * cs-parser.jay: AnonymousMethod requires host container.
8551 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
8553 2006-03-18 Raja R Harinath <harinath@gmail.com>
8555 * class.cs: Change 'TypeContainer ds' constructor argument to
8556 'DeclSpace parent'. Some classes were missed below due to
8557 different naming convention.
8559 * class.cs (MemberCore.Parent): Delete. This makes the
8560 ParentContainer changes below enforceable by the compiler.
8562 Treat pointers to enclosing declaration space as 'DeclSpace', not
8564 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
8565 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
8567 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
8569 (Block.AddThisVariable): Likewise.
8570 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
8571 (AbstractPropertyEventMethod.Emit): Likewise.
8572 (AbstractPropertyEventMethod.EmitMethod): Likewise.
8573 (GetMethod.Define, SetMethod.Define): Likewise.
8574 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
8575 (DelegateMethod.EmitMethod): Likewise.
8577 Fix regression test-partial-13.cs.
8578 Rationalize use of PartialContainer. Ensure that the partial
8579 class semantics can be tied to type-correctness, i.e., any
8580 violation will cause a compile error.
8581 * class.cs, const.cs: Access all fields that belong to class
8582 TypeContainer via ParentContainer. Arguments of EmitContexts and
8583 Resolve()-like functions still use 'Parent'.
8585 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
8586 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
8587 (PropertyMethod.CheckModifiers): Remove unused argument.
8588 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
8591 2006-03-17 Raja R Harinath <harinath@gmail.com>
8593 Make semantics of PartialContainer simpler.
8594 * decl.cs (DeclSpace.IsPartial): Remove.
8595 * class.cs (TypeContainer.IsPartial): Likewise.
8596 (TypeContainer..ctor): Set PartialContainer to point to self.
8597 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
8598 (TypeContainer.FindNestedType): Likewise.
8599 (MemberCore.ParentContainer): Simplify. Remove deprecation.
8601 2006-03-17 Marek Safar <marek.safar@seznam.cz>
8603 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
8605 2006-03-15 Marek Safar <marek.safar@seznam.cz>
8607 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
8610 2006-03-15 Marek Safar <marek.safar@seznam.cz>
8612 * class.cs (Operator.Define): An error for base conversion was not
8615 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
8617 * iterator.cs : yield break is allowed in try statement which has
8618 catch clauses. Fixed bug #77767.
8620 2006-03-13 Marek Safar <marek.safar@seznam.cz>
8622 A fix for #77593, #77574.
8624 * class.cs (MethodCore.CheckBase): Another if for operator.
8626 2006-03-09 Marek Safar <marek.safar@seznam.cz>
8628 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
8631 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
8632 (DelegateCreation.ImplicitStandardConversionExists): New method for just
8635 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
8638 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
8639 Updated after another emitcontext usage was clean up. It should help us to
8640 synchronize with gmcs easier.
8642 2006-03-04 Marek Safar <marek.safar@seznam.cz>
8646 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
8647 (Event.Define): ditto
8648 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
8650 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
8651 Removed redundant code and set NewSlot for Invoke method too.
8653 * parameter.cs (Parameters.ctor): Add custom, type ctor.
8654 (Parameters.MergeGenerated): New method. Use this method when you merge
8655 compiler generated argument with user arguments.
8657 2006-03-03 Marek Safar <marek.safar@seznam.cz>
8659 * attribute.cs (ResolveAsTypeTerminal): Removed.
8661 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
8662 specialization for predefined types; 30% speed up.
8663 Finally placed obsolete check to right place.
8664 (Expression.ResolveType): Removed.
8666 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
8667 Updated after ResolveType was removed.
8669 * expression.cs (Cast.ctor): Check void cast.
8670 (Binary.ResolveAsTypeTerminal): Is never type.
8671 (Conditional.ResolveAsTypeTerminal): Is never type.
8673 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
8675 2006-03-01 Raja R Harinath <rharinath@novell.com>
8678 * expression.cs (ParameterReference.DoResolveBase): Change return
8680 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
8684 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
8687 * typemanager.cs (GetFullNameSignature): Don't nullref on
8688 protected accessors.
8690 2006-02-27 Marek Safar <marek.safar@seznam.cz>
8692 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
8693 these two separated members to simplify the code.
8694 (Attribute.Resolve): Refactored to use new fields and methods.
8695 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
8696 implemented obsolete attribute checking.
8697 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
8698 implemented obsolete checking again. It look line never ending quest ;-)
8699 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
8701 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
8703 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
8705 *class.cs (Property.Define): Add RegisterProperty call.
8707 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
8708 argument groups (only 2).
8710 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
8711 encoding expression to arguments.
8712 (Expression.ExprClassToResolveFlags): Just turned to property.
8714 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
8715 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
8716 optimized as well as implemented support for zero-length attributes.
8718 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
8719 Add caching of PropertyInfo's.
8721 2006-02-25 Marek Safar <marek.safar@seznam.cz>
8723 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
8724 error multiple times.
8726 2006-02-25 Marek Safar <marek.safar@seznam.cz>
8728 New partial class implementation.
8729 A fix for #77027, #77029, #77403
8731 * attribute.cs (Attributable): Made attributes protected.
8733 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
8734 the replacements of ClassPart and PartialContainer.
8735 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
8736 (TypeContainer.AddInterface): Ditto.
8737 (TypeContainer.AddPartial): The main method for partial classes. It checks
8738 for errors and merges ModFlags and attributes. At the end class is added to
8740 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
8742 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
8743 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
8744 from the rest of partial classes.
8745 (TypeContainer.GetClassBases): Simplified.
8746 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
8748 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
8749 (TypeContainer.HasExplicitLayout): Uses Flags now.
8750 (PartialContainer): Removed.
8751 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
8752 (StaticClass): Was merged with Class.
8753 (Class.GetClassBases): class and static class bases are verified here.
8754 (Class.TypeAttr): Added static attributes when class is static.
8755 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
8756 (MemberBase): In some cases we need to call parent container for partial
8757 class. It should be eliminated but it's not easy now.
8759 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
8761 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
8762 partial classed to accumulate class comments.
8763 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
8765 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
8767 * driver.cs (MainDriver): Tree.GetDecl was removed.
8769 * modifiers.cs (Modifiers): Add partial modifier.
8771 * tree.cs (Tree.decl): Removed.
8772 (RootTypes): Started to use this class more often for root types
8775 2006-02-22 Marek Safar <marek.safar@seznam.cz>
8779 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
8780 external interface does not have an attribute.
8782 2006-02-22 Marek Safar <marek.safar@seznam.cz>
8784 Another prerequisites for new partial classs implementation.
8786 * attribute.cs (Attribute.Equal): Implemented.
8787 (Attribute.Emit): Changed as attributes can be applied more than twice.
8788 (Attributes.Emit): Check for duplicate attributes here.
8790 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
8791 as a parameter, clean-up.
8793 2006-02-11 Marek Safar <marek.safar@seznam.cz>
8797 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
8798 contains obsolete attribute check which can in some cases look for base
8799 type of current class which is not initialized yet.
8800 (TypeContainer.BaseType): Replacement of ptype.
8802 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
8804 2006-02-11 Marek Safar <marek.safar@seznam.cz>
8806 First of prerequisites for new partial classs implemention.
8808 * attribute.cs (Attributable): Extended by ResolveContext;
8809 Attributes finally have correct context for resolving in all cases.
8810 (AttachTo): Attribute owner is assigned here.
8812 * codegen.cs (IResolveContext): Introduce new interface to hold
8813 all information needed in resolving phase.
8814 (EmitContext): Implements IResolveContext; more clean-up needed here.
8816 * decl.cs (MemberCore): Implemented IResolveContext.
8818 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
8819 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
8820 parameter.cs, statement.cs, tree.cs, typemanager.cs:
8821 Refactored to use new IResolveContext instead of EmitContext; cleanup
8823 2006-02-06 Miguel de Icaza <miguel@novell.com>
8825 * codegen.cs (EmitScopeInitFromBlock): check here the
8826 capture_context, there is no need to make two calls to the
8829 * anonymous.cs: Add some debugging messages that might help me
8830 track other instances of this problem in the future (the
8831 regression of test 467).
8833 * cs-parser.jay: track the variable block, as we need to initalize
8834 any captured variables declared in this block for the "catch"
8835 portion of the "Try" statement.
8837 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
8838 scope initialization for captured variables.
8840 Also, move the emit for the variables after the block location has
8843 2006-02-06 Marek Safar <marek.safar@seznam.cz>
8845 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
8847 2006-02-02 Miguel de Icaza <miguel@novell.com>
8849 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
8850 commit yesterday, the initialization for the roots is necessary.
8851 What is not necessary is the scope activation.
8853 2006-02-02 Raja R Harinath <rharinath@novell.com>
8855 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
8856 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
8858 (Argument.Resolve): Remove CS0206 checks.
8860 2006-02-01 Miguel de Icaza <miguel@novell.com>
8862 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
8863 scopes for all the roots, the scopes will now be emitted when the
8864 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
8866 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
8867 code. This reduces a lot of existing cruft.
8869 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
8870 that the ScopeInfo is generated as we enter the scope, not at the
8871 time of use, which is what we used to do before.
8873 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
8874 every time a Block is about to be emitted if we have a
8877 2006-02-01 Raja R Harinath <rharinath@novell.com>
8879 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
8881 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
8883 * typemanager.cs (cons_param_array_attribute): Make private.
8884 (Reset): Set it to null.
8885 (InitCoreHelpers): Don't initialize it.
8886 (ConsParamArrayAttribute): New. Initialize it as needed.
8887 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
8889 2006-01-31 Miguel de Icaza <miguel@novell.com>
8891 * expression.cs: There might be errors reported during the
8892 selection of applicable methods. If there are errors, do not
8893 continue execution as it will lead the compiler to crash.
8895 2006-01-30 Miguel de Icaza <miguel@novell.com>
8897 * expression.cs: Member access is not allowed on anonymous
8898 methods. Fixes #77402.
8900 2006-01-30 Raja R Harinath <rharinath@novell.com>
8903 * cs-parser.jay (VariableDeclaration): Don't set
8904 current_array_type to null.
8905 (field_declaration, event_declaration, declaration_statement):
8906 Set it to null here.
8908 2006-01-28 Raja R Harinath <harinath@gmail.com>
8910 * typemanager.cs (GenericParameterPosition): New.
8913 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
8915 * doc.cs : To process "include" elements, first we should create
8916 another list than XmlNodeList, because it could result in node
8917 removal, which could result in that the XmlNodeList gives up
8920 (Also made code identical to gmcs again.)
8922 2006-01-25 Miguel de Icaza <miguel@novell.com>
8924 * ecore.cs: Introduce an error report that we were not catching
8925 before, if not silent, we must report the error. Gonzalo ran into
8928 2006-01-23 Miguel de Icaza <miguel@novell.com>
8930 A fix for bug: #76957
8932 * iterators.cs (MoveNextMethod.CreateMethodHost): call
8933 ComputeMethodHost before creating the method, this is a new
8936 * anonymous.cs (AnonymousContainer): Now we track all the scopes
8937 that this method references (RegisterScope). The actual scope
8938 where the method is hosted is computed with the ComputeMethodHost
8939 before we create the method.
8941 Moved the Deepest routine here.
8943 (AnonymousContainer.ComputeMethodHost): New routine used to
8944 compute the proper ScopeInfo that will host the anonymous method.
8946 (ScopeInfo): Deal with multiple roots. The problem was that we
8947 did not have a unique root where all ScopeInfos could be hanged
8948 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
8951 Remove AdjustMethodScope which is now computed at the end. Remove
8952 LinkScope which did a partial link, instead link all ScopeInfos
8953 before code generation from the new "LinkScopes" routine.
8955 Simplify all the Add* routines as they no longer need to maintain
8956 the tree, they just need to record that they are using variables
8959 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
8960 routines to produce the forest of ScopeInfo trees.
8962 * class.cs (TypeContainer.AppendMethod): This is just like
8963 AddMethod, but ensures that an interface implementation method
8964 (IEnumerable.XXX) is not inserted at the beginning of the queue of
8965 methods, but at the end.
8967 We use this functionality to ensure that the generated MoveNext
8968 method in the iterator class is resolved/emitted before the
8969 enumerator methods created.
8971 This is required because the MoveNext method computes the right
8972 ScopeInfo for the method. And the other methods will eventually
8973 need to resolve and fetch information computed from the anonymous
8976 2006-01-21 Raja R Harinath <harinath@gmail.com>
8977 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8980 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
8982 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
8983 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
8985 2006-01-18 Raja R Harinath <rharinath@novell.com>
8987 Fix #76656, cs0231-2.cs.
8988 * cs-parser.jay (formal_parameter_list): Make error case catch
8990 (parenthesized_expression_0): Add CS1026 check.
8991 (invocation_expression): Remove unused { $$ = lexer.Location }.
8993 2006-01-17 Raja R Harinath <rharinath@novell.com>
8996 * cs-parser.jay (statement_expression): Don't list out the
8997 individual statement-expressions. Convert syntax error into
9000 2006-01-16 Raja R Harinath <rharinath@novell.com>
9003 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
9004 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
9005 CheckIntermediateModification.
9006 (FieldExpr.DoResolve): Add new two-argument version that
9007 allows us to resolve the InstanceExpression as an lvalue.
9008 The one-argument variant is now just a wrapper.
9009 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
9010 Resolve the lhs as an lvalue if the it has a value type.
9011 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
9012 from Assign.DoResolve.
9013 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
9014 resolved as an lvalue.
9015 (PropertyExpr.DoResolve): Update.
9016 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
9017 has a value type. Move CS1612 check here from
9018 CheckIntermediateModification.
9019 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
9020 * expression.cs (EmptyExpression.OutAccess): New. Used as the
9021 'right_side' of a ResolveLValue on an 'out' argument.
9022 (EmptyExpression.LValueMemberAccess): New. Used as the
9023 'right_side' of a propagated ResolveLValue on a value type.
9024 (LocalVariableReference.DoResolveBase): Recognize
9025 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
9027 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
9028 EmptyExpression.Null.
9030 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
9032 * typemanager.cs : added IsGenericParameter(). In mcs it always
9034 * doc.cs : for generic parameters, use GenericParameterPosition,
9037 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
9039 * expression.cs: Fix Console.WriteLine ((this = x).foo);
9041 2006-01-12 Miguel de Icaza <miguel@novell.com>
9043 This fixes the problem where we used ldfld instead of ldflda to
9044 load the "THIS" pointer on captured parameters, when THIS is a
9045 value type. See bug #77205.
9047 * iterators.cs (CapturedThisReference.Emit): Pass false to
9048 EmitThis (we do not need the address).
9050 * codegen.cs (EmitThis): it needs to know whether we need the
9051 address of `this' or not. This is used by value types.
9053 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
9054 every other call passes false.
9056 2006-01-12 Raja R Harinath <rharinath@novell.com>
9059 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
9061 * expression.cs (Invocation.OverloadResolve): Update.
9062 (Invocation.DoResolve): Avoid double resolution of invocation.
9064 2006-01-11 Raja R Harinath <rharinath@novell.com>
9067 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
9068 unary negation of floating point types as 0-expr; negation cannot
9069 overflow in floating point types.
9072 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
9073 on operands of 'void' type.
9076 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
9077 and ExclusiveOr for boolean constants too.
9079 2006-01-09 Raja R Harinath <rharinath@novell.com>
9082 * expression.cs (Invocation.OverloadResolve): Replace reflected
9083 override methods with their base virtual methods, rather than
9085 * typemanager.cs (TypeManager.GetOverride): New.
9087 2006-01-05 Jb Evain <jbevain@gmail.com>
9089 * class.cs (Property.Define, Indexer.Define): do not tag the
9090 properties as SpecialName | RTSpecialName.
9092 2006-01-04 Miguel de Icaza <miguel@novell.com>
9094 * class.cs (MethodCore.IsDuplicateImplementation): This method was
9095 doing a low-level comparission of parameter types. It was lacking
9096 a check for __argslist.
9098 2005-12-30 Miguel de Icaza <miguel@novell.com>
9100 * expression.cs (ParameterReference.DoResolveBase): Allow
9101 reference parameters if they are local to this block.
9103 This allows the ref and out parameters of a delegate to be used in
9104 an anonymous method, for example:
9106 delegate void set (out int x);
9108 set s = delegate (out int x){
9112 This is used by functionality introduced late in the C# language.
9114 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
9115 method that take ref and out parameters.
9117 Fixes #77119 which was a late change in the spec.
9119 2005-12-23 Miguel de Icaza <miguel@novell.com>
9121 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
9122 parent if its the same scope. Fixes #77060.
9124 2005-12-21 Miguel de Icaza <miguel@novell.com>
9126 * driver.cs: Report the case of no source files and no -out:
9129 2005-12-20 Raja R Harinath <rharinath@novell.com>
9132 * expression.cs (ComposedCast.GetSignatureForError): Define.
9134 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9138 * namespace.cs (NamespaceEntry): Add extern_aliases as a
9139 ListDictionary, to contain the ExternAliasEntry entries (in
9140 addition to the NamespaceEntry.aliases hashtable). This field is
9141 shared between the original entry and its doppelganger (bodyless
9143 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
9144 extern_aliases field.
9145 (NamespaceEntry.Lookup): Move the IsImplicit check after the
9146 lookup in extern_aliases.
9148 2005-12-16 Raja R Harinath <rharinath@novell.com>
9151 * class.cs (TypeContainer.Mark_HasEquals): New.
9152 (TypeContainer.Mark_HasGetHashCode): New.
9153 (ClassPart): Override them.
9154 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
9157 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
9158 'parent' argument to the base constructor.
9160 Remove all mention of TypeContainer from decl.cs.
9161 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
9162 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
9163 (DeclSpace.DeclSpace): Likewise.
9164 (DeclSpace.DefineMembers): Remove unused argument.
9165 * cs-parser.jay (pop_current_class): Update to changes. Simplify
9166 debugging check -- we don't care if the debug code throws an
9167 InvalidCastException instead of an InternalErrorException.
9168 * class.cs (TypeContainer.DefineMembers): Update to changes.
9169 (TypeContainer.DoDefineMembers): Likewise.
9170 (TypeContainer.GetMethods): Likewise.
9171 (PropertyMember.Define): Likewise.
9172 (MemberBase.Parent): New property that forwards to
9173 MemberCore.Parent, but ensures that we get a TypeContainer.
9174 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
9175 (RootContext.PopulateTypes): Likewise. Remove special case code
9176 for !RootContext.StdLib: DefineMembers is idempotent.
9178 2005-12-14 Miguel de Icaza <miguel@novell.com>
9180 * convert.cs (ExplicitConversionCore): Check the return value from
9181 ExplicitConversionCore which can return null on failure. Fixes #76914
9183 2005-12-13 Marek Safar <marek.safar@seznam.cz>
9185 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
9187 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
9189 * doc.cs : The search for referenced namespace was insufficient to
9190 get global one as it used to do. Fixed bug #76965.
9192 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
9194 * doc.cs : check name in cref in the last phase that whether it is
9197 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
9199 * cs-tokenizer.cs : reverted the latest change: it somehow broke
9202 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
9204 * doc.cs : so it turned out that we cannot skip override check for
9205 interface members. Fixed bug #76954.
9207 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
9209 * cs-tokenizer.cs : fixed bug #75984:
9210 - #warning and #error should not be handled when the source line
9212 - #line is not checked strictly when the source line is disabled.
9213 - #define and #undef is on the other hand checked strictly at any
9216 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
9218 * cs-tokenizer.cs : missing Location (actually, filename) in one of
9221 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9223 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
9225 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
9227 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
9228 (FieldBase.Initializer): Initializer is now optional.
9229 (EventField.Define): Only event field can have initializer.
9231 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
9233 * const.cs (Const): Reuse initializer.
9235 * cs-parser.jay: Updated after FieldBase changes.
9236 Added current_array_type to simplify array initializers.
9238 * ecore.cs (NullCast.IsDefaultValue): Implemented.
9240 * expression.cs, iterators.cs: Updated.
9242 * namespace.cs (NamespaceEntry): Made UsingFound private.
9244 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9246 * parameterCollection.cs: Obsolete, removed.
9247 * parser.cs: Obsolete, removed.
9249 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9252 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
9254 * enum.cs (Enum.Define): Set obsolete context here.
9256 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
9259 - FindDocumentedMember() now expects 1) paramList as null
9260 when "we don't have to check the number of parameters" and
9261 2) Type.EmptyTypes when "there is no arguments".
9262 - Introduced FoundMember struct to hold the exact type which was
9263 used to find the documented member (the above change broke
9264 test-xml-044; it might be better just to use DeclaringType than
9265 what MS does, like this change does, but it depends on usage.)
9267 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
9269 * doc.cs : documented member might be from DeclaringType for nested
9270 types. Fixed bug #76782.
9272 2005-12-03 Ben Maurer <bmaurer@ximian.com>
9274 * anonymous.cs: Have the param code handle leaving copies on the
9275 stack etc. Allows anonymous params to take part in the assignment
9276 code (++, +=, etc). Fixes bug #76550
9278 * expression.cs: Handle the prepare_for_load/leave_copy by passing
9279 it down to the anon code.
9281 * iterators.cs: Use dummy var here
9283 * codegen.cs: Handle new vars
9285 2005-12-01 Marek Safar <marek.safar@seznam.cz>
9288 * class.cs (MethodData.Define): Set proper Obsolete context.
9290 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
9292 (FieldExpr.DoResolve): Ditto.
9294 2005-12-01 Marek Safar <marek.safar@seznam.cz>
9297 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
9298 parent is not obsolete.
9300 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
9302 * doc.cs : (FindDocumentedMember) find parameterless members first
9303 and get CS0419 in the early stage. Fixed first case of bug #76727.
9305 2005-11-30 Marek Safar <marek.safar@seznam.cz>
9308 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
9309 no error was reported.
9311 *expression.cs (Binary.DoResolve): left can be null.
9313 2005-11-22 Marek Safar <marek.safar@seznam.cz>
9316 * class.cs (MethodData.Emit): Parameters should be labeled first.
9318 2005-11-21 Marek Safar <marek.safar@seznam.cz>
9321 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
9323 2005-11-18 Marek Safar <marek.safar@seznam.cz>
9325 * attribute.cs (AreParametersCompliant): Moved to Parameter.
9327 * class.cs (MethodCore): Parameter clean up.
9328 (IMethodData): Added ParameterInfo.
9329 (MethodData): Parameter clean up.
9330 (Indexer.Define): Parameter clean up.
9342 * typemanager.cs: Parameter clean up.
9344 * delegate.cs (Define): Get rid of duplicated code.
9346 * expression.cs (ParameterReference): Removed useless parameters
9348 (Invocation): Ditto.
9350 * parameter.cs (ParamsParameter): New class, params specialization.
9351 (ArglistParameter): Attemp to separate arglist.
9352 (Parameter): Refactored to be reusable and faster.
9353 (Parameter.Modifier): Made understandable.
9354 (Parameters): Changed to be used as a class for `this' assembly
9355 parameters. Refactored to use new specialized classes.
9357 * support.cs (ParameterData): Added Types property.
9358 (InternalParameters): Deleted.
9360 2005-08-20 Martin Baulig <martin@ximian.com>
9362 Merging this patch from GMCS to fix #75867.
9364 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9365 scope if we don't already have it.
9367 2005-11-17 Martin Baulig <martin@ximian.com>
9370 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
9371 inherit the scope from our parent. Fixes #76653.
9373 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9375 * doc.cs : the previous patch does not actually fix the bug.
9376 PropertyInfo override check is now implemented and really fixed it.
9377 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
9379 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9381 * doc.cs : apply "override filter" also to properties.
9384 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9386 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
9387 no need to check overrides. For classes, omit those results from
9388 interfaces since they must exist in the class. Fixed bug #76726.
9390 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9392 * typemanager.cs : (GetFullNameSignature) differentiate indexers
9393 with different parameters. Fixed the second problem in #76685.
9395 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9397 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
9398 get expected 'protected' access in CheckValidFamilyAccess()).
9401 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9403 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
9404 Fixed bug #76705. CS1569 was incorrectly commented out.
9406 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
9408 * doc.cs : use Invocation.IsOverride() to do real override check.
9409 * expression.cs : made Invocation.IsOverride() internal.
9411 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
9413 * doc.cs : use TypeManager.FindMembers() instead of (possible)
9414 TypeBuilder.FindMembers() and filter overriden base members out.
9417 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9419 * doc.cs : ref/out parameters are represented as '@' (instead of
9420 '&' in type FullName). Fixed bug #76630 (additionally crefs).
9422 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9424 * doc.cs : when there was no '.' in cref to methods in doc comment,
9425 then parameters were missing in the output. Fixed bug #76691.
9427 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9429 * driver.cs : don't output docs when there is an error.
9432 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9435 Now it should detect indexers. Fixed primary concern in bug #76685.
9436 Fixed CS0419 message to not show the identical member signature in
9439 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9441 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
9442 instead of Type.FindMembers() since it does not handle events.
9445 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
9447 * codegen.cs: Fixed typo (speficied -> specified).
9449 2005-11-11 Marek Safar <marek.safar@seznam.cz>
9452 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
9454 2005-11-11 Marek Safar <marek.safar@seznam.cz>
9456 * attribute.cs: Changed error message.
9458 * cs-tokenizer.cs: One more check.
9460 2005-11-10 Marek Safar <marek.safar@seznam.cz>
9462 * statement.cs (Block.Resolve): Ignore empty statement.
9464 2005-11-10 Marek Safar <marek.safar@seznam.cz>
9466 * report.cs: Made error/warning methods more strict to avoid
9469 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
9470 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
9471 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
9472 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
9474 2005-11-08 Marek Safar <marek.safar@seznam.cz>
9476 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
9477 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
9479 * class.cs (TypeContainer.IsComImport): New property.
9480 (Constructor.Define): Create proper ctor for ComImport types.
9482 * expression.cs (New.CheckComImport): Fixed.
9484 2005-11-07 Miguel de Icaza <miguel@novell.com>
9486 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
9487 that a parameter has been captured does not mean that we do not
9488 have to do the rest of the processing. This fixes the second part
9489 of #76592. If there was another anonymous method capturing
9490 values in the past, the Scope would never be set for the second
9491 method that captured the same parameter.
9493 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
9494 properly manipulate the stack. Second part of fix for #76592.
9496 * expression.cs (New): Add support for invoking "new" on
9497 interfaces that have been flagged with the ComImport attribute and
9498 the CoClass. Fixes #76637
9500 * statement.cs (Try.DoEmit): When a variable is captured, do not
9501 try to emit the vi.LocalBuilder variable as it has been captured.
9502 Create a temporary variable and store the results on the
9503 FieldBuilder. Fixes #76642
9505 2005-11-07 Marek Safar <marek.safar@seznam.cz>
9507 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
9509 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
9511 * expression.cs (Binary.DoResolve): Added && optimalization.
9513 * typemanager.cs (AddUserType): Removed useless argument.
9515 2005-11-04 Marek Safar <marek.safar@seznam.cz>
9517 * statement.cs (Block.variables): Uses ListDictionary.
9519 2005-11-03 Marek Safar <marek.safar@seznam.cz>
9522 * class.cs (PartialContainer.EmitType): Customized to emit
9523 security attributes.
9524 (ClassPart.ApplyAttributeBuilder): Transform security attribute
9525 for partial classes.
9527 2005-11-03 Marek Safar <marek.safar@seznam.cz>
9530 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
9531 access has to be fixed.
9533 * typemanager.cs (IsUnmanagedType): Wrong common field type.
9535 2005-11-01 Marek Safar <marek.safar@seznam.cz>
9538 * ecore.cs (NullCast.Reduce): Implemented.
9540 * expression.cs (ArrayCreation.CheckIndices): Correcly check
9543 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
9545 (Foreach.Resolve): Catch null properly.
9547 2005-10-29 Marek Safar <marek.safar@seznam.cz>
9549 * cs-tokenizer.cs: Warning text fix.
9551 * driver.cs: AllWarningNumbers exposed on public interface.
9553 * report.cs (): Reviewed warning numbers.
9554 (IsValidWarning): Use binary search.
9556 2005-10-29 Marek Safar <marek.safar@seznam.cz>
9558 * driver.cs: Implemeted resource visibility.
9559 (Resources): New class for code sharing between /res: and
9562 2005-10-28 Marek Safar <marek.safar@seznam.cz>
9565 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
9568 * convert (Convert.ImplicitReferenceConversion): NullCast holds
9571 * ecore.cs (NullCast): Child is contant only.
9573 * literal.cs (NullLiteral.Reduce): null can be converted to any
9576 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
9578 * driver.cs: Use Encoding.Default as default code page instead
9581 2005-10-27 Raja R Harinath <rharinath@novell.com>
9584 * expression.cs (Invocation.Error_InvalidArguments): Handle
9585 __arglist parameters.
9586 (Invocation.VerifyArgumentsCompat): Likewise.
9587 * support.cs (ReflectionParameters.GetSignatureForError): Print
9588 __arglist parameters.
9589 (InternalParamters.GetSignatureForError): Likewise.
9590 * parameter.cs (Parameters.GetSignatureForError): Likewise.
9592 2005-10-26 Marek Safar <marek.safar@seznam.cz>
9594 * attribute.cs (GetPropertyValue): Made public.
9596 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
9598 Add new property WrapNonExceptionThrows to handle 2.0 assembly
9600 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
9603 * driver.cs: Reflect method name change.
9605 * statement.cs (Try.Resolve): Warn when try has both general
9608 * typemanager.cs: runtime_compatibility_attr_type new predefined
9611 2005-10-26 Raja R Harinath <harinath@gmail.com>
9614 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
9615 treat it as an empty parameter list.
9617 2005-10-26 Raja R Harinath <rharinath@novell.com>
9620 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
9621 ResolveAsTypeStep silent.
9622 * statement.cs (Block.AddConstant): Mark block as used.
9623 (Block.ResolveMeta): Avoid piling on error messages
9624 if a constant initializer resolution fails.
9626 2005-10-25 Raja R Harinath <rharinath@novell.com>
9628 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
9630 (NamespaceEntry.VerifyAllUsing): New.
9631 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
9632 behaviour. Delegates actual resolution of alias to ...
9633 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
9634 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
9636 * driver.cs (Driver.MainDriver): Update.
9638 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
9639 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
9641 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
9643 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
9644 RootNamespace.DefineNamespacesForAll.
9646 2005-10-24 Raja R Harinath <harinath@gmail.com>
9648 * typemanager.cs (assemblies, external_aliases, modules)
9649 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
9650 (ComputeNamespaces, GetRootNamespace): Remove extra staging
9651 overhead. Move resposibility ...
9652 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
9653 * driver.cs, attribute.cs, codegen.cs: Update to changes.
9655 2005-10-23 Raja R Harinath <harinath@gmail.com>
9657 * namespace.cs (RootNamespace.all_namespaces): Renamed from
9658 cached_namespaces. Improve usage.
9659 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
9660 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
9661 Move from GlobalRootNamespace and simplify.
9662 (RootNamespace.Global): Make instance variable.
9663 (RootNamespace.RootNamespace): Add "alias name" parameter.
9664 (GlobalRootNamespace): Simplify drastically.
9665 (Namespace.Lookup): Don't use GetNamespace.
9666 * typemanager.cs (GetRootNamespace): Rename from
9667 ComputeNamespaceForAlias.
9668 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
9670 2005-10-23 Marek Safar <marek.safar@seznam.cz>
9672 * anonymous.cs (AnonymousContainer): Don't crash when container
9675 2005-10-23 Marek Safar <marek.safar@seznam.cz>
9677 * expression.cs (Binary.DoResolve): Warn when comparing same
9680 2005-10-23 Marek Safar <marek.safar@seznam.cz>
9683 * expression.cs (Binary.DoResolve): It looks like there are no
9684 convetsion rules in enum context.
9686 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9688 Add support for extern alias qualifiers.
9689 * typemanager.cs: Move some LookupTypeReflection code
9690 to namespace.cs, to have cleaner code. Added some methods
9691 to help us keep track of the extern aliased references.
9692 * driver.cs: Add suport for extern alias assemblies on command
9693 line and check for their warnings/errors. Also keep track of the
9694 extern aliased assemblies.
9695 * namespace.cs: Move the global functionality of Namespace
9696 to GlobalRootNamespace/RootNamespace. Now the global namespace
9697 is GlobalRootNamespace.Globa. Also the code moved from
9698 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
9699 Finally added LocalAliasEntry (AliasEntry before) and
9700 ExternAliasEntry, to handle alias statements.
9701 * cs-parser.jay: Add support in the grammar for extern alias
9703 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
9704 Update callings to Namespace (now in GlobalRootNamespace).
9706 2005-10-18 Raja R Harinath <rharinath@novell.com>
9709 * class.cs (TypeContainer.DefineType): Move updating of
9710 topological sort earlier in the code.
9711 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
9713 2005-10-18 Marek Safar <marek.safar@seznam.cz>
9716 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
9718 * constant.cs (Constant.TryReduce): Moved from Cast class.
9719 (Reduce): Made little bit more OO and fixed missing conversions.
9721 * ecore.cs (Reduce): Implemented.
9722 (Binary.EnumLiftUp): New method to upgrade values to enum values.
9724 * literal.cs (Reduce): Implemented.
9726 * class.cs: Reverted Miguel's wrong commit.
9728 2005-10-14 Miguel de Icaza <miguel@novell.com>
9730 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
9732 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
9734 * cs-parser.jay, expression.cs : CS0214 was missing error location
9735 for constants. Fixed bug #76404.
9737 2005-10-11 Marek Safar <marek.safar@seznam.cz>
9740 * convert.cs (ExplicitConversionCore): Fixed object->enum
9743 2005-10-10 Raja R Harinath <rharinath@novell.com>
9745 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
9747 (PropertyExpr.EmitCall): Likewise.
9748 * expression.cs (Invocation.EmitArguments): Handle case where
9750 (Invocation.EmitCall): Avoid allocating temporary variable if
9751 there are no arguments.
9753 2005-10-07 Raja R Harinath <rharinath@novell.com>
9756 * convert.cs (ImplicitConversionStandard): Move conversion of
9757 void* to arbitrary pointer types ...
9758 (ExplicitConversionStandard): .. here.
9759 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
9760 error to always print typenames.
9762 2005-10-07 Raja R Harinath <rharinath@novell.com>
9764 * convert.cs (GetConversionOperator): Rename from
9765 GetConversionOperators. Move operator selection code from ...
9766 (UserDefinedConversion): ... here.
9768 2005-10-06 Marek Safar <marek.safar@seznam.cz>
9770 * convert.cs (ExplicitConversionCore): Removed duplicate enum
9773 2005-10-05 Marek Safar <marek.safar@seznam.cz>
9775 * assign.cs (Assign.DoResolve): Error method changed.
9777 * cfold.cs (DoConstantNumericPromotions): Error method changed.
9779 * const.cs (ResolveValue): Reset in_transit immediately.
9781 * constant.cs: Error method changed.
9783 * convert.cs: Removed useless location parameter.
9784 (ExplicitNumericConversion): Don't do double enum check.
9785 (ExplicitConversionCore): Renamed from ExplicitConversion.
9786 (ExplicitUnsafe): Extracted from ExplicitConversion.
9787 (ExplicitConversion): Uses for error reporting.
9789 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
9791 (ResolveBoolean): Uses common error method.
9792 (CastToDecimal): Get rid of ec.
9793 (CastFromDecimal): Optimized.
9794 (ConvCast): Get rid of ec.
9796 * enum.cs (ResolveValue): Reset in_transit immediately.
9797 (Emit): Return after first error.
9799 * expression.cs: Convert changes.
9801 * literal.cs: Error method changed.
9803 * statement.cs: Error method changed.
9805 2005-10-03 Raja R Harinath <rharinath@novell.com>
9807 * support.cs (SeekableStreamReader.Position): Don't error out when
9808 the requested position is just beyond the end of the current
9811 2005-09-28 Raja R Harinath <rharinath@novell.com>
9813 * support.cs (SeekableStreamReader): Simplify drastically. Don't
9814 try to keep in sync with the byte count of the underlying Stream.
9815 However, this limits us to a window size of 2048 characters: i.e.,
9816 the maximum lookahead of our lexer/parser can be 2048 characters.
9818 2005-09-28 Marek Safar <marek.safar@seznam.cz>
9821 * driver.cs: Fix compilation files with full root path.
9823 2005-09-25 Miguel de Icaza <miguel@novell.com>
9825 * report.cs (SymbolRelatedToPreviousError): Format the output so
9826 it does not use an open parenthesis that is never closed.
9828 * driver.cs: Follow coding guidelines
9830 2005-09-27 Marek Safar <marek.safar@seznam.cz>
9833 * const.cs (Const.ResolveValue): Check for assigning non-null
9834 value to reference type.
9836 2005-09-27 Marek Safar <marek.safar@seznam.cz>
9838 * anonymous.cs: Implemented ExprClassName.
9840 * assign.cs (Assign.DoResolve): Don't chrash when type is not
9843 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
9846 * class.cs (StaticClass.DefineContainerMembers): Report protected
9849 * codegen.cs: if(ed) PRODUCTION.
9851 * convert.cs (Error_CannotImplicitConversion): Better error
9854 * cs-parser.jay: More error checks.
9856 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
9858 * driver.cs (CSCParseOption): Enabled wrong option check.
9860 * ecore.cs (Expression.ExprClassName): Turned to property.
9861 (MemberExpr.CheckIntermediateModification): For checking boxed
9862 value types modification.
9864 * statement.cs (Fixed.Resolve): Expression type must be
9865 convertible to fixed type.
9866 (CollectionForeach.GetEnumeratorFilter,TryType):
9867 Small refactoring for easier error checking.
9869 2005-09-26 Marek Safar <marek.safar@seznam.cz>
9871 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
9874 * class.cs (GeneratedBaseInitializer): New class for customization
9875 compiler generated initializers.
9876 (MemberBase.DoDefine): Check Obsolete attribute here.
9877 (FieldMember.DoDefine): Ditto.
9879 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
9882 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
9883 (MemberCore.GetObsoleteAttribute): Removed argument.
9884 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
9885 (MemberCore.CheckObsoleteType): New helper.
9889 * statement.cs: Updates after MemberCore changes.
9891 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
9892 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
9894 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
9895 obsolete attribute for compiler construct.
9896 (As.DoResolve): Cache result.
9898 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
9900 2005-09-26 Raja R Harinath <rharinath@novell.com>
9903 * expression.cs (This.VerifyFixed): In a value type T, the type of
9904 'this' is T&, iow, 'this' is either an out or ref parameter. In a
9905 value type R, 'this' is treated as a value parameter.
9907 2005-09-22 Miguel de Icaza <miguel@novell.com>
9909 * statement.cs (Lock): Use the TemporaryVariable class instead of
9910 manually using local variables as those do not work when variables
9913 * ecore.cs: Moved the TemporaryVariable class from being a nested
9914 class inside Foreach to be a public class that can be employed in
9917 2005-09-19 Marek Safar <marek.safar@seznam.cz>
9919 * cs-parser.jay: interface_accessors replaced by
9920 accessor_declarations.
9922 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
9925 * statement.cs (GotoCase.Resolve): Convert null constant to
9927 (SwitchLabel.ResolveAndReduce): Ditto.
9928 (SwitchLabel.NullStringCase): Custom null stamp.
9929 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
9931 typemanager.cs (CSharpSignature): Don't skip first argument
9934 2005-09-18 Miguel de Icaza <miguel@novell.com>
9936 * driver.cs: Set InEmacs based on the environment variable EMACS.
9938 * location.cs (InEmacs): in this mode, do not report column
9939 location as it confuses Emacs.
9941 2005-09-16 Marek Safar <marek.safar@seznam.cz>
9943 * cfold.cs, constant.cs, convert.cs, ecore.cs,
9944 expression.cs, iterators.cs, literal.cs: Store constants and
9947 * class.cs (MemberBase.ShortName): Pass location.
9949 * cs-parser.jay: Some location fixes.
9951 * ecore.cs (Expression.Location): Made virtual.
9953 2005-09-05 Miguel de Icaza <miguel@novell.com>
9955 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
9956 if the underlying types are the same, otherwise we need to produce
9957 code that will do the proper cast.
9959 This was exposed by Marek's constant rewrite which produced
9960 invalid code for the call site:
9963 void Method (X v) {}
9967 This fixes test-49.cs
9969 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
9971 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
9972 Type/Object should be allowed as well. Fixed bug #75968.
9974 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
9976 * expression.cs : (Binary.DoResolve): when one is enum constant and
9977 another is constant 0, then return enum one *as enum type*.
9980 2005-09-02 Raja R Harinath <rharinath@novell.com>
9982 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
9986 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
9987 flow-branching for LocalVariableReferences in case we were invoked
9988 from a MemberAccess.
9989 * expression.cs (LocalVariableReference.VerifyAssigned): New.
9991 (LocalVariableReference.DoResolveBase): ... this.
9992 (MemberAccess.Resolve): Do the check that was disabled during
9995 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
9998 (PartialContainer.Create): check abstract/sealed/static strictly
9999 but abstract/sealed can exist only at one side. Fixed bug #75883.
10001 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
10004 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
10005 specified, don't default to UnmanagedType.I4.
10007 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
10009 * expression.cs : conditional operator should check possibly
10010 incorrect assign expression. Fixed bug #75946.
10012 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
10014 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
10015 Reverting the change. gmcs is much complex than mcs on this matter.
10017 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
10019 * cs-tokenizer.cs : To read another token ahead of the actual
10020 consumption, use new SavedToken and cache token instead of moving
10021 back the stream with SeekableStreamReader (it seemed problematic).
10023 driver.cs : Thus use StreamReader directly.
10024 * support.cs : Thus removed SeekableStreamReader.
10026 2005-08-30 Raja R Harinath <rharinath@novell.com>
10029 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
10030 (ScopeInfo.EmitScopeType): Use it to construct field names from
10031 names of captured locals.
10034 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
10035 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
10036 Pass 'target_type' to BoxedCast. Don't default to 'object'.
10037 (ExplicitConversion): Remove enum cases already handled by
10038 implicit conversion. Move implicit conversion check to the beginning.
10039 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
10040 * expression.cs (ArrayCreation.EmitDynamicInitializers):
10041 Don't treat System.Enum as a struct.
10043 2005-08-30 Jb Evain <jbevain@gmail.com>
10045 * attribute.cs: handles as expression in parameters.
10047 2005-08-30 Raja R Harinath <rharinath@novell.com>
10050 * class.cs (TypeContainer.VerifyClsName): Don't use a
10051 PartialContainer when verifying CLS compliance.
10052 (AbstractPropertyEventMethod): Set Parent here, ...
10053 (PropertyMethod): ... not here.
10055 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
10057 * attribute.cs : escaped attribute name should not be allowed to be
10058 resolved (e.g. @class as classAttribute). Fixed bug #75930.
10060 2005-08-29 Raja R Harinath <rharinath@novell.com>
10063 * convert.cs (ImplicitStandardConversionExists): Allow zero also
10064 when converting a long constant to unsigned long.
10065 * expression.cs (Invocation.OverloadResolve): Add sanity check to
10066 detect where IsApplicable and VerifyArgumentsCompat disagree.
10068 2005-08-29 Raja R Harinath <rharinath@novell.com>
10069 and Carlos Alberto Cortez <carlos@unixmexico.org>
10072 * class.cs (TypeContainer.CanElideInitializer): New helper.
10073 (TypeContainer.EmitFieldInitializers): Use it to determine if we
10074 can safely emitting the initializer of a field.
10076 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10078 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
10079 allowed inside a switch (without loop). Fixed bug #75433.
10081 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
10083 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
10084 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
10086 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10088 * driver.cs : kinda reverting the default encoding changes (not exact
10089 revert since I noticed that "codepage:reset" might not work fine).
10091 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10093 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
10094 Location. Now getter and setter store location correctly.
10095 (errors/cs0111-12.cs now reports the expected location.)
10097 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
10099 * driver.cs : Use default encoding on the environment.
10100 Removed (now that) extra parameter for SeekableStreamReader.
10101 * support.cs : (SeekableStreamReader) third .ctor() argument for
10102 StreamReader is not required (always true). preamble size could
10103 be acquired in simpler and safe way.
10105 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
10107 * cs-parser.jay: report CS0642 at warning level 3
10108 and report CS0642 for an if else statement also
10109 fixes bug #74745. Patch by John Luke (and a bit
10111 Removed extra CS0642 warning check for "while",
10113 * statement.cs: In Block.Resolve(), CS0642 check
10114 is reimplemented to check a sequence of an empty
10115 statement and a block.
10117 Both fix bug #66777.
10119 2005-08-24 Marek Safar <marek.safar@seznam.cz>
10121 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
10122 detection until I fix it.
10124 * cs-tokenizer.cs: Changed error message.
10126 * cs-parser.jay: Fixed 2 error locations.
10128 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
10129 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
10132 * enum.cs (GetSignatureForError): Fixed.
10134 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
10138 * typemanager.cs (RegisterProperty): Removed.
10140 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
10142 2005-08-24 Raja R Harinath <rharinath@novell.com>
10145 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
10146 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
10148 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10150 * expression.cs : tiny fix is required for not warning positive ulong.
10153 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10155 * expression.cs : add CS0652 check for constant and integral
10156 expression. Fixed bug #53974.
10158 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10160 * expression.cs : in DoNumericPromotions(), check if there is implicit
10161 conversion overload for string (to check CS0034). Fixed bug #52492.
10163 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10165 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
10167 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10169 * ecore.cs : report location when it is *not* Null.
10171 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
10177 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
10178 correctly. Fixed bug #75721.
10180 2005-08-23 Raja R Harinath <rharinath@novell.com>
10182 * support.cs (SeekableStreamReader.Position): Avoid an expensive
10183 loop that performs 'min (pos, char_count)'.
10186 * expression.cs (Unary.ResolveOperator): Don't discard implicit
10187 converted value in Operator.OnesComplement.
10189 2005-08-22 Ben Maurer <bmaurer@ximian.com>
10191 * anonymous.cs: If the anon method is pulled into a helper class,
10192 it needs to be `internal' not `private'. Fixes runtime behavior on
10195 2005-08-20 Martin Baulig <martin@ximian.com>
10197 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10198 scope if we don't already have it.
10200 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
10201 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
10204 2005-08-17 Marek Safar <marek.safar@seznam.cz>
10207 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
10208 is a partial class.
10210 2005-08-16 Marek Safar <marek.safar@seznam.cz>
10212 The big constants rewrite
10213 Fix #75746, #75685 and more
10214 As a side effect saved 1MB for MWF ;-)
10216 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
10217 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
10218 enum based for corlib compilation.
10220 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
10223 * class.cs (FixedField.Define): Use ResolveAsConstant.
10225 * const.cs (IConstant): Interface constants and enums.
10226 (Const.ResolveValue): New method for constant resolvning.
10227 (ExternalConstant): Constants from imported assemblies.
10229 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
10230 conversion; like enums.
10231 (Constant.ToType): Converts this constant to different type.
10232 (Constant.Increment): Adds 1.
10234 * convert.cs (ImplicitConversionRequired): Simplified.
10236 * cs-parser.jay: Create EnumMember directly.
10238 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
10240 * doc.cs (GenerateEnumDocComment): Removed.
10242 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
10243 (ConvertIntLiteral): Removed.
10244 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
10246 * enum.cs (EnumMember): Implement IConstant.
10247 (Enum.IsValidEnumConstant): Removed.
10248 (Enum.GetNextDefaultValue): Removed.
10249 (Enum.FindMembers): Updated.
10250 (Enum.GenerateDocComment): Iterate enum members.
10252 * expression.cs (Cast.TryReduce): Handle enums correctly.
10253 (New.Constantify): Made public.
10254 (MemberAccess.DoResolve): Removed contant specific if(s).
10256 * literal.cs (NullLiteral): Implement new abstract methods.
10258 * statement.cs (GotoCase.Resolve): Use new constant methods.
10259 (SwitchLabel.ResolveAndReduce): Use new constant methods.
10261 * typemanager.cs (LookupEnum): Removed.
10262 (IsEnumType): Fixed to work with corlib.
10263 (RegisterConstant): Removed.
10264 (LookupConstant): Removed.
10265 (GetConstant): Changed to work with IConstant.
10267 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
10269 * location.cs : Fixed overflown (>255) column number.
10271 2005-08-03 Raja R Harinath <rharinath@novell.com>
10273 First cut of the qualified-alias-member feature.
10274 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
10276 * cs-parser.jay (DOUBLE_COLON): New token.
10277 (namespace_or_type_name): Add rule for recognizing
10278 qualified-alias-members.
10279 (primary_expression): Likewise.
10280 (element_access): Allow QualifiedAliasMember as a possible
10281 type-bearing expression.
10282 (local_variable_type, local_variable_pointer_type): Likewise.
10283 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
10284 aliases in the current and enclosing namespace declarations.
10285 (NamespaceEntry.UsingAlias): Add CS0440 warning.
10286 * decl.cs (MemberName.is_double_colon): New.
10287 (MemberName.MemberName): Add new constructor for alias-member.
10288 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
10289 * expression.cs (QualifiedAliasMember): New expression type.
10291 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10293 * location.cs : it borked when no argument was specified.
10295 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10297 * location.cs : tiny ToString() format fix.
10299 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10301 * statement.cs : oops, it was missing.
10303 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10305 A set of fixes for precise line/column location.
10308 "token" field now holds a file/line "delta", a line number offset
10309 from the segment, and a column number. See also:
10310 http://lists.ximian.com/pipermail/mono-devel-list/2004-
10311 December/009508.html
10312 Removed static IsNull. Use instance IsNull property instead.
10313 * cs-tokenizer.cs :
10314 For some tokens it stores Location. For Identifier it stores
10315 LocatedToken which is a pair of string name and location.
10316 Column numbers are adjusted only at getChar().
10318 Use Location.ToString() for reporting (it now contains column).
10320 Largely modified to use LocatedToken instead of
10321 string (IDENTIFIER), and to acquire Location from some tokens.
10322 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
10323 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
10325 Now MemberName holds Location. DeclSpace.ctor() receives Location
10326 as a parameter. Removed extra parameters to all derived classes.
10327 Replaced Location.IsNull() with instance property.
10328 * assign.cs, expression.cs :
10329 Added .ctor() overload that omits Location.
10331 Added "nameEscaped" flag that indicates the identifier was escaped
10332 in the source file. This fixes bug #57047.
10334 2005-08-02 Marek Safar <marek.safar@seznam.cz>
10336 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
10337 New method, looking for lo-case imported cls type.
10339 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
10342 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10344 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
10346 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
10347 all_imported_types.
10348 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
10350 Optimized to save 3.5 MB for SWF compilation.
10352 2005-08-01 Marek Safar <marek.safar@seznam.cz>
10354 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
10355 (PartialContainer.Create): Moved logic AddToContainer.
10356 (PartialContainer.MarkForDuplicationCheck): Shares name.
10358 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
10361 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
10363 (Namespace.GetSignatureForError): New method.
10365 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
10366 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
10368 2005-08-01 Raja R Harinath <rharinath@novell.com>
10371 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
10372 member lookup rather than qualifier_type, since qualifier_type can
10375 2005-08-01 Marek Safar <marek.safar@seznam.cz>
10377 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
10380 2005-07-31 Miguel de Icaza <miguel@novell.com>
10382 * statement.cs: Copy the local exception into the exception
10383 captured local. Fixes 75674
10385 2005-07-31 Raja R Harinath <harinath@gmail.com>
10388 * expression.cs (Invocation.OverloadResolve): Don't report error
10389 CS1501 if error CS1502 has been reported.
10390 (New.DoResolve): Delegate CS1501 reporting to
10391 Invocation.OverloadResolve.
10394 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
10395 invariant-meaning-in-block property in an enclosing block if
10398 2005-07-29 Marek Safar <marek.safar@seznam.cz>
10400 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
10401 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
10402 (Switch.CheckSwitch): Just save 50kb for SWF.
10404 2005-07-27 Martin Baulig <martin@ximian.com>
10406 * anonymous.cs (CaptureContext.AddField): Added
10407 `AnonymousContainer am' argument; compute its toplevel scope if
10408 it's not already computed. Fixes #75649.
10410 2005-07-26 Raja R Harinath <rharinath@novell.com>
10413 * class.cs (Constructor.Emit): Reset block to null if the block
10416 2005-07-25 Marek Safar <marek.safar@seznam.cz>
10418 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
10420 2005-07-25 Marek Safar <marek.safar@seznam.cz>
10422 * class.cs (MethodData.Define): Check whether accessor implementing
10423 interface is public.
10425 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
10427 2005-07-22 Marek Safar <marek.safar@seznam.cz>
10430 * namespace.cs (LookupType): Moved same type check to...
10432 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
10433 with the same name.
10435 2005-07-21 Raja R Harinath <rharinath@novell.com>
10437 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
10438 already found a typebuilder.
10439 * class.cs (MethodCore.IsDuplicateImplementation): Compare
10440 MemberNames, not strings.
10442 * const.cs (Error_ExpressionMustBeConst):
10443 Rename from Error_EpressionMustBeConst.
10444 * const.cs, class.cs, statement.cd: Update.
10446 2005-07-21 Marek Safar <marek.safar@seznam.cz>
10450 * const.cs (Const.LookupConstantValue): Report missing contant expression
10452 (Error_EpressionMustBeConstant): Only one error method.
10454 * class.cs, statement.c: Updated.
10456 2005-07-20 Raja R Harinath <rharinath@novell.com>
10458 * statement.cs (Block.Flags): Add back HasVarargs.
10459 (Block.flags): Make protected.
10460 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
10462 * typemanager.cs (types, typecontainers, user_types): Remove.
10463 (UserTypes, TypeContainers): Likewise.
10464 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
10465 (CleanUp, Reset): Update.
10466 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
10467 (GetNestedType): Use Type.GetNestedType.
10468 (CoreLookupType): Take two arguments, the namespace and the
10469 basename of the type. Update to use the Namespace.Lookup
10471 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
10472 (RealMemberLookup): Use IsNestedChildOf instead of playing with
10473 string concatenation and substring matches.
10474 * class.cs, enum.cs, delegate.cs: Update to changes.
10476 2005-07-20 Marek Safar <marek.safar@seznam.cz>
10478 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
10479 Expression and made virtual.
10481 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
10482 (ImplicitStandardConversionExists): Fixed `byte' typo ?
10484 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
10486 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
10489 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
10492 2005-07-18 Marek Safar <marek.safar@seznam.cz>
10495 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
10496 AssemblyCultureAttribute is not used on executable.
10499 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
10501 2005-07-16 Raja R Harinath <rharinath@novell.com>
10504 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
10505 New. Reports CS0252/CS0253.
10506 Mostly taken from preliminary patch by Duncak Mak.
10507 (Binary.DoResolveOperator): Store results of operator lookup.
10508 Use them to detect if we need to warn about unintended reference
10511 2005-07-15 Raja R Harinath <rharinath@novell.com>
10514 * namespace.cs (Namespace.Lookup): Add back location parameter.
10515 (Namespace.LookupType): Add CS0436 report. Add location parameter.
10516 * delegate.cs, ecore.cs, expression.cs: Update to changes.
10518 * codegen.cs (EmitContext.DeclSpace): Make readonly.
10519 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
10520 (Namespace.LookupType): ... this.
10521 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
10523 * typemanager.cs (LookupTypeReflection): Remove buggy code that
10524 purported to handle pointers.
10525 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
10528 2005-07-15 Marek Safar <marek.safar@seznam.cz>
10530 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
10533 2005-07-15 Raja R Harinath <rharinath@novell.com>
10535 * namespace.cs (Namespace.Lookup): Drop location parameter.
10536 (NamespaceEntry.LookupAlias): Remove. Merge into ...
10537 (NamespaceEntry.Lookup): ... this.
10538 (NamespaceEntry.Error_AmbiguousTypeReference):
10539 Move here from DeclSpace.
10540 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
10542 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
10543 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
10544 Move to NamespaceEntry.
10545 * delegate.cs, expression.cs: Update to changes.
10547 2005-07-14 Marek Safar <marek.safar@seznam.cz>
10549 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
10550 CheckAttributeType and refactored.
10551 (Attribute.ResolvePossibleAttributeType): Changed to reuse
10552 ResolveAsTypeTerminal error handling.
10553 (ResolveAsTypeTerminal): Introduced because of global attributes extra
10555 (GetSignatureForError): Print errors in same way.
10558 * codegen.cs: Reflect attribute GetSignatureForError change.
10561 * expression.cs: Add silent parameter to ResolveAsTypeStep.
10563 * namespace.cs (UsingEntry): Refactored to make fields private.
10566 statement.cs: Error_UnexpectedKind has extra parameter.
10568 2005-07-14 Raja R Harinath <rharinath@novell.com>
10570 * ecore.cs (IAlias): Remove.
10571 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
10572 that implement the interface.
10573 * namespace.cs (Namespace): Likewise.
10574 (Namespace.declspaces): Renamed from 'defined_names'.
10575 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
10576 DeclSpace instead of an IAlias.
10577 * tree.cs (Tree.AddDecl): Update.
10579 2005-07-12 Raja R Harinath <rharinath@novell.com>
10581 * statement.cs (Block.Flags); Remove HasVarargs.
10582 (Block.HasVarargs): Move to ToplevelBlock.
10583 (Block.ThisVariable, Block.AddThisVariable): Likewise.
10584 (Block.Variables): Make protected. Initialize variable hashtable
10586 (Block.AddVariable): Update.
10587 (Block.Resolve): Update to changes.
10588 (ToplevelBlock.HasVarargs): New boolean.
10589 (ToplevelBlock.ThisVariable): Move here from Block.
10590 (ToplevelBlock.AddThisVariable): Likewise.
10591 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
10592 * expression.cs (This.ResolveBase): Update to changes.
10593 (ArglistAccess.DoResolve): Likewise.
10595 2005-07-11 Marek Safar <marek.safar@seznam.cz>
10598 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
10600 * class.cs (TypeContainer.VerifyMembers): Distinguish between
10601 not used and not used & assigned.
10602 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
10604 2005-07-11 Marek Safar <marek.safar@seznam.cz>
10607 * expression.cs (Is.DoResolve): null is never provided type.
10609 2005-07-08 Marek Safar <marek.safar@seznam.cz>
10612 * cs-parser.jay: Less strict event error rule to catch more errors.
10614 2005-07-08 Martin Baulig <martin@ximian.com>
10616 Fix test-iter-10.cs - distinguish whether we `yield' in a property
10617 gettter (allowed) or setter (not allowed).
10619 * class.cs (Accessor): Implement IIteratorContainer.
10620 (Accessor.Yields): New public field.
10621 (PropertyBase.PropertyMethod.Define): Handle iterators on a
10622 per-accessor basis.
10625 (get_accessor_declaration, set_accessor_declaration): Set the
10626 `yields' flag on the accessor, not the property.
10627 (property_declaration): Do the iterators check on a per-accessor
10628 basis and not for the whole property.
10630 2005-07-08 Martin Baulig <martin@ximian.com>
10632 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
10633 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
10635 2005-07-07 Marek Safar <marek.safar@seznam.cz>
10638 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
10639 (ExtractSecurityPermissionSet): Cope with self referencing security
10640 attributes properly.
10642 * driver.cs (SetOutputFile): Made public property OutputFile.
10644 2005-07-07 Raja R Harinath <rharinath@novell.com>
10647 * class.cs (TypeContainer.first_nonstatic_field): Rename from
10648 has_nonstatic_fields. Make into a FieldBase pointer.
10649 (TypeContainer.AddField): Add CS0282 check.
10650 (TypeContainer.EmitType): Update.
10652 2005-07-06 Miguel de Icaza <miguel@novell.com>
10654 * cs-tokenizer.cs (consume_identifier): Do not create strings to
10655 compare if they start with __.
10657 2005-07-06 Raja R Harinath <rharinath@novell.com>
10659 * statement.cs (Switch.SwitchGoverningType): Only look at
10660 UserCasts that don't need implicit standard conversions to one of
10661 the allowed switch types (Fixes test-322.cs).
10662 (LocalInfo.Resolve): Re-enable sanity-test.
10664 2005-07-06 Marek Safar <marek.safar@seznam.cz>
10666 * cs-tokenizer.cs (consume_identifier): Detect double undescores
10668 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
10670 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
10672 2005-07-06 Raja R Harinath <rharinath@novell.com>
10675 * ecore.cs (SimpleName.GetSignatureForError): Add.
10676 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
10677 (MemberAccess.GetSignatureForError): Add.
10679 2005-07-05 Marek Safar <marek.safar@seznam.cz>
10681 The big error and warning messages review.
10711 * typemanager.cs: Updated.
10713 * class.cs: (MethodCore.SetYields): Moved here to share.
10714 (PropertyMethod.Define): Moved iterator setup here.
10716 * iterators.cs: Add orig_method to have full access to parent
10719 2005-07-05 Raja R Harinath <rharinath@novell.com>
10721 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
10722 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
10723 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
10724 variable of struct type.
10725 * expression.cs (Unary.ResolveOperator): Update to change.
10726 (Indirection.VerifyFixed): Likewise.
10727 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
10728 (ParameterReference.VerifyFixed): Value parameters are fixed.
10729 (This.VerifyFixed): Treat 'this' as a value parameter.
10730 * statement.cs (LocalInfo.IsFixed): Remove.
10732 2005-07-01 Martin Baulig <martin@ximian.com>
10734 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
10735 `ec.EmitThis ()' to get the correct scope.
10737 2005-07-01 Martin Baulig <martin@ximian.com>
10739 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
10740 instance is a ParameterReference; fixes #75299.
10742 2005-07-01 Martin Baulig <martin@ximian.com>
10744 Reverted Marek's latest patch (r46725):
10745 - it contains structural changes which are neither mentioned in
10746 the ChangeLog nor explained anywhere; for example the additional
10747 argument of EmitContext's and Iterator's .ctor's and the
10748 TypeContainer.DefineMembers() change.
10749 - structural changes like this should go in in seperate patches
10750 and not be hidden in a huge patch which just seems to affect
10751 warnings and errors.
10752 a big and hard to understand patch.
10753 - it breaks iterators and causes regressions, for instance in
10756 2005-06-30 Raja R Harinath <rharinath@novell.com>
10759 * expression.cs (Indexers.map): Remove.
10760 (Indexers.Append): Filter out inaccessible setters and getters.
10761 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
10764 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
10765 Refactored from ...
10766 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
10767 (FieldExpr.Emit, PropertyExpr.Emit): Update.
10768 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
10769 * expression.cs (Invocation.EmitCall): Add CS0120 check.
10771 2005-06-30 Marek Safar <marek.safar@seznam.cz>
10774 * class.cs (FieldBase.GetInitializerExpression): One more field
10777 2005-06-28 Miguel de Icaza <miguel@novell.com>
10779 * pending.cs: Do not define a proxy if the base method is virtual,
10780 it will be picked up by the runtime (bug 75270).
10782 2005-06-08 Martin Baulig <martin@ximian.com>
10784 The big Iterators rewrite :-)
10786 * iterators.cs: Rewrite this to use the anonymous methods framework.
10788 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
10789 before the TypeContainers; see 2test-21.cs.
10792 (TypeContainer.DefineType): Don't create a new EmitContext if we
10793 already have one (this only happens if we're an Iterator).
10794 (TypeContainer.Define): Also call Define() on all our iterators.
10795 (Method.CreateEmitContext): Added support for iterators.
10798 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
10799 (AnonymousContainer.CreateMethodHost): Moved here from
10800 AnonymousMethod and made abstract.
10801 (AnonymousContainer.CreateScopeType): New abstract method.
10802 (AnonymousContainer.IsIterator): New public property.
10803 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
10804 get the ScopeTypeBuilder rather than manually defining it here.
10805 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
10808 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
10809 before RootContext.DefineTypes().
10811 * codegen.cs (EmitContext.RemapToProxy): Removed.
10812 (EmitContext.CurrentAnonymousMethod): Changed type from
10813 AnonymousMethod -> AnonymousContainer.
10814 (EmitContext.ResolveTopBlock): Protect from being called twice.
10815 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
10816 (EmitContext.EmitThis): Removed the iterators hacks; use the
10817 anonymous methods framework for that.
10820 (ToplevelBlock.Container): Make this a property, not a field.
10821 (ToplevelBlock.ReParent): New public method; move the
10822 ToplevelBlock into a new container.
10823 (Foreach.TemporaryVariable): Simplify.
10825 2005-06-05 Martin Baulig <martin@ximian.com>
10827 * statement.cs (LocalInfo.CompilerGenerated): New flag.
10828 (Block.AddTemporaryVariable): New public method; creates a new
10829 `LocalInfo' for a temporary variable.
10830 (Block.EmitMeta): Create the LocalBuilders for all the temporary
10832 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
10833 non-iterator variables.
10835 2005-06-05 Martin Baulig <martin@ximian.com>
10837 * statement.cs (Foreach.TemporaryVariable): Create the
10838 LocalBuilder in the Emit phase and not in Resolve since in some
10839 situations, we don't have an ILGenerator during Resolve; see
10840 2test-19.cs for an example.
10842 2005-06-04 Martin Baulig <martin@ximian.com>
10844 **** Merged r45395 from GCS ****
10846 The big Foreach rewrite - Part II.
10848 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
10849 with `PropertyInfo ienumerator_getcurrent'.
10851 * codegen.cs (VariableStorage): Removed.
10854 (Foreach): Derive from Statement, not ExceptionStatement.
10855 (Foreach.CollectionForeach): New nested class. Moved all the code
10856 dealing with collection foreach here.
10857 (Foreach.ForeachHelperMethods): Removed.
10858 (Foreach.TemporaryVariable): Implement IMemoryLocation.
10860 2005-05-23 Martin Baulig <martin@ximian.com>
10862 * statement.cs (Try.DoResolve): Don't create a `finally' if we
10863 don't need to. Fix #75014.
10865 2005-05-20 Martin Baulig <martin@ximian.com>
10867 Merged r44808 from GMCS.
10869 * class.cs (TypeContainer.CircularDepException): Removed.
10870 (TypeContainer.DefineType): Removed the `InTransit' stuff.
10871 (TypeContainer.CheckRecursiveDefinition): Check for circular class
10872 (CS0146) and interface (CS0529) dependencies here.
10874 2005-06-21 Raja R Harinath <rharinath@novell.com>
10876 * expression.cs (Invocation.EmitCall): Fix initialization
10877 'this_call' to reflect current behaviour. Fix indentation.
10879 * convert.cs (FindMostEncompassedType): Add two trivial special
10880 cases (number_of_types == 0 || number_of_types == 1).
10881 (FindMostEncompasingType): Likewise.
10883 2005-06-17 Raja R Harinath <rharinath@novell.com>
10885 Some cleanups preparing for the fix of #75283.
10886 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
10888 (EventExpr.InstanceResolve): Likewise.
10889 (EventExpr.DoResolve): Remove redundant checks.
10891 2005-06-10 Duncan Mak <duncan@novell.com>
10893 * cs-tokenizer.cs (process_directives): New flag for controlling
10894 the processing of preprocessor directives.
10895 (x_token): After seeing a '#', return Token.NONE instead of going
10896 to handle_preprocessing_directive() when not processing
10897 directives. This avoids unnecessary processing during the token peek in
10902 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
10903 the existing error reporting methods instead of Report.Error.
10905 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
10906 after Raja's rewrite.
10908 2005-06-08 Miguel de Icaza <miguel@novell.com>
10910 * class.cs: Small fix.
10912 2005-06-08 Raja R Harinath <rharinath@novell.com>
10915 * class.cs (GetPartialBases): Fix return value check of
10916 part.GetClassBases.
10918 2005-06-07 Raja R Harinath <rharinath@novell.com>
10920 Ensure that partial classes are registered in their enclosing
10921 namespace. Initial part of fix of #75160.
10922 * tree.cs (Tree.RecordDecl): Add new namespace argument.
10923 Register declspace with namespace here, not in
10924 DeclSpace.RecordDecl.
10925 * cs-parser.jay: Pass namespace to RecordDecl.
10926 * class.cs (PartialContainer.Create): Likewise.
10927 (ClassPart.DefineType): New sanity-check. Throws an exception if
10929 * decl.cs (Declspace.RecordDecl): Remove.
10930 * namespace.cs (NamespaceEntry.DefineName): Remove.
10932 2005-06-06 Marek Safar <marek.safar@seznam.cz>
10934 * rootcontext.cs: Reset TargetExt as well.
10936 2005-06-03 Raja R Harinath <rharinath@novell.com>
10938 * ecore.cs (Expression.Resolve): Emit CS0654 error when
10939 -langversion:ISO-1.
10941 2005-06-02 Raja R Harinath <rharinath@novell.com>
10943 Fix #75080, cs0119.cs.
10944 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
10946 (Expression.Resolve): ... this. Use it. Remove bogus code
10947 allowing ExprClass.Type and ExprClass.Namespace for
10948 ResolveFlags.VariableOrValue.
10949 (Expression.Resolve) [1-argument variant]: Change default resolve
10950 flags based on language version.
10951 (Expression.Error_UnexpectedKind): Use a simple string array
10952 rather than an ArrayList.
10953 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
10954 not ExprClass.Type.
10955 (TypeOfVoid.DoResolve): Likewise.
10956 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
10957 flags argument -- it always has the same value.
10959 2005-05-31 Raja R Harinath <rharinath@novell.com>
10962 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
10963 Use it in the error message.
10964 * assign.cs, expression.cs, statement.cs: Update.
10966 2005-05-30 Raja R Harinath <rharinath@novell.com>
10969 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
10970 the "almostMatchedMember" case too.
10971 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
10972 that failed the accessibility checks to 'almost_match'.
10974 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
10976 * attribute.cs: Use internal MethodBuilder methods to set
10977 ExactSpelling and SetLastError on PInvoke methods, instead
10978 of passing them via charset. Fixes #75060.
10980 2005-05-27 Raja R Harinath <rharinath@novell.com>
10982 * parameter.cs (Parameter): Remove TODO comment.
10983 (Parameter.DefineParameter): Remove Location parameter.
10984 (Parameters.LabelParameters): Likewise.
10985 * class.cs (Constructor.Emit): Update to change.
10986 (MethodData.Emit): Likewise.
10987 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
10988 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
10990 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
10993 Removed Parameters.Location and added Parameter.Location instead.
10994 Removed Location parameter from Emit() and GetSignature().
11001 Modified all related calls.
11003 2005-05-26 Raja R Harinath <rharinath@novell.com>
11005 Improve user-defined conversion handling.
11006 * convert.cs (GetConversionOperators): Rewrite. Return only the
11007 applicable operators.
11008 (AddConversionOperators): New. Helper for GetConversionOperators.
11009 (FindMostEncompassedType, FindMostEncompassingType): Verify that
11010 there is only one most encompassed/encompassing type.
11011 (FindMostSpecificSource, FindMostSpecificTarget): Remove
11012 "applicable operator" handling.
11013 (UserConversion): Move cache here from GetConversionOperators.
11014 Directly cache the chosen operator, rather than the whole
11016 (ExplicitNumericConversion): Fix buggy implementation of Decimal
11017 case. Allow conversion of decimal to sbyte and byte too.
11018 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
11019 New static methods. Used to avoid allocating EmptyExpressions in
11022 2005-05-24 Duncan Mak <duncan@novell.com>
11024 * ecore.cs (CastFromDecimal): New class for casting a decimal to
11025 another class, used in Convert.ExplicitNumericConversion.
11026 (CastToDecimal): New class, similar to above, but casts to
11027 System.Decimal, used in Convert.ImplicitNumericConversion and also
11028 in explicit convesion from double/float to decimal.
11030 * convert.cs (ImplicitNumericConversion): Handle implicit
11031 conversions to System.Decimal.
11032 (ExplicitNumericConversion): handle explicit conversions to
11037 2005-05-20 Miguel de Icaza <miguel@novell.com>
11039 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
11040 know the type at this stage, just break through. Fixes #75008
11042 2005-05-19 Martin Baulig <martin@ximian.com>
11045 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
11046 to disable error reporting.
11048 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
11049 here since we don't want to report an error; see the new test-336.cs.
11051 2005-05-19 Raja R Harinath <rharinath@novell.com>
11053 * statement.cs (ToplevelBlock.GetParameterReference)
11054 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
11055 Move here from class Block.
11056 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
11057 * expression.cs (ParameterReference.DoResolveBase): Likewise.
11059 2005-05-18 Martin Baulig <martin@ximian.com>
11064 (FlowBranching.Reachability): Add non-static public And() and Or()
11066 (FlowBranchingSwitch): New class; do the `break_origins' thing
11067 like in FlowBranchingLoop.
11068 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
11069 reachability, not just locals and parameters.
11070 (FlowBranching.MergeChild): Remove some of the hacks for loop and
11071 switch; MergeBreakOrigins() now takes care of that.
11073 2005-05-18 Martin Baulig <martin@ximian.com>
11075 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11076 a loop and may leave it, reset the barrier; fixes #74974.
11078 2005-05-17 Marek Safar <marek.safar@seznam.cz>
11080 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
11083 * cs-parser.jay: Catch more lexical errors.
11085 * report.cs: Add one more Error method.
11088 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
11090 2005-05-17 Martin Baulig <martin@ximian.com>
11092 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
11095 2005-05-16 Raja R Harinath <rharinath@novell.com>
11097 Fix test-382.cs. Emit values of decimal constants.
11098 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
11100 (TypeContainer.AddField): ... this.
11101 (TypeContainer.EmitFieldInitializers): Allow the list of fields
11102 with initializers to include 'Const's.
11103 (ClassPart.RegisterFieldForInitialization): Forward to
11105 * const.cs (Const.Const): Pass initializer to base class.
11106 (Const.Define): In case of decimal constants, register them for
11107 initialization in a static constructor.
11109 2005-05-14 Martin Baulig <martin@ximian.com>
11111 * statement.cs (Block.Resolve): Correctly handle unreachable code;
11112 do not call ResolveUnreachable() on unreachable statements in
11113 here, see the comment in the source code.
11115 2005-05-13 Raja R Harinath <rharinath@novell.com>
11118 * expression.cs (BinaryResolveOperator): If one of the operands of
11119 an equality comparison is 'null' and the other is a pointer type,
11120 convert the null to a NullPointer.
11121 * convert.cs (ImplicitReferenceConversion): If the expression is a
11122 NullLiteral and the target type is a pointer type, return a
11123 NullPointer instead.
11124 (ImplicitConversionStandard): Likewise.
11126 2005-05-13 Marek Safar <marek.safar@seznam.cz>
11128 * cs-parser.jay: Set readonly context based on special constructs.
11130 * expression.cs (LocalVariableReference.DoResolveBase): Improved
11131 readonly variable error handling.
11133 * rootcontext.cs (EmitCode): Don't verify members when error
11136 * statement.cs (LocalInfo): Add reaodnly context information.
11137 (SetReadOnlyContext, GetReadOnlyContext): New methods.
11139 2005-05-13 Raja R Harinath <rharinath@novell.com>
11141 * statement.cs (Block.Resolve): Revert change below. Modify fix
11142 for #74041 to initialize 'resolved' to false only for explicit
11143 blocks. Fixes #74873.
11145 2005-05-12 Raja R Harinath <harinath@gmail.com>
11148 * typemanager.cs (unmanaged_enclosing_types): New.
11149 (IsUnmanagedType): Avoid infloops by using
11150 'unmanaged_enclosing_types' to talk with recursive invocations.
11152 2005-05-13 Martin Baulig <martin@ximian.com>
11154 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
11155 instance variable, not a local. Fix #74873.
11156 (Block.ResolveUnreachable): Set it to true here.
11158 2005-05-11 Duncan Mak <duncan@novell.com>
11160 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
11161 continuing to process for 'arg'.
11162 (handle_preprocessing_directive): Check the argument of the #endif
11163 directive and report error CS1025 if there are any trailing
11166 According to the C# spec, having even whitespace after the #endif
11167 directive is illegal; however, because we call arg.TrimEnd ()
11168 beforehand, we have the same behavior as csc, allowing whitespace
11169 after the directive.
11173 2005-05-11 Marek Safar <marek.safar@seznam.cz>
11177 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
11178 (Constructor.GetObsoleteAttribute): Implemented correctly.
11180 2005-05-10 Martin Baulig <martin@ximian.com>
11182 * support.cs (ReflectionParameters.ParameterModifier): Use
11183 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
11184 and `ParameterAttributes.In'. Fixes #74884.
11186 2005-05-10 Marek Safar <marek.safar@seznam.cz>
11188 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
11190 * expression.cs (Argument.GetParameterModifier): Turned to property.
11191 (Invocation.Error_InvalidArguments): Add more descriptive errors.
11193 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
11196 2005-05-09 Raja R Harinath <rharinath@novell.com>
11199 * decl.cs (MemberCache.AddMethods): Register override methods,
11200 rather than non-override methods.
11201 * typemanager.cs (RegisterOverride): New.
11202 (IsOverride): Update.
11204 2005-05-09 Marek Safar <marek.safar@seznam.cz>
11208 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
11209 recursive declaration.
11211 * statement.cs (Block.ResolveMeta): Report any error in resolving.
11213 2005-05-06 Marek Safar <marek.safar@seznam.cz>
11215 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
11217 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
11219 2005-05-05 Raja R Harinath <rharinath@novell.com>
11222 * decl.cs (DeclSpace.FamilyAccessible):
11223 Use TypeManager.IsNestedFamilyAccessible.
11225 Fix reopened #64812.
11226 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
11229 2005-05-04 Raja R Harinath <rharinath@novell.com>
11230 Abin Thomas <projectmonokochi@rediffmail.com>
11231 Anoob V E <projectmonokochi@rediffmail.com>
11232 Harilal P R <projectmonokochi@rediffmail.com>
11235 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
11236 allow access to all static members.
11238 2005-05-04 Martin Baulig <martin@ximian.com>
11240 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
11242 2005-05-04 Martin Baulig <martin@ximian.com>
11246 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
11247 section at the end; make things work if `default' is not the last
11250 2005-05-04 Martin Baulig <martin@ximian.com>
11254 * statement.cs (Switch): Replaced the `got_default' field with a
11255 `default_section' one.
11256 (Switch.CheckSwitch): Set `default_section' here.
11257 (Switch.Resolve): If we're a constant switch and the constant is
11258 not found, use the default section.
11260 2005-05-03 Martin Baulig <martin@ximian.com>
11262 * expression.cs (ArrayAccess.EmitGetLength): New public method.
11264 * statement.cs (Foreach.ArrayForeach): New nested class.
11265 (Foreach.TemporaryVariable): New nested class.
11266 (Foreach.EmitArrayForeach): Removed; this is now in the new
11267 ArrayForeach class.
11269 2005-05-03 Raja R Harinath <rharinath@novell.com>
11271 * pending.cs (BaseImplements): Move the #74773 fix here. This is
11273 (VerifyPendingMethods): Revert change below.
11275 * typemanager.cs (IsOverride, RegisterNonOverride): New.
11276 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
11277 that used to trigger warning -28. Remove warning -28.
11278 * expression.cs (Invocation.OverloadResolve): Use
11279 TypeManager.IsOverride to distinguish override methods.
11282 * pending.cs (VerifyPendingMethods): If a base type implements the
11283 requested interface, don't bother checking individual methods of
11284 the base type. As a side-effect, this prevents the creation of
11285 unnecessary proxies.
11287 2005-05-02 Martin Baulig <martin@ximian.com>
11291 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11292 Also `And' the locals if the old vector is null.
11293 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
11294 null; in this case we basically reset all the variables.
11296 2005-05-02 Martin Baulig <martin@ximian.com>
11300 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
11301 Added `FlowBranching branching' argument; always `and' the
11302 variables instead of `or'ing them unless we're an infinite loop.
11304 * statement.cs (While.Resolve): Create a new sibling unless we're
11307 2005-05-02 Martin Baulig <martin@ximian.com>
11311 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
11312 arguments; use it instead of creating a new TopLevelBlock.
11313 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
11314 our ConstructorInitializer.
11317 (TopLevelBlock.TopLevelBranching): New public property.
11318 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
11319 and create our `TopLevelBranching'.
11321 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
11322 anonymous method host, use `block.TopLevelBranching' rather than
11323 creating a new branching.
11325 2005-04-20 Miguel de Icaza <miguel@novell.com>
11327 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
11328 a ScopeInfo, if any of the current children is a child of the new
11329 entry, move those children there.
11331 2005-04-30 Martin Baulig <martin@ximian.com>
11333 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
11334 at the beginning of a SwitchSection. Fix #73335.
11336 2005-04-27 Marek Safar <marek.safar@seznam.cz>
11339 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
11341 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
11342 (FieldExpr.DoResolve): Obsolete members are ignored for field
11345 2005-04-26 Marek Safar <marek.safar@seznam.cz>
11347 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
11348 of arrays detection.
11350 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
11352 (Field.VerifyClsCompliance): Volatile fields are not compliant.
11354 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
11357 2005-04-25 Ben Maurer <bmaurer@ximian.com>
11359 * cs-parser.jay: Use the prefered version of -unsafe in error
11362 2005-04-22 Marek Safar <marek.safar@seznam.cz>
11364 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
11367 2005-04-20 John Luke <john.luke@gmail.com>
11369 * driver.cs: fix typo in error message, --outout to --output
11371 2005-04-20 Marek Safar <marek.safar@seznam.cz>
11373 * codegen.cs (InRefOutArgumentResolving): New field.
11375 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
11376 fields outside contructor.
11378 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
11380 2005-04-19 Miguel de Icaza <miguel@novell.com>
11382 * anonymous.cs (CaptureContext.EmitParameterInstance): The
11383 parameter code was not completed ever, so it was not as up-to-date
11384 as local variables. Must finish it.
11386 The bug fix was to compare the Toplevel of the block, not the
11387 current block. Thanks for Ben for pointing this out.
11389 2005-04-19 Raja R Harinath <rharinath@novell.com>
11391 * decl.cs (AddMethods): Use the declaring type of the problem
11392 method to determine if we want to squash a warning.
11394 2005-04-19 Marek Safar <marek.safar@seznam.cz>
11396 * attribute.cs: Removed debug output.
11398 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
11400 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
11403 2005-04-18 Raja R Harinath <rharinath@novell.com>
11406 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
11407 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
11408 all null comparisons against reference types.
11410 2005-04-18 Marek Safar <marek.safar@seznam.cz>
11413 * class.cs (TypeContainer.CircularDepException) New nested
11415 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
11416 (TypeContainer.DefineType): Removed error, reset InTransit before
11418 (Class.DefineType): Throw exception when is in Transit.
11419 Catch exception and report error.
11420 (Struct.DefineType): Throw exception when is in Transit.
11421 Catch exception and report error.
11422 (Interface.DefineType): Throw exception when is in Transit.
11423 Catch exception and report error.
11425 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
11426 handle nested exception handlers.
11428 * flowanalysis.cs (InTryWithCatch): New method, search for try with
11431 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
11432 InFinally and InCatch storage.
11434 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
11435 (Catch.Resolve): Set and Restore ec.InCatch.
11436 (Try.Resolve): Set and Restore ec.InFinally.
11437 (Try.HasCatch): True when try has catch.
11439 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
11441 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
11442 for the same event member, so exclude such cases from warning 419.
11445 2005-04-16 Miguel de Icaza <miguel@novell.com>
11447 * expression.cs (Binary.ResolveOperator): Apply patch from John
11448 Luke to fix bug 59864: operators &, | and ^ on enumerations
11449 require that the same enum type on both sides.
11451 * driver.cs: Add warnings to old flag usage, this is to assist
11452 people who produce Makefiles and hope that the Makefiles will be
11455 * class.cs (TypeContainer.EmitType): Moved the definition of the
11456 special $PRIVATE$ field from the resolve phase to the Emit phase.
11457 During resolve we do not know if we are a struct with
11458 HasExplicitLayout, we know this only after the attributes for the
11461 Set the FieldOffset to zero on the dummy field that we create for
11462 the class. Fixes 74590.
11464 2005-04-16 Raja R Harinath <rharinath@novell.com>
11467 * ecore.cs (PropertyExpr.resolved): New.
11468 (DoResolve): Use it to handle a case of double resolution here.
11469 Handle a case of identical-name-and-type-name.
11470 * expression.cs (ArrayCreation.CheckIndices): Avoid double
11471 resolution by storing the results of expression resolution back
11472 into the "probes" array.
11474 2005-04-15 Raja R Harinath <rharinath@novell.com>
11476 Fix cs0208-7.cs and cs0208-8.cs.
11477 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
11478 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
11479 error reporting to point out the reason a struct is not unmanaged.
11481 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11483 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
11484 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
11486 2005-04-13 Raja R Harinath <rharinath@novell.com>
11489 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
11490 IdenticalNameAndTypeName here.
11491 (EventExpr.InstanceResolve): Likewise.
11493 2005-04-13 Marek Safar <marek.safar@seznam.cz>
11495 C# 2.0 DefaultCharSetAttribute implementation
11497 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
11498 which allows us to set GlobalNamespace for every resolve.
11499 (Attribute.ResolveArguments): Cut from Resolve.
11500 (Attribute.GetCharSetValue): Returns CharSet named argument.
11501 (Attribute.DefinePInvokeMethod): Gets default charset from
11503 (GlobalAttribute.ResolveAsTypeStep): Override.
11504 (GlobalAttribute.ResolveArguments): Override.
11506 * class.cs (TypeAttr): Is protected.
11508 * codegen.cs (ModuleClass.DefaultCharSet): New member.
11509 (ModuleClass.DefaultCharSetType): New memeber.
11510 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
11512 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
11513 charset from module.
11515 * delegate.cs (TypeAttr): Override.
11516 (Delegate.DefineType): Use this TypeAttr.
11518 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
11519 at very early stage (before types are defined) to resolve model
11520 module attributes. It will probably not work with corlib but it
11523 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
11524 charset from module.
11526 * typemanager.cs (default_charset_type): New type.
11528 2005-04-13 Raja R Harinath <rharinath@novell.com>
11530 * decl.cs (MemberCache.AddMethods): Don't warn if
11531 System.Object.Finalize has buggy MethodAttributes.
11533 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
11536 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11538 * doc.cs : detect ambiguous reference to overloaded members.
11539 Fixed bug #71603. MS 1.1 csc does not detect it.
11541 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11543 * doc.cs : delegates must not be referenced with parameters.
11546 2005-04-12 Miguel de Icaza <miguel@novell.com>
11548 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
11550 2005-04-10 Miguel de Icaza <miguel@novell.com>
11552 * driver.cs (MainDriver): Stop processing if the CLS stage found
11555 (CompilerCallableEntryPoint.InvokeCompiler): Always
11556 reset after execution; Take a TextWriter argument for the
11559 * report.cs: Use the error stream instead of hardcoding stderr.
11561 2005-04-09 Miguel de Icaza <miguel@novell.com>
11563 * class.cs: Reduce code paths to test, too small of an
11564 optimization to make it worth the extra testing. Always perform
11567 2005-04-08 Raja R Harinath <rharinath@novell.com>
11570 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
11571 operators that had errors reported on them.
11573 2005-04-08 Marek Safar <marek.safar@seznam.cz>
11575 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
11577 (Attribute.Resolve): Add named argument type checking.
11579 * class.cs (FixedField.Define): Use IsPrimitiveType
11581 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
11583 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
11584 unsafe parameter types.
11586 * statement.cs (Using.ResolveExpression): Add better error description.
11588 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
11590 2005-04-08 Raja R Harinath <rharinath@novell.com>
11593 * attribute.cs (Attribute.GetAttributeUsage): Resolve
11594 AttributeUsageAttribute in the emitcontext of the attribute class,
11595 not in the emitcontext of the attributable entity it was attached to.
11596 * cs-parser.jay: Use 'current_class', not 'current_container',
11597 when creating a GlobalAttribute.
11599 2005-04-08 Alp Toker <alp@atoker.com>
11601 * pending.cs: The fix to #58413 failed to compile methods implementing
11602 interfaces with/without params modifiers and vice versa, even though
11603 params modifiers aren't part of the signature. Make the modifier check
11604 less strict as in csc.
11606 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
11607 Anoob V E <projectmonokochi@rediffmail.com>
11608 Harilal P R <projectmonokochi@rediffmail.com>
11611 * pending.cs (TypeAndMethods.mods): New. Store the parameter
11612 modifiers of pending methods.
11613 (PendingImplementation.PendingImplementation): Initialize it.
11614 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
11615 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
11616 with ParameterData. Add check for modifiers.
11617 * class.cs (MethodData.Define): Update to changes.
11619 2005-04-07 Raja R Harinath <rharinath@novell.com>
11621 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
11623 2005-04-07 Marek Safar <marek.safar@seznam.cz>
11625 * class.cs (PropertyMethod.Define): Check private accessor in abstract
11628 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
11631 * typemanager.cs: Registered RequiredAttributeAttribute.
11633 2005-04-06 Marek Safar <marek.safar@seznam.cz>
11635 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
11636 Warning CS0169 is back at level 3.
11637 (IMethodData.SetMemberIsUsed): New method.
11639 * decl.cs (IsUsed): New value; moved from FieldBase.Status
11640 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
11642 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
11644 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
11646 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
11649 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
11652 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
11653 to avoid the problems with nested types.
11655 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
11656 Anoob V.E <projectmonokochi@rediffmail.com>
11657 Harilal P.R <projectmonokochi@rediffmail.com>
11658 Raja R Harinath <rharinath@novell.com>
11661 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
11663 * typemanager (GetConstructor): Make public.
11665 2005-04-05 John Luke <john.luke@gmail.com>
11666 Raja R Harinath <rharinath@novell.com>
11669 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
11670 struct too. Return false quicker in a few cases.
11671 (VerifyUnManaged): Use it.
11673 2005-04-05 Raja R Harinath <rharinath@novell.com>
11676 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
11677 not 'unreachable_seen'.
11679 2005-04-04 Marek Safar <marek.safar@seznam.cz>
11681 * attribute.cs (Attribute.GetValue): Removed unused.
11683 * codegen.cs (CodeGen.TrimExt): Removed unused.
11685 * cs-parser.jay (output): Removed unused.
11687 * cs-tokenizer.cs (hex_digits): Removed unused.
11689 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
11691 * expression.cs (Indirection.LoadExprValue): Removed unused.
11692 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
11694 * iterators.cs (Iterator.param_types): Removed unused.
11696 * statement.cs (Goto.block): Removed unused.
11697 (ToplevelBlock.did): Removed unused.
11698 (Switch.ResolveConstantSwitch): Removed unused.
11700 2005-04-01 Ben Maurer <bmaurer@ximian.com>
11702 * rootcontext.cs: Allow mcs to bootstrap with the compilation
11705 2005-04-01 Raja R Harinath <rharinath@novell.com>
11707 Fix #74232 and cs0208-3.cs.
11708 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
11709 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
11710 unmanaged type. Don't use FieldBuilders when 't' is a
11711 TypeBuilder. Use ModFlags and MemberType fields.
11712 * class.cs (MemberBase.member_type): Rename from MemberType.
11713 (MemberBase.MemberType): New property. Determines member_type on
11715 (MemberBase.DoDefine): Don't initialize MemberType here.
11716 (FieldMember.Define): Likewise.
11718 2005-04-01 Marek Safar <marek.safar@seznam.cz>
11721 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
11722 Attributes are emitted there.
11724 2005-04-01 Raja R Harinath <rharinath@novell.com>
11726 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
11727 keyword in 'partial enum' too.
11728 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
11730 Report from Kamil Skalski <nazgul@omega.pl>.
11733 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
11734 have partial containers too.
11736 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
11737 in block' checks to Block.CheckInvariantMeaningInBlock.
11738 * statement.cs (Block.GetKnownVariableInfo): Make private.
11739 (Block.IsVariableUsedInChildBlock): Remove.
11740 (Block.IsVariableUsedInBlock): Likewise.
11741 (Block.CheckInvariantMeaningInBlock): New. Show location of
11742 conflicting declaration.
11743 (Block.AddVariable): Make error messages less long-winded and more
11744 specific. Show location of conflicting declaration.
11745 * parameter.cs (Parameters.Location): New readonly property.
11747 2005-03-31 Raja R Harinath <rharinath@novell.com>
11749 Clean up semantics of invoking ResolveMemberAccess.
11750 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
11751 can have an instance, ensure that we pass in a non-TypeExpression
11752 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
11753 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
11754 argument. Update to changes and simplify.
11755 (FieldExpr.Emitinstance): Remove CS0120 check.
11756 (PropertyExpr.EmitInstance): Likewise.
11757 * expression.cs (Argument.Resolve): Likewise.
11758 (Invocation.DoResolve): Update to changes in semantics of
11759 InstanceExpression.
11761 2005-03-31 Marek Safar <marek.safar@seznam.cz>
11764 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
11767 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
11769 2005-03-31 Raja R Harinath <rharinath@novell.com>
11771 Fix difference in behaviour with commandline invocation.
11772 * driver.cs (Driver.Reset): New.
11773 (CompilerCallableEntryPoint): Call it.
11775 * statement.cs (If.Resolve): Avoid spurious "uninitialized
11776 variable" warnings if the boolean expression failed to resolve.
11778 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
11780 * attribute.cs: Fix the union of several permissions when some of them
11781 are unrestricted (so the result isn't an unrestricted permission set).
11784 2005-03-30 Raja R Harinath <rharinath@novell.com>
11786 * ecore.cs (MemberExpr): New class. Convert from interface
11788 (MemberExpr.ResolveMemberAccess): Refactor and move here from
11789 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
11791 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
11792 (MethodGroupExpr.IsExplicitImpl): Remove.
11793 (Expression.GetFieldFromEvent): Remove.
11794 (SimpleName.MemberStaticCheck): Remove.
11795 (SimpleName.DoSimpleNameResolve): Update to changes.
11796 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
11797 (MemberAccess.IdenticalNameAndTypeName): Remove.
11798 (MemberAccess.error176): Move to MemberExpr.
11799 (MemberAccess.DoResolve): Update to changes.
11800 (BaseAccess.DoResolve): Likewise.
11802 2005-03-30 Marek Safar <marek.safar@seznam.cz>
11804 C# 2.0 Conditional attribute class implementation
11806 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
11807 Analyzes class whether it has attribute which has ConditionalAttribute
11808 and its condition is not defined.
11810 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
11811 (Class.IsExcluded): New method. Search for at least one defined
11812 condition in ConditionalAttribute of attribute class.
11814 2005-03-30 Raja R Harinath <rharinath@novell.com>
11816 * ecore.cs (PropertyExpr): Derive from Expression, not
11817 ExpressionStatement.
11818 (PropertyExpr.EmitStatement): Remove.
11820 2005-03-29 Raja R Harinath <rharinath@novell.com>
11823 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
11824 internal field "value__" of an enum be private. The examples for
11825 "value__" that I found on MSDN all used FieldAttributes.Private.
11827 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
11828 Don't mention IL method attribute names.
11830 Fix #47991. Remove a TODO.
11831 * statement.cs (Block.Toplevel): Make into a field.
11832 (Block.Parameters): Move into ToplevelBlock.
11833 (Block.known_variables): Rename from child_variable_names.
11834 (Block.Block): Remove variants that take Parameters. Initialize
11835 'Toplevel' with the immediately surrounding toplevel block.
11836 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
11837 LocalInfo parameter.
11838 (Block.GetKnownVariableInfo): New.
11839 (Block.IsVariableNameUsedInChildBlock): Update.
11840 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
11841 the block, even though it may not be in scope.
11842 (Block.AddVariable): Remove Parameters parameter. Use
11843 Toplevel.Parameters instead.
11844 (Block.AddConstant): Remove Parameters parameter.
11845 (Block.GetParameterReference): Update to use Toplevel.Parameters.
11846 (Block.IsParamaterReference): Likewise.
11847 (Block.IsLocalParameter): Likewise. Simplify a lot.
11848 (ToplevelBlock.Parameters): New. Moved from Block.
11849 (ToplevelBlock.ToplevelBlock): Update to changes. Always
11850 initialize Parameters to a non-null value.
11851 * cs-parser.jay: Update to changes.
11852 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
11853 simple names that mean different things in the same block. Use
11854 Block.IsVariableNameUsedInBlock.
11856 2005-03-28 Raja R Harinath <rharinath@novell.com>
11858 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
11859 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
11860 GetTypeHandle. It is possible for a reflected type to derive from
11861 a TypeBuilder (e.g., int[] derives from the TypeBuilder
11862 System.Array during mscorlib compilation).
11863 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
11864 contain a method_hash, don't create one either. Don't create a
11865 deep copy of the base cache's method_hash.
11866 (MemberCache.SetupCache): Rename back from DeepCopy.
11867 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
11868 already initialized. If we see an override function, add its
11869 underlying base virtual function to the member_hash too.
11871 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
11873 2005-03-26 Raja R Harinath <harinath@acm.org>
11876 * assign.cs (Assign.DoResolve): When the RHS of an assignment
11877 fails to resolve, ensure that the LHS is still resolved as an
11880 2005-03-25 Raja R Harinath <harinath@acm.org>
11882 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
11884 (Enum.current_ec): Remove.
11885 (Enum.LookupEnumValue): Remove EmitContext argument.
11886 Just uses the one created during DefineType.
11887 (Enum.FindMembers): Update.
11888 * expression.cs (MemberAccess.DoResolve): Update.
11890 2005-03-22 Marek Safar <marek.safar@seznam.cz>
11892 * assign.cs (Assign.DoResolve): Check for CS1717 when
11893 source and target are same (uses Equals).
11895 * expression.cs (LocalVariableReference, ParameterReference,
11896 This): Implemented Equals, GetHashCode.
11898 * statement.cs (Block.GetParameterReference): Removed useless
11901 2005-03-22 Raja R Harinath <rharinath@novell.com>
11904 * statement.cs (Block.AddVariable): Ensure that we skip implicit
11905 blocks before deciding whether the error is cs0136 or cs0128.
11907 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
11908 (using_alias_directive, using_namespace_directive): Pass
11909 MemberName, not an expression to Namespace.UsingAlias and
11911 (MakeName): Use the MemberName of the namespace.
11912 * namespace.cs (Namespace.MemberName): New.
11913 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
11914 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
11916 * decl.cs (MemberName.Name): Make readonly.
11917 (MemberName.FromDotted): New "constructor".
11918 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
11919 (MemberCore.Name): Compute from MemberName on demand.
11920 (MemberCore.SetMemberName): Provide a way to change the
11922 (MemberCore.AddToContainer): Don't take a fullname parameter.
11923 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
11924 fully qualified name of the container to the member name.
11925 (TypeContainer.AddToTypeContainer): Use a fully qualified name
11926 only if the type is a member of the root container.
11927 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
11928 MemberName.Left rather than searching for an embedded ".".
11929 (PartialContainer.CreatePart): Update to changes in RootContext.
11930 (MemberBase.ShortName): Turn into a property. Use
11931 MemberCore.SetMemberName.
11932 (MemberBase.ExplicitInterfaceName): Remove.
11933 (MemberBase.UpdateMemberName): Remove.
11934 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
11935 (PropertyBase.SetMemberName): New override.
11936 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
11937 (Tree.GetDecl): New.
11938 (Tree.AllDecls): Rename from Decls.
11939 * attribute.cs, enum.cs, report.cs: Update to changes.
11940 * driver.cs (MainDriver): Use MemberName.FromDotted on
11941 RootContext.MainClass.
11943 2005-03-21 Marek Safar <marek.safar@seznam.cz>
11945 * class.cs (FixedField.Define): Check for CS1664 and more sanity
11948 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
11950 2005-03-18 Marek Safar <marek.safar@seznam.cz>
11952 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
11953 property accessor modifiers.
11955 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
11956 fixed buffer attribute (CS1716).
11957 (PropertyMethod.HasCustomAccessModifier): When property accessor
11958 has custom modifier.
11960 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
11962 (PropertyExpr.DoResolveLValue): Add CS0272.
11964 2005-03-17 Miguel de Icaza <miguel@novell.com>
11966 * convert.cs: When converting to a pointer, use the proper Conv.U
11967 or Conv.I depending on the source data type.
11969 * cs-tokenizer.cs: Make the size for large decimal constants,
11972 2005-03-17 Martin Baulig <martin@ximian.com>
11974 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
11975 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
11977 2005-03-17 Martin Baulig <martin@ximian.com>
11979 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
11980 to bool so we can return an error condition.
11981 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
11984 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
11986 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
11989 2005-03-16 Raja R Harinath <rharinath@novell.com>
11991 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
11992 Refactor to avoid traversing the list of assemblies, and to avoid
11993 string concatenation.
11994 * typemanager.cs (guid_attr_type): Remove.
11995 (negative_hits, pointers, references): Remove hashes.
11997 (GetConstructedType): New. Uses type_hash to handle constructed
11998 types (arrays, references, pointers).
11999 (GetReferenceType, GetPointerType): Use it.
12000 (GetNestedType): New. Uses type_hash to handle nested types of
12002 (LookupType, LookupTypeDirect): Remove.
12003 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
12004 'types' hash and LookupTypeReflection directly.
12005 (params_string, params_object): Use GetConstructedType.
12006 * namespace.cs (Namespace.cached_types): New. Cache of reflected
12008 (Namespace.Lookup): Use cached_types.
12009 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
12010 provided by old TypeManager.LookupType.
12011 * rootcontext.cs (MakeFQN): Remove.
12012 * decl.cs (DeclSpace.MakeFQN): Likewise.
12013 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
12014 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12015 TypeManager.GetConstructedType.
12016 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
12018 2005-03-15 Marek Safar <marek.safar@seznam.cz>
12020 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
12023 * cs-parser.jay: Reports CS1527 for any namespace element.
12025 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
12028 * expression.cs (ParameterReference.IsAssigned): Changed error to
12030 (Error_WrongNumArguments): Moved CS0245 detection here.
12032 * statement.cs (Return.Resolve): Add CS1622 report.
12034 2005-03-11 Marek Safar <marek.safar@seznam.cz>
12036 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
12038 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
12040 * attribute.cs expression.cs: Get rid of some allocations.
12042 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
12044 * doc.cs : just eliminate the latest change.
12046 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12048 * doc.cs : commented out the latest change. It breaks xml-030.cs
12050 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12052 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
12053 fail. So invoke CreateType() in FindDocumentedType().
12055 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
12057 * cs-tokenizer.cs : added IsKeyword().
12058 * doc.cs : Detect keyword incorrectly used as identifier.
12059 Allow identifiers prefixed by @.
12061 2005-03-10 Marek Safar <marek.safar@seznam.cz>
12063 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
12064 It caused exception in namespace resolving (again!).
12066 * class.cs (Class.ctor): Removed exit.
12067 (PropertyMethod.ctor): ditto.
12069 * codegen.cs (Codegen.Reset): Reset static data.
12070 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
12072 * cs-tokenizer.cs (Cleanup): Removed.
12074 * driver.cs (GetSystemDir): Rewrote to one line command.
12075 It caused problem with unloaded dynamic modules.
12076 (UnixParseOption): Removed Exit.
12077 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
12078 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
12079 Now can be mcs used as library.
12081 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
12084 * location.cs (Reset): Reset static data.
12086 * namespace.cs (Reset): Reset static data.
12088 * report.cs (Report.Reset): Reset static data.
12090 * rootcontext.cs (RootContext.Reset): Reset static data.
12092 * tree.cs (RootTypes.ctor): Use Location.Null
12094 * typemanager.cs (TypeManager.Reset): Reset static data.
12095 (CoreLookupType): Removed Exit.
12096 (TypeHandle.Reset): Reset static data.
12098 2005-03-10 Raja R Harinath <rharinath@novell.com>
12101 * typemanager.cs (ComputeNamespaces): Import namespaces from
12102 referenced modules too.
12104 2005-03-09 Raja R Harinath <rharinath@novell.com>
12106 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
12109 2005-03-09 Raja R Harinath <rharinath@novell.com>
12111 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
12112 enclosing DeclSpace. This ensures that a name-lookup populates
12113 more caches and there are fewer 'TypeExpression's. Carve out
12114 nested type lookup into ...
12115 (LookupNestedTypeInHierarchy): ... this.
12117 2005-03-09 Raja R Harinath <rharinath@novell.com>
12119 Clean up a few partial-class semantics.
12120 Fixes test-357.cs and cs1618-2.cs.
12121 * cs-parser.jay (struct_declaration): Use 'current_class' as
12122 parent of newly-created struct. Remove call to Register ().
12123 Use 'pop_current_class' to complete handing the current struct.
12124 (interface_declaration): Likewise.
12125 (class_declaration): Likewise.
12126 (enum_declaration): Use 'current_class' as parent of newly created
12128 (delegate_declaration): Likewise.
12129 (pop_current_class): New function. This is used to handle closing
12130 up the 'current_class' and 'current_container', and pointing them
12131 to the enclosing class/container.
12132 (CSharpParser): Initialize 'current_class' too.
12133 * decl.cs (MemberCore): Add check for invariant: a partial
12134 container is not a parsed entity, and thus does not enclose any
12136 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
12137 (DeclSpace.BaseTypeExpr): Use it.
12138 (DeclSpace.LookupType): Add check for invariant.
12139 * class.cs (TypeContainer): Add check for invariant: a nested
12140 class should have the same NamespaceEntry as its enclosing class.
12141 (TypeContainer.EmitFieldInitializers): Make virtual.
12142 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
12144 (TypeContainer.Register): Remove.
12145 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
12146 null. Use TypeResolveEmitContext for resolving base types and
12147 interfaces. Move initialization of Parts.TypeBuilder here from
12149 (TypeContainer.DefineNestedTypes): ... here.
12150 (PartialContainer): Take a Namespace not a NamespaceEntry.
12151 (PartialContainer.Create): Don't use Register. Call the
12152 appropriate Add... function directly.
12153 (ClassPart): Take both the PartialContainer and the enclosing
12154 class as constructor arguments.
12155 (ClassPart.EmitFieldInitializers): Override.
12156 (ClassPart.PartFindNestedTypes): Remove.
12157 (FieldBase.GetInitializerExpression): Resolve the initializer
12158 expression in the emit context of the enclosing class.
12159 * tree.cs (RootTypes): Remove Register ().
12161 2005-03-08 Marek Safar <marek.safar@seznam.cz>
12163 * cs-parser.jay: Removed CS0134.
12165 * driver.cs: Removed CS1901.
12167 * expression.cs (SizeOf.DoResolve): Don't report CS0233
12168 for predefined types.
12170 2005-03-07 Duncan Mak <duncan@novell.com>
12172 * codegen.cs (Save): Catch UnauthorizedAccessException as
12173 well. Fixes bug #73454.
12175 2005-03-07 Marek Safar <marek.safar@seznam.cz>
12177 * cs-tokenizer.cs (xtoken): Add CS1035.
12179 * class.cs (MethodData.Define): Add CS0683.
12180 (FieldMember.ctor): Add CS0681.
12182 2005-03-07 Raja R Harinath <rharinath@novell.com>
12184 * ecore.cs (SimpleName.DoResolve): Rename from
12185 SimpleName.DoResolveAllowStatic.
12186 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
12187 Pass 'intermediate' flag to MemberStaticCheck.
12188 (SimpleName.MemberStaticCheck): Skip "static check" only in case
12189 of "intermediate" lookups via MemberAccess.
12190 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
12191 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
12193 2005-03-07 Raja R Harinath <rharinath@novell.com>
12196 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
12197 slipped in because of variable names that are identical to a
12198 builtin type's BCL equivalent ('string String;', 'int Int32;').
12199 (PropertyExpr.EmitInstance): Likewise.
12201 2005-03-04 Marek Safar <marek.safar@seznam.cz>
12203 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
12205 * report.cs (warning_ignore_table): Made public.
12207 2005-03-04 Raja R Harinath <rharinath@novell.com>
12210 * class.cs (MethodData.Emit): Pass 'container' to
12211 container.GetObsoleteAttribute instead of 'container.Parent'.
12213 2005-03-03 Marek Safar <marek.safar@seznam.cz>
12215 * cs-parser.jay: Add 1534 error test.
12217 * iterators.cs (Yield.CheckContext): Add error 1629.
12218 (Iterator.ctor): Save unsafe modifier.
12219 (MoveNextMethod.DoEmit): Restore unsafe context.
12221 * namespace.cs (UsingAlias): Better error message.
12223 2005-03-03 Dan Winship <danw@novell.com>
12225 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
12226 the warning message [#73219]
12228 2005-03-03 Raja R Harinath <rharinath@novell.com>
12230 Fix compile with MCS 1.0.0.0.
12231 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
12232 w_restore to not depend on string constant folding.
12234 2005-03-03 Raja R Harinath <rharinath@novell.com>
12236 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
12237 CS0246 check to users who passed 'silent = false'.
12238 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
12240 (SimpleName.SimpleNameResolve): Update.
12241 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
12242 (MemberAccess.IdenticalNameAndTypeName): Update.
12243 * doc.cs (FindDocumentedTypeNonArray): Update.
12245 2005-03-03 Raja R Harinath <rharinath@novell.com>
12247 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
12248 * parameters.cs (ComputeAndDefineParameters): Remove.
12249 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
12250 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
12251 Use GetParameterInfo.
12253 2005-03-02 Marek Safar <marek.safar@seznam.cz>
12255 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
12257 2005-03-02 Raja R Harinath <rharinath@novell.com>
12259 Unify DeclSpace.LookupType and DeclSpace.FindType.
12260 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
12261 is in charge of defining nested types on demand.
12262 (DeclSpace.LookupType): Use it when the current_type is a
12263 TypeBuilder. Use LookupTypeDirect for reflected types.
12264 (DeclSpace.FindType): Remove.
12265 (DeclSpace.LookupInterfaceOrClass): Likewise.
12266 (DeclSpace.DefineTypeAndParents): Likewise.
12267 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
12268 DeclSpace.LookupType.
12269 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
12270 * typemanager.cs (LookupType): Simplify.
12271 (AddUserType): Remove type from negative_hits.
12272 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
12273 * class.cs (TypeContainer.FindMembers): Move handling of nested
12275 (TypeContainer.FindMembers_NestedTypes): ... here.
12276 (TypeContainer.FindNestedType): Implement override.
12277 (ClassPart.FindNestedType): Delegate to PartialContainer.
12278 (ClassPart.PartFindNestedType): Looks up the nested types of the
12281 2005-03-02 Martin Baulig <martin@ximian.com>
12283 * class.cs (TypeContainer.DoDefineMembers): We also need a default
12284 static constructor in static classes.
12286 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
12288 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
12289 sizeParamIndex is not specified.
12291 2005-03-01 Marek Safar <marek.safar@seznam.cz>
12294 * report.cs (WarningMessage.IsEnabled): Missing null check.
12296 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12298 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
12299 in the fields and not in the properties.
12301 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
12303 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
12306 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12308 * attribute.cs: Small refactoring (improved robustness).
12309 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
12310 (ValidateGuid): Removed.
12311 (Resolve): Removed referenced to above mentioned.
12312 (GetAttributeUsage): Made private and changed to work without
12314 (GetIndexerAttributeValue): Don't crash.
12315 (GetConditionalAttributeValue): Ditto.
12316 (GetClsCompliantAttributeValue): Ditto.
12317 (ExtractSecurityPermissionSet): All attributes exceptions are
12319 (GetPropertyValue): New helper.
12320 (GetMethodImplOptions): New method.
12321 (DefinePInvokeMethod): Reuse common code. Implemented handling of
12322 some missing properties.
12324 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
12325 (Method.ApplyAttributeBuilder): Updated.
12327 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
12330 2005-02-28 Raja R Harinath <rharinath@novell.com>
12333 * report.cs (Report.SymbolRelatedToPreviousError): Handle
12334 non-simple types (array, pointer, reference).
12336 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12338 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
12340 * class.cs (MethodCore.IsDuplicateImplementation): Special error
12342 (Method.CheckBase): Catch wrong destructor here.
12343 (MethodData.Define): Add errors 550, 668.
12345 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
12347 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
12349 * pending.cs (VerifyPendingMethods): Add error 551.
12351 * typemanager.cs (CSharpName): Next error report helper.
12353 2005-02-25 Marek Safar <marek.safar@seznam.cz>
12355 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
12356 attributes. Removed useless attribute double check.
12357 It saves almost 2MBs for corlib.
12359 2005-02-25 Raja R Harinath <rharinath@novell.com>
12362 * statement.cs (ExpressionStatement.Resolve): Make robust to being
12363 called twice in case of error.
12365 2005-02-23 Chris Toshok <toshok@ximian.com>
12367 Fix compiler portions of #72827.
12368 * statement.cs (Block.Emit): call Begin/EndScope on the
12369 EmitContext instead of the ILGenerator.
12371 * codegen.cs (EmitContext.BeginScope): new method, call
12372 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
12374 (EmitContext.BeginScope): same, but EndScope and CloseScope
12376 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
12377 offset and call the superclass's OpenScope(int) with it.
12378 (SymbolWriter.CloseScope): get the current il
12379 offset and call superclass's CloseScope(int) with it.
12381 2005-02-23 Marek Safar <marek.safar@seznam.cz>
12383 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
12384 CS1677 for out and ref as well.
12386 * class.cs (Method.Define): Add error CS1599 detection.
12388 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
12390 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
12392 * delegate.cs (Delegate.Define): Add error CS1599 detection.
12394 * support.cs.cs (ModifierDesc): New helper method.
12396 2005-02-23 Raja R Harinath <rharinath@novell.com>
12397 Abin Thomas <projectmonokochi@rediffmail.com>
12398 Anoob V E <projectmonokochi@rediffmail.com>
12399 Harilal P R <projectmonokochi@rediffmail.com>
12401 Fix #57851, #72718.
12402 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
12403 MemberLookup (used for error reporting) actually returns a result.
12404 Fix error report number (122, not 112).
12406 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
12407 Anoob V E <projectmonokochi@rediffmail.com>
12408 Harilal P R <projectmonokochi@rediffmail.com>
12411 * pending.cs (PendingImplementation.GetAbstractMethods):
12412 Find NonPublic members too.
12414 2005-02-22 Marek Safar <marek.safar@seznam.cz>
12416 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
12419 * class.cs (MethodCore.CheckMethodAgainstBase):
12420 Add error 239 report.
12422 2005-02-21 Raja R Harinath <rharinath@novell.com>
12425 * expression.cs (Invocation.IsApplicable): Make public.
12426 (Invocation.IsParamsMethodApplicable): Likewise.
12427 * delegate.cs (Delegate.VerifyApplicability): Don't use
12428 Invocation.VerifyArgumentCompat for parameter applicability
12429 testing. Use Invocation.IsApplicable and
12430 Invocation.IsParamsMethodApplicable.
12432 2005-02-21 Marek Safar <marek.safar@seznam.cz>
12434 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
12436 * class.cs (Operator.Define): Add error 217 report.
12438 2005-02-21 Raja R Harinath <rharinath@novell.com>
12440 * namespace.cs (UsingEntry.Resolve): Undo change below.
12442 2005-02-21 Raja R Harinath <rharinath@novell.com>
12445 * ecore.cs (Expression.MemberLookupFailed): Add argument to
12446 disable the error message when the extended MemberLookup also
12448 (Expression.MemberLookupFinal): Update.
12449 (SimpleName.DoSimpleNameResolve): Update.
12450 * expression.cs (MemberAccess.ResolveNamespaceOrType):
12451 Don't use MemberLookupFinal.
12452 (New.DoResolve): Update.
12453 (BaseAccess.CommonResolve): Update.
12455 2005-02-21 Raja R Harinath <rharinath@novell.com>
12458 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
12459 occured previously, don't resolve again.
12461 2005-02-21 Marek Safar <marek.safar@seznam.cz>
12464 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
12465 argument. Call ResolveAttributeUsage for unresolved.
12466 when types doesn't match ctor arguments.
12468 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
12469 for nested attribute classes.
12470 (Class.attribute_usage): Removed.
12471 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
12472 for attribute class.
12474 * ecore.cs (IsAttribute): Removed.
12476 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
12478 * rootcontext.cs (RegisterAttribute): Removed, attributes are
12480 (attribute_types): Removed.
12481 (EmitCode): Global attributes are emited as the latest.
12483 2005-02-18 Marek Safar <marek.safar@seznam.cz>
12485 * class.cs (EmitFieldInitializers): Don't emit field initializer
12486 for default values when optimilization is on.
12488 * constant.cs (Constant.IsDefaultValue): New property.
12490 * driver.cs: Add /optimize handling.
12494 * literal.cs: Implement new IsDefaultValue property.
12496 * rootcontext.cs (Optimize): New field, holds /optimize option.
12498 2005-02-18 Raja R Harinath <rharinath@novell.com>
12500 Fix crasher in re-opened #72347.
12501 * namespace.cs (Namespace.Lookup): Return null if
12502 DeclSpace.DefineType returns null.
12505 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
12507 2005-02-18 Raja R Harinath <rharinath@novell.com>
12509 Fix remainder of #63202. Change semantics of DoResolveLValue: it
12510 now returns null if it cannot resolve to an lvalue.
12511 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
12512 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
12513 returned null. Remove check for SimpleName.
12514 (EventExpr.DoResolveLValue): New.
12515 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
12516 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
12518 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
12519 avoid CS0131 error.
12520 (Unary.ResolveOperator): Move CS0211 check ...
12521 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
12523 (Unary.DoResolveLValue): Simplify.
12524 (AddressOf.DoResolveLValue): New.
12525 (ArrayAccess.DoResolveLValue): New.
12527 2005-02-16 Marek Safar <marek.safar@seznam.cz>
12529 * attribute.cs (Attribute.Resolve): Add arguments casting for
12530 when types doesn't match ctor arguments.
12532 2005-02-16 Raja R Harinath <rharinath@novell.com>
12534 Fix parts of #63202.
12535 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
12536 lookup of operator in base type. Ensure that all checks happen
12537 when the operator resolves to an "op_..." method.
12539 2005-02-15 Raja R Harinath <rharinath@novell.com>
12542 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
12543 'ignore_cs0104' parameter. Pass it to ...
12544 (NamespaceEntry.Lookup): ... this.
12545 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
12546 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
12547 (TypeLookupExpression.DoResolveAsTypeStep): Update.
12548 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
12549 Update. Request that cs0104 errors be ignored.
12550 (ComposedCast.ResolveAsTypeStep): Update.
12552 2005-02-14 Raja R Harinath <rharinath@novell.com>
12555 * expression.cs (Invocation.BetterFunction): Remove support for
12556 comparing virtual functions and their overrides.
12557 (Invocation.IsOverride): New.
12558 (Invocation.OverloadResolve): Don't consider 'override' functions
12559 during candidate selection. Store them in a lookaside list.
12560 If the selected method is a 'virtual' function, use the list to
12561 find any overrides that are closer to the LHS type.
12563 2005-02-14 Marek Safar <marek.safar@seznam.cz>
12565 * expression.cs (New.DoResolve): Add complex core type reduction.
12566 (New.Constantify): Converts complex core type syntax like 'new int ()'
12567 to simple constant.
12569 2005-02-14 Raja R Harinath <rharinath@novell.com>
12571 * decl.cs (EntryType.EntryType): New constructor to create an
12572 updated copy of a cache entry.
12573 (MemberCache.AddMethods): Use it.
12574 (MemberCache.ClearDeclaredOnly): Remove.
12575 (MemberCache.MemberCache): Update.
12577 2005-02-11 Miguel de Icaza <miguel@novell.com>
12579 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
12580 variable. This one is represents the actual low-level declaration
12581 of the method, as opposed to the semantic level `IsStatic'.
12583 An anonymous method which is hosted into a static method might be
12584 actually an instance method. IsStatic would reflect the
12585 container, while MethodIsStatic represents the actual code
12588 * expression.cs (ParameterReference): Use the new MethodIsStatic
12589 instead of IsStatic.
12591 * anonymous.cs (AnonymousMethod.Compatible): Pass the
12592 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
12593 set on the current EmitContext.
12595 * expression.cs (Cast): Overload DoResolveLValue so we can pass
12596 resolve our casted expression as an LValue. This triggers the
12597 proper LValue processing that is later required by Assign.
12601 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
12603 2005-02-11 Marek Safar <marek.safar@seznam.cz>
12605 C# 2.0 Fixed buffer implementation
12607 * anonymous.cs: Update after RegisterHelperClass renaming.
12609 * attribute.cs (AttributeTester.fixed_buffer_cache):
12610 Cache of external fixed buffers.
12611 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
12612 implementation if field is fixed buffer else null.
12615 (TypeContainer.AddField): Accept FieldMember instead of Field.
12616 (FieldBase.IsFieldClsCompliant): Extracted code from
12617 VerifyClsCompliance descendant customization.
12618 (FixedField): New class handles fixed buffer fields.
12619 (FixedFieldExternal): Keeps information about imported fixed
12621 (IFixedField): Make access to internal or external fixed buffer
12624 * cs-parser.jay: Add fixed buffer parsing.
12626 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
12629 * expression.cs (Indirection): Extended implementation to accept
12630 fixed buffer field.
12631 (PointerArithmetic.Emit): Get element from fixed buffer as well.
12632 (ElementAccess.MakePointerAccess): Get type as parameter.
12633 (DoResolve): Add fixed buffer field expression conversion.
12634 (DoResolveLValue): Ditto.
12635 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
12636 (ArrayPtr): Derives from FixedBufferPtr.
12637 (ArrayPtr.Emit): Add extra emit for array elements.
12639 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
12641 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
12642 for compiler generated types.
12643 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
12645 * statement.cs (Fixed): Refactored to be easier add fixed buffer
12646 and consume less memory.
12647 (Fixed.Resolve): Add fixed buffer case.
12649 * typemanager.cs (compiler_generated_attr_ctor,
12650 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
12651 (HasElementType): Add our own implementation to work on every
12654 2005-02-11 Miguel de Icaza <miguel@novell.com>
12656 * anonymous.cs (CaptureContext): Track whether `this' has been
12659 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
12660 only captured `this' if it was implicitly done (instance
12661 methods/variables were used).
12663 * codegen.cs (EmitContext.CaptureThis): New method to flag that
12664 `this' must be captured.
12666 2005-01-30 Miguel de Icaza <miguel@novell.com>
12668 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
12669 is null it means that there has been no need to capture anything,
12670 so we just create a sibling.
12672 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
12674 Just a partial fix. The other half is fairly elusive.
12676 2005-02-10 Raja R Harinath <rharinath@novell.com>
12678 Fix #52586, cs0121-4.cs.
12679 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
12680 and return a hashtable.
12681 (MemberCache.ClearDeclaredOnly): New.
12682 (MemberCache.MemberCache): Update to change. Make a deep copy of
12683 the method_hash of a base type too.
12684 (MemberCache.AddMethods): Adapt to having a deep copy of the base
12685 type methods. Overwrite entries with the same MethodHandle so
12686 that the ReflectedType is correct. The process leaves in base
12687 virtual functions and their overrides as distinct entries.
12688 (CacheEntry): Now a class instead of a struct. It shouldn't alter
12689 matters since it was boxed in a ArrayList before.
12690 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
12692 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
12693 case of a virtual function and its override (choose the overload
12695 (Invocation.OverloadResolve): Avoid 'override' members during
12696 'applicable_type' calculation.
12698 2005-02-09 Raja R Harinath <rharinath@novell.com>
12700 Combine two near-redundant caches.
12701 * typemanager.cs (method_params): Rename from method_internal_params.
12702 (TypeManager.GetParameterData): New. Replace
12703 Invocation.GetParameterData.
12704 (TypeManager.LookupParametersByBuilder): Remove.
12705 * expression.cs (Invocation.method_parameter_cache): Remove.
12706 (Invocation.GetParameterData): Remove.
12708 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
12711 2005-02-08 Raja R Harinath <rharinath@novell.com>
12714 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
12715 TypeManager.multicast_delegate_type is null, resolve it by looking
12716 up "System.MulticastDelegate".
12717 * rootcontext.cs (RootContext.ResolveCore): Simplify.
12719 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
12720 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
12721 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
12724 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
12725 (LabeledStatement.AddReference): New. Set 'referenced'.
12726 (Goto.Resolve): Use it.
12728 2005-02-05 John Luke <john.luke@gmail.com>
12730 * driver.cs: remove duplicate -doc line in Usage ()
12732 2005-02-04 Raja R Harinath <rharinath@novell.com>
12734 * location.cs (Location.AddFile): Fix CS2002 error report.
12736 2005-02-02 Martin Baulig <martin@ximian.com>
12738 * delegate.cs (Delegate.DefineType): Report an internal error if
12739 TypeManager.multicast_delegate_type is null. See bug #72015 for
12742 2005-02-02 Raja R Harinath <rharinath@novell.com>
12744 Fix a crasher in a variant of #31984.
12745 * const.cs (Constant.CheckBase): New override that defers the
12746 new-or-override check in case the base type hasn't been populated
12748 (Constant.Define): Ensure the new-or-override check is performed.
12750 2005-02-01 Duncan Mak <duncan@ximian.com>
12752 * const.cs (LookupConstantValue): Check that `ce' is not null
12753 before calling GetValue ().
12755 2005-02-01 Raja R Harinath <rharinath@novell.com>
12757 Fix test-334.cs (#69519).
12758 * cs-parser.jay (using_alias_directive): Pass in an expression to
12759 NamespaceEntry.UsingAlias.
12760 (using_namespace_directive): Pass in an expression to
12761 NamespaceEntry.Using.
12762 (namespace_name): Don't flatten to a string.
12763 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
12764 (NamespaceEntry.AliasEntry.Resolve): Lookup using
12766 (NamespaceEntry.UsingEntry): Likewise.
12767 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
12769 (NamespaceEntry.LookupForUsing): Remove.
12770 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
12772 (NamespaceEntry.Lookup): Remove support for dotted names.
12774 2005-02-01 Raja R Harinath <rharinath@novell.com>
12776 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
12778 (NamespaceEntry.ImplicitParent): Compute on demand.
12779 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
12780 parallels the current.
12781 (NamespaceEntry.LookupForUsing): Use it.
12782 (NamespaceEntry.Lookup): If the current namespace-entry is
12783 implicit, don't search aliases and using tables.
12785 2005-02-01 Raja R Harinath <rharinath@novell.com>
12788 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
12790 (TypeContainer.BaseCache): Compute on demand.
12791 (TypeContainer.FindMembers): Define constants and types if they're
12792 not already created.
12793 (FieldMember.Define): Move resetting of ec.InUnsafe before error
12795 * const.cs (Constant.Define): Make idempotent.
12797 2005-01-29 Miguel de Icaza <miguel@novell.com>
12799 * pending.cs: Produce better code (no nops produced by using Ldarg
12802 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
12803 i - 1' it should be arg + 1.
12807 2005-01-28 Raja R Harinath <rharinath@novell.com>
12809 * attribute.cs (Attribute.CheckAttributeType): Make private
12811 (Attribute.ResolveType): Make virtual.
12812 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
12813 handling of RootContext.Tree.Types.
12815 2005-01-27 Raja R Harinath <rharinath@novell.com>
12817 Update attribute-handling to use the SimpleName/MemberAccess
12819 * cs-parser.jay (attribute): Pass in an expression to the
12820 constructors of Attribute and GlobalAttribute.
12821 * attribute.cs (Attribute): Take an expression for the name.
12822 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
12823 passed in attribute name expression.
12824 (Attribute.CheckAttributeType): Use it.
12825 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
12826 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
12827 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
12828 argument to prevent error messages if the lookup fails.
12830 2005-01-27 Marek Safar <marek.safar@seznam.cz>
12832 * expression.cs (Indirection): Implemented IVariable interface
12833 to support indirection in AddressOf operator.
12834 (PointerArithmetic.Emit): Add optimalization for case where
12835 result can be precomputed.
12837 2005-01-26 Martin Baulig <martin@ximian.com>
12839 * class.cs (TypeContainer.AttributeTargets): Return the correct
12840 AttributeTargets depending on our `Kind' instead of throwing an
12841 exception; fixes #71632.
12843 2005-01-26 Marek Safar <marek.safar@seznam.cz>
12846 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
12849 2005-01-25 Raja R Harinath <rharinath@novell.com>
12852 * expression.cs (MemberAccess.DoResolve): Don't complain with
12853 cs0572 when the LHS of a member access has identical name and type
12856 2005-01-25 Marek Safar <marek.safar@seznam.cz>
12859 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
12861 Create custom PermissionSet only for PermissionSetAttribute.
12863 2005-01-24 Marek Safar <marek.safar@seznam.cz>
12866 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
12867 delegates in static class.
12869 2005-01-24 Martin Baulig <martin@ximian.com>
12871 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12872 merging an implicit block, just use its reachability.
12874 * statement.cs (Block.Resolve): Make the unreachable code check
12875 work wrt. implicit blocks; see test-337 from #63842.
12877 2005-01-21 Alp Toker <alp@atoker.com>
12879 * cs-parser.jay: destructor_declaration's container is PartialContainer
12880 not Class when partial types are used, so use Kind prop instead of
12883 2005-01-22 Miguel de Icaza <miguel@ximian.com>
12885 * cs-parser.jay: Improve error reporting when an interface
12886 declares new types.
12888 2005-01-20 Dick Porter <dick@ximian.com>
12890 * support.cs: SeekableStreamReader fix from Sandor Dobos
12891 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
12892 chars are read. Fixes bug 70369.
12894 2005-01-20 Raja R Harinath <rharinath@novell.com>
12896 * cs-parser.jay (catch_clause): Simplify current_block handling
12899 2005-01-17 Miguel de Icaza <miguel@ximian.com>
12901 * convert.cs (ImplicitStandardConversionExists): Synchronize the
12902 code with ImplicitStandardConversion to handle the implicit
12903 conversion of method groups into valid delegate invocations.
12905 The problem is that in parameter handling we were using this code
12906 path. Fixes bug #64698
12908 2005-01-19 Raja R Harinath <rharinath@novell.com>
12910 * cs-parser.jay: Fix several infelicities.
12911 - Avoid assigning to the parser value stack. Code like
12912 '$3 = null' is unclean. Synthesize a value for the code block
12914 - Avoid using oob_stack for storing location information. Use ...
12915 (_mark_): ... this. New (empty) rule. Saves the current location
12917 (foreach_statement): Avoid using oob_stack for current_block
12918 handling. Use technique used in for_statement and
12919 using_statement. Synthesize a value for the code block to store
12920 additional intermediate information.
12922 2005-01-13 Miguel de Icaza <miguel@ximian.com>
12924 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
12925 of a different type is only allowed to private fields of a
12926 containing type, not on fields of a base class.
12928 See test-174.cs and error cs0122-9.cs
12930 2005-01-13 Raja R Harinath <rharinath@novell.com>
12932 Fix test-335.cs (bug #58126).
12933 * cs-parser.jay (argument): Split out non-expression parts of the
12934 rule into 'non_simple_argument'.
12935 (invocation_expression): Support parenthesized invocations with
12936 multiple arguments, and with single non-simple arguments.
12938 2005-01-13 Raja R Harinath <rharinath@novell.com>
12940 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
12943 2005-01-12 Raja R Harinath <rharinath@novell.com>
12945 Fix cs0038-1.cs, cs1640-6.cs.
12946 * ecore.cs (Expression.Resolve): Remove special-case for
12947 SimpleName in error-handling.
12948 (Expression.almostMatchedMembers): Relax access permission to
12950 (Expression.MemberLookupFailed): Handle duplicates in
12951 almostMatchedMembers list.
12952 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
12953 * expression.cs (New.DoResolve): Report CS1540 for more cases.
12954 * typemanager.cs (GetFullNameSignature): Use the MethodBase
12955 overload if the passed in MemberInfo is a MethodBase.
12957 2005-01-12 Marek Safar <marek.safar@seznam.cz>
12960 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
12961 for non-CAS & merge permission sets properly.
12963 2005-01-11 Raja R Harinath <rharinath@novell.com>
12965 Improve standard-compliance of simple name and member access
12966 resolution. Fixes bugs #52697, #57200, #67520, #69519.
12967 * ecore.cs (FullNamedExpression): New abstract base class
12968 for Namespaces and TypeExpressions.
12969 (ResolveFlags.SimpleName): Remove.
12970 (SimpleName): Remove support for dotted names.
12971 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
12972 DeclSpace.FindType and DeclSpace.LookupType.
12973 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
12974 (Expression.ExprClassName): Make member function.
12975 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
12976 a namespace. Remove creation of dotted "SimpleName"s.
12977 (MemberAccess.DoResolve): Likewise.
12978 * decl.cs (DeclSpace.Cache): Make private.
12979 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
12980 (DeclSpace.FindType): Update.
12981 (DeclSpace.LookupType): Move here from RootContext. Return a
12982 FullNamedExpression.
12983 * namespace.cs (Namespace): Derive from FullNamedExpression
12984 so that it can be part of expression resolution.
12985 (Namespace.Lookup): Return an FullNamedExpression.
12986 (NamespaceEntry.LookupAlias): Lookup aliases only in current
12988 * rootcontext.cs (NamespaceLookup): Remove.
12989 (LookupType): Move to DeclSpace.
12990 * attribute.cs (CheckAttributeType): Update.
12991 * doc.cs (FindDocumentedType): Remove allowAlias argument.
12992 (FindDocumentedTypeNonArray): Likewise.
12994 2005-01-11 Raja R Harinath <rharinath@novell.com>
12996 Fix cs0509.cs, cs1632.cs.
12997 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
12998 is the same as IsInterface.
12999 (TypeContainer.GetClassBases): Likewise.
13000 * statement.cs (LabeledStatement.ig): New field.
13001 (LabeledStatement.LabelTarget): Save ILGenerator which created the
13003 (LabeledStatement.DoEmit): Check that the label was created with
13004 the same ILGenerator.
13006 2005-01-10 Marek Safar <marek.safar@seznam.cz>
13009 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
13010 accessors to its properties.
13012 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
13013 from accessors to property.
13015 2005-01-10 Marek Safar <marek.safar@seznam.cz>
13018 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
13019 only for overrides.
13021 2005-01-08 Miguel de Icaza <miguel@ximian.com>
13023 * attribute.cs: Check for null and empty strings.
13025 I have lost another battle to Paolo.
13027 2005-01-07 Marek Safar <marek.safar@seznam.cz>
13030 * class.cs (PropertyMethod): Set Parent field in ctors.
13031 (SetMethod.InternalParameters): Add unsafe switch hack.
13032 Override MarkForDuplicationCheck where it is appropriate.
13034 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
13035 It says whether container allows members with the same name.
13036 Base default is no.
13037 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
13038 Removed is_method parameter.
13040 2005-01-06 Duncan Mak <duncan@ximian.com>
13042 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
13043 because the previous change led to incorrect reporting of CS1032
13044 ("Cannot define/undefine preprocessor symbols after first token in
13045 file"). Instead of using `tokens_seen' as the only flag that
13046 triggers CS1040, introduce `comments_seen'. This new flag is used
13047 to signify having seen comments on the current line, so it is
13048 unset after a newline.
13050 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
13052 * doc.cs : When searching for a type, find nested type too.
13053 This fixes bug #71040.
13055 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
13058 - Warn missing member comment on those classes which also does not
13059 have doc comments. Fixed bug #71041.
13060 - Don't warn missing doc comment on default constructor.
13063 2005-01-06 Duncan Mak <duncan@ximian.com>
13065 * cs-tokenizer.cs (xtoken): After handling traditional C-style
13066 comments, set `tokens_seen' to true. This allows us to detect
13067 misplaced preprocessor directives (i.e. not at the beginning of
13068 the a line, nor after whitespaces). In that case, report error
13069 CS1040. This fixes bug #56460.
13071 * cs-parser.jay (interface_member_declaration): Add checks for
13072 IsExplicitImpl, and report CS0541 error if an interface member is
13073 defined as an explicit interface declaration.
13075 2005-01-06 Marek Safar <marek.safar@seznam.cz>
13078 * class.cs (PropertyMethod): Set Parent field in ctors.
13079 (SetMethod.InternalParameters): Add unsafe switch hack.
13081 * decl.cs (MemberCore.Parent): Cannot be readonly.
13083 2005-01-06 Raja R Harinath <rharinath@novell.com>
13085 * decl.cs (DeclSpace.ResolveType): Remove.
13086 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
13087 Merge in code from ...
13088 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
13089 * class.cs, enum.cs: Update to changes.
13091 2005-01-06 Miguel de Icaza <miguel@ximian.com>
13093 * anonymous.cs: Ensure that we init the scope of our parent if it
13094 has not been initialized yet.
13096 2004-12-30 Duncan Mak <duncan@ximian.com>
13098 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
13099 if field.FieldBuilder is null. Fixes #70758.
13101 * convert.cs: Fixed some typos and updated some of the comments.
13102 (ImplicitStandardConversionExists):
13103 (TryImplicitIntConversion): If `target_type' is an interface and
13104 the type of `ic' implements this interface, return true or a new
13105 BoxedCast instead of null. This fixes #70468.
13107 2004-12-29 Duncan Mak <duncan@ximian.com>
13109 * expression.cs (Argument.Emit): Check that Expr is
13110 IMemoryLocation before casting to it, and report CS1510 otherwise.
13114 2004-12-21 Ben Maurer <bmaurer@ximian.com>
13116 * statement.cs (Block.ThisVariable): remove the recursion here, to
13117 make the --profile more sane.
13119 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
13121 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
13122 assembly, by JB Evain.
13124 2004-12-17 Raja R Harinath <rharinath@novell.com>
13126 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
13127 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
13128 "parent" refers to enclosing type/class. "base" refers to superclass.
13130 2004-12-17 Raja R Harinath <rharinath@novell.com>
13132 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13133 Ensure that we only have GlobalAttributes.
13134 * attribute.cs (Attribute.Emit): Make non-virtual.
13135 (GlobalAttribute.Emit): Remove.
13136 (Attribute.Resolve): Make virtual.
13137 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
13138 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
13139 the argument. Don't create one.
13140 (Attribute.GetObsoleteAttribute): Likewise.
13141 (Attribute.GetClsCompliantAttributeValue): Likewise.
13142 * class.cs, decl.cs: Update to changes.
13144 2004-12-17 Marek Safar <marek.safar@seznam.cz>
13146 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
13148 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
13150 * statement.cs (Foreach.Resolve): Add error 186 report.
13152 2004-12-16 Marek Safar <marek.safar@seznam.cz>
13154 * expression.cs (Conditional.DoResolve): Add warning 429.
13156 * statement.cs (If.Resolve): Add warning 665.
13158 2004-12-16 Raja R Harinath <rharinath@novell.com>
13160 New invariant: RootContext.Tree.Types.NamespaceEntry == null
13161 except when in the parser, and in GlobalAttribute.
13162 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
13163 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
13164 RootContext.Tree.Types.NamespaceEntry once work is done.
13165 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
13166 and resets RootContext.Tree.Types.NamespaceEntry.
13168 2004-12-15 Marek Safar <marek.safar@seznam.cz>
13170 * cs-parser.jay: Don't create a block for every variable.
13172 2004-12-14 Miguel de Icaza <miguel@ximian.com>
13174 * location.cs: Provide extra information.
13176 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
13177 variables from the captured environment, it is the ldarg_0.
13179 2004-12-14 Marek Safar <marek.safar@seznam.cz>
13181 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
13184 * class.cs: Changed warning level for 169 to avoid developer
13185 displeasure from warning flooding. It will be changed back when they
13186 fix most of current BCL warnings.
13188 * RootContext.cs: Pushed default WarningLevel to 3.
13190 * statement.cs: Removed unused variable.
13192 2004-12-14 Marek Safar <marek.safar@seznam.cz>
13194 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
13195 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
13196 Add error 502 report.
13197 (StaticClass.DefineType): Add error 441 report.
13198 (Class.AllowedModifiersProp): New virtual property as temporary
13199 extension to AllowedModifiers.
13200 (Class.DefineType): Add error 418 report. Moved ModFlags check here
13201 to share implementation with StaticClass and don't call virtual
13204 * driver.cs (MainDriver): Add error 1558 test.
13206 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
13207 report. Moved error 36 test here.
13209 * statement.cs (Throw.Resolve): Add error 724 report.
13211 * typemanager.cs: Add out_attribute_type core type.
13213 2004-12-13 Marek Safar <marek.safar@seznam.cz>
13215 * class.cs (TypeContainer.VerifyClsCompliance): Add error
13217 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
13219 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
13222 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
13224 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
13225 Add error 3023 report.
13226 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
13228 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
13231 2004-12-12 John Luke <john.luke@gmail.com>
13233 * driver.cs (AddArgs): take -- into account when
13234 adding arguments, fixes bug 65710
13236 2004-12-12 Martin Baulig <martin@ximian.com>
13238 * expression.cs (Unary.TryReduceNegative): Added support for
13239 SByteConstant and ByteConstant.
13240 (Unary.Reduce): Check error values from TryReduceNegative().
13242 2004-12-10 Marek Safar <marek.safar@seznam.cz>
13244 * attributes.cs (Attribute.Resolve): Avoid multiple error report
13245 and report exception as error 182.
13247 2004-12-10 Raja R Harinath <rharinath@novell.com>
13249 * driver.cs (Main): Fix message when there are warnings.
13251 2004-12-09 Miguel de Icaza <miguel@ximian.com>
13253 * delegate.cs: Fixed my fix from yesterday, sorry about that.
13255 2004-12-09 Marek Safar <marek.safar@seznam.cz>
13257 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
13258 Reduced number of warnings.
13260 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
13262 2004-12-08 Miguel de Icaza <miguel@ximian.com>
13264 * driver.cs: Removed message.
13266 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
13268 2004-12-08 <vargaz@freemail.hu>
13270 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
13272 2004-12-08 Martin Baulig <martin@ximian.com>
13274 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
13275 instead of a CS3002 for properties and indexer.
13277 2004-12-08 Martin Baulig <martin@ximian.com>
13279 * decl.cs (MemberName.ToString): Make this work again.
13281 2004-12-08 Marek Safar <marek.safar@seznam.cz>
13283 * attribute.cs (Resolve): Add error 591 detection.
13285 * class.cs (FieldMember.Define): Add error 1547 detection.
13286 (Indexer.Define): Add error 620 detection.
13287 (Operator.Define): Add error 590 detection.
13289 * ecore.cs: Missing argument for error 79.
13291 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
13294 2004-12-07 Marek Safar <marek.safar@seznam.cz>
13297 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
13300 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
13302 * cs-parser.jay : handle doc comments on implicit/explicit operators.
13303 Some operator comments were suppressed.
13304 * doc.cs : Implicit/explicit operator name in doc comments are like
13305 "op_Explicit(type)~returnType", so added suffix handling.
13307 2004-12-07 Martin Baulig <martin@ximian.com>
13310 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
13311 (MemberCore.GetClsCompliantAttributeValue): Likewise.
13312 (DeclSpace.ec): New protected field; store the EmitContext here.
13313 (DeclSpace.EmitContext): New public property; moved here from
13315 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
13318 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
13319 (Enum.Emit): Don't create a new EmitContext.
13321 * delegate.cs (Delegate.DefineType): Always create the
13324 * iterators.cs (Iterators.DefineIterator): Create a new
13325 EmitContext and store it in `ec'.
13327 2004-08-24 Martin Baulig <martin@ximian.com>
13330 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
13331 this for accessibility checks.
13332 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
13333 IsNestedFamilyAccessible.
13334 (TypeManager.IsSubclassOf): New method, do what the name actually
13337 2004-12-06 Raja R Harinath <rharinath@novell.com>
13339 Fix crash on cs0657-17.cs.
13340 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13341 Use RootContext.Tree.Types, not 'new RootTypes ()'.
13342 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
13343 the case where the NamespaceEntry gets overwritten.
13345 2004-12-06 Marek Safar <marek.safar@seznam.cz>
13347 Fixed #69195, #56821
13348 * ecore.cs (ResolveBoolean): Tiny refactoring.
13350 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
13351 of right expression resolving when left is false constant and
13352 operator is LogicalAnd OR true constant and operator is LogicalOr.
13354 * statement.cs (ResolveUnreachable): Always reports warning.
13356 2004-12-05 Miguel de Icaza <miguel@ximian.com>
13358 * class.cs: Distinguish between 1721 and 1722 (just a little help
13359 for the programmer).
13361 2004-12-03 Miguel de Icaza <miguel@ximian.com>
13363 * delegate.cs: Only allow this on new versions of the language.
13365 2004-12-02 Duncan Mak <duncan@ximian.com>
13367 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
13369 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
13370 here as a static method. Take an additional bool out parameter
13371 `must_do_cs1540_check' for signaling to InstanceResolve.
13372 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
13373 member field from PropertyExpr class and made it an argument of
13374 the method instead.
13375 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
13376 check for MarshalByRefObject, and report CS0122 instead of CS1540.
13377 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
13378 and `remove_accessor' as well as InstanceResolve: report CS0122
13383 2004-12-03 Raja R Harinath <rharinath@novell.com>
13385 Fix test-327.cs, test-328.cs, and put in early infrastructure
13386 for eventually fixing #52697.
13387 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
13388 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
13389 from other methods.
13390 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
13391 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
13392 (VerifyUsing, error246): Update.
13393 * rootcontext.cs (RootContext.NamespaceLookup): Just use
13394 'NamespaceEntry.LookupNamespaceOrType'.
13396 2004-12-03 Martin Baulig <martin@ximian.com>
13398 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13399 method as our child, call AnonymousMethod.Compatible() on it.
13401 2004-12-03 Raja R Harinath <rharinath@novell.com>
13403 Disable XML documentation support in 'basic' profile.
13404 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
13405 Redirect XmlElement to System.Object.
13406 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
13407 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
13408 * mcs.exe.sources: Add doc-bootstrap.cs.
13409 * doc-bootstrap.cs: New file. Contains empty stub implementation
13412 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
13414 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
13415 comments are allowed.
13417 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
13419 * delegate.cs: Add checks for subtypes in paramaters and return values
13420 in VerifyMethod () to add support for Covariance/Contravariance
13423 2004-12-02 Miguel de Icaza <miguel@ximian.com>
13425 * report.cs: Remove extra closing parenthesis.
13427 * convert.cs (Error_CannotImplicitConversion): If the name of the
13428 types are the same, provide some extra information.
13430 * class.cs (FieldBase): Use an unused bit field from the field to
13431 encode the `has_offset' property from the FieldMember. This saves
13432 a couple of Ks on bootstrap compilation.
13434 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13435 method as our child, return the AnonymousMethod resolved
13438 * expression.cs (New.DoResolve): Allow return values from
13439 NewDelegate to also include AnonymousMethods.
13443 2004-12-02 Marek Safar <marek.safar@seznam.cz>
13446 * attribute.cs (Resolve): Improved implementation of params
13447 attribute arguments.
13449 * support.cs (ParameterData): Add HasParams to be faster.
13451 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
13453 all things are for /doc support:
13455 * doc.cs: new file that supports XML documentation generation.
13456 * mcs.exe.sources: added doc.cs.
13458 Handle /doc command line option.
13459 Report error 2006 instead of 5 for missing file name for /doc.
13460 Generate XML documentation when required, after type resolution.
13462 Added support for picking up documentation (/// and /** ... */),
13463 including a new XmlCommentState enumeration.
13465 Added lines to fill Documentation element for field, constant,
13466 property, indexer, method, constructor, destructor, operator, event
13467 and class, struct, interface, delegate, enum.
13468 Added lines to warn incorrect comment.
13470 Added Documentation field (passed only when /doc was specified).
13472 Added DocComment, DocCommentHeader, GenerateDocComment() and
13473 OnGenerateDocComment() and some supporting private members for
13474 /doc feature to MemberCore.
13476 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
13478 Added overriden DocCommentHeader.
13480 Added overriden DocCommentHeader and GenerateDocComment().
13482 2004-12-01 Miguel de Icaza <miguel@ximian.com>
13484 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
13485 unwrapping the enumeration values, chain to
13486 DoConstantNumericPromotions again, so we can promote things to the
13487 fundamental types (takes care of enums that are bytes, sbytes).
13491 2004-12-01 Raja R Harinath <rharinath@novell.com>
13493 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
13494 Fix long-standing bug in type-lookup. Use FindType instead of
13495 LookupType when ec.ResolvingTypeTree.
13496 (Attribute.ResolveType, Attribute.Resolve)
13497 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
13499 (Attributes.Search): Remove internal version. Update.
13500 (Attributes.SearchMulti): Update.
13501 (Attributes.GetClsCompliantAttribute): Remove.
13502 (Attributes.GetIndexerNameAttribute): Remove.
13503 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
13504 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
13505 * class.cs (Indexer.Define): Likewise.
13507 2004-12-01 Marek Safar <marek.safar@seznam.cz>
13510 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
13511 MarshallByReference members access.
13513 * expression.cs: Use CheckMarshallByRefAccess;
13514 Better error CS0197 message.
13516 * report.cs: Print whole related error message.
13518 2004-11-30 Raja R Harinath <rharinath@novell.com>
13520 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
13521 the current directory to help debugging.
13523 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13525 * class (GetClassBases): Better error 60 report.
13526 (EventProperty): Disabled warning 67 detection.
13528 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13531 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
13533 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
13536 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13539 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
13541 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
13543 2004-11-26 Miguel de Icaza <miguel@ximian.com>
13545 * attribute.cs (Attribute.Resolve): Refine error reporting and
13546 report a cs0117 if the identifier does not exist, to distinguish
13547 from 0617 which is a miss-use of the actual identifier.
13549 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
13550 between cs0070 and cs0079.
13552 * class.cs (MemberBase.DoDefine): When reporting a wrong
13553 accessibility level, we use MethodCore to compare instead of
13554 Method (this was a regression in some refactoring effort).
13556 So now we correctly report cs0056 again.
13558 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
13559 testing the target_type (which was known to be object_type) and
13560 not the source type (which is anonymous_method).
13562 Fixed reporting of error cs1660.
13564 * expression.cs (UserCast.Source): Expose the underlying cast.
13566 * statement.cs (Switch.SwitchGoverningType): Sort the list of
13567 allowed types to find a match to int32 first (most common).
13569 In addition, it ignores any ImplicitUserConversions that did an
13570 internal implicit conversion (as the switch statement allows only
13571 one integral conversion to exist).
13573 * class.cs (PartialContainer.Create): rename `name' to
13574 `member_name' for clarity. Then replace the string calls with a
13575 call to MemberName.GetPartialName, as now using
13576 MemberName.ToString is an error (this is due to the side effects
13577 it had, that were fixed in the past).
13579 This will restore the error reporting on a number of partial class
13580 errors that were missusing this (and getting an exception as a
13581 results, which is now just a plain textual warning, because
13582 yyparse debug output would crash otherwise).
13584 2004-11-26 Raja R Harinath <rharinath@novell.com>
13586 * Makefile (PROGRAM_INSTALL_DIR): Remove.
13588 2004-11-25 Ben Maurer <bmaurer@ximian.com>
13590 * rootcontext.cs (LookupType): Make sure to cache lookups that
13591 don't give us a negative result. This saves about 5% of corlib
13594 2004-11-25 Miguel de Icaza <miguel@ximian.com>
13596 * report.cs (AbstractMessage.Print): messages are sent to stderr
13598 * class.cs (TypeContainer.GetClassBases): It is an error to have a
13599 non-interface in the list of interfaces (at this point, either
13600 parent was properly set, or a base class is being listed in the
13601 interfaces section).
13603 This flags error 1722, and resolves the crash from bug 69259.
13605 2004-11-25 Ben Maurer <bmaurer@ximian.com>
13607 * statement.cs (Using.EmitExpressionFinally): make this work right
13608 for valuetypes. Fixes 69926.
13610 2004-11-25 Miguel de Icaza <miguel@ximian.com>
13612 * const.cs (Const.ChangeType): Cope with the "0 literal can be
13613 converted to an enum" here, before we try to change the underlying
13614 type. This code exists, but it is a different code path than the
13615 one used while encoding constants.
13617 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
13618 old bug: when converting from the null literal to a pointer,
13619 return an EmptyCast, not the NullLiteral.
13621 This fixes #69921, the recent null_type changes probably made this
13622 bug more prominent.
13624 (ImplicitReferenceConversionExists): In addition, resynchronized
13625 the code here, so it matches the same code in
13626 ImplicitReferenceConversionExists for the `from any class-type S
13627 to any interface-type T'.
13630 2004-11-25 Marek Safar <marek.safar@seznam.cz>
13632 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
13634 2004-11-24 Miguel de Icaza <miguel@ximian.com>
13636 * cs-parser.jay: Use verbosity accordingly.
13638 2004-11-24 Marek Safar <marek.safar@seznam.cz>
13640 * expression.cs (Unary.ResolveOperator): Do not report warning;
13641 AddressOf reads from variable.
13643 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
13645 2004-11-24 Marek Safar <marek.safar@seznam.cz>
13649 * attribute.cs (Attributable): Removed CheckTargets.
13650 (Attributes.Emit): Explicit attribute targets are tested here.
13652 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
13653 not enabled for interfaces.
13655 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
13656 (GetAssemblyName): Ouch next bug there.
13658 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
13660 * expression.cs: Error 275 added.
13662 2004-11-23 Marek Safar <marek.safar@seznam.cz>
13664 Fix bug #69177 (Implemented decimal constant support)
13666 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
13667 (BinaryFold): Add DecimalConstant.
13669 * const.cs (Define): Decimal constant
13671 (ChangeType): Add decimal type handling.
13672 (LookupConstantValue): Don't set value for decimal type but
13673 emit DecimalConstantAttribute. Needed for constant optimization.
13675 * constant.cs (ToDecimal): New method.
13676 (ConvertToDecimal): New method.
13677 (IntConstant): Implemented ConvertToDecimal.
13678 (DecimalConstant.Emit): Emit optimized version for decimals in
13681 * expression.cs (ResolveOperator): Changed order of constant
13682 reduction to work correctly with native types which have
13683 overloaded operators.
13684 (ResolveMemberAccess): Extract constant value from attribute
13687 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
13689 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
13690 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
13691 (ChangeType): Decimal is special.
13692 (TypeToCoreType): Add decimal type.
13694 2004-11-22 Marek Safar <marek.safar@seznam.cz>
13696 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
13699 2004-11-22 Marek Safar <marek.safar@seznam.cz>
13701 * class.cs (EventField.ApplyAttributeBuilder): Fix error
13704 2004-11-19 Marek Safar <marek.safar@seznam.cz>
13706 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
13708 * pending.cs (PendingImplementation): Grab only interfaces.
13710 2004-11-19 Marek Safar <marek.safar@seznam.cz>
13712 * statement.cs (ForeachHelperMethods): Add location member and
13713 error 202 detection.
13715 2004-11-19 Raja R Harinath <rharinath@novell.com>
13717 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
13718 automatically handled by executable.make.
13719 (PROGRAM): Make profile-specific.
13721 2004-11-18 Marek Safar <marek.safar@seznam.cz>
13723 * expression.cs (DoResolveBase): Fixed wrong warning for out
13726 2004-11-18 Martin Baulig <martin@ximian.com>
13728 Merged latest changes into gmcs. Please keep this comment in
13729 here, it makes it easier for me to see what changed in MCS since
13730 the last time I merged.
13732 2004-11-17 Raja R Harinath <rharinath@novell.com>
13734 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
13735 (TypeHandle.GetMemberCache): New.
13736 (TypeHandle.TypeHandle): Update.
13737 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
13738 (TypeManager.LookupParentInterfacesCache):
13739 Rename from LookupInterfaceCache. Optimize slightly.
13740 (TypeManager.MemberLookup_FindMembers): Update.
13741 * decl.cs (MemberCache.MemberCache): Set Container to null in the
13742 multi-type variant.
13743 (AddCacheContents): Rename from AddHashtable.
13744 * class.cs (TypeContainer.parent_container): Remove.
13745 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
13746 (TypeContainer.DoDefineMembers): Don't initialize it.
13747 Update to name changes.
13749 2004-11-17 Miguel de Icaza <miguel@ximian.com>
13751 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
13752 that factors the code to check access modifiers on override.
13754 (PropertyBase): Use the code here.
13756 Patch from Lluis S'anchez, fixes bug #69361.
13758 2004-11-15 Miguel de Icaza <miguel@ximian.com>
13760 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
13761 routine that is used to report the use of a captured variable
13762 whose address has been taken.
13764 There are two checks: one when variables are being captured and
13765 the other check is when the address of a variable is taken.
13767 (because an anonymous methods might be resolved before *or* after
13768 the address has been taken) and
13770 * expression.cs (Conditional.DoResolve): Remove the special
13771 casing that Martin added to trueExpr and falseExpr being both
13772 NullLiteral. We get the right behavior now just by introducing
13773 the null_type into the compiler.
13775 * convert.cs (ExplicitConversion): Change the code to use
13776 null_type instead of testing `expr is NullLiteral'.
13777 (ImplicitConversionStandard): use null_type too.
13778 (ImplicitReferenceConversionExists): use null_type too.
13779 (ImplicitReferenceConversion): use null_type too.
13781 * literal.cs: The type of `NullLiteral' is now null_type instead
13783 (Resolve): Set the type here.
13785 * typemanager.cs: Introduce null_type.
13787 2004-11-17 Martin Baulig <martin@ximian.com>
13789 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
13790 direction, like FindMembers() does. Fixes #69546, testcase is in
13793 2004-11-16 Martin Baulig <martin@ximian.com>
13795 This is based on a patch from Marek Safar, see bug #69082.
13796 Fixes bugs #63705 and #67130.
13798 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
13799 method; create a MemberCache for an interface type and cache the
13802 * decl.cs (IMemberContainer.ParentContainer): Removed.
13803 (IMemberContainer.ParentCache): New property.
13804 (MemberCache.SetupCacheForInterface): Removed.
13805 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
13806 to create a cache for an interface's "parent".
13808 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
13811 2004-11-16 Martin Baulig <martin@ximian.com>
13813 Merged back from gmcs; these changes already went into gmcs a
13814 couple of weeks ago.
13817 (TypeManager.AddUserType): Removed the `ifaces' argument.
13818 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
13820 (TypeManager.AddUserInterface): Removed.
13821 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
13823 (TypeManager.GetInterfaces): Likewise.
13824 (TypeManager.GetExplicitInterfaces): Likewise.
13826 * ecore.cs (TypeExpr.GetInterfaces): Removed.
13828 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
13829 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
13831 2004-11-14 Ben Maurer <bmaurer@ximian.com>
13833 * statement.cs: Avoid adding bools to a hashtable.
13835 2004-11-07 Miguel de Icaza <miguel@ximian.com>
13837 * expression.cs (Invocation.OverloadResolve): Flag error if we are
13838 calling an unsafe method from a safe location.
13840 2004-11-06 Marek Safar <marek.safar@seznam.cz>
13843 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
13845 2004-11-06 Miguel de Icaza <miguel@ximian.com>
13847 * namespace.cs (VerifyUsing): use GetPartialName instead of
13850 2004-11-05 Miguel de Icaza <miguel@ximian.com>
13852 * statement.cs (Return.Resolve): Fix regression in typo: if
13853 `in_exc', we have to request a NeedReturnLabel, this was a typo
13854 introduced in the anonymous method check-in. Fixes #69131.
13856 * Indexers were using the ShortName when defining themselves,
13857 causing a regression in the compiler bootstrap when applying the
13858 patch from 2004-11-02 (first part), now they use their full name
13859 and the bug is gone.
13861 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
13863 * driver.cs: Strip the path from the names of embedded resources. Fixes
13866 2004-11-04 Raja R Harinath <rharinath@novell.com>
13868 Fix error message regression: cs0104-2.cs.
13869 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
13870 (AliasEntry.Resolve): Update.
13871 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
13873 (RootContext.LookupType): Update.
13875 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
13877 * cs-parser.jay: Add support for handling accessor modifiers
13878 * class: Add support port accessor modifiers and error checking,
13879 define PropertyMethod.Define as virtual (not abstract anymore)
13880 * ecore.cs: Add checking for proeprties access with access modifiers
13881 * iterators.cs: Modify Accessor constructor call based in the modified
13883 2004-11-02 Ben Maurer <bmaurer@ximian.com>
13885 * expression.cs (StringConcat): Handle being called twice,
13886 as when we have a concat in a field init with more than two
13889 2004-11-02 Miguel de Icaza <miguel@ximian.com>
13891 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
13892 special case explicit implementations, we should always produce
13893 the .property or .event declaration.
13895 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
13896 since it will not return correct data if people use this
13897 unresolved in the presence of using statements (see test-313).
13899 * class.cs (MethodData.Define): If we are an explicit interface
13900 implementation, set the method name to the full name of the
13901 interface plus the name of the method.
13903 Notice that using the method.MethodName.GetFullName() does not
13904 work, as it will only contain the name as declared on the source
13905 file (it can be a shorthand in the presence of using statements)
13906 and not the fully qualifed type name, for example:
13910 class D : ICloneable {
13911 object ICloneable.Clone () {
13915 Would produce a method called `ICloneable.Clone' instead of
13916 `System.ICloneable.Clone'.
13918 * namespace.cs (Alias.Resolve): Use GetPartialName.
13920 2004-11-01 Marek Safar <marek.safar@seznam.cz>
13922 * cs-parser.jay: Add error 1055 report.
13924 2004-11-01 Miguel de Icaza <miguel@ximian.com>
13926 * assign.cs (Assign.DoResolve): Only do the transform of
13927 assignment into a New if the types are compatible, if not, fall
13928 through and let the implicit code deal with the errors and with
13929 the necessary conversions.
13931 2004-11-01 Marek Safar <marek.safar@seznam.cz>
13933 * cs-parser.jay: Add error 1031 report.
13935 * cs-tokenizer.cs: Add location for error 1038.
13937 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13939 * cs-parser.jay: Add error 1016 report.
13941 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13943 * cs-parser.jay: Add errors 1575,1611 report.
13945 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13947 * cs-parser.jay: Add error 1001 report.
13949 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13952 * attribute.cs (GetMarshal): Add method argument for
13953 caller identification.
13955 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
13956 agument for GetMarshal and RuntimeMissingSupport.
13958 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13960 * attribute.cs (ExtractSecurityPermissionSet): Removed
13961 TypeManager.code_access_permission_type.
13963 * typemanager.cs: Removed TypeManager.code_access_permission_type.
13965 2004-10-27 Miguel de Icaza <miguel@ximian.com>
13967 * expression.cs (LocalVariableReference.DoResolveLValue): Check
13968 for obsolete use of a variable here. Fixes regression on errors
13969 cs0619-25 and cs0619-26.
13971 2004-10-27 Marek Safar <marek.safar@seznam.cz>
13973 Fix #62358, implemented security attribute encoding.
13975 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
13976 Tests permitted SecurityAction for assembly or other types.
13977 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
13978 data from SecurityPermissionAttribute to PermisionSet class.
13980 * class.cs (ApplyAttributeBuilder): Added special handling
13981 for System.Security.Permissions.SecurityAttribute based types.
13983 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
13984 special handling for System.Security.Permissions.SecurityAttribute
13987 * enum.cs (ApplyAttributeBuilder): Added special handling
13988 for System.Security.Permissions.SecurityAttribute based types.
13990 * parameter.cs (ApplyAttributeBuilder): Added special handling
13991 for System.Security.Permissions.SecurityAttribute based types.
13993 * rootcontext.cs: Next 2 core types.
13995 * typemanager.cs (TypeManager.security_permission_attr_type):
13996 Built in type for the SecurityPermission Attribute.
13997 (code_access_permission_type): Build in type.
13999 2004-10-17 Miguel de Icaza <miguel@ximian.com>
14001 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
14002 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
14003 all of this information into
14004 EmitContext.EmitCapturedVariableInstance.
14006 * codegen.cs (EmitCapturedVariableInstance): move here the
14007 funcionality of emitting an ldarg.0 in the presence of a
14008 remapping. This centralizes the instance emit code.
14010 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
14011 then emit a load of this: it means that we have reached the
14012 topmost ScopeInfo: the one that contains the pointer to the
14013 instance of the class hosting the anonymous method.
14015 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
14016 captures to the topmost CaptureContext.
14018 2004-10-12 Miguel de Icaza <miguel@ximian.com>
14020 * expression.cs (LocalVariableReference): Move the knowledge about
14021 the iterators into codegen's EmitCapturedVariableInstance.
14023 2004-10-11 Miguel de Icaza <miguel@ximian.com>
14025 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
14026 all code paths return a value from an anonymous method (it is the
14027 same as the 161 error, but for anonymous methods).
14029 2004-10-08 Miguel de Icaza <miguel@ximian.com>
14031 The introduction of anonymous methods in the compiler changed
14032 various ways of doing things in the compiler. The most
14033 significant one is the hard split between the resolution phase
14034 and the emission phases of the compiler.
14036 For instance, routines that referenced local variables no
14037 longer can safely create temporary variables during the
14038 resolution phase: they must do so from the emission phase,
14039 since the variable might have been "captured", hence access to
14040 it can not be done with the local-variable operations from the runtime.
14044 (Block.Flags): New flag `IsTopLevel' to indicate that this block
14045 is a toplevel block.
14047 (ToplevelBlock): A new kind of Block, these are the blocks that
14048 are created by the parser for all toplevel method bodies. These
14049 include methods, accessors and anonymous methods.
14051 These contain some extra information not found in regular blocks:
14052 A pointer to an optional CaptureContext (for tracking captured
14053 local variables and parameters). A pointer to the parent
14056 (Return.Resolve): Catch missmatches when returning a value from an
14057 anonymous method (error 1662).
14058 Invoke NeedReturnLabel from the Resolve phase instead of the emit
14061 (Break.Resolve): ditto.
14063 (SwitchLabel): instead of defining the labels during the
14064 resolution phase, we now turned the public ILLabel and ILLabelCode
14065 labels into methods called GetILLabelCode() and GetILLabel() that
14066 only define the label during the Emit phase.
14068 (GotoCase): Track the SwitchLabel instead of the computed label
14069 (its contained therein). Emit the code by using
14070 SwitchLabel.GetILLabelCode ().
14072 (LocalInfo.Flags.Captured): A new flag has been introduce to track
14073 whether the Local has been captured or not.
14075 (LocalInfo.IsCaptured): New property, used to tell whether the
14076 local has been captured.
14078 * anonymous.cs: Vastly updated to contain the anonymous method
14081 The main classes here are: CaptureContext which tracks any
14082 captured information for a toplevel block and ScopeInfo used to
14083 track the activation frames for various local variables.
14085 Each toplevel block has an optional capture context associated
14086 with it. When a method contains an anonymous method both the
14087 toplevel method and the anonymous method will create a capture
14088 context. When variables or parameters are captured, they are
14089 recorded on the CaptureContext that owns them, for example:
14093 MyDelegate d = delegate {
14098 Here `a' will be recorded as captured on the toplevel
14099 CapturedContext, the inner captured context will not have anything
14100 (it will only have data if local variables or parameters from it
14101 are captured in a nested anonymous method.
14103 The ScopeInfo is used to track the activation frames for local
14104 variables, for example:
14106 for (int i = 0; i < 10; i++)
14107 for (int j = 0; j < 10; j++){
14108 MyDelegate d = delegate {
14113 At runtime this captures a single captured variable `i', but it
14114 captures 10 different versions of the variable `j'. The variable
14115 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
14116 recorded on a child.
14118 The toplevel ScopeInfo will also track information like the `this'
14119 pointer if instance variables were referenced (this is necessary
14120 as the anonymous method lives inside a nested class in the host
14121 type of the method).
14123 (AnonymousMethod): Expanded to track the Toplevel, implement
14124 `AnonymousMethod.Compatible' to tell whether an anonymous method
14125 can be converted to a target delegate type.
14127 The routine now also produces the anonymous method content
14129 (AnonymousDelegate): A helper class that derives from
14130 DelegateCreation, this is used to generate the code necessary to
14131 produce the delegate for the anonymous method that was created.
14133 * assign.cs: API adjustments for new changes in
14134 Convert.ImplicitStandardConversionExists.
14136 * class.cs: Adjustments to cope with the fact that now toplevel
14137 blocks are of type `ToplevelBlock'.
14139 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
14140 insteda of standard blocks.
14142 Flag errors if params arguments are passed to anonymous methods.
14144 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
14145 `CurrentAnonymousMethod' which points to the current Anonymous
14146 Method. The variable points to the AnonymousMethod class that
14147 holds the code being compiled. It is set in the new EmitContext
14148 created for the anonymous method.
14150 (EmitContext.Phase): Introduce a variable and an enumeration to
14151 assist in enforcing some rules about when and where we are allowed
14152 to invoke certain methods (EmitContext.NeedsReturnLabel is the
14153 only one that enfonces this right now).
14155 (EmitContext.HaveCaptureInfo): new helper method that returns
14156 whether we have a CapturedContext initialized.
14158 (EmitContext.CaptureVariable): New method used to register that a
14159 LocalInfo must be flagged for capturing.
14161 (EmitContext.CapturedParameter): New method used to register that a
14162 parameters must be flagged for capturing.
14164 (EmitContext.CapturedField): New method used to register that a
14165 field must be flagged for capturing.
14167 (EmitContext.HaveCapturedVariables,
14168 EmitContext.HaveCapturedFields): Return whether there are captured
14169 variables or fields.
14171 (EmitContext.EmitMethodHostInstance): This is used to emit the
14172 instance for the anonymous method. The instance might be null
14173 (static methods), this (for anonymous methods that capture nothing
14174 and happen to live side-by-side with the current method body) or a
14175 more complicated expression if the method has a CaptureContext.
14177 (EmitContext.EmitTopBlock): Routine that drives the emission of
14178 code: it will first resolve the top block, then emit any metadata
14179 and then emit the code. The split is done so that we can extract
14180 any anonymous methods and flag any captured variables/parameters.
14182 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
14183 during this phase, the ILGenerator should not be used as labels
14184 and local variables declared here might not be accessible to any
14185 code that is part of an anonymous method.
14187 Exceptions to this include the temporary variables that are
14188 created by some statements internally for holding temporary
14191 (EmitContext.EmitMeta): New routine, in charge of emitting all the
14194 (EmitContext.TemporaryReturn): This method is typically called
14195 from the Emit phase, and its the only place where we allow the
14196 ReturnLabel to be defined other than the EmitMeta. The reason is
14197 that otherwise we would have to duplicate a lot of logic in the
14198 Resolve phases of various methods that today is on the Emit
14201 (EmitContext.NeedReturnLabel): This no longer creates the label,
14202 as the ILGenerator is not valid during the resolve phase.
14204 (EmitContext.EmitThis): Extended the knowledge in this class to
14205 work in anonymous methods in addition to iterators.
14207 (EmitContext.EmitCapturedVariableInstance): This emits whatever
14208 code is necessary on the stack to access the instance to a local
14209 variable (the variable will be accessed as a field).
14211 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
14212 EmitContext.EmitAddressOfParameter): Routines to support
14213 parameters (not completed at this point).
14215 Removals: Removed RemapLocal and RemapLocalLValue. We probably
14216 will also remove the parameters.
14218 * convert.cs (Convert): Define a `ConstantEC' which points to a
14219 null. This is just to prefity some code that uses
14220 ImplicitStandardConversion code and do not have an EmitContext
14223 The idea is to flag explicitly that at that point in time, it is
14224 known that the conversion will not trigger the delegate checking
14225 code in implicit conversions (which requires a valid
14228 Everywhere: pass new EmitContext parameter since
14229 ImplicitStandardConversionExists now requires it to check for
14230 anonymous method conversions.
14232 (Convert.ImplicitStandardConversionExists): If the type of an
14233 expression is the anonymous_method_type, and the type is a
14234 delegate, we invoke the AnonymousMethod.Compatible method to check
14235 whether an implicit conversion is possible.
14237 (Convert.ImplicitConversionStandard): Only do implicit method
14238 group conversions if the language level is not ISO_1.
14240 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
14241 MethodInfo for the Invoke method. used by Delegate and
14244 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
14245 method conversions if the target type is a delegate.
14247 Removed extra debugging nops.
14249 (LocalVariableReference): Turn the `local_info' into a public
14252 Add `prepared' field, the same hack used for FieldExprs to cope
14253 with composed assignments, as Local variables do not necessarily
14254 operate purely on the stack as they used to: they can be captured
14257 Add `temp' for a temporary result, like fields.
14259 Refactor DoResolve and DoResolveLValue into DoResolveBase.
14261 It now copes with Local variables that are captured and emits the
14262 proper instance variable to load it from a field in the captured
14265 (ParameterReference.DoResolveBase): During the resolve phase,
14266 capture parameters if we are in an anonymous method.
14268 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
14269 anonymous method, use the EmitContext helper routines to emit the
14270 parameter reference.
14272 * iterators.cs: Set RemapToProxy to true/false during the
14275 * parameters.cs (GetParameterByName): New helper method.
14277 * typemanager.cs (anonymous_method_type) a new type that
14278 represents an anonyous method. This is always an internal type,
14279 used as a fencepost to test against the anonymous-methodness of an
14282 2004-10-20 Marek Safar <marek.safar@seznam.cz>
14284 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
14286 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
14288 2004-10-18 Martin Baulig <martin@ximian.com>
14290 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
14291 `Type' directly, but call ResolveType() on it.
14292 (Catch.Resolve): Likewise.
14293 (Foreach.Resolve): Likewise.
14295 2004-10-18 Martin Baulig <martin@ximian.com>
14297 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
14298 `Type' directly, but call ResolveType() on it.
14299 (Probe.DoResolve): Likewise.
14300 (ArrayCreation.LookupType): Likewise.
14301 (TypeOf.DoResolve): Likewise.
14302 (SizeOf.DoResolve): Likewise.
14304 2004-10-18 Martin Baulig <martin@ximian.com>
14306 * expression.cs (Invocation.BetterFunction): Put back
14307 TypeManager.TypeToCoreType().
14309 2004-10-18 Raja R Harinath <rharinath@novell.com>
14311 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
14314 2004-10-18 Martin Baulig <martin@ximian.com>
14316 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
14317 `Type' directly, but call ResolveType() on it.
14319 2004-10-18 Martin Baulig <martin@ximian.com>
14321 * class.cs (FieldMember.Define): Don't access the TypeExpr's
14322 `Type' directly, but call ResolveType() on it.
14323 (MemberBase.DoDefine): Likewise.
14325 * expression.cs (New.DoResolve): Don't access the TypeExpr's
14326 `Type' directly, but call ResolveType() on it.
14327 (ComposedCast.DoResolveAsTypeStep): Likewise.
14329 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
14330 `Type' directly, but call ResolveType() on it.
14332 2004-10-17 John Luke <john.luke@gmail.com>
14334 * class.cs (Operator.GetSignatureForError): use CSharpName
14336 * parameter.cs (Parameter.GetSignatureForError): Returns
14337 correct name even if was not defined.
14339 2004-10-13 Raja R Harinath <rharinath@novell.com>
14342 * class.cs (TypeContainer.EmitContext): New property.
14343 (DefineNestedTypes): Create an emitcontext for each part.
14344 (MethodCore.DoDefineParameters): Use container's emitcontext.
14345 Pass type array to InternalParameters.
14346 (MemberBase.DoDefine): Use container's emitcontext.
14347 (FieldMember.Define): Likewise.
14348 (Event.Define): Likewise.
14349 (SetMethod.GetParameterInfo): Change argument to EmitContext.
14350 Pass type array to InternalParameters.
14351 (SetIndexerMethod.GetParameterInfo): Likewise.
14352 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
14353 * delegate.cs (Define): Pass emitcontext to
14354 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
14355 array to InternalParameters.
14356 * expression.cs (ParameterReference.DoResolveBase): Pass
14357 emitcontext to GetParameterInfo.
14358 (ComposedCast.DoResolveAsTypeStep): Remove check on
14359 ec.ResolvingTypeTree.
14360 * parameter.cs (Parameter.Resolve): Change argument to
14361 EmitContext. Use ResolveAsTypeTerminal.
14362 (Parameter.GetSignature): Change argument to EmitContext.
14363 (Parameters.ComputeSignature): Likewise.
14364 (Parameters.ComputeParameterTypes): Likewise.
14365 (Parameters.GetParameterInfo): Likewise.
14366 (Parameters.ComputeAndDefineParameterTypes): Likewise.
14367 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
14368 * support.cs (InternalParameters..ctor): Remove variant that takes
14370 * typemanager.cs (system_intptr_expr): New.
14371 (InitExpressionTypes): Initialize it.
14373 2004-10-12 Chris Toshok <toshok@ximian.com>
14375 * cs-parser.jay: fix location for try_statement and catch_clause.
14377 2004-10-11 Martin Baulig <martin@ximian.com>
14379 * report.cs: Don't make --fatal abort on warnings, we have
14380 -warnaserror for that.
14382 2004-10-07 Raja R Harinath <rharinath@novell.com>
14384 More DeclSpace.ResolveType avoidance.
14385 * decl.cs (MemberCore.InUnsafe): New property.
14386 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
14387 with newly created EmitContext.
14388 (FieldMember.Define): Likewise.
14389 * delegate.cs (Delegate.Define): Likewise.
14390 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
14391 only if normal name-lookup fails.
14392 (TypeExpr.DoResolve): Enable error-checking.
14393 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
14394 (SizeOf.DoResolve): Likewise.
14395 (ComposedCast.DoResolveAsTypeStep): Likewise.
14396 (StackAlloc.DoResolve): Likewise.
14397 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
14398 (Block.Unsafe): New property.
14399 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
14400 (Unsafe): Set 'unsafe' flag of contained block.
14401 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
14402 (Fixed.Resolve): Likewise.
14403 (Catch.Resolve): Likewise.
14404 (Using.ResolveLocalVariableDecls): Likewise.
14405 (Foreach.Resolve): Likewise.
14407 2004-10-05 John Luke <john.luke@gmail.com>
14409 * cs-parser.jay: add location to error CS0175
14411 2004-10-04 Miguel de Icaza <miguel@ximian.com>
14413 * ecore.cs (Expression.Constantity): Add support for turning null
14416 * const.cs (Const.Define): Allow constants to be reference types
14417 as long as the value is Null.
14419 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
14421 * namespace.cs (NamespaceEntry.Using): No matter which warning
14422 level is set, check if this namespace name has already been added.
14424 2004-10-03 Ben Maurer <bmaurer@ximian.com>
14426 * expression.cs: reftype [!=]= null should always use br[true,false].
14429 2004-10-03 Marek Safar <marek.safar@seznam.cz>
14432 * attribute.cs: Enum conversion moved to
14433 GetAttributeArgumentExpression to be applied to the all
14436 2004-10-01 Raja R Harinath <rharinath@novell.com>
14438 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
14439 * class.c (TypeContainer.DefineType): Flag error if
14440 base types aren't accessible due to access permissions.
14441 * decl.cs (DeclSpace.ResolveType): Move logic to
14442 Expression.ResolveAsTypeTerminal.
14443 (DeclSpace.ResolveTypeExpr): Thin layer over
14444 Expression.ResolveAsTypeTerminal.
14445 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
14446 Refactor code into NestedAccess. Use it.
14447 (DeclSpace.NestedAccess): New.
14448 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
14449 argument to silence errors. Check access permissions.
14450 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
14451 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
14452 (Cast.DoResolve): Likewise.
14453 (New.DoResolve): Likewise.
14454 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
14455 (TypeOf.DoResolve): Likewise.
14457 * expression.cs (Invocation.BetterConversion): Return the Type of
14458 the better conversion. Implement section 14.4.2.3 more faithfully.
14459 (Invocation.BetterFunction): Make boolean. Make correspondence to
14460 section 14.4.2.2 explicit.
14461 (Invocation.OverloadResolve): Update.
14462 (Invocation): Remove is_base field.
14463 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
14464 (Invocation.Emit): Likewise.
14466 2004-09-27 Raja R Harinath <rharinath@novell.com>
14468 * README: Update to changes.
14470 2004-09-24 Marek Safar <marek.safar@seznam.cz>
14472 * cs-parser.jay: Reverted 642 warning fix.
14474 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14477 * decl.cs (FindMemberWithSameName): Indexer can have more than
14480 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14482 * expression.cs (LocalVariableReference.DoResolveLValue):
14483 Do not report warning 219 for out values.
14484 (EmptyExpression.Null): New member to avoid extra allocations.
14486 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14488 * cs-parser.jay: Fix wrong warning 642 report.
14490 * cs-tokenizer.cs (CheckNextToken): New helper;
14491 Inspect next character if is same as expected.
14493 2004-09-23 Martin Baulig <martin@ximian.com>
14495 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
14496 (Convert.ImplicitReferenceConversionExists): Likewise.
14498 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14500 * class.cs (Operator.Define): Add error 448 and 559 report.
14502 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14504 * class.cs (MemberBase.IsTypePermitted): New protected
14505 method for checking error CS0610.
14507 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14509 * class.cs (TypeContainer.HasExplicitLayout): New property
14510 Returns whether container has StructLayout attribute set Explicit.
14511 (FieldMember): New abstract class for consts and fields.
14512 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
14513 (Field): Reuse FieldMember.
14515 * const.cs (Const): Reuse FieldMember.
14517 * rootcontext.cs: EmitConstants call moved to class.
14519 2004-09-22 Martin Baulig <martin@ximian.com>
14521 Thanks to Peter Sestoft for this bug report.
14523 * expression.cs (Conditional): If both the `trueExpr' and the
14524 `falseExpr' is a NullLiteral, return a NullLiteral.
14526 2004-09-22 Martin Baulig <martin@ximian.com>
14528 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
14529 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
14530 for the "get_Current" call.
14532 2004-09-22 Martin Baulig <martin@ximian.com>
14534 Marek and me just fixed one of our oldest bugs: #28562 :-)
14536 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
14538 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
14539 we're an EnumConstant, just return that.
14540 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
14541 an EnumConstant. In this case, we need to use GetValueAsEnumType()
14542 to get the value which'll actually be written into the attribute.
14543 However, we have to use GetValue() to access the attribute's value
14546 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14548 * constant.cs (Constant.IsNegative): New abstract property
14551 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
14552 (StackAlloc.DoResolve): Reused IsNegative.
14554 2004-09-21 Martin Baulig <martin@ximian.com>
14556 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
14557 if we're used in an iterator, we may be called from different
14560 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
14561 we actually have an exception block.
14563 2004-09-20 John Luke <jluke@cfl.rr.com>
14565 * class.cs, cs-parser.jay: Improve the error report for 1520:
14566 report the actual line where the error happens, not where the
14567 class was declared.
14569 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
14570 Pass location information that was available elsewhere.
14572 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
14574 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
14575 runtime to delay sign assemblies.
14577 2004-09-19 Miguel de Icaza <miguel@ximian.com>
14579 * cs-parser.jay: Do not report the stack trace, this is barely
14582 2004-08-22 John Luke <john.luke@gmail.com>
14584 * driver.cs : check that a resource id is not already used
14585 before adding it, report CS1508 if it is, bug #63637
14587 2004-09-19 Miguel de Icaza <miguel@ximian.com>
14589 * ecore.cs: Removed dead code.
14591 2004-09-18 Marek Safar <marek.safar@seznam.cz>
14593 * class.cs: Do not report warning CS0067 on the interfaces.
14595 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14597 * cs-parser.jay: Add error 504 report.
14599 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14601 * rootcontext.cs: WarningLevel is 4 by default now.
14603 * statement.cs (Fixed.Resolve): Do not null
14606 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14609 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
14610 deep search when property is not virtual.
14611 (PropertyExpr.ResolveAccessors): Make one call for both
14614 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14617 * statement.cs: Error 152 report constains also location.
14619 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14622 * const.cs: Explicitly set constant as static.
14624 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14627 * cs-parser.jay: Add error 1017 report.
14629 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14631 Fixed bug #59980, #64224
14632 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
14634 * typemanager.cs (IsSpecialMethod): Simplified
14636 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14638 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
14639 condition with better params.
14641 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14644 * attribute.cs (Resolve): Property has to have both
14647 2004-09-14 Martin Baulig <martin@ximian.com>
14649 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
14651 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14654 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
14655 called and is obsolete then this member suppress message
14656 when call is inside next [Obsolete] method or type.
14658 * expression.cs: Use TestObsoleteMethodUsage member.
14660 2004-09-14 Martin Baulig <martin@ximian.com>
14662 * cs-parser.jay: Sync a bit with the GMCS version.
14664 2004-09-14 Martin Baulig <martin@ximian.com>
14666 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
14667 (CSharpParser.yacc_verbose_flag): New public field.
14669 * genericparser.cs: Removed.
14671 2004-09-14 Raja R Harinath <rharinath@novell.com>
14673 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
14675 2004-09-13 Marek Safar <marek.safar@seznam.cz>
14677 * class.cs (MethodCore.CheckBase): Fix bug #65757.
14679 2004-09-10 Martin Baulig <martin@ximian.com>
14681 Backported my MemberName changes from GMCS into MCS.
14683 - we are now using a special `MemberName' class instead of using
14684 strings; in GMCS, the `MemberName' also contains the type
14687 - changed the grammar rules a bit:
14688 * the old `member_name' is now a `namespace_or_type_name':
14689 The rule is that we use `namespace_or_type_name' everywhere
14690 where we expect either a "member name" (GetEnumerator) or a
14691 "member name" with an explicit interface name
14692 (IEnumerable.GetEnumerator).
14693 In GMCS, the explicit interface name may include type arguments
14694 (IEnumerable<T>.GetEnumerator).
14695 * we use `member_name' instead of just `IDENTIFIER' for
14697 The rule is that we use `member_name' wherever a member may
14698 have type parameters in GMCS.
14700 * decl.cs (MemberName): New public class.
14701 (MemberCore.MemberName): New public readonly field.
14702 (MemberCore.ctor): Take a `MemberName' argument, not a string.
14703 (DeclSpace): Likewise.
14705 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
14706 * enum.cs (Enum.ctor): Likewise.
14708 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
14710 (AliasEntry.ctor): Take a MemberName, not an Expression.
14711 (AliasEntry.UsingAlias): Likewise.
14713 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
14714 (IMethodData.MemberName): Changed type from string to MemberName.
14715 (MemberBase.ExplicitInterfaceName): Likewise.
14716 (AbstractPropertyEventMethod.SetupName): Make this private.
14717 (AbstractPropertyEventMethod.ctor): Added `string prefix'
14718 argument; compute the member name here.
14719 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
14720 on the `member.MemberName' and the `prefix'.
14722 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
14724 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
14725 thus, we get a `MemberName' instead of a `string'. These
14726 declarations may have type parameters in GMCS.
14727 (interface_method_declaration, delegate_declaration): Likewise.
14728 (class_declaration, interface_declaration): Likewise.
14729 (method_header): Use `namespace_or_type_name' instead of
14730 `member_name'. We may be an explicit interface implementation.
14731 (property_declaration, event_declaration): Likewise.
14732 (member_name): This is now just an `IDENTIFIER', not a
14733 `namespace_or_type_name'.
14734 (type_name, interface_type): Removed.
14735 (namespace_or_type_name): Return a MemberName, not an Expression.
14736 (primary_expression): Use `member_name' instead of `IDENTIFIER';
14737 call GetTypeExpression() on the MemberName to get an expression.
14738 (IndexerDeclaration.interface_type): Changed type from string to
14740 (MakeName): Operate on MemberName's instead of string's.
14742 2004-09-13 Raja R Harinath <rharinath@novell.com>
14745 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
14746 (NamespaceEntry.Lookup): Add new argument to flag if we want the
14747 lookup to avoid symbols introduced by 'using'.
14748 * rootcontext.cs (NamespaceLookup): Update.
14750 2004-09-12 Marek Safar <marek.safar@seznam.cz>
14752 * class.cs (TypeContainer.DoDefineMembers): Do not call
14753 DefineDefaultConstructor for static classes.
14755 2004-09-12 Marek Safar <marek.safar@seznam.cz>
14757 * attribute.cs (Attribute.Resolve): Add error 653 report.
14759 * class.cs (Class.ApplyAttributeBuilder): Add error 641
14761 (Method.ApplyAttributeBuilder): Add error 685 report.
14762 (Operator.Define): Add error 564 report.
14764 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
14766 * expression.cs (Invocation.DoResolve): Add error
14767 245 and 250 report.
14769 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
14772 2004-09-11 Marek Safar <marek.safar@seznam.cz>
14774 * class.cs (ConstructorInitializer.Resolve):
14775 Wrong error number (515->516).
14777 2004-09-11 Marek Safar <marek.safar@seznam.cz>
14779 * class.cs (Indexer.Define): Add error 631 report.
14781 2004-09-11 Marek Safar <marek.safar@seznam.cz>
14783 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
14785 2004-09-11 Marek Safar <marek.safar@seznam.cz>
14787 * expression.cs (Probe.DoResolve): Add error CS0241 report.
14789 2004-09-10 Marek Safar <marek.safar@seznam.cz>
14791 * cs-parser.jay: Added error CS0241 report.
14793 2004-09-10 Raja R Harinath <rharinath@novell.com>
14795 * cs-parser.jay (fixed_statement): Introduce a scope for the
14796 declaration in the 'fixed' statement.
14798 2004-09-09 Marek Safar <marek.safar@seznam.cz>
14800 * cs-parser.jay: Added CS0230 error report.
14802 2004-09-09 Marek Safar <marek.safar@seznam.cz>
14804 * cs-parser.jay: Added errors CS0231 and CS0257 report.
14806 2004-09-09 Marek Safar <marek.safar@seznam.cz>
14808 * expression.cs (Argument.Resolve): Added error CS0192 and
14811 2004-09-09 Marek Safar <marek.safar@seznam.cz>
14813 C# 2.0 #pragma warning feature
14815 * cs-tokenizer.cs (PreProcessPragma): New method;
14816 Handles #pragma directive.
14818 * report.cs (WarningRegions): New class; Support
14819 class for #pragma warning directive. It tests whether
14820 warning is enabled for a given line.
14822 2004-09-08 Miguel de Icaza <miguel@ximian.com>
14824 * const.cs: Add more descriptive error report, tahnks to
14827 2004-09-08 Marek Safar <marek.safar@seznam.cz>
14829 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
14831 2004-09-07 Miguel de Icaza <miguel@ximian.com>
14833 * expression.cs: Apply patch from Ben: Remove dead code from
14834 ArrayCreation, and remove the TurnintoConstant call in const.cs,
14835 as that code just threw an exception anwyays.
14837 * const.cs: Remove the call to the turnintoconstant, for details
14840 * literal.cs: The type of the null-literal is the null type; So
14841 we use a placeholder type (literal.cs:System.Null, defined here)
14844 * expression.cs (Conditional.DoResolve): Remove some old code that
14845 is no longer needed, conversions have been fixed.
14847 (ArrayCreationExpression.DoResolve): Return false if we fail to
14848 resolve the inner expression.
14850 2004-09-07 Raja R Harinath <rharinath@novell.com>
14853 * cs-parser.jay (delegate_declaration): Record a delegate
14854 declaration as a type declaration.
14855 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
14857 2004-09-06 Miguel de Icaza <miguel@ximian.com>
14859 * parameter.cs: Do not crash if the type can not be resolved.
14861 * expression.cs: Report errors with unsafe pointers, fixes #64896
14863 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
14865 * expression.cs: Pointer arith always needs to do a conv.i
14866 if the operand is a long. fix 65320
14868 2004-09-04 Marek Safar <marek.safar@seznam.cz>
14870 Fixed cs0619-37.cs, cs0619-38.cs
14872 * enum.cs (GetObsoleteAttribute): Removed.
14874 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
14875 on Enum member is double staged. The first is tested member
14878 2004-09-04 Marek Safar <marek.safar@seznam.cz>
14880 Fixed #56986, #63631, #65231
14882 * class.cs: (TypeContainer.AddToMemberContainer): New method,
14883 adds member to name container.
14884 (TypeContainer.AddToTypeContainer): New method, adds type to
14886 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
14887 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
14888 AddOperator): Simplified by reusing AddToMemberContainer.
14889 (TypeContainer.UserDefinedStaticConstructor): Changed to property
14891 (Method.CheckForDuplications): Fixed implementation to test all
14893 (MemberBase): Detection whether member is explicit interface
14894 implementation is now in constructor.
14895 (MemberBase.UpdateMemberName): Handles IndexerName.
14896 (Accessor): Changed to keep also location information.
14897 (AbstractPropertyEventMethod): Is derived from MemberCore.
14898 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
14899 will be emited or not.
14900 (PropertyBase.AreAccessorsDuplicateImplementation):
14901 Tests whether accessors are not in collision with some method.
14902 (Operator): Is derived from MethodCore to simplify common
14905 * decl.cs (Flags.TestMethodDuplication): Test for duplication
14907 (DeclSpace.AddToContainer): Adds the member to defined_names
14908 table. It tests for duplications and enclosing name conflicts.
14910 * enum.cs (EnumMember): Clean up to reuse the base structures
14912 2004-09-03 Martin Baulig <martin@ximian.com>
14914 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
14915 into TypeContainer, to make partial classes work again.
14917 2004-09-03 Martin Baulig <martin@ximian.com>
14919 * rootcontext.cs (RootContext.V2): Removed.
14921 2004-03-23 Martin Baulig <martin@ximian.com>
14923 * expression.cs (Invocation.OverloadResolve): Added `bool
14924 may_fail' argument and use it instead of the Location.IsNull() hack.
14926 2004-09-03 Martin Baulig <martin@ximian.com>
14928 Merged latest changes into gmcs. Please keep this comment in
14929 here, it makes it easier for me to see what changed in MCS since
14930 the last time I merged.
14932 2004-09-03 Raja R Harinath <rharinath@novell.com>
14935 * expression.cs (BetterConversion): Don't allow either conversion
14936 to be null. Remove redundant implicit conversion test when 'q ==
14937 null' -- when this function is invoked, we already know that the
14938 implicit conversion exists.
14939 (BetterFunction): Assume that 'best' is non-null. Remove
14940 redundant reimplementation of IsApplicable when 'best' is null.
14941 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
14942 number of arguments.
14943 (IsAncestralType): Extract from OverloadResolve.
14944 (OverloadResolve): Make robust to the MethodGroupExpr being
14945 unsorted. Implement all the logic of Section 14.5.5.1, and
14946 support overloading of methods from multiple applicable types.
14947 Clean up logic somewhat. Don't pass null methods to BetterFunction.
14949 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
14950 (RealError, Warning): Append type of report to related symbol.
14952 2004-09-03 Marek Safar <marek.safar@seznam.cz>
14954 * enum.cs: Fixed CLS-Compliance checks for enum members.
14955 Error tests cs3008-8.cs, cs3014-8.cs
14957 2004-09-02 Marek Safar <marek.safar@seznam.cz>
14959 Fixed bug #62342, #63102
14960 * class.cs: ImplementIndexer uses member.IsExplicitImpl
14961 like ImplementMethod.
14963 2004-09-02 Marek Safar <marek.safar@seznam.cz>
14965 * attribute.cs (Attribute.GetAttributeArgumentExpression):
14968 2004-09-02 Martin Baulig <martin@ximian.com>
14970 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
14971 TypeManager.GetArgumentTypes() rather than calling GetParameters()
14974 2004-09-01 Marek Safar <marek.safar@seznam.cz>
14976 C# 2.0 Static classes implemented
14978 * class.cs (TypeContainer): instance_constructors,
14979 initialized_fields, initialized_static_fields,
14980 default_constructor, base_inteface_types are protected to be
14981 accessible from StaticClass.
14982 (TypeContainer.DefineDefaultConstructor): New virtual method
14983 for custom default constructor generating
14984 (StaticClass): New class to handle "Static classes" feature.
14986 * cs-parser.jay: Handle static keyword on class like instance
14989 * driver.cs: Added "/langversion" command line switch with two
14990 options (iso-1, default).
14992 2004-08-31 Marek Safar <marek.safar@seznam.cz>
14994 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
14996 2004-08-31 Miguel de Icaza <miguel@ximian.com>
14998 * delegate.cs: Style.
15000 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
15002 * delegate.cs: Add seperate instance expr field for miguel.
15004 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
15006 * PointerArithmetic (Resolve): make sure we are not doing
15007 pointer arith on void*. Also, make sure we are resolved
15008 by not setting eclass until resolve.
15010 All callers: Make sure that PointerArithmetic gets resolved.
15012 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
15014 * ArrayCreation (LookupType): If the type does not resolve
15015 to an array, give an error.
15017 2004-08-27 Marek Safar <marek.safar@seznam.cz>
15019 * statement.cs (Try.Resolve): Fixed bug #64222
15021 2004-08-27 Martin Baulig <martin@ximian.com>
15024 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
15027 2004-08-26 Marek Safar <marek.safar@seznam.cz>
15029 * ecore.cs (Constantify): Get underlying type via
15030 System.Enum.GetUnderlyingType to avoid StackOverflow on the
15031 Windows in special cases.
15033 2004-08-26 Marek Safar <marek.safar@seznam.cz>
15035 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
15036 for obtaining also private methods.
15037 (GetRemoveMethod): Used GetRemoveMethod (true)
15038 for obtaining also private methods.
15040 2004-08-24 Martin Baulig <martin@ximian.com>
15042 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
15043 MethodAttributes.HideBySig for operators.
15045 2004-08-23 Martin Baulig <martin@ximian.com>
15047 Back to the old error reporting system :-)
15049 * report.cs (Message): Removed.
15050 (Report.MessageData, ErrorData, WarningData): Removed.
15051 (Report.Error, Warning): Back to the old system.
15053 2004-08-23 Martin Baulig <martin@ximian.com>
15055 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
15057 * class.cs (TypeContainer.ParentContainer): New public virtual
15058 method; replaces the explicit interface implementation.
15059 (ClassPart.ParentContainer): Override.
15061 2004-08-23 Martin Baulig <martin@ximian.com>
15063 * statement.cs (Switch): Added support for constant switches; see
15064 #59428 or test-285.cs.
15066 2004-08-22 Marek Safar <marek.safar@seznam.cz>
15069 * statement.cs (GetEnumeratorFilter): Removed useless
15070 logic because C# specs is strict. GetEnumerator must be
15073 2004-08-22 Martin Baulig <martin@ximian.com>
15075 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15076 a switch and may break, reset the barrier. Fixes #59867.
15078 2004-08-22 Marek Safar <marek.safar@seznam.cz>
15080 CLS-Compliance speed up (~5% for corlib)
15082 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
15083 New method. Tests container for CLS-Compliant names
15085 * class.cs (TypeContainer.VerifyClsName): New method.
15086 Checks whether container name is CLS Compliant.
15087 (Constructor): Implements IMethodData.
15089 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
15090 low-case table for CLS Compliance test.
15091 (MemberCache.VerifyClsParameterConflict): New method.
15092 Checks method parameters for CS3006 error.
15094 * enum.cs (EnumMember): Is derived from MemberCore.
15095 (Enum.VerifyClsName): Optimized for better performance.
15097 2004-08-06 Marek Safar <marek.safar@seznam.cz>
15099 * report.cs: Renamed Error_T to Error and changed all
15102 2004-08-06 Marek Safar <marek.safar@seznam.cz>
15104 * class.cs (TypeContainer.IndexerArrayList): New inner class
15105 container for indexers.
15106 (TypeContainer.DefaultIndexerName): New constant for default
15107 indexer name. Replaced all "Item" with this constant.
15108 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
15110 * typemanager.cs (TypeManager.default_member_ctor): Cache here
15111 DefaultMemberAttribute constructor.
15113 2004-08-05 Martin Baulig <martin@ximian.com>
15115 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
15118 2004-08-05 Marek Safar <marek.safar@seznam.cz>
15120 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
15121 multi platforms problem.
15123 * compiler.csproj: Included shared files.
15125 2004-08-04 Marek Safar <marek.safar@seznam.cz>
15127 Fix bug 60333, 55971 in the more general way
15128 * attribute.cs (Attribute.GetAttributeArgumentExpression):
15129 Added arg_type argument for constant conversion.
15130 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
15132 2004-08-04 Marek Safar <marek.safar@seznam.cz>
15135 * class.cs (TypeContainer ): New inner classes MethodArrayList,
15136 OperatorArrayList, MethodCoreArrayList for typecontainer
15137 containers. Changed class member types to these new types.
15138 (MethodArrayList.DefineMembers): Added test for CS0659.
15140 2004-08-04 Miguel de Icaza <miguel@ximian.com>
15142 * cfold.cs: Synchronize the folding with the code in expression.cs
15143 Binary.DoNumericPromotions for uint operands.
15145 * attribute.cs: Revert patch from Raja, it introduced a regression
15146 while building Blam-1.2.1 (hard to isolate a test case).
15148 2004-08-04 Marek Safar <marek.safar@seznam.cz>
15152 (TypeContainer.Define): Renamed to DefineContainerMembers because of
15154 (MethodCore.parent_method): New member. The method we're overriding
15155 if this is an override method.
15156 (MethodCore.CheckBase): Moved from Method class and made common.
15157 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
15159 (MethodCore.CheckForDuplications): New abstract method. For custom
15160 member duplication search in a container
15161 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
15162 method and its return type.
15163 (Event.conflict_symbol): New member. Symbol with same name in the
15167 (MemberCache.FindMemberWithSameName): New method. The method
15168 is looking for conflict with inherited symbols.
15170 2004-08-04 Martin Baulig <martin@ximian.com>
15172 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
15174 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
15176 2004-08-03 Marek Safar <marek.safar@seznam.cz>
15178 * report.cs (Message): New enum for better error, warning reference in
15180 (MessageData): New inner abstract class. It generally handles printing of
15181 error and warning messages.
15182 Removed unused Error, Warning, Message methods.
15184 2004-08-03 Marek Safar <marek.safar@seznam.cz>
15186 Fix for cs0592-8.cs test
15188 (Attributable.ValidAttributeTargets): Made public.
15189 (Attribute.ExplicitTarget): New member for explicit target value.
15190 (Attribute.CheckTargets): Now we translate explicit attribute
15191 target to Target here.
15193 2004-08-03 Ben Maurer <bmaurer@ximian.com>
15195 * ecore.cs (MethodGroupExpr): new IsBase property.
15197 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
15199 * delegate.cs (DelegateCreation): store a MethodGroupExpr
15200 rather than an instance expr.
15202 (DelegateCreation.Emit): Use the method group rather than
15203 the instance expression. Also, if you have base.Foo as the
15204 method for a delegate, make sure to emit ldftn, not ldftnvirt.
15206 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
15208 (NewDelegate.DoResolve): Only check for the existance of Invoke
15209 if the method is going to be needed. Use MethodGroupExpr.
15211 (NewDelegate.Emit): Remove, DelegateCreation implements this.
15213 * expression.cs: For pointer arith., make sure to use
15214 the size of the type, not the size of the pointer to
15217 2004-08-03 Marek Safar <marek.safar@seznam.cz>
15220 * class.cs (Class): Added error CS0502 test.
15222 2004-08-03 John Luke <jluke@cfl.rr.com>
15223 Raja R Harinath <rharinath@novell.com>
15226 * attribute.cs (Attribute.complained_before): New flag.
15227 (Attribute.ResolveType, Attribute.Resolve),
15228 (Attribute.DefinePInvokeMethod): Set it.
15229 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
15231 2004-08-03 Martin Baulig <martin@ximian.com>
15233 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
15234 use a user-defined operator; we still need to do numeric
15235 promotions in case one argument is a builtin type and the other
15236 one has an implicit conversion to that type. Fixes #62322.
15238 2004-08-02 Martin Baulig <martin@ximian.com>
15240 * statement.cs (LocalInfo.Flags): Added `IsThis'.
15241 (LocalInfo.IsThis): New public property.
15242 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
15244 2004-08-01 Martin Baulig <martin@ximian.com>
15246 * class.cs (TypeContainer.GetClassBases): Don't set the default
15247 here since we may get called from GetPartialBases().
15248 (TypeContainer.DefineType): If GetClassBases() didn't return a
15249 parent, use the default one.
15251 2004-07-30 Duncan Mak <duncan@ximian.com>
15253 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
15255 2004-07-30 Martin Baulig <martin@ximian.com>
15257 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
15259 * class.cs (SourceMethod): New public class, derive from the
15260 symbol writer's ISourceMethod.
15261 (Method): Use the new symbol writer API.
15263 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
15264 as argument and use the new symbol writer.
15267 (SourceFile): Implement the symbol writer's ISourceFile.
15268 (Location.SymbolDocument): Removed.
15269 (Location.SourceFile): New public property.
15271 * symbolwriter.cs: Use the new symbol writer API.
15273 2004-07-30 Raja R Harinath <rharinath@novell.com>
15275 * Makefile (install-local): Remove. Functionality moved to
15278 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
15280 * Makefile: Install mcs.exe.config file together with mcs.exe.
15281 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
15282 correct runtime version.
15284 2004-07-25 Martin Baulig <martin@ximian.com>
15287 (TypeContainer.RegisterOrder): Removed, this was unused.
15288 (TypeContainer, interface_order): Removed.
15289 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
15290 TypeContainer as argument since we can also be called with a
15291 `PartialContainer' for a partial class/struct/interface.
15292 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
15293 of checking whether we're an `Interface' - we could be a
15294 `PartialContainer'.
15295 (PartialContainer.Register): Override; call
15296 AddClass()/AddStruct()/AddInterface() on our parent.
15298 * cs-parser.jay (interface_member_declaration): Add things to the
15299 `current_container', not the `current_class'.
15301 * rootcontext.cs (RegisterOrder): The overloaded version which
15302 takes an `Interface' was unused, removed.
15304 * typemanager.cs (TypeManager.LookupInterface): Return a
15305 `TypeContainer', not an `Interface'.
15306 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
15307 contain a `PartialContainer' for an interface, so check it's
15308 `Kind' to figure out what it is.
15310 2004-07-25 Martin Baulig <martin@ximian.com>
15312 * class.cs (Class.DefaultTypeAttributes): New public constant.
15313 (Struct.DefaultTypeAttributes): Likewise.
15314 (Interface.DefaultTypeAttributes): Likewise.
15315 (PartialContainer.TypeAttr): Override this and add the
15316 DefaultTypeAttributes.
15318 2004-07-25 Martin Baulig <martin@ximian.com>
15320 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
15321 we can just use the `Parent' field instead.
15323 2004-07-25 Martin Baulig <martin@ximian.com>
15325 * class.cs (TypeContainer.Emit): Renamed to EmitType().
15327 2004-07-25 Martin Baulig <martin@ximian.com>
15329 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
15330 our parts before defining any methods.
15331 (TypeContainer.VerifyImplements): Make this virtual.
15332 (ClassPart.VerifyImplements): Override and call VerifyImplements()
15333 on our PartialContainer.
15335 2004-07-25 Martin Baulig <martin@ximian.com>
15337 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
15339 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
15340 argument, we can just use the `Parent' field instead.
15343 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
15344 (MemberBase.DoDefine): Likewise.
15346 2004-07-24 Martin Baulig <martin@ximian.com>
15348 * decl.cs (MemberCore.Parent): New public field.
15349 (DeclSpace.Parent): Moved to MemberCore.
15351 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
15352 (MemberBase.ctor): Added TypeContainer argument, pass it to our
15354 (FieldBase, Field, Operator): Likewise.
15355 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
15356 (EventField, Event): Likewise.
15358 2004-07-23 Martin Baulig <martin@ximian.com>
15360 * class.cs (PartialContainer): New public class.
15361 (ClassPart): New public class.
15362 (TypeContainer): Added support for partial classes.
15363 (TypeContainer.GetClassBases): Splitted some of the functionality
15364 out into GetNormalBases() and GetPartialBases().
15366 * cs-tokenizer.cs (Token.PARTIAL): New token.
15367 (Tokenizer.consume_identifier): Added some hacks to recognize
15368 `partial', but only if it's immediately followed by `class',
15369 `struct' or `interface'.
15371 * cs-parser.jay: Added support for partial clases.
15373 2004-07-23 Martin Baulig <martin@ximian.com>
15375 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
15376 a `DeclSpace' and also made it readonly.
15377 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
15378 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
15379 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
15381 * cs-parser.jay: Pass the `current_class', not the
15382 `current_container' (at the moment, this is still the same thing)
15383 to a new Method, Property, Event, Indexer or Constructor.
15385 2004-07-23 Martin Baulig <martin@ximian.com>
15387 * cs-parser.jay (CSharpParser): Added a new `current_class' field
15388 and removed the `current_interface' one.
15389 (struct_declaration, class_declaration, interface_declaration):
15390 Set `current_class' to the newly created class/struct/interface;
15391 set their `Bases' and call Register() before parsing their body.
15393 2004-07-23 Martin Baulig <martin@ximian.com>
15395 * class.cs (Kind): New public enum.
15396 (TypeContainer): Made this class abstract.
15397 (TypeContainer.Kind): New public readonly field.
15398 (TypeContainer.CheckDef): New public method; moved here from
15400 (TypeContainer.Register): New public abstract method.
15401 (TypeContainer.GetPendingImplementations): New public abstract
15403 (TypeContainer.GetClassBases): Removed the `is_class' and
15404 `is_iface' parameters.
15405 (TypeContainer.DefineNestedTypes): Formerly known as
15407 (ClassOrStruct): Made this class abstract.
15409 * tree.cs (RootTypes): New public type.
15411 2004-07-20 Martin Baulig <martin@ximian.com>
15413 * tree.cs (Tree.RecordNamespace): Removed.
15414 (Tree.Namespaces): Removed.
15416 * rootcontext.cs (RootContext.IsNamespace): Removed.
15418 * cs-parser.jay (namespace_declaration): Just create a new
15419 NamespaceEntry here.
15421 2004-07-20 Martin Baulig <martin@ximian.com>
15423 * statement.cs (ExceptionStatement): New abstract class. This is
15424 now used as a base class for everyone who's using `finally'.
15425 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
15426 our local variables before using them.
15428 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
15429 virtual method. This is used by Yield.Resolve() to "steal" an
15430 outer block's `finally' clauses.
15431 (FlowBranchingException): The .ctor now takes an ExceptionStatement
15434 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
15435 version which takes an ExceptionStatement. This version must be
15436 used to create exception branchings.
15439 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
15440 (Iterator.EmitMoveNext): Added exception support; protect the
15441 block with a `fault' clause, properly handle 'finally' clauses.
15442 (Iterator.EmitDispose): Run all the `finally' clauses here.
15444 2004-07-20 Martin Baulig <martin@ximian.com>
15446 * iterator.cs: This is the first of a set of changes in the
15447 iterator code. Match the spec more closely: if we're an
15448 IEnumerable, then GetEnumerator() must be called. The first time
15449 GetEnumerator() is called, it returns the current instance; all
15450 subsequent invocations (if any) must create a copy.
15452 2004-07-19 Miguel de Icaza <miguel@ximian.com>
15454 * expression.cs: Resolve the constant expression before returning
15457 2004-07-19 Martin Baulig <martin@ximian.com>
15459 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
15460 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
15461 the return type of the new EmitContext.
15463 2004-07-18 Martin Baulig <martin@ximian.com>
15465 * class.cs (Property.Define): Fix iterators.
15467 * iterators.cs (Iterator.Define): Moved the
15468 `container.AddInterator (this)' call here from the .ctor; only do
15469 it if we resolved successfully.
15471 2004-07-17 Miguel de Icaza <miguel@ximian.com>
15473 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
15474 `true' for preprocessing directives that we parse. The return
15475 value indicates whether we should return to regular tokenizing or
15476 not, not whether it was parsed successfully.
15478 In the past if we were in: #if false ... #line #endif, we would
15479 resume parsing after `#line'. See bug 61604.
15481 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
15482 building: IsEnumType should return true only for enums, not for
15483 enums or System.Enum itself. This fixes #61593.
15485 Likely what happened is that corlib was wrong: mcs depended on
15486 this bug in some places. The bug got fixed, we had to add the
15487 hack, which caused bug 61593.
15489 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
15490 that was a workaround for the older conditions.
15492 2004-07-16 Ben Maurer <bmaurer@ximian.com>
15494 * assign.cs: IAssignMethod has a new interface, as documented
15495 inline. All assignment code now uses this new api.
15497 * ecore.cs, expression.cs: All classes which implement
15498 IAssignMethod now use the new interface.
15500 * expression.cs (Invocation): add a hack to EmitCall so that
15501 IndexerAccess can be the target of a compound assignment without
15502 evaluating its arguments twice.
15504 * statement.cs: Handle changes in Invocation api.
15506 2004-07-16 Martin Baulig <martin@ximian.com>
15508 * iterators.cs: Rewrote this. We're now using one single Proxy
15509 class for both the IEnumerable and the IEnumerator interface and
15510 `Iterator' derives from Class so we can use the high-level API.
15512 * class.cs (TypeContainer.AddIterator): New method.
15513 (TypeContainer.DoDefineType): New protected virtual method, which
15514 is called from DefineType().
15515 (TypeContainer.DoDefineMembers): Call DefineType() and
15516 DefineMembers() on all our iterators.
15517 (TypeContainer.Emit): Call Emit() on all our iterators.
15518 (TypeContainer.CloseType): Call CloseType() on all our iterators.
15520 * codegen.cs (EmitContext.CurrentIterator): New public field.
15522 2004-07-15 Martin Baulig <martin@ximian.com>
15525 (TypeManager.not_supported_exception_type): New type.
15527 2004-07-14 Martin Baulig <martin@ximian.com>
15529 * iterators.cs: Use real error numbers.
15531 2004-07-14 Martin Baulig <martin@ximian.com>
15533 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
15534 requires this to be a System.Collection.IEnumerable and not a
15535 class implementing that interface.
15536 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
15538 2004-07-13 Marek Safar <marek.safar@seznam.cz>
15540 * class.cs: Fixed previous fix, it broke some error tests.
15542 2004-07-12 Martin Baulig <martin@ximian.com>
15544 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
15547 2004-07-09 Miguel de Icaza <miguel@ximian.com>
15549 * assign.cs (LocalTemporary): Add new argument: is_address,If
15550 `is_address' is true, then the value that we store is the address
15551 to the real value, and not the value itself.
15553 * ecore.cs (PropertyExpr): use the new local temporary
15554 stuff to allow us to handle X.Y += z (where X is a struct)
15556 2004-07-08 Martin Baulig <martin@ximian.com>
15558 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
15559 not always return, just like we're doing in Using.Resolve().
15561 2004-07-07 Miguel de Icaza <miguel@ximian.com>
15563 * cs-parser.jay (fixed_statement): flag this as Pinned.
15565 2004-07-06 Miguel de Icaza <miguel@ximian.com>
15567 * typemanager.cs (TypeManager): Removed MakePinned method, this
15568 mechanism is replaced with the .NET 2.x compatible mechanism of
15569 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
15571 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
15572 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
15573 `IsFixed' property which has a different meaning.
15575 2004-07-02 Raja R Harinath <rharinath@novell.com>
15577 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
15578 visible from inside a nested class, not just the names of the
15579 immediately enclosing class.
15580 Fix for bug #60730.
15582 2004-06-24 Raja R Harinath <rharinath@novell.com>
15584 * expression.cs (BetterConversion): Remove buggy special-case
15585 handling of "implicit constant expression conversions". At this
15586 point, we already know that the conversion is possible -- we're
15587 only checking to see which is better.
15589 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15591 * cs-parser.jay: Added error CS0210 test.
15593 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15595 * cs-parser.jay: Added error CS0134 test.
15597 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15600 * cs-parser.jay: Added error CS0145 test.
15602 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15604 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
15606 2004-06-23 Ben Maurer <bmaurer@ximian.com>
15608 * expression.cs (StackAlloc.Resolve): The argument may not
15609 be a constant; deal with this case.
15611 2004-06-23 Marek Safar <marek.safar@seznam.cz>
15613 * attribute.cs (IndexerName_GetIndexerName): Renamed to
15614 GetIndexerAttributeValue.
15615 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
15617 * class.cs (Indexer.Define): Added error tests for CS0415,
15620 2004-06-23 Miguel de Icaza <miguel@ximian.com>
15622 * attribute.cs (Attribute.Resolve): Keep field code in sync with
15625 2004-06-23 Martin Baulig <martin@ximian.com>
15627 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
15628 neither return nor throw, reset the barrier as well. Fixes #60457.
15630 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
15632 * class.cs : EventAttributes is now set to None by default.
15633 This fixes bug #60459.
15635 2004-06-18 Marek Safar <marek.safar@seznam.cz>
15638 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15639 Don't throw exception but return null (it's sufficient now).
15641 2004-06-18 Marek Safar <marek.safar@seznam.cz>
15643 * typemanager.cs (GetArgumentTypes): Faster implementation.
15645 2004-06-18 Martin Baulig <martin@ximian.com>
15647 * attribute.cs (Attribute.Resolve): Check whether we're an
15648 EmptyCast which a Constant child. Fixes #60333.
15650 2004-06-17 Ben Maurer <bmaurer@ximian.com>
15652 * statement.cs (EmitCollectionForeach): Account for the fact that
15653 not all valuetypes are in areas which we can take the address of.
15654 For these variables, we store to a temporary variable. Also, make
15655 sure that we dont emit a `callvirt' on a valuetype method.
15657 2004-06-15 Marek Safar <marek.safar@seznam.cz>
15659 * expression.cs (StackAlloc.DoReSolve): Added test for
15660 negative parameter (CS0247).
15662 2004-06-15 Marek Safar <marek.safar@seznam.cz>
15665 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
15667 2004-06-15 Marek Safar <marek.safar@seznam.cz>
15670 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
15673 2004-06-14 Marek Safar <marek.safar@seznam.cz>
15675 Fix bug #58254 & cs1555.cs, cs1556.cs
15676 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
15678 2004-06-14 Marek Safar <marek.safar@seznam.cz>
15680 * cs-parser.jay: Added error CS1669 test for indexers.
15682 2004-06-11 Martin Baulig <martin@ximian.com>
15684 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
15685 call this twice: for params and varargs methods.
15687 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15690 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
15692 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15694 * attribute.cs (Attribute.GetValidTargets): Made public.
15697 (AbstractPropertyEventMethod): New class for better code sharing.
15698 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
15700 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
15702 2004-06-11 Raja R Harinath <rharinath@novell.com>
15705 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
15706 that the call to Resolve is part of a MemberAccess.
15707 (Expression.Resolve): Use it for SimpleName resolution.
15708 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
15709 Add 'intermediate' boolean argument.
15710 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
15711 error message when the SimpleName can be resolved ambiguously
15712 between an expression and a type.
15713 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
15715 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
15716 call on the left-side.
15718 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15721 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
15723 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15725 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
15727 2004-06-11 Martin Baulig <martin@ximian.com>
15729 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
15730 varargs methods if applicable.
15732 2004-06-11 Martin Baulig <martin@ximian.com>
15734 * expression.cs (Invocation.EmitCall): Don't use
15735 `method.CallingConvention == CallingConventions.VarArgs' since the
15736 method could also have `CallingConventions.HasThis'.
15738 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15740 * class.cs (Event.GetSignatureForError): Implemented.
15741 Fixed crash in error test cs3010.cs
15743 2004-06-10 Miguel de Icaza <miguel@ximian.com>
15745 * cs-tokenizer.cs: Change the way we track __arglist to be
15746 consistent with the other keywords.
15748 2004-06-09 Miguel de Icaza <miguel@ximian.com>
15750 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
15753 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
15755 * codegen.cs: Check that all referenced assemblies have a strongname
15756 before strongnaming the compiled assembly. If not report error CS1577.
15757 Fix bug #56563. Patch by Jackson Harper.
15758 * typemanager.cs: Added a method to return all referenced assemblies.
15759 Fix bug #56563. Patch by Jackson Harper.
15761 2004-06-08 Marek Safar <marek.safar@seznam.cz>
15764 (Method.ApplyAttributeBuilder): Moved and added conditional
15765 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
15768 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
15770 2004-06-08 Marek Safar <marek.safar@seznam.cz>
15773 * class.cs: (EventField.attribute_targets): Changed default target.
15775 2004-06-08 Martin Baulig <martin@ximian.com>
15777 * expression.cs (Invocation.EmitCall): Enable varargs methods.
15779 2004-06-08 Martin Baulig <martin@ximian.com>
15781 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
15783 2004-06-07 Martin Baulig <martin@ximian.com>
15785 Added support for varargs methods.
15787 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
15790 * cs-parser.jay: Added support for `__arglist'.
15792 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
15794 * expression.cs (Argument.AType): Added `ArgList'.
15795 (Invocation): Added support for varargs methods.
15796 (ArglistAccess): New public class.
15797 (Arglist): New public class.
15799 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
15801 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
15802 a method's top-level block if the method has varargs.
15804 * support.cs (ReflectionParameters, InternalParameters): Added
15805 support for varargs methods.
15807 2004-06-07 Miguel de Icaza <miguel@ximian.com>
15809 * class.cs: Provide location in indexer error report.
15811 * driver.cs: Use standard names.
15813 * namespace.cs: Catch the use of using after a namespace has been
15814 declared also on using aliases.
15816 2004-06-03 Raja R Harinath <rharinath@novell.com>
15819 * typemanager.cs (closure_private_ok, closure_invocation_type)
15820 (closure_qualifier_type, closure_invocation_assembly)
15821 (FilterWithClosure): Move to ...
15822 (Closure): New internal nested class.
15823 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
15824 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
15825 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
15826 (MemberLookup, MemberLookupFailed): Use it.
15827 * expression.cs (New.DoResolve): Treat the lookup for the
15828 constructor as being qualified by the 'new'ed type.
15829 (Indexers.GetIndexersForTypeOrInterface): Update.
15831 2004-06-03 Marek Safar <marek.safar@seznam.cz>
15834 (GetConditionalAttributeValue): New method. Returns
15835 condition of ConditionalAttribute.
15836 (SearchMulti): New method. Returns all attributes of type 't'.
15837 Use it when attribute is AllowMultiple = true.
15838 (IsConditionalMethodExcluded): New method.
15841 (Method.IsExcluded): Implemented. Returns true if method has conditional
15842 attribute and the conditions is not defined (method is excluded).
15843 (IMethodData): Extended interface for ConditionalAttribute support.
15844 (PropertyMethod.IsExcluded): Implemented.
15847 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
15850 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
15853 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
15855 * expression.cs (ArrayCreationExpression): Make this just an
15856 `expression'. It can't be a statement, so the code here was
15859 2004-06-02 Marek Safar <marek.safar@seznam.cz>
15862 * typemanager.cs (GetFullNameSignature): New method for
15865 2004-06-02 Marek Safar <marek.safar@seznam.cz>
15868 * class.cs (MemberBase.GetSignatureForError): New virtual method.
15869 Use this method when MethodBuilder is null.
15870 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
15871 Added test for error CS0626 (MONO reports error for this situation).
15872 (IMethodData.GetSignatureForError): Extended interface.
15874 2004-06-01 Marek Safar <marek.safar@seznam.cz>
15877 (AttributeTester.GetObsoleteAttribute): Returns instance of
15878 ObsoleteAttribute when type is obsolete.
15881 (TypeContainer.VerifyObsoleteAttribute): Override.
15882 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
15883 (MethodCode.VerifyObsoleteAttribute): Override.
15884 (MemberBase.VerifyObsoleteAttribute): Override.
15887 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
15888 and report proper error.
15891 Delegate.VerifyObsoleteAttribute): Override.
15894 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
15895 and report proper error.
15896 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
15899 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
15903 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
15904 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
15905 Added test for ObsoleteAttribute.
15908 (Catch): Derived from Statement.
15910 2004-06-01 Marek Safar <marek.safar@seznam.cz>
15912 Fixed bug #59071 & cs0160.cs
15914 * statement.cs (Try.Resolve): Check here whether order of catch
15915 clauses matches their dependencies.
15917 2004-05-31 Miguel de Icaza <miguel@ximian.com>
15919 * Reverted patch to namespace.cs (Use lookuptypedirect). This
15920 caused a regression: #59343. Referencing nested classes from an
15921 assembly stopped working.
15923 2004-05-31 Martin Baulig <martin@ximian.com>
15925 MCS is now frozen for beta 2.
15927 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
15929 * convert.cs: add a trivial cache for overload operator resolution.
15931 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
15933 * decl.cs: If possible, use lookuptypedirect here. We can only do
15934 this if there is no `.' after the namespace. Avoids using
15935 LookupType, which does lots of slow processing.
15936 (FindNestedType) New method, does what it says :-).
15937 * namespace.cs: use LookupTypeDirect.
15938 * rootcontext.cs: use membercache, if possible.
15939 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
15941 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
15944 According to the spec,
15946 In a member access of the form E.I, if E is a single identifier,
15947 and if the meaning of E as a simple-name (§7.5.2) is a constant,
15948 field, property, localvariable, or parameter with the same type as
15949 the meaning of E as a type-name (§3.8), then both possible
15950 meanings of E are permitted.
15952 We did not check that E as a simple-name had the same type as E as
15955 This trivial check gives us 5-7% on bootstrap time.
15957 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
15959 * expression.cs (Invocation.OverloadResolve): Avoid the
15960 use of hashtables and boxing here by allocating on demand.
15962 2004-05-30 Martin Baulig <martin@ximian.com>
15964 * rootcontext.cs (RootContext.LookupType): Don't cache things if
15965 we're doing a silent lookup. Don't try to lookup nested types in
15966 TypeManager.object_type (thanks to Ben Maurer).
15968 2004-05-30 Martin Baulig <martin@ximian.com>
15970 Committing a patch from Ben Maurer.
15972 * rootcontext.cs (RootContext.LookupType): Cache negative results.
15974 2004-05-29 Martin Baulig <martin@ximian.com>
15976 * class.cs (IMethodData.ShouldIgnore): New method.
15978 * typemanager.cs (TypeManager.MethodFlags): Don't take a
15979 `Location' argument, we don't need it anywhere. Use
15980 `IMethodData.ShouldIgnore ()' instead of
15981 `MethodData.GetMethodFlags ()'.
15982 (TypeManager.AddMethod): Removed.
15983 (TypeManager.AddMethod2): Renamed to AddMethod.
15985 2004-05-29 Martin Baulig <martin@ximian.com>
15987 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
15989 * convert.cs (Convert.ImplicitReferenceConversion): If we're
15990 converting from a class type S to an interface type and we already
15991 have an object on the stack, don't box it again. Fixes #52578.
15993 2004-05-29 Martin Baulig <martin@ximian.com>
15995 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15996 Added support for `params' parameters. Fixes #59267.
15998 2004-05-29 Martin Baulig <martin@ximian.com>
16000 * literal.cs (NullPointer): Provide a private .ctor which sets
16001 `type' to TypeManager.object_type. Fixes #59048.
16003 2004-05-29 Martin Baulig <martin@ximian.com>
16005 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
16006 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
16008 * ecore.cs (EventExpr.instance_expr): Make the field private.
16010 2004-05-26 Marek Safar <marek.safar@seznam.cz>
16012 Fixed bug #50080 & cs0214-2.cs
16013 * expression.cs (Cast.DoResolve): Check unsafe context here.
16015 * statement.cs (Resolve.DoResolve): Likewise.
16017 2004-05-26 Martin Baulig <martin@ximian.com>
16019 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
16021 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
16022 (RootContext.LookupType): Pass down the `silent' flag.
16024 2004-05-25 Martin Baulig <martin@ximian.com>
16027 (MethodGroupExpr.IdenticalTypeName): New public property.
16028 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
16029 expression actually refers to a type.
16031 2004-05-25 Martin Baulig <martin@ximian.com>
16033 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
16034 for #56176 and made it actually work.
16036 2004-05-25 Martin Baulig <martin@ximian.com>
16038 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
16039 (FieldExpr, PropertyExpr): Override and implement
16040 CacheTemporaries. Fixes #52279.
16042 2004-05-25 Miguel de Icaza <miguel@ximian.com>
16044 * location.cs: In the new compiler listing a file twice is a
16045 warning, not an error.
16047 2004-05-24 Martin Baulig <martin@ximian.com>
16049 * enum.cs (Enum.DefineType): For the `BaseType' to be a
16050 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
16052 2004-05-24 Martin Baulig <martin@ximian.com>
16054 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
16055 walking the `using' list. Fixes #53921.
16057 2004-05-24 Martin Baulig <martin@ximian.com>
16059 * const.cs (Const.LookupConstantValue): Added support for
16060 EmptyCast's; fixes #55251.
16062 2004-05-24 Martin Baulig <martin@ximian.com>
16064 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
16065 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
16066 which does the CS0135 check. The reason is that we first need to
16067 check whether the variable actually exists.
16069 2004-05-24 Martin Baulig <martin@ximian.com>
16071 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
16072 than RootContext.LookupType() to find the explicit interface
16073 type. Fixes #58584.
16075 2004-05-24 Raja R Harinath <rharinath@novell.com>
16077 * Makefile: Simplify. Use executable.make.
16078 * mcs.exe.sources: New file. List of sources of mcs.exe.
16080 2004-05-24 Anders Carlsson <andersca@gnome.org>
16084 Use the invariant culture when doing String.Compare for CLS case
16087 2004-05-23 Martin Baulig <martin@ximian.com>
16089 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
16090 don't have any dots. Fixes #52622, added cs0246-8.cs.
16092 * namespace.cs (NamespaceEntry.Lookup): Likewise.
16094 2004-05-23 Marek Safar <marek.safar@seznam.cz>
16096 * class.cs (MemberBase.Define): Reuse MemberType member for
16097 resolved type. Other methods can use it too.
16099 2004-05-23 Martin Baulig <martin@ximian.com>
16101 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
16102 the variable also exists in the current block (otherwise, we need
16103 to report a CS0103). Fixes #58670.
16105 2004-05-23 Martin Baulig <martin@ximian.com>
16107 * flowanalysis.cs (Reachability.Reachable): Compute this
16108 on-the-fly rather than storing it as a field.
16110 2004-05-23 Martin Baulig <martin@ximian.com>
16112 * flowanalysis.cs (Reachability.And): Manually compute the
16113 resulting `barrier' from the reachability.
16115 2004-05-23 Marek Safar <marek.safar@seznam.cz>
16118 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
16119 instance of ObsoleteAttribute when symbol is obsolete.
16122 (IMethodData): Extended interface for ObsoleteAttribute support.
16124 2004-05-22 Marek Safar <marek.safar@seznam.cz>
16126 * attribute.cs: Fix bug #55970
16128 2004-05-22 Marek Safar <marek.safar@seznam.cz>
16132 (GetObsoleteAttribute): New method. Creates the instance of
16134 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
16135 ObsoleteAttribute when member is obsolete.
16136 (AttributeTester.Report_ObsoleteMessage): Common method for
16137 Obsolete error/warning reporting.
16140 (TypeContainer.base_classs_type): New member for storing parent type.
16143 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
16144 for this MemberCore.
16146 2004-05-21 Marek Safar <marek.safar@seznam.cz>
16148 * attribute.cs, const.cs: Fix bug #58590
16150 2004-05-21 Martin Baulig <martin@ximian.com>
16152 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
16153 out parameters if the end of the method is unreachable. Fixes
16156 2004-05-21 Marek Safar <marek.safar@seznam.cz>
16158 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
16159 Hari was right, why extra method.
16161 2004-05-21 Marek Safar <marek.safar@seznam.cz>
16163 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
16165 2004-05-20 Martin Baulig <martin@ximian.com>
16167 Merged this back from gmcs to keep the differences to a minumum.
16169 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
16170 instead of a Declspace.
16171 (Attribute.ResolveType): Likewise.
16172 (Attributes.Search): Likewise.
16173 (Attributes.Contains): Likewise.
16174 (Attributes.GetClsCompliantAttribute): Likewise.
16176 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
16178 (MethodData.ApplyAttributes): Take an EmitContext instead of a
16181 2004-05-19 Marek Safar <marek.safar@seznam.cz>
16183 Fix bug #58688 (MCS does not report error when the same attribute
16186 * attribute.cs (Attribute.Emit): Distinction between null and default.
16188 2004-05-19 Raja R Harinath <rharinath@novell.com>
16190 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
16191 of a top-level attribute without an attribute target.
16192 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
16194 (Attribute.Conditional_GetConditionName),
16195 (Attribute.Obsolete_GetObsoleteMessage): Update.
16196 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
16197 part of ScanForIndexerName.
16198 (Attribute.CanIgnoreInvalidAttribute): New function.
16199 (Attribute.ScanForIndexerName): Move to ...
16200 (Attributes.ScanForIndexerName): ... here.
16201 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
16202 (Attributes.Search): New internal variant that can choose not to
16203 complain if types aren't resolved. The original signature now
16205 (Attributes.GetClsCompliantAttribute): Use internal variant, with
16206 complaints suppressed.
16207 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
16208 only if it not useful.
16209 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
16210 top-level for attributes that are shared between the assembly
16211 and a top-level class.
16212 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
16213 * class.cs: Update to reflect changes.
16214 (DefineIndexers): Fuse loops.
16215 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
16216 a couple more variants of attribute names.
16218 2004-05-18 Marek Safar <marek.safar@seznam.cz>
16220 Fix bug #52585 (Implemented explicit attribute declaration)
16223 (Attributable.ValidAttributeTargets): New abstract method. It gets
16224 list of valid attribute targets for explicit target declaration.
16225 (Attribute.Target): It holds target itself.
16226 (AttributeSection): Removed.
16227 (Attribute.CheckTargets): New method. It checks whether attribute
16228 target is valid for the current element.
16231 (EventProperty): New class. For events that are declared like
16232 property (with add and remove accessors).
16233 (EventField): New class. For events that are declared like field.
16236 * cs-parser.jay: Implemented explicit attribute target declaration.
16238 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
16239 Override ValidAttributeTargets.
16242 (ReturnParameter): Class for applying custom attributes on
16244 (ParameterAtribute): New class. Class for applying custom
16245 attributes on the parameter type.
16247 2004-05-17 Miguel de Icaza <miguel@ximian.com>
16249 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
16252 (Method): Allow UNSAFE here.
16254 * modifiers.cs: Support unsafe reporting.
16256 2004-05-17 Marek Safar <marek.safar@seznam.cz>
16258 * decl.cs: Fix bug #58478.
16260 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16262 * statement.cs: When checking for unreachable code on an EmptyStatement,
16263 set the location. Fixes bug #58488.
16265 2004-05-13 Miguel de Icaza <miguel@ximian.com>
16267 * driver.cs: Add -pkg handling.
16269 From Gonzalo: UseShelLExecute=false
16271 2004-05-12 Marek Safar <marek.safar@seznam.cz>
16274 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
16276 (Attribute.IsClsCompliaceRequired): Moved to base for better
16278 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
16279 when attribute is AttributeUsageAttribute.
16280 (Attribute.GetValidTargets): Simplified.
16281 (Attribute.GetAttributeUsage): New method returns AttributeUsage
16282 attribute for this type.
16283 (Attribute.ApplyAttributes): Method renamed to Emit and make
16285 (GlobalAttributeSection): New class for special handling of global
16286 attributes (assembly, module).
16287 (AttributeSection.Emit): New method.
16289 * class.cs: Implemented Attributable abstract methods.
16290 (MethodCore.LabelParameters): Moved to Parameter class.
16291 (Accessor): Is back simple class.
16292 (PropertyMethod): Implemented Attributable abstract class.
16293 (DelegateMethod): Implemented Attributable abstract class.
16294 (Event): New constructor for disctintion between normal Event
16295 and Event with accessors.
16297 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
16299 * codegen.cs, const.cs, decl.cs, delegate.cs:
16300 (CommonAssemblyModulClass): Implemented Attributable abstract class
16303 * enum.cs: Implement IAttributeSupport interface.
16304 (EnumMember): New class for emum members. Implemented Attributable
16308 (ParameterBase): Is abstract.
16309 (ReturnParameter): New class for easier [return:] attribute handling.
16311 * typemanager.cs: Removed builder_to_attr.
16313 2004-05-11 Raja R Harinath <rharinath@novell.com>
16316 * attribute.cs (Attribute.GetPositionalValue): New function.
16317 * class.cs (TypeContainer.VerifyMembers): New function.
16318 (TypeContainer.Emit): Use it.
16319 (ClassOrStruct): New base class for Class and Struct.
16320 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
16321 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
16323 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
16324 then each non-static field should have a FieldOffset attribute.
16325 Otherwise, none of the fields should have a FieldOffset attribute.
16326 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
16327 and FieldOffset attributes.
16328 * typemanager.cs (TypeManager.struct_layout_attribute_type)
16329 (TypeManager.field_offset_attribute_type): New core types.
16330 (TypeManager.InitCoreTypes): Initialize them.
16332 2004-05-11 Michal Moskal <malekith@pld-linux.org>
16334 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
16335 Return correct type.
16338 2004-05-09 Miguel de Icaza <miguel@ximian.com>
16340 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
16341 be implicitly converted to ulong.
16343 * expression.cs: The logic for allowing operator &, | and ^ worked
16344 was wrong, it worked before because we did not report an error in
16345 an else branch. Fixes 57895.
16347 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
16348 allow volatile fields to be reference types.
16350 2004-05-07 Miguel de Icaza <miguel@ximian.com>
16352 * driver.cs: Add support for /debug-
16354 2004-05-07 Raja R Harinath <rharinath@novell.com>
16356 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
16357 Add a 'complain' parameter to silence errors.
16358 (Attribute.Resolve): Update to changes. Put in sanity check to catch
16359 silently overlooked type-resolutions.
16360 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
16361 to reflect changes.
16362 (Attributes.Search): New function.
16363 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
16364 (Attributes.GetAttributeFullName): Remove hack.
16365 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
16366 Update to reflect changes.
16367 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16368 Use Attributes.Search instead of nested loops.
16370 2004-05-07 Marek Safar <marek.safar@seznam.cz>
16373 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
16374 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
16375 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
16377 * report.cs: (Report.Warning): Renamed to Warning_T because of
16378 parameter collision.
16380 2004-05-05 Raja R Harinath <rharinath@novell.com>
16382 * expression.cs (MemberAccess.ResolveMemberAccess):
16383 Exit with non-zero status after Report.Error.
16384 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
16386 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
16388 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
16390 * support.cs: Don't hang when the file is empty.
16392 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
16394 * support.cs: In SeekableStreamReader, compute the preamble size of the
16395 underlying stream. Position changes should take into account that initial
16398 2004-05-03 Todd Berman <tberman@sevenl.net>
16400 * driver.cs: remove unused GetSysVersion function.
16402 2004-05-03 Todd Berman <tberman@sevenl.net>
16404 * driver.cs: Remove the hack from saturday, as well as the hack
16405 from jackson (LoadAssemblyFromGac), also adds the CWD to the
16406 link_paths to get that bit proper.
16408 2004-05-01 Todd Berman <tberman@sevenl.net>
16410 * driver.cs: Try a LoadFrom before a Load, this checks the current
16411 path. This is currently a bug in mono that is be fixed, however, this
16412 provides a workaround for now. This will be removed when the bug
16415 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
16417 * CryptoConvert.cs: Updated to latest version. Fix issue with
16418 incomplete key pairs (#57941).
16420 2004-05-01 Todd Berman <tberman@sevenl.net>
16422 * driver.cs: Remove '.' from path_chars, now System.* loads properly
16425 2004-04-30 Jackson Harper <jackson@ximian.com>
16427 * codegen.cs: Open keys readonly.
16429 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16431 * typemanager.cs: don't report cyclic struct layout when a struct
16432 contains 2 or more fields of the same type. Failed for Pango.AttrShape
16433 which has 2 Pango.Rectangle fields.
16435 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
16437 * expression.cs: Handle IntPtr comparisons with IL code
16438 rather than a method call.
16440 2004-04-29 Martin Baulig <martin@ximian.com>
16442 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
16443 the list of PropertyInfo's in class hierarchy and find the
16444 accessor. Fixes #56013.
16446 2004-04-29 Martin Baulig <martin@ximian.com>
16448 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
16450 2004-04-29 Martin Baulig <martin@ximian.com>
16452 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16454 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
16456 2004-04-29 Martin Baulig <martin@ximian.com>
16458 * class.cs (ConstructorInitializer.Resolve): Check whether the
16459 parent .ctor is accessible. Fixes #52146.
16461 2004-04-29 Martin Baulig <martin@ximian.com>
16463 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16465 * statement.cs (Using.EmitLocalVariableDecls): Use
16466 TypeManager.idisposable_type, not typeof (IDisposable).
16467 (Foreach.EmitCollectionForeach): Added support for valuetypes.
16469 2004-04-29 Martin Baulig <martin@ximian.com>
16471 * class.cs (Event.Define): Don't emit the field and don't set
16472 RTSpecialName and SpecialName for events on interfaces. Fixes
16475 2004-04-29 Raja R Harinath <rharinath@novell.com>
16477 Refactor Attribute.ApplyAttributes.
16478 * attribute.cs (Attributable): New base class for objects that can
16479 have Attributes applied on them.
16480 (Attribute): Make AttributeUsage fields public.
16481 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
16482 (Attribute.IsInternalCall): New property.
16483 (Attribute.UsageAttr): Convert to a public read-only property.
16484 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
16485 (Attribute.ResolveType, Attribute.Resolve)
16486 (Attribute.ScanForIndexerName): Update to reflect changes.
16487 (Attribute.CheckAttributeTarget): Re-format.
16488 (Attribute.ApplyAttributes): Refactor, to various
16489 Attributable.ApplyAttributeBuilder methods.
16490 * decl.cs (MemberCore): Make Attributable.
16491 * class.cs (Accessor): Make Attributable.
16492 (MethodData.ApplyAttributes): Use proper attribute types, not
16494 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
16495 (TypeContainer.ApplyAttributeBuilder)
16496 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
16497 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
16498 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
16499 (Operator.ApplyAttributeBuilder): New factored-out methods.
16500 * const.cs (Const.ApplyAttributeBuilder): Likewise.
16501 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
16502 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
16503 * parameter.cs (ParameterBase): New Attributable base class
16504 that can also represent Return types.
16505 (Parameter): Update to the changes.
16507 2004-04-29 Jackson Harper <jackson@ximian.com>
16509 * driver.cs: Prefer the corlib system version when looking for
16510 assemblies in the GAC. This is still a hack, but its a better hack
16513 2004-04-29 Marek Safar <marek.safar@seznam.cz>
16515 * decl.cs, enum.cs: Improved error 3005 reporting.
16517 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
16518 (related_symbols): New private member for list of symbols
16519 related to reported error/warning.
16521 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
16523 2004-04-29 Martin Baulig <martin@ximian.com>
16525 * ecore.cs (Expression.Constantify): If we're an enum and
16526 TypeManager.TypeToCoreType() doesn't give us another type, use
16527 t.UnderlyingSystemType. Fixes #56178.
16529 2004-04-29 Martin Baulig <martin@ximian.com>
16531 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
16532 interfaces and for each interface, only add members directly
16533 declared in that interface. Fixes #53255.
16535 2004-04-28 Martin Baulig <martin@ximian.com>
16537 * expression.cs (ConditionalLogicalOperator): Use a temporary
16538 variable for `left' to avoid that we evaluate it more than once;
16541 2004-04-28 Martin Baulig <martin@ximian.com>
16543 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
16546 2004-04-28 Martin Baulig <martin@ximian.com>
16548 * statement.cs (LocalInfo.Resolve): Check whether the type is not
16551 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
16552 whether the type is not void (CS1547).
16554 2004-04-28 Martin Baulig <martin@ximian.com>
16556 * expression.cs (Unary.DoResolveLValue): Override this and report
16557 CS0131 for anything but Operator.Indirection.
16559 2004-04-28 Martin Baulig <martin@ximian.com>
16561 Committing a patch from Ben Maurer; see bug #50820.
16563 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16566 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16569 2004-04-28 Martin Baulig <martin@ximian.com>
16571 Committing a patch from Ben Maurer; see bug #50820.
16573 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16576 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16579 2004-04-28 Martin Baulig <martin@ximian.com>
16581 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
16582 (Block.AddLabel): Call DoLookupLabel() to only search in the
16585 2004-04-28 Martin Baulig <martin@ximian.com>
16587 * cfold.cs (ConstantFold.BinaryFold): Added special support for
16588 comparing StringConstants and NullLiterals in Equality and Inequality.
16590 2004-04-28 Jackson Harper <jackson@ximian.com>
16592 * driver.cs: Attempt to load referenced assemblies from the
16593 GAC. This is the quick and dirty version of this method that
16594 doesnt take into account versions and just takes the first
16595 canidate found. Will be good enough for now as we will not have more
16596 then one version installed into the GAC until I update this method.
16598 2004-04-28 Martin Baulig <martin@ximian.com>
16600 * typemanager.cs (TypeManager.CheckStructCycles): New public
16601 static method to check for cycles in the struct layout.
16603 * rootcontext.cs (RootContext.PopulateTypes): Call
16604 TypeManager.CheckStructCycles() for each TypeContainer.
16605 [Note: We only need to visit each type once.]
16607 2004-04-28 Martin Baulig <martin@ximian.com>
16609 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
16611 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
16612 success and added `out object value'. Use a `bool resolved' field
16613 to check whether we've already been called rather than
16614 `ConstantValue != null' since this breaks for NullLiterals.
16616 2004-04-28 Raja R Harinath <rharinath@novell.com>
16618 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
16619 setting of this flag, since the 'set' method may be non-public.
16621 2004-04-28 Raja R Harinath <rharinath@novell.com>
16623 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
16624 check on current_vector.Block.
16626 2004-04-27 Martin Baulig <martin@ximian.com>
16628 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
16629 a field initializer. Fixes #56459.
16631 2004-04-27 Martin Baulig <martin@ximian.com>
16633 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
16634 we're not attempting to use an indexer. Fixes #52154.
16636 2004-04-27 Martin Baulig <martin@ximian.com>
16638 * statement.cs (Return): Don't create a return label if we don't
16639 need it; reverts my change from January 20th. Thanks to Ben
16642 2004-04-27 Martin Baulig <martin@ximian.com>
16644 According to the spec, `goto' can only leave a nested scope, but
16647 * statement.cs (Block.LookupLabel): Only lookup in the current
16648 block, don't recurse into parent or child blocks.
16649 (Block.AddLabel): Check in parent and child blocks, report
16650 CS0140/CS0158 if we find a duplicate.
16651 (Block): Removed this indexer for label lookups.
16652 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
16653 this already does the error reporting for us.
16656 (FlowBranching.UsageVector.Block): New public variable; may be null.
16657 (FlowBranching.CreateSibling): Added `Block' argument.
16658 (FlowBranching.LookupLabel): New public virtual method. Lookup a
16659 label for the target of a `goto' and check whether we're not
16660 leaving a `finally'.
16662 2004-04-27 Martin Baulig <martin@ximian.com>
16664 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16665 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
16668 2004-04-27 Martin Baulig <martin@ximian.com>
16670 * statement.cs (Block.AddLabel): Also check for implicit blocks
16671 and added a CS0158 check.
16673 2004-04-27 Martin Baulig <martin@ximian.com>
16675 * flowanalysis.cs (FlowBranchingLoop): New class.
16676 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
16677 UsageVector's instead of an ArrayList.
16678 (FlowBranching.Label): Likewise.
16679 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
16680 (FlowBranching.AddBreakVector): New method.
16682 2004-04-27 Miguel de Icaza <miguel@ximian.com>
16684 * attribute.cs: Small regression fix: only convert the type if we
16685 the type is different, fixes System.Drawing build.
16687 2004-04-27 Martin Baulig <martin@ximian.com>
16689 * attribute.cs (Attribute.Resolve): If we have a constant value
16690 for a named field or property, implicity convert it to the correct
16693 2004-04-27 Raja R Harinath <rharinath@novell.com>
16695 * statement.cs (Block.Block): Implicit blocks share
16696 'child_variable_names' fields with parent blocks.
16697 (Block.AddChildVariableNames): Remove.
16698 (Block.AddVariable): Mark variable as "used by a child block" in
16699 every surrounding block.
16700 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
16701 been used in a child block, complain about violation of "Invariant
16702 meaning in blocks" rule.
16703 * cs-parser.jay (declare_local_variables): Don't use
16704 AddChildVariableNames.
16705 (foreach_statement): Don't create an implicit block: 'foreach'
16706 introduces a scope.
16708 2004-04-23 Miguel de Icaza <miguel@ximian.com>
16710 * convert.cs (ImplicitNumericConversion): 0 is also positive when
16711 converting from 0L to ulong. Fixes 57522.
16713 2004-04-22 Marek Safar <marek.safar@seznam.cz>
16715 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
16716 derived class hides via 'new' keyword field from base class (test-242.cs).
16717 TODO: Handle this in the more general way.
16719 * class.cs (CheckBase): Ditto.
16721 2004-04-22 Marek Safar <marek.safar@seznam.cz>
16723 * decl.cs (caching_flags): New member for storing cached values
16725 (MemberCore.Flags): New enum where bit flags for caching_flags
16727 (MemberCore.cls_compliance): Moved to caching_flags.
16728 (DeclSpace.Created): Moved to caching_flags.
16730 * class.cs: Use caching_flags instead of DeclSpace.Created
16732 2004-04-21 Miguel de Icaza <miguel@ximian.com>
16734 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
16735 if we are only a derived class, not a nested class.
16737 * typemanager.cs: Same as above, but do this at the MemberLookup
16738 level (used by field and methods, properties are handled in
16739 PropertyExpr). Allow for the qualified access if we are a nested
16742 2004-04-21 Marek Safar <marek.safar@seznam.cz>
16744 * class.cs: Refactoring.
16745 (IMethodData): New inteface; Holds links to parent members
16746 to avoid member duplication (reduced memory allocation).
16747 (Method): Implemented IMethodData interface.
16748 (PropertyBase): New inner classes for get/set methods.
16749 (PropertyBase.PropertyMethod): Implemented IMethodData interface
16750 (Event): New inner classes for add/remove methods.
16751 (Event.DelegateMethod): Implemented IMethodData interface.
16753 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
16754 EmitContext (related to class.cs refactoring).
16756 2004-04-21 Raja R Harinath <rharinath@novell.com>
16758 * delegate.cs (Delegate.VerifyApplicability): If the number of
16759 arguments are the same as the number of parameters, first try to
16760 verify applicability ignoring any 'params' modifier on the last
16764 2004-04-16 Raja R Harinath <rharinath@novell.com>
16766 * class.cs (TypeContainer.AddIndexer): Use
16767 'ExplicitInterfaceName' to determine if interface name was
16768 explicitly specified. 'InterfaceType' is not initialized at this time.
16769 (TypeContainer.DefineIndexers): Remove use of temporary list. The
16770 Indexers array is already in the required order. Initialize
16771 'IndexerName' only if there are normal indexers.
16772 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
16773 (TypeContainer.Emit): Emit DefaultMember attribute only if
16774 IndexerName is initialized.
16777 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
16779 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
16782 2004-04-15 Raja R Harinath <rharinath@novell.com>
16784 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
16788 * attribute.cs (Attribute.Resolve): Check for duplicate named
16792 2004-04-15 Miguel de Icaza <miguel@ximian.com>
16794 * iterators.cs (MarkYield): track whether we are in an exception,
16795 and generate code accordingly. Use a temporary value to store the
16796 result for our state.
16798 I had ignored a bit the interaction of try/catch with iterators
16799 since their behavior was not entirely obvious, but now it is
16800 possible to verify that our behavior is the same as MS .NET 2.0
16804 2004-04-14 Miguel de Icaza <miguel@ximian.com>
16806 * iterators.cs: Avoid creating temporaries if there is no work to
16809 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
16810 Enumerations, use TypeManager.EnumToUnderlying and call
16813 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
16816 (This.Emit): Use EmitContext.EmitThis to emit our
16819 (This.EmitAssign): Ditto.
16821 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
16822 codepaths, we will move all the functionality into
16825 (FieldExpr.EmitAssign): Ditto.
16827 This fixes several hidden bugs that I uncovered while doing a code
16828 review of this today.
16830 * codegen.cs (EmitThis): reworked so the semantics are more clear
16831 and also support value types "this" instances.
16833 * iterators.cs: Changed so that for iterators in value types, we
16834 do not pass the value type as a parameter.
16836 Initialization of the enumerator helpers is now done in the caller
16837 instead of passing the parameters to the constructors and having
16838 the constructor set the fields.
16840 The fields have now `assembly' visibility instead of private.
16842 2004-04-11 Miguel de Icaza <miguel@ximian.com>
16844 * expression.cs (Argument.Resolve): Check if fields passed as ref
16845 or out are contained in a MarshalByRefObject.
16847 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
16848 another compiler type.
16850 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
16852 * class.cs (Indexer.Define): use the new name checking method.
16853 Also, return false on an error.
16854 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
16855 (is_identifier_[start/part]_character): make static.
16857 2004-04-10 Miguel de Icaza <miguel@ximian.com>
16859 * expression.cs (Binary.ResolveOperator): Do no append strings
16860 twice: since we can be invoked more than once (array evaluation)
16861 on the same concatenation, take care of this here. Based on a fix
16862 from Ben (bug #56454)
16864 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
16866 * codegen.cs: Fix another case where CS1548 must be reported (when
16867 delay-sign isn't specified and no private is available #56564). Fix
16868 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
16869 error when MCS is used on the MS runtime and we need to delay-sign
16870 (which seems unsupported by AssemblyBuilder - see #56621).
16872 2004-04-08 Marek Safar <marek.safar@seznam.cz>
16874 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
16875 (TypeManager.ComputeNamespaces): Faster implementation for
16878 * compiler.csproj: Updated AssemblyName to mcs.
16880 2004-04-07 Miguel de Icaza <miguel@ximian.com>
16882 * rootcontext.cs: Add new types to the boot resolution.
16884 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
16885 MulticastDelegate is not allowed.
16887 * typemanager.cs: Add new types to lookup: System.TypedReference
16890 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
16891 check for TypedReference or ArgIterator, they are not allowed.
16893 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
16894 makes us properly catch 1510 in some conditions (see bug 56016 for
16897 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
16899 * CryptoConvert.cs: update from corlib version
16902 2004-04-05 Miguel de Icaza <miguel@ximian.com>
16904 * class.cs (Indexer.Define): Check indexername declaration
16906 2004-04-05 Marek Safar <marek.safar@seznam.cz>
16908 * attribute.cs (IsClsCompliant): Fixed problem with handling
16909 all three states (compliant, not-compliant, undetected).
16911 2004-03-30 Marek Safar <marek.safar@seznam.cz>
16913 * attribute.cs (Attribute): Location is now public.
16914 (Resolve): Store resolved arguments (pos_values) in attribute class.
16915 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
16916 (GetClsCompliantAttributeValue): New method that gets
16917 CLSCompliantAttribute value.
16918 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
16919 if exists else null.
16920 (AttributeTester): New class for CLS-Compliant verification routines.
16922 * class.cs (Emit): Add CLS-Compliant verification.
16923 (Method.GetSignatureForError): Implemented.
16924 (Constructor.GetSignatureForError): Implemented
16925 (Constructor.HasCompliantArgs): Returns if constructor has
16926 CLS-Compliant arguments.
16927 (Constructor.Emit): Override.
16928 (Construcor.IsIdentifierClsCompliant): New method; For constructors
16929 is needed to test only parameters.
16930 (FieldBase.GetSignatureForError): Implemented.
16931 (TypeContainer): New member for storing base interfaces.
16932 (TypeContainer.FindMembers): Search in base interfaces too.
16934 * codegen.cs (GetClsComplianceAttribute): New method that gets
16935 assembly or module CLSCompliantAttribute value.
16936 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
16938 (ModuleClass.Emit): Add error 3012 test.
16940 * const.cs (Emit): Override and call base for CLS-Compliant tests.
16942 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
16943 state for all decl types.
16944 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
16945 if CLS-Compliant tests are required.
16946 (IsClsCompliaceRequired): New method. Analyze whether code
16947 must be CLS-Compliant.
16948 (IsExposedFromAssembly): New method. Returns true when MemberCore
16949 is exposed from assembly.
16950 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
16951 value or gets cached value.
16952 (HasClsCompliantAttribute): New method. Returns true if MemberCore
16953 is explicitly marked with CLSCompliantAttribute.
16954 (IsIdentifierClsCompliant): New abstract method. This method is
16955 used to testing error 3005.
16956 (IsIdentifierAndParamClsCompliant): New method. Common helper method
16957 for identifier and parameters CLS-Compliant testing.
16958 (VerifyClsCompliance): New method. The main virtual method for
16959 CLS-Compliant verifications.
16960 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
16961 null. I don't know why is null (too many public members !).
16962 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
16963 and get value of first CLSCompliantAttribute that found.
16965 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
16966 (VerifyClsCompliance): Override and add extra tests.
16968 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
16969 clscheck- disable CLS-Compliant verification event if assembly is has
16970 CLSCompliantAttribute(true).
16972 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
16973 ApllyAttribute is now called in emit section as in the other cases.
16974 Possible future Emit integration.
16975 (IsIdentifierClsCompliant): New override.
16976 (VerifyClsCompliance): New override.
16977 (GetEnumeratorName): Returns full enum name.
16979 * parameter.cs (GetSignatureForError): Implemented.
16981 * report.cs (WarningData): New struct for Warning message information.
16982 (LocationOfPreviousError): New method.
16983 (Warning): New method. Reports warning based on the warning table.
16984 (Error_T): New method. Reports error based on the error table.
16986 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
16987 verifications are done here.
16989 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
16991 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
16992 CLSCompliantAttribute.
16993 (all_imported_types): New member holds all imported types from other
16995 (LoadAllImportedTypes): New method fills static table with exported types
16996 from all referenced assemblies.
16997 (Modules): New property returns all assembly modules.
16999 2004-03-30 Miguel de Icaza <miguel@ximian.com>
17001 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
17002 throwing a parser error.
17004 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
17005 which removes the hardcoded get_/set_ prefixes for properties, as
17006 IL allows for the properties to be named something else.
17010 * expression.cs: Do not override operand before we know if it is
17011 non-null. Fix 56207
17013 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17015 * typemanager.cs: support for pinned variables.
17017 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17019 * decl.cs, typemanager.cs: Avoid using an arraylist
17020 as a buffer if there is only one result set.
17022 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
17024 * expression.cs: Make sure you cant call a static method
17025 with an instance expression, bug #56174.
17027 2004-03-29 Miguel de Icaza <miguel@ximian.com>
17029 * class.cs (IsDuplicateImplementation): Improve error reporting to
17030 flag 663 (method only differs in parameter modifier).
17032 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
17033 in preprocessor directives.
17035 * location.cs (LookupFile): Allow for the empty path.
17037 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
17038 better approach for some of that patch, but its failing with the
17039 CharSet enumeration. For now try/catch will do.
17041 * typemanager.cs: Do not crash if a struct does not have fields.
17044 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17046 * expression.cs: cs0213, cant fix a fixed expression.
17049 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17051 * cs-parser.jay: detect invalid embeded statements gracefully.
17054 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
17056 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
17059 the invocation type may not be a subclass of the tye of the item/
17060 The type of the item must be a subclass of the invocation item.
17065 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
17067 * attribute.cs: Added methods to get a string and a bool from an
17068 attribute. Required to information from AssemblyKeyFileAttribute,
17069 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
17070 * codegen.cs: Modified AssemblyName creation to include support for
17071 strongnames. Catch additional exceptions to report them as CS1548.
17072 * compiler.csproj: Updated include CryptoConvert.cs.
17073 * compiler.csproj.user: Removed file - user specific configuration.
17074 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
17075 Mono.Security assembly. The original class is maintained and tested in
17076 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
17077 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
17078 like CSC 8.0 (C# v2) supports.
17079 * Makefile: Added CryptoConvert.cs to mcs sources.
17080 * rootcontext.cs: Added new options for strongnames.
17082 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
17084 * driver.cs: For --expect-error, report error code `2'
17085 if the program compiled with no errors, error code `1' if
17086 it compiled with an error other than the one expected.
17088 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
17090 * compiler.csproj: Updated for Visual Studio .NET 2003.
17091 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
17092 * compiler.sln: Updated for Visual Studio .NET 2003.
17094 2004-03-24 Ravi Pratap M <ravi@ximian.com>
17096 * expression.cs: Fix bug #47234. We basically need to apply the
17097 rule that we prefer the conversion of null to a reference type
17098 when faced with a conversion to 'object' (csc behaviour).
17100 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17102 * statement.cs: Shorter form for foreach, eliminates
17103 a local variable. r=Martin.
17105 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17107 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
17108 checks if we can use brtrue/brfalse to test for 0.
17109 * expression.cs: use the above in the test for using brtrue/brfalse.
17110 cleanup code a bit.
17112 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17114 * expression.cs: Rewrite string concat stuff. Benefits:
17116 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
17117 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
17118 rather than a concat chain.
17120 * typemanager.cs: Add lookups for more concat overloads.
17122 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
17124 * expression.cs: Emit shorter il code for array init.
17141 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
17143 * statement.cs: Before, two switch blocks would be merged if the
17144 total size of the blocks (end_item - begin_item + 1) was less than
17145 two times the combined sizes of the blocks.
17147 Now, it will only merge if after the merge at least half of the
17152 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
17154 * class.cs : csc build fix for GetMethods(). See bug #52503.
17156 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
17158 * expression.cs: Make sure fp comparisons work with NaN.
17159 This fixes bug #54303. Mig approved this patch a long
17160 time ago, but we were not able to test b/c the runtime
17163 2004-03-19 Miguel de Icaza <miguel@ximian.com>
17165 * ecore.cs (TypExpr.GetHashCode): implement this overload.
17167 2004-03-19 Martin Baulig <martin@ximian.com>
17169 * class.cs (MemberCore.IsDuplicateImplementation): Report the
17170 error here and not in our caller.
17172 2004-03-19 Martin Baulig <martin@ximian.com>
17174 * interface.cs: Completely killed this file.
17175 (Interface): We're now a TypeContainer and live in class.cs.
17177 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
17178 argument; we're now also called for interfaces.
17179 (TypeContainer.DefineMembers): Allow this method being called
17181 (TypeContainer.GetMethods): New public method; formerly known as
17182 Interface.GetMethod(). This is used by PendingImplementation.
17183 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
17184 it's now private and non-static.
17185 (Interface): Moved this here; it's now implemented similar to
17187 (Method, Property, Event, Indexer): Added `bool is_interface'
17188 argument to their .ctor's.
17189 (MemberBase.IsInterface): New public field.
17191 * cs-parser.jay: Create normal Method, Property, Event, Indexer
17192 instances instead of InterfaceMethod, InterfaceProperty, etc.
17193 (opt_interface_base): Removed; we now use `opt_class_base' instead.
17194 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
17196 2004-03-19 Martin Baulig <martin@ximian.com>
17198 * class.cs (MethodCore.IsDuplicateImplementation): New private
17199 method which does the CS0111 checking.
17200 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
17201 Use IsDuplicateImplementation().
17203 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
17205 * decl.cs (FindMemberToOverride): New method to find the correct
17206 method or property to override in the base class.
17208 - Make Method/Property use the above method to find the
17209 version in the base class.
17210 - Remove the InheritableMemberSignatureCompare as it is now
17213 This patch makes large code bases much faster to compile, as it is
17214 O(n) rather than O(n^2) to do this validation.
17216 Also, it fixes bug 52458 which is that nested classes are not
17217 taken into account when finding the base class member.
17219 Reviewed/Approved by Martin.
17221 2004-03-17 Marek Safar <marek.safar@seznam.cz>
17223 * interface.cs: In all interface classes removed redundant
17224 member initialization.
17226 2004-03-16 Martin Baulig <martin@ximian.com>
17228 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
17230 2004-03-15 Miguel de Icaza <miguel@ximian.com>
17232 * decl.cs (DefineTypeAndParents): New helper method to define a
17233 type's containers before the type itself is defined; This is a
17234 bug exposed by the recent changes to Windows.Forms when an
17235 implemented interface was defined inside a class that had not been
17238 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
17240 (Check): Loop correctly to report errors modifiers
17241 (UNSAFE was not in the loop, since it was the same as TOP).
17243 * interface.cs: Every interface member now takes a ModFlags,
17244 instead of a "is_new" bool, which we set on the base MemberCore.
17246 Every place where we called "UnsafeOk" in the interface, now we
17247 call the proper member (InterfaceMethod.UnsafeOK) instead to get
17248 the unsafe settings from the member declaration instead of the
17249 container interface.
17251 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
17253 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
17254 `set_indexer_name' to the pending bits (one per type).
17256 We fixed a bug today that was picking the wrong method to
17257 override, since for properties the existing InterfaceMethod code
17258 basically ignored the method name. Now we make sure that the
17259 method name is one of the valid indexer names.
17261 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
17263 * support.cs (SeekableStreamReader): Keep track of stream byte
17264 positions and don't mix them with character offsets to the buffer.
17266 Patch from Gustavo Giráldez
17268 2004-03-15 Marek Safar <marek.safar@seznam.cz>
17270 * interface.cs (InterfaceSetGetBase): Removed double member
17271 initialization, base class does it as well.
17273 2004-03-13 Martin Baulig <martin@ximian.com>
17275 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
17276 when compiling corlib.
17278 2004-03-13 Miguel de Icaza <miguel@ximian.com>
17280 * convert.cs (ExplicitConversion): We were reporting an error on
17281 certain conversions (object_type source to a value type, when the
17282 expression was `null') before we had a chance to pass it through
17283 the user defined conversions.
17285 * driver.cs: Replace / and \ in resource specifications to dots.
17288 * class.cs: Add check for duplicate operators. Fixes 52477
17290 2004-03-11 Miguel de Icaza <miguel@ximian.com>
17292 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
17293 that are in the middle of the statements, not only at the end.
17296 * class.cs (TypeContainer.AddField): No longer set the
17297 `HaveStaticConstructor' flag, now we call it
17298 `UserDefineStaticConstructor' to diferentiate the slightly
17299 semantic difference.
17301 The situation is that we were not adding BeforeFieldInit (from
17302 Modifiers.TypeAttr) to classes that could have it.
17303 BeforeFieldInit should be set to classes that have no static
17308 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
17310 And most importantly Zoltan's comment:
17312 http://bugzilla.ximian.com/show_bug.cgi?id=44229
17314 "I think beforefieldinit means 'it's ok to initialize the type sometime
17315 before its static fields are used', i.e. initialization does not need
17316 to be triggered by the first access to the type. Setting this flag
17317 helps the JIT to compile better code, since it can run the static
17318 constructor at JIT time, and does not need to generate code to call it
17319 (possibly lots of times) at runtime. Unfortunately, mcs does not set
17320 this flag for lots of classes like String.
17322 csc sets this flag if the type does not have an explicit static
17323 constructor. The reasoning seems to be that if there are only static
17324 initalizers for a type, and no static constructor, then the programmer
17325 does not care when this initialization happens, so beforefieldinit
17328 This bug prevents the AOT compiler from being usable, since it
17329 generates so many calls to mono_runtime_class_init that the AOT code
17330 is much slower than the JITted code. The JITted code is faster,
17331 because it does not generate these calls if the vtable is type is
17332 already initialized, which is true in the majority of cases. But the
17333 AOT compiler can't do this."
17335 2004-03-10 Miguel de Icaza <miguel@ximian.com>
17337 * class.cs (MethodData.Emit): Refactor the code so symbolic
17338 information is generated for destructors; For some reasons we
17339 were taking a code path that did not generate symbolic information
17342 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
17344 * class.cs: Create a Constructor.CheckBase method that
17345 takes care of all validation type code. The method
17346 contains some code that was moved from Define.
17348 It also includes new code that checks for duplicate ctors.
17349 This fixes bug #55148.
17351 2004-03-09 Joshua Tauberer <tauberer@for.net>
17353 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
17354 a { ... }-style array creation invokes EmitStaticInitializers
17355 which is not good for reference-type arrays. String, decimal
17356 and now null constants (NullCast) are not counted toward
17357 static initializers.
17359 2004-03-05 Martin Baulig <martin@ximian.com>
17361 * location.cs (SourceFile.HasLineDirective): New public field;
17362 specifies whether the file contains or is referenced by a "#line"
17364 (Location.DefineSymbolDocuments): Ignore source files which
17365 either contain or are referenced by a "#line" directive.
17367 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
17369 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
17370 direct access to our parent, so check the method inline there.
17372 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
17374 * expression.cs (Invocation.EmitCall): Miguel's last commit
17375 caused a regression. If you had:
17380 In Foo the implict this would be null.
17382 2004-02-27 Miguel de Icaza <miguel@ximian.com>
17384 * expression.cs (Invocation.EmitCall): If the method is not
17385 virtual, do not emit a CallVirt to it, use Call.
17387 * typemanager.cs (GetFullNameSignature): Improve the method to
17388 cope with ".ctor" and replace it with the type name.
17390 * class.cs (ConstructorInitializer.Resolve): Now the method takes
17391 as an argument the ConstructorBuilder where it is being defined,
17392 to catch the recursive constructor invocations.
17394 2004-02-26 Miguel de Icaza <miguel@ximian.com>
17396 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
17397 routines to check if a type is an enumerable/enumerator allow
17398 classes that implement the IEnumerable or IEnumerator interfaces.
17400 * class.cs (Property, Operator): Implement IIteratorContainer, and
17401 implement SetYields.
17403 (Property.Define): Do the block swapping for get_methods in the
17404 context of iterators. We need to check if Properties also
17405 include indexers or not.
17407 (Operator): Assign the Block before invoking the
17408 OperatorMethod.Define, so we can trigger the Iterator code
17411 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
17412 Property and Operator classes are not created when we parse the
17413 declarator but until we have the block completed, so we use a
17414 singleton SimpleIteratorContainer.Simple to flag whether the
17415 SetYields has been invoked.
17417 We propagate this setting then to the Property or the Operator to
17418 allow the `yield' to function.
17420 2004-02-25 Marek Safar <marek.safar@seznam.cz>
17422 * codegen.cs: Implemented attribute support for modules.
17423 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
17424 Assembly/Module functionality.
17426 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
17427 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
17428 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
17430 2004-02-16 Marek Safar <marek.safar@seznam.cz>
17432 * interface.cs (FindMembers): The operation is performed on all base
17433 interfaces and not only on the first. It is required for future CLS Compliance patch.
17435 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
17437 * statement.cs, codegen.cs:
17438 This patch deals with patterns such as:
17440 public class List : IEnumerable {
17442 public MyEnumerator GetEnumerator () {
17443 return new MyEnumerator(this);
17446 IEnumerator IEnumerable.GetEnumerator () {
17450 public struct MyEnumerator : IEnumerator {
17455 Before, there were a few things we did wrong:
17456 1) we would emit callvirt on a struct, which is illegal
17457 2) we emited ldarg when we needed to emit ldarga
17458 3) we would mistakenly call the interface methods on an enumerator
17459 type that derived from IEnumerator and was in another assembly. For example:
17461 public class MyEnumerator : IEnumerator
17463 Would have the interface methods called, even if there were public impls of the
17464 method. In a struct, this lead to invalid IL code.
17466 2004-02-11 Marek Safar <marek.safar@seznam.cz>
17468 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
17471 * delegate.cs (Define): Fixed crash when delegate type is undefined.
17473 2004-02-11 Miguel de Icaza <miguel@ximian.com>
17475 * cs-parser.jay: Fix small regression: we were not testing V2
17476 compiler features correctly.
17478 * interface.cs: If the emit context is null, then create one
17480 2004-02-09 Marek Safar <marek.safar@seznam.cz>
17482 * decl.cs (GetSignatureForError): New virtual method to get full name
17483 for error messages.
17485 * attribute.cs (IAttributeSupport): New interface for attribute setting.
17486 Now it is possible to rewrite ApplyAttributes method to be less if/else.
17488 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
17489 Duplicated members and code in these classes has been removed.
17490 Better encapsulation in these classes.
17492 2004-02-07 Miguel de Icaza <miguel@ximian.com>
17494 * assign.cs (Assign.DoResolve): When dealing with compound
17495 assignments, there is a new rule in ECMA C# 2.4 (might have been
17496 there before, but it is documented here) that states that in:
17500 If b is of type int, and the `op' is a shift-operator, then the
17501 above is evaluated as:
17505 * expression.cs (Binary.ResolveOperator): Instead of testing for
17506 int/uint/long/ulong, try to implicitly convert to any of those
17507 types and use that in pointer arithmetic.
17509 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
17510 method to print information for from the type, not from the
17511 null-method we were given.
17513 2004-02-01 Duncan Mak <duncan@ximian.com>
17515 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
17516 parsing for cmd, fixes bug #53694.
17518 2004-02-04 Marek Safar <marek.safar@seznam.cz>
17520 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
17521 in the member name duplication tests. Property and operator name duplication
17522 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
17524 2004-02-03 Marek Safar <marek.safar@seznam.cz>
17526 * interface.cs (PopulateMethod): Fixed crash when interface method
17527 returns not existing type (error test cs0246-3.cs).
17529 2004-02-02 Ravi Pratap M <ravi@ximian.com>
17531 * cs-parser.jay (interface_accessors): Re-write actions to also
17532 store attributes attached to get and set methods. Fix spelling
17535 (inteface_property_declaration): Modify accordingly.
17537 (InterfaceAccessorInfo): New helper class to store information to pass
17538 around between rules that use interface_accessors.
17540 * interface.cs (Emit): Apply attributes on the get and set
17541 accessors of properties and indexers too.
17543 * attribute.cs (ApplyAttributes): Modify accordingly to use the
17544 right MethodBuilder when applying attributes to the get and set accessors.
17546 2004-01-31 Miguel de Icaza <miguel@ximian.com>
17548 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
17550 2004-01-26 Miguel de Icaza <miguel@ximian.com>
17552 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
17554 2004-01-25 Miguel de Icaza <miguel@ximian.com>
17556 * cs-parser.jay: Remove YIELD token, instead use the new grammar
17557 changes that treat `yield' specially when present before `break'
17558 or `return' tokens.
17560 * cs-tokenizer.cs: yield is no longer a keyword.
17562 2004-01-23 Marek Safar <marek.safar@seznam.cz>
17564 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
17565 setting for default constructors.
17566 For default constructors are almost every time set wrong Modifier. The
17567 generated IL code has been alright. But inside mcs this values was
17568 wrong and this was reason why several of my CLS Compliance tests
17571 2004-01-22 Martin Baulig <martin@ximian.com>
17573 * cs-parser.jay (namespace_or_type_name): Return an Expression,
17574 not a QualifiedIdentifier. This is what `type_name_expression'
17575 was previously doing.
17576 (type_name_expression): Removed; the code is now in
17577 `namespace_or_type_name'.
17578 (qualified_identifier): Removed, use `namespace_or_type_name'
17580 (QualifiedIdentifier): Removed this class.
17582 2004-01-22 Martin Baulig <martin@ximian.com>
17584 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
17585 not a string as alias name.
17587 2004-01-21 Miguel de Icaza <miguel@ximian.com>
17589 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
17590 #52730 bug, and instead compute correctly the need to use a
17591 temporary variable when requesting an address based on the
17592 static/instace modified of the field and the constructor.
17594 2004-01-21 Martin Baulig <martin@ximian.com>
17596 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
17597 class and namespace before looking up aliases. Fixes #52517.
17599 2004-01-21 Martin Baulig <martin@ximian.com>
17601 * flowanalysis.cs (UsageVector.Merge): Allow variables being
17602 assinged in a 'try'; fixes exception4.cs.
17604 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17605 * class.cs : Implemented parameter-less constructor for TypeContainer
17607 * decl.cs: Attributes are now stored here. New property OptAttributes
17609 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
17611 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
17613 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17615 * typemanager.cs (CSharpSignature): Now reports also inner class name.
17616 (CSharpSignature): New method for indexer and property signature.
17618 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17620 * pending.cs (IsVirtualFilter): Faster implementation.
17622 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17624 * typemanager.cs: Avoid inclusion of same assembly more than once.
17626 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17628 * cs-parser.jay: Fixed problem where the last assembly attribute
17629 has been applied also to following declaration (class, struct, etc.)
17631 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17633 * class.cs: Added error CS0538, CS0539 reporting.
17634 Fixed crash on Microsoft runtime when field type is void.
17636 * cs-parser.jay: Added error CS0537 reporting.
17638 * pending.cs: Added error CS0535 reporting.
17639 Improved error report for errors CS0536, CS0534.
17641 2004-01-20 Miguel de Icaza <miguel@ximian.com>
17643 Merge a few bits from the Anonymous Method MCS tree.
17645 * statement.cs (ToplevelBlock): New class for toplevel methods,
17646 will hold anonymous methods, lifted variables.
17648 * cs-parser.jay: Create toplevel blocks for delegates and for
17649 regular blocks of code.
17651 2004-01-20 Martin Baulig <martin@ximian.com>
17653 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
17654 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
17655 and `NeedExplicitReturn'; added `IsLastStatement'.
17656 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
17657 have a `ReturnLabel' or we're not unreachable.
17659 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
17660 child's reachability; don't just override ours with it. Fixes
17661 #58058 (lluis's example).
17662 (FlowBranching): Added public InTryOrCatch(), InCatch(),
17663 InFinally(), InLoop(), InSwitch() and
17664 BreakCrossesTryCatchBoundary() methods.
17666 * statement.cs (Return): Do all error checking in Resolve().
17667 Unless we are the last statement in a top-level block, always
17668 create a return label and jump to it.
17669 (Break, Continue): Do all error checking in Resolve(); also make
17670 sure we aren't leaving a `finally'.
17671 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
17672 statement in a top-level block.
17673 (Block.Flags): Added `IsDestructor'.
17674 (Block.IsDestructor): New public property.
17676 2004-01-20 Martin Baulig <martin@ximian.com>
17678 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
17680 2004-01-20 Martin Baulig <martin@ximian.com>
17682 * statement.cs (Statement.ResolveUnreachable): New public method.
17683 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
17684 (Block.Resolve): Resolve unreachable statements.
17686 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
17688 * expression.cs: We need to fix the case where we do
17689 not have a temp variable here.
17691 * assign.cs: Only expression compound assignments need
17692 temporary variables.
17694 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
17696 * flowanalysis.cs: Reduce memory allocation in a few ways:
17697 - A block with no variables should not allocate a bit
17699 - A method with no out parameters does not need any tracking
17700 for assignment of the parameters, so we need not allocate
17703 public readonly Type[] VariableTypes;
17704 public readonly string[] VariableNames;
17705 Are redundant. The data is already stored in the variable
17706 map, so we need not allocate another array for it.
17707 - We need to add alot of checks for if (params | locals) == null
17708 due to the first two changes.
17710 2004-01-18 Miguel de Icaza <miguel@ximian.com>
17712 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
17713 implement IMemoryLocation, we store a copy on a local variable and
17714 take the address of it. Patch from Benjamin Jemlich
17716 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
17717 to use a special "type_name_expression" rule which reduces the
17718 number of "QualifiedIdentifier" classes created, and instead
17719 directly creates MemberAccess expressions.
17721 2004-01-17 Miguel de Icaza <miguel@ximian.com>
17723 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
17724 that fixes #52853. Null literal assignment to ValueType
17726 * class.cs (MethodData.Emit): Instead of checking the name of the
17727 method to determine if its a destructor, create a new derived
17728 class from Method called Destructor, and test for that.
17730 * cs-parser.jay: Create a Destructor object instead of a Method.
17732 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
17736 2004-01-16 Miguel de Icaza <miguel@ximian.com>
17738 * expression.cs (Binary.ResolveOperator): Perform an implicit
17739 conversion from MethodGroups to their delegate types on the
17740 Addition operation.
17742 * delegate.cs: Introduce a new class DelegateCreation that is the
17743 base class for `NewDelegate' and `ImplicitDelegateCreation',
17744 factor some code in here.
17746 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
17747 conversion from MethodGroups to compatible delegate types.
17749 * ecore.cs (Expression.Resolve): Do not flag error 654
17750 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
17751 we allow conversions from MethodGroups to delegate types now.
17753 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
17754 assignments in v2 either.
17756 2004-01-10 Miguel de Icaza <miguel@ximian.com>
17758 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
17759 static read-only fields in ctors.
17761 Applied patch from Benjamin Jemlich
17763 * expression.cs (UnaryMutator): Avoid leaking local variables.
17765 2004-01-09 Miguel de Icaza <miguel@ximian.com>
17767 * cs-tokenizer.cs (IsCastToken): Allow the various native types
17768 here to return true, as they can be used like this:
17770 (XXX) int.MEMBER ()
17772 Fixed 49836 and all the other dups
17774 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
17776 * driver.cs: Implement /win32res and /win32icon.
17778 2004-01-08 Miguel de Icaza <miguel@ximian.com>
17780 * cs-parser.jay: Add a rule to improve error handling for the
17781 common mistake of placing modifiers after the type.
17783 2004-01-07 Miguel de Icaza <miguel@ximian.com>
17785 * cs-parser.jay (interface_event_declaration): Catch
17786 initialization of events on interfaces, and report cs0068
17788 * cs-parser.jay (interface_event_declaration): Catch
17789 initialization of events.
17791 * ecore.cs: Better report missing constructors.
17793 * expression.cs (Binary.ResolveOperator): My previous bug fix had
17794 the error reporting done in the wrong place. Fix.
17796 * expression.cs (Binary.ResolveOperator): Catch the
17797 operator + (E x, E y) error earlier, and later allow for implicit
17798 conversions in operator +/- (E e, U x) from U to the underlying
17801 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
17802 52596, if the container class is abstract, the default constructor
17803 is protected otherwise its public (before, we were always public).
17805 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
17808 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
17809 Jemlich that fixes bug #52597, MCS was generating invalid code for
17810 idisposable structs. Thanks to Ben for following up with this
17813 2004-01-06 Miguel de Icaza <miguel@ximian.com>
17815 * driver.cs: Allow assemblies without code to be generated, fixes
17818 2004-01-07 Nick Drochak <ndrochak@gol.com>
17820 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
17822 2004-01-05 Miguel de Icaza <miguel@ximian.com>
17824 * cs-parser.jay: Add rules to improve error reporting if fields or
17825 methods are declared at the namespace level (error 116)
17827 * Add rules to catch event add/remove
17829 2004-01-04 David Sheldon <dave-mono@earth.li>
17831 * expression.cs: Added matching ")" to error message for
17834 2004-01-03 Todd Berman <tberman@gentoo.org>
17836 * ecore.cs, attribute.cs:
17837 Applying fix from #52429.
17839 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
17841 * ecore.cs, expression.cs, statement.cs:
17842 Total rewrite of how we handle branching. We
17843 now handle complex boolean expressions with fewer
17844 jumps. As well if (x == 0) no longer emits a ceq.
17846 if (x is Foo) is much faster now, because we generate
17849 Overall, we get a pretty big improvement on our benchmark
17850 tests. The code we generate is smaller and more readable.
17852 I did a full two-stage bootstrap. The patch was reviewed
17853 by Martin and Miguel.
17855 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
17857 * cs-parser.jay: Make primary_expression not take a QI.
17858 we dont need this because the member_access rule covers
17859 us here. So we replace the rule with just IDENTIFIER.
17861 This has two good effects. First, we remove a s/r conflict.
17862 Second, we allocate many fewer QualifiedIdentifier objects.
17864 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
17866 * attribute.cs: Handle MarshalAs attributes as pseudo, and
17867 set the correct information via SRE. This prevents
17868 hanging on the MS runtime. Fixes #29374.
17870 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
17872 * convert.cs: correctly handle conversions to value types
17873 from Enum and ValueType as unboxing conversions.
17875 Fixes bug #52569. Patch by Benjamin Jemlich.
17877 2004-01-02 Ravi Pratap <ravi@ximian.com>
17879 * expression.cs (BetterConversion): Prefer int -> uint
17880 over int -> ulong (csc's behaviour). This fixed bug #52046.
17882 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
17884 * decl.cs (MemberCache.FindMembers): now returns a
17887 * typemanager.cs: In general, go with with ^^.
17888 (CopyNewMethods): take an IList.
17889 (RealMemberLookup): Only allocate an arraylist
17890 if we copy from two sets of methods.
17892 This change basically does two things:
17893 1) Fewer array lists allocated due to CopyNewMethods.
17894 2) the explicit cast in MemberList costed ALOT.
17896 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
17898 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
17899 a hashtable to avoid needless string allocations when an identifier is
17900 used more than once (the common case).
17902 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
17904 * pending.cs: MS's TypeBuilder.GetInterfaces ()
17905 is broken, it will not return anything. So, we
17906 have to use the information we have in mcs to
17909 * typemanager.cs: Add a cache for GetInterfaces,
17910 since this will now be used more often (due to ^^)
17912 (GetExplicitInterfaces) New method that gets the
17913 declared, not effective, interfaces on a type
17914 builder (eg, if you have interface IFoo, interface
17915 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
17918 This patch makes MCS able to bootstrap itself on
17921 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
17923 * expression.cs: Remove the Nop's that Miguel put
17926 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
17928 * report.cs, codegen.cs: Give the real stack trace to
17929 the error when an exception is thrown.
17931 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
17933 * decl.cs: only allocate hashtables for ifaces if
17936 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
17938 * expression.cs: fix the error from cs0121-2.cs
17939 (a parent interface has two child interfaces that
17940 have a function with the same name and 0 params
17941 and the function is called through the parent).
17943 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
17945 * class.cs, rootcontext.cs, typmanager.cs: do not
17948 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
17950 * codegen.cs: remove stack for the ec flow branching.
17951 It is already a linked list, so no need.
17953 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
17955 * Makefile: Allow custom profiler here.
17957 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
17959 * typemanager.cs (LookupType):
17960 - Use a static char [], because split takes
17961 a param array for args, so it was allocating
17963 - Do not store true in a hashtable, it boxes.
17965 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
17967 * flowanalysis.cs: bytify common enums.
17969 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
17971 * modifiers.cs: Add a new set of flags for the
17972 flags allowed on explicit interface impls.
17973 * cs-parser.jay: catch the use of modifiers in
17974 interfaces correctly.
17975 * class.cs: catch private void IFoo.Blah ().
17977 All related to bug #50572.
17979 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
17981 * decl.cs: Rewrite the consistant accessability checking.
17982 Accessability is not linear, it must be implemented in
17983 a tableish way. Fixes #49704.
17985 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
17987 * expression.cs: Handle negation in a checked context.
17988 We must use subtraction from zero. Fixes #38674.
17990 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
17992 * class.cs: Ignore static void main in DLLs.
17993 * rootcontext.cs: Handle the target type here,
17994 since we are have to access it from class.cs
17995 * driver.cs: account for the above.
17997 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
17999 * report.cs: Give line numbers and files if available.
18001 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
18003 * driver.cs: Implement /addmodule.
18005 * typemanager.cs: Change 'modules' field so it now contains Modules not
18008 2003-12-20 Martin Baulig <martin@ximian.com>
18010 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
18011 (FieldBase.IsAssigned): Removed this field.
18012 (FieldBase.SetAssigned): New public method.
18013 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
18015 2003-12-20 Martin Baulig <martin@ximian.com>
18017 * expression.cs (LocalVariableReference.DoResolve): Don't set
18018 `vi.Used' if we're called from DoResolveLValue().
18020 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
18021 returns the usage vector it just merged into the current one -
18022 pass this one to UsageWarning().
18023 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
18024 of the `EmitContext', don't call this recursively on our children.
18026 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
18028 * driver.cs: Implement /target:module.
18030 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
18032 * support.cs (CharArrayHashtable): New helper class.
18034 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
18035 char arrays, not strings, so we can avoid creating a string in
18036 consume_identifier if the identifier is a keyword.
18038 2003-12-16 Martin Baulig <martin@ximian.com>
18040 * statement.cs (LocalInfo.Assigned): Removed this property.
18041 (LocalInfo.Flags): Removed `Assigned'.
18042 (LocalInfo.IsAssigned): New public method; takes the EmitContext
18043 and uses flow analysis.
18044 (Block.UsageWarning): Made this method private.
18045 (Block.Resolve): Call UsageWarning() if appropriate.
18047 * expression.cs (LocalVariableReference.DoResolve): Always set
18048 LocalInfo.Used here.
18050 2003-12-13 Martin Baulig <martin@ximian.com>
18052 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
18053 any value here; we're now using flow analysis to figure out
18054 whether a statement/block returns a value.
18056 2003-12-13 Martin Baulig <martin@ximian.com>
18058 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
18060 (FlowBranching.MergeFinally): Don't call
18061 `branching.CheckOutParameters()' here, this is called in
18063 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
18064 when adding the `finally' vector.
18066 2003-12-13 Martin Baulig <martin@ximian.com>
18069 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
18070 actually work and also fix #48962.
18072 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
18074 * decl.cs: Do not check System.Object for nested types,
18075 since we know it does not have any. Big bang for buck:
18078 Run 1: 8.35 seconds
18079 Run 2: 8.32 seconds
18080 corlib: 17.99 seconds
18082 Run 1: 8.17 seconds
18083 Run 2: 8.17 seconds
18084 corlib: 17.39 seconds
18086 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
18088 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
18089 time we are returning 0 members, so we save alot here.
18091 2003-12-11 Martin Baulig <martin@ximian.com>
18093 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
18094 `MergeChild()', also just take the `FlowBranching' as argument;
18095 call Merge() on it and return the result.
18096 (FlowBranching.Merge): We don't need to do anything if we just
18099 2003-12-11 Martin Baulig <martin@ximian.com>
18101 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
18102 them in an `ArrayList' to reduce memory usage. Thanks to Ben
18103 Maurer for this idea.
18105 2003-12-11 Martin Baulig <martin@ximian.com>
18107 * flowanalysis.cs (MergeResult): This class is now gone; we now
18108 use the `UsageVector' for this. The reason for this is that if a
18109 branching just has one sibling, we don't need to "merge" them at
18110 all - that's the next step to do.
18111 (FlowBranching.Merge): We now return a `UsageVector' instead of a
18114 2003-12-11 Martin Baulig <martin@ximian.com>
18116 Reworked flow analyis and made it more precise and bug-free. The
18117 most important change is that we're now using a special `Reachability'
18118 class instead of having "magic" meanings of `FlowReturns'. I'll
18119 do some more cleanups and optimizations and also add some more
18120 documentation this week.
18122 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
18123 largely reworked this class.
18124 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
18125 the new `Reachability' class instead of having "magic" values here.
18126 (FlowBranching): We're now using an instance of `Reachability'
18127 instead of having separate `Returns', `Breaks' etc. fields.
18129 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
18130 based on flow analysis; ignore the return value of block.Emit ().
18132 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
18134 * driver.cs typemanager.cs: Find the mono extensions to corlib even
18135 if they are private.
18137 2003-12-09 Martin Baulig <martin@ximian.com>
18139 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
18140 call them directly on the UsageVector.
18142 2003-12-09 Martin Baulig <martin@ximian.com>
18144 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
18145 Changed return type from `FlowReturns' to `Reachability'.
18147 2003-12-09 Martin Baulig <martin@ximian.com>
18149 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
18150 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
18151 `Reachable' fields with a single `Reachability' one.
18153 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18155 * class.cs (FindMembers): Remove foreach's.
18160 Run 1: 8.74 seconds
18161 Run 2: 8.71 seconds
18164 Run 1: 8.64 seconds
18165 Run 2: 8.58 seconds
18168 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18173 This patch does a few things:
18174 1. EmptyStatement is now a singleton, so it is never reallocated.
18175 2. All blah is EmptyStatement constructs have been changed to
18176 blah == EmptyStatement.Value, which is much faster and valid
18177 now that EmptyStatement is a singleton.
18178 3. When resolving a block, rather than allocating a new array for
18179 the non-empty statements, empty statements are replaced with
18180 EmptyStatement.Value
18181 4. Some recursive functions have been made non-recursive.
18182 Mainly the performance impact is from (3), however (1) and (2) are needed for
18183 this to work. (4) does not make a big difference in normal situations, however
18184 it makes the profile look saner.
18189 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18190 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18191 Total memory allocated: 56397 KB
18194 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
18195 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
18196 Total memory allocated: 55666 KB
18198 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18200 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
18201 than the hashtable in a hashtable version
18203 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
18204 we always end up concating a string. This results in a huge perf
18205 loss, because many strings have to be tracked by the GC. In this
18206 patch, we first use a hashtable that works with two keys, so that
18207 the strings do not need to be concat'ed.
18211 Run 1: 8.74 seconds
18212 Run 2: 8.71 seconds
18215 Run 1: 8.65 seconds
18216 Run 2: 8.56 seconds
18218 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
18220 * Makefile: Add a new target `do-time' that does a quick and simple
18221 profile, leaving easy to parse output.
18223 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
18225 * codegen.cs (Init): Create the dynamic assembly with
18226 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
18228 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
18230 * support.cs: Make the PtrHashtable use only one
18231 instance of its comparer.
18233 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
18235 * typemanager.cs: Fix lookup of GetNamespaces.
18237 2003-11-29 Miguel de Icaza <miguel@ximian.com>
18239 * expression.cs: Removed redundant line.
18241 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
18242 ArrayLists, use for loops with bounds.
18244 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
18247 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
18248 arraylists, use for loop with bounds.
18250 The above three changes give us a 0.071 second performance
18251 improvement out of 3.294 seconds down to 3.223. On my machine
18252 the above changes reduced the memory usage by 1,387 KB during
18253 compiler bootstrap.
18255 * cs-parser.jay (QualifiedIdentifier): New class used to represent
18256 QualifiedIdentifiers. Before we created a new string through
18257 concatenation, and mostly later on, the result would be
18258 manipulated by DecomposeQI through string manipulation.
18260 This reduced the compiler memory usage for bootstrapping from
18261 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
18262 compile times in 0.05 seconds.
18264 2003-11-28 Dick Porter <dick@ximian.com>
18266 * support.cs: Do string compares with the Invariant culture.
18274 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
18275 the comparison is done with the Invariant culture.
18277 2003-11-27 Miguel de Icaza <miguel@ximian.com>
18279 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
18280 GetEnumerator method.
18282 (ProbeCollectionType): Iterate starting at the most specific type
18283 upwards looking for a GetEnumerator
18285 * expression.cs: Shift count can be up to 31 for int/uint and 63
18288 2003-11-26 Miguel de Icaza <miguel@ximian.com>
18290 * statement.cs (Block.LookupLabel): Also look for the label on the
18291 children blocks. Use a hash table to keep track of visited
18294 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
18295 we actually did transform the other operand, otherwise fall back
18296 to the common codepath that casts to long.
18298 * cs-tokenizer.cs: Use the same code pattern as the int case.
18299 Maybe I should do the parsing myself, and avoid depending on the
18300 Parse routines to get this done.
18302 2003-11-25 Miguel de Icaza <miguel@ximian.com>
18304 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
18305 which fixes bug 51347. This time test it.
18307 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
18308 attributes for example can not tell the difference between these.
18309 The difference was only a syntax feature of the language.
18311 * attribute.cs: Apply attributes to delegates.
18313 * delegate.cs: Call the apply attributes method.
18315 2003-11-24 Miguel de Icaza <miguel@ximian.com>
18317 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
18318 comparing 0 vs Byte.MinValue, not the value
18320 (ImplicitConversionRequired): When reporting a conversion error,
18321 use error 31 to print out the constant error instead of the
18324 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
18325 which fixes bug 51347.
18327 2003-11-22 Miguel de Icaza <miguel@ximian.com>
18329 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
18330 which fixes the -warnaserror command line option.
18332 2003-11-21 Miguel de Icaza <miguel@ximian.com>
18334 * cfold.cs (DoNumericPromotions): During constant folding of
18335 additions on UIntConstant, special case intconstants with
18336 IntConstants like we do on the expression binary operator.
18338 2003-11-12 Miguel de Icaza <miguel@ximian.com>
18340 * convert.cs (ImplicitReferenceConversion): We were missing a case
18341 (System.Enum are not value types or class types, so we need to
18342 classify them separatedly).
18344 * driver.cs: We do not support error 2007.
18346 2003-11-12 Jackson Harper <jackson@ximian.com>
18348 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
18349 system directory. Also use the full file name so users can
18350 libraries names mscorlib-o-tron.dll in a non system dir.
18352 2003-11-10 Martin Baulig <martin@ximian.com>
18354 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
18355 (TypeManager.InitCoreTypes): Initialize them here, but instead of
18356 calling `ResolveType()' on them, directly assign their `Type'.
18358 2003-11-08 Martin Baulig <martin@ximian.com>
18360 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
18361 return value and the `out parent' parameter.
18362 (TypeContainer.DefineType): Moved the CS0644 check into
18363 GetClassBases(). Don't pass the interface types to the
18364 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
18365 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
18367 * ecore.cs (TypeExpr.IsAttribute): New property.
18368 (TypeExpr.GetInterfaces): New method.
18370 * interface.cs (Interface.GetInterfaceTypeByName): Return a
18371 TypeExpr instead of a Type.
18372 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
18373 (Interface.DefineType): Don't pass the interface types to the
18374 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
18375 them later and then call `TypeBulider.AddInterfaceImplementation()'.
18377 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
18378 instead of a `Type[]'.
18379 (TypeManager.RegisterBuilder): Likewise.
18380 (TypeManager.AddUserInterface): Likewise.
18381 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
18382 `Type[]' and also return a `TypeExpr[]'.
18383 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
18385 2003-11-08 Martin Baulig <martin@ximian.com>
18387 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
18390 2003-11-08 Martin Baulig <martin@ximian.com>
18392 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
18393 TypeManager.ResolveExpressionTypes().
18395 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
18396 instead of an Expression.
18397 (TypeExpr): This is now an abstract base class for `TypeExpression'.
18398 (TypeExpression): New public class; formerly known as `TypeExpr'.
18400 * expression.cs (ComposedCast): Derive from TypeExpr.
18402 * typemanager.cs (TypeManager.system_*_expr): These are now
18403 TypExpr's instead of Expression's.
18404 (TypeManager.ResolveExpressionTypes): New public static function;
18405 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
18408 2003-11-06 Miguel de Icaza <miguel@ximian.com>
18410 * expression.cs (New.DoResolve): Do not dereference value that
18411 might be a null return.
18413 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
18414 sure that the constant value has the right type. Fixes an
18415 unreported bug, similar to 50425.
18417 * const.cs (Const.LookupConstantValue): Call
18418 ImplicitStandardConversionExists before doing a conversion to
18419 avoid havng the TypeManager.ChangeType do conversions.
18421 Reduced the number of casts used
18423 (Const.ChangeType): New routine to enable reuse of the constant
18424 type changing code from statement.
18426 * typemanager.cs (ChangeType): Move common initialization to
18427 static global variables.
18431 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
18432 every value type to go through, even if it was void. Fix that.
18434 * cs-tokenizer.cs: Use is_identifier_start_character on the start
18435 character of the define, and the is_identifier_part_character for
18436 the rest of the string.
18438 2003-11-05 Miguel de Icaza <miguel@ximian.com>
18440 * expression.cs (UnaryMutator.EmitCode): When I updated
18441 LocalVariableReference.DoResolve, I overdid it, and dropped an
18442 optimization done on local variable references.
18444 2003-11-04 Miguel de Icaza <miguel@ximian.com>
18446 * ecore.cs: Convert the return from Ldlen into an int.
18448 2003-10-20 Miguel de Icaza <miguel@ximian.com>
18450 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
18451 the accessibility, this is a special case for toplevel non-public
18452 classes (internal for instance).
18454 2003-10-20 Nick Drochak <ndrochak@gol.com>
18456 * ecore.cs: Fix typo and build. Needed another right paren.
18458 2003-10-19 Miguel de Icaza <miguel@ximian.com>
18460 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
18461 `internal' case regular and protected, but not allowing protected
18462 to be evaluated later. Bug 49840
18464 2003-10-15 Miguel de Icaza <miguel@ximian.com>
18466 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
18467 to kb.Nlast, and not the kb.nFirst to isolate the switch
18470 Extract the underlying type, so enumerations of long/ulong are
18471 treated like long/ulong.
18473 2003-10-14 Miguel de Icaza <miguel@ximian.com>
18475 * expression.cs (New): Overload the meaning of RequestedType to
18476 track the possible creation of the NewDelegate type, since
18477 DoResolve is invoked more than once for new constructors on field
18480 See bugs: #48800 and #37014
18482 * cs-parser.jay (declare_local_constants): Take an arraylist
18483 instead of a single constant.
18485 (local_constant_declaration): It should take a
18486 constant_declarators, not a constant_declarator. Fixes 49487
18488 * convert.cs: Fix error report.
18490 2003-10-13 Jackson Harper <jackson@ximian.com>
18492 * typemanager.cs (TypeToCoreType): Add float and double this fixes
18495 2003-10-09 Martin Baulig <martin@ximian.com>
18497 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
18499 (MethodCore.DoDefineParameters): Removed the TypeContainer
18500 argument; use the DeclSpace which was passed to the .ctor instead.
18501 (MethodCore.CheckParameter): Take a DeclSpace instead of a
18502 TypeContainer; we only need a DeclSpace here.
18504 2003-10-09 Martin Baulig <martin@ximian.com>
18506 * class.cs (MethodData): Added additional `DeclSpace ds' argument
18508 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
18509 EmitContext's .ctor.
18511 2003-10-09 Martin Baulig <martin@ximian.com>
18513 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
18514 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
18515 AsAccessible(), moved them as well.
18517 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
18519 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
18521 * cs-parser.jay : Renamed yyName to yyNames related to jay.
18523 2003-10-07 Miguel de Icaza <miguel@ximian.com>
18525 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
18526 generation for >=, as spotted by Paolo, bug 48679.
18527 Patch from David Waite.
18529 * cs-tokenizer.cs: Add handling for #pragma.
18531 * cs-parser.jay: Allow for both yield and yield return in the
18532 syntax. The anti-cobolization of C# fight will go on!
18534 * class.cs (TypeBuilder.DefineType): Catch error condition here
18535 (Parent.DefineType erroring out and returning null).
18537 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18538 coping with enumerations variables, we were mistakenly processing
18539 them as a regular value type instead of built-in types. Fixes the
18542 * typemanager.cs (IsBuiltinOrEnum): New method.
18544 2003-09-30 Miguel de Icaza <miguel@ximian.com>
18546 * cs-parser.jay: Upgrade: yield now needs the return clause.
18548 2003-09-19 Martin Baulig <martin@ximian.com>
18550 * decl.cs (MemberCache.SetupCacheForInterface): Take a
18551 `MemberCache parent' argument. Normally, an interface doesn't
18552 have a parent type except System.Object, but we use this in gmcs
18553 for generic type parameters.
18555 2003-09-18 Martin Baulig <martin@ximian.com>
18557 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
18558 on `type.IsInterface'; don't check whether the type has a parent
18559 to determine whether it's an interface.
18561 2003-09-15 Martin Baulig <martin@ximian.com>
18563 * class.cs (TypeContainer.DefineType): Added an error flag to
18564 avoid reporting duplicate CS0146's ("class definition is
18567 * driver.cs (Driver.MainDriver): Abort if
18568 RootContext.ResolveTree() reported any errors.
18570 2003-09-07 Martin Baulig <martin@ximian.com>
18572 * report.cs (Error, Warning): Added overloaded versions which take
18573 a `params object[] args' and call String.Format().
18575 2003-09-07 Martin Baulig <martin@ximian.com>
18577 * decl.cs (DeclSpace..ctor): Don't call
18578 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
18579 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
18580 (DeclSpace.RecordDecl): New method.
18582 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
18584 2003-09-02 Ravi Pratap <ravi@ximian.com>
18586 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
18587 value attributes to be applied to ParameterBuilders.
18589 * class.cs (MethodCore.LabelParameters): Make static and more
18590 generic so that it can be used from other places - like interface
18591 methods, for instance.
18593 * interface.cs (Interface.Emit): Call LabelParameters before
18594 emitting attributes on the InterfaceMethod.
18596 2003-08-26 Martin Baulig <martin@ximian.com>
18598 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
18599 resolving aliases; fixes #47927.
18601 2003-08-26 Martin Baulig <martin@ximian.com>
18603 * statement.cs (Using.DoResolve): This is internally emitting a
18604 try/finally clause, so we need to set ec.NeedExplicitReturn if we
18605 do not always return. Fixes #47681.
18607 2003-08-26 Martin Baulig <martin@ximian.com>
18609 * decl.cs (MemberCore): Moved WarningNotHiding(),
18610 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
18612 (AdditionResult): Make this nested in DeclSpace.
18613 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
18614 argument; call NamespaceEntry.Define() unless we're nested in a
18617 * namespace.cs (Namespace.DefineName): New public function. This
18618 is called from DeclSpace's .ctor to add
18619 (Namespace.Lookup): Include DeclSpaces in the lookup.
18621 * class.cs (Operator): Derive from MemberBase, not MemberCore.
18623 * const.cs (Const): Derive from MemberBase, not MemberCore.
18625 2003-08-25 Martin Baulig <martin@ximian.com>
18627 * convert.cs (Convert.ExplicitReferenceConversion): When
18628 converting from an interface type to a class, unbox if the target
18629 type is a struct type. Fixes #47822.
18631 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18633 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
18636 2003-08-22 Martin Baulig <martin@ximian.com>
18638 * class.cs (TypeManager.DefineType): When defining a nested type,
18639 call DefineType() on our parent; fixes #47801.
18641 2003-08-22 Martin Baulig <martin@ximian.com>
18643 * class.cs (MethodData.Define): While checking if a method is an
18644 interface implementation, improve the test a bit more to fix #47654.
18646 2003-08-22 Martin Baulig <martin@ximian.com>
18648 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
18649 correctly; fixes #47722.
18651 2003-08-22 Martin Baulig <martin@ximian.com>
18653 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
18654 LocalVariableReference, ensure it's not read-only. Fixes #47536.
18656 * statement.cs (Fixed.DoResolve): Make all variables read-only.
18658 2003-08-22 Martin Baulig <martin@ximian.com>
18660 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
18661 can only be assigned in static constructors. Fixes #47161.
18663 2003-08-22 Martin Baulig <martin@ximian.com>
18665 Rewrote and improved the flow analysis code.
18667 * flowbranching.cs (FlowBranching): Make this class abstract.
18668 (FlowBranching.CreateBranching): New static function to create a
18669 new flow branching.
18670 (FlowBranchingBlock, FlowBranchingException): New classes.
18671 (FlowBranching.UsageVector.Type): New public readonly field.
18672 (FlowBranching.UsageVector.Breaks): Removed the setter.
18673 (FlowBranching.UsageVector.Returns): Removed the setter.
18674 (FlowBranching.UsageVector): Added Break(), Return(),
18675 NeverReachable() and Throw() methods to modify the reachability.
18676 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
18677 done by FlowBranching.Merge().
18678 (FlowBranching.UsageVector.MergeChild): New method; merges the
18679 merge result into the current vector.
18680 (FlowBranching.Merge): New abstract method to merge a branching.
18682 2003-08-12 Martin Baulig <martin@ximian.com>
18684 * expression.cs (Indirection.CacheTemporaries): Create the
18685 LocalTemporary with the pointer type, not its element type.
18687 2003-08-10 Miguel de Icaza <miguel@ximian.com>
18689 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
18690 token was a keyword or not.
18692 Add `error' options where an IDENTIFIER was expected; Provide
18693 CheckToken and CheckIdentifierToken convenience error reporting
18696 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
18698 * decl.cs: Rename `NamespaceEntry Namespace' public field into
18699 NameSpaceEntry NameSpaceEntry.
18701 (LookupInterfaceOrClass): Avoid creating a full qualified name
18702 from namespace and name: avoid doing lookups when we know the
18703 namespace is non-existant. Use new Tree.LookupByNamespace which
18704 looks up DeclSpaces based on their namespace, name pair.
18706 * driver.cs: Provide a new `parser verbose' to display the
18707 exception thrown during parsing. This is turned off by default
18708 now, so the output of a failure from mcs is more graceful.
18710 * namespace.cs: Track all the namespaces defined in a hashtable
18713 (IsNamespace): New method
18715 2003-08-09 Miguel de Icaza <miguel@ximian.com>
18717 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
18718 we know that we need to concatenate (full typename can never be
18723 * statement.cs: Use a bitfield; Do not initialize to null things
18724 which are done by the constructor by default.
18726 * cs-parser.jay: bug fix, parameter was 4, not 3.
18728 * expression.cs: Just use the property;
18730 * statement.cs: No need for GetVariableInfo method.
18732 2003-08-08 Martin Baulig <martin@ximian.com>
18734 * flowanalysis.cs (FlowReturns): This is now nested in the
18735 `FlowBranching' class.
18736 (MyBitVector): Moved this here from statement.cs.
18737 (FlowBranching.SiblingType): New enum type.
18738 (FlowBranching.CreateSibling): Added `SiblingType' argument.
18740 2003-08-07 Martin Baulig <martin@ximian.com>
18742 * flowanalysis.cs (FlowBranchingType): This is now nested in the
18743 `FlowBranching' class and called `BranchingType'.
18745 2003-08-07 Martin Baulig <martin@ximian.com>
18747 * flowanalysis.cs: Moved all the control flow analysis code into
18750 2003-08-07 Martin Baulig <martin@ximian.com>
18752 * assign.cs (Assign.DoResolve): `target' must either be an
18753 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
18756 2003-08-07 Miguel de Icaza <miguel@ximian.com>
18758 * expression.cs (BinaryMethod): This kind of expression is created by the
18759 Binary class if it determines that the operator has to be handled
18762 (BinaryDelegate): This kind of expression is created if we are
18763 dealing with a + or - operator on delegates.
18765 (Binary): remove method, argumetns, and DelegateOperator: when
18766 dealing with methods,
18768 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
18770 * statement.cs (Block): use bitfields for the three extra booleans
18771 we had in use. Remove unused topblock parameter.
18773 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
18775 * assign.cs: Drop extra unneeded tests.
18777 2003-08-06 Miguel de Icaza <miguel@ximian.com>
18779 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
18781 * statement.cs (Foreach): Use VariableStorage instead of
18784 * codegen.cs (VariableStorage): New class used by clients that
18785 require a variable stored: locals or fields for variables that
18786 need to live across yield.
18788 Maybe provide a convenience api for EmitThis+EmitLoad?
18790 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
18793 2003-08-05 Miguel de Icaza <miguel@ximian.com>
18795 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
18796 RemapParameterLValue): New methods that are used to turn a
18797 precomputed FieldInfo into an expression like this:
18801 The idea is to use this instead of making LocalVariableReference
18802 have more than one meaning.
18804 * cs-parser.jay: Add error production to BASE.
18806 * ecore.cs: Deal with TypeManager.GetField returning null, which
18807 is now a valid return value.
18809 (FieldExprNoAddress): New expression for Fields whose address can
18812 * expression.cs (LocalVariableReference): During the resolve
18813 phases, create new expressions if we are in a remapping context.
18814 Remove code that dealt with remapping here.
18816 (ParameterReference): same.
18818 (ProxyInstance): New expression, like the `This' expression, but
18819 it is born fully resolved. We know what we are doing, so remove
18820 the errors that are targeted to user-provided uses of `this'.
18822 * statement.cs (Foreach): our variable is now stored as an
18823 Expression; During resolution, follow the protocol, dont just
18824 assume it will return this.
18826 2003-08-06 Martin Baulig <martin@ximian.com>
18828 * support.cs (SeekableStreamReader.cs): New public class.
18830 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
18831 SeekableStreamReader instead of the normal StreamReader.
18833 2003-08-04 Martin Baulig <martin@ximian.com>
18835 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
18836 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
18837 deambiguate casts and delegate invocations.
18838 (parenthesized_expression): Use the new tokens to ensure this is
18839 not a cast of method invocation.
18841 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
18842 when reading a `)' and Deambiguate_CloseParens () was previously
18845 * expression.cs (ParenthesizedExpression): New class. This is
18846 just used for the CS0075 test.
18847 (Binary.DoResolve): Check for CS0075.
18849 2003-07-29 Ravi Pratap <ravi@ximian.com>
18851 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
18852 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
18853 reference comparison.
18855 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
18856 examine the ReturnType for equality - this is necessary in the
18857 cases of implicit and explicit operators whose signature also
18858 includes the return type.
18860 2003-07-26 Miguel de Icaza <miguel@ximian.com>
18862 * namespace.cs: Cache the result of the namespace computation,
18863 instead of computing it every time.
18865 2003-07-24 Miguel de Icaza <miguel@ximian.com>
18867 * decl.cs: Use a global arraylist that we reuse over invocations
18868 to avoid excesive memory consumption. Reduces memory usage on an
18869 mcs compile by one meg (45 average).
18871 * typemanager.cs (LookupTypeReflection): In .NET pointers are
18872 private, work around that.
18874 2003-07-23 Miguel de Icaza <miguel@ximian.com>
18876 * literal.cs (IntLiteral): Define Zero and One static literals.
18878 * cs-parser.jay (integer_literal): use static literals to reduce
18879 memory usage for the most used literals (0, 1 and -1). 211kb
18880 reduced in memory usage.
18882 Replace all calls to `new ArrayList' with `new
18883 ArrayList(4)' which is a good average number for most allocations,
18884 and also requires only 16 bytes of memory for its buffer by
18887 This reduced MCS memory usage in seven megabytes for the RSS after
18890 2003-07-28 Ravi Pratap <ravi@ximian.com>
18892 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
18893 handle params methods the correct way by forming only one
18894 applicable set with params and normal methods in them. Earlier we
18895 were looking at params methods only if we found no normal methods
18896 which was not the correct thing to do.
18898 (Invocation.BetterFunction): Take separate arguments indicating
18899 when candidate and the best method are params methods in their
18902 This fixes bugs #43367 and #46199.
18904 * attribute.cs: Documentation updates.
18906 (CheckAttribute): Rename to CheckAttributeTarget.
18907 (GetValidPlaces): Rename to GetValidTargets.
18909 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
18910 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
18914 2003-07-28 Martin Baulig <martin@ximian.com>
18916 * class.cs (TypeContainer.DefineMembers): Use the base type's full
18917 name when looking up the base class of a nested class. Fixes #46977.
18919 2003-07-26 Martin Baulig <martin@ximian.com>
18921 * expression.cs (Indexers.Indexer): New nested struct; contains
18922 getter, setter and the indexer's type.
18923 (Indexers.Properties): This is now an ArrayList of
18924 Indexers.Indexer's.
18925 (IndexerAccess.DoResolveLValue): Correctly set the type if the
18926 indexer doesn't have any getters.
18928 * assign.cs (Assign.DoResolve): Also do the implicit conversions
18929 for embedded property and indexer assignments.
18931 2003-07-26 Martin Baulig <martin@ximian.com>
18933 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
18934 preprocessor directive is not the first non-whitespace character
18937 2003-07-26 Martin Baulig <martin@ximian.com>
18939 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
18940 namespace parsing, follow the spec more closely.
18942 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
18943 NamespaceEntry.Lookup().
18945 2003-07-25 Martin Baulig <martin@ximian.com>
18947 * MethodCore.cs (OverridesSomething): New public field; it's set
18948 from TypeContainer.DefineMembers if this method overrides
18949 something (which doesn't need to be a method). Fix #39462.
18951 2003-07-25 Ravi Pratap <ravi@ximian.com>
18953 * typemanager.cs (GetMembers): Ensure that the list of members is
18954 reversed. This keeps things in sync.
18956 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
18957 find an AttributeUsage attribute.
18959 * expression.cs (Invocation.OverloadResolve): Perform the check
18960 which disallows Invoke to be directly called on a Delegate.
18962 (Error_InvokeOnDelegate): Report error cs1533.
18964 2003-07-25 Martin Baulig <martin@ximian.com>
18966 * expression.cs (Indexers.GetIndexersForType): Only look in the
18967 interface hierarchy if the requested type is already an
18968 interface. Fixes #46788 while keeping #46502 fixed.
18970 2003-07-25 Martin Baulig <martin@ximian.com>
18972 * class.cs (TypeContainer.DefineMembers): Check whether all
18973 readonly fields have been assigned and report warning CS0649 if
18976 * statement.cs (LocalInfo.IsFixed): Always return true if this is
18979 2003-07-24 Ravi Pratap <ravi@ximian.com>
18981 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
18982 returned from GetMethods to make things consistent with the
18983 assumptions MCS makes about ordering of methods.
18985 This should comprehensively fix bug #45127 and it does :-)
18987 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
18988 ordering is actually reverse.
18990 * Clean up some debug messages I left lying around.
18992 * interface.cs (Populate*): Get rid of code which emits attributes
18993 since the stage in which we emit attributes is the 'Emit' stage,
18994 not the define stage.
18996 (Emit): Move attribute emission for interface members here.
18998 2003-07-22 Ravi Pratap <ravi@ximian.com>
19000 * expression.cs (Invocation.OverloadResolve): Follow the spec more
19001 closely: we eliminate methods in base types when we have an
19002 applicable method in a top-level type.
19004 Please see section 14.5.5.1 for an exact description of what goes
19007 This fixes bug #45127 and a host of other related to corlib compilation.
19009 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
19010 array is the method corresponding to the top-level type (this is
19011 because of the changes made to icall.c) so we change this
19014 (MethodGroupExpr.Name): This too.
19016 * typemanager.cs (GetElementType): New method which does the right
19017 thing when compiling corlib.
19019 * everywhere: Make use of the above in the relevant places.
19021 2003-07-22 Martin Baulig <martin@ximian.com>
19023 * cs-parser.jay (invocation_expression): Moved
19024 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
19025 `cast_expression', but create a InvocationOrCast which later
19026 resolves to either an Invocation or a Cast.
19028 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
19029 method; call this before EmitStatement() to make sure that this
19030 expression can be used as a statement.
19032 * expression.cs (InvocationOrCast): New class; resolves to either
19033 an Invocation or a Cast.
19035 * statement.cs (StatementExpression): Call ResolveStatement() on
19036 the ExpressionStatement before emitting it.
19038 2003-07-21 Martin Baulig <martin@ximian.com>
19040 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
19041 `ref' and `out' attributes match; fixes #46220.
19042 (MemberAccess.ResolveMemberAccess): You can't reference a type
19043 through an expression; fixes #33180.
19044 (Indexers.GetIndexersForType): Don't return the indexers from
19045 interfaces the class implements; fixes #46502.
19047 2003-07-21 Martin Baulig <martin@ximian.com>
19049 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
19050 CS0661 checks; fixes bug #30442.
19052 2003-07-21 Martin Baulig <martin@ximian.com>
19054 * decl.cs (AdditionResult): Added `Error'.
19056 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
19058 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
19059 makes cs0031.cs actually work.
19061 2003-07-20 Martin Baulig <martin@ximian.com>
19063 * namespace.cs: Fixed that bug which caused a crash when compiling
19064 the debugger's GUI.
19066 2003-07-20 Miguel de Icaza <miguel@ximian.com>
19068 * typemanager.cs (LookupTypeReflection): Never expose types which
19069 are NotPublic, NestedPrivate, NestedAssembly, or
19070 NestedFamANDAssem. We used to return these, and later do a check
19071 that would report a meaningful error, but the problem is that we
19072 would not get the real match, if there was a name override.
19074 2003-07-18 Miguel de Icaza <miguel@ximian.com>
19076 * namespace.cs (Namespace, Name): Do not compute the namespace
19077 name dynamically, compute it in the constructor. This reduced
19078 memory usage by 1697 KB.
19080 * driver.cs: Use --pause to pause at the end.
19082 2003-07-17 Peter Williams <peter@newton.cx>
19084 * Makefile: Change the name of the test target so that it doesn't
19085 conflict with the recursive test target.
19087 2003-07-17 Miguel de Icaza <miguel@ximian.com>
19089 * expression.cs (LocalVariableReference.Emit, EmitAssign,
19090 AddressOf): Do not use EmitThis, that was wrong, use the actual
19093 2003-07-15 Miguel de Icaza <miguel@ximian.com>
19095 * class.cs (MethodData.Define): While checking if a method is an
19096 interface implementation, improve the test: If we are not public
19097 (use new test here: use the computed MethodAttributes directly,
19098 instead of the parsed modifier flags) check if the `implementing'
19099 method comes from an interface or not.
19101 * pending.cs (VerifyPendingMethods): Slightly better error
19104 * makefile: add test target that does the mcs bootstrap.
19106 2003-07-16 Ravi Pratap <ravi@ximian.com>
19108 * interface.cs (Define): Do nothing here since there are no
19109 members to populate etc. Move the attribute emission out of here
19110 since this was just totally the wrong place to put it. Attribute
19111 application happens during the 'Emit' phase, not in the 'Define'
19114 (Emit): Add this method and move the attribute emission here
19116 * rootcontext.cs (EmitCode): Call the Emit method on interface
19119 2003-07-14 Ravi Pratap M <ravi@ximian.com>
19121 * expression.cs (OverloadResolve): Report error only if Location
19122 is not 'Null' which means that there was a probe going on.
19124 2003-07-14 Martin Baulig <martin@ximian.com>
19126 * expression.cs (ConditionalLogicalOperator): New public class to
19127 implement user defined conditional logical operators.
19128 This is section 14.11.2 in the spec and bug #40505.
19130 2003-07-14 Martin Baulig <martin@ximian.com>
19132 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
19134 2003-07-14 Martin Baulig <martin@ximian.com>
19136 * codegen.cs (EmitContext.InFixedInitializer): New public field.
19138 * ecore.cs (IVariable.VerifyFixed): New interface method.
19140 * expression.cs (Unary.ResolveOperator): When resolving the `&'
19141 operator, check whether the variable is actually fixed. Fixes bug
19142 #36055. Set a variable definitely assigned when taking its
19143 address as required by the spec.
19145 * statement.cs (LocalInfo.IsFixed): New field.
19146 (LocalInfo.MakePinned): Set `IsFixed' to true.
19148 2003-07-14 Ravi Pratap M <ravi@ximian.com>
19150 * attribute.cs (Attribute.Resolve): While doing a Member lookup
19151 for .ctors, ensure that we only ask for members declared in the
19152 attribute type (BindingFlags.DeclaredOnly).
19156 * expression.cs (Error_WrongNumArguments): Report error 1501
19157 correctly the way CSC does.
19159 2003-07-13 Martin Baulig <martin@ximian.com>
19161 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
19162 lookup on the fully qualified name, to make things like "X.X" work
19163 where "X.X" is a fully qualified type name, but we also have a
19164 namespace "X" in the using list. Fixes #41975.
19166 2003-07-13 Martin Baulig <martin@ximian.com>
19168 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
19169 function. If we're a CompoundAssign, we need to create an embedded
19170 CompoundAssign, not an embedded Assign.
19171 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
19174 2003-07-13 Martin Baulig <martin@ximian.com>
19176 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
19177 work to fix bug #46088.
19179 2003-07-13 Ravi Pratap <ravi@ximian.com>
19181 * class.cs (Operator.Emit): Do not emit attributes here - it is
19182 taken care of by the Method class that we delegate too. This takes
19183 care of bug #45876.
19185 2003-07-10 Martin Baulig <martin@ximian.com>
19187 * expression.cs (TypeOfVoid): New class.
19188 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
19190 2003-07-10 Martin Baulig <martin@ximian.com>
19192 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
19195 2003-07-10 Martin Baulig <martin@ximian.com>
19197 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
19198 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
19200 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
19202 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
19204 2003-07-10 Martin Baulig <martin@ximian.com>
19206 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
19207 of decimal. Fixes #42850.
19209 NOTE: I also fixed the created byte blob, but this doesn't work on
19210 the MS runtime and csc never produces any byte blobs for decimal
19213 2003-07-10 Martin Baulig <martin@ximian.com>
19215 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
19216 structs; fixes #32068.
19217 (Block.AddChildVariableNames): Fixed #44302.
19219 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19221 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
19223 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19225 * attribute.cs: And this test is onger needed.
19227 2003-07-08 Martin Baulig <martin@ximian.com>
19229 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
19230 inaccessible types. Fixes #36313.
19232 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
19234 * namespace.cs (NamespaceEntry): Create implicit entries for all
19235 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
19236 implicit entries for N1.N2 and N1.
19238 2003-07-08 Martin Baulig <martin@ximian.com>
19240 Rewrote the handling of namespaces to fix a lot of the issues
19241 wrt. `using' aliases etc.
19243 * namespace.cs (Namespace): Splitted this class into a
19244 per-assembly `Namespace' and a per-file `NamespaceEntry'.
19246 * typemanager.cs (TypeManager.IsNamespace): Removed.
19247 (TypeManager.ComputeNamespaces): Only compute namespaces from
19248 loaded assemblies here, not the namespaces from the assembly we're
19249 currently compiling.
19251 2003-07-08 Martin Baulig <martin@ximian.com>
19253 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
19255 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19257 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
19260 I thought about the memory savings here, but LookupTypeReflection
19261 is used under already very constrained scenarios. Compiling
19262 corlib or mcs only exposes one hit, so it would not really reduce
19263 any memory consumption.
19265 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19267 * typemanager.cs: fixes bug #45889 by only adding public types from
19268 other assemblies to the list of known types.
19270 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19272 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
19273 on the type we resolved.
19275 2003-07-05 Martin Baulig <martin@ximian.com>
19277 * pending.cs (PendingImplementation.ParentImplements): Don't
19278 create the proxy if the parent is abstract.
19280 * class.cs (TypeContainer.DefineIndexers): Process explicit
19281 interface implementations first. Fixes #37714.
19283 2003-07-04 Miguel de Icaza <miguel@ximian.com>
19285 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
19286 defined recursively; but since we modify the input parameters
19287 (left is set to `this' temporarily), we reset this value if the
19288 left_is_explicit is false, which gives the original semantics to
19291 * literal.cs (NullPointer): new class used to represent a null
19292 literal in a pointer context.
19294 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
19295 type is a pointer, use a NullPointer object instead of a
19296 NullLiteral. Closes 43687
19298 (ExplicitConversion): Convert pointer values using
19299 the conv opcode to the proper type.
19301 * ecore.cs (New): change ValueTypeVariable property into a method,
19302 that returns whether the valuetype is suitable for being used.
19304 * expression.cs (Binary.DoNumericPromotions): Only return if we
19305 the int constant was a valid uint, and we can return both left and
19306 right as uints. If not, we continue processing, to trigger the
19307 type conversion. This fixes 39018.
19309 * statement.cs (Block.EmitMeta): During constant resolution, set
19310 the CurrentBlock property on the emitcontext, so that we resolve
19311 constants propertly.
19313 2003-07-02 Martin Baulig <martin@ximian.com>
19315 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
19316 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
19318 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
19319 than emitting it here.
19321 * statement.cs: Fixed some more flow analysis bugs.
19323 2003-07-02 Martin Baulig <martin@ximian.com>
19325 * class.cs (MethodData.Define): When implementing interface
19326 methods, set Final unless we're Virtual.
19328 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
19329 check work for interface methods.
19331 2003-07-01 Martin Baulig <martin@ximian.com>
19333 * ecore.cs (EmitContext.This): Replaced this property with a
19334 GetThis() method which takes a Location argument. This ensures
19335 that we get the correct error location for a CS0188.
19337 2003-07-01 Miguel de Icaza <miguel@ximian.com>
19339 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
19340 ImplicitStandardConversion.
19342 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
19344 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
19346 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
19349 2003-06-30 Miguel de Icaza <miguel@ximian.com>
19351 * class.cs (Constructor.Define): Turn off initlocals for unsafe
19354 (MethodData.Define): Turn off initlocals for unsafe methods.
19356 2003-06-29 Miguel de Icaza <miguel@ximian.com>
19358 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
19359 complete; Fixes #37521.
19361 * delegate.cs: Use Modifiers.TypeAttr to compute the
19362 TypeAttributes, instead of rolling our own. This makes the flags
19363 correct for the delegates.
19365 2003-06-28 Miguel de Icaza <miguel@ximian.com>
19367 * class.cs (Constructor.Define): Set the private flag for static
19368 constructors as well.
19370 * cs-parser.jay (statement_expression): Set the return value to
19371 null, to avoid a crash when we catch an error.
19373 2003-06-24 Miguel de Icaza <miguel@ximian.com>
19375 * cs-parser.jay: Applied patch from Jackson that adds support for
19376 extern and unsafe modifiers to destructor declarations.
19378 * expression.cs: Report error 21 if the user is trying to index a
19381 * driver.cs: Add an error message, suggested by the bug report.
19383 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
19384 if we do not have a ": this ()" constructor initializer. Fixes 45149
19386 2003-06-14 Miguel de Icaza <miguel@ximian.com>
19388 * namespace.cs: Add some information to reduce FAQs.
19390 2003-06-13 Miguel de Icaza <miguel@ximian.com>
19392 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
19393 underlying enumeration types. Fixes #43915.
19395 * expression.cs: Treat ushort/short as legal values to be used in
19396 bitwise operations.
19398 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
19400 * delegate.cs: transfer custom attributes for paramenters from
19401 the delegate declaration to Invoke and BeginInvoke.
19403 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
19405 * attribute.cs: handle custom marshalers and emit marshal info
19408 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
19410 * makefile.gnu: Added anonymous.cs to the compiler sources.
19412 2003-05-28 Miguel de Icaza <miguel@ximian.com>
19414 * iterators.cs: Change the name of the proxy class to include two
19417 * cs-parser.jay: Update grammar to include anonymous methods.
19419 * anonymous.cs: new file.
19421 2003-05-27 Miguel de Icaza <miguel@ximian.com>
19423 * class.cs (Field.Define): Add missing test for pointers and
19426 2003-05-27 Ravi Pratap <ravi@ximian.com>
19428 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
19429 we use the stobj opcode.
19431 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
19432 since it wasn't the correct fix.
19434 It still is puzzling that we are required to use stobj for IntPtr
19435 which seems to be a ValueType.
19437 2003-05-26 Miguel de Icaza <miguel@ximian.com>
19439 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
19440 during regular simple name resolution. Now, the trick is that
19441 instead of returning for processing the simplename, we do a
19442 TypeManager.LookupType (ie, a rooted lookup as opposed to a
19443 contextual lookup type). If a match is found, return that, if
19444 not, return for further composition.
19446 This fixes long-standing 30485.
19448 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19449 using the address to initialize an object, do an Stobj instead of
19450 using the regular Stelem.
19452 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
19453 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
19454 Because if we are a BaseIndexerAccess that value will be true.
19457 * statement.cs (GotoCase.Resolve): Return after reporting an
19458 error, do not attempt to continue.
19460 * expression.cs (PointerArithmetic.Emit): If our operand is a
19461 long, convert our constants to match the operand before
19462 multiplying. Convert to I type before adding. Fixes 43670.
19464 2003-05-14 Ravi Pratap <ravi@ximian.com>
19466 * enum.cs (ImplicitConversionExists) : Rename to
19467 ImplicitEnumConversionExists to remove ambiguity.
19469 * ecore.cs (NullCast): New type of cast expression class which
19470 basically is very similar to EmptyCast with the difference being
19471 it still is a constant since it is used only to cast a null to
19473 (eg. (string) null)
19475 * convert.cs (ImplicitReferenceConversion): When casting a null
19476 literal, we return a NullCast.
19478 * literal.cs (NullLiteralTyped): Remove - I don't see why this
19479 should be around anymore.
19481 The renaming (reported was slightly wrong). Corrections:
19483 ConvertImplicitStandard -> ImplicitConversionStandard
19484 ConvertExplicitStandard -> ExplicitConversionStandard
19486 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
19487 before passing them in !
19489 * convert.cs (ImplicitConversionStandard): When comparing for
19490 equal expr and target types, ensure that expr is not a
19493 In general, we must not be checking (expr_type ==
19494 target_type) in the top level conversion methods
19495 (ImplicitConversion, ExplicitConversion etc). This checking is
19496 done in the methods that they delegate to.
19498 2003-05-20 Miguel de Icaza <miguel@ximian.com>
19500 * convert.cs: Move Error_CannotConvertType,
19501 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
19502 ImplicitNumericConversion, ImplicitConversionExists,
19503 ImplicitUserConversionExists, StandardConversionExists,
19504 FindMostEncompassedType, FindMostSpecificSource,
19505 FindMostSpecificTarget, ImplicitUserConversion,
19506 ExplicitUserConversion, GetConversionOperators,
19507 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
19508 TryImplicitIntConversion, Error_CannotConvertImplicit,
19509 ConvertImplicitRequired, ConvertNumericExplicit,
19510 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
19511 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
19514 Perform the following renames:
19516 StandardConversionExists -> ImplicitStandardConversionExists
19517 ConvertImplicit -> ImplicitConversion
19518 ConvertImplicitStandard -> ImplicitStandardConversion
19519 TryImplicitIntConversion -> ImplicitIntConversion
19520 ConvertImplicitRequired -> ImplicitConversionRequired
19521 ConvertNumericExplicit -> ExplicitNumericConversion
19522 ConvertReferenceExplicit -> ExplicitReferenceConversion
19523 ConvertExplicit -> ExplicitConversion
19524 ConvertExplicitStandard -> ExplicitStandardConversion
19526 2003-05-19 Martin Baulig <martin@ximian.com>
19528 * statement.cs (TypeInfo.StructInfo): Made this type protected.
19529 (TypeInfo): Added support for structs having structs as fields.
19531 * ecore.cs (FieldExpr): Implement IVariable.
19532 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
19533 VariableInfo for the field.
19535 2003-05-18 Martin Baulig <martin@ximian.com>
19537 * expression.cs (This.DoResolve): Report a CS0027 if we're
19538 emitting a field initializer.
19540 2003-05-18 Martin Baulig <martin@ximian.com>
19542 * expression.cs (This.ResolveBase): New public function.
19543 (This.DoResolve): Check for CS0188.
19545 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
19548 * ecore.cs (MethodGroupExpr.DoResolve): Set the
19549 `instance_expression' to null if we don't have any non-static
19552 2003-05-18 Martin Baulig <martin@ximian.com>
19554 Reworked the way how local variables and parameters are handled by
19555 the flow analysis code.
19557 * statement.cs (TypeInfo, VariableMap): New public classes.
19558 (VariableInfo): New public class. This is now responsible for
19559 checking whether a variable has been assigned. It is used for
19560 parameters and local variables.
19561 (Block.EmitMeta): Take the InternalParameters as argument; compute
19562 the layout of the flow vectors here.
19563 (Block.LocalMap, Block.ParameterMap): New public properties.
19564 (FlowBranching): The .ctor doesn't get the InternalParameters
19565 anymore since Block.EmitMeta() now computes the layout of the flow
19567 (MyStructInfo): This class is now known as `StructInfo' and nested
19568 in `TypeInfo'; we don't access this directly anymore.
19570 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
19571 property and removed IsAssigned(), IsFieldAssigned(),
19572 SetAssigned() and SetFieldAssigned(); we now call them on the
19573 VariableInfo so we don't need to duplicate this code everywhere.
19575 * expression.cs (ParameterReference): Added `Block block' argument
19577 (LocalVariableReference, ParameterReference, This): The new
19578 VariableInfo class is now responsible for all the definite
19581 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
19582 IsParameterAssigned, SetParameterAssigned): Removed.
19584 2003-05-18 Martin Baulig <martin@ximian.com>
19586 * typemanager.cs (InitCoreTypes): Try calling
19587 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
19588 the 3-args-version. Corlib now also needs our `void_type'.
19589 (GetMethod): Added overloaded version which takes an optional
19590 `bool report_errors' to allow lookups of optional methods.
19592 2003-05-12 Martin Baulig <martin@ximian.com>
19594 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
19595 only used for locals and not for parameters.
19597 2003-05-12 Miguel de Icaza <miguel@ximian.com>
19599 * support.cs (InternalParameters.ParameterType): Return the
19600 ExternalType of the parameter.
19602 * parameter.cs (Parameter.ExternalType): drop the two arguments,
19605 2003-05-11 Miguel de Icaza <miguel@ximian.com>
19607 * class.cs (MethodData.Define): Do not set the `newslot' on
19608 interface members, if they are also flagged as "override".
19610 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
19611 better code for ++i and i++. This only works for static fields
19612 and local variables.
19614 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
19615 want to pull the DeclSpace out of the builder_to_declspace instead
19616 of the TypeBuilder (like in TypeContainer.FindMembers).
19618 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
19619 instead of LookupTypeContainer. Fixes the crash on .NET for
19620 looking up interface members.
19622 * const.cs: Create our own emit context during the Definition
19623 stage, so that constants are evaluated in the proper context, when
19624 a recursive definition happens.
19626 2003-05-11 Martin Baulig <martin@ximian.com>
19628 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
19629 new block for a switch section.
19630 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
19631 the adding/lookup in the switch block. Fixes #39828.
19633 2003-05-09 Miguel de Icaza <miguel@ximian.com>
19635 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
19636 functionality: I needed to convert the data after I had performed
19637 the add/sub operation into the operands type size.
19639 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
19640 pass the type for the box operation, otherwise the resulting
19641 object would have been of type object.
19643 (BoxedCast): Add constructor to specify the type to box as.
19645 2003-05-07 Miguel de Icaza <miguel@ximian.com>
19647 * iterators.cs: I was reusing the `count' variable inadvertently,
19648 take steps to not allow this to happen.
19650 2003-05-06 Miguel de Icaza <miguel@ximian.com>
19652 * attribute.cs (Attribute.Resolve): Params attributes are encoded
19653 by creating an array at the point where the params starts and
19654 putting all those arguments there, then adjusting the size of the
19657 2003-05-05 Miguel de Icaza <miguel@ximian.com>
19659 * expression.cs (New.AddressOf): Implement interface
19660 IMemoryLocation. This is used when the `new' operator is used in
19661 the context of an invocation to a method on a value type.
19663 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
19666 * namespace.cs: Also check the using aliases here.
19668 * driver.cs: Move the test for using validity after the types have
19669 been entered, so we do a single pass that also includes the using
19672 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
19673 in the regular case. CreateSiblingForFinally is doing extra
19676 * attribute.cs (GetAttributeArgumentExpression): Store the result
19677 on an out value, and use the return value to indicate failure
19678 instead of using null (which is a valid return for Constant.GetValue).
19680 * statement.cs: Perform the analysis flow for the increment
19681 portion after the statement, because this will be the real flow of
19682 execution. Fixes #42385
19684 * codegen.cs (EmitContext.EmitArgument,
19685 EmitContext.EmitStoreArgument): New helper functions when the
19686 RemapToProxy flag is set.
19688 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
19691 Add support for remapping parameters.
19693 * iterators.cs: Propagate parameter values; Store parameter
19694 values in the proxy classes.
19696 2003-05-04 Miguel de Icaza <miguel@ximian.com>
19698 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
19699 need a proxy reference; I do not know what I was thinking
19701 * cs-parser.jay (constructor_initializer): catch another error,
19702 and display nice message.
19704 (field_declaration): catch void field declaration
19705 to flag a better error.
19707 * class.cs (MemberBase.CheckBase): Report an error instead of a
19708 warning if a new protected member is declared in a struct.
19709 (Field.Define): catch the error of readonly/volatile.
19711 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
19713 (FieldExpr.AddressOf): ditto. Catch error where the address of a
19714 volatile variable is taken
19716 2003-05-02 Miguel de Icaza <miguel@ximian.com>
19718 * statement.cs (Fixed.Resolve): Report an error if we are not in
19721 2003-05-01 Miguel de Icaza <miguel@ximian.com>
19723 * typemanager.cs: reuse the code that handles type clashes for
19724 delegates and enumerations.
19726 * class.cs (Report28): Always report.
19728 * expression.cs (EncodeAsAttribute): Allow nulls here.
19730 2003-04-28 Miguel de Icaza <miguel@ximian.com>
19732 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
19733 the functionality for testing whether an expression is valid for
19734 an attribute here. Also handle the case of arrays of elements
19737 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
19738 encoding a linear array into an array of objects that are suitable
19739 to be passed to an CustomAttributeBuilder.
19741 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
19743 * ecore.cs: (FieldExpr): Handle field remapping here.
19745 * iteratators.cs: Pass the instance variable (if the method is an
19746 instance method) to the constructors, so we can access the field
19747 variables on the class.
19749 TODO: Test this with structs. I think the THIS variable on
19750 structs might have to be a pointer, and not a refenrece
19752 2003-04-27 Miguel de Icaza <miguel@ximian.com>
19754 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
19755 local variables to fields in a proxy class.
19757 * iterators.cs (PopulateProxy): Rename our internal fields to
19759 Create a <THIS> field if we are an instance method, so we can
19760 reference our parent container variables.
19761 (MapVariable): Called back from the EmitContext code to enter a
19762 new variable to field mapping into the proxy class (we just create
19766 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
19767 for using the remapped locals to fields.
19769 I placed the code here, because that gives the same semantics to
19770 local variables, and only changes the Emit code.
19772 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
19773 statements inside iterators.
19774 (VariableInfo): Add a FieldBuilder for the cases when we are
19775 remapping local variables to fields in a proxy class
19777 * ecore.cs (SimpleNameResolve): Avoid testing two times for
19778 current_block != null.
19780 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
19781 not cope with strings, as it has been moved to the
19782 TableSwitchEmit. Fixed bug in switch generation.
19784 * expression.cs (New.DoResolve): Provide more context for the user
19785 when reporting an error.
19787 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
19790 * expression.cs (MemberAccess.DoResolve): When we get a type back,
19791 check the permissions for it. Note than in a type-resolution
19792 context the check was already present in DeclSpace.ResolveType,
19793 but was missing from the MemberAccess.
19795 (ArrayCreation.CheckIndices): warn if the user has
19796 more nested levels of expressions, but there are no more
19797 dimensions specified. Avoids crash on bug 41906.
19799 2003-04-26 Miguel de Icaza <miguel@ximian.com>
19801 * statement.cs (Block): replace Implicit bool, for a generic
19803 New flag: `Unchecked'. This is used during the EmitMeta phase
19804 (which is out-of-line with the regular Resolve/Emit process for a
19805 statement, as this is done ahead of time, but still gets a chance
19806 to call constant resolve).
19808 (Block.Flags): new enum for adding a new flag.
19810 (Block.EmitMeta): track the state of unchecked.
19812 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
19813 to enable constant resolution to work there as well.
19815 2003-04-22 Miguel de Icaza <miguel@ximian.com>
19817 * typemanager.cs (ienumerable_type): Also look up
19818 System.Collections.IEnumerable.
19820 2003-04-21 Miguel de Icaza <miguel@ximian.com>
19822 TODO: Test more than one conditional per method.
19824 * class.cs (Indexer.Define): Report the location where the user is
19825 referencing the unsupported feature.
19827 (MethodData): Overload the use of `conditionals' to
19828 minimize the creation of needless ArrayLists. This saves roughly
19829 212kb on my machine.
19831 (Method): Implement the new IIteratorContainer interface.
19832 (Method.SetYields): Implement the method by setting the ModFlags
19833 to contain METHOD_YIELDS.
19835 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
19836 which just got set to null.
19838 * iterators.cs: New file.
19840 (Yield, YieldBreak): New statements.
19842 * statement.cs (Return.Resolve): Flag an error if we are used in
19843 an iterator method.
19845 * codegen.cs (InIterator): New flag set if the code is being
19846 compiled in an iterator method.
19848 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
19849 internal modifier, and we just use it to avoid adding extra
19850 fields, as this is seldom used.
19852 * cs-parser.jay: Add yield_statement (yield and yield break).
19854 * driver.cs: New flag -v2 to turn on version 2 features.
19856 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
19857 hashtable when v2 is enabled.
19859 2003-04-20 Miguel de Icaza <miguel@ximian.com>
19861 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
19862 there is already a namespace defined with this name.
19864 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
19865 people upgraded their corlibs.
19867 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
19868 always use fully qualified types, no need to use the compiler
19871 (TypeManager.IsNamespace): Use binarysearch.
19873 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
19874 AddDelegate): I did not quite use the new IsValid API properly: I
19875 have to pass the short-name and the fullname. I was passing only
19876 the basename instead of the fullname sometimes.
19878 (TypeContainer.DefineType): call NamespaceClash.
19880 * interface.cs (Interface.DefineType): use NamespaceClash before
19883 * delegate.cs (Delegate.DefineType): use NamespaceClash before
19886 * enum.cs: (Enum.DefineType): use NamespaceClash before
19889 * typemanager.cs (: 3-line patch that gives us some tasty 11%
19890 speed increase. First, use the negative_hits cache when we get a
19891 negative. Second, add the type with its full original name
19892 instead of the new . and + encoded name (reflection uses + to
19893 separate type from a nested type). Use LookupTypeReflection
19894 directly which bypasses the type->name hashtable (that we already
19895 know does not contain the type.
19897 * decl.cs (DeclSpace.ResolveTypeExpr): track the
19898 location/container type.
19900 * driver.cs: When passing utf8, use directly the UTF8Encoding.
19902 2003-04-19 Miguel de Icaza <miguel@ximian.com>
19904 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
19906 * delegate.cs (NewDelegate.Resolve): Test whether an instance
19907 method is being referenced in the method group from a static
19908 context, and report error 120 if so.
19910 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
19913 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
19914 is created, we create the A namespace).
19916 * cs-parser.jay: A namespace also introduces a DeclarationFound.
19919 2003-04-18 Miguel de Icaza <miguel@ximian.com>
19921 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
19922 invocation to ModuleBuilder.GetType with the same values will
19923 return a new type instance, so we need to cache its return
19926 * expression.cs (Binary.ResolveOperator): Only allow the compare
19927 operators on enums if they are of the same type.
19929 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
19930 types of ValueType on their own case. Before we were giving them
19931 the same treatment as objects.
19933 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
19934 fullname. Short name is used to compare against container name.
19935 Fullname is used to check against defined namespace names.
19937 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
19938 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
19940 (Method.CheckBase): Call parent.
19941 (MemberBase.CheckBase): Check for protected members on sealed
19943 (PropertyBase.CheckBase): Call parent.
19944 (Field.Define): Call parent.
19946 * report.cs: Negative error codes are now mapped to 8000 - code,
19947 so that the display is render more nicely.
19949 * typemanager.cs: Do not use try/catch, instead report a regular
19952 (GetPointerType, GetReferenceType): These methods provide
19953 mechanisms to obtain the T* and T& from a T. We had the code
19954 previously scattered around the code base, and it also used
19955 TypeManager.LookupType that would go through plenty of caches.
19956 This one goes directly to the type source.
19958 In some places we did the Type.GetType followed by
19959 ModuleBuilder.GetType, but not in others, so this unifies the
19960 processing as well.
19962 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
19963 statements now that we have namespace information.
19965 * typemanager.cs (IsNamespace): New method, returns whether the
19966 string presented is a namespace or not.
19968 (ComputeNamespaces): New public entry point, computes the list of
19969 available namespaces, using the GetNamespaces API call in Mono, or
19970 the slower version in MS.NET.
19972 Now before we start the semantic analysis phase, we have a
19973 complete list of namespaces including everything that the user has
19976 Deleted old code to cache namespaces in .nsc files.
19978 2003-04-17 Miguel de Icaza <miguel@ximian.com>
19980 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
19981 class/struct location definition Location for the implicit
19982 constructor location.
19984 (Operator.Define): Use the location of the operator for the
19985 implicit Method definition.
19987 (Constructor.Emit): use the constructor location for the implicit
19988 base initializer constructor.
19990 * ecore.cs: Remove ITypeExpression. This interface is now gone,
19991 and the Expression class now contains two new methods:
19993 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
19994 isolate type lookup from the rest of the resolution process.
19996 Since we use Expressions to hold type definitions due to the way
19997 we parse the input we have historically overloaded Resolve to
19998 perform the Type lookups if a special flag is passed. Now this is
19999 eliminated and two methods take their place.
20001 The differences in the two methods between xStep and xTerminal is
20002 that xStep is involved in our current lookup system that uses
20003 SimpleNames to compose a name, while xTerminal is used just to
20004 catch the case where the simplename lookup failed.
20006 2003-04-16 Miguel de Icaza <miguel@ximian.com>
20008 * expression.cs (ResolveMemberAccess): Remove redundant code.
20009 TypeExpr expressions are always born fully resolved.
20011 * interface.cs (PopulateMethod): Do not lookup the types twice.
20012 We were doing it once during SemanticAnalysis and once during
20015 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
20016 in local variable type definitions, were being returned as a
20017 SimpleName (we decomposed everything into a string), that is
20018 because primary_expression was being used instead of a type in the
20019 grammar (reduce/reduce conflicts).
20021 The part that was wrong is that we converted the expression into a
20022 string (an oversimplification in one hand, compounded with primary
20023 expressions doing string concatenation).
20029 Would return "A.B.C[]" as a SimpleName. This stopped things like
20030 using clauses from working on this particular context. And a type
20031 was being matched directly against "A.B.C[]".
20033 We now use the correct approach, and allow for ComposedCast to be
20034 part of the unary expression. So the "A.B.C []" become a composed
20035 cast of "A.B.C" (as a nested group of MemberAccess with a
20036 SimpleName at the end) plus the rank composition "[]".
20040 2003-04-10 Miguel de Icaza <miguel@ximian.com>
20042 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
20043 for the access level checking.
20045 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
20046 `TypeContainer container', because I kept getting confused when I
20047 was debugging this code.
20049 * expression.cs (Indexers): Instead of tracking getters/setters,
20050 we now track them in parallel. We create one arraylist less, but
20051 most importantly it is possible now for the LValue code to find a
20052 matching get for a set.
20054 (IndexerAccess.DoResolveLValue): Update the code.
20055 GetIndexersForType has been modified already to extract all the
20056 indexers from a type. The code assumed it did not.
20058 Also make the code set the correct return type for the indexer.
20059 This was fixed a long time ago for properties, but was missing for
20060 indexers. It used to be void_type.
20062 (Binary.Emit): Test first for doubles instead of
20063 floats, as they are more common.
20065 (Binary.EmitBranchable): Use the .un version of the branch opcodes
20066 when dealing with floats and the <=, >= operators. This fixes bug
20069 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
20070 to load the array value by emitting a load on the foreach variable
20071 type. This was incorrect.
20073 We now emit the code to load an element using the the array
20074 variable type, and then we emit the conversion operator.
20078 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
20080 * attribute.cs: Avoid allocation of ArrayLists in the common case.
20082 2003-04-09 Miguel de Icaza <miguel@ximian.com>
20084 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
20085 test for protection before we test for signatures.
20087 (MethodSignature.ToString): implement.
20089 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
20090 to the case where we reduced into a LongConstant.
20092 * decl.cs (CheckAccessLevel): If the type is an array, we can not
20093 depend on whether the information is acurrate, because the
20094 Microsoft runtime will always claim that the array type is public,
20095 regardless of the real state.
20097 If the type is a pointer, another problem happens: the type is
20098 reported as non-public in Microsoft.
20100 In both cases we have to call CheckAccessLevel recursively with
20101 the underlying type as the argument to be tested.
20103 2003-04-08 Miguel de Icaza <miguel@ximian.com>
20105 * assign.cs (Assign.Emit): If we are dealing with a compound
20106 assignment expression, we should use the code path that stores the
20107 intermediate result in a temporary value. This fixes #40903.
20109 *expression.cs (Indirection.ToString): Provide ToString method for
20112 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
20114 * class.cs: Null out fields holding references to Block objects so
20115 they can be garbage collected.
20117 * expression.cs (OverloadResolve): Remove unused local.
20119 2003-04-07 Martin Baulig <martin@ximian.com>
20121 * codegen.cs (EmitContext.CurrentFile): New public field.
20122 (EmitContext.Mark): Use the CurrentFile to check whether the
20123 location is in the correct file.
20124 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
20126 2003-04-07 Martin Baulig <martin@ximian.com>
20128 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
20130 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
20131 location. [FIXME: The location argument which gets passed to this
20132 method is sometimes wrong!]
20134 2003-04-07 Nick Drochak <ndrochak@gol.com>
20136 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
20138 2003-04-07 Miguel de Icaza <miguel@ximian.com>
20140 * expression.cs (Indirection.EmitAssign): We were using the
20141 temporary, but returning immediately instead of continuing the
20144 2003-04-06 Martin Baulig <martin@ximian.com>
20146 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
20147 if it's a nested child, but also deriving from the outer class.
20150 * typemanager.cs (IsNestedChildOf): Make this work if it's a
20151 nested child, but also deriving from the outer class. See
20153 (FilterWithClosure): We may access private members of the outer
20154 class if we're a nested child and deriving from the outer class.
20155 (RealMemberLookup): Only set `closure_private_ok' if the
20156 `original_bf' contained BindingFlags.NonPublic.
20158 2003-04-05 Martin Baulig <martin@ximian.com>
20160 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
20162 2003-04-02 Miguel de Icaza <miguel@ximian.com>
20164 * class.cs (Event.Define): Do not allow abstract events to have
20167 2003-04-01 Miguel de Icaza <miguel@ximian.com>
20169 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
20170 block in event declarations.
20172 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
20173 value type, get its address.
20175 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
20176 leaving a class on the stack instead of a boolean value (int
20177 0/1). Change the code so we compare against null, and then the
20178 result against zero.
20180 * class.cs (TypeContainer.GetClassBases): We were checking for the
20181 parent class being sealed too late.
20183 * expression.cs (Binary.Emit): For <= and >= when dealing with
20184 floating point values, use cgt.un and clt.un instead of cgt and
20187 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
20189 * statement.cs: Apply the same optimization as MS: skip the
20190 GetEnumerator returning an IEnumerator, and use the one returning a
20191 CharEnumerator instead. This allows us to avoid the try-finally block
20194 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
20196 * cs-parser.jay: Attributes cannot be applied to
20197 namespaces. Fixes #40473
20199 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20202 (Add*): check if the name is valid using the full name for constants,
20203 fields, properties and events.
20205 2003-03-28 Miguel de Icaza <miguel@ximian.com>
20207 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
20208 char constants to be part of the enumeration.
20210 * expression.cs (Conditional.DoResolve): Add support for operator
20211 true. Implements the missing functionality from 14.12
20213 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
20214 operator true/false as required by the spec.
20216 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
20217 implicit conversion to boolean.
20219 * statement.cs (Statement.ResolveBoolean): A boolean expression is
20220 also one where the type implements `operator true'.
20222 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
20223 get an expression that will invoke operator true based on an
20226 (GetConversionOperators): Removed the hack that called op_True
20229 (Expression.ResolveBoolean): Move this from Statement.
20231 2003-03-17 Miguel de Icaza <miguel@ximian.com>
20233 * ecore.cs (FieldExpr): do not allow initialization of initonly
20234 fields on derived classes
20236 2003-03-13 Martin Baulig <martin@ximian.com>
20238 * statement.cs (Block.Emit): Call ig.BeginScope() and
20239 ig.EndScope() when compiling with debugging info; call
20240 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
20242 2003-03-08 Miguel de Icaza <miguel@ximian.com>
20244 * expression.cs (Indexers): Do not construct immediately, allow
20245 for new members to be appended as we go. Fixes 38143
20247 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20249 * expression.cs: save/restore context when resolving an unchecked
20252 2003-03-05 Miguel de Icaza <miguel@ximian.com>
20254 * cfold.cs: Catch division by zero in modulus operator during
20257 2003-03-03 Miguel de Icaza <miguel@ximian.com>
20259 * interface.cs (Interface.DefineMembers): Avoid defining members
20262 2003-02-27 Miguel de Icaza <miguel@ximian.com>
20264 * driver.cs: handle the +/- options for -noconfig
20266 * statement.cs (Unckeched.Resolve): Also track the state of
20267 unchecked in the Resolve phase.
20269 2003-02-27 Martin Baulig <martin@ximian.com>
20271 * ecore.cs (Expression.MemberLookup): Don't create a
20272 MethodGroupExpr for something which is not a method. Fixes #38291.
20274 2003-02-25 Miguel de Icaza <miguel@ximian.com>
20276 * class.cs (MemberBase.CheckParameters): Also check that the type
20277 is unmanaged if it is a pointer.
20279 * expression.cs (SizeOf.Resolve): Add location information.
20281 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
20282 a managed type is declared.
20284 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
20285 parameter modifiers as well. Fixes bug 38606
20287 * class.cs: Very sad. Am backing out the speed up changes
20288 introduced by the ArrayList -> Array in the TypeContainer, as they
20289 were not actually that much faster, and introduced a bug (no error
20290 reports on duplicated methods).
20292 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
20293 source first, this will guarantee that we have a valid expression
20294 before calling in lower levels functions that will require a
20295 resolved object. Then use this original_source in the
20296 target.ResolveLValue instead of the original source that was
20299 Another change. Use target.Resolve instead of LValueResolve.
20300 Although we are resolving for LValues, we will let the Assign code
20301 take care of that (it will be called again from Resolve). This
20302 basically allows code like this:
20304 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
20305 class Y { void A (X x) { x [0] += o; }
20307 The problem was that the indexer was trying to resolve for
20308 set_Item (idx, object o) and never finding one. The real set_Item
20309 was set_Item (idx, X). By delaying the process we get the right
20314 2003-02-23 Martin Baulig <martin@ximian.com>
20316 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
20317 while calling DoEmit ().
20319 * codegen.cs (EmitContext.Mark): Don't mark locations in other
20320 source files; if you use the #line directive inside a method, the
20321 compiler stops emitting line numbers for the debugger until it
20322 reaches the end of the method or another #line directive which
20323 restores the original file.
20325 2003-02-23 Martin Baulig <martin@ximian.com>
20327 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
20329 2003-02-23 Martin Baulig <martin@ximian.com>
20331 * statement.cs (Block.AddChildVariableNames): We need to call this
20332 recursively, not just for our immediate children.
20334 2003-02-23 Martin Baulig <martin@ximian.com>
20336 * class.cs (Event.Define): Always make the field private, like csc does.
20338 * typemanager.cs (TypeManager.RealMemberLookup): Make events
20339 actually work, fixes bug #37521.
20341 2003-02-23 Miguel de Icaza <miguel@ximian.com>
20343 * delegate.cs: When creating the various temporary "Parameters"
20344 classes, make sure that we call the ComputeAndDefineParameterTypes
20345 on those new parameters (just like we do with the formal ones), to
20346 allow them to be resolved in the context of the DeclSpace.
20348 This fixes the bug that Dick observed in Bugzilla #38530.
20350 2003-02-22 Miguel de Icaza <miguel@ximian.com>
20352 * expression.cs (ResolveMemberAccess): When resolving a constant,
20353 do not attempt to pull a constant if the value was not able to
20354 generate a valid constant.
20356 * const.cs (LookupConstantValue): Do not report more errors than required.
20358 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20360 * expression.cs: fixes bug #38328.
20362 2003-02-18 Miguel de Icaza <miguel@ximian.com>
20364 * class.cs: Changed all the various members that can be part of a
20365 class from being an ArrayList to be an Array of the right type.
20366 During the DefineType type_list, interface_list, delegate_list and
20367 enum_list are turned into types, interfaces, delegates and enums
20370 And during the member population, indexer_list, event_list,
20371 constant_list, field_list, instance_constructor_list, method_list,
20372 operator_list and property_list are turned into their real arrays.
20374 Although we could probably perform this operation earlier, for
20375 good error reporting we need to keep the lists and remove the
20376 lists for longer than required.
20378 This optimization was triggered by Paolo profiling the compiler
20379 speed on the output of `gen-sample-program.pl' perl script.
20381 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
20382 not crash in methods like MemberLookupFailed that use this field.
20384 This problem arises when the compiler fails to resolve a type
20385 during interface type definition for example.
20387 2003-02-18 Miguel de Icaza <miguel@ximian.com>
20389 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
20390 inherit from System.Object, so we have to stop at null, not only
20391 when reaching System.Object.
20393 2003-02-17 Miguel de Icaza <miguel@ximian.com>
20395 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
20396 DeclaredOnly because the parent indexer might have had a different
20397 name, but did not loop until the top of the hierarchy was reached.
20399 The problem this one fixes is 35492: when a class implemented an
20400 indexer from an interface, we were getting the interface method
20401 (which was abstract) and we were flagging an error (can not invoke
20404 This also keeps bug 33089 functioning, and test-148 functioning.
20406 * typemanager.cs (IsSpecialMethod): The correct way of figuring
20407 out if a method is special is to see if it is declared in a
20408 property or event, or whether it is one of the predefined operator
20409 names. This should fix correctly #36804.
20411 2003-02-15 Miguel de Icaza <miguel@ximian.com>
20413 The goal here is to remove the dependency on EmptyCast.Peel ().
20414 Killing it completely.
20416 The problem is that currently in a number of places where
20417 constants are expected, we have to "probe" for an EmptyCast, and
20418 Peel, which is not the correct thing to do, as this will be
20419 repetitive and will likely lead to errors.
20421 The idea is to remove any EmptyCasts that are used in casts that
20422 can be reduced to constants, so we only have to cope with
20425 This bug hunt was triggered by Bug 37363 and the desire to remove
20426 the duplicate pattern where we were "peeling" emptycasts to check
20427 whether they were constants. Now constants will always be
20430 * ecore.cs: Use an enumconstant here instead of wrapping with
20433 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
20434 throwing me off. By handling this we can get rid of a few hacks.
20436 * statement.cs (Switch): Removed Peel() code.
20438 2003-02-14 Miguel de Icaza <miguel@ximian.com>
20440 * class.cs: Location information for error 508
20442 * expression.cs (New.DoResolve): Add a guard against double
20443 resolution of an expression.
20445 The New DoResolve might be called twice when initializing field
20446 expressions (see EmitFieldInitializers, the call to
20447 GetInitializerExpression will perform a resolve on the expression,
20448 and later the assign will trigger another resolution
20450 This leads to bugs (#37014)
20452 * delegate.cs: The signature for EndInvoke should contain any ref
20453 or out parameters as well. We were not doing this in the past.
20455 * class.cs (Field.Define): Do not overwrite the type definition
20456 inside the `volatile' group. Turns out that volatile enumerations
20457 were changing the type here to perform a validity test, which
20460 2003-02-12 Miguel de Icaza <miguel@ximian.com>
20462 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
20463 and structs, we do not want to load the instance variable
20465 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
20466 enum_type has to be handled like an object reference (implicit
20467 conversions exists from this to object), but the regular IsClass
20468 and IsValueType tests will never return true for this one.
20470 Also we use TypeManager.IsValueType instead of type.IsValueType,
20471 just for consistency with the rest of the code (this is only
20472 needed if we ever use the construct exposed by test-180.cs inside
20473 corlib, which we dont today).
20475 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
20477 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
20480 2003-02-09 Martin Baulig <martin@ximian.com>
20482 * namespace.cs (Namespace..ctor): Added SourceFile argument.
20483 (Namespace.DefineNamespaces): New static public method; this is
20484 called when we're compiling with debugging to add all namespaces
20485 to the symbol file.
20487 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
20488 pass it to the Namespace's .ctor.
20490 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
20491 and MethodBase arguments; pass the namespace ID to the symwriter;
20492 pass the MethodBase instead of the token to the symwriter.
20493 (SymbolWriter.DefineNamespace): New method to add a namespace to
20496 2003-02-09 Martin Baulig <martin@ximian.com>
20498 * symbolwriter.cs: New file. This is a wrapper around
20499 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
20500 methods here in near future.
20502 2003-02-09 Martin Baulig <martin@ximian.com>
20504 * codegen.cs (EmitContext.Mark): Just pass the arguments to
20505 ILGenerator.MarkSequencePoint() which are actually used by the
20508 2003-02-09 Martin Baulig <martin@ximian.com>
20510 * location.cs (SourceFile): New public sealed class. This
20511 contains the name and an index which is used in the location's token.
20512 (Location): Reserve an appropriate number of bits in the token for
20513 the source file instead of walking over that list, this gives us a
20514 really huge performance improvement when compiling with debugging.
20516 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
20517 `SourceFile' argument instead of a string.
20518 (Driver.ProcessFile): Add all the files via Location.AddFile(),
20519 but don't parse/tokenize here, we need to generate the list of all
20520 source files before we do that.
20521 (Driver.ProcessFiles): New static function. Parses/tokenizes all
20524 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
20525 instead of a string.
20527 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
20530 2003-02-09 Martin Baulig <martin@ximian.com>
20532 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
20533 filename on `#line default'.
20535 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
20537 * statement.cs: don't clear the pinned var when the fixed statement
20538 returns from the method (fixes bug#37752).
20540 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
20542 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
20545 2003-02-07 Martin Baulig <martin@ximian.com>
20547 * driver.cs: Removed the `--debug-args' command line argument.
20549 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
20550 automatically by the AsssemblyBuilder.
20551 (CodeGen.InitializeSymbolWriter): We don't need to call any
20552 initialization function on the symbol writer anymore. This method
20553 doesn't take any arguments.
20555 2003-02-03 Miguel de Icaza <miguel@ximian.com>
20557 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
20558 from referenced assemblies as well.
20560 2003-02-02 Martin Baulig <martin@ximian.com>
20562 * class.cs (MethodData.Emit): Generate debugging info for external methods.
20564 2003-02-02 Martin Baulig <martin@ximian.com>
20566 * class.cs (Constructor.Emit): Open the symbol writer before
20567 emitting the constructor initializer.
20568 (ConstructorInitializer.Emit): Call ec.Mark() to allow
20569 single-stepping through constructor initializers.
20571 2003-01-30 Miguel de Icaza <miguel@ximian.com>
20573 * class.cs: Handle error 549: do not allow virtual methods in
20576 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
20578 * decl.cs: Check access levels when resolving types
20580 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
20582 * statement.cs: Add parameters and locals set in catch blocks that might
20583 return to set vector
20585 2003-01-29 Miguel de Icaza <miguel@ximian.com>
20587 * class.cs (Operator): Set the SpecialName flags for operators.
20589 * expression.cs (Invocation.DoResolve): Only block calls to
20590 accessors and operators on SpecialName methods.
20592 (Cast.TryReduce): Handle conversions from char constants.
20595 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
20597 * statement.cs: small memory and time optimization in FlowBranching.
20599 2003-01-28 Pedro Mart <yoros@wanadoo.es>
20601 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
20602 problem that the last fix but in the other sid (Set).
20604 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
20605 access when there is no indexer in the hierarchy.
20607 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
20609 * class.cs: Combine some if statements.
20611 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20613 * driver.cs: fixed bug #37187.
20615 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
20617 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
20618 any indexer, it's needed to build a list with all the indexers in the
20619 hierarchy (AllGetters), else we have problems. Fixes #35653.
20621 2003-01-23 Miguel de Icaza <miguel@ximian.com>
20623 * class.cs (MethodData.Define): It is wrong for an interface
20624 implementation to be static in both cases: explicit and implicit.
20625 We were only handling this in one case.
20627 Improve the if situation there to not have negations.
20629 * class.cs (Field.Define): Turns out that we do not need to check
20630 the unsafe bit on field definition, only on usage. Remove the test.
20632 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20634 * driver.cs: use assembly.Location instead of Codebase (the latest
20635 patch made mcs fail when using MS assemblies).
20637 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
20639 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
20640 get the path to *corlib.dll.
20642 2003-01-21 Nick Drochak <ndrochak@gol.com>
20646 * typemanager.cs: Remove compiler warnings
20648 2003-01-20 Duncan Mak <duncan@ximian.com>
20650 * AssemblyInfo.cs: Bump the version number to 0.19.
20652 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20654 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
20656 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
20658 * class.cs (Constructor::Emit): Emit debugging info for constructors.
20660 2003-01-17 Miguel de Icaza <miguel@ximian.com>
20662 * cs-parser.jay: Small fix: we were not comparing the constructor
20663 name correctly. Thanks to Zoltan for the initial pointer.
20665 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
20667 * cs-tokenizer.cs: Set file name when specified with #line
20669 2003-01-15 Miguel de Icaza <miguel@ximian.com>
20671 * cs-parser.jay: Only perform the constructor checks here if we
20672 are named like the class; This will help provider a better
20673 error. The constructor path is taken when a type definition is
20674 not found, but most likely the user forgot to add the type, so
20675 report that rather than the constructor error.
20677 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
20679 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
20682 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20684 * cs-parser.jay: Add cleanup call.
20686 2003-01-13 Duncan Mak <duncan@ximian.com>
20688 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
20689 consistent with other methods.
20691 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20693 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
20695 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
20697 * attribute.cs: only set GuidAttr to true when we have a
20700 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20704 * typemanager.cs: fixes to allow mcs compile corlib with the new
20705 Type.IsSubclassOf fix.
20707 2003-01-08 Miguel de Icaza <miguel@ximian.com>
20709 * expression.cs (LocalVariableReference.DoResolve): Classify a
20710 constant as a value, not as a variable. Also, set the type for
20713 * cs-parser.jay (fixed_statement): take a type instead of a
20714 pointer_type, so we can produce a better error message later.
20716 * statement.cs (Fixed.Resolve): Flag types that are not pointers
20719 (For.DoEmit): Make inifinite loops have a
20720 non-conditional branch back.
20722 (Fixed.DoEmit): First populate the pinned variables, then emit the
20723 statement, then clear the variables. Before I was emitting the
20724 code once for each fixed piece.
20727 2003-01-08 Martin Baulig <martin@ximian.com>
20729 * statement.cs (FlowBranching.MergeChild): A break in a
20730 SWITCH_SECTION does not leave a loop. Fixes #36155.
20732 2003-01-08 Martin Baulig <martin@ximian.com>
20734 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
20735 lives in the same number space than `param_map'. Fixes #36154.
20737 2003-01-07 Miguel de Icaza <miguel@ximian.com>
20739 * cs-parser.jay (constructor_declaration): Set the
20740 Constructor.ModFlags before probing for it. This makes the
20741 compiler report 514, 515 and 132 (the code was there, but got
20744 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
20745 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
20746 (GotoCase.Resolve): Set `Returns' to ALWAYS.
20748 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
20750 * enum.cs: create the enum static fields using the enum type.
20752 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
20754 * class.cs: don't try to create the ParamBuilder for the return
20755 type if it's not needed (and handle it breaking for the ms runtime
20758 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
20760 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
20762 2002-12-29 Miguel de Icaza <miguel@ximian.com>
20764 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
20765 the command. This showed up while compiling the JANET source
20766 code, which used \r as its only newline separator.
20768 2002-12-28 Miguel de Icaza <miguel@ximian.com>
20770 * class.cs (Method.Define): If we are an operator (because it
20771 reuses our code), then set the SpecialName and HideBySig. #36128
20773 2002-12-22 Miguel de Icaza <miguel@ximian.com>
20775 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
20776 exception, report error 120 `object reference required'.
20778 * driver.cs: Add --pause option, used during to measure the size
20779 of the process as it goes with --timestamp.
20781 * expression.cs (Invocation.DoResolve): Do not allow methods with
20782 SpecialName to be invoked.
20784 2002-12-21 Miguel de Icaza <miguel@ximian.com>
20786 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
20787 number before adding it.
20789 2002-12-21 Ravi Pratap <ravi@ximian.com>
20791 * ecore.cs (StandardImplicitConversion): When in an unsafe
20792 context, we allow conversion between void * to any other pointer
20793 type. This fixes bug #35973.
20795 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
20797 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
20798 is not thrown when extensionless outputs are used
20800 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20802 * rootcontext.cs: fixed compilation of corlib.
20804 2002-12-19 Miguel de Icaza <miguel@ximian.com>
20806 * attribute.cs (Attributes.Contains): Add new method.
20808 * class.cs (MethodCore.LabelParameters): if the parameter is an
20809 `out' parameter, check that no attribute `[In]' has been passed.
20811 * enum.cs: Handle the `value__' name in an enumeration.
20813 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
20815 * decl.cs: Added special case to allow overrides on "protected
20818 2002-12-18 Ravi Pratap <ravi@ximian.com>
20820 * attribute.cs (Attributes.AddAttributeSection): Rename to this
20821 since it makes much more sense.
20823 (Attributes.ctor): Don't require a Location parameter.
20825 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
20827 * attribute.cs (ApplyAttributes): Remove extra Location parameters
20828 since we already have that information per attribute.
20830 * everywhere : make appropriate changes.
20832 * class.cs (LabelParameters): Write the code which actually
20833 applies attributes to the return type. We can't do this on the MS
20834 .NET runtime so we flag a warning in the case an exception is
20837 2002-12-18 Miguel de Icaza <miguel@ximian.com>
20839 * const.cs: Handle implicit null conversions here too.
20841 2002-12-17 Ravi Pratap <ravi@ximian.com>
20843 * class.cs (MethodCore.LabelParameters): Remove the extra
20844 Type [] parameter since it is completely unnecessary. Instead
20845 pass in the method's attributes so that we can extract
20846 the "return" attribute.
20848 2002-12-17 Miguel de Icaza <miguel@ximian.com>
20850 * cs-parser.jay (parse): Use Report.Error to flag errors instead
20851 of ignoring it and letting the compile continue.
20853 * typemanager.cs (ChangeType): use an extra argument to return an
20854 error condition instead of throwing an exception.
20856 2002-12-15 Miguel de Icaza <miguel@ximian.com>
20858 * expression.cs (Unary.TryReduce): mimic the code for the regular
20859 code path. Perform an implicit cast in the cases where we can
20860 implicitly convert to one of the integral types, and then reduce
20861 based on that constant. This fixes bug #35483.
20863 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20865 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
20867 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20869 * namespace.cs: fixed bug #35489.
20871 2002-12-12 Miguel de Icaza <miguel@ximian.com>
20873 * class.cs: Remove some dead code.
20875 * cs-parser.jay: Estimate the number of methods needed
20876 (RootContext.MethodCount);
20878 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
20879 numbers instead of StringBuilders.
20881 * support.cs (PtrHashtable): Add constructor with initial size;
20882 We can now reduce reallocations of the method table.
20884 2002-12-10 Ravi Pratap <ravi@ximian.com>
20886 * attribute.cs (ApplyAttributes): Keep track of the emitted
20887 attributes on a per-target basis. This fixes bug #35413.
20889 2002-12-10 Miguel de Icaza <miguel@ximian.com>
20891 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
20892 default to the Windows 1252 encoding.
20894 (UnixParseOption): Support version, thanks to Alp for the missing
20897 * AssemblyInfo.cs: Add nice assembly information.
20899 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
20902 * cs-parser.jay: Allow a trailing comma before the close bracked
20903 in the attribute_section production.
20905 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
20906 address of the instance was being taken, I will take this out,
20907 because we take the address of the object immediately here.
20909 2002-12-09 Ravi Pratap <ravi@ximian.com>
20911 * typemanager.cs (AreMultipleAllowed): Take care of the most
20912 obvious case where attribute type is not in the current assembly -
20915 2002-12-08 Miguel de Icaza <miguel@ximian.com>
20917 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
20918 definitions, instead of doing that afterwards.
20920 Also we use a nice little hack, depending on the constructor, we
20921 know if we are a "composed" name or a simple name. Hence, we
20922 avoid the IndexOf test, and we avoid
20924 * codegen.cs: Add code to assist in a bug reporter to track down
20925 the source of a compiler crash.
20927 2002-12-07 Ravi Pratap <ravi@ximian.com>
20929 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
20930 types have been emitted for a given element and flag an error
20931 if something which does not have AllowMultiple set is used more
20934 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
20935 attribute types and their corresponding AllowMultiple properties
20937 (AreMultipleAllowed): Check the property for a given type.
20939 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
20940 property in the case we have a TypeContainer.
20942 (Attributes.AddAttribute): Detect duplicates and just skip on
20943 adding them. This trivial fix catches a pretty gross error in our
20944 attribute emission - global attributes were being emitted twice!
20946 Bugzilla bug #33187 is now fixed.
20948 2002-12-06 Miguel de Icaza <miguel@ximian.com>
20950 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
20951 instead of pp_and).
20953 * expression.cs (Binary.ResolveOperator): I can only use the
20954 Concat (string, string, string) and Concat (string, string,
20955 string, string) if the child is actually a concatenation of
20958 2002-12-04 Miguel de Icaza <miguel@ximian.com>
20960 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
20961 context where we need a 2-character lookahead.
20963 * pending.cs (PendingImplementation): Rework so we can keep track
20964 of interface types all the time, and flag those which were
20965 implemented by parents as optional.
20967 2002-12-03 Miguel de Icaza <miguel@ximian.com>
20969 * expression.cs (Binary.ResolveOperator): Use
20970 String.Concat(string,string,string) or
20971 String.Concat(string,string,string,string) when possible.
20973 * typemanager: More helper methods.
20976 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
20978 * pending.cs: remove the bogus return from GetMissingInterfaces()
20979 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
20981 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20983 * namespace.cs: avoid duplicated 'using xxx' being added to
20984 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
20985 when we get more than one 'using' statement for the same namespace.
20986 Report a CS0105 warning for it.
20988 2002-11-30 Miguel de Icaza <miguel@ximian.com>
20990 * cs-tokenizer.cs (consume_identifier): use read directly, instead
20991 of calling getChar/putback, uses internal knowledge of it.
20993 (xtoken): Reorder tokenizer so most common patterns are checked
20994 first. This reduces the compilation time in another 5% (from 8.11s
20995 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
20997 The parsing time is 22% of the compilation in mcs, and from that
20998 64% is spent on the tokenization process.
21000 I tried using a binary search for keywords, but this is slower
21001 than the hashtable. Another option would be to do a couple of
21004 * Not use a StringBuilder, instead use an array of chars,
21005 with a set value. Notice that this way we could catch
21006 the 645 error without having to do it *afterwards*.
21008 * We could write a hand-parser to avoid the hashtable
21009 compares altogether.
21011 The identifier consumption process takes 37% of the tokenization
21012 time. Another 15% is spent on is_number. 56% of the time spent
21013 on is_number is spent on Int64.Parse:
21015 * We could probably choose based on the string length to
21016 use Int32.Parse or Int64.Parse and avoid all the 64-bit
21019 Another 3% is spend on wrapping `xtoken' in the `token' function.
21021 Handle 0xa0 as whitespace (#34752)
21023 2002-11-26 Miguel de Icaza <miguel@ximian.com>
21025 * typemanager.cs (IsCLRType): New routine to tell whether a type
21026 is one of the builtin types.
21028 Maybe it needs to use TypeCodes to be faster. Maybe we could use
21029 typecode in more places instead of doing pointer comparissions.
21030 We could leverage some knowledge about the way the typecodes are
21033 New code to cache namespaces in assemblies, it is currently not
21034 invoked, to be used soon.
21036 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
21038 * expression.cs (Binary.ResolveOperator): specially handle
21039 strings, and do not perform user-defined operator overloading for
21042 2002-11-24 Miguel de Icaza <miguel@ximian.com>
21044 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
21045 internalcall as it is a pretty simple operation; Avoid whenever
21046 possible to call Char.IsLetter.
21048 (consume_identifier): Cut by half the number of
21049 hashtable calls by merging the is_keyword and GetKeyword behavior.
21051 Do not short-circuit, because if we do, we
21052 report errors (ie, #if false && true would produce an invalid
21056 2002-11-24 Martin Baulig <martin@ximian.com>
21058 * expression.cs (Cast.TryReduce): If we're in checked syntax,
21059 check constant ranges and report a CS0221. Fixes #33186.
21061 2002-11-24 Martin Baulig <martin@ximian.com>
21063 * cs-parser.jay: Make this work for uninitialized variable
21064 declarations in the `for' initializer. Fixes #32416.
21066 2002-11-24 Martin Baulig <martin@ximian.com>
21068 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
21069 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
21071 2002-11-24 Martin Baulig <martin@ximian.com>
21073 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
21074 argument; if true, we also check for user-defined conversions.
21075 This is only needed if both arguments are of a user-defined type.
21076 Fixes #30443, added test-175.cs.
21077 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
21079 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
21081 2002-11-24 Martin Baulig <martin@ximian.com>
21083 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
21084 function to get the store opcode.
21085 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
21086 only emit the Ldelema if the store opcode is Stobj. You must run
21087 both test-34 and test-167 to test this. Fixes #34529.
21089 2002-11-23 Martin Baulig <martin@ximian.com>
21091 * ecore.cs (Expression.MemberLookup): Added additional
21092 `qualifier_type' argument which is used when we're being called
21093 from MemberAccess.DoResolve() and null if we're called from a
21095 (Expression.MemberLookupFailed): New method to report errors; this
21096 does the CS1540 check and reports the correct error message.
21098 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
21099 argument for the CS1540 check and redone the way how we're dealing
21100 with private members. See the comment in the source code for details.
21101 (FilterWithClosure): Reverted this back to revision 1.197; renamed
21102 `closure_start_type' to `closure_qualifier_type' and check whether
21103 it's not null. It was not this filter being broken, it was just
21104 being called with the wrong arguments.
21106 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
21107 and pass it the correct `qualifier_type'; this also does the error
21110 2002-11-22 Miguel de Icaza <miguel@ximian.com>
21112 * expression.cs (Invocation.EmitParams): If the we are dealing
21113 with a non-built-in value type, load its address as well.
21115 (ArrayCreation): Use a a pretty constant instead
21116 of the hardcoded value 2. Use 6 instead of 2 for the number of
21117 static initializers.
21119 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
21120 because they are not really value types, just glorified integers.
21122 * driver.cs: Do not append .exe, the CSC compiler does not do it.
21124 * ecore.cs: Remove redundant code for enumerations, make them use
21125 the same code path as everything else, fixes the casting issue
21126 with enumerations in Windows.Forms.
21128 * attribute.cs: Do only cast to string if it is a string, the
21129 validation happens later.
21131 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
21132 people upgrade their corlibs.
21134 * ecore.cs: Oops, enumerations were not following the entire code path
21136 2002-11-21 Miguel de Icaza <miguel@ximian.com>
21138 * typemanager.cs (FilterWithClosure): Commented out the test for
21139 1540 in typemanager.cs, as it has problems when accessing
21140 protected methods from a parent class (see test-174.cs).
21142 * attribute.cs (Attribute.ValidateGuid): new method.
21143 (Attribute.Resolve): Use above.
21145 2002-11-19 Miguel de Icaza <miguel@ximian.com>
21147 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
21149 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
21150 handling for enumerations, as we only needed the TypeContainer
21151 functionality to begin with (this is required for the fix below to
21152 work for enums that reference constants in a container class for
21155 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
21157 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
21158 a valid TypeBuilder to perform lookups on.o
21160 * class.cs (InheritableMemberSignatureCompare): Use true in the
21161 call to GetGetMethod and GetSetMethod, because we are comparing
21162 the signature, and we need to get the methods *even* if they are
21165 (PropertyBase.CheckBase): ditto.
21167 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
21168 GotoCase.Resolve): Use Peel on EmpytCasts.
21170 * ecore.cs (EmptyCast): drop child, add Peel method.
21172 2002-11-17 Martin Baulig <martin@ximian.com>
21174 * ecore.cs (EmptyCast.Child): New public property.
21176 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
21177 label resolved to an EmptyCast. Fixes #34162.
21178 (GotoCase.Resolve): Likewise.
21179 (Block.EmitMeta): Likewise.
21181 2002-11-17 Martin Baulig <martin@ximian.com>
21183 * expression.cs (Invocation.BetterConversion): Prefer int over
21184 uint; short over ushort; long over ulong for integer literals.
21185 Use ImplicitConversionExists instead of StandardConversionExists
21186 since we also need to check for user-defined implicit conversions.
21187 Fixes #34165. Added test-173.cs.
21189 2002-11-16 Martin Baulig <martin@ximian.com>
21191 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
21192 with the `true' and `false' literals. Fixes #33151.
21194 2002-11-16 Martin Baulig <martin@ximian.com>
21196 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
21197 October 22nd; don't do the cs1540 check for static members.
21199 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
21200 now using our own filter here and doing the cs1540 check again.
21202 2002-11-16 Martin Baulig <martin@ximian.com>
21204 * support.cs (InternalParameters): Don't crash if we don't have
21205 any fixed parameters. Fixes #33532.
21207 2002-11-16 Martin Baulig <martin@ximian.com>
21209 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
21210 when looking up static methods to make this work on Windows.
21213 2002-11-16 Martin Baulig <martin@ximian.com>
21215 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
21216 a setter rather than using PropertyInfo.CanWrite.
21218 2002-11-15 Nick Drochak <ndrochak@gol.com>
21220 * class.cs: Allow acces to block member by subclasses. Fixes build
21223 2002-11-14 Martin Baulig <martin@ximian.com>
21225 * class.cs (Constructor.Emit): Added the extern/block check.
21228 2002-11-14 Martin Baulig <martin@ximian.com>
21230 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
21231 iteration while looking for indexers, this is needed because the
21232 indexer may have a different name in our base classes. Fixed the
21233 error reporting (no indexers at all, not get accessor, no
21234 overloaded match). Fixes bug #33089.
21235 (IndexerAccess.DoResolveLValue): Likewise.
21237 2002-11-14 Martin Baulig <martin@ximian.com>
21239 * class.cs (PropertyBase.CheckBase): Make this work for multiple
21240 indexers. Fixes the first part of bug #33089.
21241 (MethodSignature.InheritableMemberSignatureCompare): Added support
21244 2002-11-13 Ravi Pratap <ravi@ximian.com>
21246 * attribute.cs (Attribute.Resolve): Catch the
21247 NullReferenceException and report it since it isn't supposed to
21250 2002-11-12 Miguel de Icaza <miguel@ximian.com>
21252 * expression.cs (Binary.EmitBranchable): Also handle the cases for
21253 LogicalOr and LogicalAnd that can benefit from recursively
21254 handling EmitBranchable. The code now should be nice for Paolo.
21256 2002-11-08 Miguel de Icaza <miguel@ximian.com>
21258 * typemanager.cs (LookupType): Added a negative-hit hashtable for
21259 the Type lookups, as we perform quite a number of lookups on
21260 non-Types. This can be removed once we can deterministically tell
21261 whether we have a type or a namespace in advance.
21263 But this might require special hacks from our corlib.
21267 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
21268 and double which avoids a conversion from an integer to a double.
21270 * expression.cs: tiny optimization, avoid calling IsConstant,
21271 because it effectively performs the lookup twice.
21273 2002-11-06 Miguel de Icaza <miguel@ximian.com>
21275 But a bogus return here to keep the semantics of the old code
21276 until the Mono runtime is fixed.
21278 * pending.cs (GetMissingInterfaces): New method used to remove all
21279 the interfaces that are already implemented by our parent
21280 classes from the list of pending methods.
21282 * interface.cs: Add checks for calls after ResolveTypeExpr.
21284 2002-11-05 Miguel de Icaza <miguel@ximian.com>
21286 * class.cs (Class.Emit): Report warning 67: event not used if the
21287 warning level is beyond 3.
21289 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
21290 being a NullLiteral.
21292 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
21295 * class.cs (TypeContainer.GetClassBases): Cover a missing code
21296 path that might fail if a type can not be resolved.
21298 * expression.cs (Binary.Emit): Emit unsigned versions of the
21301 * driver.cs: use error 5.
21303 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
21305 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
21307 2002-11-01 Miguel de Icaza <miguel@ximian.com>
21309 * cs-parser.jay (switch_section): A beautiful patch from Martin
21310 Baulig that fixed 33094.
21312 2002-10-31 Miguel de Icaza <miguel@ximian.com>
21314 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
21315 Check whether the base is abstract and report an error if so.
21317 * expression.cs (IndexerAccess.DoResolveLValue,
21318 IndexerAccess.DoResolve): ditto.
21320 (Invocation.DoResolve): ditto.
21322 (Invocation.FullMethodDesc): Improve the report string.
21324 * statement.cs (Block): Eliminate IsVariableDefined as it is
21325 basically just a wrapper for GetVariableInfo.
21327 * ecore.cs (SimpleName): Use new
21329 * support.cs (ReflectionParamter.ParameterType): We unwrap the
21330 type, as we return the actual parameter ref/unref state on a
21333 2002-10-30 Miguel de Icaza <miguel@ximian.com>
21335 * support.cs: Return proper flags REF/OUT fixing the previous
21338 * expression.cs: Reverted last patch, that was wrong. Is_ref is
21339 not used to mean `ref' but `ref or out' in ParameterReference
21341 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
21342 full type signature instead of calling TypeManger.CSharpName
21345 * support.cs (InternalParameters.ParameterDesc): Do not compare
21346 directly to the modflags, because REF/OUT will actually be bitsets
21349 * delegate.cs (VerifyMethod): Check also the modifiers.
21351 * cs-tokenizer.cs: Fix bug where floating point values with an
21352 exponent where a sign was missing was ignored.
21354 * driver.cs: Allow multiple assemblies to be specified in a single
21357 2002-10-28 Miguel de Icaza <miguel@ximian.com>
21359 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
21360 because identifiers after a parenthesis would end up in this kind
21361 of production, and we needed to desamiguate it for having casts
21364 (UserDefinedType *) xxx
21366 2002-10-24 Miguel de Icaza <miguel@ximian.com>
21368 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
21369 we should set on the Bindingflags.NonPublic, but not turn on
21370 private_ok. private_ok controls whether a Private member is
21371 returned (this is chekced on the filter routine), while the
21372 BindingFlags.NonPublic just controls whether private/protected
21373 will be allowed. This fixes the problem part of the problem of
21374 private properties being allowed to be used in derived classes.
21376 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
21377 so we can call the children DoResolveLValue method (this will
21378 properly signal errors on lvalue assignments to base properties)
21380 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
21381 getter are null, and we have a property info, we know that this
21382 happened because the lookup failed, so we report an error 122 for
21383 protection level violation.
21385 We also silently return if setter and getter are null in the
21386 resolve functions, this condition only happens if we have flagged
21387 the error before. This is the other half of the problem.
21389 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
21390 not have accessibility information, that is why we were returning
21391 true in the filter function in typemanager.cs.
21393 To properly report 122 (property is inaccessible because of its
21394 protection level) correctly, we report this error in ResolveAccess
21395 by failing if both the setter and the getter are lacking (ie, the
21398 DoResolve and DoLResolve have been modified to check for both
21399 setter/getter being null and returning silently, the reason being
21400 that I did not want to put the knowledge about this error in upper
21403 int old = Report.Errors;
21404 x = new PropertyExpr (...);
21405 if (old != Report.Errors)
21410 So the property expr is returned, but it is invalid, so the error
21411 will be flagged during the resolve process.
21413 * class.cs: Remove InheritablePropertySignatureCompare from the
21414 class, as we no longer depend on the property signature to compute
21415 whether it is possible to implement a method or not.
21417 The reason is that calling PropertyInfo.GetGetMethod will return
21418 null (in .NET, in Mono it works, and we should change this), in
21419 cases where the Get Method does not exist in that particular
21424 class X { public virtual int A { get { return 1; } } }
21426 class Z : Y { public override int A { get { return 2; } } }
21428 Would fail in Z because the parent (Y) would not have the property
21429 defined. So we avoid this completely now (because the alternative
21430 fix was ugly and slow), and we now depend exclusively on the
21433 (PropertyBase.CheckBase): Use a method-base mechanism to find our
21434 reference method, instead of using the property.
21436 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
21437 routines are gone now.
21439 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
21440 names, they were incorrectly named.
21442 * cs-tokenizer.cs: Return are more gentle token on failure.
21444 * pending.cs (PendingImplementation.InterfaceMethod): This routine
21445 had an out-of-sync index variable, which caused it to remove from
21446 the list of pending methods the wrong method sometimes.
21448 2002-10-22 Miguel de Icaza <miguel@ximian.com>
21450 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
21451 CanWrite, because those refer to this particular instance of the
21452 property, and do not take into account the fact that we can
21453 override single members of a property.
21455 Constructor requires an EmitContext. The resolution process does
21456 not happen here, but we need to compute the accessors before,
21457 because the resolution does not always happen for properties.
21459 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
21460 subclass, before we did not update this flag, but we did update
21463 (GetAccessors): Drop this routine, as it did not work in the
21464 presence of partially overwritten set/get methods.
21466 Notice that this broke the cs1540 detection, but that will require
21469 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21473 * driver.cs: issue a warning instead of an error if we don't support
21474 debugging for the platform. Also ignore a couple of errors that may
21475 arise when trying to write the symbols. Undo my previous patch.
21477 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21479 * driver.cs: ignore /debug switch except for Unix platforms.
21481 2002-10-23 Nick Drochak <ndrochak@gol.com>
21483 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
21485 2002-10-21 Miguel de Icaza <miguel@ximian.com>
21487 * driver.cs: Do not make mcs-debug conditional, so we do not break
21488 builds that use it.
21490 * statement.cs (UsageVector.MergeChildren): I would like Martin to
21491 review this patch. But basically after all the children variables
21492 have been merged, the value of "Breaks" was not being set to
21493 new_breaks for Switch blocks. I think that it should be set after
21494 it has executed. Currently I set this to the value of new_breaks,
21495 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
21496 conservative, but I do not understand this code very well.
21498 I did not break anything in the build, so that is good ;-)
21500 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
21502 2002-10-20 Mark Crichton <crichton@gimp.org>
21504 * cfold.cs: Fixed compile blocker. Really fixed it this time.
21506 2002-10-20 Nick Drochak <ndrochak@gol.com>
21508 * cfold.cs: Fixed compile blocker.
21510 2002-10-20 Miguel de Icaza <miguel@ximian.com>
21512 * driver.cs: I was chekcing the key, not the file.
21514 2002-10-19 Ravi Pratap <ravi@ximian.com>
21516 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
21517 message that we were generating - we just need to silently return
21520 2002-10-19 Miguel de Icaza <miguel@ximian.com>
21522 * class.cs (Event.Define): Change my previous commit, as this
21523 breaks the debugger. This is a temporary hack, as it seems like
21524 the compiler is generating events incorrectly to begin with.
21526 * expression.cs (Binary.ResolveOperator): Added support for
21527 "U operator - (E x, E y)"
21529 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
21532 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
21533 init-only variables, but this path did not take into account that
21534 there might be also instance readonly variables. Correct this
21537 This fixes bug 32253
21539 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
21542 * driver.cs: Change the extension for modules to `netmodule'
21544 * cs-parser.jay: Improved slightly the location tracking for
21545 the debugger symbols.
21547 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
21548 modifiers that were specified instead of the hardcoded value
21549 (FamAndAssem). This was basically ignoring the static modifier,
21550 and others. Fixes 32429.
21552 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
21553 fixed a bug in the process (32476)
21555 * expression.cs (ArrayAccess.EmitAssign): Patch from
21556 hwang_rob@yahoo.ca that fixes bug 31834.3
21558 2002-10-18 Miguel de Icaza <miguel@ximian.com>
21560 * driver.cs: Make the module extension .netmodule.
21562 2002-10-16 Miguel de Icaza <miguel@ximian.com>
21564 * driver.cs: Report an error if the resource file is not found
21565 instead of crashing.
21567 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
21568 false, like Emit does.
21570 2002-10-16 Nick Drochak <ndrochak@gol.com>
21572 * typemanager.cs: Remove unused private member. Also reported mcs
21573 bug to report this as a warning like csc.
21575 2002-10-15 Martin Baulig <martin@gnome.org>
21577 * statement.cs (Statement.Emit): Made this a virtual method; emits
21578 the line number info and calls DoEmit().
21579 (Statement.DoEmit): New protected abstract method, formerly knows
21580 as Statement.Emit().
21582 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
21584 2002-10-11 Miguel de Icaza <miguel@ximian.com>
21586 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
21587 have fixed a remaining problem: not every AddXXXX was adding a
21588 fully qualified name.
21590 Now everyone registers a fully qualified name in the DeclSpace as
21591 being defined instead of the partial name.
21593 Downsides: we are slower than we need to be due to the excess
21594 copies and the names being registered this way.
21596 The reason for this is that we currently depend (on the corlib
21597 bootstrap for instance) that types are fully qualified, because
21598 we dump all the types in the namespace, and we should really have
21599 types inserted into the proper namespace, so we can only store the
21600 basenames in the defined_names array.
21602 2002-10-10 Martin Baulig <martin@gnome.org>
21604 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
21605 from bug #31834, see the bug report for a testcase which is
21608 2002-10-10 Martin Baulig <martin@gnome.org>
21610 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
21611 flow analysis code for this.
21613 * statement.cs (Do, While, For): Tell the flow analysis code about
21615 (FlowBranching.UsageVector): Added support for infinite loops.
21616 (Block.Resolve): Moved the dead code elimination here and use flow
21619 2002-10-09 Miguel de Icaza <miguel@ximian.com>
21621 * class.cs (Field.Define): Catch cycles on struct type
21624 * typemanager.cs (IsUnmanagedtype): Do not recursively check
21625 fields if the fields are static. We only need to check instance
21628 * expression.cs (As.DoResolve): Test for reference type.
21630 * statement.cs (Using.ResolveExpression): Use
21631 ConvertImplicitRequired, not ConvertImplicit which reports an
21633 (Using.ResolveLocalVariableDecls): ditto.
21635 * expression.cs (Binary.ResolveOperator): Report errors in a few
21636 places where we had to.
21638 * typemanager.cs (IsUnmanagedtype): Finish implementation.
21640 2002-10-08 Miguel de Icaza <miguel@ximian.com>
21642 * expression.cs: Use StoreFromPtr instead of extracting the type
21643 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
21645 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
21646 an enumeration value to a System.Enum, but System.Enum is not a
21647 value type, but an class type, so we need to box.
21649 (Expression.ConvertExplicit): One codepath could return
21650 errors but not flag them. Fix this. Fixes #31853
21652 * parameter.cs (Resolve): Do not allow void as a parameter type.
21654 2002-10-06 Martin Baulig <martin@gnome.org>
21656 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
21657 if it's a class type and not a struct. Fixes #31815.
21659 2002-10-06 Martin Baulig <martin@gnome.org>
21661 * statement.cs: Reworked the flow analysis code a bit to make it
21662 usable for dead code elimination.
21664 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21666 * cs-parser.jay: allow empty source files. Fixes bug #31781.
21668 2002-10-04 Miguel de Icaza <miguel@ximian.com>
21670 * expression.cs (ComposedCast.DoResolveType): A quick workaround
21671 to fix the test 165, will investigate deeper.
21673 2002-10-04 Martin Baulig <martin@gnome.org>
21675 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
21676 finally blocks actually work.
21677 (Try.Resolve): We don't need to create a sibling for `finally' if
21678 there is no finally block.
21680 2002-10-04 Martin Baulig <martin@gnome.org>
21682 * class.cs (Constructor.Define): The default accessibility for a
21683 non-default constructor is private, not public.
21685 2002-10-04 Miguel de Icaza <miguel@ximian.com>
21687 * class.cs (Constructor): Make AllowedModifiers public, add
21690 * cs-parser.jay: Perform the modifiers test here, as the
21691 constructor for the Constructor class usually receives a zero
21692 because of the way we create it (first we create, later we
21693 customize, and we were never checking the modifiers).
21695 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
21696 is a version of LookupTypeReflection that includes the type-name
21697 cache. This can be used as a fast path for functions that know
21698 the fully qualified name and are only calling into *.GetType() to
21699 obtain a composed type.
21701 This is also used by TypeManager.LookupType during its type
21704 (LookupType): We now also track the real type name, as sometimes
21705 we can get a quey for the real type name from things like
21706 ComposedCast. This fixes bug 31422.
21708 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
21709 complete type fullname, it does not have to go through the type
21710 resolution system to obtain the composed version of the type (for
21711 obtaining arrays or pointers).
21713 (Conditional.Emit): Use the EmitBoolExpression to
21714 generate nicer code, as requested by Paolo.
21716 (ArrayCreation.CheckIndices): Use the patch from
21717 hwang_rob@yahoo.ca to validate the array initializers.
21719 2002-10-03 Miguel de Icaza <miguel@ximian.com>
21721 * class.cs (ConstructorInitializer.Emit): simplify code by using
21722 Invocation.EmitCall, and at the same time, fix the bugs in calling
21723 parent constructors that took variable arguments.
21725 * ecore.cs (Expression.ConvertNumericExplicit,
21726 Expression.ImplicitNumericConversion): Remove the code that
21727 manually wrapped decimal (InternalTypeConstructor call is now gone
21730 * expression.cs (Cast.TryReduce): Also handle decimal types when
21731 trying to perform a constant fold on the type.
21733 * typemanager.cs (IsUnmanagedtype): Partially implemented.
21735 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
21736 that only turned off an error report, and did nothing else.
21738 2002-10-02 Miguel de Icaza <miguel@ximian.com>
21740 * driver.cs: Handle and ignore /fullpaths
21742 2002-10-01 Miguel de Icaza <miguel@ximian.com>
21744 * expression.cs (Binary.ResolveOperator): Catch the case where
21745 DoNumericPromotions returns true,
21747 (Binary.DoNumericPromotions): Simplify the code, and the tests.
21749 2002-09-27 Miguel de Icaza <miguel@ximian.com>
21751 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
21754 2002-09-26 Miguel de Icaza <miguel@ximian.com>
21756 * ecore.cs (ConvertNumericExplicit): It is not enough that the
21757 conversion exists, but it is also required that the conversion be
21758 performed. This manifested in "(Type64Enum) 2".
21760 * class.cs (TypeManager.AddMethod): The fix is not to change
21761 AddEnum, because that one was using a fully qualified name (every
21762 DeclSpace derivative does), but to change the AddMethod routine
21763 that was using an un-namespaced name. This now correctly reports
21764 the duplicated name.
21766 Revert patch until I can properly fix it. The issue
21767 is that we have a shared Type space across all namespaces
21768 currently, which is wrong.
21770 Options include making the Namespace a DeclSpace, and merge
21771 current_namespace/current_container in the parser.
21773 2002-09-25 Miguel de Icaza <miguel@ximian.com>
21775 * cs-parser.jay: Improve error reporting when we get a different
21776 kind of expression in local_variable_type and
21777 local_variable_pointer_type.
21779 Propagate this to avoid missleading errors being reported.
21781 * ecore.cs (ImplicitReferenceConversion): treat
21782 TypeManager.value_type as a target just like object_type. As
21787 Is valid, and needs to result in the int 1 being boxed before it
21788 is assigned to the value type v.
21790 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
21791 to validate the enumeration name.
21793 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
21794 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
21795 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
21797 * ecore.cs (TryImplicitIntConversion): When doing an
21798 implicit-enumeration-conversion, check if the type is 64-bits and
21799 perform a conversion before passing to EnumConstant.
21801 2002-09-23 Miguel de Icaza <miguel@ximian.com>
21803 * decl.cs (Error_AmbiguousTypeReference); New routine used to
21804 report ambiguous type references. Unlike the MS version, we
21805 report what the ambiguity is. Innovation at work ;-)
21807 (DeclSpace.FindType): Require a location argument to
21808 display when we display an ambiguous error.
21810 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
21812 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
21814 * expression.cs (EmitDynamicInitializers): Apply patch from
21815 hwang_rob@yahoo.ca that fixes the order in which we emit our
21818 2002-09-21 Martin Baulig <martin@gnome.org>
21820 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
21821 delegate takes no arguments.
21823 2002-09-20 Miguel de Icaza <miguel@ximian.com>
21825 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
21828 * expression.cs: Extract the underlying type.
21830 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
21832 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
21834 2002-09-19 Miguel de Icaza <miguel@ximian.com>
21836 * class.cs (TypeContainer.DefineType): We can not use the nice
21837 PackingSize with the size set to 1 DefineType method, because it
21838 will not allow us to define the interfaces that the struct
21841 This completes the fixing of bug 27287
21843 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
21844 means also structs. This fixes part of the problem.
21845 (Expresion.ImplicitReferenceConversionExists): ditto.
21847 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
21848 error if there were no errors reported during the type lookup
21849 process, to avoid duplicates or redundant errors. Without this
21850 you would get an ambiguous errors plus a type not found. We have
21851 beaten the user enough with the first error.
21853 (DeclSparce.FindType): Emit a warning if we have an ambiguous
21856 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
21857 during the resolution process, stop the lookup, this avoids
21858 repeated error reports (same error twice).
21860 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
21862 * typemanager.cs (LookupType): Redo the type lookup code to match
21863 the needs of System.Reflection.
21865 The issue is that System.Reflection requires references to nested
21866 types to begin with a "+" sign instead of a dot. So toplevel
21867 types look like: "NameSpace.TopLevelClass", and nested ones look
21868 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
21871 2002-09-19 Martin Baulig <martin@gnome.org>
21873 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
21874 says that a method always returns or always throws an exception,
21875 don't report the CS0161.
21877 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
21878 set `Returns = new_returns'.
21880 2002-09-19 Martin Baulig <martin@gnome.org>
21882 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
21883 to an enum constant, check for a CS0176.
21885 2002-09-18 Miguel de Icaza <miguel@ximian.com>
21887 * class.cs (TypeContainer.CheckPairedOperators): Now we check
21888 for operators that must be in pairs and report errors.
21890 * ecore.cs (SimpleName.DoResolveType): During the initial type
21891 resolution process, when we define types recursively, we must
21892 check first for types in our current scope before we perform
21893 lookups in the enclosing scopes.
21895 * expression.cs (MakeByteBlob): Handle Decimal blobs.
21897 (Invocation.VerifyArgumentsCompat): Call
21898 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
21899 I thought we were supposed to always call this, but there are a
21900 few places in the code where we dont do it.
21902 2002-09-17 Miguel de Icaza <miguel@ximian.com>
21904 * driver.cs: Add support in -linkres and -resource to specify the
21905 name of the identifier.
21907 2002-09-16 Miguel de Icaza <miguel@ximian.com>
21909 * ecore.cs (StandardConversionExists): Sync with the conversion
21910 code: allow anything-* to void* conversions.
21912 (FindMostSpecificSource): Use an Expression argument
21913 instead of a Type, because we might be handed over a Literal which
21914 gets a few more implicit conversions that plain types do not. So
21915 this information was being lost.
21917 Also, we drop the temporary type-holder expression when not
21920 2002-09-17 Martin Baulig <martin@gnome.org>
21922 * class.cs (PropertyBase.CheckBase): Don't check the base class if
21923 this is an explicit interface implementation.
21925 2002-09-17 Martin Baulig <martin@gnome.org>
21927 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
21928 different `IndexerName' attributes.
21930 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
21931 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
21932 virtual CommonResolve().
21934 2002-09-16 Miguel de Icaza <miguel@ximian.com>
21936 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
21937 and convert that to the UnderlyingType.
21939 * statement.cs (Foreach.Resolve): Indexers are just like variables
21940 or PropertyAccesses.
21942 * cs-tokenizer.cs (consume_string): Track line numbers and columns
21943 inside quoted strings, we were not doing this before.
21945 2002-09-16 Martin Baulig <martin@gnome.org>
21947 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
21948 resolve it. This is needed for the definite assignment check of the
21949 instance expression, fixes bug #29846.
21950 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
21952 2002-09-16 Nick Drochak <ndrochak@gol.com>
21954 * parameter.cs: Fix compile error. Cannot reference static member
21955 from an instance object. Is this an mcs bug?
21957 2002-09-14 Martin Baulig <martin@gnome.org>
21959 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
21960 multiple times. Fixes bug #30295, added test-166.cs.
21962 2002-09-14 Martin Baulig <martin@gnome.org>
21964 * statement.cs (Block.Emit): Don't emit unreachable code.
21965 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
21966 `break' statements.
21967 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
21969 2002-09-14 Martin Baulig <martin@gnome.org>
21971 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
21974 2002-09-14 Martin Baulig <martin@gnome.org>
21976 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
21977 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
21978 be false on the ms runtime.
21980 2002-09-13 Martin Baulig <martin@gnome.org>
21982 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
21983 the CS0038 error message.
21985 2002-09-12 Miguel de Icaza <miguel@ximian.com>
21987 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
21988 constant inside, return it.
21990 2002-09-12 Martin Baulig <martin@gnome.org>
21992 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
21993 implicit conversion can be done between enum types.
21995 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
21996 check whether an implicit conversion to the current enum's UnderlyingType
21997 exists and report an error if not.
21999 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
22000 without debugging support.
22002 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
22003 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
22005 2002-09-12 Martin Baulig <martin@gnome.org>
22007 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
22009 * ecore.cs (IMemberExpr.DeclaringType): New property.
22010 (SimpleName.SimpleNameResolve): Check whether we're accessing a
22011 nonstatic member of an outer type (CS0038).
22013 2002-09-11 Miguel de Icaza <miguel@ximian.com>
22015 * driver.cs: Activate the using-error detector at warning level
22016 4 (at least for MS-compatible APIs).
22018 * namespace.cs (VerifyUsing): Small buglett fix.
22020 * pending.cs (PendingImplementation): pass the container pointer.
22022 * interface.cs (GetMethods): Allow for recursive definition. Long
22023 term, I would like to move every type to support recursive
22024 definitions, not the current ordering mechanism that we have right
22027 The situation is this: Attributes are handled before interfaces,
22028 so we can apply attributes to interfaces. But some attributes
22029 implement interfaces, we will now handle the simple cases
22030 (recursive definitions will just get an error).
22032 * parameter.cs: Only invalidate types at the end if we fail to
22035 2002-09-09 Martin Baulig <martin@gnome.org>
22037 * ecore.cs (PropertyExpr.Emit): Also check for
22038 TypeManager.system_int_array_get_length so this'll also work when
22039 compiling corlib. Fixes #30003.
22041 2002-09-09 Martin Baulig <martin@gnome.org>
22043 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
22044 and throw an exception if we can't get the type's size. Fixed #30040,
22047 2002-09-09 Martin Baulig <martin@gnome.org>
22049 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
22051 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
22052 context. Fixes bug #30027.
22054 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
22055 virtual functions. Fixes bug #30043, added test-164.cs.
22057 2002-09-08 Ravi Pratap <ravi@ximian.com>
22059 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
22061 2002-09-08 Nick Drochak <ndrochak@gol.com>
22063 * driver.cs: Use an object to get the windows codepage since it's not a
22066 2002-09-08 Miguel de Icaza <miguel@ximian.com>
22068 * statement.cs (For.Emit): for infinite loops (test == null)
22069 return whether there is a break inside, not always "true".
22071 * namespace.cs (UsingEntry): New struct to hold the name of the
22072 using definition, the location where it is defined, and whether it
22073 has been used in a successful type lookup.
22075 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
22080 2002-09-06 Ravi Pratap <ravi@ximian.com>
22082 * attribute.cs : Fix incorrect code which relied on catching
22083 a NullReferenceException to detect a null being passed in
22084 where an object was expected.
22086 2002-09-06 Miguel de Icaza <miguel@ximian.com>
22088 * statement.cs (Try): flag the catch variable as assigned
22090 * expression.cs (Cast): Simplified by using ResolveType instead of
22091 manually resolving.
22093 * statement.cs (Catch): Fix bug by using ResolveType.
22095 2002-09-06 Ravi Pratap <ravi@ximian.com>
22097 * expression.cs (BetterConversion): Special case for when we have
22098 a NullLiteral as the argument and we have to choose between string
22099 and object types - we choose string the way csc does.
22101 * attribute.cs (Attribute.Resolve): Catch the
22102 NullReferenceException and report error #182 since the Mono
22103 runtime no more has the bug and having this exception raised means
22104 we tried to select a constructor which takes an object and is
22107 2002-09-05 Ravi Pratap <ravi@ximian.com>
22109 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
22110 message (1502, 1503) when we can't locate a method after overload
22111 resolution. This is much more informative and closes the bug
22114 * interface.cs (PopulateMethod): Return if there are no argument
22115 types. Fixes a NullReferenceException bug.
22117 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
22118 expressions too. Previously we were checking only in one place for
22119 positional arguments leaving out named arguments.
22121 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
22122 type to the enum type is not allowed. Remove code corresponding to
22125 (ConvertNumericExplicit): Allow explicit conversions from
22126 the underlying type to enum type. This precisely follows the spec
22127 and closes a bug filed by Gonzalo.
22129 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22132 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
22134 2002-09-03 Miguel de Icaza <miguel@ximian.com>
22136 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
22137 it was important that we stored the right value after the
22138 reduction in `converted'.
22140 2002-09-04 Martin Baulig <martin@gnome.org>
22142 * location.cs (Location.SymbolDocument): Use full pathnames for the
22145 2002-08-30 Miguel de Icaza <miguel@ximian.com>
22147 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
22148 of the expression resolve mechanism, because that will catch the
22149 SimpleName error failures.
22151 (Conditional): If we can not resolve the
22152 expression, return, do not crash.
22154 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22157 (location): display token name instead of its number.
22159 2002-08-28 Martin Baulig <martin@gnome.org>
22161 * expression.cs (Binary.ResolveOperator): Don't silently return
22162 but return an error if an operator cannot be applied between two
22165 2002-08-28 Martin Baulig <martin@gnome.org>
22167 * class.cs (Constructor.Define): Set the permission attributes
22168 correctly instead of making all constructors public.
22170 2002-08-28 Martin Baulig <martin@gnome.org>
22172 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
22173 for private members before reporting a CS0103; if we find anything,
22176 2002-08-28 Martin Baulig <martin@gnome.org>
22178 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
22179 to check whether `closure_start_type == closure_invocation_type',
22180 we also need to check whether `m.DeclaringType == closure_invocation_type'
22181 before bypassing the permission checks. We might be accessing
22182 protected/private members from the base class.
22183 (TypeManager.RealMemberLookup): Only set private_ok if private
22184 members were requested via BindingFlags.NonPublic.
22186 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
22188 * expression.cs (MemberAccess.ResolveMemberAccess): Set
22189 MethodGroupExpr.IsExplicitImpl if appropriate.
22190 (Invocation.DoResolve): Don't report the CS0120 for explicit
22191 interface implementations.
22193 2002-08-27 Martin Baulig <martin@gnome.org>
22195 * expression.cs (Invocation.DoResolve): If this is a static
22196 method and we don't have an InstanceExpression, we must report
22199 2002-08-25 Martin Baulig <martin@gnome.org>
22201 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
22202 `==' between a valuetype and an object.
22204 2002-08-25 Miguel de Icaza <miguel@ximian.com>
22206 * ecore.cs (TypeExpr): Provide a ToString method.
22208 2002-08-24 Martin Baulig <martin@gnome.org>
22210 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
22211 now called proggie.dbg and it's a binary file.
22213 2002-08-23 Martin Baulig <martin@gnome.org>
22215 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
22217 2002-08-23 Martin Baulig <martin@gnome.org>
22219 * struct.cs (MyStructInfo.ctor): Make this work with empty
22220 structs; it's not allowed to use foreach() on null.
22222 2002-08-23 Martin Baulig <martin@gnome.org>
22224 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
22225 writer the full pathname of the generated assembly.
22227 2002-08-23 Martin Baulig <martin@gnome.org>
22229 * statements.cs (FlowBranching.UsageVector.MergeChildren):
22230 A `finally' block never returns or breaks; improved handling of
22233 2002-08-23 Martin Baulig <martin@gnome.org>
22235 * statement.cs (Throw.Resolve): Allow `throw null'.
22237 2002-08-23 Martin Baulig <martin@gnome.org>
22239 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
22240 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
22241 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
22242 MemberLookup would return a wrong event if this is an explicit
22243 interface implementation and the class has an event with the same
22246 2002-08-23 Martin Baulig <martin@gnome.org>
22248 * statement.cs (Block.AddChildVariableNames): New public method.
22249 (Block.AddChildVariableName): Likewise.
22250 (Block.IsVariableNameUsedInChildBlock): Likewise.
22251 (Block.AddVariable): Check whether a variable name has already
22252 been used in a child block.
22254 * cs-parser.jay (declare_local_variables): Mark all variable names
22255 from the current block as being used in a child block in the
22258 2002-08-23 Martin Baulig <martin@gnome.org>
22260 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
22261 find the symbol writer.
22263 * driver.cs: csc also allows the arguments to /define being
22264 separated by commas, not only by semicolons.
22266 2002-08-23 Martin Baulig <martin@gnome.org>
22268 * interface.cs (Interface.GetMembers): Added static check for events.
22270 2002-08-15 Martin Baulig <martin@gnome.org>
22272 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
22273 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
22275 * ecore.cs (Expression.MemberLookup): Added documentation and explained
22276 why the MethodData.EmitDestructor() change was necessary.
22278 2002-08-20 Martin Baulig <martin@gnome.org>
22280 * class.cs (TypeContainer.FindMembers): Added static check for events.
22282 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
22284 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
22285 use Type.GetEvents(), not Type.FindMembers().
22287 2002-08-20 Martin Baulig <martin@gnome.org>
22289 * decl.cs (MemberCache): Added a special method cache which will
22290 be used for method-only searched. This ensures that a method
22291 search will return a MethodInfo with the correct ReflectedType for
22294 2002-08-20 Martin Baulig <martin@gnome.org>
22296 * decl.cs (DeclSpace.FindMembers): Made this public.
22298 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22300 * delegate.cs: fixed build on windows.
22301 [FIXME: Filed as bug #29150: MCS must report these errors.]
22303 2002-08-19 Ravi Pratap <ravi@ximian.com>
22305 * ecore.cs (StandardConversionExists): Return a false
22306 if we are trying to convert the void type to anything else
22307 since that is not allowed.
22309 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
22310 we flag error 70 in the event an event is trying to be accessed
22311 directly from outside the declaring type.
22313 2002-08-20 Martin Baulig <martin@gnome.org>
22315 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
22316 MemberCache from typemanager.cs to decl.cs.
22318 2002-08-19 Martin Baulig <martin@gnome.org>
22320 * class.cs (TypeContainer): Implement IMemberContainer.
22321 (TypeContainer.DefineMembers): Create the MemberCache.
22322 (TypeContainer.FindMembers): Do better BindingFlags checking; only
22323 return public members if BindingFlags.Public was given, check
22324 whether members are static.
22326 2002-08-16 Martin Baulig <martin@gnome.org>
22328 * decl.cs (DeclSpace.Define): Splitted this in Define and
22329 DefineMembers. DefineMembers is called first and initializes the
22332 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
22333 DefineMembers() on all our DeclSpaces.
22335 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
22336 but call DefineMembers() on all nested interfaces. We call their
22337 Define() in our new Define() function.
22339 * interface.cs (Interface): Implement IMemberContainer.
22340 (Interface.Define): Moved all code except the attribute stuf to
22342 (Interface.DefineMembers): Initialize the member cache.
22344 * typemanager.cs (IMemberFinder): Removed this interface, we don't
22345 need this anymore since we can use MemberCache.FindMembers directly.
22347 2002-08-19 Martin Baulig <martin@gnome.org>
22349 * typemanager.cs (MemberCache): When creating the cache for an
22350 interface type, add all inherited members.
22351 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
22352 to `out bool used_cache' and documented it.
22353 (TypeManager.MemberLookup): If we already used the cache in the first
22354 iteration, we don't need to do the interfaces check.
22356 2002-08-19 Martin Baulig <martin@gnome.org>
22358 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
22359 here from IMemberFinder and don't implement this interface anymore.
22360 (DeclSpace.MemberCache): Moved here from IMemberFinder.
22362 * typemanager.cs (IMemberFinder): This interface is now only used by
22363 classes which actually support the member cache.
22364 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
22365 since we only put DeclSpaces into this Hashtable.
22366 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
22367 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
22369 2002-08-16 Martin Baulig <martin@gnome.org>
22371 * typemanager.cs (ICachingMemberFinder): Removed.
22372 (IMemberFinder.MemberCache): New property.
22373 (TypeManager.FindMembers): Merged this with RealFindMembers().
22374 This function will never be called from TypeManager.MemberLookup()
22375 so we can't use the cache here, just the IMemberFinder.
22376 (TypeManager.MemberLookup_FindMembers): Check whether the
22377 IMemberFinder has a MemberCache and call the cache's FindMembers
22379 (MemberCache): Rewrote larger parts of this yet another time and
22380 cleaned it up a bit.
22382 2002-08-15 Miguel de Icaza <miguel@ximian.com>
22384 * driver.cs (LoadArgs): Support quoting.
22386 (Usage): Show the CSC-like command line arguments.
22388 Improved a few error messages.
22390 2002-08-15 Martin Baulig <martin@gnome.org>
22392 * typemanager.cs (IMemberContainer.Type): New property.
22393 (IMemberContainer.IsInterface): New property.
22395 The following changes are conditional to BROKEN_RUNTIME, which is
22396 defined at the top of the file.
22398 * typemanager.cs (MemberCache.MemberCache): Don't add the base
22399 class'es members, but add all members from TypeHandle.ObjectType
22400 if we're an interface.
22401 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
22402 is the current type.
22403 (MemberCache.CacheEntry.Container): Removed this field.
22404 (TypeHandle.GetMembers): Include inherited members.
22406 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22408 * typemanager.cs: fixed compilation and added a comment on a field that
22411 2002-08-15 Martin Baulig <martin@gnome.org>
22413 * class.cs (ConstructorInitializer.Resolve): In the
22414 Expression.MemberLookup call, use the queried_type as
22417 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
22418 declared' attribute, it's always true.
22419 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
22420 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
22421 temporary wrapper for FindMembers which tells MemberLookup whether
22422 members from the base classes are included in the return value.
22423 This will go away soon.
22424 (TypeManager.MemberLookup): Use this temporary hack here; once the
22425 new MemberCache is completed, we don't need to do the DeclaredOnly
22426 looping here anymore since the MemberCache will take care of this.
22427 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
22428 (MemberCache): When creating the MemberCache for a class, get
22429 members from the current class and all its base classes.
22430 (MemberCache.CacheEntry.Container): New field. This is a
22431 temporary hack until the Mono runtime is fixed to distinguish
22432 between ReflectedType and DeclaringType. It allows us to use MCS
22433 with both the MS runtime and the unfixed Mono runtime without
22434 problems and without accecting performance.
22435 (MemberCache.SearchMembers): The DeclaredOnly looping from
22436 TypeManager.MemberLookup is now done here.
22438 2002-08-14 Martin Baulig <martin@gnome.org>
22440 * statement.cs (MyStructInfo.MyStructInfo): Don't call
22441 Type.GetFields on dynamic types but get the fields from the
22442 corresponding TypeContainer.
22443 (MyStructInfo.GetStructInfo): Added check for enum types.
22445 * typemanager.cs (MemberList.IsSynchronized): Implemented.
22446 (MemberList.SyncRoot): Implemented.
22447 (TypeManager.FilterWithClosure): No need to check permissions if
22448 closure_start_type == closure_invocation_type, don't crash if
22449 closure_invocation_type is null.
22451 2002-08-13 Martin Baulig <martin@gnome.org>
22453 Rewrote TypeContainer.FindMembers to use a member cache. This
22454 gives us a speed increase of about 35% for the self-hosting MCS
22455 build and of about 15-20% for the class libs (both on GNU/Linux).
22457 * report.cs (Timer): New class to get enhanced profiling. This
22458 whole class is "TIMER" conditional since it remarkably slows down
22461 * class.cs (MemberList): New class. This is an IList wrapper
22462 which we're now using instead of passing MemberInfo[]'s around to
22463 avoid copying this array unnecessarily.
22464 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
22465 (ICachingMemberFinder, IMemberContainer): New interface.
22466 (TypeManager.FilterWithClosure): If `criteria' is null, the name
22467 has already been checked, otherwise use it for the name comparision.
22468 (TypeManager.FindMembers): Renamed to RealMemberFinder and
22469 provided wrapper which tries to use ICachingMemberFinder.FindMembers
22470 if possible. Returns a MemberList, not a MemberInfo [].
22471 (TypeHandle): New class, implements IMemberContainer. We create
22472 one instance of this class per type, it contains a MemberCache
22473 which is used to do the member lookups.
22474 (MemberCache): New class. Each instance of this class contains
22475 all members of a type and a name-based hash table.
22476 (MemberCache.FindMembers): This is our new member lookup
22477 function. First, it looks up all members of the requested name in
22478 the hash table. Then, it walks this list and sorts out all
22479 applicable members and returns them.
22481 2002-08-13 Martin Baulig <martin@gnome.org>
22483 In addition to a nice code cleanup, this gives us a performance
22484 increase of about 1.4% on GNU/Linux - not much, but it's already
22485 half a second for the self-hosting MCS compilation.
22487 * typemanager.cs (IMemberFinder): New interface. It is used by
22488 TypeManager.FindMembers to call FindMembers on a TypeContainer,
22489 Enum, Delegate or Interface.
22490 (TypeManager.finder_to_member_finder): New PtrHashtable.
22491 (TypeManager.finder_to_container): Removed.
22492 (TypeManager.finder_to_delegate): Removed.
22493 (TypeManager.finder_to_interface): Removed.
22494 (TypeManager.finder_to_enum): Removed.
22496 * interface.cs (Interface): Implement IMemberFinder.
22498 * delegate.cs (Delegate): Implement IMemberFinder.
22500 * enum.cs (Enum): Implement IMemberFinder.
22502 * class.cs (TypeContainer): Implement IMemberFinder.
22504 2002-08-12 Martin Baulig <martin@gnome.org>
22506 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
22508 2002-08-12 Martin Baulig <martin@gnome.org>
22510 * ecore.cs (ITypeExpression): New interface for expressions which
22512 (TypeExpression): Renamed to TypeLookupExpression.
22513 (Expression.DoResolve): If we're doing a types-only lookup, the
22514 expression must implement the ITypeExpression interface and we
22515 call DoResolveType() on it.
22516 (SimpleName): Implement the new ITypeExpression interface.
22517 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
22518 hack, the situation that we're only looking up types can't happen
22519 anymore when this method is called. Moved the type lookup code to
22520 DoResolveType() and call it.
22521 (SimpleName.DoResolveType): This ITypeExpression interface method
22522 is now doing the types-only lookup.
22523 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
22524 (ResolveFlags): Added MaskExprClass.
22526 * expression.cs (MemberAccess): Implement the ITypeExpression
22528 (MemberAccess.DoResolve): Added support for a types-only lookup
22529 when we're called via ITypeExpression.DoResolveType().
22530 (ComposedCast): Implement the ITypeExpression interface.
22532 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
22533 Expression.Resolve() with ResolveFlags.Type instead.
22535 2002-08-12 Martin Baulig <martin@gnome.org>
22537 * interface.cs (Interface.Define): Apply attributes.
22539 * attribute.cs (Attribute.ApplyAttributes): Added support for
22540 interface attributes.
22542 2002-08-11 Martin Baulig <martin@gnome.org>
22544 * statement.cs (Block.Emit): Only check the "this" variable if we
22545 do not always throw an exception.
22547 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
22548 whether the property has a set accessor.
22550 2002-08-11 Martin Baulig <martin@gnome.org>
22552 Added control flow analysis support for structs.
22554 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
22555 with control flow analysis turned off.
22556 (IVariable): New interface.
22557 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
22558 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
22559 (FieldExpr.DoResolve): Resolve the instance expression with flow
22560 analysis turned off and do the definite assignment check after the
22561 resolving when we know what the expression will resolve to.
22563 * expression.cs (LocalVariableReference, ParameterReference):
22564 Implement the new IVariable interface, only call the flow analysis
22565 code if ec.DoFlowAnalysis is true.
22566 (This): Added constructor which takes a Block argument. Implement
22567 the new IVariable interface.
22568 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
22569 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
22570 This does the definite assignment checks for struct members.
22572 * class.cs (Constructor.Emit): If this is a non-static `struct'
22573 constructor which doesn't have any initializer, call
22574 Block.AddThisVariable() to tell the flow analysis code that all
22575 struct elements must be initialized before control returns from
22578 * statement.cs (MyStructInfo): New public class.
22579 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
22580 argument to this indexer. If non-zero, check an individual struct
22581 member, not the whole struct.
22582 (FlowBranching.CheckOutParameters): Check struct members.
22583 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
22584 overloaded versions of these methods which take an additional
22585 `int field_idx' argument to check struct members.
22586 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
22587 overloaded versions of these methods which take an additional
22588 `string field_name' argument to check struct member.s
22589 (VariableInfo): Implement the IVariable interface.
22590 (VariableInfo.StructInfo): New public property. Returns the
22591 MyStructInfo instance of the variable if it's a struct or null.
22592 (Block.AddThisVariable): New public method. This is called from
22593 Constructor.Emit() for non-static `struct' constructor which do
22594 not have any initializer. It creates a special variable for the
22595 "this" instance variable which will be checked by the flow
22596 analysis code to ensure that all of the struct's fields are
22597 initialized before control returns from the constructor.
22598 (UsageVector): Added support for struct members. If a
22599 variable/parameter is a struct with N members, we reserve a slot
22600 in the usage vector for each member. A struct is considered fully
22601 initialized if either the struct itself (slot 0) or all its
22602 members are initialized.
22604 2002-08-08 Martin Baulig <martin@gnome.org>
22606 * driver.cs (Driver.MainDriver): Only report an error CS5001
22607 if there were no compilation errors.
22609 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
22610 `UnsafeContext' property to determine whether the parent is in
22611 unsafe context rather than checking the parent's ModFlags:
22612 classes nested in an unsafe class are unsafe as well.
22614 2002-08-08 Martin Baulig <martin@gnome.org>
22616 * statement.cs (UsageVector.MergeChildren): Distinguish between
22617 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
22618 we return. Added test17() and test18() to test-154.cs.
22620 2002-08-08 Martin Baulig <martin@gnome.org>
22622 * typemanager.cs (TypeManager.FilterWithClosure): If we have
22623 Family access, make sure the invoking type isn't a subclass of the
22624 queried type (that'd be a CS1540).
22626 * ecore.cs (Expression.MemberLookup): Added overloaded version of
22627 this method which takes an additional `Type invocation_type'.
22629 * expression.cs (BaseAccess.DoResolve): Use the base type as
22630 invocation and query type.
22631 (MemberAccess.DoResolve): If the lookup failed and we're about to
22632 report a CS0122, try a lookup with the ec.ContainerType - if this
22633 succeeds, we must report a CS1540.
22635 2002-08-08 Martin Baulig <martin@gnome.org>
22637 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
22638 (MethodGroupExpr): Implement the IMemberExpr interface.
22640 * expression (MemberAccess.ResolveMemberAccess): No need to have
22641 any special code for MethodGroupExprs anymore, they're now
22644 2002-08-08 Martin Baulig <martin@gnome.org>
22646 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
22647 Family, FamANDAssem and FamORAssem permissions.
22648 (TypeManager.IsSubclassOrNestedChildOf): New public method.
22650 2002-08-08 Martin Baulig <martin@gnome.org>
22652 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
22653 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
22656 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
22658 * driver.cs: implemented /resource option to embed managed resources.
22660 2002-08-07 Martin Baulig <martin@gnome.org>
22662 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
22663 (FieldBase.HasFieldInitializer): New public property.
22664 (FieldBase.GetInitializerExpression): New public method. Resolves and
22665 returns the field initializer and makes sure it is only resolved once.
22666 (TypeContainer.EmitFieldInitializers): Call
22667 FieldBase.GetInitializerExpression to get the initializer, this ensures
22668 that it isn't resolved multiple times.
22670 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
22671 the resolving process (SimpleName/MemberLookup) that we're currently
22672 emitting a field initializer (which must not access any instance members,
22673 this is an error CS0236).
22675 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
22676 argument, if the `IsFieldInitializer' flag is set, we must report and
22677 error CS0236 and not an error CS0120.
22679 2002-08-07 Martin Baulig <martin@gnome.org>
22681 * ecore.cs (IMemberExpr): New public interface.
22682 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
22683 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
22684 if the expression is an IMemberExpr.
22686 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
22687 to be null, implicitly default to `this' if we're non-static in
22688 this case. Simplified the code a lot by using the new IMemberExpr
22689 interface. Also fixed bug #28176 here.
22691 2002-08-06 Martin Baulig <martin@gnome.org>
22693 * cs-parser.jay (SimpleLookup): Removed. We need to create
22694 ParameterReferences during semantic analysis so that we can do a
22695 type-only search when resolving Cast, TypeOf and SizeOf.
22696 (block): Pass the `current_local_parameters' to the Block's
22699 * class.cs (ConstructorInitializer): Added `Parameters parameters'
22700 argument to the constructor.
22701 (ConstructorInitializer.Resolve): Create a temporary implicit
22702 block with the parameters.
22704 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
22705 references here if we aren't doing a type-only search.
22707 * statement.cs (Block): Added constructor which takes a
22708 `Parameters parameters' argument.
22709 (Block.Parameters): New public property.
22711 * support.cs (InternalParameters.Parameters): Renamed `parameters'
22712 to `Parameters' and made it public readonly.
22714 2002-08-06 Martin Baulig <martin@gnome.org>
22716 * ecore.cs (Expression.Warning): Made this public as well.
22718 * report.cs (Report.Debug): Print the contents of collections.
22720 2002-08-06 Martin Baulig <martin@gnome.org>
22722 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
22723 used to tell Resolve() which kinds of expressions it may return.
22724 (Expression.Resolve): Added overloaded version of this method which
22725 takes a `ResolveFlags flags' argument. This can be used to tell
22726 Resolve() which kinds of expressions it may return. Reports a
22728 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
22729 ResolveFlags.SimpleName.
22730 (Expression.Error118): Added overloaded version of this method which
22731 takes a `ResolveFlags flags' argument. It uses the flags to determine
22732 which kinds of expressions are allowed.
22734 * expression.cs (Argument.ResolveMethodGroup): New public method.
22735 Resolves an argument, but allows a MethodGroup to be returned.
22736 This is used when invoking a delegate.
22738 * TODO: Updated a bit.
22740 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22742 Fixed compilation with csc.
22744 * ecore.cs: Expression.Error made public. Is this correct? Should
22745 Warning be made public too?
22747 * expression.cs: use ea.Location instead of ea.loc.
22748 [FIXME: Filed as bug #28607: MCS must report these errors.]
22750 2002-08-06 Martin Baulig <martin@gnome.org>
22752 * ecore.cs (Expression.loc): Moved the location here instead of
22753 duplicating it in all derived classes.
22754 (Expression.Location): New public property.
22755 (Expression.Error, Expression.Warning): Made them non-static and
22756 removed the location argument.
22757 (Expression.Warning): Added overloaded version which takes an
22758 `int level' argument.
22759 (Expression.Error118): Make this non-static and removed the
22760 expression and location arguments.
22761 (TypeExpr): Added location argument to the constructor.
22763 * expression.cs (StaticCallExpr): Added location argument to
22765 (Indirection, PointerArithmetic): Likewise.
22766 (CheckedExpr, UnCheckedExpr): Likewise.
22767 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
22768 (StringPtr): Likewise.
22771 2002-08-05 Martin Baulig <martin@gnome.org>
22773 * expression.cs (BaseAccess.DoResolve): Actually report errors.
22775 * assign.cs (Assign.DoResolve): Check whether the source
22776 expression is a value or variable.
22778 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
22779 while resolving the corresponding blocks.
22781 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
22782 an error, don't silently return null.
22784 * statement.cs (Block.AddVariable): Do the error reporting here
22785 and distinguish between CS0128 and CS0136.
22786 (Block.DoResolve): Report all unused labels (warning CS0164).
22787 (LabeledStatement): Pass the location to the constructor.
22788 (LabeledStatement.HasBeenReferenced): New property.
22789 (LabeledStatement.Resolve): Set it to true here.
22791 * statement.cs (Return.Emit): Return success even after reporting
22792 a type mismatch error (CS0126 or CS0127), this is what csc does and
22793 it avoids confusing the users with any consecutive errors.
22795 2002-08-05 Martin Baulig <martin@gnome.org>
22797 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
22799 * const.cs (Const.LookupConstantValue): Catch circular definitions.
22801 * expression.cs (MemberAccess.DoResolve): Silently return if an
22802 error has already been reported.
22804 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
22805 error has already been reported.
22807 2002-08-05 Martin Baulig <martin@gnome.org>
22809 * statement.cs (UsageVector): Only initialize the `parameters'
22810 vector if we actually have any "out" parameters.
22812 2002-08-05 Martin Baulig <martin@gnome.org>
22814 * expression.cs (Binary.ResolveOperator): When combining delegates,
22815 they must have the same type.
22817 2002-08-05 Martin Baulig <martin@gnome.org>
22819 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
22820 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
22821 work with the ms runtime and we also don't need it: if we're a
22822 PropertyBuilder and not in the `indexer_arguments' hash, then we
22823 are a property and not an indexer.
22825 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
22826 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
22827 since the latter one doesn't work with the ms runtime.
22829 2002-08-03 Martin Baulig <martin@gnome.org>
22831 Fixed bugs #27998 and #22735.
22833 * class.cs (Method.IsOperator): New public field.
22834 (Method.CheckBase): Report CS0111 if there's already a method
22835 with the same parameters in the current class. Report CS0508 when
22836 attempting to change the return type of an inherited method.
22837 (MethodData.Emit): Report CS0179 if a method doesn't have a body
22838 and it's not marked abstract or extern.
22839 (PropertyBase): New abstract base class for Property and Indexer.
22840 (PropertyBase.CheckBase): Moved here from Property and made it work
22842 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
22843 the same so we can reuse it there.
22844 (Property, Indexer): Derive from PropertyBase.
22845 (MethodSignature.inheritable_property_signature_filter): New delegate
22846 to find properties and indexers.
22848 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
22849 argument and improved error reporting.
22851 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
22852 EmptyReadOnlyParameters and made it a property.
22854 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
22855 version of this method which takes a `PropertyInfo indexer'.
22856 (TypeManager.RegisterIndexer): New method.
22858 * class.cs: Added myself as author of this file :-)
22860 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22862 * class.cs: fixed compilation on windoze.
22864 2002-08-03 Martin Baulig <martin@gnome.org>
22866 * interface.cs (Interface.GetInterfaceBases): Check whether all
22867 base interfaces are at least as accessible than the current one.
22869 * class.cs (TypeContainer.GetClassBases): Check whether base types
22870 are at least as accessible than the current type.
22871 (TypeContainer.AsAccessible): Implemented and made non-static.
22872 (MemberBase.CheckParameters): Report errors if the accessibility
22875 * delegate.cs (Delegate.Delegate): The default visibility is
22876 internal for top-level types and private for nested types.
22877 (Delegate.Define): Report errors if the accessibility checks fail.
22879 * enum.cs (Enum.Enum): The default visibility is internal for
22880 top-level types and private for nested types.
22881 (Enum.DefineType): Compute the correct visibility.
22883 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
22884 function which takes a `bool is_toplevel' instead of a TypeContainer.
22886 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
22889 2002-08-02 Martin Baulig <martin@gnome.org>
22891 * expression.cs (LocalVariableReferenc): Added constructor which
22892 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
22893 (LocalVariableReference.IsReadOnly): New property.
22894 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
22895 variable is readonly, use our own readonly flag to do this; you can
22896 use the new constructor to get a writable reference to a read-only
22899 * cs-parser.jay (foreach_statement, using_statement): Get a writable
22900 reference to the local variable.
22902 2002-08-01 Miguel de Icaza <miguel@ximian.com>
22904 * rootcontext.cs (ResolveCore): Also include System.Exception
22906 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
22907 we reach an EmptyStatement.
22909 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
22912 * expression.cs (Binary.ResolveOperator): Check error result in
22915 use brtrue/brfalse directly and avoid compares to null.
22917 2002-08-02 Martin Baulig <martin@gnome.org>
22919 * class.cs (TypeContainer.Define): Define all nested interfaces here.
22920 Fixes bug #28407, added test-155.cs.
22922 2002-08-01 Martin Baulig <martin@gnome.org>
22924 * class.cs (Event.EmitDefaultMethod): Make this work with static
22925 events. Fixes #28311, added verify-3.cs.
22927 2002-08-01 Martin Baulig <martin@gnome.org>
22929 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
22930 `is_disposable' fields.
22931 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
22932 `hm.is_disposable' if we're using the collection pattern.
22933 (Foreach.EmitCollectionForeach): Use the correct type for the
22934 enumerator's local variable, only emit the try/finally block if
22935 necessary (fixes #27713).
22937 2002-08-01 Martin Baulig <martin@gnome.org>
22939 * ecore.cs (Expression.report118): Renamed to Error118 and made
22942 * statement.cs (Throw.Resolve): Check whether the expression is of
22943 the correct type (CS0118) and whether the type derives from
22944 System.Exception (CS0155).
22945 (Catch.Resolve): New method. Do the type lookup here and check
22946 whether it derives from System.Exception (CS0155).
22947 (Catch.CatchType, Catch.IsGeneral): New public properties.
22949 * typemanager.cs (TypeManager.exception_type): Added.
22951 2002-07-31 Miguel de Icaza <miguel@ximian.com>
22953 * driver.cs: Updated About function.
22955 2002-07-31 Martin Baulig <martin@gnome.org>
22957 Implemented Control Flow Analysis.
22959 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
22960 (EmitContext.CurrentBranching): Added.
22961 (EmitContext.StartFlowBranching): Added.
22962 (EmitContext.EndFlowBranching): Added.
22963 (EmitContext.KillFlowBranching): Added.
22964 (EmitContext.IsVariableAssigned): Added.
22965 (EmitContext.SetVariableAssigned): Added.
22966 (EmitContext.IsParameterAssigned): Added.
22967 (EmitContext.SetParameterAssigned): Added.
22968 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
22969 Added control flow analysis stuff here.
22971 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
22972 resolve the expression as lvalue.
22973 (LocalVariableReference.DoResolve): Check whether the variable has
22974 already been assigned.
22975 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
22976 the parameter as assigned here.
22977 (ParameterReference.DoResolve): Check whether the parameter has already
22979 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
22980 expression as lvalue.
22982 * statement.cs (FlowBranching): New class for the flow analysis code.
22983 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
22984 (LabeledStatement.IsDefined): New public property.
22985 (LabeledStatement.AddUsageVector): New public method to tell flow
22986 analyis that the label may be reached via a forward jump.
22987 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
22989 (VariableInfo.Number): New public field. This is used by flow analysis
22990 to number all locals of a block.
22991 (Block.CountVariables): New public property. This is the number of
22992 local variables in this block (including the locals from all parent
22994 (Block.EmitMeta): Number all the variables.
22996 * statement.cs: Added flow analysis support to all classes.
22998 2002-07-31 Martin Baulig <martin@gnome.org>
23000 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
23001 To get debugging messages, compile mcs with /define:MCS_DEBUG and
23002 then use this argument.
23004 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
23006 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
23007 use this to specify /define options.
23009 2002-07-29 Martin Baulig <martin@gnome.org>
23011 * statement.cs (Fixed): Moved all code that does variable lookups
23012 and resolvings from Emit to Resolve.
23014 * statement.cs (For): Moved all code that does variable lookups
23015 and resolvings from Emit to Resolve.
23017 * statement.cs (Using): Moved all code that does variable lookups
23018 and resolvings from Emit to Resolve.
23020 2002-07-29 Martin Baulig <martin@gnome.org>
23022 * attribute.cs (Attribute.Resolve): Explicitly catch a
23023 System.NullReferenceException when creating the
23024 CustromAttributeBuilder and report a different warning message.
23026 2002-07-29 Martin Baulig <martin@gnome.org>
23028 * support.cs (ParameterData.ParameterName): Added method to
23029 get the name of a parameter.
23031 * typemanager.cs (TypeManager.IsValueType): New public method.
23033 2002-07-29 Martin Baulig <martin@gnome.org>
23035 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
23036 is a flag which specifies that it's either ref or out.
23037 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
23038 the out parameter to `out Parameter.Modifier mod', also set the
23039 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
23041 * support.cs (InternalParameters.ParameterModifier): Distinguish
23042 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23043 Parameter.Modifier.ISBYREF flag if it's either ref or out.
23045 * expression.cs (Argument.GetParameterModifier): Distinguish
23046 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23047 Parameter.Modifier.ISBYREF flag if it's either ref or out.
23049 2002-07-29 Martin Baulig <martin@gnome.org>
23051 * expression.cs (ParameterReference.ParameterReference): Added
23052 `Location loc' argument to the constructor.
23054 * cs-parser.jay: Pass location to ParameterReference.
23056 2002-07-28 Miguel de Icaza <miguel@ximian.com>
23058 * statement.cs (Try): Initialize the location.
23060 * cs-parser.jay: pass location to Try.
23062 * expression.cs (Unary.Reduce): Change the prototype to return
23063 whether a constant fold could be performed or not. The result is
23064 returned in an out parameters. In the case of Indirection and
23065 AddressOf, we want to perform the full tests.
23067 2002-07-26 Miguel de Icaza <miguel@ximian.com>
23069 * statement.cs (Statement.Emit): Flag dead code.
23071 2002-07-27 Andrew Birkett <andy@nobugs.org>
23073 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
23075 2002-07-27 Martin Baulig <martin@gnome.org>
23077 * class.cs (MethodData.Define): Put back call to
23078 TypeManager.AddMethod(), accidentally commented this out.
23080 * report.cs (Debug): New public method to print debugging information,
23081 this is `[Conditional ("DEBUG")]'.
23083 2002-07-26 Martin Baulig <martin@gnome.org>
23085 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
23086 (switch_statement): Push the current_block to the switch_stack and
23087 pop it again when we're done with the switch.
23088 (switch_section): The new block is a child of the current_block.
23089 Fixes bug #24007, added test-152.cs.
23091 2002-07-27 Martin Baulig <martin@gnome.org>
23093 * expression.cs (Invocation.EmitArguments): When calling a varargs
23094 function with only its fixed arguments, we need to pass an empty
23097 2002-07-27 Martin Baulig <martin@gnome.org>
23099 Mono 0.13 has been released.
23101 2002-07-25 Miguel de Icaza <miguel@ximian.com>
23103 * driver.cs: Rename --resource to --linkres, because that is what
23104 we do currently, we dont support --resource yet.
23106 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
23108 2002-07-25 Martin Baulig <martin@gnome.org>
23110 * class.cs (MethodData): New public class. This is a `method builder'
23111 class for a method or one accessor of a Property/Indexer/Event.
23112 (MethodData.GetMethodFlags): Moved here from MemberBase.
23113 (MethodData.ApplyAttributes): Likewise.
23114 (MethodData.ApplyObsoleteAttribute): Likewise.
23115 (MethodData.ApplyConditionalAttribute): Likewise.
23116 (MethodData.ApplyDllImportAttribute): Likewise.
23117 (MethodData.CheckAbstractAndExternal): Likewise.
23118 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
23119 (MethodData.Emit): Formerly known as Method.Emit().
23120 (MemberBase): Moved everything which was specific to a single
23121 accessor/method to MethodData.
23122 (Method): Create a new MethodData and call Define() and Emit() on it.
23123 (Property, Indexer, Event): Create a new MethodData objects for each
23124 accessor and call Define() and Emit() on them.
23126 2002-07-25 Martin Baulig <martin@gnome.org>
23128 Made MethodCore derive from MemberBase to reuse the code from there.
23129 MemberBase now also checks for attributes.
23131 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
23132 (MemberBase.GetMethodFlags): Moved here from class Method and marked
23134 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
23135 `CallingConventions cc' and `Attributes opt_attrs' arguments.
23136 (MemberBase.ApplyAttributes): New virtual method; applies the
23137 attributes to a method or accessor.
23138 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
23139 (MemberBase.ApplyConditionalAttribute): Likewise.
23140 (MemberBase.ApplyDllImportAttribute): Likewise.
23141 (MemberBase.CheckAbstractAndExternal): Likewise.
23142 (MethodCore.ParameterTypes): This is now a property instead of a
23143 method, it's initialized from DoDefineParameters().
23144 (MethodCore.ParameterInfo): Removed the set accessor.
23145 (MethodCore.DoDefineParameters): New protected virtual method to
23146 initialize ParameterTypes and ParameterInfo.
23147 (Method.GetReturnType): We can now simply return the MemberType.
23148 (Method.GetMethodFlags): Override the MemberBase version and add
23149 the conditional flags.
23150 (Method.CheckBase): Moved some code from Define() here, call
23151 DoDefineParameters() here.
23152 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
23153 here to avoid some larger code duplication.
23154 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
23155 ensure that abstract and external accessors don't declare a body.
23157 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
23158 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
23159 lookup in the attribute's parent classes, so we need to abort as soon
23160 as we found the first match.
23161 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
23162 the attribute has no arguments.
23164 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
23167 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23169 * cs-parser.jay: reverted previous patch.
23171 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23173 * cs-parser.jay: fixed bug #22119.
23175 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23177 * attribute.cs: fixed compilation. The error was:
23178 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
23179 be assigned to before control leaves the current method."
23180 [FIXME: Filed as bug #28186: MCS must report this error.]
23182 2002-07-25 Martin Baulig <martin@gnome.org>
23184 * attribute.cs (Attribute.Conditional_GetConditionName): New static
23185 method to pull the condition name ouf of a Conditional attribute.
23186 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
23187 the obsolete message and error flag out of an Obsolete attribute.
23189 * class.cs (Method.GetMethodFlags): New public method to get the
23190 TypeManager.MethodFlags for this method.
23191 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
23193 (Method.Define): Get and apply the Obsolete and Conditional attributes;
23194 if we're overriding a virtual function, set the new private variable
23195 `parent_method'; call the new TypeManager.AddMethod().
23197 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
23198 the MethodBuilder and the Method in a PtrHashtable.
23199 (TypeManager.builder_to_method): Added for this purpose.
23200 (TypeManager.MethodFlags): Added IsObsoleteError.
23201 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
23202 Obsolete and Conditional arguments in MethodBuilders. If we discover
23203 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
23204 the message from the attribute.
23206 2002-07-24 Martin Baulig <martin@gnome.org>
23208 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
23209 preprocessor directives, ensure that the argument to #define/#undef is
23210 exactly one identifier and that it's actually an identifier.
23212 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
23215 2002-07-24 Martin Baulig <martin@gnome.org>
23217 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
23218 initialize it to TypeManager.object_type in the constructor.
23219 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
23220 of the `hm.get_current' method if we're using the collection pattern.
23221 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
23222 for the explicit conversion to make it work when we're using the collection
23223 pattern and the `Current' property has a different return type than `object'.
23226 2002-07-24 Martin Baulig <martin@gnome.org>
23228 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
23229 does not match, but don't report any errors. This method is called in
23230 order for all methods in a MethodGroupExpr until a matching method is
23231 found, so we don't want to bail out if the first method doesn't match.
23232 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
23233 matches, report the 123. Fixes #28070.
23235 2002-07-24 Martin Baulig <martin@gnome.org>
23237 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
23238 TypeManager.TypeToCoreType() to the top of the method so the
23239 following equality checks will work. Fixes #28107.
23241 2002-07-24 Martin Baulig <martin@gnome.org>
23243 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
23244 operand is of type uint, and the other operand is of type sbyte,
23245 short or int, the operands are converted to type long." -
23246 Actually do what this comment already told us. Fixes bug #28106,
23249 2002-07-24 Martin Baulig <martin@gnome.org>
23251 * class.cs (MethodBase): New abstract class. This is now a base
23252 class for Property, Indexer and Event to avoid some code duplication
23253 in their Define() and DefineMethods() methods.
23254 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
23255 generic methods for Define() and DefineMethods().
23256 (FieldBase): Derive from MemberBase, not MemberCore.
23257 (Property): Derive from MemberBase, not MemberCore.
23258 (Property.DefineMethod): Moved all the code from this method to the
23259 new MethodBase.DefineAccessor(), just call it with appropriate
23261 (Property.Define): Call the new Property.DoDefine(), this does some
23262 sanity checks and we don't need to duplicate the code everywhere.
23263 (Event): Derive from MemberBase, not MemberCore.
23264 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
23265 accessors, this will also make them work with interface events.
23266 (Indexer): Derive from MemberBase, not MemberCore.
23267 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
23268 (Indexer.Define): Use the new MethodBase functions.
23270 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
23271 argument to the constructor.
23272 (Interface.FindMembers): Added support for interface events.
23273 (Interface.PopluateEvent): Implemented.
23275 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
23277 2002-07-22 Miguel de Icaza <miguel@ximian.com>
23279 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
23280 but this is required to check for a method name being the same as
23281 the containing class.
23285 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23287 * interface.cs: initialize variable.
23289 2002-07-23 Martin Baulig <martin@gnome.org>
23291 Implemented the IndexerName attribute in interfaces.
23293 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
23294 name if this is an explicit interface implementation.
23295 (Indexer.InterfaceIndexerName): New public variable. If we're
23296 implementing an interface indexer, this is the IndexerName in that
23297 interface. Otherwise, it's the IndexerName.
23298 (Indexer.DefineMethod): If we're implementing interface indexer,
23299 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
23300 and Pending.ImplementIndexer methods.
23301 (Indexer.Define): Also define the PropertyBuilder if we're
23302 implementing an interface indexer and this is neither an explicit
23303 interface implementation nor do the IndexerName match the one in
23306 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
23307 If a method is defined here, then we always need to create a proxy
23308 for it. This is used when implementing interface indexers.
23309 (Pending.IsInterfaceIndexer): New public method.
23310 (Pending.ImplementIndexer): New public method.
23311 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
23312 This is used when implementing interface indexers to define a proxy
23314 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
23315 define a proxy if necessary.
23317 * interface.cs (Interface.IndexerName): New public variable.
23318 (Interface.PopulateIndexer): Set the IndexerName.
23319 (Interface.DefineIndexers): New private method. Populate all the
23320 indexers and make sure their IndexerNames match.
23322 * typemanager.cs (IndexerPropertyName): Added support for interface
23325 2002-07-22 Martin Baulig <martin@gnome.org>
23327 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
23328 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
23329 ret if HasReturnLabel.
23330 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
23333 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
23334 and set the ec.LoopBeginTryCatchLevel.
23335 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
23336 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
23337 the current ec.TryCatchLevel, the branch goes out of an exception
23338 block. In this case, we need to use Leave and not Br.
23340 2002-07-22 Martin Baulig <martin@gnome.org>
23342 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
23343 block unless the block does not always return or it is contained in
23344 another try { ... } catch { ... } block. Fixes bug #26506.
23345 Added verify-1.cs to the test suite.
23347 2002-07-22 Martin Baulig <martin@gnome.org>
23349 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
23350 then we do not always return. Fixes bug #24985.
23352 2002-07-22 Martin Baulig <martin@gnome.org>
23354 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
23355 lookup on a per-class level; ie. walk up the class hierarchy until we
23356 found at least one applicable method, then choose the best among them.
23357 Fixes bug #24463 and test-29.cs.
23359 2002-07-22 Martin Baulig <martin@gnome.org>
23361 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
23362 return types of the methods. The return type is not part of the
23363 signature and we must not check it to make the `new' modifier work.
23364 Fixes bug #27999, also added test-147.cs.
23365 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
23367 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
23368 on the method's return type.
23370 2002-07-21 Martin Baulig <martin@gnome.org>
23372 * assign.cs: Make this work if the rightmost source is a constant and
23373 we need to do an implicit type conversion. Also adding a few more tests
23374 to test-38.cs which should have caught this.
23376 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
23377 target in the makefile for this. The makefile.gnu is primarily intended
23378 for end-users who don't want to debug the compiler.
23380 2002-07-21 Martin Baulig <martin@gnome.org>
23382 * assign.cs: Improved the Assign class so it can now handle embedded
23383 assignments (X = Y = Z = something). As a side-effect this'll now also
23384 consume less local variables. test-38.cs now passes with MCS, added
23385 a few new test cases to that test.
23387 2002-07-20 Martin Baulig <martin@gnome.org>
23389 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
23390 instructions. Fixes bug #27977, also added test-146.cs.
23392 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23394 * cs-tokenizer.cs: fixed getHex ().
23396 2002-07-19 Martin Baulig <martin@gnome.org>
23398 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
23399 not Type.GetType() to lookup the array type. This is needed when
23400 we're constructing an array of a user-defined type.
23401 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
23402 single-dimensional arrays, but also for single-dimensial arrays of
23405 2002-07-19 Martin Baulig <martin@gnome.org>
23407 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
23408 this function is called, it's not allowed to share LocalBuilders
23409 among ILGenerators.
23411 2002-07-19 Martin Baulig <martin@gnome.org>
23413 * expression.cs (Argument.Resolve): Report an error 118 when trying
23414 to pass a type as argument.
23416 2002-07-18 Martin Baulig <martin@gnome.org>
23418 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
23419 Conv_R_Un for the signed `long' type.
23421 2002-07-15 Miguel de Icaza <miguel@ximian.com>
23423 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
23424 `expr' for the temporary result, as that will fail if we do
23425 multiple resolves on the same expression.
23427 2002-07-05 Miguel de Icaza <miguel@ximian.com>
23429 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
23430 ec.TypeContainer for looking up aliases.
23432 * class.cs (TypeContainer): Remove LookupAlias from here.
23434 * decl.cs (DeclSpace); Move here.
23436 2002-07-01 Miguel de Icaza <miguel@ximian.com>
23438 * class.cs (FindMembers): Only call filter if the constructor
23439 bulider is not null.
23441 Also handle delegates in `NestedTypes' now. Now we will perform
23442 type lookups using the standard resolution process. This also
23445 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
23446 This uses Expressions (the limited kind that can be parsed by the
23447 tree) instead of strings.
23449 * expression.cs (ComposedCast.ToString): Implement, used to flag
23450 errors since now we have to render expressions.
23452 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
23455 * ecore.cs (SimpleName.ToString): ditto.
23457 * cs-parser.jay: Instead of using strings to assemble types, use
23458 Expressions to assemble the type (using SimpleName, ComposedCast,
23459 MemberAccess). This should fix the type lookups in declarations,
23460 because we were using a different code path for this.
23462 * statement.cs (Block.Resolve): Continue processing statements
23463 even when there is an error.
23465 2002-07-17 Miguel de Icaza <miguel@ximian.com>
23467 * class.cs (Event.Define): Also remove the `remove' method from
23468 the list of pending items.
23470 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
23471 generate more compact code.
23473 2002-07-17 Martin Baulig <martin@gnome.org>
23475 * const.cs (Const.LookupConstantValue): Add support for constant
23476 `unchecked' and `checked' expressions.
23477 Also adding test case test-140.cs for this.
23479 2002-07-17 Martin Baulig <martin@gnome.org>
23481 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
23482 check whether mi.ReturnType implements the IEnumerator interface; the
23483 `==' and the IsAssignableFrom() will fail in this situation.
23485 2002-07-16 Ravi Pratap <ravi@ximian.com>
23487 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
23490 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23492 * expression.cs: fixed bug #27811.
23494 2002-07-14 Miguel de Icaza <miguel@ximian.com>
23496 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
23497 Molaro: when we are a ref, the value already contains a pointer
23498 value, do not take the address of it.
23500 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23501 * removed mb-parser.jay and mb-tokenizer.cs
23503 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23505 * expression.cs: check against the building corlib void type.
23507 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
23509 * ecore.cs: fix for valuetype static readonly fields: when
23510 initializing them, we need their address, not the address of a copy.
23512 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23514 * typemanager.cs: register also enum_type in corlib.
23516 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23518 * class.cs: allow calling this (but not base) initializers in structs.
23520 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
23522 * ecore.cs: make sure we compare against the building base types
23525 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
23527 * typemanager.cs: fix TypeToCoreType() to handle void and object
23528 (corlib gets no more typerefs after this change).
23530 2002-07-12 Miguel de Icaza <miguel@ximian.com>
23532 * expression.cs (ArrayCreation.EmitArrayArguments): use
23533 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
23535 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
23536 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
23537 array indexes, the runtime actually forbids them.
23539 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
23540 for array arguments here.
23542 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
23543 instead of the default for ValueTypes.
23545 (New.DoEmit): Use IsValueType instead of
23546 IsSubclassOf (value_type)
23547 (New.DoResolve): ditto.
23548 (Invocation.EmitCall): ditto.
23550 * assign.cs (Assign): ditto.
23552 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
23553 Statements *are* currently doing part of their resolution during
23556 Expressions do always resolve during resolve, but statements are
23557 only required to propagate resolution to their children.
23559 2002-07-11 Miguel de Icaza <miguel@ximian.com>
23561 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
23563 (LoadAssembly): Do not add the dll if it is already specified
23565 (MainDriver): Add the System directory to the link path at the end,
23566 after all the other -L arguments.
23568 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
23569 wrong opcode for loading bytes and bools (ldelem.i1 instead of
23570 ldelem.u1) and using the opposite for sbytes.
23572 This fixes Digger, and we can finally run it.
23574 * driver.cs (UnixParseOption): Move the option parsing here.
23575 (CSCParseOption): Implement CSC-like parsing of options.
23577 We now support both modes of operation, the old Unix way, and the
23578 new CSC-like way. This should help those who wanted to make cross
23579 platform makefiles.
23581 The only thing broken is that /r:, /reference: and /lib: are not
23582 implemented, because I want to make those have the same semantics
23583 as the CSC compiler has, and kill once and for all the confussion
23584 around this. Will be doing this tomorrow.
23586 * statement.cs (Unsafe.Resolve): The state is checked during
23587 resolve, not emit, so we have to set the flags for IsUnsfe here.
23589 2002-07-10 Miguel de Icaza <miguel@ximian.com>
23591 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
23592 not catch the Error_ObjectRefRequired in SimpleName (as it is
23593 possible to have a class/instance variable name that later gets
23594 deambiguated), we have to check this here.
23596 2002-07-10 Ravi Pratap <ravi@ximian.com>
23598 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
23599 make static and put into Expression.
23601 (Event.Define): Register the private field of the event with the
23602 TypeManager so that GetFieldFromEvent can get at it.
23604 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
23605 keep track of the private field associated with an event which
23608 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
23611 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
23613 2002-07-10 Miguel de Icaza <miguel@ximian.com>
23615 * expression.cs (Binary.EmitBranchable): this routine emits the
23616 Binary expression in a branchable context. This basically means:
23617 we need to branch somewhere, not just get the value on the stack.
23619 This works together with Statement.EmitBoolExpression.
23621 * statement.cs (Statement.EmitBoolExpression): Use
23624 2002-07-09 Miguel de Icaza <miguel@ximian.com>
23626 * statement.cs (For): Reduce the number of jumps in loops.
23628 (For): Implement loop inversion for the For statement.
23630 (Break): We can be breaking out of a Try/Catch controlled section
23631 (foreach might have an implicit try/catch clause), so we need to
23632 use Leave instead of Br.
23634 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
23635 now). If the instace expression supports IMemoryLocation, we use
23636 the AddressOf method from the IMemoryLocation to extract the
23637 address instead of emitting the instance.
23639 This showed up with `This', as we were emitting the instance
23640 always (Emit) instead of the Address of This. Particularly
23641 interesting when This is a value type, as we dont want the Emit
23642 effect (which was to load the object).
23644 2002-07-08 Miguel de Icaza <miguel@ximian.com>
23646 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
23648 * statement.cs (Checked): Set the CheckedState during the resolve
23649 process too, as the ConvCast operations track the checked state on
23650 the resolve process, and not emit.
23652 * cs-parser.jay (namespace_member_declaration): Flag that we have
23653 found a declaration when we do. This is used to flag error 1529
23655 * driver.cs: Report ok when we display the help only.
23657 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
23659 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
23661 2002-07-04 Miguel de Icaza <miguel@ximian.com>
23663 * cs-tokenizer.cs (define): We also have to track locally the
23664 defines. AllDefines is just used for the Conditional Attribute,
23665 but we also need the local defines for the current source code.
23667 2002-07-03 Miguel de Icaza <miguel@ximian.com>
23669 * statement.cs (While, For, Do): These loops can exit through a
23670 Break statement, use this information to tell whether the
23671 statement is the last piece of code.
23673 (Break): Flag that we break.
23675 * codegen.cs (EmitContexts): New `Breaks' state variable.
23677 2002-07-03 Martin Baulig <martin@gnome.org>
23679 * class.cs (TypeContainer.MethodModifiersValid): Allow override
23680 modifiers in method declarations in structs. Otherwise, you won't
23681 be able to override things like Object.Equals().
23683 2002-07-02 Miguel de Icaza <miguel@ximian.com>
23685 * class.cs (Method, Property, Indexer): Do not allow the public
23686 modifier to be used in explicit interface implementations.
23688 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
23689 override modifiers in method declarations in structs
23691 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
23693 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
23694 integer or real overflow, report an error
23696 2002-07-02 Martin Baulig <martin@gnome.org>
23698 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
23699 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
23700 to tell the runtime about our newly created System.Object and
23701 System.ValueType types.
23703 2002-07-02 Miguel de Icaza <miguel@ximian.com>
23705 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
23706 struct instead of Ldarg/Starg.
23708 2002-07-02 Martin Baulig <martin@gnome.org>
23710 * expression.cs (Indirection.Indirection): Call
23711 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
23713 2002-07-02 Martin Baulig <martin@gnome.org>
23715 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
23716 ValueType, call TypeManager.TypeToCoreType() on it.
23717 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
23718 the OpCodes.Newarr argument.
23720 2002-07-02 Martin Baulig <martin@gnome.org>
23722 * expression.cs (Invocation.EmitCall): When compiling corlib,
23723 replace all calls to the system's System.Array type to calls to
23724 the newly created one.
23726 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
23727 System.Array methods.
23728 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
23729 from the system's System.Array type which must be replaced.
23731 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
23733 * typemanager.cs: load unverifiable_code_ctor so we can build
23734 corlib using the correct type. Avoid using GetTypeCode() with
23736 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
23737 TypeManager.object_type to allow building corlib.
23739 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
23741 * ecore.cs: handle System.Enum separately in LoadFromPtr().
23743 2002-07-01 Martin Baulig <martin@gnome.org>
23745 * class.cs: Make the last change actually work, we need to check
23746 whether `ifaces != null' to avoid a crash.
23748 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23750 * class.cs: when we build structs without fields that implement
23751 interfaces, we need to add the interfaces separately, since there is
23752 no API to both set the size and add the interfaces at type creation
23755 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23757 * expression.cs: the dimension arguments to the array constructors
23758 need to be converted if they are a long.
23760 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
23762 * class.cs: don't emit ldarg.0 if there is no parent constructor
23763 (fixes showstopper for corlib).
23765 2002-06-29 Martin Baulig <martin@gnome.org>
23767 MCS now compiles corlib on GNU/Linux :-)
23769 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
23770 ie. check for MethodImplOptions.InternalCall.
23772 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
23773 and TypeManager.attribute_type are null, so we must explicitly check
23774 whether parent is not null to find out whether it's an attribute type.
23775 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
23776 and SetBuilder, not only if the property is neither abstract nor external.
23777 This is necessary to set the MethodImplOptions on the accessor methods.
23778 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
23779 SetBuilder, see Property.Emit().
23781 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
23782 populate "System.Object", "System.ValueType" and "System.Attribute" since
23783 they've already been populated from BootCorlib_PopulateCoreTypes().
23785 2002-06-29 Martin Baulig <martin@gnome.org>
23787 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
23788 is the NullLiteral, we also need to make sure that target_type is not
23791 2002-06-29 Martin Baulig <martin@gnome.org>
23793 * rootcontext.cs (RootContext.ResolveCore): We must initialize
23794 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
23795 before calling BootstrapCorlib_ResolveDelegate ().
23797 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23799 * statement.cs: fixed build-breaker. All tests passed ok.
23801 2002-06-27 Martin Baulig <martin@gnome.org>
23803 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
23804 for System.Decimal when compiling corlib.
23806 2002-06-27 Martin Baulig <martin@gnome.org>
23808 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
23809 switch blocks which contain nothing but a default clause.
23811 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
23813 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
23815 2002-06-27 Martin Baulig <martin@gnome.org>
23817 * ecore.cs (PropertyExpr.PropertyExpr): Call
23818 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
23820 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
23821 is already a TypeBuilder.
23823 2002-06-27 Martin Baulig <martin@gnome.org>
23825 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
23826 `target_type == TypeManager.array_type', not IsAssignableFrom() in
23827 the "from an array-type to System.Array" case. This makes it work
23828 when compiling corlib.
23830 2002-06-27 Martin Baulig <martin@gnome.org>
23832 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
23833 non-static PropertyExpr, set its InstanceExpression. This makes
23834 the `ICollection.Count' property work in System/Array.cs.
23836 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
23838 * driver.cs: Made error handling more consistent. Errors now
23839 tracked by Report class, so many methods which used to return int
23840 now return void. Main() now prints success/failure and
23841 errors/warnings message.
23843 Renamed '--probe' compiler argument to '--expect-error'. Removed
23844 the magic number return values (123 and 124). Now, if the
23845 expected error occurs, the compiler exits with success (exit value
23846 0). If the compilation completes without seeing that particular
23847 error, the compiler exits with failure (exit value 1). The
23848 makefile in mcs/errors has been changed to handle the new behaviour.
23850 * report.cs: Made 'expected error' number a property and renamed
23851 it from 'Probe' to 'ExpectedError'.
23853 * genericparser.cs: Removed error handling support, since it is
23854 now all done by Report class.
23856 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
23857 class, so parse() no longer returns an int.
23859 * namespace.cs: Use Report.Error instead of GenericParser.error
23861 2002-06-22 Miguel de Icaza <miguel@ximian.com>
23863 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
23864 TypeContainer.AddOperator): At the front of the list put the
23865 explicit implementations, so they get resolved/defined first.
23867 2002-06-21 Miguel de Icaza <miguel@ximian.com>
23869 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
23870 interface type is implemented by this TypeContainer. Used during
23871 explicit interface implementation.
23873 (Property.Define, Indexer.Define, Method.Define): Validate that
23874 the given interface in the explicit implementation is one of the
23875 base classes for the containing type.
23877 Also if we are explicitly implementing an interface, but there is
23878 no match in the pending implementation table, report an error.
23880 (Property.Define): Only define the property if we are
23881 not explicitly implementing a property from an interface. Use the
23882 correct name also for those properties (the same CSC uses,
23883 although that is really not needed).
23885 (Property.Emit): Do not emit attributes for explicitly implemented
23886 properties, as there is no TypeBuilder.
23888 (Indexer.Emit): ditto.
23890 Hiding then means that we do not really *implement* a pending
23891 implementation, which makes code fail.
23893 2002-06-22 Martin Baulig <martin@gnome.org>
23895 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
23896 the return value of Object.GetType(). [FIXME: we need to do this whenever
23897 we get a type back from the reflection library].
23899 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
23901 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
23903 2002-06-20 Miguel de Icaza <miguel@ximian.com>
23905 * attribute.cs: Return null if we can not look up the type.
23907 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
23908 the interface types found.
23910 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
23911 interface types found.
23913 * typemanager.cs (GetInterfaces): Make this routine returns alll
23914 the interfaces and work around the lame differences between
23915 System.Type and System.Reflection.Emit.TypeBuilder in the results
23916 result for GetInterfaces.
23918 (ExpandInterfaces): Given an array of interface types, expand and
23919 eliminate repeated ocurrences of an interface. This expands in
23920 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
23923 2002-06-21 Martin Baulig <martin@gnome.org>
23925 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
23928 2002-06-21 Martin Baulig <martin@gnome.org>
23930 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
23931 and called with one of the core types, return the corresponding typebuilder for
23934 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
23937 2002-06-21 Martin Baulig <martin@gnome.org>
23939 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
23940 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
23941 (Expression.ConvertReferenceExplicit): Likewise.
23943 * expression.cs (ElementAccess.DoResolve): Likewise.
23944 (ElementAccess.DoResolveLValue): Likewise.
23946 2002-06-10 Martin Baulig <martin@gnome.org>
23948 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
23949 add the "value" parameter to the parameter list.
23951 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
23954 2002-06-19 Miguel de Icaza <miguel@ximian.com>
23956 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
23957 the argument to an int, uint, long or ulong, per the spec. Also
23958 catch negative constants in array creation.
23960 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
23962 * class.cs: do not allow the same interface to appear twice in
23963 the definition list.
23965 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
23967 * ecore.cs: don't use ldlen with System.Array.
23969 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
23971 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
23973 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
23975 * modifiers.cs: produce correct field attributes for protected
23976 internal. Easy fix so miguel can work on ther harder stuff:-)
23978 2002-06-18 Miguel de Icaza <miguel@ximian.com>
23980 * pending.cs: New file. Move the code from class.cs here.
23981 Support clearning the pending flag for all methods (when not doing
23982 explicit interface implementation).
23984 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
23986 * rootcontext.cs: added a couple more types needed to bootstrap.
23988 2002-06-17 Miguel de Icaza <miguel@ximian.com>
23990 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
23991 constructor in the type, instead of any constructor in the type
23992 hierarchy. Thanks to Paolo for finding this bug (it showed up as
23993 a bug in the Mono runtime when applying the params attribute).
23995 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23996 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
23998 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
24000 * expression.cs (Unary.ResolveOperator): Use TypeManager
24001 to resolve the type.
24003 2002-06-13 Ravi Pratap <ravi@ximian.com>
24005 * cs-parser.jay (enum_member_declaration): Pass in the attributes
24008 * enum.cs (AddEnumMember): Add support to store the attributes associated
24009 with each member too.
24011 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
24012 field builders too - this takes care of the enum member case.
24014 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
24016 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
24017 address-of operator on both value types and pointers.
24019 2002-06-10 Martin Baulig <martin@gnome.org>
24021 * interface.cs (Interface.PopulateIndexer): Add the indexer's
24022 PropertyBuilder to the `property_builders' list.
24024 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
24025 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
24026 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
24027 find any indexers which are inherited from an interface.
24029 2002-06-09 Martin Baulig <martin@gnome.org>
24031 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
24032 the same type as the constant if necessary. There's also a test-130.cs
24035 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
24037 * typemanager.cs (TypeManager.ChangeType): Previously known as
24038 Enum.ChangeEnumType().
24040 2002-06-09 Martin Baulig <martin@gnome.org>
24042 * expression.cs (Cast.TryReduce): Added support for consts.
24044 2002-06-08 Ravi Pratap <ravi@ximian.com>
24046 * class.cs (Accessor): Hold attributes information so we can pass
24049 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
24050 Modify to pass in attributes attached to the methods.
24052 (add_accessor_declaration, remove_accessor_declaration): Ditto.
24054 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
24055 to handle the Accessor kind :-)
24057 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
24059 2002-06-08 Martin Baulig <martin@gnome.org>
24061 * expression.cs (Unary.TryReduceNegative): Added support for
24064 2002-06-08 Martin Baulig <martin@gnome.org>
24066 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
24067 name can't be found in the `defined_names' - the caller will do a
24068 MemberLookup in this case and thus find methods in System.Enum
24069 such as Enum.IsDefined().
24071 2002-06-08 Martin Baulig <martin@gnome.org>
24073 * enum.cs (Enum.ChangeEnumType): This is a custom version of
24074 Convert.ChangeType() which works with TypeBuilder created types.
24075 (Enum.LookupEnumValue, Enum.Define): Use it here.
24077 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
24078 `TypeBuilder.BaseType != null' check.
24079 (TypeContainer.FindMembers): Only lookup parent members if we
24080 actually have a parent.
24081 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
24082 (ConstructorInitializer.Resolve): Likewise.
24084 * interface.cs (Interface.FindMembers): Added
24085 `TypeBuilder.BaseType != null' check.
24087 * rootcontext.cs (RootContext.ResolveCore): Added
24088 "System.Runtime.CompilerServices.IndexerNameAttribute" to
24089 classes_second_stage.
24091 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
24092 debug_type and trace_type when compiling with --nostdlib.
24094 2002-06-07 Martin Baulig <martin@gnome.org>
24096 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
24097 (AddField): Set it to true when adding a non-static field.
24098 (DefineType): Use `have_nonstatic_fields' to find out whether we
24099 have non-static fields, not `Fields != null'.
24101 2002-06-02 Miguel de Icaza <miguel@ximian.com>
24103 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
24104 dereferencing a null on the static-field code path)
24106 2002-05-30 Martin Baulig <martin@gnome.org>
24108 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
24109 to take command line arguments. Use reflection to call the new
24110 custom `Initialize' function on the symbol writer and pass it the
24111 command line arguments.
24113 * driver.cs (--debug-args): New command line argument to pass command
24114 line arguments to the symbol writer.
24116 2002-05-28 Miguel de Icaza <miguel@ximian.com>
24118 * assign.cs (DoResolve): Forgot to do the implicit conversion to
24119 the target type for indexers and properties. Thanks to Joe for
24122 2002-05-27 Miguel de Icaza <miguel@ximian.com>
24124 * typemanager.cs (MethodFlags): returns the method flags
24125 (Obsolete/ShouldIgnore) that control warning emission and whether
24126 the invocation should be made, or ignored.
24128 * expression.cs (Invocation.Emit): Remove previous hack, we should
24129 not do this on matching a base type, we should do this based on an attribute
24131 Only emit calls to System.Diagnostics.Debug and
24132 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
24133 on the command line.
24135 * rootcontext.cs: Global settings for tracing and debugging.
24137 * cs-tokenizer.cs (define): New utility function to track
24138 defines. Set the global settings for TRACE and DEBUG if found.
24140 2002-05-25 Ravi Pratap <ravi@ximian.com>
24142 * interface.cs (Populate*): Pass in the TypeContainer as well as
24143 the DeclSpace as parameters so that we can create EmitContexts and
24144 then use that to apply attributes etc.
24146 (PopulateMethod, PopulateEvent, PopulateProperty)
24147 (PopulateIndexer): Apply attributes everywhere.
24149 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
24152 (ApplyAttributes): Update accordingly.
24154 We now apply interface attributes for all members too.
24156 2002-05-26 Miguel de Icaza <miguel@ximian.com>
24158 * class.cs (Indexer.Define); Correctly check if we are explicit
24159 implementation (instead of checking the Name for a ".", we
24160 directly look up if the InterfaceType was specified).
24162 Delay the creation of the PropertyBuilder.
24164 Only create the PropertyBuilder if we are not an explicit
24165 interface implementation. This means that explicit interface
24166 implementation members do not participate in regular function
24167 lookups, and hence fixes another major ambiguity problem in
24168 overload resolution (that was the visible effect).
24170 (DefineMethod): Return whether we are doing an interface
24173 * typemanager.cs: Temporary hack until we get attributes in
24174 interfaces (Ravi is working on that) and we get IndexerName
24175 support in interfaces.
24177 * interface.cs: Register the indexers as properties.
24179 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
24180 warning, I have verified that this is a bug in the .NET runtime
24181 (JavaScript suffers of the same problem).
24183 * typemanager.cs (MemberLookup): When looking up members for
24184 interfaces, the parent of an interface is the implicit
24185 System.Object (so we succeed in searches of Object methods in an
24186 interface method invocation. Example: IEnumerable x; x.ToString
24189 2002-05-25 Miguel de Icaza <miguel@ximian.com>
24191 * class.cs (Event): Events should also register if they do
24192 implement the methods that an interface requires.
24194 * typemanager.cs (MemberLookup); use the new GetInterfaces
24197 (GetInterfaces): The code used to lookup interfaces for a type is
24198 used in more than one place, factor it here.
24200 * driver.cs: Track the errors at the bottom of the file, we kept
24203 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
24204 instance if the method we are calling is static!
24206 2002-05-24 Miguel de Icaza <miguel@ximian.com>
24208 * attribute.cs (ApplyAttributes): Make this function filter out
24209 the IndexerName attribute (as that attribute in reality is never
24210 applied) and return the string constant for the IndexerName
24213 * class.cs (TypeContainer.Emit): Validate that all the indexers
24214 have the same IndexerName attribute, and if so, set the
24215 DefaultName attribute on the class.
24217 * typemanager.cs: The return value might contain other stuff (not
24218 only methods). For instance, consider a method with an "Item"
24219 property and an Item method.
24221 * class.cs: If there is a problem with the parameter types,
24224 2002-05-24 Ravi Pratap <ravi@ximian.com>
24226 * ecore.cs (ImplicitConversionExists): Wrapper function which also
24227 looks at user defined conversion after making a call to
24228 StandardConversionExists - we need this for overload resolution.
24230 * expression.cs : Update accordingly the various method calls.
24232 This fixes 2 bugs filed against implicit user defined conversions
24234 2002-05-22 Miguel de Icaza <miguel@ximian.com>
24236 * statement.cs: Track the result of the assignment.
24238 2002-05-21 Miguel de Icaza <miguel@ximian.com>
24240 * expression.cs (MemberAccess): Improved error reporting for
24241 inaccessible members.
24243 2002-05-22 Martin Baulig <martin@gnome.org>
24245 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
24246 itself with debugging support.
24248 2002-05-22 Martin Baulig <martin@gnome.org>
24250 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
24251 Removed, this isn't needed anymore.
24253 2002-05-20 Martin Baulig <martin@gnome.org>
24255 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
24256 be underlying type for an enum.
24258 2002-05-20 Miguel de Icaza <miguel@ximian.com>
24260 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
24261 that splits out the loading of just the core types.
24263 * rootcontext.cs (ResolveCore): Split the struct resolution in
24264 two, so we can load the enumeration underlying types before any
24267 * expression.cs (Is): Bandaid until we fix properly Switch (see
24268 bug #24985 for details).
24270 * typemanager.cs (ImplementsInterface): The hashtable will contain
24271 a null if there are no interfaces implemented.
24273 2002-05-18 Miguel de Icaza <miguel@ximian.com>
24275 * cs-parser.jay (indexer_declarator): It is fine to have array
24278 2002-05-17 Miguel de Icaza <miguel@ximian.com>
24280 * typemanager.cs: (RegisterBuilder): New function used to register
24281 TypeBuilders that implement interfaces. Since
24282 TypeBuilder.GetInterfaces (as usual) does not work with lame
24284 (AddUserType): register interfaces.
24286 (ImplementsInterface): Use the builder_to_ifaces hash if we are
24287 dealing with TypeBuilder. Also, arrays are showing up as
24288 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
24289 methods can not be invoked on them!
24291 * ecore.cs (ExplicitReferenceConversionExists): Made public.
24292 (ImplicitReferenceConversionExists): Split out from
24293 StandardConversionExists.
24295 * expression.cs (As): We were only implementing one of the three
24296 cases for the as operator. We now implement them all.
24297 (Is): Implement the various other cases for Is as well.
24299 * typemanager.cs (CACHE): New define used to control if we want or
24300 not the FindMembers cache. Seems to have a negative impact on
24301 performance currently
24303 (MemberLookup): Nested types have full acess to
24304 enclosing type members
24306 Remove code that coped with instance/static returns for events, we
24307 now catch this in RealFindMembers.
24309 (RealFindMembers): only perform static lookup if the instance
24310 lookup did not return a type or an event.
24312 2002-05-17 Miguel de Icaza <miguel@ximian.com>
24314 * assign.cs (CompoundAssign): We pass more semantic information
24315 now to Compound Assignments than we did before: now we have all
24316 the information at hand, and now we resolve the target *before* we
24317 do the expression expansion, which allows the "CacheValue" method
24318 to have the effect we intended (before, a [x] += 1 would generate
24319 two differen ArrayAccess expressions from the ElementAccess,
24320 during the resolution process).
24322 (CompoundAssign.DoResolve): Resolve target and original_source here.
24324 2002-05-16 Miguel de Icaza <miguel@ximian.com>
24326 * expression.cs (ArrayAccess): dropped debugging information.
24328 * typemanager.cs: Small bug fix: I was always returning i_members,
24329 instead of one of i_members or s_members (depending on which had
24332 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
24333 method is invoked before any code generation takes place, and it
24334 is a mechanism to inform that the expression will be invoked more
24335 than once, and that the method should use temporary values to
24336 avoid having side effects
24338 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
24340 * ecore.cs (Expression.CacheTemporaries): Provide empty default
24343 * expression.cs (Indirection, ArrayAccess): Add support for
24344 CacheTemporaries in these two bad boys.
24346 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
24347 ldobj or ldind_ref.
24348 (StoreFromPtr): Handle stobj as well.
24350 * expression.cs (UnaryMutator): Share more code.
24352 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
24353 down: I was not tracking the Filter function as well, which
24354 was affecting the results of the cache.
24356 2002-05-15 Miguel de Icaza <miguel@ximian.com>
24358 * attribute.cs: Remove the hack to handle the CharSet property on
24361 2002-05-14 Miguel de Icaza <miguel@ximian.com>
24363 * attribute.cs (DoResolve): More uglyness, we now only try to
24364 resolve the attribute partially, to extract the CharSet
24365 information (only if we are a StructLayout attribute). Otherwise
24367 (GetExtraTypeInfo): Add some code to conditionally kill in the
24368 future this. I am more and more convinced that the .NET
24369 framework has special code to handle the attribute setting on
24372 * expression.cs (IsParamsMethodApplicable): Revert my previous
24373 foreach change here, it was wrong.
24375 2002-05-13 Miguel de Icaza <miguel@ximian.com>
24377 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
24378 (pp_expr): do not abort on unknown input, just return.
24379 (eval): abort if there are pending chars.
24381 * attribute.cs (Attribute.Resolve): Positional parameters are
24382 optional. Deal with that case.
24384 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
24385 the Ansi/Unicode/Auto information for the type.
24387 (TypeContainer.DefineType): instantiate the EmitContext here, as
24388 we will be using it during the type definition (to resolve
24389 attributes) and during the emit phase.
24391 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
24392 to pull type information out of the attributes
24394 (Attribute.Resolve): track the constructor builder, and allow for
24395 multiple invocations (structs and classes will use this).
24397 * ecore.cs (MemberLookupFinal): new version with all the
24398 parameters customizable.
24400 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
24401 constructors. Return if the result value is null (as the error
24402 would have been flagged already by MemberLookupFinal)
24404 Do not allow instances of abstract classes or interfaces to be
24407 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
24408 We have to compare the assembly property here when dealing with
24409 FamANDAssem and Assembly access modifiers, because we might be
24410 creating an assembly from *modules* (that means that we are not
24411 getting TypeBuilders for types defined in other modules that are
24412 part of this assembly).
24414 (Method.Emit): If the method is marked abstract and has a body,
24417 (TypeContainer.DefineMembers): If both the defined member and the
24418 parent name match are methods, then do not emit any warnings: let
24419 the Method.Define routine take care of flagging warnings. But if
24420 there is a mismatch (method overrides something else, or method is
24421 overriwritten by something, then emit warning).
24423 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
24424 set to null, this means `do not check for the return type on the
24427 (Method.Define): set the return type for the method signature to
24428 null, so that we get methods with the same name and parameters and
24429 different return types. This is used to flag warning 114 (you are
24430 hiding a method, and you probably want to use the new/override
24433 * typemanager.cs (MemberLookup): Implemented proper access
24434 control, closing a long standing set of bug reports. The problem
24435 was that the Framework only has two bits: Public and NonPublic,
24436 and NonPublic includes private and protected methods, but we need
24437 to enforce the FamANDAssem, FamOrAssem and Family.
24439 2002-05-11 Miguel de Icaza <miguel@ximian.com>
24441 * statement.cs (GotoCase): Return true: Ammounts to giving up
24442 knowledge on whether we return or not, and letting the other case
24443 be responsible for it.
24445 2002-05-10 Miguel de Icaza <miguel@ximian.com>
24447 * driver.cs: Do not load directories for each file processed, only
24448 do it if there is a pattern.
24450 * ecore.cs: Report readonly assigns here as well, as we might have
24451 been resolved only by MemberAccess.
24453 (SimpleName.SimpleNameResolve): Also be useful for LValue
24454 resolution. We need this to propagate assign to local readonly variables
24456 * typemanager.cs: Use a ptrhashtable for the criteria, because we
24457 do not want to reuse potential criteria memory.
24459 * class.cs (MyEventBuilder): Set reflected_type;
24461 * ecore.cs (Constantify): Added support for constifying bools.
24463 (RootContext.LookupType): Added a cache for values looked up in
24464 the declaration space.
24466 * typemanager.cs (FindMembers): Now is a front-end to
24467 RealFindMembers, and provides a two-level hashtable-based cache to
24470 15% performance improvement: from 22.5 to 19.2 seconds.
24472 * expression.cs (IsParamsMethodApplicable): use foreach.
24473 (Invocation.DoResolve): ditto.
24474 (New.DoResolve): ditto.
24475 (ArrayCreation.DoResolve): ditto.
24477 * ecore.cs (FindMostEncompassingType): use foreach.
24479 * delegate.cs (NewDelegate.DoResolve): Use foreach
24481 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
24482 (RemoveMethods): use foreach.
24484 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
24485 nested foreach statements instead of for, and also break out of
24486 the inner loop once a match is found.
24488 (Invocation.OverloadResolve): Use foreach, simplify the code.
24490 2002-05-08 Miguel de Icaza <miguel@ximian.com>
24492 * cfold.cs (BinaryFold): During an enumeration evaluation context,
24493 we actually unwrap the expression to allow for extra information
24496 * expression.cs: Use Shr_Un on unsigned operations.
24498 2002-05-08 Ravi Pratap <ravi@ximian.com>
24500 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
24501 applicable operators was not being considered correctly. This closes
24502 the bug Miguel reported.
24504 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
24506 * attribute.cs: check that the type derives from System.Attribute
24507 and report the correct error in that case (moved the duplicate code to
24508 its own method, too).
24510 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
24512 * attribute.cs: lookup attribute type name as the spec says: first the
24513 bare attribute name and then name + "Attribute" (nant compiles with
24514 mcs after this fix).
24516 2002-05-07 Miguel de Icaza <miguel@ximian.com>
24518 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
24519 Because of the way we parse things, we should try to see if a
24520 UIntConstant can fit in an integer.
24522 2002-05-07 Ravi Pratap <ravi@ximian.com>
24524 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
24525 when we are in an explicit context.
24527 (ConvertReferenceExplicit): When converting from Iface type S to Class
24528 T make sure the rules are implemented as an OR.
24530 * parameter.cs (ParameterType): Make it a property for now although the
24531 purpose really isn't anything immediate.
24533 * expression.cs (Is*Applicable): Do better checking on the parameter type
24534 of a ref/out parameter. The ones from the system assemblies are already
24535 marked with the correct type so we don't need to do any correction.
24537 * ecore.cs (StandardConversionExists): Conversion from Interface types to
24538 the object type is standard too so include that.
24540 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24542 * ecore.cs (StandardConversionExists): Augment with missing code:
24543 deal with IntConstant, LongConstants and Enumerations.
24545 * assign.cs: Report the error, instead of failing silently
24547 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
24548 typecontainer that they are declared, because the
24549 typecontainer/namespace will have the list of using clauses that
24550 need to be applied.
24552 Assembly Attributes were escaping the normal registration
24555 (EmitCode): Apply attributes within an EmitContext that represents
24556 the container they were declared on.
24558 * cs-parser.jay: Track bases for structs. How did I get this wrong?
24560 2002-05-06 Ravi Pratap <ravi@ximian.com>
24562 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
24563 Revamp completely - make much cleaner as we now operate only
24566 (FindMostSpecificSource, FindMostSpecificTarget): New methods
24567 to implement the logic detailed in the spec more correctly.
24569 (UserDefinedConversion): Update accordingly.
24571 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24573 * statement.cs: Return flow analysis information up.
24575 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
24578 (token): Do not consume an extra character before calling
24581 2002-05-06 Piers Haken <piersh@friskit.com>
24583 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
24585 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24587 * class.cs (Constructor.Emit): Set the IsStatic flag in the
24588 EmitContext during the instance constructor initializer
24589 resolution, to stop access to instance variables.
24591 This is mandated by the spec, last paragraph of the `constructor
24592 initializers' section.
24594 2002-05-05 Miguel de Icaza <miguel@ximian.com>
24596 * cs-parser.jay, class.cs (Accessor): new class used to represent
24597 an accessor (get or set). In the past we used `null' to represent
24598 a missing accessor. But this is ambiguous because there was no
24599 way to tell in abstract indexers/properties if one of them was
24602 Now there is a way of addressing that.
24604 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
24605 instead of FindMembers.
24607 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
24608 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
24610 * attribute.cs: Treat indexers and properties as the same in terms
24611 of applying attributes
24613 * ecore.cs (FindMostEncompassedType): Use statically initialized
24614 EmptyExpressions()s like we do elsewhere to avoid creating useless
24615 objects (and we take this out of the tight loop).
24617 (GetConversionOperators): Move the code to extract the actual
24618 operators to a separate routine to clean things up.
24620 2002-05-04 Miguel de Icaza <miguel@ximian.com>
24622 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
24623 events are always registered FieldBuilders.
24625 * class.cs (FieldBase): New class shared by Fields
24627 * delegate.cs: If we are a toplevel delegate, use our full name.
24628 If we are a nested delegate, then only use our tail name.
24630 2002-05-02 Ravi Pratap <ravi@ximian.com>
24632 * expression.cs (IsApplicable): Ensure that we add the "&" to
24633 ref/out types before comparing it with the type of the argument.
24635 (IsParamsMethodApplicable): Ditto.
24637 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
24640 * delegate.cs : Handle the case when we have more than one applicable
24641 method. Flag an error only when we finish checking all.
24643 2002-05-02 Miguel de Icaza <miguel@ximian.com>
24645 * expression.cs: Add support for boolean static initializers.
24647 2002-05-01 Miguel de Icaza <miguel@ximian.com>
24649 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
24651 * parameter.cs (ComputeParameterTypes,
24652 ComputeAndDefineParameterTypes): Better error handling: now we
24653 clear the `types' cache if we fail during any of the type lookups.
24654 We also return the status code correctly to our caller
24656 * delegate.cs: If we fail to define a delegate, abort the extra
24659 * expression.cs (Binary.ResolveOperator): for
24660 operator==(object,object) and operator !=(object, object) we also
24661 have to verify that there is an implicit conversion from one to
24664 (ArrayAccess.DoResolve): Array Access can operate on
24667 2002-04-30 Miguel de Icaza <miguel@ximian.com>
24669 * assign.cs (CompoundAssign): A new class used as a "flag" that
24670 the assignment actually is happening as part of a compound
24671 assignment operator.
24673 During compound assignment, a few new rules exist to enable things
24680 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
24681 to the type of x) if y is implicitly convertible to the type of x,
24682 and the operator is a builtin operator and the return type of the
24683 operator is explicitly convertible to the type of x.
24685 * rootcontext.cs: Reset warning level to 2. 4 catches various
24686 "interesting" features in mcs, we must clean this up at some
24687 point, but currently am trying to kill other bugs ;-)
24689 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
24690 in container classes as well.
24692 * expression.cs (Binary.ResolveOperator): Handle string case
24693 before anything else (as operator overloading does emit an error
24694 before doing anything else).
24696 This code could go away when we move to a table driven model, but
24697 i could not come up with a good plan last night.
24699 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
24701 * typemanager.cs (CSharpName): reimplementation using regex.
24702 * class.cs: added null check for fields in Emit
24703 * rootcontext.cs: set warninglevel to 4
24705 2002-04-29 Miguel de Icaza <miguel@ximian.com>
24707 * typemanager.cs (CSharpName): reimplemented with Lupus
24710 2002-04-28 Miguel de Icaza <miguel@ximian.com>
24712 * statement.cs (If): correclty implement Resolve, because we were
24713 not catching sem errors in there. The same process is needed
24715 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
24718 (Statement.Warning_DeadCodeFound): Factorize code.
24719 (While): Report dead code here too.
24721 (Statement): Added Resolve virtual method to allow
24722 for resolution split from the emit code.
24724 2002-04-26 Miguel de Icaza <miguel@ximian.com>
24726 * statement.cs (EmitBoolExpression): No longer try to resolve the
24728 (MakeBoolean): New utility function that resolve, implicitly
24729 converts to boolean and tags the expression.
24732 (If, Do): Implement dead code elimination.
24733 (While): Implement loop inversion
24735 (Do, While, For, If): Resolve the expression prior to calling our
24738 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
24741 - added method Report28 (warning: program has more than one entry point)
24742 - added method IsEntryPoint, implements paragraph 10.1 of the spec
24743 - modified method Method.Define, the part at the end of the method
24745 * rootcontext.cs: added static public Location EntryPointLocation;
24747 * ../errors/cs0028.cs : Add test case for the above warning.
24750 - modified method CSharpName to allow arrays of primitive type to
24751 be printed nicely (e.g. instead of System.Int32[][] it now prints
24753 - added method CSharpSignature: returns the signature of a method
24754 in string format to be used in reporting errors, warnings, etc.
24756 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
24759 2002-04-26 Ravi Pratap <ravi@ximian.com>
24761 * delegate.cs (Define): Fix extremely silly bug where I was
24762 setting the type of the 'object' parameter of the BeginInvoke
24763 method to System.IAsyncResult instead of System.Object ;-)
24765 2002-04-26 Miguel de Icaza <miguel@ximian.com>
24767 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
24770 (Constructor.Emit): return if we fail to initialize the
24771 constructor. Another door closed!
24773 * expression.cs (New.DoResolve): Improve error message (from -6 to
24774 1501). Use DeclaredOnly lookup to find the exact constructor.
24776 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
24777 loop. This is useful.
24779 * cs-parser.jay: Adjust the default parameters so that destructors
24780 have the proper signature.
24782 2002-04-26 Martin Baulig <martin@gnome.org>
24784 * driver.cs (LoadAssembly): If `assembly' contains any characters
24785 which are only valid in path names and not in assembly names
24786 (currently slash, backslash and point), use Assembly.LoadFrom ()
24787 instead of Assembly.Load () on the `assembly' (before iteration
24788 over the link_paths).
24790 2002-04-26 Martin Baulig <martin@gnome.org>
24792 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
24794 2002-04-25 Miguel de Icaza <miguel@ximian.com>
24796 * class.cs (Property): use the new typemanager.MemberLookup
24798 (TypeContainer.MemberLookup): Implement using the
24799 TypeManager.MemberLookup now.
24801 * typemanager.cs: Make MemberLookup a function of the TypeManager,
24802 and return MemberInfos, so that these can be used without an
24803 EmitContext (what we had before).
24805 2002-04-24 Miguel de Icaza <miguel@ximian.com>
24807 * expression.cs: Fix the case where the argument to params if the
24808 type of the params. I omitted handling this before. Fixed
24810 2002-04-22 Miguel de Icaza <miguel@ximian.com>
24812 * driver.cs: Call BootCorlib_PopulateCoreType
24814 * class.cs (Property.CheckBase): Check for properties only, not
24817 * interface.cs: Temporary hack: try/catch around the
24818 CustomAttributeBuilder, because I am getting an exception that I
24821 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
24822 types whose definitions are required to be there (attributes are
24823 defined before standard types).
24825 Compute definitions as we boot the various types, as they are used
24826 immediately (value_type class will need object_type, but if we do
24827 not initialize object_type, we will pass a null, which will let
24828 the runtime pick the System.Object from the existing corlib, which
24829 is not what we want).
24831 2002-04-22 Patrik Torstensson <totte@labs2.com>
24833 * cs-tokenizer.cs: fixed a number of trim() issues.
24835 2002-04-22 Ravi Pratap <ravi@ximian.com>
24837 * expression.cs (Argument.Type): Ensure that we return the correct
24838 type when we have out or ref parameters [in which case we
24841 2002-04-22 Miguel de Icaza <miguel@ximian.com>
24843 * class.cs (Property, Indexer): Allow extern modifier in there.
24845 * typemanager.cs (InitBaseTypes): Initializes object_type and
24846 value_type, since those will be used early on during the bootstrap
24847 process to compile corlib.
24849 (InitCoreTypes): Move code from here to InitBaseTypes.
24851 2002-04-21 Miguel de Icaza <miguel@ximian.com>
24853 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
24854 single-dimension arrays as using the ldlen opcode.
24856 Daniel Lewis discovered this optimization.
24858 * typemanager.cs: Add signature for System.Array::get_Length
24860 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24862 * statement.cs: report the error when the foreach does not apply to an
24863 array nor a collection.
24865 2002-04-19 Miguel de Icaza <miguel@ximian.com>
24867 * expression.cs: Add implicit conversions to the operator ~.
24869 * constant.cs (DecimalConstant.Emit): Emit decimal value.
24871 * typemanager.cs: Locate the decimal constructor.
24873 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24875 * attribute.cs: use the new property of TypeOf.
24876 * expression.cs: added 'get' property around typearg.
24878 These changes fix a build breaker reported by NickD. Is this the
24879 correct way to fix? If not, please, revert my changes and make it
24882 2002-04-17 Miguel de Icaza <miguel@ximian.com>
24884 * attribute.cs: Add support for typeof in attribute invocations.
24885 I am not sure that this is right though.
24887 2002-04-14 Duncan Mak <duncan@ximian.com>
24889 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
24890 Binary.Operator.Division case.
24892 2002-04-13 Ravi Pratap <ravi@ximian.com>
24894 * class.cs (DefineType): Ensure that we do a proper check on
24895 attribute types and also register it with the TypeManager.
24897 (TypeContainer.Targets): The default for attribute types is
24898 AttributeTargets.All.
24900 * attribute.cs (ApplyAttributes): Registering the attribute type
24901 is done elsewhere, not when we discover we have a Usage attribute.
24903 2002-04-12 Ravi Pratap <ravi@ximian.com>
24905 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
24906 and get rid of is_delegate parameter.
24908 * everywhere : update.
24910 2002-04-12 Ravi Pratap <ravi@ximian.com>
24912 * cs-parser.jay (compilation_unit): Revamp completely to use
24913 some new ideas that I got from Rhys' grammar to solve the problems
24914 with assembly level attributes.
24916 (outer_declaration): New grammar production.
24918 (attribute_sections): Add.
24920 (opt_attributes): Base on attribute_sections
24922 (namespace_declaration): Allow opt_attributes to tackle the case
24923 when we have assembly level attributes - we are clever in this
24926 * attribute.cs (ApplyAttributes): Do not worry about assembly
24927 attributes in the non-global context.
24929 * rootcontext.cs (AddGlobalAttributes): Go back to using this
24930 instead of SetGlobalAttributes.
24932 * class.cs, rootcontext.cs : Ensure we define and generate
24933 attribute types before anything else.
24935 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
24936 and flag the new error -20 for the case when the attribute type
24937 does not have valid targets specified. csc does not catch this.
24939 * ../errors/errors.txt : update for error # -20
24941 2002-04-11 Ravi Pratap <ravi@ximian.com>
24943 * support.cs (InternalParameters.ParameterModifier): Do some null
24944 checking and return sane values.
24946 * class.cs (Method.Define): If we are a PInvoke method, ensure
24947 that we are static and extern. Report error # 601
24949 * ../errors/cs0601.cs : Add test case for the above error.
24951 2002-04-07 Ravi Pratap <ravi@ximian.com>
24953 * rootcontext.cs (attribute_types): We need to keep type of
24954 all attribute types separately and emit code for them first.
24956 (RegisterAttribute) : Implement.
24958 * class.cs (DefineType): Check if the current Type is a custom
24959 attribute type and register it accordingly.
24961 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
24962 adding the first attribute twice and rename to
24964 (SetGlobalAttributes): this.
24966 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
24969 * attribute.cs (ApplyAttributes): Take an additional argument telling us
24970 if we are processing global arguments. Hmm, I am unsure of this.
24972 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24974 * expression.cs: added static array of strings to avoid calling
24975 Enum.ToString () for Operator in Binary. Significant recover of
24978 2002-04-10 Miguel de Icaza <miguel@ximian.com>
24980 * class.cs (FindMembers): Allow the Builders of the various
24981 members to be null. If they are skip them. This only happens
24982 during the PInvoke declaration.
24984 2002-04-09 Miguel de Icaza <miguel@ximian.com>
24986 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
24987 failure, so we do not keep going afterwards.
24989 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
24990 wanted to pass `false' as the `is_delegate' argument. If this is
24991 the case, why not use delegate_type == null to mean `is_delegate =
24992 false' and anything else as is_delegate = true.
24994 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
24996 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
24997 code for the section, not the beginning of the tests.
24999 2002-04-08 Miguel de Icaza <miguel@ximian.com>
25001 * cfold.cs: Handle operator + (Enum x, Underlying x)
25003 * expression.cs (Binary): same. Warn about errors where we have
25004 Enum/Enum in operator + as well.
25006 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
25009 - added support for switch(bool)
25010 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
25011 - add TableSwitchEmit() to handle table-based switch statements
25013 2002-04-05 Ravi Pratap <ravi@ximian.com>
25015 * expression.cs (Invocation.OverloadResolve): Factor out code which
25016 does parameter compatibility checking with arguments so that we can
25017 re-use the code even from Delegate.VerifyApplicability
25019 (VerifyArgumentsCompat): Move above code here.
25021 * delegate.cs (VerifyApplicability): Get rid of duplicate code
25022 and instead make a call to the above method.
25024 2002-03-31 Ravi Pratap <ravi@ximian.com>
25026 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
25027 We use it to keep track of classes which are attribute types.
25029 2002-04-02 Miguel de Icaza <miguel@ximian.com>
25031 * delegate.cs (Delegate.Define): Correctly define the types in the
25032 presence of fixed and array parameters.
25034 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
25037 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
25038 include NonPublic after the first iteration.
25040 * class.cs (Indexer.CheckBase): Only check if both parents are
25043 * cs-parser.jay (accessor_body): If empty, set to null.
25045 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
25046 same code path here to resolve constants names that we did have in
25047 MemberAccess.DoResolve. There is too much code duplicated here.
25049 2002-04-01 Miguel de Icaza <miguel@ximian.com>
25051 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
25053 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
25056 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
25057 tokens, numbers and strings.
25059 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
25062 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
25063 asyncronous parameters and the regular parameters.
25065 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
25066 specify the target directory.
25068 * expression.cs: (This.DoResolve): Simplify
25069 (As.Emit): Optimize, do not generate IsInst if the expression is
25070 always of the given type.
25072 (Is.DoResolve): Bug fix, we were reporting both always/never for
25075 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
25076 creating too many unnecessary arrays.
25078 2002-03-31 Miguel de Icaza <miguel@ximian.com>
25080 * class.cs (EmitFieldInitializer): Use Assign expression to assign
25081 fields instead of rolling our own initializer. Takes care of all
25082 implicit conversions, and drops unnecessary static checks/argument.
25084 2002-03-31 Dick Porter <dick@ximian.com>
25086 * driver.cs: use the GetDirectories() return values properly, and
25087 use "/" as path separator.
25089 2002-03-30 Miguel de Icaza <miguel@ximian.com>
25091 * expression.cs (Unary): Optimize - - expr into expr.
25092 (Binary): Optimize a + (-b) into a -b.
25094 * codegen.cs (CodeGen): Made all methods static.
25096 2002-03-29 Miguel de Icaza <miguel@ximian.com>
25100 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
25101 TypeBuilder property.
25103 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
25106 * tree.cs: Removed the various RecordXXXX, and replaced with a
25107 single RecordDecl. Removed all the accessor methods, and just
25108 left a single access point Type
25110 * enum.cs: Rename DefineEnum to DefineType.
25112 * decl.cs: New abstract method `DefineType' used to unify the
25113 Defines for Enumerations, Interfaces, TypeContainers and
25116 (FindType): Moved LookupInterfaceOrClass here. Moved the
25117 LookupBaseClasses method that used to live in class.cs and
25118 interface.cs here, and renamed to FindType.
25120 * delegate.cs: Implement DefineType. Take advantage of the
25121 refactored pattern for locating the parent builder without taking
25122 the parent_builder argument (which we know does not work if we are
25123 nested, and triggering a toplevel definition).
25125 2002-03-28 Miguel de Icaza <miguel@ximian.com>
25127 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
25128 accessibility of a member has changed during override and report
25131 * class.cs (Method.Define, Property.Define): Only complain on
25132 overrides if the method is private, any other accessibility is
25133 fine (and since we just checked the permission is the same, we are
25136 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
25137 and elif are processed always. The other pre-processing
25138 directives are only processed if we are "taking" the path
25140 2002-03-29 Martin Baulig <martin@gnome.org>
25142 * class.cs (Method.Emit): Only emit symbolic debugging info if the
25143 current location is not Null.
25145 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
25146 a separate method so we can profile it.
25148 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
25149 `span.Seconds' are just seconds, but no minutes or hours.
25150 (MainDriver): Profile the CodeGen.SaveSymbols calls.
25152 2002-03-28 Miguel de Icaza <miguel@ximian.com>
25154 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
25155 Remove the gratuitous set of Final:
25157 // If an interface implementation, then we can set Final.
25158 if (((flags & MethodAttributes.Abstract) == 0) &&
25159 implementing.DeclaringType.IsInterface)
25160 flags |= MethodAttributes.Final;
25162 I do not know what I was smoking when I used that.
25165 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
25166 step into fixing the name resolution issues for delegates and
25167 unifying the toplevel name resolution.
25169 2002-03-28 Martin Baulig <martin@gnome.org>
25171 * class.cs (Method.Emit): If we have a symbol writer, call its
25172 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
25173 tell it about the current method.
25175 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
25176 writer that we're going to emit the first byte of IL code for a new
25177 statement (a new source line).
25178 (EmitContext.EmitTopBlock): If we have a symbol writer, call
25179 EmitContext.Mark() before emitting any code.
25181 * location.cs (SymbolDocument): Return null when we're Null.
25183 * statement.cs (Statement): Moved the `Location loc' variable here.
25184 (Statement.EmitBoolExpression): If we have a symbol writer, call
25185 ec.Mark() before emitting any code to tell it that we're at the
25186 beginning of a new statement.
25187 (StatementExpression): Added `Location' argument to the constructor.
25188 (Block): Added public readonly variable `StartLocation' and public
25189 variable `EndLocation'. The latter is to be set using SetEndLocation().
25190 (Block): Added constructor which takes a start and end location.
25191 (Block.SetEndLocation): New method. This sets the end location.
25192 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
25193 local variables we create.
25194 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
25195 each statement and do also mark the begin and end of the block.
25197 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
25198 tell it the current lexer.Location, use Location.Null for the end of the
25200 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
25201 current block, set its end location using SetEndLocation().
25202 (statement_expression): StatementExpression constructor now takes the
25203 lexer.Location as additional argument.
25204 (for_statement, declare_local_variables): Likewise.
25205 (declare_local_variables): When creating a new implicit block, use the
25206 new Block constructor and pass it the lexer.Location.
25208 2002-03-28 Miguel de Icaza <miguel@ximian.com>
25210 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
25211 members also on the parent interfaces recursively.
25213 2002-03-27 Miguel de Icaza <miguel@ximian.com>
25215 * report.cs: Use new formats, since Gonzalo finished the missing
25218 * expression.cs (Binary.ResolveOperator): added missing operator|
25219 operator& and operator^ for bool/bool.
25221 * cs-parser.jay: CheckDef now takes a Location argument that is
25222 used to report errors more precisly (instead of reporting the end
25223 of a definition, we try to track something which is a lot closer
25224 to the source of the problem).
25226 * cs-tokenizer.cs: Track global token use, so we can properly flag
25227 the use of #define/#undef after the first token has been seen.
25229 Also, rename the reportXXXX to Error_DescriptiveName
25231 * decl.cs (DeclSpace.IsTopLevel): Move property here from
25232 TypeContainer, so that Enum and Interface can use this too.
25234 * class.cs (TypeContainer.LookupInterfaceOrClass,
25235 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
25236 `builder' argument. Typically this was used to pass the parent
25237 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
25240 The problem is that a nested class could trigger the definition of
25241 a toplevel class, and the builder would be obviously wrong in that
25244 So we drop this argument, and we compute dynamically the
25245 TypeBuilder/ModuleBuilder (the correct information was available
25246 to us anyways from DeclSpace.Parent)
25248 * interface.cs (Interface.DefineInterface): Drop builder
25249 parameter cleanup like class.cs
25251 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
25254 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
25257 (Try.Emit): Propagate the returns value from the statement.
25259 (Return.Emit): Even if we are leavning
25261 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
25263 * modifiers.cs: Fix the computation of MethodAttributes flags.
25265 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
25267 * driver.cs: allow compilation of files that start with '/'.
25268 Add a default case when checking the argument of --target.
25270 2002-03-25 Miguel de Icaza <miguel@ximian.com>
25272 * interface.cs: Implement the same search algorithm for types in
25273 the interface code.
25275 * delegate.cs: Do not allow multiple definition.
25277 * Recovered ChangeLog that got accidentally amputated
25279 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
25281 * rootcontext.cs: Load manually enum to allow core classes to
25282 contain enumerations.
25284 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
25285 Update to new static methods in TypeManager.
25287 * typemanager.cs (GetMethod, GetConstructor): Use our
25288 implementation of FindMembers to find the members, since during
25289 corlib compilation, the types are TypeBuilders and GetMethod and
25290 GetConstructor do not work.
25292 Make all methods in TypeManager static.
25294 (InitCodeHelpers): Split the functionality from
25295 the InitCodeTypes function.
25297 * driver.cs: Call InitCodeHelpers after we have populated the
25300 * cs-parser.jay (delegate_declaration): we did not used to compute
25301 the delegate name correctly for void delegates.
25303 2002-03-24 Miguel de Icaza <miguel@ximian.com>
25305 * rootcontext.cs (RootContext): Init the interface_resolve_order
25306 and type_container_resolve_order always.
25308 (ResolveCore, BootstrapCorlib_ResolveClass,
25309 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
25310 compiler when compiling with --nostdlib
25312 * class.cs (TypeContainer.DefineType): Check that our parent is
25313 not null. This test is most important when we are bootstraping
25316 * codegen.cs: Split out the symbol writing code.
25318 2002-03-25 Martin Baulig <martin@gnome.org>
25320 * driver.cs (-g): Made -g an alias for --debug.
25322 2002-03-24 Martin Baulig <martin@gnome.org>
25324 * codegen.cs (SymbolWriter): New public variable. Returns the
25325 current symbol writer.
25326 (CodeGen): Added `bool want_debugging_support' argument to the
25327 constructor. If true, tell the ModuleBuild that we want debugging
25328 support and ask it for the ISymbolWriter.
25329 (Save): If we have a symbol writer, call it's Close() method after
25330 saving the assembly.
25332 * driver.c (--debug): New command line argument to create a
25333 debugger information file.
25335 * location.cs (SymbolDocument): New public property. Returns an
25336 ISymbolDocumentWriter object for the current source file or null
25337 if we don't have a symbol writer.
25339 2002-03-21 Miguel de Icaza <miguel@ximian.com>
25341 * driver.cs (LoadAssembly): Correctly return when all the paths
25342 have been tried and not before.
25344 * statement.cs (Switch.Emit): return the actual coverage for this
25345 statement (returns/not-returns)
25347 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
25348 switch of the statement if we are the last switch section. That
25349 kills two problems: try/catch problems (we used to emit an empty
25350 nop at the end) and switch statements where all branches would
25353 2002-03-19 Miguel de Icaza <miguel@ximian.com>
25355 * driver.cs: Add default assemblies (the equivalent to the
25356 Microsoft CSC.RSP file)
25358 * cs-tokenizer.cs: When updating `cols and setting it to zero,
25359 also update tokens_seen and set it to false.
25361 * driver.cs: Implement --recurse for Mike.
25363 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
25364 correctly splitting out the paths.
25366 2002-03-18 Miguel de Icaza <miguel@ximian.com>
25368 * interface.cs (Interface.PopulateProperty): Instead of using
25369 `parent' as the declaration space for the set parameters, use
25372 * support.cs (InternalParameters): InternalParameters constructor
25373 takes a DeclSpace instead of a TypeContainer.
25375 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
25376 types are being initialized, load the address of it before calling
25379 (New): Provide a mechanism to disable the generation of local
25380 value type temporaries when the caller will be providing us with
25381 an address to store it.
25383 (ArrayCreation.EmitDynamicInitializers): Use it.
25385 2002-03-17 Miguel de Icaza <miguel@ximian.com>
25387 * expression.cs (Invocation.EmitArguments): Only probe for array
25388 property if there is more than one argument. Sorry about that.
25390 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
25391 empty param arrays.
25393 * class.cs (Method.LabelParameters): Fix incorrect code path that
25394 prevented the `ParamArrayAttribute' from being applied to the
25397 2002-03-16 Miguel de Icaza <miguel@ximian.com>
25399 * support.cs (ReflectionParameters): Correctly compute whether the
25400 last argument is a params array. Fixes the problem with
25403 * typemanager.cs: Make the assemblies array always be non-null
25404 (empty, but non-null)
25406 * tree.cs (RecordDecl): New function that abstracts the recording
25407 of names. This reports error 101, and provides a pointer to the
25408 previous declaration. Fixes a crash in the compiler.
25410 * cs-parser.jay (constructor_declaration): Update to new grammar,
25411 and provide a constructor_body that can be empty.
25413 2002-03-15 Miguel de Icaza <miguel@ximian.com>
25415 * driver.cs: Add support for --resources.
25417 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
25418 Make all types for the various array helper methods be integer.
25420 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
25421 CheckState to ConvCast.
25423 (ConvCast): Now it takes a `checked' state argument, to avoid
25424 depending on the emit context for the conversion, and just using
25425 the resolve time setting.
25427 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
25428 instead of Invocation.EmitArguments. We do not emit the original
25429 arguments, instead we emit those which have been converted to
25430 unsigned int expressions.
25432 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
25434 * codegen.cs: ditto.
25436 * expression.cs (LocalVariableReference): Drop the use of the
25437 Store function that depended on the variable index.
25439 * statement.cs (VariableInfo): Drop the `Idx' property from this
25440 class, as this is not taking into account the indexes for
25441 temporaries tat we generate during the execution, getting the
25444 * class.cs: First emit class initializers, then call the parent
25447 * expression.cs (Binary): Fix opcode emision.
25448 (UnaryMutator.EmitCode): Support checked code generation
25450 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
25451 matches for events for both the Static and Instance scans,
25452 pointing to the same element. Fix that.
25454 2002-03-14 Miguel de Icaza <miguel@ximian.com>
25456 * rootcontext.cs (ResolveTree): Always set the
25457 interface_resolve_order, because nested interfaces will be calling
25460 * class.cs (GetInterfaceOrClass): Track the same resolution
25461 process used by TypeManager.LookupType. This fixes the nested
25462 type lookups in class declarations (separate path from
25465 (TypeContainer.DefineType): Also define nested interfaces.
25466 (TypeContainer.RegisterOrder): New public function used to
25467 register the order in which child interfaces need to be closed.
25469 Nested interfaces need to be closed after their parents have been
25472 * interface.cs (InterfaceAttr): Put all the logic for computing
25473 the interface attribute here.
25475 (DefineInterface): Register our interface order with the
25476 RootContext or with the TypeContainer depending on the case.
25478 2002-03-12 Miguel de Icaza <miguel@ximian.com>
25480 * cs-parser.jay: rework foreach statement to work with the new
25481 changes to the policy on SimpleNames.
25483 * report.cs: support Stacktrace on warnings as well.
25485 * makefile: drop --unsafe and /unsafe from the compile.
25487 2002-03-13 Ravi Pratap <ravi@ximian.com>
25489 * ecore.cs (StandardConversionExists): Modify to take an Expression
25490 as the first parameter. Ensure we do null -> reference type conversion
25493 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
25494 temporary Expression objects.
25496 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
25498 * interface.cs: workaround bug in method overloading resolution
25499 (there is already a bugzilla bug for it).
25501 2002-03-12 Miguel de Icaza <miguel@ximian.com>
25503 We could also solve this problem by having a separate path for
25504 performing type lookups, instead of DoResolve, we could have a
25505 ResolveType entry point, and only participating pieces of the
25506 production (simplename, deref, array) would implement this.
25508 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
25509 signal SimpleName to only resolve type names and not attempt to
25510 resolve anything else.
25512 * expression.cs (Cast): Set the flag.
25514 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
25516 * class.cs: Only report 108 if there is no `new' modifier.
25518 * cs-parser.jay: rework foreach statement to work with the new
25519 changes to the policy on SimpleNames.
25521 * report.cs: support Stacktrace on warnings as well.
25523 * makefile: drop --unsafe and /unsafe from the compile.
25525 2002-03-11 Miguel de Icaza <miguel@ximian.com>
25527 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25528 lookups here, instead of doing that at parse time. This means
25529 that our grammar will not introduce `LocalVariableReferences' as
25530 expressions at this point. That solves the problem of code like
25534 static void Main ()
25538 This is only half the fix. The full fix requires parameters to
25539 also be handled in this way.
25541 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
25542 makes the use more obvious of the DeclSpace. The
25543 ec.TypeContainer.TypeBuilder is now only used to pull the
25544 TypeBuilder for it.
25546 My theory is that I can get rid of the TypeBuilder completely from
25547 the EmitContext, and have typecasts where it is used (from
25548 DeclSpace to where it matters).
25550 The only pending problem is that the code that implements Aliases
25551 is on TypeContainer, and probably should go in DeclSpace.
25553 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25554 lookups here, instead of doing that at parse time. This means
25555 that our grammar will not introduce `LocalVariableReferences' as
25556 expressions at this point. That solves the problem of code like
25560 static void Main ()
25564 This is only half the fix. The full fix requires parameters to
25565 also be handled in this way.
25567 * class.cs (Property.DefineMethod): When implementing an interface
25568 method, set newslot, when implementing an abstract method, do not
25569 set the flag (before we tried never setting it, or always setting
25570 it, which is the difference).
25571 (Indexer.DefineMethod): same.
25572 (Method.DefineMethod): same.
25574 * ecore.cs: Only set the status used flag if we get back a Field.
25576 * attribute.cs: Temporary hack, so Paolo can keep working.
25578 2002-03-08 Ravi Pratap <ravi@ximian.com>
25580 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
25581 the unmanaged type in the case we have a MarshalAs attribute.
25583 (Resolve): Handle the case when we are parsing the special MarshalAs
25584 attribute [we need to store the unmanaged type to use later]
25586 * typemanager.cs (marshal_as_attr_type): Built in type for the
25587 MarshalAs Attribute.
25589 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
25590 on parameters and accordingly set the marshalling info.
25592 2002-03-09 Miguel de Icaza <miguel@ximian.com>
25594 * class.cs: Optimizing slightly by removing redundant code after
25595 we switched to the `NoTypes' return value.
25596 (Property.DefineMethod): use NoTypes here too.
25598 This fixes the bug I introduced in my last batch of changes.
25600 2002-03-05 Ravi Pratap <ravi@ximian.com>
25602 * tree.cs (RecordEnum): Add. We now keep track of enums too.
25604 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
25605 Enums since those are types too.
25607 * cs-parser.jay (enum_declaration): Record enums as we parse them.
25609 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
25610 thanks to a call during the lookup process.
25612 2002-03-07 Miguel de Icaza <miguel@ximian.com>
25614 * statement.cs (Foreach): Lots of work to accomodate a particular
25615 kind of foreach statement that I had not kept in mind. It is
25616 possible to have foreachs on classes that provide a GetEnumerator
25617 method that return objects that implement the "pattern" for using
25618 a foreach, there is no need to support GetEnumerator
25621 This is needed to compile nant.
25623 * decl.cs: Only report 114 if the member is not `Finalize' and if
25624 the warning level is at least 2.
25626 * class.cs: Moved the compare function from Method to
25629 (MethodSignature.InheritableMemberSignatureCompare): Add new
25630 filter function that is used to extract inheritable methods from a
25633 (Method.Define): Use the new `inheritable_method_signature_filter'
25636 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
25639 2002-03-06 Miguel de Icaza <miguel@ximian.com>
25641 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
25643 * cs-parser.jay: Add opt_semicolon to the interface declaration.
25645 * expression.cs: Pass location information to
25646 ConvertImplicitStandard.
25648 * class.cs: Added debugging code to track return values from
25651 2002-03-05 Miguel de Icaza <miguel@ximian.com>
25653 * expression.cs (Is.DoResolve): If either side of the `is' is an
25654 interface, do not flag the warning.
25656 * ecore.cs (ImplicitReferenceConversion): We need a separate test
25659 * report.cs: Allow for --fatal to be used with --probe.
25661 * typemanager.cs (NoTypes): Move the definition for the empty Type
25664 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
25666 (TypeContainer.DefineProxy): New function used to proxy to parent
25667 implementations when implementing interfaces.
25668 (TypeContainer.ParentImplements): used to lookup if our parent
25669 implements a public function that is required by an interface.
25670 (TypeContainer.VerifyPendingMethods): Hook this up.
25672 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
25673 `modules' and `assemblies' arraylists into arrays. We only grow
25674 these are the very early start up of the program, so this improves
25675 the speedof LookupType (nicely measured).
25677 * expression.cs (MakeByteBlob): Replaced unsafe code with
25678 BitConverter, as suggested by Paolo.
25680 * cfold.cs (ConstantFold.Binary): Special case: perform constant
25681 folding of string concatenation, but if either side is a string,
25682 and the other is not, then return null, and let the runtime use
25683 the concatenation on the string plus the object (using
25684 `Object.ToString').
25686 2002-03-04 Miguel de Icaza <miguel@ximian.com>
25688 Constant Folding has been implemented now.
25690 * expression.cs (Unary.Reduce): Do not throw an exception, catch
25691 the error instead on types that are not supported in one's
25694 * constant.cs (Constant and all children): New set of functions to
25695 perform implict and explicit conversions.
25697 * ecore.cs (EnumConstant): Implement the new functions to perform
25698 conversion by proxying to the child expression.
25700 * codegen.cs: (ConstantCheckState): Constant evaluation has its
25701 own separate setting that can not be turned off from the command
25702 line using --unchecked or --checked and is only controlled using
25703 the checked/unchecked statements and expressions. This setting is
25704 used by the constant folder to flag errors.
25706 * expression.cs (CheckedExpr, UncheckedExpr): Set the
25707 ConstantCheckState as well.
25709 During Resolve, they also have to flag the state, because the
25710 constant folder runs completely in the Resolve phase.
25712 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
25715 2002-03-01 Miguel de Icaza <miguel@ximian.com>
25717 * cfold.cs: New file, this file contains the constant folder.
25719 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
25720 argument to track whether we are using the resulting address to
25721 load or store a value and provide better error messages.
25723 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
25724 new AddressOf arguments.
25726 * statement.cs (Foreach.EmitCollectionForeach): Update
25728 * expression.cs (Argument.Emit): Call AddressOf with proper
25729 arguments to track usage.
25731 (New.DoEmit): Call AddressOf with new arguments.
25733 (Unary.Emit): Adjust AddressOf call.
25735 2002-03-01 Ravi Pratap <ravi@ximian.com>
25737 * cs-parser.jay (member_access): Change the case for pre-defined types
25738 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
25741 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
25744 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
25745 essentially like methods and apply attributes like MethodImplOptions to them too.
25747 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
25750 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
25751 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
25754 * Update code everywhere accordingly.
25756 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
25758 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
25760 2002-02-28 Ravi Pratap <ravi@ximian.com>
25762 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
25763 try performing lookups against those instead of jumping straight into using
25764 the 'using' clauses.
25766 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
25768 (LookupType): Perform lookups in implicit parents too.
25770 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
25771 sequence as RootContext.LookupType.
25773 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
25774 the various cases of namespace lookups into this method.
25776 2002-03-01 Miguel de Icaza <miguel@ximian.com>
25778 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
25779 in positional arguments)
25781 * class.cs (Operator): Update the AllowedModifiers to contain
25784 * cs-parser.jay: Update operator declaration to allow for the
25785 operator body to be empty.
25787 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
25790 2002-02-27 Miguel de Icaza <miguel@ximian.com>
25792 * class.cs (Method.Emit): Label parameters.
25794 * driver.cs: Return 1 or 0 as the program exit code.
25796 2002-02-26 Miguel de Icaza <miguel@ximian.com>
25798 * expression.cs: Special case the `null' object when trying to
25799 auto-compute the type, as anything can be explicitly converted to
25802 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
25803 spotting this Paolo.
25805 (Expression.ImplicitNumericConversion): Perform comparissions of
25806 the type using the underlying type in the case of an enumeration
25807 rather than using the enumeration type for the compare.
25809 Cope with the underlying == type case, which is not possible to
25812 (Expression.ConvertNumericExplicit): Perform comparissions of
25813 the type using the underlying type in the case of an enumeration
25814 rather than using the enumeration type for the compare.
25816 * driver.cs: If the user does not supply an extension, assume .exe
25818 * cs-parser.jay (if_statement): Rewrote so that we can track the
25819 location for the if statement.
25821 * expression.cs (Binary.ConstantFold): Only concat strings when
25822 the operation is "+", not everything ;-)
25824 * statement.cs (Statement.EmitBoolExpression): Take a location
25826 (If, While, Do): Track location.
25828 * expression.cs (Binary.ResolveOperator): In the object + string
25829 case, I was missing a call to ConvertImplicit
25831 2002-02-25 Ravi Pratap <ravi@ximian.com>
25833 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
25834 Location arguments. Ensure we use RootContext.LookupType to do our work
25835 and not try to do a direct Type.GetType and ModuleBuilder.GetType
25837 * interface.cs (PopulateMethod): Handle the type of the parameter being
25840 * expression.cs (Invocation.BetterFunction): Handle the case when we
25841 have a params method with no fixed arguments and a call is made with no
25844 2002-02-25 Miguel de Icaza <miguel@ximian.com>
25846 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
25847 the verbatim-string-literal
25849 * support.cs (InternalParameters.ParameterModifier): handle null
25851 (InternalParameters.ParameterType): ditto.
25853 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
25854 duplicating the name of the variable parameter.
25855 (GetParameterByName): Fix bug where we were not looking up array
25856 paramters if they were the only present (thanks Paolo!).
25857 (GetParameterInfo): We only have an empty set of types if both
25858 fixed and array are set to null.
25859 (GetParameterInfo-idx): Handle FixedParameter == null
25861 * cs-parser.jay: Handle the case where there is no catch
25862 statements (missing null test).
25864 2002-02-22 Miguel de Icaza <miguel@ximian.com>
25866 * driver.cs (MainDriver): Be conservative on our command line
25869 Catch DirectoryNotFoundException when calling GetFiles.
25871 (SplitPathAndPattern): Used to split the input specification into
25872 a path and a pattern that we can feed to Directory.GetFiles.
25874 2002-02-21 Miguel de Icaza <miguel@ximian.com>
25876 * statement.cs (Fixed): Implement the last case of the Fixed
25877 statement (string handling).
25879 * expression.cs (StringPtr): New class used to return a char * to
25880 a string; Used by the Fixed statement.
25882 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
25884 * expression.cs (Binary.ResolveOperator): Remove redundant
25885 MemberLookup pn parent type.
25886 Optimize union call, we do not need a union if the types are the same.
25887 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
25890 Specialize the use of MemberLookup everywhere, instead of using
25891 the default settings.
25893 (StackAlloc): Implement stackalloc keyword.
25895 * cs-parser.jay: Add rule to parse stackalloc.
25897 * driver.cs: Handle /h, /help, /?
25899 * expression.cs (MakeByteBlob): Removed the hacks we had in place
25900 before we supported unsafe code.
25902 * makefile: add --unsafe to the self compilation of mcs.
25904 2002-02-20 Miguel de Icaza <miguel@ximian.com>
25906 * expression.cs (PointerArithmetic): New class that is used to
25907 perform pointer arithmetic.
25908 (Binary.Resolve): Handle pointer arithmetic
25909 Handle pointer comparission.
25910 (ArrayPtr): Utility expression class that is used to take the
25911 address of an array.
25913 (ElementAccess): Implement array access for pointers
25915 * statement.cs (Fixed): Implement fixed statement for arrays, we
25916 are missing one more case before we are done.
25918 * expression.cs (Indirection): Implement EmitAssign and set the
25919 ExprClass to Variable. This allows pointer dereferences to be
25920 treated as variables, and to have values assigned to them.
25922 * ecore.cs (Expression.StoreFromPtr): New utility function to
25923 store values dereferencing.
25925 2002-02-20 Ravi Pratap <ravi@ximian.com>
25927 * expression.cs (Binary.ResolveOperator): Ensure that we are
25928 not trying to operate on a void type - this fixes the reported
25931 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
25932 the parent implementation is sealed.
25934 * ../errors/cs0239.cs : Add.
25936 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
25938 * typemanager.cs (unverifiable_code_type): Corresponds to
25939 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
25940 which have unsafe code in them.
25942 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
25945 2002-02-19 Miguel de Icaza <miguel@ximian.com>
25947 * cs-tokenizer.cs: Add support for @"litreal strings"
25949 Make tokenizer accept pre-processor directives
25950 on any column (remove the old C-like limitation).
25952 * rootcontext.cs (EmitCode): Emit any global attributes.
25953 (AddGlobalAttributes): Used to keep track of assembly attributes.
25955 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
25957 * cs-parser.jay: Add support for global attributes.
25959 2002-02-17 Miguel de Icaza <miguel@ximian.com>
25961 * expression.cs (Indirection): New helper class. Unary will
25962 create Indirection classes to be able to implement the
25963 IMemoryLocation interface on it.
25965 2002-02-16 Miguel de Icaza <miguel@ximian.com>
25967 * cs-parser.jay (fixed_statement): reference the right statement.
25969 * statement.cs (Fixed.Emit): Finish implementing the fixed
25970 statement for the &x case.
25972 2002-02-14 Miguel de Icaza <miguel@ximian.com>
25974 * class.cs (Property.Define, Method.Define): Remove newslot when
25977 * modifiers.cs: My use of NewSlot when `Abstract' was set was
25978 wrong. NewSlot should only be used if the `new' keyword is present.
25980 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
25981 locating our system dir. Sorry about this.
25983 2002-02-13 Miguel de Icaza <miguel@ximian.com>
25985 * driver.cs (GetSystemDir): Compute correctly the location of our
25986 system assemblies. I was using the compiler directory instead of
25987 the library directory.
25989 2002-02-13 Ravi Pratap <ravi@ximian.com>
25991 * expression.cs (BetterFunction): Put back in what Miguel commented out
25992 since it is the correct fix. The problem is elsewhere ;-)
25994 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
25995 parameters of the parms method are themselves compatible or not !
25997 (StandardConversionExists): Fix very dangerous bug where we were forgetting
25998 to check that a class implements an interface before saying that an implicit
25999 conversion was allowed. Use ImplementsInterface to do the checking.
26001 2002-02-13 Miguel de Icaza <miguel@ximian.com>
26003 * class.cs (Method.Define): Track whether we are an explicit
26004 implementation or not. And only call DefineMethodOverride if we
26005 are an explicit implementation.
26007 (Property.DefineMethod): Ditto.
26009 2002-02-11 Ravi Pratap <ravi@ximian.com>
26011 * expression.cs (BetterFunction): Catch hideous bug which was
26012 preventing us from detecting ambiguous calls due to implicit casts i.e
26015 2002-01-29 Miguel de Icaza <miguel@ximian.com>
26017 * support.cs (Pair): Remove un-needed method. I figured why I was
26018 getting the error in cs-parser.jay, the variable in a foreach loop
26019 is readonly, and the compiler does not really treat this as a variable.
26021 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
26022 instead of EQUALS in grammar.
26024 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
26026 * expression.cs (Unary.DoResolve): Check whether the argument is
26029 2002-01-28 Miguel de Icaza <miguel@ximian.com>
26031 * support.cs: Api for Pair to set a value. Despite the fact that
26032 the variables are public the MS C# compiler refuses to compile
26033 code that accesses the field if the variable is part of a foreach
26036 * statement.cs (Fixed): Begin implementation of the fixed
26039 (Block.AddVariable): Return the VariableInfo on success and null
26040 on failure instead of true/false.
26042 * cs-parser.jay (foreach): Catch errors on variables already
26043 defined (we were ignoring this value before) and properly unwind
26044 the block hierarchy
26046 (fixed_statement): grammar for the fixed statement.
26048 2002-01-25 Miguel de Icaza <miguel@ximian.com>
26050 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
26051 pointer types to be incretemented.
26053 (SizeOf): Implement.
26055 * cs-parser.jay (pointer_member_access): Implement
26056 expr->IDENTIFIER production.
26058 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
26059 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
26062 (Unary): Implement indirection.
26064 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
26065 use in non-unsafe context).
26067 (SimpleName.DoResolve): Check for pointers in field access on safe
26070 (Expression.LoadFromPtr): Factor the load-indirect code in this
26071 function. This was duplicated in UnboxCast and ParameterReference
26073 2002-01-24 Miguel de Icaza <miguel@ximian.com>
26075 * expression.cs (ComposedCast): report an error if a pointer cast
26076 is used in a safe region.
26078 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
26079 pointer type casts in unsafe context.
26081 * codegen.cs (EmitContext): Set up IsUnsafe.
26083 * cs-parser.jay (non_expression_type): Add productions for pointer
26086 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
26087 code. We should not use force into static mode if the method is
26088 not virtual. Fixes bug in MIS
26090 * statement.cs (Do.Emit, While.Emit, For.Emit,
26091 Statement.EmitBoolExpression): Add support to Do and While to
26092 propagate infinite loop as `I do return' semantics.
26094 Improve the For case to also test for boolean constants.
26096 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
26097 to the list of attributes we can add.
26099 Remove `EmitContext' argument.
26101 * class.cs (Method.Define): Apply parameter attributes.
26102 (Constructor.Define): Apply parameter attributes.
26103 (MethodCore.LabelParameters): Move here the core of labeling
26106 * support.cs (ReflectionParameters.ParameterModifier,
26107 InternalParameters.ParameterModifier): Use IsByRef on the type and
26108 only return the OUT bit for these parameters instead of in/out/ref
26111 This is because I miss-understood things. The ParameterInfo.IsIn
26112 and IsOut represent whether the parameter has the [In] and [Out]
26115 2002-01-22 Miguel de Icaza <miguel@ximian.com>
26117 * ecore.cs (FieldExpr.Emit): Release temporaries.
26119 * assign.cs (LocalTemporary.Release): new function.
26121 * codegen.cs (EmitContext.GetTemporaryStorage,
26122 EmitContext.FreeTemporaryStorage): Rework the way we deal with
26123 temporary storage. Now we can "put back" localbuilders when we
26126 2002-01-21 Miguel de Icaza <miguel@ximian.com>
26128 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
26129 need to make a copy of the variable to generate verifiable code.
26131 2002-01-19 Miguel de Icaza <miguel@ximian.com>
26133 * driver.cs: Compute dynamically the system directory.
26135 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
26136 Slower, but more generally useful. Used by the abstract
26137 registering implementation.
26139 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
26140 the rules for the special rule on Type/instances. First check if
26141 we have the same name, and if so, try that special static path
26142 rather than the instance path.
26144 2002-01-18 Miguel de Icaza <miguel@ximian.com>
26146 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
26149 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
26150 Enum, ValueType, Delegate or Array for non-corlib compiles.
26152 * cs-tokenizer.cs: Catch long identifiers (645)
26154 * typemanager.cs (IndexerPropetyName): Ravi never tested this
26157 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
26158 fix, we were returning too early, so we were not registering
26159 pending methods from abstract classes.
26161 Do not register pending methods if the class is abstract.
26163 * expression.cs (Conditional.DoResolve): Report circular implicit
26164 conversions when we neecd to compute it for conditional
26167 (Is.DoResolve): If the expression is always of the provided type,
26168 flag warning 183. If the expression can not ever be of the
26169 provided type flag warning 184.
26171 * class.cs: Catch 169 as well.
26173 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
26176 2002-01-18 Nick Drochak <ndrochak@gol.com>
26178 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
26180 2002-01-17 Miguel de Icaza <miguel@ximian.com>
26182 * interface.cs: (PopulateMethod): Check for pointers being defined
26183 only if the unsafe context is active.
26184 (PopulateProperty): ditto.
26185 (PopulateIndexer): ditto.
26187 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
26188 specified. If pointers are present, make sure that they are
26189 present in an unsafe context.
26190 (Constructor, Constructor.Define): ditto.
26191 (Field, Field.Define): ditto.
26192 (Property, Property.Define): ditto.
26193 (Event, Event.Define): ditto.
26195 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
26196 hashtable if there are classes or structs defined.
26198 * expression.cs (LocalVariableReference.DoResolve): Simplify this
26199 code, as the constant resolution moved.
26201 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
26202 the metadata, so we can flag error 133.
26204 * decl.cs (MemberCore.UnsafeOK): New function to test that a
26205 pointer is being declared in an unsafe context.
26207 2002-01-16 Miguel de Icaza <miguel@ximian.com>
26209 * modifiers.cs (Modifiers.Check): Require a Location argument.
26210 Report error 227 for Unsafe use.
26212 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
26214 * statement.cs (For.Emit): If the test is null, then report that
26215 we do `return', as we wont reach anything afterwards.
26217 (Switch.SwitchGoverningType): Track the expression that matched
26220 * driver.cs: Allow negative numbers as an error code to flag.
26222 * cs-parser.jay: Handle 1551.
26224 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
26226 2002-01-15 Miguel de Icaza <miguel@ximian.com>
26228 * cs-parser.jay: Report 1518 (type declaration can only contain
26229 class, struct, interface, enum or delegate)
26231 (switch_label): Report 1523 (keywords `case' or `default' must
26234 (opt_switch_sections): Report 1522 (empty switch)
26236 * driver.cs: Report 1515 (response file specified multiple times)
26237 Report 1516 (Source file specified multiple times).
26239 * expression.cs (Argument.Resolve): Signal 1510
26241 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
26242 access not allowed in static code)
26244 2002-01-11 Ravi Pratap <ravi@ximian.com>
26246 * typemanager.cs (IsPointerType): Utility method which we are going
26249 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
26250 the object type, so we take care of that.
26252 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
26254 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
26255 added to non-params parameters :-)
26257 * typemanager.cs (CSharpName): Include 'void' type too.
26259 (void_ptr_type): Include in the set of core types.
26261 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
26264 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
26267 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
26268 completely forgotten about it.
26270 2002-01-10 Ravi Pratap <ravi@ximian.com>
26272 * cs-parser.jay (pointer_type): Add. This begins our implementation
26273 of parsing rules for unsafe code.
26275 (unsafe_statement): Implement.
26277 (embedded_statement): Modify to include the above.
26279 * statement.cs (Unsafe): Implement new class for unsafe blocks.
26281 * codegen.cs (EmitContext.InUnsafe): Add. This determines
26282 if the current context is an unsafe one.
26284 * cs-parser.jay (local_variable_pointer_type): Since local variable types
26285 are handled differently, we need separate rules for them.
26287 (local_variable_declaration): Update to use local_variable_pointer_type
26288 to allow variable declarations of unmanaged pointer types.
26290 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
26291 in unsafe contexts.
26293 * ../errors/cs0214.cs : Add.
26295 2002-01-16 Nick Drochak <ndrochak@gol.com>
26297 * makefile: remove 'response' file when cleaning.
26299 2002-01-15 Miguel de Icaza <miguel@ximian.com>
26301 * cs-parser.jay: Report 1524.
26303 2002-01-14 Miguel de Icaza <miguel@ximian.com>
26305 * typemanager.cs (RegisterMethod): drop checking if we have
26306 registered this from here
26308 2002-01-12 Miguel de Icaza <miguel@ximian.com>
26310 * class.cs (Method.EmitDestructor): Implement calling our base
26313 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
26314 value of InFinally.
26316 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
26317 this routine and will wrap the call in a try/catch block. Deal
26320 2002-01-11 Miguel de Icaza <miguel@ximian.com>
26322 * ecore.cs (Expression.MemberLookup): instead of taking a
26323 parameter `same_type' that was used to tell whether we could
26324 access private members we compute our containing type from the
26327 (FieldExpr): Added partial support for volatile fields. This does
26328 not work for volatile fields exposed from assemblies, as I can not
26329 figure out how to extract the modreq from it.
26331 Updated all the source files to use this.
26333 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
26334 because it is referenced by MemberLookup very often.
26336 2002-01-09 Ravi Pratap <ravi@ximian.com>
26338 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
26339 TypeBuilder.GetCustomAttributes to retrieve what we need.
26341 Get rid of redundant default_member_attr_type as this is the same as
26342 default_member_type which already exists.
26344 * interface.cs, attribute.cs : Update accordingly.
26346 2002-01-08 Miguel de Icaza <miguel@ximian.com>
26348 * typemanager.cs: Enable IndexerPropertyName again. It does not
26349 work for TYpeBuilders though. Ravi, can you please fix this?
26351 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
26353 * expression.cs (Argument.Emit): Handle the case of ref objects
26354 being passed to ref functions;
26356 (ParameterReference.EmitLoad): Loads the content of the pointer
26357 without dereferencing.
26359 2002-01-07 Miguel de Icaza <miguel@ximian.com>
26361 * cs-tokenizer.cs: Implemented the pre-processing expressions.
26363 2002-01-08 Ravi Pratap <ravi@ximian.com>
26365 * class.cs (Indexer.DefineMethod): Incorporate the interface
26366 type in the name of the method if we are doing explicit interface
26369 * expression.cs (ConversionExists): Remove as it is completely obsolete.
26371 (BetterConversion): Fix extremely trivial bug where we were referring to
26372 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
26375 * ../errors/bug16.cs : Add although we have fixed it.
26377 2002-01-07 Miguel de Icaza <miguel@ximian.com>
26379 * expression.cs (BaseIndexer): Begin implementation.
26381 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
26383 * cs-parser.jay (indexer_declarator): Use qualified_identifier
26384 production directly to remove a shift/reduce, and implement
26385 explicit interface implementation.
26387 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
26388 after a floating point suffix.
26390 * expression.cs (DoNumericPromotions): Improved the conversion for
26391 uint/uint. If we have a constant, we avoid doing a typecast to a
26394 * class.cs (Indexer): Implement explicit interface implementation
26397 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
26399 * class.cs: make the default instance constructor public and hidebysig.
26401 2001-01-03 Ravi Pratap <ravi@ximian.com>
26403 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
26404 so we can call it from elsewhere.
26406 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
26407 we emit it internally if the class has a defined indexer; otherwise the user
26408 emits it by decorating the class definition with the DefaultMemberAttribute.
26410 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
26411 attribute is not used on a type which defines an indexer.
26413 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
26414 character when we skip whitespace.
26416 * ../errors/cs0646.cs : Add.
26418 2002-01-03 Miguel de Icaza <miguel@ximian.com>
26420 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
26423 * makefile: Add practical target `mcs3.exe' which builds the third
26424 generation compiler.
26426 * expression.cs (New): Fix structures constructor calling.
26428 * class.cs (Property, Method, Indexer): Emit Final flag on the
26429 method if we are an interface implementation and we are not
26432 * ecore.cs (PropertyExpr): New public field `IsBase', tells
26433 whether this property is referencing a `base' method.
26435 * expression.cs (Invocation.EmitCall): take an extra argument:
26436 is_base, this is used to determine whether the `call' or
26437 `callvirt' opcode should be used.
26440 * delegate.cs: update EmitCall.
26442 * class.cs (Method.Define): Set NewSlot for the cases where we are
26443 not implementing an interface method.
26445 (Property.Define): ditto.
26447 2002-01-02 Miguel de Icaza <miguel@ximian.com>
26449 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
26450 'r'. Allows mcs to parse itself fully.
26452 2002-01-02 Ravi Pratap <ravi@ximian.com>
26454 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
26455 of the number of initializers that require the InitializeArray method.
26457 (CheckIndices): Store the Expression in all cases - not the plain value. Also
26458 update the above field where necessary.
26460 (MakeByteBlob): Update accordingly.
26462 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
26465 (EmitDynamicInitializers): Update in accordance with the new optimization.
26467 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
26468 same OpCode applies.
26470 * cs-parser.jay : Fix some glaring errors I introduced.
26472 2002-01-01 Ravi Pratap <ravi@ximian.com>
26474 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
26475 so that we can check for name clashes there too.
26477 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
26478 for interface indexers.
26480 * interfaces.cs (Define): Emit the default member attribute.
26482 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
26483 variable was being referred to while setting the value ;-)
26485 2002-01-01 Miguel de Icaza <miguel@ximian.com>
26487 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
26488 byte-by-byte information when we know the data is zero.
26490 Make the block always a multiple of 4, because
26491 DefineInitializedData has a bug.
26493 * assign.cs: Fix, we should assign from the temporary, not from
26496 * expression.cs (MakeByteBlob): Fix my incorrect code.
26498 2001-12-31 Miguel de Icaza <miguel@ximian.com>
26500 * typemanager.cs (EnumToUnderlying): This function is used to get
26501 the underlying type from an enumeration, because it does not
26504 * constant.cs: Use the I4_S form for values between -128 and 127.
26506 * statement.cs (Block.LookupLabel): Looks up a label.
26507 (Block): Drop support for labeled blocks.
26509 (LabeledStatement): New kind of statement that represents a label
26512 (Goto): Finally implement this bad boy.
26514 * cs-parser.jay: Update to reflect new mechanism to implement
26517 2001-12-30 Miguel de Icaza <miguel@ximian.com>
26519 * codegen.cs (EmitContext.This): a codegen property that keeps the
26520 a single instance of this instead of creating many different this
26523 * delegate.cs (Delegate.DoResolve): Update to use the property;
26525 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
26527 * expression.cs (BaseAccess.DoResolve): Ditto.
26529 2001-12-29 Ravi Pratap <ravi@ximian.com>
26531 * typemanager.cs (methodimpl_attr_type): Add to hold the type
26532 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
26534 (InitCoreTypes): Update accordingly.
26536 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
26537 so we can quickly store the state.
26539 (ApplyAttributes): Set the correct implementation flags
26540 for InternalCall methods.
26542 2001-12-29 Miguel de Icaza <miguel@ximian.com>
26544 * expression.cs (EmitCall): if a method is not virtual, then do
26545 not use callvirt on it.
26547 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
26548 user defined stuff) requires the use of stobj, which takes an
26549 address on the stack instead of an array and an index. So emit
26550 the Ldelema operation for it.
26552 (EmitStoreOpcode): Use stobj for valuetypes.
26554 (UnaryMutator.EmitCode): Use the right 1 value depending on
26555 whether we are dealing with int64/uint64, float or doubles.
26557 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
26558 constructors that I implemented last night.
26560 (Constructor.IsDefault): Fix to work properly for static
26563 * cs-parser.jay (CheckDef): report method signature errors.
26564 Update error number 103 to be 132.
26566 * decl.cs: New AdditionResult enumeration value: MethodExists.
26567 Although we do this check for methods later on in the semantic
26568 analysis, catching repeated default constructors is so easy that
26569 we catch these here.
26571 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
26574 (ParameterReference.EmitAssign, Emit): handle
26577 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
26578 (ArrayAccess.EmitStoreOpcode): ditto.
26580 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
26582 * expression.cs (MakeByteBlob): Complete all the missing types
26583 (uint, short, ushort, byte, sbyte)
26585 * class.cs: Only init instance field initializers on instance
26588 Rename `constructors' to instance_constructors.
26590 (TypeContainer.AddConstructor): Only add constructors to the list
26591 if it is not static.
26593 Make sure that we handle default_static_constructor independently
26594 everywhere where we handle instance_constructors
26596 2001-12-28 Miguel de Icaza <miguel@ximian.com>
26598 * class.cs: Do not lookup or create a base initializer for a
26599 static constructor.
26601 (ConstructorInitializer.Resolve): use the proper type to lookup
26604 * cs-parser.jay: Report error 1585 (modifiers between type and name).
26606 * enum.cs, interface.cs: Remove CloseType, this is taken care by
26609 * decl.cs: CloseType is now an virtual method, the default
26610 implementation just closes this type.
26612 2001-12-28 Ravi Pratap <ravi@ximian.com>
26614 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
26615 to PreserveSig by default. Also emit HideBySig on such methods.
26617 Basically, set the defaults to standard values.
26619 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
26620 argument, if candidate is better, it can't be worse than the best !
26622 (Invocation): Re-write bits to differentiate between methods being
26623 applicable in their expanded form and their normal form - for params
26626 Get rid of use_standard everywhere as only standard conversions are allowed
26627 in overload resolution.
26629 More spec conformance.
26631 2001-12-27 Miguel de Icaza <miguel@ximian.com>
26633 * driver.cs: Add --timestamp, to see where the compiler spends
26636 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
26637 `this' in static code.
26639 (SimpleName.DoResolve): Implement in terms of a helper function
26640 that allows static-references to be passed upstream to
26643 (Expression.ResolveWithSimpleName): Resolve specially simple
26644 names when called by MemberAccess to implement the special
26647 (Expression.ImplicitReferenceConversion): Handle conversions from
26648 Null to reference types before others, as Null's type is
26651 * expression.cs (Invocation.EmitCall): Handle the special case of
26652 calling methods declared on a reference type from a ValueType
26653 (Base classes System.Object and System.Enum)
26655 (MemberAccess.Resolve): Only perform lookups on Enumerations if
26656 the left hand side is a TypeExpr, not on every enumeration.
26658 (Binary.Resolve): If types are reference types, then do a cast to
26659 object on operators != and == of both arguments.
26661 * typemanager.cs (FindMembers): Extract instance and static
26662 members if requested.
26664 * interface.cs (PopulateProperty): Use void_type instead of null
26665 as the return type for the setter method.
26667 (PopulateIndexer): ditto.
26669 2001-12-27 Ravi Pratap <ravi@ximian.com>
26671 * support.cs (ReflectionParameters): Fix minor bug where we
26672 were examining the wrong parameter for the ParamArray attribute.
26674 Cope with requests for the type of the parameter at position
26675 greater than the params parameter's. We now return the element
26676 type of the params array as that makes more sense.
26678 * expression.cs (Invocation.IsParamsMethodApplicable): Update
26679 accordingly as we no longer have to extract the element type
26682 (Invocation.OverloadResolve): Update.
26684 2001-12-27 Miguel de Icaza <miguel@ximian.com>
26686 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
26687 against IEnumerator, test whether the return value is a descendant
26688 of the IEnumerator interface.
26690 * class.cs (Indexer.Define): Use an auxiliary method to implement
26691 the other bits of the method definition. Begin support for
26692 explicit interface implementation.
26694 (Property.DefineMethod): Use TypeManager.void_type instead of null
26695 for an empty return value.
26697 2001-12-26 Miguel de Icaza <miguel@ximian.com>
26699 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
26700 dealing with a FieldExpr which is composed of a FieldBuilder, in
26701 the code path we did extract the constant, but we should have
26702 obtained the underlying value to be able to cast it (otherwise we
26703 end up in an infinite loop, this is what Ravi was running into).
26705 (ArrayCreation.UpdateIndices): Arrays might be empty.
26707 (MemberAccess.ResolveMemberAccess): Add support for section
26708 14.5.4.1 that deals with the special case of E.I when E is a type
26709 and something else, that I can be a reference to a static member.
26711 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
26712 handle a particular array type to create byte blobs, it is just
26713 something we dont generate byteblobs for.
26715 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
26718 * location.cs (Push): remove the key from the hashtable that we
26719 are about to add. This happens for empty files.
26721 * driver.cs: Dispose files after we have parsed them.
26723 (tokenize): new function that only runs the tokenizer on its
26724 input, for speed testing.
26726 2001-12-26 Ravi Pratap <ravi@ximian.com>
26728 * class.cs (Event.Define): Define the private field only if there
26729 are no accessors defined.
26731 * expression.cs (ResolveMemberAccess): If there is no associated
26732 field with the event, that means we have an event defined with its
26733 own accessors and we should flag error cs0070 since transforming
26734 ourselves into a field is not valid in that case.
26736 * ecore.cs (SimpleName.DoResolve): Same as above.
26738 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
26739 and charset to sane values.
26741 2001-12-25 Ravi Pratap <ravi@ximian.com>
26743 * assign.cs (DoResolve): Perform check on events only if they
26744 are being accessed outside the declaring type.
26746 * cs-parser.jay (event_declarations): Update rules to correctly
26747 set the type of the implicit parameter etc.
26749 (add_accessor, remove_accessor): Set current local parameters.
26751 * expression.cs (Binary): For delegate addition and subtraction,
26752 cast the return value from the method into the appropriate delegate
26755 2001-12-24 Ravi Pratap <ravi@ximian.com>
26757 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
26758 of these as the workaround is unnecessary.
26760 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
26761 delegate data - none of that is needed at all.
26763 Re-write bits to extract the instance expression and the delegate method
26766 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
26769 * attribute.cs (ApplyAttributes): New method to take care of common tasks
26770 of attaching attributes instead of duplicating code everywhere.
26772 * everywhere : Update code to do attribute emission using the above method.
26774 2001-12-23 Miguel de Icaza <miguel@ximian.com>
26776 * expression.cs (IsParamsMethodApplicable): if there are not
26777 parameters, return immediately.
26779 * ecore.cs: The 0 literal can be implicity converted to an enum
26782 (SimpleName.DoResolve): First lookup the type, then lookup the
26785 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
26786 want to get its address. If the InstanceExpression is not
26787 addressable, store the result in a temporary variable, then get
26790 * codegen.cs: Only display 219 errors on warning level or above.
26792 * expression.cs (ArrayAccess): Make it implement the
26793 IMemoryLocation interface.
26795 (Binary.DoResolve): handle the operator == (object a, object b)
26796 and operator != (object a, object b) without incurring into a
26797 BoxedCast (because 5 != o should never be performed).
26799 Handle binary enumerator operators.
26801 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
26802 value type, otherwise use Ldelem_ref.
26804 Use precomputed names;
26806 (AddressOf): Implement address of
26808 * cs-parser.jay (labeled_statement): Fix recursive block
26809 addition by reworking the production.
26811 * expression.cs (New.DoEmit): New has a special case:
26813 If we are dealing with a ValueType, we have a few
26814 situations to deal with:
26816 * The target of New is a ValueType variable, that is
26817 easy, we just pass this as the variable reference
26819 * The target of New is being passed as an argument,
26820 to a boxing operation or a function that takes a
26823 In this case, we need to create a temporary variable
26824 that is the argument of New.
26827 2001-12-23 Ravi Pratap <ravi@ximian.com>
26829 * rootcontext.cs (LookupType): Check that current_type is not null before
26830 going about looking at nested types.
26832 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
26833 not implement the IAssignMethod interface any more.
26835 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
26836 where we tranform them into FieldExprs if they are being resolved from within
26837 the declaring type.
26839 * ecore.cs (SimpleName.DoResolve): Do the same here.
26841 * assign.cs (DoResolve, Emit): Clean up code considerably.
26843 * ../errors/bug10.cs : Add.
26845 * ../errors/cs0070.cs : Add.
26847 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
26849 * assign.cs : Get rid of EventIsLocal everywhere.
26851 2001-12-23 Miguel de Icaza <miguel@ximian.com>
26853 * ecore.cs (ConvertIntLiteral): finished the implementation.
26855 * statement.cs (SwitchLabel): Convert the value we are using as a
26856 key before looking up the table.
26858 2001-12-22 Miguel de Icaza <miguel@ximian.com>
26860 * codegen.cs (EmitTopBlock): Require a Location argument now.
26862 * cs-parser.jay (constructor_declarator): We need to setup
26863 current_local_parameters before we parse the
26864 opt_constructor_initializer, to allow the variables to be bound
26865 to the constructor arguments.
26867 * rootcontext.cs (LookupType): First lookup nested classes in our
26868 class and our parents before we go looking outside our class.
26870 * expression.cs (ConstantFold): Extract/debox the values at the
26873 * rootcontext.cs (EmitCode): Resolve the constants first before we
26874 resolve the types. This is not really needed, but it helps debugging.
26876 * statement.cs: report location.
26878 * cs-parser.jay: pass location to throw statement.
26880 * driver.cs: Small bug fix.
26882 * report.cs: Updated format to be 4-zero filled digits.
26884 2001-12-22 Ravi Pratap <ravi@ximian.com>
26886 * expression.cs (CheckIndices): Fix minor bug where the wrong
26887 variable was being referred to ;-)
26889 (DoEmit): Do not call EmitStaticInitializers when the
26890 underlying type is System.Object.
26892 2001-12-21 Ravi Pratap <ravi@ximian.com>
26894 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
26895 and do the usual workaround for SRE.
26897 * class.cs (MyEventBuilder.EventType): New member to get at the type
26898 of the event, quickly.
26900 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
26902 * assign.cs (Assign.DoResolve): Handle the case when the target
26903 is an EventExpr and perform the necessary checks.
26905 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
26908 (SimpleName.MemberStaticCheck): Include check for EventExpr.
26910 (EventExpr): Set the type in the constructor itself since we
26911 are meant to be born fully resolved.
26913 (EventExpr.Define): Revert code I wrote earlier.
26915 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
26916 instance expression is null. The instance expression is a This in that case
26917 or a null, depending on whether it is a static method or not.
26919 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
26920 refers to more than one method.
26922 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
26923 and accordingly flag errors.
26925 2001-12-21 Miguel de Icaza <miguel@ximian.com>
26927 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
26929 2001-12-22 Miguel de Icaza <miguel@ximian.com>
26931 * location.cs (ToString): Provide useful rutine.
26933 2001-12-21 Miguel de Icaza <miguel@ximian.com>
26935 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
26936 objects, return the actual integral boxed.
26938 * statement.cs (SwitchLabel): define an ILLabel for each
26941 (Switch.CheckSwitch): If the value is a Literal, extract
26942 the underlying literal.
26944 Also in the unused hashtable we had, add the SwitchLabel so we can
26945 quickly look this value up.
26947 * constant.cs: Implement a bunch of new constants. Rewrite
26948 Literal based on this. Made changes everywhere to adapt to this.
26950 * expression.cs (Expression.MakeByteBlob): Optimize routine by
26951 dereferencing array only once, and also copes with enumrations.
26953 bytes are two bytes wide, not one.
26955 (Cast): Perform constant conversions.
26957 * ecore.cs (TryImplicitIntConversion): Return literals instead of
26958 wrappers to the literals here.
26960 * expression.cs (DoNumericPromotions): long literals can converted
26961 to ulong implicity (this is taken care of elsewhere, but I was
26962 missing this spot).
26964 * ecore.cs (Expression.Literalize): Make the return type Literal,
26965 to improve type checking.
26967 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
26969 2001-12-20 Miguel de Icaza <miguel@ximian.com>
26971 * literal.cs: Revert code from ravi that checked the bounds. The
26972 bounds are sane by the definition of the type itself.
26974 * typemanager.cs: Fix implementation of ImplementsInterface. We
26975 need to actually look up in our parent hierarchy for interfaces
26978 * const.cs: Use the underlying type for enumerations
26980 * delegate.cs: Compute the basename for the delegate creation,
26981 that should fix the delegate test case, and restore the correct
26982 Type Lookup semantics in rootcontext
26984 * rootcontext.cs: Revert Ravi's last patch. The correct way of
26985 referencing a nested type with the Reflection API is using the "+"
26988 * cs-parser.jay: Do not require EOF token at the end.
26990 2001-12-20 Ravi Pratap <ravi@ximian.com>
26992 * rootcontext.cs (LookupType): Concatenate type names with
26993 a '.' instead of a '+' The test suite passes again.
26995 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
26996 field of the enumeration.
26998 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
26999 the case when the member is an EventExpr.
27001 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
27002 static has an associated instance expression.
27004 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
27006 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
27008 * class.cs (Event.Define): Register event and perform appropriate checks
27011 We define the Add and Remove methods even if the use provides none because
27012 in that case, we provide default implementations ourselves.
27014 Define a private field of the type of the event. This is done by the CSC compiler
27015 and we should be doing it too ;-)
27017 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
27018 More methods we use in code we generate.
27020 (multicast_delegate_type, delegate_type): Two separate types since the distinction
27023 (InitCoreTypes): Update accordingly for the above.
27025 * class.cs (Event.Emit): Generate code for default accessors that we provide
27027 (EmitDefaultMethod): Do the job in the above.
27029 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
27032 2001-12-20 Miguel de Icaza <miguel@ximian.com>
27034 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
27035 builders even if we were missing one.
27037 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
27038 pass the Basename as our class name instead of the Name. The
27039 basename will be correctly composed for us.
27041 * parameter.cs (Paramters): Now takes a Location argument.
27043 * decl.cs (DeclSpace.LookupType): Removed convenience function and
27044 make all the code call directly LookupType in RootContext and take
27045 this chance to pass the Location information everywhere.
27047 * Everywhere: pass Location information.
27049 2001-12-19 Miguel de Icaza <miguel@ximian.com>
27051 * class.cs (Constructor.Define): Updated way of detecting the
27052 length of the parameters.
27054 (TypeContainer.DefineType): Use basename as the type name for
27057 (TypeContainer.Define): Do not recursively define types here, as
27058 definition is taken care in order by the RootContext.
27060 * tree.cs: Keep track of namespaces in a per-file basis.
27062 * parameter.cs (Parameter.ComputeSignature): Update to use
27065 (Parameters.GetSignature): ditto.
27067 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
27068 instead of a TypeContainer.
27070 (Interface.SemanticAnalysis): Use `this' instead of our parent to
27071 resolve names. Because we need to be resolve in our context, not
27074 * driver.cs: Implement response files.
27076 * class.cs (TypeContainer.DefineType): If we are defined, do not
27077 redefine ourselves.
27079 (Event.Emit): Emit the code for add/remove handlers.
27080 (Event.Define): Save the MethodBuilders for add/remove.
27082 * typemanager.cs: Use pair here too.
27084 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
27085 DictionaryEntry requires the first argument to be non-null.
27087 (enum_declaration): Compute full name for registering the
27090 (delegate_declaration): Instead of using
27091 formal_parameter_list, use opt_formal_parameter_list as the list
27094 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
27095 (EventParsing): New property that controls whether `add' and
27096 `remove' are returned as tokens or identifiers (for events);
27098 2001-12-19 Ravi Pratap <ravi@ximian.com>
27100 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
27101 use MyEventBuilder only and let it wrap the real builder for us.
27103 (MyEventBuilder): Revamp constructor etc.
27105 Implement all operations that we perform on EventBuilder in precisely the same
27108 (FindMembers): Update to use the EventBuilder member.
27110 (Event.Emit): Update accordingly.
27112 2001-12-18 Ravi Pratap <ravi@ximian.com>
27114 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
27115 by calling the appropriate methods.
27117 (GetCustomAttributes): Make stubs as they cannot possibly do anything
27120 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
27122 2001-12-17 Ravi Pratap <ravi@ximian.com>
27124 * delegate.cs (Delegate.Populate): Check that the return type
27125 and various parameters types are indeed accessible.
27127 * class.cs (Constructor.Define): Same here.
27129 (Field.Define): Ditto.
27131 (Event.Define): Ditto.
27133 (Operator.Define): Check that the underlying Method defined itself
27134 correctly - so it's MethodBuilder should not be null.
27136 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
27137 expression happens to be null.
27139 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
27140 members but as of now we don't seem to be able to do anything really useful with it.
27142 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
27143 not the EventBuilder.
27145 2001-12-18 Miguel de Icaza <miguel@ximian.com>
27147 * cs-tokenizer.cs: Add support for defines.
27148 Add support for #if, #elif, #else, #endif
27150 (eval_var): evaluates a variable.
27151 (eval): stubbed for evaluating functions.
27153 * cs-parser.jay: Pass the defines information
27155 * driver.cs: Add --define command line option.
27157 * decl.cs: Move MemberCore here.
27159 Make it the base class for DeclSpace. This allows us to catch and
27160 report 108 and 109 for everything now.
27162 * class.cs (TypeContainer.Define): Extract all the members
27163 before populating and emit the warning 108 (new keyword required
27164 to override) instead of having each member implement this.
27166 (MemberCore.Define): New abstract method, we will be using this in
27167 the warning reporting engine in Populate.
27169 (Operator.Define): Adjust to new MemberCore protocol.
27171 * const.cs (Const): This does not derive from Expression, it is a
27172 temporary object we use to create fields, it is a MemberCore.
27174 * class.cs (Method.Define): Allow the entry point to be in a
27177 * driver.cs: Rewrite the argument handler to clean it up a bit.
27179 * rootcontext.cs: Made it just an auxiliary namespace feature by
27180 making everything static.
27182 * driver.cs: Adapt code to use RootContext type name instead of
27185 * delegate.cs: Remove RootContext argument.
27187 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
27190 * class.cs (Event.Define): The lookup can fail.
27192 * cs-tokenizer.cs: Begin implementation of pre-procesor.
27194 * expression.cs: Resolve the this instance before invoking the code.
27196 2001-12-17 Miguel de Icaza <miguel@ximian.com>
27198 * cs-parser.jay: Add a production in element_access that allows
27199 the thing to become a "type" reference. This way we can parse
27200 things like "(string [])" as a type.
27202 Note that this still does not handle the more complex rules of
27206 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
27208 * ecore.cs: (CopyNewMethods): new utility function used to
27209 assemble the list of methods from running FindMembers.
27211 (MemberLookup): Rework FindMembers so that
27213 2001-12-16 Miguel de Icaza <miguel@ximian.com>
27215 * class.cs (TypeContainer): Remove Delegates who fail to be
27218 * delegate.cs (Populate): Verify that we dont get null return
27219 values. TODO: Check for AsAccessible.
27221 * cs-parser.jay: Use basename to emit error 574 (destructor should
27222 have the same name as container class), not the full name.
27224 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
27225 possible representation.
27227 Also implements integer type suffixes U and L.
27229 2001-12-15 Miguel de Icaza <miguel@ximian.com>
27231 * expression.cs (ArrayCreation.DoResolve): We need to do the
27232 argument resolution *always*.
27234 * decl.cs: Make this hold the namespace. Hold the root context as
27236 (LookupType): Move here.
27238 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
27240 * location.cs (Row, Name): Fixed the code, it was always returning
27241 references to the first file.
27243 * interface.cs: Register properties defined through interfaces.
27245 * driver.cs: Add support for globbing on the command line
27247 * class.cs (Field): Make it derive from MemberCore as well.
27250 2001-12-15 Ravi Pratap <ravi@ximian.com>
27252 * class.cs (Event::Define): Check that the type of the event is a delegate
27253 type else flag error #66.
27255 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
27258 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
27259 values of EntryPoint, CharSet etc etc.
27261 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
27263 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
27264 be null and we should ignore this. I am not sure if this is really clean. Apparently,
27265 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
27266 which needs this to do its work.
27268 * ../errors/cs0066.cs : Add.
27270 2001-12-14 Miguel de Icaza <miguel@ximian.com>
27272 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
27275 * class.cs: (MethodSignature.MethodSignature): Removed hack that
27276 clears out the parameters field.
27277 (MemberSignatureCompare): Cleanup
27279 (MemberCore): New base class used to share code between MethodCore
27282 (RegisterRequiredImplementations) BindingFlags.Public requires
27283 either BindingFlags.Instace or Static. Use instance here.
27285 (Property): Refactored code to cope better with the full spec.
27287 * parameter.cs (GetParameterInfo): Return an empty array instead
27290 * class.cs (Property): Abstract or extern properties have no bodies.
27292 * parameter.cs (GetParameterInfo): return a zero-sized array.
27294 * class.cs (TypeContainer.MethodModifiersValid): Move all the
27295 method modifier validation to the typecontainer so we can reuse
27296 this on properties.
27298 (MethodCore.ParameterTypes): return an empty sized array of types.
27300 (Property.Define): Test property modifier validity.
27302 Add tests for sealed/override too.
27304 (Method.Emit): abstract or extern methods have no bodies.
27306 2001-12-14 Ravi Pratap <ravi@ximian.com>
27308 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
27311 (Method::Define, ::Emit): Modify accordingly.
27313 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
27315 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
27317 * makefile: Pass in /unsafe.
27319 2001-12-13 Miguel de Icaza <miguel@ximian.com>
27321 * class.cs (MakeKey): Kill routine.
27323 * class.cs (TypeContainer.Define): Correctly define explicit
27324 method implementations (they require the full interface name plus
27327 * typemanager.cs: Deply the PtrHashtable here and stop using the
27328 lame keys. Things work so much better.
27330 This of course broke everyone who depended on `RegisterMethod' to
27331 do the `test for existance' test. This has to be done elsewhere.
27333 * support.cs (PtrHashtable): A hashtable that avoid comparing with
27334 the object stupid Equals method (because, that like fails all over
27335 the place). We still do not use it.
27337 * class.cs (TypeContainer.SetRequiredInterface,
27338 TypeContainer.RequireMethods): Killed these two routines and moved
27339 all the functionality to RegisterRequiredImplementations.
27341 (TypeContainer.RegisterRequiredImplementations): This routine now
27342 registers all the implementations required in an array for the
27343 interfaces and abstract methods. We use an array of structures
27344 which can be computed ahead of time to reduce memory usage and we
27345 also assume that lookups are cheap as most classes will not
27346 implement too many interfaces.
27348 We also avoid creating too many MethodSignatures.
27350 (TypeContainer.IsInterfaceMethod): Update and optionally does not
27351 clear the "pending" bit if we find that there are problems with
27354 (TypeContainer.VerifyPendingMethods): Update to report errors of
27355 methods that look like implementations but are not.
27357 (TypeContainer.Define): Add support for explicit interface method
27360 2001-12-12 Miguel de Icaza <miguel@ximian.com>
27362 * typemanager.cs: Keep track of the parameters here instead of
27363 being a feature of the TypeContainer.
27365 * class.cs: Drop the registration of parameters here, as
27366 InterfaceMethods are also interface declarations.
27368 * delegate.cs: Register methods with the TypeManager not only with
27369 the TypeContainer. This code was buggy.
27371 * interface.cs: Full registation here.
27373 2001-12-11 Miguel de Icaza <miguel@ximian.com>
27375 * expression.cs: Remove reducer for binary expressions, it can not
27378 * const.cs: Put here the code that used to go into constant.cs
27380 * constant.cs: Put here the code for constants, this is a new base
27381 class for Literals.
27383 * literal.cs: Make Literal derive from Constant.
27385 2001-12-09 Miguel de Icaza <miguel@ximian.com>
27387 * statement.cs (Return.Emit): Report error 157 if the user
27388 attempts to return from a finally block.
27390 (Return.Emit): Instead of emitting a return, jump to the end of
27393 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
27394 LocalBuilder to store the result of the function. ReturnLabel is
27395 the target where we jump.
27398 2001-12-09 Radek Doulik <rodo@ximian.com>
27400 * cs-parser.jay: remember alias in current namespace
27402 * ecore.cs (SimpleName::DoResolve): use aliases for types or
27405 * class.cs (LookupAlias): lookup alias in my_namespace
27407 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
27409 (LookupAlias): lookup alias in this and if needed in parent
27412 2001-12-08 Miguel de Icaza <miguel@ximian.com>
27416 * rootcontext.cs: (ModuleBuilder) Made static, first step into
27417 making things static. I need this to avoid passing the
27418 TypeContainer when calling ParameterType.
27420 * support.cs (InternalParameters.ParameterType): Remove ugly hack
27421 that did string manipulation to compute the type and then call
27422 GetType. Use Parameter.ParameterType instead.
27424 * cs-tokenizer.cs: Consume the suffix for floating values.
27426 * expression.cs (ParameterReference): figure out whether this is a
27427 reference parameter or not. Kill an extra variable by computing
27428 the arg_idx during emission.
27430 * parameter.cs (Parameters.GetParameterInfo): New overloaded
27431 function that returns whether a parameter is an out/ref value or not.
27433 (Parameter.ParameterType): The type of the parameter (base,
27434 without ref/out applied).
27436 (Parameter.Resolve): Perform resolution here.
27437 (Parameter.ExternalType): The full type (with ref/out applied).
27439 * statement.cs (Using.Emit, Using.EmitExpression): Implement
27440 support for expressions on the using statement.
27442 2001-12-07 Miguel de Icaza <miguel@ximian.com>
27444 * statement.cs (Using.EmitLocalVariableDecls): Split the
27445 localvariable handling of the using statement.
27447 (Block.EmitMeta): Keep track of variable count across blocks. We
27448 were reusing slots on separate branches of blocks.
27450 (Try.Emit): Emit the general code block, we were not emitting it.
27452 Check the type of the declaration to be an IDisposable or
27453 something that can be implicity converted to it.
27455 Emit conversions if required.
27457 * ecore.cs (EmptyExpression): New utility class.
27458 (Expression.ImplicitConversionExists): New utility function.
27460 2001-12-06 Miguel de Icaza <miguel@ximian.com>
27462 * statement.cs (Using): Implement.
27464 * expression.cs (LocalVariableReference): Support read only variables.
27466 * statement.cs: Remove the explicit emit for the Leave opcode.
27467 (VariableInfo): Add a readonly field.
27469 2001-12-05 Miguel de Icaza <miguel@ximian.com>
27471 * ecore.cs (ConvCast): new class used to encapsulate the various
27472 explicit integer conversions that works in both checked and
27473 unchecked contexts.
27475 (Expression.ConvertNumericExplicit): Use new ConvCast class to
27476 properly generate the overflow opcodes.
27478 2001-12-04 Miguel de Icaza <miguel@ximian.com>
27480 * statement.cs: The correct type for the EmptyExpression is the
27481 element_type, not the variable type. Ravi pointed this out.
27483 2001-12-04 Ravi Pratap <ravi@ximian.com>
27485 * class.cs (Method::Define): Handle PInvoke methods specially
27486 by using DefinePInvokeMethod instead of the usual one.
27488 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
27489 above to do the task of extracting information and defining the method.
27491 2001-12-04 Ravi Pratap <ravi@ximian.com>
27493 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
27494 of the condition for string type.
27496 (Emit): Move that here.
27498 (ArrayCreation::CheckIndices): Keep string literals in their expression
27501 (EmitDynamicInitializers): Handle strings appropriately.
27503 2001-12-04 Miguel de Icaza <miguel@ximian.com>
27505 * codegen.cs (EmitContext): Replace multiple variables with a
27506 single pointer to the current Switch statement.
27508 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
27511 2001-12-03 Miguel de Icaza <miguel@ximian.com>
27515 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
27518 (Foreach.Emit): Foreach on arrays was not setting
27519 up the loop variables (for break/continue).
27521 (GotoCase): Semi-implented.
27523 2001-12-03 Ravi Pratap <ravi@ximian.com>
27525 * attribute.cs (CheckAttribute): Handle system attributes by using
27526 Attribute.GetAttributes to examine information we need.
27528 (GetValidPlaces): Same here.
27530 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
27532 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
27534 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
27536 (Method::Define): Set appropriate flags if we have a DllImport attribute.
27538 (Method::Emit): Handle the case when we are a PInvoke method.
27540 2001-12-03 Miguel de Icaza <miguel@ximian.com>
27542 * expression.cs: Use ResolveWithSimpleName on compound names.
27544 2001-12-02 Ravi Pratap <ravi@ximian.com>
27546 * constant.cs (EmitConstant): Make sure we resolve the associated expression
27547 before trying to reduce it.
27549 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
27551 * constant.cs (LookupConstantValue): Implement.
27553 (EmitConstant): Use the above in emitting the constant.
27555 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
27556 that are user-defined by doing a LookupConstantValue on them.
27558 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
27561 2001-11-29 Miguel de Icaza <miguel@ximian.com>
27563 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
27565 (BaseAccess.DoResolve): Implement.
27567 (MemberAccess.DoResolve): Split this routine into a
27568 ResolveMemberAccess routine that can be used independently
27570 2001-11-28 Miguel de Icaza <miguel@ximian.com>
27572 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
27573 As that share bits of the implementation. Is returns a boolean,
27574 while As returns the Type that is being probed.
27576 2001-12-01 Ravi Pratap <ravi@ximian.com>
27578 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
27579 instead of a Literal - much easier.
27581 (EnumInTransit): Remove - utterly useless :-)
27583 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
27585 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
27587 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
27588 chain when we have no associated expression.
27590 2001-11-30 Ravi Pratap <ravi@ximian.com>
27592 * constant.cs (Define): Use Location while reporting the errror.
27594 Also emit a warning when 'new' is used and there is no inherited
27597 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
27600 (LookupEnumValue): Implement to lookup an enum member's value and define it
27603 (Populate): Re-write accordingly to use the above routine.
27605 2001-11-27 Miguel de Icaza <miguel@ximian.com>
27607 * expression.cs (This): Fix prototype for DoResolveLValue to
27608 override the base class DoResolveLValue.
27610 * cs-parser.cs: Report errors cs574 and cs575 (destructor
27613 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
27614 (we need to load the address of the field here). This fixes
27617 (FieldExpr.DoResolveLValue): Call the DoResolve
27618 function to initialize the Instance expression.
27620 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
27621 correctly the GetEnumerator operation on a value type.
27623 * cs-parser.jay: Add more simple parsing error catches.
27625 * statement.cs (Switch): Add support for string switches.
27626 Handle null specially.
27628 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
27630 2001-11-28 Ravi Pratap <ravi@ximian.com>
27632 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
27634 (declare_local_constant): New helper function.
27636 * statement.cs (AddConstant): Keep a separate record of constants
27638 (IsConstant): Implement to determine if a variable is a constant.
27640 (GetConstantExpression): Implement.
27642 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
27644 * statement.cs (IsVariableDefined): Re-write.
27646 2001-11-27 Ravi Pratap <ravi@ximian.com>
27648 * class.cs (TypeContainer::FindMembers): Look for constants
27649 in the case when we are looking for MemberTypes.Field
27651 * expression.cs (MemberAccess::DoResolve): Check that in the
27652 case we are a FieldExpr and a Literal, we are not being accessed
27653 by an instance reference.
27655 * cs-parser.jay (local_constant_declaration): Implement.
27657 (declaration_statement): Implement for constant declarations.
27659 2001-11-26 Miguel de Icaza <miguel@ximian.com>
27661 * statement.cs (Switch): Catch double defaults.
27663 (Switch): More work on the switch() statement
27664 implementation. It works for integral values now, need to finish
27668 2001-11-24 Miguel de Icaza <miguel@ximian.com>
27670 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
27671 integer literals into other integer literals. To be used by
27674 2001-11-24 Ravi Pratap <ravi@ximian.com>
27676 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
27679 (EmitDynamicInitializers): Cope with the above since we extract data
27680 directly from ArrayData now.
27682 (ExpectInitializers): Keep track of whether initializers are mandatory
27685 (Bounds): Make it a hashtable to prevent the same dimension being
27686 recorded for every element in that dimension.
27688 (EmitDynamicInitializers): Fix bug which prevented the Set array method
27691 Also fix bug which was causing the indices to be emitted in the reverse
27694 2001-11-24 Miguel de Icaza <miguel@ximian.com>
27696 * expression.cs (ArrayCreation): Implement the bits that Ravi left
27697 unfinished. They do not work, because the underlying code is
27700 2001-11-22 Miguel de Icaza <miguel@ximian.com>
27702 * cs-parser.jay: Remove bogus fixme.
27704 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
27705 on Switch statement.
27707 2001-11-23 Ravi Pratap <ravi@ximian.com>
27709 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
27712 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
27713 parameter. Apparently, any expression is allowed.
27715 (ValidateInitializers): Update accordingly.
27717 (CheckIndices): Fix some tricky bugs thanks to recursion.
27719 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
27720 I was being completely brain-dead.
27722 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
27723 and re-write acordingly.
27725 (DelegateInvocation): Re-write accordingly.
27727 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
27729 (MakeByteBlob): Handle types more correctly.
27731 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
27732 initialization from expressions but it is incomplete because I am a complete
27735 2001-11-22 Miguel de Icaza <miguel@ximian.com>
27737 * statement.cs (If.Emit): Fix a bug that generated incorrect code
27738 on If. Basically, we have to return `true' (ie, we do return to
27739 our caller) only if both branches of the if return.
27741 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
27742 short-circuit operators, handle them as short circuit operators.
27744 (Cast.DoResolve): Resolve type.
27745 (Cast.Cast): Take an expression as the target type.
27747 * cs-parser.jay (cast_expression): Remove old hack that only
27748 allowed a limited set of types to be handled. Now we take a
27749 unary_expression and we resolve to a type during semantic
27752 Use the grammar productions from Rhys to handle casts (this is
27753 not complete like Rhys syntax yet, we fail to handle that corner
27754 case that C# has regarding (-x), but we will get there.
27756 2001-11-22 Ravi Pratap <ravi@ximian.com>
27758 * class.cs (EmitFieldInitializer): Take care of the case when we have a
27759 field which is an array type.
27761 * cs-parser.jay (declare_local_variables): Support array initialization too.
27763 * typemanager.cs (MakeKey): Implement.
27765 (everywhere): Use the above appropriately.
27767 * cs-parser.jay (for_statement): Update for array initialization while
27768 declaring variables.
27770 * ecore.cs : The error message was correct, it's the variable's names that
27771 were misleading ;-) Make the code more readable.
27773 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
27774 the correct type etc.
27776 (ConvertExplicit): Handle Enum types by examining the underlying type.
27778 2001-11-21 Ravi Pratap <ravi@ximian.com>
27780 * parameter.cs (GetCallingConvention): Always return
27781 CallingConventions.Standard for now.
27783 2001-11-22 Miguel de Icaza <miguel@ximian.com>
27785 * expression.cs (Binary.ResolveOperator): Update the values of `l'
27786 and `r' after calling DoNumericPromotions.
27788 * ecore.cs: Fix error message (the types were in the wrong order).
27790 * statement.cs (Foreach.ProbeCollectionType): Need to pass
27791 BindingFlags.Instance as well
27793 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
27794 implicit int literal conversion in an empty cast so that we
27795 propagate the right type upstream.
27797 (UnboxCast): new class used to unbox value types.
27798 (Expression.ConvertExplicit): Add explicit type conversions done
27801 (Expression.ImplicitNumericConversion): Oops, forgot to test for
27802 the target type before applying the implicit LongLiterals to ULong
27805 2001-11-21 Miguel de Icaza <miguel@ximian.com>
27807 * cs-parser.jay (for_statement): Reworked the way For works: now
27808 we declare manually any variables that are introduced in
27809 for_initializer to solve the problem of having out-of-band code
27810 emition (that is what got for broken).
27812 (declaration_statement): Perform the actual variable declaration
27813 that used to be done in local_variable_declaration here.
27815 (local_variable_declaration): Do not declare anything, just pass
27816 the information on a DictionaryEntry
27818 2001-11-20 Ravi Pratap <ravi@ximian.com>
27820 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
27821 re-write of the logic to now make it recursive.
27823 (UpdateIndices): Re-write accordingly.
27825 Store element data in a separate ArrayData list in the above methods.
27827 (MakeByteBlob): Implement to dump the array data into a byte array.
27829 2001-11-19 Ravi Pratap <ravi@ximian.com>
27831 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
27834 * constant.cs (Define): Implement.
27836 (EmitConstant): Re-write fully.
27838 Pass in location info.
27840 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
27843 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
27844 DictionaryEntry since we need location info too.
27846 (constant_declaration): Update accordingly.
27848 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
27849 code into another method : UpdateIndices.
27851 2001-11-18 Ravi Pratap <ravi@ximian.com>
27853 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
27854 some type checking etc.
27856 2001-11-17 Ravi Pratap <ravi@ximian.com>
27858 * expression.cs (ArrayCreation::ValidateInitializers): Implement
27859 bits to provide dimension info if the user skips doing that.
27861 Update second constructor to store the rank correctly.
27863 2001-11-16 Ravi Pratap <ravi@ximian.com>
27865 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
27866 and try to implement.
27868 * ../errors/cs0150.cs : Add.
27870 * ../errors/cs0178.cs : Add.
27872 2001-11-16 Miguel de Icaza <miguel@ximian.com>
27874 * statement.cs: Implement foreach on multi-dimensional arrays.
27876 * parameter.cs (Parameters.GetParameterByName): Also lookup the
27877 name of the params argument.
27879 * expression.cs: Use EmitStoreOpcode to get the right opcode while
27880 initializing the array.
27882 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
27883 we can use this elsewhere.
27885 * statement.cs: Finish implementation of foreach for single
27888 * cs-parser.jay: Use an out-of-band stack to pass information
27889 around, I wonder why I need this.
27891 foreach_block: Make the new foreach_block the current_block.
27893 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
27894 function used to return a static Parameters structure. Used for
27895 empty parameters, as those are created very frequently.
27897 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
27899 2001-11-15 Ravi Pratap <ravi@ximian.com>
27901 * interface.cs : Default modifier is private, not public. The
27902 make verify test passes again.
27904 2001-11-15 Ravi Pratap <ravi@ximian.com>
27906 * support.cs (ReflectionParameters): Fix logic to determine
27907 whether the last parameter is a params one. Test 9 passes again.
27909 * delegate.cs (Populate): Register the builders we define with
27910 RegisterParameterForBuilder. Test 19 passes again.
27912 * cs-parser.jay (property_declaration): Reference $6 instead
27913 of $$ to get at the location.
27915 (indexer_declaration): Similar stuff.
27917 (attribute): Ditto.
27919 * class.cs (Property): Register parameters for the Get and Set methods
27920 if they exist. Test 23 passes again.
27922 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
27923 call to EmitArguments as we are sure there aren't any params arguments.
27924 Test 32 passes again.
27926 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
27927 IndexOutOfRangeException.
27929 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
27930 Test 33 now passes again.
27932 2001-11-15 Miguel de Icaza <miguel@ximian.com>
27934 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
27935 broke a bunch of things. Will have to come up with a better way
27936 of tracking locations.
27938 * statement.cs: Implemented foreach for single dimension arrays.
27940 2001-11-09 Miguel de Icaza <miguel@ximian.com>
27942 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
27943 an error. This removes the lookup from the critical path.
27945 * cs-parser.jay: Removed use of temporary_loc, which is completely
27948 2001-11-14 Miguel de Icaza <miguel@ximian.com>
27950 * support.cs (ReflectionParameters.ParameterModifier): Report
27951 whether the argument is a PARAMS argument or not.
27953 * class.cs: Set the attribute `ParamArrayAttribute' on the
27954 parameter argument.
27956 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
27957 and cons_param_array_attribute (ConstructorInfo for
27958 ParamArrayAttribute).,
27960 * codegen.cs: Emit the return using the `Return' statement, that
27961 way we can report the error correctly for missing return values.
27963 * class.cs (Method.Emit): Clean up.
27965 * expression.cs (Argument.Resolve): Take another argument: the
27966 location where this argument is used. Notice that this is not
27967 part of the "Argument" class as to reduce the size of the
27968 structure (we know the approximate location anyways).
27970 Test if the argument is a variable-reference, if not, then
27971 complain with a 206.
27973 (Argument.Emit): Emit addresses of variables.
27975 (Argument.FullDesc): Simplify.
27977 (Invocation.DoResolve): Update for Argument.Resolve.
27979 (ElementAccess.DoResolve): ditto.
27981 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
27982 method should be virtual, as this method is always virtual.
27984 (NewDelegate.DoResolve): Update for Argument.Resolve.
27986 * class.cs (ConstructorInitializer.DoResolve): ditto.
27988 * attribute.cs (Attribute.Resolve): ditto.
27990 2001-11-13 Miguel de Icaza <miguel@ximian.com>
27992 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
27994 * expression.cs (ParameterReference): Drop IStackStorage and implement
27995 IAssignMethod instead.
27997 (LocalVariableReference): ditto.
27999 * ecore.cs (FieldExpr): Drop IStackStorage and implement
28000 IAssignMethod instead.
28002 2001-11-13 Miguel de Icaza <miguel@ximian.com>
28004 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
28005 enumerations that are used in heavily used structures derive from
28006 byte in a laughable and pathetic attempt to reduce memory usage.
28007 This is the kind of pre-optimzations that you should not do at
28008 home without adult supervision.
28010 * expression.cs (UnaryMutator): New class, used to handle ++ and
28011 -- separatedly from the other unary operators. Cleans up the
28012 code, and kills the ExpressionStatement dependency in Unary.
28014 (Unary): Removed `method' and `Arguments' from this class, making
28015 it smaller, and moving it all to SimpleCall, so I can reuse this
28016 code in other locations and avoid creating a lot of transient data
28017 strucutres when not required.
28019 * cs-parser.jay: Adjust for new changes.
28021 2001-11-11 Miguel de Icaza <miguel@ximian.com>
28023 * enum.cs (Enum.Populate): If there is a failure during
28026 * cs-parser.jay (opt_enum_base): we used to catch type errors
28027 here, but this is really incorrect. The type error should be
28028 catched during semantic analysis.
28030 2001-12-11 Ravi Pratap <ravi@ximian.com>
28032 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
28033 current_local_parameters as expected since I, in my stupidity, had forgotten
28036 * attribute.cs (GetValidPlaces): Fix stupid bug.
28038 * class.cs (Method::Emit): Perform check on applicability of attributes.
28040 (Constructor::Emit): Ditto.
28042 (Field::Emit): Ditto.
28044 (Field.Location): Store location information.
28046 (Property, Event, Indexer, Operator): Ditto.
28048 * cs-parser.jay (field_declaration): Pass in location for each field.
28050 * ../errors/cs0592.cs : Add.
28052 2001-11-12 Ravi Pratap <ravi@ximian.com>
28054 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
28056 (InitCoreTypes): Update accordingly.
28058 (RegisterAttrType, LookupAttr): Implement.
28060 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
28061 info about the same.
28063 (Resolve): Update to populate the above as necessary.
28065 (Error592): Helper.
28067 (GetValidPlaces): Helper to the above.
28069 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
28071 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
28073 2001-11-12 Ravi Pratap <ravi@ximian.com>
28075 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
28077 * ../errors/cs0617.cs : Add.
28079 2001-11-11 Ravi Pratap <ravi@ximian.com>
28081 * enum.cs (Emit): Rename to Populate to be more consistent with what
28082 we expect it to do and when exactly it is called.
28084 * class.cs, rootcontext.cs : Update accordingly.
28086 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
28087 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
28089 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
28091 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
28092 of a fieldinfo using the above, when dealing with a FieldBuilder.
28094 2001-11-10 Ravi Pratap <ravi@ximian.com>
28096 * ../errors/cs0031.cs : Add.
28098 * ../errors/cs1008.cs : Add.
28100 * ../errrors/cs0543.cs : Add.
28102 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
28105 (FindMembers): Implement.
28107 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
28108 enums and delegates too.
28110 (enum_types): Rename to builder_to_enum.
28112 (delegate_types): Rename to builder_to_delegate.
28114 * delegate.cs (FindMembers): Implement.
28116 2001-11-09 Ravi Pratap <ravi@ximian.com>
28118 * typemanager.cs (IsEnumType): Implement.
28120 * enum.cs (Emit): Re-write parts to account for the underlying type
28121 better and perform checking etc.
28123 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
28124 of the underlying type.
28126 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
28129 * enum.cs (error31): Helper to report error #31.
28131 * cs-parser.jay (enum_declaration): Store location of each member too.
28133 * enum.cs (member_to_location): New hashtable.
28135 (AddEnumMember): Update location hashtable.
28137 (Emit): Use the location of each member while reporting errors.
28139 2001-11-09 Miguel de Icaza <miguel@ximian.com>
28141 * cs-parser.jay: A for_initializer if is a
28142 local_variable_declaration really ammount to have an implicit
28143 block with the variable declaration and no initializer for for.
28145 * statement.cs (For.Emit): Cope with null initializers.
28147 This fixes the infinite loop on for initializers.
28149 2001-11-08 Miguel de Icaza <miguel@ximian.com>
28151 * enum.cs: More cleanup.
28153 * ecore.cs: Remove dead code.
28155 * class.cs (Property.Emit): More simplification.
28156 (Event.Emit): ditto.
28158 Reworked to have less levels of indentation.
28160 2001-11-08 Ravi Pratap <ravi@ximian.com>
28162 * class.cs (Property): Emit attributes.
28172 * enum.cs (Emit): Ditto.
28174 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
28177 * class.cs (Field, Event, etc.): Move attribute generation into the
28178 Emit method everywhere.
28180 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
28181 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
28182 as we had no way of defining nested enums !
28184 * rootcontext.cs : Adjust code accordingly.
28186 * typemanager.cs (AddEnumType): To keep track of enum types separately.
28188 2001-11-07 Ravi Pratap <ravi@ximian.com>
28190 * expression.cs (EvalConstantExpression): Move into ecore.cs
28192 * enum.cs (Enum): Rename some members and make them public and readonly
28193 according to our convention.
28195 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
28198 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
28200 (Enum::Emit): Write a simple version for now which doesn't try to compute
28201 expressions. I shall modify this to be more robust in just a while.
28203 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
28205 (TypeContainer::CloseType): Create the Enum types too.
28207 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
28209 * expression.cs (EvalConstantExpression): Get rid of completely.
28211 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
28212 user-defined values and other cases.
28214 (IsValidEnumLiteral): Helper function.
28216 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
28217 out there in the case we had a literal FieldExpr.
28219 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
28221 (Literalize): Revamp a bit to take two arguments.
28223 (EnumLiteral): New class which derives from Literal to wrap enum literals.
28225 2001-11-06 Ravi Pratap <ravi@ximian.com>
28227 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
28229 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
28231 (Resolve): Use the above to ensure we have proper initializers.
28233 2001-11-05 Ravi Pratap <ravi@ximian.com>
28235 * expression.cs (Expression::EvalConstantExpression): New method to
28236 evaluate constant expressions.
28238 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
28240 2001-11-07 Miguel de Icaza <miguel@ximian.com>
28242 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
28245 (Binary.ResolveOperator): Handle operator != (object a, object b)
28246 and operator == (object a, object b);
28248 (Binary.DoNumericPromotions): Indicate whether the numeric
28249 promotion was possible.
28251 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
28254 Made the ArrayAccess implement interface IAssignMethod instead of
28255 IStackStore as the order in which arguments are passed reflects
28258 * assign.cs: Instead of using expr.ExprClass to select the way of
28259 assinging, probe for the IStackStore/IAssignMethod interfaces.
28261 * typemanager.cs: Load InitializeArray definition.
28263 * rootcontext.cs (RootContext.MakeStaticData): Used to define
28264 static data that can be used to initialize arrays.
28266 2001-11-05 Miguel de Icaza <miguel@ximian.com>
28268 * expression.cs: Handle operator== and operator!= for booleans.
28270 (Conditioal.Reduce): Implement reducer for the ?: operator.
28272 (Conditional.Resolve): Implement dead code elimination.
28274 (Binary.Resolve): Catch string literals and return a new
28275 concatenated string.
28277 (Unary.Reduce): Implement reduction of unary expressions.
28279 * ecore.cs: Split out the expression core handling here.
28281 (Expression.Reduce): New method used to perform constant folding
28282 and CSE. This is needed to support constant-expressions.
28284 * statement.cs (Statement.EmitBoolExpression): Pass true and false
28285 targets, and optimize for !x.
28287 2001-11-04 Ravi Pratap <ravi@ximian.com>
28289 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
28290 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
28291 set custom atttributes.
28293 * literal.cs (Literal::GetValue): New abstract method to return the actual
28294 value of the literal, cast as an object.
28296 (*Literal): Implement GetValue method.
28298 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
28299 expressions to the arraylist but objects of type Argument.
28301 * class.cs (TypeContainer::Emit): Emit our attributes too.
28303 (Method::Emit, Constructor::Emit): Ditto.
28305 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
28306 to be ignoring earlier.
28308 2001-11-03 Ravi Pratap <ravi@ximian.com>
28310 * attribute.cs (AttributeSection::Define): Implement to do the business
28311 of constructing a CustomAttributeBuilder.
28313 (Attribute): New trivial class. Increases readability of code.
28315 * cs-parser.jay : Update accordingly.
28317 (positional_argument_list, named_argument_list, named_argument): New rules
28319 (attribute_arguments): Use the above so that we are more correct.
28321 2001-11-02 Ravi Pratap <ravi@ximian.com>
28323 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
28324 to perform all checks for a method with a params parameter.
28326 (Invocation::OverloadResolve): Update to use the above method and therefore
28327 cope correctly with params method invocations.
28329 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
28332 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
28333 constructors in our parent too because we can't afford to miss out on
28336 * attribute.cs (AttributeSection): New name for the class Attribute
28338 Other trivial changes to improve readability.
28340 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
28341 use the new class names.
28343 2001-11-01 Ravi Pratap <ravi@ximian.com>
28345 * class.cs (Method::Define): Complete definition for params types too
28347 (Indexer::Define): Ditto.
28349 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
28350 Cope everywhere with a request for info about the array parameter.
28352 2001-11-01 Ravi Pratap <ravi@ximian.com>
28354 * tree.cs (RecordNamespace): Fix up to check for the correct key.
28356 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
28357 local_variable_type to extract the string corresponding to the type.
28359 (local_variable_type): Fixup the action to use the new helper method.
28361 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
28364 * expression.cs : Clean out code which uses the above.
28366 2001-10-31 Ravi Pratap <ravi@ximian.com>
28368 * typemanager.cs (RegisterMethod): Check if we already have an existing key
28369 and bale out if necessary by returning a false.
28371 (RegisterProperty): Ditto.
28373 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
28374 and print out appropriate error messages.
28376 * interface.cs (everywhere): Ditto.
28378 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
28379 location to constructor.
28381 * class.cs (Property, Event, Indexer): Update accordingly.
28383 * ../errors/cs111.cs : Added.
28385 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
28386 of a method, as laid down by the spec.
28388 (Invocation::OverloadResolve): Use the above method.
28390 2001-10-31 Ravi Pratap <ravi@ximian.com>
28392 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
28393 now take a TypeContainer and a Parameters object.
28395 (ParameterData): Modify return type of ParameterModifier method to be
28396 Parameter.Modifier and not a string.
28398 (ReflectionParameters, InternalParameters): Update accordingly.
28400 * expression.cs (Argument::GetParameterModifier): Same here.
28402 * support.cs (InternalParameters::ParameterType): Find a better way of determining
28403 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
28404 symbol in it at all so maybe this is only for now.
28406 2001-10-30 Ravi Pratap <ravi@ximian.com>
28408 * support.cs (InternalParameters): Constructor now takes an extra argument
28409 which is the actual Parameters class.
28411 (ParameterDesc): Update to provide info on ref/out modifiers.
28413 * class.cs (everywhere): Update call to InternalParameters to pass in
28414 the second argument too.
28416 * support.cs (ParameterData): Add ParameterModifier, which is a method
28417 to return the modifier info [ref/out etc]
28419 (InternalParameters, ReflectionParameters): Implement the above.
28421 * expression.cs (Argument::ParameterModifier): Similar function to return
28422 info about the argument's modifiers.
28424 (Invocation::OverloadResolve): Update to take into account matching modifiers
28427 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
28428 a new SetFormalParameters object which we pass to InternalParameters.
28430 2001-10-30 Ravi Pratap <ravi@ximian.com>
28432 * expression.cs (NewArray): Merge into the ArrayCreation class.
28434 2001-10-29 Ravi Pratap <ravi@ximian.com>
28436 * expression.cs (NewArray): Merge classes NewBuiltinArray and
28437 NewUserdefinedArray into one as there wasn't much of a use in having
28440 * expression.cs (Argument): Change field's name to ArgType from Type.
28442 (Type): New readonly property which returns the proper type, taking into
28443 account ref/out modifiers.
28445 (everywhere): Adjust code accordingly for the above.
28447 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
28448 whether we are emitting for a ref or out parameter.
28450 * expression.cs (Argument::Emit): Use the above field to set the state.
28452 (LocalVariableReference::Emit): Update to honour the flag and emit the
28455 * parameter.cs (Attributes): Set the correct flags for ref parameters.
28457 * expression.cs (Argument::FullDesc): New function to provide a full desc.
28459 * support.cs (ParameterData): Add method ParameterDesc to the interface.
28461 (ReflectionParameters, InternalParameters): Implement the above method.
28463 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
28466 (Invocation::FullMethodDesc): Ditto.
28468 2001-10-29 Miguel de Icaza <miguel@ximian.com>
28470 * cs-parser.jay: Add extra production for the second form of array
28473 * expression.cs (ArrayCreation): Update to reflect the above
28476 * Small changes to prepare for Array initialization.
28478 2001-10-28 Miguel de Icaza <miguel@ximian.com>
28480 * typemanager.cs (ImplementsInterface): interface might be null;
28481 Deal with this problem;
28483 Also, we do store negative hits on the cache (null values), so use
28484 this instead of calling t.GetInterfaces on the type everytime.
28486 2001-10-28 Ravi Pratap <ravi@ximian.com>
28488 * typemanager.cs (IsBuiltinType): New method to help determine the same.
28490 * expression.cs (New::DoResolve): Get rid of array creation code and instead
28491 split functionality out into different classes.
28493 (New::FormArrayType): Move into NewBuiltinArray.
28495 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
28498 (NewBuiltinArray): New class to handle creation of built-in arrays.
28500 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
28501 account creation of one-dimensional arrays.
28503 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
28505 (NewUserdefinedArray::DoResolve): Implement.
28507 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
28509 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
28510 we maintain inside the TypeManager. This is necessary to perform lookups on the
28513 (LookupType): Update to perform GetType on the module builders too.
28515 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
28517 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
28519 2001-10-23 Ravi Pratap <ravi@ximian.com>
28521 * expression.cs (New::DoResolve): Implement guts of array creation.
28523 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
28525 2001-10-27 Miguel de Icaza <miguel@ximian.com>
28527 * expression.cs: Fix bug I introduced lsat night that broke
28530 (Expression.Resolve): Report a 246 error (can not resolve name)
28531 if we find a SimpleName in the stream.
28533 (Expression.ResolveLValue): Ditto.
28535 (Expression.ResolveWithSimpleName): This function is a variant of
28536 ResolveName, this one allows SimpleNames to be returned without a
28537 warning. The only consumer of SimpleNames is MemberAccess
28539 2001-10-26 Miguel de Icaza <miguel@ximian.com>
28541 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
28542 might arrive here. I have my doubts that this is correct.
28544 * statement.cs (Lock): Implement lock statement.
28546 * cs-parser.jay: Small fixes to support `lock' and `using'
28548 * cs-tokenizer.cs: Remove extra space
28550 * driver.cs: New flag --checked, allows to turn on integer math
28553 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
28554 Threading.Monitor.Exit
28556 2001-10-23 Miguel de Icaza <miguel@ximian.com>
28558 * expression.cs (IndexerAccess::DoResolveLValue): Set the
28559 Expression Class to be IndexerAccess.
28561 Notice that Indexer::DoResolve sets the eclass to Value.
28563 2001-10-22 Miguel de Icaza <miguel@ximian.com>
28565 * class.cs (TypeContainer::Emit): Emit code for indexers.
28567 * assign.cs (IAssignMethod): New interface implemented by Indexers
28568 and Properties for handling assignment.
28570 (Assign::Emit): Simplify and reuse code.
28572 * expression.cs (IndexerAccess, PropertyExpr): Implement
28573 IAssignMethod, clean up old code.
28575 2001-10-22 Ravi Pratap <ravi@ximian.com>
28577 * typemanager.cs (ImplementsInterface): New method to determine if a type
28578 implements a given interface. Provides a nice cache too.
28580 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
28583 (ConvertReferenceExplicit): Ditto.
28585 * delegate.cs (Delegate::Populate): Update to define the parameters on the
28586 various methods, with correct names etc.
28588 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
28589 Operator.UnaryNegation.
28591 * cs-parser.jay (operator_declarator): Be a little clever in the case where
28592 we have a unary plus or minus operator.
28594 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
28597 * everywhere : update accordingly.
28599 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
28602 * class.cs (Method::Define): For the case where we are implementing a method
28603 inherited from an interface, we need to set the MethodAttributes.Final flag too.
28604 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
28606 2001-10-21 Ravi Pratap <ravi@ximian.com>
28608 * interface.cs (FindMembers): Implement to work around S.R.E
28611 * typemanager.cs (IsInterfaceType): Implement.
28613 (FindMembers): Update to handle interface types too.
28615 * expression.cs (ImplicitReferenceConversion): Re-write bits which
28616 use IsAssignableFrom as that is not correct - it doesn't work.
28618 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
28619 and accordingly override EmitStatement.
28621 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
28622 using the correct logic :-)
28624 2001-10-19 Ravi Pratap <ravi@ximian.com>
28626 * ../errors/cs-11.cs : Add to demonstrate error -11
28628 2001-10-17 Miguel de Icaza <miguel@ximian.com>
28630 * assign.cs (Assign::Resolve): Resolve right hand side first, and
28631 then pass this as a hint to ResolveLValue.
28633 * expression.cs (FieldExpr): Add Location information
28635 (FieldExpr::LValueResolve): Report assignment to readonly
28638 (Expression::ExprClassFromMemberInfo): Pass location information.
28640 (Expression::ResolveLValue): Add new method that resolves an
28643 (Expression::DoResolveLValue): Default invocation calls
28646 (Indexers): New class used to keep track of indexers in a given
28649 (IStackStore): Renamed from LValue, as it did not really describe
28650 what this did. Also ResolveLValue is gone from this interface and
28651 now is part of Expression.
28653 (ElementAccess): Depending on the element access type
28655 * typemanager.cs: Add `indexer_name_type' as a Core type
28656 (System.Runtime.CompilerServices.IndexerNameAttribute)
28658 * statement.cs (Goto): Take a location.
28660 2001-10-18 Ravi Pratap <ravi@ximian.com>
28662 * delegate.cs (Delegate::VerifyDelegate): New method to verify
28663 if two delegates are compatible.
28665 (NewDelegate::DoResolve): Update to take care of the case when
28666 we instantiate a delegate from another delegate.
28668 * typemanager.cs (FindMembers): Don't even try to look up members
28669 of Delegate types for now.
28671 2001-10-18 Ravi Pratap <ravi@ximian.com>
28673 * delegate.cs (NewDelegate): New class to take care of delegate
28676 * expression.cs (New): Split the delegate related code out into
28677 the NewDelegate class.
28679 * delegate.cs (DelegateInvocation): New class to handle delegate
28682 * expression.cs (Invocation): Split out delegate related code into
28683 the DelegateInvocation class.
28685 2001-10-17 Ravi Pratap <ravi@ximian.com>
28687 * expression.cs (New::DoResolve): Implement delegate creation fully
28688 and according to the spec.
28690 (New::DoEmit): Update to handle delegates differently.
28692 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
28693 because of which we were printing out arguments in reverse order !
28695 * delegate.cs (VerifyMethod): Implement to check if the given method
28696 matches the delegate.
28698 (FullDelegateDesc): Implement.
28700 (VerifyApplicability): Implement.
28702 * expression.cs (Invocation::DoResolve): Update to accordingly handle
28703 delegate invocations too.
28705 (Invocation::Emit): Ditto.
28707 * ../errors/cs1593.cs : Added.
28709 * ../errors/cs1594.cs : Added.
28711 * delegate.cs (InstanceExpression, TargetMethod): New properties.
28713 2001-10-16 Ravi Pratap <ravi@ximian.com>
28715 * typemanager.cs (intptr_type): Core type for System.IntPtr
28717 (InitCoreTypes): Update for the same.
28719 (iasyncresult_type, asynccallback_type): Ditto.
28721 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
28724 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
28727 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
28728 the builders for the 4 members of a delegate type :-)
28730 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
28733 * expression.cs (New::DoResolve): Implement guts for delegate creation.
28735 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
28737 2001-10-15 Miguel de Icaza <miguel@ximian.com>
28739 * statement.cs (Break::Emit): Implement.
28740 (Continue::Emit): Implement.
28742 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
28743 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
28744 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
28745 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
28748 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
28749 properties that track the label for the current loop (begin of the
28750 loop and end of the loop).
28752 2001-10-15 Ravi Pratap <ravi@ximian.com>
28754 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
28755 use of emitting anything at all.
28757 * class.cs, rootcontext.cs : Get rid of calls to the same.
28759 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
28761 (Populate): Define the constructor correctly and set the implementation
28764 * typemanager.cs (delegate_types): New hashtable to hold delegates that
28767 (AddDelegateType): Implement.
28769 (IsDelegateType): Implement helper method.
28771 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
28773 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
28774 and accordingly handle it.
28776 * delegate.cs (Populate): Take TypeContainer argument.
28777 Implement bits to define the Invoke method. However, I still haven't figured out
28778 how to take care of the native int bit :-(
28780 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
28781 Qualify the name of the delegate, not its return type !
28783 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
28786 (StandardConversionExists): Checking for array types turns out to be recursive.
28788 (ConvertReferenceExplicit): Implement array conversion.
28790 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
28792 2001-10-12 Ravi Pratap <ravi@ximian.com>
28794 * cs-parser.jay (delegate_declaration): Store the fully qualified
28795 name as it is a type declaration.
28797 * delegate.cs (ReturnType, Name): Rename members to these. Make them
28800 (DefineDelegate): Renamed from Define. Does the same thing essentially,
28801 as TypeContainer::DefineType.
28803 (Populate): Method in which all the definition of the various methods (Invoke)
28806 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
28809 (CloseDelegate): Finally creates the delegate.
28811 * class.cs (TypeContainer::DefineType): Update to define delegates.
28812 (Populate, Emit and CloseType): Do the same thing here too.
28814 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
28815 delegates in all these operations.
28817 2001-10-14 Miguel de Icaza <miguel@ximian.com>
28819 * expression.cs: LocalTemporary: a new expression used to
28820 reference a temporary that has been created.
28822 * assign.cs: Handle PropertyAccess back here, so that we can
28823 provide the proper semantic access to properties.
28825 * expression.cs (Expression::ConvertReferenceExplicit): Implement
28826 a few more explicit conversions.
28828 * modifiers.cs: `NEW' modifier maps to HideBySig.
28830 * expression.cs (PropertyExpr): Make this into an
28831 ExpressionStatement, and support the EmitStatement code path.
28833 Perform get/set error checking, clean up the interface.
28835 * assign.cs: recognize PropertyExprs as targets, and if so, turn
28836 them into toplevel access objects.
28838 2001-10-12 Miguel de Icaza <miguel@ximian.com>
28840 * expression.cs: PropertyExpr::PropertyExpr: use work around the
28843 * typemanager.cs: Keep track here of our PropertyBuilders again to
28844 work around lameness in SRE.
28846 2001-10-11 Miguel de Icaza <miguel@ximian.com>
28848 * expression.cs (LValue::LValueResolve): New method in the
28849 interface, used to perform a second resolution pass for LValues.
28851 (This::DoResolve): Catch the use of this in static methods.
28853 (This::LValueResolve): Implement.
28855 (This::Store): Remove warning, assigning to `this' in structures
28858 (Invocation::Emit): Deal with invocation of
28859 methods on value types. We need to pass the address to structure
28860 methods rather than the object itself. (The equivalent code to
28861 emit "this" for structures leaves the entire structure on the
28862 stack instead of a pointer to it).
28864 (ParameterReference::DoResolve): Compute the real index for the
28865 argument based on whether the method takes or not a `this' pointer
28866 (ie, the method is static).
28868 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
28869 value types returned from functions when we need to invoke a
28870 method on the sturcture.
28873 2001-10-11 Ravi Pratap <ravi@ximian.com>
28875 * class.cs (TypeContainer::DefineType): Method to actually do the business of
28876 defining the type in the Modulebuilder or Typebuilder. This is to take
28877 care of nested types which need to be defined on the TypeBuilder using
28878 DefineNestedMethod.
28880 (TypeContainer::GetClassBases): Implement. Essentially the code from the
28881 methods in RootContext, only ported to be part of TypeContainer.
28883 (TypeContainer::GetInterfaceOrClass): Ditto.
28885 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
28887 * interface.cs (Interface::DefineInterface): New method. Does exactly
28888 what RootContext.CreateInterface did earlier, only it takes care of nested types
28891 (Interface::GetInterfaces): Move from RootContext here and port.
28893 (Interface::GetInterfaceByName): Same here.
28895 * rootcontext.cs (ResolveTree): Re-write.
28897 (PopulateTypes): Re-write.
28899 * class.cs (TypeContainer::Populate): Populate nested types too.
28900 (TypeContainer::Emit): Emit nested members too.
28902 * typemanager.cs (AddUserType): Do not make use of the FullName property,
28903 instead just use the name argument passed in as it is already fully
28906 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
28907 to TypeContainer mapping to see if a type is user-defined.
28909 * class.cs (TypeContainer::CloseType): Implement.
28911 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
28912 the default constructor.
28914 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
28917 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
28919 * interface.cs (CloseType): Create the type here.
28921 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
28924 Remove all the methods which are now in TypeContainer.
28926 2001-10-10 Ravi Pratap <ravi@ximian.com>
28928 * delegate.cs (Define): Re-write bits to define the delegate
28931 2001-10-10 Miguel de Icaza <miguel@ximian.com>
28933 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
28935 * expression.cs (ImplicitReferenceConversion): handle null as well
28936 as a source to convert to any reference type.
28938 * statement.cs (Return): Perform any implicit conversions to
28939 expected return type.
28941 Validate use of return statement.
28943 * codegen.cs (EmitContext): Pass the expected return type here.
28945 * class.cs (Method, Constructor, Property): Pass expected return
28946 type to EmitContext.
28948 2001-10-09 Miguel de Icaza <miguel@ximian.com>
28950 * expression.cs: Make DoResolve take an EmitContext instead of a
28953 Replaced `l' and `location' for `loc', for consistency.
28955 (Error, Warning): Remove unneeded Tc argument.
28957 * assign.cs, literal.cs, constant.cs: Update to new calling
28960 * codegen.cs: EmitContext now contains a flag indicating whether
28961 code is being generated in a static method or not.
28963 * cs-parser.jay: DecomposeQI, new function that replaces the old
28964 QualifiedIdentifier. Now we always decompose the assembled
28965 strings from qualified_identifier productions into a group of
28968 2001-10-08 Miguel de Icaza <miguel@ximian.com>
28970 * rootcontext.cs: Deal with field-less struct types correctly now
28971 by passing the size option to Define Type.
28973 * class.cs: Removed hack that created one static field.
28975 2001-10-07 Miguel de Icaza <miguel@ximian.com>
28977 * statement.cs: Moved most of the code generation here.
28979 2001-10-09 Ravi Pratap <ravi@ximian.com>
28981 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
28984 (ElementAccess): Remove useless bits for now - keep checks as the spec
28987 2001-10-08 Ravi Pratap <ravi@ximian.com>
28989 * expression.cs (ElementAccess::DoResolve): Remove my crap code
28990 and start performing checks according to the spec.
28992 2001-10-07 Ravi Pratap <ravi@ximian.com>
28994 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
28995 rank_specifiers instead.
28997 (rank_specifiers): Change the order in which the rank specifiers are stored
28999 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
29001 * expression.cs (ElementAccess): Implement the LValue interface too.
29003 2001-10-06 Ravi Pratap <ravi@ximian.com>
29005 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
29006 except that user defined conversions are not included.
29008 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
29009 perform the conversion of the return type, if necessary.
29011 (New::DoResolve): Check whether we are creating an array or an object
29012 and accordingly do the needful.
29014 (New::Emit): Same here.
29016 (New::DoResolve): Implement guts of array creation.
29018 (New::FormLookupType): Helper function.
29020 2001-10-07 Miguel de Icaza <miguel@ximian.com>
29022 * codegen.cs: Removed most of the code generation here, and move the
29023 corresponding code generation bits to the statement classes.
29025 Added support for try/catch/finalize and throw.
29027 * cs-parser.jay: Added support for try/catch/finalize.
29029 * class.cs: Catch static methods having the flags override,
29030 virtual or abstract.
29032 * expression.cs (UserCast): This user cast was not really doing
29033 what it was supposed to do. Which is to be born in fully resolved
29034 state. Parts of the resolution were being performed at Emit time!
29038 2001-10-05 Miguel de Icaza <miguel@ximian.com>
29040 * expression.cs: Implicity convert the result from UserCast.
29042 2001-10-05 Ravi Pratap <ravi@ximian.com>
29044 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
29045 prevented it from working correctly.
29047 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
29048 merely ConvertImplicit.
29050 2001-10-05 Miguel de Icaza <miguel@ximian.com>
29052 * typemanager.cs: Make the LookupTypeContainer function static,
29053 and not per-instance.
29055 * class.cs: Make static FindMembers (the one that takes a Type
29058 * codegen.cs: Add EmitForeach here.
29060 * cs-parser.jay: Make foreach a toplevel object instead of the
29061 inline expansion, as we need to perform semantic analysis on it.
29063 2001-10-05 Ravi Pratap <ravi@ximian.com>
29065 * expression.cs (Expression::ImplicitUserConversion): Rename to
29066 UserDefinedConversion.
29068 (Expression::UserDefinedConversion): Take an extra argument specifying
29069 whether we look for explicit user conversions too.
29071 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
29073 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
29075 (ExplicitUserConversion): Make it a call to UserDefinedConversion
29076 with the appropriate arguments.
29078 * cs-parser.jay (cast_expression): Record location too.
29080 * expression.cs (Cast): Record location info.
29082 (Expression::ConvertExplicit): Take location argument.
29084 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
29085 to determine if we are doing explicit conversions.
29087 (UserCast::Emit): Update accordingly.
29089 (Expression::ConvertExplicit): Report an error if everything fails.
29091 * ../errors/cs0030.cs : Add.
29093 2001-10-04 Miguel de Icaza <miguel@ximian.com>
29095 * modifiers.cs: If the ABSTRACT keyword is present, also set the
29096 virtual and newslot bits.
29098 * class.cs (TypeContainer::RegisterRequiredImplementations):
29099 Record methods we need.
29101 (TypeContainer::MakeKey): Helper function to make keys for
29102 MethodBases, since the Methodbase key is useless.
29104 (TypeContainer::Populate): Call RegisterRequiredImplementations
29105 before defining the methods.
29107 Create a mapping for method_builders_to_methods ahead of time
29108 instead of inside a tight loop.
29110 (::RequireMethods): Accept an object as the data to set into the
29111 hashtable so we can report interface vs abstract method mismatch.
29113 2001-10-03 Miguel de Icaza <miguel@ximian.com>
29115 * report.cs: Make all of it static.
29117 * rootcontext.cs: Drop object_type and value_type computations, as
29118 we have those in the TypeManager anyways.
29120 Drop report instance variable too, now it is a global.
29122 * driver.cs: Use try/catch on command line handling.
29124 Add --probe option to debug the error reporting system with a test
29127 * report.cs: Add support for exiting program when a probe
29128 condition is reached.
29130 2001-10-03 Ravi Pratap <ravi@ximian.com>
29132 * expression.cs (Binary::DoNumericPromotions): Fix the case when
29133 we do a forcible conversion regardless of type, to check if
29134 ForceConversion returns a null.
29136 (Binary::error19): Use location to report error.
29138 (Unary::error23): Use location here too.
29140 * ../errors/cs0019.cs : Check in.
29142 * ../errors/cs0023.cs : Check in.
29144 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
29145 case of a non-null MethodInfo object with a length of 0 !
29147 (Binary::ResolveOperator): Flag error if overload resolution fails to find
29148 an applicable member - according to the spec :-)
29149 Also fix logic to find members in base types.
29151 (Unary::ResolveOperator): Same here.
29153 (Unary::report23): Change name to error23 and make first argument a TypeContainer
29154 as I was getting thoroughly confused between this and error19 :-)
29156 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
29157 (::FindMostEncompassedType): Implement.
29158 (::FindMostEncompassingType): Implement.
29159 (::StandardConversionExists): Implement.
29161 (UserImplicitCast): Re-vamp. We now need info about most specific
29162 source and target types so that we can do the necessary conversions.
29164 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
29165 mathematical union with no duplicates.
29167 2001-10-03 Miguel de Icaza <miguel@ximian.com>
29169 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
29170 in order from base classes to child classes, so that we can in
29171 child classes look up in our parent for method names and
29172 attributes (required for handling abstract, virtual, new, override
29173 constructs: we need to instrospect our base class, and if we dont
29174 populate the classes in order, the introspection might be
29175 incorrect. For example, a method could query its parent before
29176 the parent has any methods and would determine that the parent has
29177 no abstract methods (while it could have had them)).
29179 (RootContext::CreateType): Record the order in which we define the
29182 2001-10-02 Miguel de Icaza <miguel@ximian.com>
29184 * class.cs (TypeContainer::Populate): Also method definitions can
29185 fail now, keep track of this.
29187 (TypeContainer::FindMembers): Implement support for
29188 DeclaredOnly/noDeclaredOnly flag.
29190 (Constructor::Emit) Return the ConstructorBuilder.
29192 (Method::Emit) Return the MethodBuilder.
29193 Check for abstract or virtual methods to be public.
29195 * rootcontext.cs (RootContext::CreateType): Register all the
29196 abstract methods required for the class to be complete and the
29197 interface methods that must be implemented.
29199 * cs-parser.jay: Report error 501 (method requires body if it is
29200 not marked abstract or extern).
29202 * expression.cs (TypeOf::Emit): Implement.
29204 * typemanager.cs: runtime_handle_type, new global type.
29206 * class.cs (Property::Emit): Generate code for properties.
29208 2001-10-02 Ravi Pratap <ravi@ximian.com>
29210 * expression.cs (Unary::ResolveOperator): Find operators on base type
29211 too - we now conform exactly to the spec.
29213 (Binary::ResolveOperator): Same here.
29215 * class.cs (Operator::Define): Fix minor quirk in the tests.
29217 * ../errors/cs0215.cs : Added.
29219 * ../errors/cs0556.cs : Added.
29221 * ../errors/cs0555.cs : Added.
29223 2001-10-01 Miguel de Icaza <miguel@ximian.com>
29225 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
29226 single integer which is really efficient
29228 2001-10-01 Ravi Pratap <ravi@ximian.com>
29230 * expression.cs (Expression::ImplicitUserConversion): Use location
29231 even in the case when we are examining True operators.
29233 * class.cs (Operator::Define): Perform extensive checks to conform
29234 with the rules for operator overloading in the spec.
29236 * expression.cs (Expression::ImplicitReferenceConversion): Implement
29237 some of the other conversions mentioned in the spec.
29239 * typemanager.cs (array_type): New static member for the System.Array built-in
29242 (cloneable_interface): For System.ICloneable interface.
29244 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
29245 we start resolving the tree and populating types.
29247 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
29249 2001-10-01 Miguel de Icaza <miguel@ximian.com>
29251 * expression.cs (Expression::ExprClassFromMemberInfo,
29252 Expression::Literalize): Create literal expressions from
29253 FieldInfos which are literals.
29255 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
29256 type casts, because they were wrong. The test suite in tests
29259 (ImplicitNumericConversion): ushort to ulong requires a widening
29262 Int32 constant to long requires widening cast as well.
29264 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
29265 for integers because the type on the stack is not i4.
29267 2001-09-30 Miguel de Icaza <miguel@ximian.com>
29269 * expression.cs (report118): require location argument.
29271 * parameter.cs: Do not dereference potential null value.
29273 * class.cs: Catch methods that lack the `new' keyword when
29274 overriding a name. Report warnings when `new' is used without
29275 anything being there to override.
29277 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
29279 * class.cs: Only add constructor to hashtable if it is non-null
29280 (as now constructors can fail on define).
29282 (TypeManager, Class, Struct): Take location arguments.
29284 Catch field instance initialization in structs as errors.
29286 accepting_filter: a new filter for FindMembers that is static so
29287 that we dont create an instance per invocation.
29289 (Constructor::Define): Catch errors where a struct constructor is
29292 * cs-parser.jay: Pass location information for various new
29295 * delegate.cs (Delegate): take a location argument.
29297 * driver.cs: Do not call EmitCode if there were problesm in the
29298 Definition of the types, as many Builders wont be there.
29300 * decl.cs (Decl::Decl): Require a location argument.
29302 * cs-tokenizer.cs: Handle properly hex constants that can not fit
29303 into integers, and find the most appropiate integer for it.
29305 * literal.cs: Implement ULongLiteral.
29307 * rootcontext.cs: Provide better information about the location of
29308 failure when CreateType fails.
29310 2001-09-29 Miguel de Icaza <miguel@ximian.com>
29312 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
29315 * expression.cs (Binary::CheckShiftArguments): Add missing type
29317 (Binary::ResolveOperator): Add type to the logical and and logical
29318 or, Bitwise And/Or and Exclusive Or code paths, it was missing
29321 (Binary::DoNumericPromotions): In the case where either argument
29322 is ulong (and most signed types combined with ulong cause an
29323 error) perform implicit integer constant conversions as well.
29325 2001-09-28 Miguel de Icaza <miguel@ximian.com>
29327 * expression.cs (UserImplicitCast): Method should always be
29329 (Invocation::BetterConversion): Simplified test for IntLiteral.
29331 (Expression::ImplicitNumericConversion): Split this routine out.
29332 Put the code that performs implicit constant integer conversions
29335 (Expression::Resolve): Become a wrapper around DoResolve so we can
29336 check eclass and type being set after resolve.
29338 (Invocation::Badness): Remove this dead function
29340 (Binary::ResolveOperator): Do not compute the expensive argumnets
29341 unless we have a union for it.
29343 (Probe::Emit): Is needs to do an isinst and then
29344 compare against null.
29346 (::CanConvert): Added Location argument. If the Location argument
29347 is null (Location.Null), then we do not report errors. This is
29348 used by the `probe' mechanism of the Explicit conversion. We do
29349 not want to generate an error for something that the user
29350 explicitly requested to be casted. But the pipeline for an
29351 explicit cast first tests for potential implicit casts.
29353 So for now, if the Location is null, it means `Probe only' to
29354 avoid adding another argument. Might have to revise this
29357 (ClassCast): New class used to type cast objects into arbitrary
29358 classes (used in Explicit Reference Conversions).
29360 Implement `as' as well.
29362 Reverted all the patches from Ravi below: they were broken:
29364 * The use of `level' as a mechanism to stop recursive
29365 invocations is wrong. That was there just to catch the
29366 bug with a strack trace but not as a way of addressing
29369 To fix the problem we have to *understand* what is going
29370 on and the interactions and come up with a plan, not
29371 just get things going.
29373 * The use of the type conversion cache that I proposed
29374 last night had an open topic: How does this work across
29375 protection domains. A user defined conversion might not
29376 be public in the location where we are applying the
29377 conversion, a different conversion might be selected
29378 (ie, private A->B (better) but public B->A (worse),
29379 inside A, A->B applies, but outside it, B->A will
29382 * On top of that (ie, even if the above is solved),
29383 conversions in a cache need to be abstract. Ie, `To
29384 convert from an Int to a Short use an OpcodeCast', not
29385 `To convert from an Int to a Short use the OpcodeCast on
29386 the variable 5' (which is what this patch was doing).
29388 2001-09-28 Ravi Pratap <ravi@ximian.com>
29390 * expression.cs (Invocation::ConversionExists): Re-write to use
29391 the conversion cache
29393 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
29394 cache all conversions done, not just user-defined ones.
29396 (Invocation::BetterConversion): The real culprit. Use ConversionExists
29397 to determine if a conversion exists instead of acutually trying to
29398 perform the conversion. It's faster too.
29400 (Expression::ConvertExplicit): Modify to use ConversionExists to check
29401 and only then attempt the implicit conversion.
29403 2001-09-28 Ravi Pratap <ravi@ximian.com>
29405 * expression.cs (ConvertImplicit): Use a cache for conversions
29406 already found. Check level of recursion and bail out if necessary.
29408 2001-09-28 Miguel de Icaza <miguel@ximian.com>
29410 * typemanager.cs (string_concat_string_string, string_concat_object_object):
29411 Export standard methods that we expect for string operations.
29413 * statement.cs (Block::UsageWarning): Track usage of variables and
29414 report the errors for not used variables.
29416 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
29419 2001-09-27 Miguel de Icaza <miguel@ximian.com>
29421 * codegen.cs: remove unnneded code
29423 * expression.cs: Removed BuiltinTypeAccess class
29425 Fix the order in which implicit conversions are
29428 The previous fixed dropped support for boxed conversions (adding a
29429 test to the test suite now)
29431 (UserImplicitCast::CanConvert): Remove test for source being null,
29432 that code is broken. We should not feed a null to begin with, if
29433 we do, then we should track the bug where the problem originates
29434 and not try to cover it up here.
29436 Return a resolved expression of type UserImplicitCast on success
29437 rather than true/false. Ravi: this is what I was talking about,
29438 the pattern is to use a static method as a "constructor" for
29441 Also, do not create arguments until the very last minute,
29442 otherwise we always create the arguments even for lookups that
29443 will never be performed.
29445 (UserImplicitCast::Resolve): Eliminate, objects of type
29446 UserImplicitCast are born in a fully resolved state.
29448 * typemanager.cs (InitCoreTypes): Init also value_type
29449 (System.ValueType).
29451 * expression.cs (Cast::Resolve): First resolve the child expression.
29453 (LValue): Add new method AddressOf to be used by
29456 Change the argument of Store to take an EmitContext instead of an
29457 ILGenerator, because things like FieldExpr need to be able to call
29458 their children expression to generate the instance code.
29460 (Expression::Error, Expression::Warning): Sugar functions for
29463 (Expression::MemberLookup): Accept a TypeContainer instead of a
29464 Report as the first argument.
29466 (Expression::ResolvePrimary): Killed. I still want to improve
29467 this as currently the code is just not right.
29469 (Expression::ResolveMemberAccess): Simplify, but it is still
29472 (Unary::Resolve): Catch errors in AddressOf operators.
29474 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
29475 index to a byte for the short-version, or the compiler will choose
29476 the wrong Emit call, which generates the wrong data.
29478 (ParameterReference::Emit, ::Store): same.
29480 (FieldExpr::AddressOf): Implement.
29482 * typemanager.cs: TypeManager: made public variable instead of
29485 * driver.cs: document --fatal.
29487 * report.cs (ErrorMessage, WarningMessage): new names for the old
29488 Error and Warning classes.
29490 * cs-parser.jay (member_access): Turn built-in access to types
29491 into a normal simplename
29493 2001-09-27 Ravi Pratap <ravi@ximian.com>
29495 * expression.cs (Invocation::BetterConversion): Fix to cope
29496 with q being null, since this was introducing a bug.
29498 * expression.cs (ConvertImplicit): Do built-in conversions first.
29500 2001-09-27 Ravi Pratap <ravi@ximian.com>
29502 * expression.cs (UserImplicitCast::Resolve): Fix bug.
29504 2001-09-27 Ravi Pratap <ravi@ximian.com>
29506 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
29507 I had introduced long ago (what's new ?).
29509 * expression.cs (UserImplicitCast::CanConvert): Static method to do
29510 the work of all the checking.
29511 (ConvertImplicit): Call CanConvert and only then create object if necessary.
29512 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
29514 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
29515 that is the right way.
29517 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
29518 overloading resolution. Use everywhere instead of cutting and pasting code.
29520 (Binary::ResolveOperator): Use MakeUnionSet.
29522 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
29523 we have to convert to bool types. Not complete yet.
29525 2001-09-27 Miguel de Icaza <miguel@ximian.com>
29527 * typemanager.cs (TypeManager::CSharpName): support ushort.
29529 * expression.cs (Expression::TryImplicitIntConversion): Attempts
29530 to provide an expression that performsn an implicit constant int
29531 conversion (section 6.1.6).
29532 (Expression::ConvertImplicitRequired): Reworked to include
29533 implicit constant expression conversions.
29535 (Expression::ConvertNumericExplicit): Finished.
29537 (Invocation::Emit): If InstanceExpression is null, then it means
29538 that we perform a call on this.
29540 2001-09-26 Miguel de Icaza <miguel@ximian.com>
29542 * expression.cs (Unary::Emit): Remove some dead code.
29543 (Probe): Implement Resolve and Emit for `is'.
29544 (Expression::ConvertImplicitRequired): Attempt to do constant
29545 expression conversions here. Maybe should be moved to
29546 ConvertImplicit, but I am not sure.
29547 (Expression::ImplicitLongConstantConversionPossible,
29548 Expression::ImplicitIntConstantConversionPossible): New functions
29549 that tell whether is it possible to apply an implicit constant
29550 expression conversion.
29552 (ConvertNumericExplicit): Started work on explicit numeric
29555 * cs-parser.jay: Update operator constants.
29557 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
29558 (Parameters::GetSignature): Hook up VerifyArgs here.
29559 (Parameters::VerifyArgs): Verifies that no two arguments have the
29562 * class.cs (Operator): Update the operator names to reflect the
29563 ones that the spec expects (as we are just stringizing the
29566 * expression.cs (Unary::ResolveOperator): Fix bug: Use
29567 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
29568 previous usage did only work for our methods.
29569 (Expression::ConvertImplicit): Handle decimal implicit numeric
29570 conversions as well.
29571 (Expression::InternalTypeConstructor): Used to invoke constructors
29572 on internal types for default promotions.
29574 (Unary::Emit): Implement special handling for the pre/post
29575 increment/decrement for overloaded operators, as they need to have
29576 the same semantics as the other operators.
29578 (Binary::ResolveOperator): ditto.
29579 (Invocation::ConversionExists): ditto.
29580 (UserImplicitCast::Resolve): ditto.
29582 2001-09-26 Ravi Pratap <ravi@ximian.com>
29584 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
29585 operator, return after emitting body. Regression tests pass again !
29587 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
29588 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
29589 (Invocation::OverloadResolve): Ditto.
29590 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
29592 * everywhere : update calls to the above methods accordingly.
29594 2001-09-26 Miguel de Icaza <miguel@ximian.com>
29596 * assign.cs (Assign): Make it inherit from ExpressionStatement.
29598 * expression.cs (ExpressionStatement): New base class used for
29599 expressions that can appear in statements, so that we can provide
29600 an alternate path to generate expression that do not leave a value
29603 (Expression::Emit, and all the derivatives): We no longer return
29604 whether a value is left on the stack or not. Every expression
29605 after being emitted leaves a single value on the stack.
29607 * codegen.cs (EmitContext::EmitStatementExpression): Use the
29608 facilties of ExpressionStatement if possible.
29610 * cs-parser.jay: Update statement_expression.
29612 2001-09-25 Miguel de Icaza <miguel@ximian.com>
29614 * driver.cs: Change the wording of message
29616 2001-09-25 Ravi Pratap <ravi@ximian.com>
29618 * expression.cs (Binary::ResolveOperator): Had forgottten to set
29619 the type of the expression to the return type of the method if
29620 we have an overloaded operator match ! The regression tests pass again !
29621 (Unary::ResolveOperator): Ditto.
29623 * expression.cs (Invocation::ConversionExists): Correct the member lookup
29624 to find "op_Implicit", not "implicit" ;-)
29625 (UserImplicitCast): New class to take care of user-defined implicit conversions.
29626 (ConvertImplicit, ForceConversion): Take TypeContainer argument
29628 * everywhere : Correct calls to the above accordingly.
29630 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
29631 (ConvertImplicit): Do user-defined conversion if it exists.
29633 2001-09-24 Miguel de Icaza <miguel@ximian.com>
29635 * assign.cs: track location.
29636 (Resolve): Use implicit conversions on assignment.
29638 * literal.cs: Oops. Not good, Emit of short access values should
29639 pass (Bytes) or the wrong argument will be selected.
29641 * expression.cs (Unary::Emit): Emit code for -expr.
29643 (Unary::ResolveOperator): Handle `Substract' for non-constants
29644 (substract from zero from the non-constants).
29645 Deal with Doubles as well.
29647 (Expression::ConvertImplicitRequired): New routine that reports an
29648 error if no implicit conversion exists.
29650 (Invocation::OverloadResolve): Store the converted implicit
29651 expressions if we make them
29653 2001-09-24 Ravi Pratap <ravi@ximian.com>
29655 * class.cs (ConstructorInitializer): Take a Location argument.
29656 (ConstructorBaseInitializer): Same here.
29657 (ConstructorThisInitializer): Same here.
29659 * cs-parser.jay : Update all calls accordingly.
29661 * expression.cs (Unary, Binary, New): Take location argument.
29662 Update accordingly everywhere.
29664 * cs-parser.jay : Update all calls to the above to take a location
29667 * class.cs : Ditto.
29669 2001-09-24 Ravi Pratap <ravi@ximian.com>
29671 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
29672 (Invocation::BetterConversion): Same here
29673 (Invocation::ConversionExists): Ditto.
29675 (Invocation::ConversionExists): Implement.
29677 2001-09-22 Ravi Pratap <ravi@ximian.com>
29679 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
29680 Also take an additional TypeContainer argument.
29682 * All over : Pass in TypeContainer as argument to OverloadResolve.
29684 * typemanager.cs (CSharpName): Update to check for the string type and return
29687 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
29690 2001-09-21 Ravi Pratap <ravi@ximian.com>
29692 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
29693 (Invocation::BetterFunction): Implement.
29694 (Invocation::BetterConversion): Implement.
29695 (Invocation::ConversionExists): Skeleton, no implementation yet.
29697 Okay, things work fine !
29699 2001-09-21 Miguel de Icaza <miguel@ximian.com>
29701 * typemanager.cs: declare and load enum_type, delegate_type and
29704 * expression.cs (Expression::Emit): Now emit returns a value that
29705 tells whether a value is left on the stack or not. This strategy
29706 might be reveted tomorrow with a mechanism that would address
29707 multiple assignments.
29708 (Expression::report118): Utility routine to report mismatches on
29711 (Unary::Report23): Report impossible type/operator combination
29714 (Unary::IsIncrementableNumber): Whether the type can be
29715 incremented or decremented with add.
29716 (Unary::ResolveOperator): Also allow enumerations to be bitwise
29718 (Unary::ResolveOperator): Implement ++, !, ~,
29720 (Invocation::Emit): Deal with new Emit convetion.
29722 * All Expression derivatives: Updated their Emit method to return
29723 whether they leave values on the stack or not.
29725 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
29726 stack for expressions that are statements.
29728 2001-09-20 Miguel de Icaza <miguel@ximian.com>
29730 * expression.cs (LValue): New interface. Must be implemented by
29732 (LocalVariableReference, ParameterReference, FieldExpr): Implement
29735 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
29736 interface for generating code, simplifies the code.
29738 2001-09-20 Ravi Pratap <ravi@ximian.com>
29740 * expression.cs (everywhere): Comment out return statements in ::Resolve
29741 methods to avoid the warnings.
29743 2001-09-20 Miguel de Icaza <miguel@ximian.com>
29745 * driver.cs (parse): Report error 2001 if we can not open the
29748 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
29751 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
29754 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
29755 otherwise nested blocks end up with the same index.
29757 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
29759 * expression.cs: Instead of having FIXMEs in the Resolve
29760 functions, throw exceptions so it is obvious that we are facing a
29763 * cs-parser.jay (invocation_expression): Pass Location information.
29765 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
29766 Use a basename for those routines because .NET does not like paths
29769 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
29772 2001-09-19 Miguel de Icaza <miguel@ximian.com>
29774 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
29775 are loading the correct data types (throws an exception if not).
29776 (TypeManager::InitCoreTypes): Use CoreLookupType
29778 * expression.cs (Unary::ResolveOperator): return the child
29779 expression for expressions which are just +expr.
29780 (Unary::ResolveOperator): Return negative literals for -LITERAL
29781 expressions (otherwise they are Unary {Literal}).
29782 (Invocation::Badness): Take into account `Implicit constant
29783 expression conversions'.
29785 * literal.cs (LongLiteral): Implement long literal class.
29786 (IntLiteral): export the `Value' of the intliteral.
29788 2001-09-19 Ravi Pratap <ravi@ximian.com>
29790 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
29792 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
29793 instead of 'Operator'
29795 * expression.cs (Binary::ResolveOperator): Update accordingly.
29796 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
29799 * cs-parser.jay (unary_expression): Update to use the new names.
29801 * gen-treedump.cs (GetUnary): Same here.
29803 * expression.cs (Unary::Resolve): Implement.
29804 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
29805 operators are found instead of making noise ;-)
29806 (Unary::ResolveOperator): New method to do precisely the same thing which
29807 Binary::ResolveOperator does for Binary expressions.
29808 (Unary.method, .Arguments): Add.
29809 (Unary::OperName): Implement.
29810 (Unary::ForceConversion): Copy and Paste !
29812 * class.cs (Operator::Define): Fix a small bug for the case when we have
29815 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
29816 for the inbuilt operators. Only overloading works for now ;-)
29818 2001-09-18 Miguel de Icaza <miguel@ximian.com>
29820 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
29821 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
29823 * expression.cs (This::Emit): Implement.
29824 (This::Resolve): Implement.
29825 (TypeOf:Resolve): Implement.
29826 (Expression::ResolveSimpleName): Add an implicit this to instance
29828 (MemberAccess::Resolve): Deal with Parameters and Fields.
29829 Bind instance variable to Field expressions.
29830 (FieldExpr::Instance): New field used to track the expression that
29831 represents the object instance.
29832 (FieldExpr::Resolve): Track potential errors from MemberLookup not
29834 (FieldExpr::Emit): Implement.
29836 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
29837 the last instruction contains a return opcode to avoid generating
29838 the last `ret' instruction (this generates correct code, and it is
29839 nice to pass the peverify output).
29841 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
29842 initializer for static and instance variables.
29843 (Constructor::Emit): Allow initializer to be null in the case of
29844 static constructors. Only emit initializer for instance
29847 (TypeContainer::FindMembers): Return a null array if there are no
29850 Also fix the code for the MemberTypes.Method branch, as it was not
29851 scanning that for operators (or tried to access null variables before).
29853 * assign.cs (Assign::Emit): Handle instance and static fields.
29857 * driver.cs: Stop compilation if there are parse errors.
29859 * cs-parser.jay (constructor_declaration): Provide default base
29860 initializer for non-static constructors.
29861 (constructor_declarator): Do not provide a default base
29862 initializers if none was specified.
29863 Catch the fact that constructors should not have parameters.
29865 * class.cs: Do not emit parent class initializers for static
29866 constructors, that should be flagged as an error.
29868 2001-09-18 Ravi Pratap <ravi@ximian.com>
29870 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
29871 Move back code into TypeContainer::Populate.
29873 2001-09-18 Ravi Pratap <ravi@ximian.com>
29875 * class.cs (TypeContainer::AddConstructor): Fix the check to
29876 compare against Name, not Basename.
29877 (Operator::OpType): Change Plus and Minus to Add and Subtract.
29879 * cs-parser.jay : Update accordingly.
29881 * class.cs (TypeContainer::FindMembers): For the case where we are searching
29882 for methods, don't forget to look into the operators too.
29883 (RegisterMethodBuilder): Helper method to take care of this for
29884 methods, constructors and operators.
29885 (Operator::Define): Completely revamp.
29886 (Operator.OperatorMethod, MethodName): New fields.
29887 (TypeContainer::Populate): Move the registering of builders into
29888 RegisterMethodBuilder.
29889 (Operator::Emit): Re-write.
29891 * expression.cs (Binary::Emit): Comment out code path to emit method
29892 invocation stuff for the case when we have a user defined operator. I am
29893 just not able to get it right !
29895 2001-09-17 Miguel de Icaza <miguel@ximian.com>
29897 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
29900 (Expression::MemberLookup): Provide a version that allows to
29901 specify the MemberTypes and BindingFlags.
29903 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
29904 so it was not fetching variable information from outer blocks.
29906 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
29907 Beforefieldinit as it was buggy.
29909 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
29910 that Ravi put here.
29912 * class.cs (Constructor::Emit): Only emit if block is not null.
29913 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
29914 deal with this by semantically definining it as if the user had
29917 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
29918 constructors as we now "emit" them at a higher level.
29920 (TypeContainer::DefineDefaultConstructor): Used to define the
29921 default constructors if none was provided.
29923 (ConstructorInitializer): Add methods Resolve and Emit.
29925 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
29927 2001-09-17 Ravi Pratap <ravi@ximian.com>
29929 * class.cs (TypeContainer::EmitDefaultConstructor): Register
29930 the default constructor builder with our hashtable for methodbuilders
29933 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
29934 and argument_count is 0 in which case we have a match.
29935 (Binary::ResolveOperator): More null checking and miscellaneous coding
29938 2001-09-17 Ravi Pratap <ravi@ximian.com>
29940 * rootcontext.cs (IsNameSpace): Compare against null.
29942 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
29944 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
29945 and Unary::Operator.
29947 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
29950 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
29951 we have overloaded operators.
29952 (Binary::ResolveOperator): Implement the part which does the operator overload
29955 * class.cs (Operator::Emit): Implement.
29956 (TypeContainer::Emit): Emit the operators we have too.
29958 * expression.cs (Binary::Emit): Update to emit the appropriate code for
29959 the case when we have a user-defined operator.
29961 2001-09-17 Miguel de Icaza <miguel@ximian.com>
29963 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
29965 2001-09-16 Ravi Pratap <ravi@ximian.com>
29967 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
29968 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
29969 (Constructor::Emit): Implement.
29970 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
29971 if we have no work to do.
29972 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
29975 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
29976 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
29978 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
29981 2001-09-15 Ravi Pratap <ravi@ximian.com>
29983 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
29985 (Tree::RecordNamespace): Method to do what the name says ;-)
29986 (Tree::Namespaces): Property to get at the namespaces hashtable.
29988 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
29991 * rootcontext.cs (IsNamespace): Fixed it :-)
29993 2001-09-14 Miguel de Icaza <miguel@ximian.com>
29995 * class.cs (TypeContainer::FindMembers): Add support for
29997 (MethodCore): New class that encapsulates both the shared aspects
29998 of a Constructor and a Method.
29999 (Method, Constructor): Factored pieces into MethodCore.
30001 * driver.cs: Added --fatal which makes errors throw exceptions.
30002 Load System assembly as well as part of the standard library.
30004 * report.cs: Allow throwing exceptions on errors for debugging.
30006 * modifiers.cs: Do not use `parent', instead use the real type
30007 container to evaluate permission settings.
30009 * class.cs: Put Ravi's patch back in. He is right, and we will
30010 have to cope with the
30012 2001-09-14 Ravi Pratap <ravi@ximian.com>
30014 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
30015 FamORAssem, not FamANDAssem.
30017 2001-09-14 Miguel de Icaza <miguel@ximian.com>
30019 * driver.cs: Added --parse option that only parses its input files
30022 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
30023 incorrect. IsTopLevel is not used to tell whether an object is
30024 root_types or not (that can be achieved by testing this ==
30025 root_types). But to see if this is a top-level *class* (not
30026 necessarly our "toplevel" container).
30028 2001-09-14 Ravi Pratap <ravi@ximian.com>
30030 * enum.cs (Enum::Define): Modify to call the Lookup method on the
30031 parent instead of a direct call to GetType.
30033 2001-09-14 Ravi Pratap <ravi@ximian.com>
30035 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
30036 Modifiers.TypeAttr. This should just be a call to that method.
30038 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
30039 object so that we can determine if we are top-level or not.
30041 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
30044 * enum.cs (Enum::Define): Ditto.
30046 * modifiers.cs (FieldAttr): Re-write.
30048 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
30049 (TypeContainer::HaveStaticConstructor): New property to provide access
30050 to precisely that info.
30052 * modifiers.cs (MethodAttr): Re-write.
30053 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
30055 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
30056 of top-level types as claimed.
30058 2001-09-13 Miguel de Icaza <miguel@ximian.com>
30060 * expression.cs (MemberLookup): Fruitless attempt to lookup
30061 constructors. Maybe I need to emit default constructors? That
30062 might be it (currently .NET emits this for me automatically).
30063 (Invocation::OverloadResolve): Cope with Arguments == null.
30064 (Invocation::EmitArguments): new function, shared by the new
30065 constructor and us.
30066 (Invocation::Emit): Handle static and instance methods. Emit
30067 proper call instruction for virtual or non-virtual invocations.
30068 (New::Emit): Implement.
30069 (New::Resolve): Implement.
30070 (MemberAccess:Resolve): Implement.
30071 (MethodGroupExpr::InstanceExpression): used conforming to the spec
30072 to track instances.
30073 (FieldExpr::Resolve): Set type.
30075 * support.cs: Handle empty arguments.
30077 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
30078 SimpleLookup): Auxiliary routines to help parse a qualifier
30081 Update qualifier_identifier rule.
30083 * codegen.cs: Removed debugging messages.
30085 * class.cs: Make this a global thing, this acts just as a "key" to
30086 objects that we might have around.
30088 (Populate): Only initialize method_builders_to_methods once.
30090 * expression.cs (PropertyExpr): Initialize type from the
30093 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
30094 Resolve pattern. Attempt to implicitly convert value to boolean.
30097 * expression.cs: Set the type for the int32/int32 argument case.
30098 (Binary::ResolveOperator): Set the return type to boolean for
30099 comparission operators
30101 * typemanager.cs: Remove debugging print code.
30103 (Invocation::Resolve): resolve type.
30105 * class.cs: Allocate a MemberInfo of the correct size, as the code
30106 elsewhere depends on the test to reflect the correct contents.
30108 (Method::) Keep track of parameters, due to System.Reflection holes
30110 (TypeContainer::Populate): Keep track of MethodBuilders to Method
30113 (TypeContainer::FindMembers): Use ArrayList and then copy an array
30114 of the exact size and return that.
30116 (Class::LookupMethodByBuilder): New function that maps
30117 MethodBuilders to its methods. Required to locate the information
30118 on methods because System.Reflection bit us again.
30120 * support.cs: New file, contains an interface ParameterData and
30121 two implementations: ReflectionParameters and InternalParameters
30122 used to access Parameter information. We will need to grow this
30125 * expression.cs (Invocation::GetParameterData): implement a cache
30126 and a wrapper around the ParameterData creation for methods.
30127 (Invocation::OverloadResolve): Use new code.
30129 2001-09-13 Ravi Pratap <ravi@ximian.com>
30131 * class.cs (TypeContainer::EmitField): Remove and move into
30132 (Field::Define): here and modify accordingly.
30133 (Field.FieldBuilder): New member.
30134 (TypeContainer::Populate): Update accordingly.
30135 (TypeContainer::FindMembers): Implement.
30137 2001-09-13 Miguel de Icaza <miguel@ximian.com>
30139 * statement.cs: (VariableInfo::VariableType): New field to be
30140 initialized with the full type once it is resolved.
30142 2001-09-12 Miguel de Icaza <miguel@ximian.com>
30144 * parameter.cs (GetParameterInfo): Use a type cache to compute
30145 things only once, and to reuse this information
30147 * expression.cs (LocalVariableReference::Emit): Implement.
30148 (OpcodeCast::Emit): fix.
30150 (ParameterReference::Resolve): Implement.
30151 (ParameterReference::Emit): Implement.
30153 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
30154 that are expressions need to stay as Expressions.
30156 * typemanager.cs (CSharpName): Returns the C# name of a type if
30159 * expression.cs (Expression::ConvertImplicit): New function that
30160 implements implicit type conversions.
30162 (Expression::ImplicitReferenceConversion): Implements implicit
30163 reference conversions.
30165 (EmptyCast): New type for transparent casts.
30167 (OpcodeCast): New type for casts of types that are performed with
30168 a sequence of bytecodes.
30170 (BoxedCast): New type used for casting value types into reference
30171 types. Emits a box opcode.
30173 (Binary::DoNumericPromotions): Implements numeric promotions of
30174 and computation of the Binary::Type.
30176 (Binary::EmitBranchable): Optimization.
30178 (Binary::Emit): Implement code emission for expressions.
30180 * typemanager.cs (TypeManager): Added two new core types: sbyte
30183 2001-09-12 Ravi Pratap <ravi@ximian.com>
30185 * class.cs (TypeContainer::FindMembers): Method which does exactly
30186 what Type.FindMembers does, only we don't have to use reflection. No
30187 implementation yet.
30189 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
30190 typecontainer objects as we need to get at them.
30191 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
30193 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
30194 typecontainer object.
30196 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
30197 of just a Report object.
30199 2001-09-11 Ravi Pratap <ravi@ximian.com>
30201 * class.cs (Event::Define): Go back to using the prefixes "add_" and
30203 (TypeContainer::Populate): Now define the delegates of the type too.
30204 (TypeContainer.Delegates): Property to access the list of delegates defined
30207 * delegates.cs (Delegate::Define): Implement partially.
30209 * modifiers.cs (TypeAttr): Handle more flags.
30211 2001-09-11 Ravi Pratap <ravi@ximian.com>
30213 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
30215 (Operator::Define): Re-write logic to get types by using the LookupType method
30216 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
30217 (Indexer::Define): Ditto.
30218 (Event::Define): Ditto.
30219 (Property::Define): Ditto.
30221 2001-09-10 Ravi Pratap <ravi@ximian.com>
30223 * class.cs (TypeContainer::Populate): Now define operators too.
30224 (TypeContainer.Operators): New property to access the list of operators
30226 (Operator.OperatorMethodBuilder): New member to hold the method builder
30227 for the operator we are defining.
30228 (Operator::Define): Implement.
30230 2001-09-10 Ravi Pratap <ravi@ximian.com>
30232 * class.cs (Event::Define): Make the prefixes of the accessor methods
30233 addOn_ and removeOn_
30235 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
30236 of the location being passed in too. Ideally, this should go later since all
30237 error reporting should be done through the Report object.
30239 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
30240 (Populate): Iterate thru the indexers we have and define them too.
30241 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
30242 for the get and set accessors.
30243 (Indexer::Define): Implement.
30245 2001-09-09 Miguel de Icaza <miguel@ximian.com>
30247 * expression.cs (Binary::Resolve): Beginning of it. I scratched
30248 my previous implementation, did not work.
30250 * typemanager.cs: Add a couple of missing types (the longs).
30252 * literal.cs: Use TypeManager.bool_type instead of getting it.
30254 * expression.cs (EventExpr): New kind of expressions.
30255 (Expressio::ExprClassFromMemberInfo): finish
30257 2001-09-08 Miguel de Icaza <miguel@ximian.com>
30259 * assign.cs: Emit stores to static fields differently.
30261 2001-09-08 Ravi Pratap <ravi@ximian.com>
30263 * Merge in changes and adjust code to tackle conflicts. Backed out my
30264 code in Assign::Resolve ;-)
30266 2001-09-08 Ravi Pratap <ravi@ximian.com>
30268 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
30269 instead Report.Error and also pass in the location.
30270 (CSharpParser::Lexer): New readonly property to return the reference
30271 to the Tokenizer object.
30272 (declare_local_variables): Use Report.Error with location instead of plain
30276 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
30277 (Operator.CheckBinaryOperator): Ditto.
30279 * cs-parser.jay (operator_declarator): Update accordingly.
30281 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
30282 (CheckBinaryOperator): Same here.
30284 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
30285 on the name without any prefixes of namespace names etc. This is because we
30286 already might have something already fully qualified like
30287 'System.Console.WriteLine'
30289 * assign.cs (Resolve): Begin implementation. Stuck ;-)
30291 2001-09-07 Ravi Pratap <ravi@ximian.com>
30293 * cs-tokenizer.cs (location): Return a string which also contains
30296 * expression.cs (ElementAccess): New class for expressions of the
30297 type 'element access.'
30298 (BaseAccess): New class for expressions of the type 'base access.'
30299 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
30302 * cs-parser.jay (element_access): Implement action.
30303 (base_access): Implement actions.
30304 (checked_expression, unchecked_expression): Implement.
30306 * cs-parser.jay (local_variable_type): Correct and implement.
30307 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
30309 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
30311 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
30312 name and the specifiers.
30314 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
30316 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
30317 making them all public ;-)
30319 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
30322 2001-09-07 Miguel de Icaza <miguel@ximian.com>
30324 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
30326 (FieldExpr, PropertyExprs): New resolved expressions.
30327 (SimpleName::MemberStaticCheck): Perform static checks for access
30328 to non-static fields on static methods. Maybe this should be
30329 generalized for MemberAccesses.
30330 (SimpleName::ResolveSimpleName): More work on simple name
30333 * cs-parser.jay (primary_expression/qualified_identifier): track
30334 the parameter index.
30336 * codegen.cs (CodeGen::Save): Catch save exception, report error.
30337 (EmitContext::EmitBoolExpression): Chain to expression generation
30338 instead of temporary hack.
30339 (::EmitStatementExpression): Put generic expression code generation.
30341 * assign.cs (Assign::Emit): Implement variable assignments to
30342 local variables, parameters and fields.
30344 2001-09-06 Miguel de Icaza <miguel@ximian.com>
30346 * statement.cs (Block::GetVariableInfo): New method, returns the
30347 VariableInfo for a variable name in a block.
30348 (Block::GetVariableType): Implement in terms of GetVariableInfo
30350 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
30351 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
30353 2001-09-06 Ravi Pratap <ravi@ximian.com>
30355 * cs-parser.jay (operator_declaration): Continue on my quest : update
30356 to take attributes argument.
30357 (event_declaration): Ditto.
30358 (enum_declaration): Ditto.
30359 (indexer_declaration): Ditto.
30361 * class.cs (Operator::Operator): Update constructor accordingly.
30362 (Event::Event): Ditto.
30364 * delegate.cs (Delegate::Delegate): Same here.
30366 * enum.cs (Enum::Enum): Same here.
30368 2001-09-05 Ravi Pratap <ravi@ximian.com>
30370 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
30372 * ../tests/cs0658.cs : New file to demonstrate error 0658.
30374 * attribute.cs (Attributes): New class to encapsulate all attributes which were
30375 being passed around as an arraylist.
30376 (Attributes::AddAttribute): Method to add attribute sections.
30378 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
30379 (struct_declaration): Update accordingly.
30380 (constant_declaration): Update.
30381 (field_declaration): Update.
30382 (method_header): Update.
30383 (fixed_parameter): Update.
30384 (parameter_array): Ditto.
30385 (property_declaration): Ditto.
30386 (destructor_declaration): Ditto.
30388 * class.cs (Struct::Struct): Update constructors accordingly.
30389 (Class::Class): Ditto.
30390 (Field::Field): Ditto.
30391 (Method::Method): Ditto.
30392 (Property::Property): Ditto.
30393 (TypeContainer::OptAttribute): update property's return type.
30395 * interface.cs (Interface.opt_attributes): New member.
30396 (Interface::Interface): Update to take the extra Attributes argument.
30398 * parameter.cs (Parameter::Parameter): Ditto.
30400 * constant.cs (Constant::Constant): Ditto.
30402 * interface.cs (InterfaceMemberBase): New OptAttributes field.
30403 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
30404 the attributes as a parameter.
30405 (InterfaceProperty): Update constructor call.
30406 (InterfaceEvent): Ditto.
30407 (InterfaceMethod): Ditto.
30408 (InterfaceIndexer): Ditto.
30410 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
30411 pass the attributes too.
30412 (interface_event_declaration): Ditto.
30413 (interface_property_declaration): Ditto.
30414 (interface_method_declaration): Ditto.
30415 (interface_declaration): Ditto.
30417 2001-09-05 Miguel de Icaza <miguel@ximian.com>
30419 * class.cs (Method::Define): Track the "static Main" definition to
30420 create an entry point.
30422 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
30423 EntryPoint if we find it.
30425 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
30426 (EmitContext::ig): Make this variable public.
30428 * driver.cs: Make the default output file be the first file name
30429 with the .exe extension.
30431 Detect empty compilations
30433 Handle various kinds of output targets. Handle --target and
30434 rename -t to --dumper.
30436 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
30437 methods inherited from Expression return now an Expression. This
30438 will is used during the tree rewriting as we resolve them during
30441 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
30442 the spec. Missing entirely is the information about
30443 accessability of elements of it.
30445 (Expression::ExprClassFromMemberInfo): New constructor for
30446 Expressions that creates a fully initialized Expression based on
30447 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
30450 (Invocation::Resolve): Begin implementing resolution of invocations.
30452 * literal.cs (StringLiteral): Implement Emit.
30454 2001-09-05 Ravi Pratap <ravi@ximian.com>
30456 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
30459 2001-09-04 Ravi Pratap <ravi@ximian.com>
30461 * cs-parser.jay (attribute_arguments): Implement actions.
30462 (attribute): Fix bug in production. Implement action.
30463 (attribute_list): Implement.
30464 (attribute_target): Implement.
30465 (attribute_target_specifier, opt_target_specifier): Implement
30466 (CheckAttributeTarget): New method to check if the attribute target
30468 (attribute_section): Implement.
30469 (opt_attributes): Implement.
30471 * attribute.cs : New file to handle attributes.
30472 (Attribute): Class to hold attribute info.
30474 * cs-parser.jay (opt_attribute_target_specifier): Remove production
30475 (attribute_section): Modify production to use 2 different rules to
30476 achieve the same thing. 1 s/r conflict down !
30477 Clean out commented, useless, non-reducing dimension_separator rules.
30479 * class.cs (TypeContainer.attributes): New member to hold list
30480 of attributes for a type.
30481 (Struct::Struct): Modify to take one more argument, the attribute list.
30482 (Class::Class): Ditto.
30483 (Field::Field): Ditto.
30484 (Method::Method): Ditto.
30485 (Property::Property): Ditto.
30487 * cs-parser.jay (struct_declaration): Update constructor call to
30488 pass in the attributes too.
30489 (class_declaration): Ditto.
30490 (constant_declaration): Ditto.
30491 (field_declaration): Ditto.
30492 (method_header): Ditto.
30493 (fixed_parameter): Ditto.
30494 (parameter_array): Ditto.
30495 (property_declaration): Ditto.
30497 * constant.cs (Constant::Constant): Update constructor similarly.
30498 Use System.Collections.
30500 * parameter.cs (Parameter::Parameter): Update as above.
30502 2001-09-02 Ravi Pratap <ravi@ximian.com>
30504 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
30505 (TypeContainer.delegates): New member to hold list of delegates.
30507 * cs-parser.jay (delegate_declaration): Implement the action correctly
30508 this time as I seem to be on crack ;-)
30510 2001-09-02 Miguel de Icaza <miguel@ximian.com>
30512 * rootcontext.cs (RootContext::IsNamespace): new function, used to
30513 tell whether an identifier represents a namespace.
30515 * expression.cs (NamespaceExpr): A namespace expression, used only
30516 temporarly during expression resolution.
30517 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
30518 utility functions to resolve names on expressions.
30520 2001-09-01 Miguel de Icaza <miguel@ximian.com>
30522 * codegen.cs: Add hook for StatementExpressions.
30524 * class.cs: Fix inverted test for static flag in methods.
30526 2001-09-02 Ravi Pratap <ravi@ximian.com>
30528 * class.cs (Operator::CheckUnaryOperator): Correct error number used
30529 to make it coincide with MS' number.
30530 (Operator::CheckBinaryOperator): Ditto.
30532 * ../errors/errors.txt : Remove error numbers added earlier.
30534 * ../errors/cs1019.cs : Test case for error # 1019
30536 * ../errros/cs1020.cs : Test case for error # 1020
30538 * cs-parser.jay : Clean out commented cruft.
30539 (dimension_separators, dimension_separator): Comment out. Ostensibly not
30540 used anywhere - non-reducing rule.
30541 (namespace_declarations): Non-reducing rule - comment out.
30543 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
30544 with TypeContainer::AddEnum.
30546 * delegate.cs : New file for delegate handling classes.
30547 (Delegate): Class for declaring delegates.
30549 * makefile : Update.
30551 * cs-parser.jay (delegate_declaration): Implement.
30553 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
30555 * class.cs (Event::Define): Implement.
30556 (Event.EventBuilder): New member.
30558 * class.cs (TypeContainer::Populate): Update to define all enums and events
30560 (Events): New property for the events arraylist we hold. Shouldn't we move to using
30561 readonly fields for all these cases ?
30563 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
30565 * class.cs (Property): Revamp to use the convention of making fields readonly.
30566 Accordingly modify code elsewhere.
30568 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
30569 the Define method of the Property class.
30571 * class.cs : Clean up applied patch and update references to variables etc. Fix
30573 (TypeContainer::Populate): Update to define all the properties we have. Also
30574 define all enumerations.
30576 * enum.cs (Define): Implement.
30578 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
30580 * cs-parser.jay (overloadable_operator): The semantic value is an
30581 enum of the Operator class.
30582 (operator_declarator): Implement actions.
30583 (operator_declaration): Implement.
30585 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
30586 validity of definitions.
30587 (Operator::CheckBinaryOperator): Static method to check for binary operators
30588 (TypeContainer::AddOperator): New method to add an operator to a type.
30590 * cs-parser.jay (indexer_declaration): Added line to actually call the
30591 AddIndexer method so it gets added ;-)
30593 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
30594 already taken care of by the MS compiler ?
30596 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
30598 * class.cs (Operator): New class for operator declarations.
30599 (Operator::OpType): Enum for the various operators.
30601 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
30603 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
30604 ostensibly handle this in semantic analysis.
30606 * cs-parser.jay (general_catch_clause): Comment out
30607 (specific_catch_clauses, specific_catch_clause): Ditto.
30608 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
30609 (catch_args, opt_catch_args): New productions.
30610 (catch_clause): Rewrite to use the new productions above
30611 (catch_clauses): Modify accordingly.
30612 (opt_catch_clauses): New production to use in try_statement
30613 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
30614 and re-write the code in the actions to extract the specific and
30615 general catch clauses by being a little smart ;-)
30617 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
30618 Hooray, try and catch statements parse fine !
30620 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30622 * statement.cs (Block::GetVariableType): Fix logic to extract the type
30623 string from the hashtable of variables.
30625 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
30626 I end up making that mistake ;-)
30627 (catch_clauses): Fixed gross error which made Key and Value of the
30628 DictionaryEntry the same : $1 !!
30630 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30632 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
30634 * cs-parser.jay (event_declaration): Correct to remove the semicolon
30635 when the add and remove accessors are specified.
30637 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30639 * cs-parser.jay (IndexerDeclaration): New helper class to hold
30640 information about indexer_declarator.
30641 (indexer_declarator): Implement actions.
30642 (parsing_indexer): New local boolean used to keep track of whether
30643 we are parsing indexers or properties. This is necessary because
30644 implicit_parameters come into picture even for the get accessor in the
30645 case of an indexer.
30646 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
30648 * class.cs (Indexer): New class for indexer declarations.
30649 (TypeContainer::AddIndexer): New method to add an indexer to a type.
30650 (TypeContainer::indexers): New member to hold list of indexers for the
30653 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
30655 * cs-parser.jay (add_accessor_declaration): Implement action.
30656 (remove_accessor_declaration): Implement action.
30657 (event_accessors_declaration): Implement
30658 (variable_declarators): swap statements for first rule - trivial.
30660 * class.cs (Event): New class to hold information about event
30662 (TypeContainer::AddEvent): New method to add an event to a type
30663 (TypeContainer::events): New member to hold list of events.
30665 * cs-parser.jay (event_declaration): Implement actions.
30667 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
30669 * cs-parser.jay (dim_separators): Implement. Make it a string
30670 concatenating all the commas together, just as they appear.
30671 (opt_dim_separators): Modify accordingly
30672 (rank_specifiers): Update accordingly. Basically do the same
30673 thing - instead, collect the brackets here.
30674 (opt_rank_sepcifiers): Modify accordingly.
30675 (array_type): Modify to actually return the complete type string
30676 instead of ignoring the rank_specifiers.
30677 (expression_list): Implement to collect the expressions
30678 (variable_initializer): Implement. We make it a list of expressions
30679 essentially so that we can handle the array_initializer case neatly too.
30680 (variable_initializer_list): Implement.
30681 (array_initializer): Make it a list of variable_initializers
30682 (opt_array_initializer): Modify accordingly.
30684 * expression.cs (New::NType): Add enumeration to help us
30685 keep track of whether we have an object/delegate creation
30686 or an array creation.
30687 (New:NewType, New::Rank, New::Indices, New::Initializers): New
30688 members to hold data about array creation.
30689 (New:New): Modify to update NewType
30690 (New:New): New Overloaded contructor for the array creation
30693 * cs-parser.jay (array_creation_expression): Implement to call
30694 the overloaded New constructor.
30696 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
30698 * class.cs (TypeContainer::Constructors): Return member
30699 constructors instead of returning null.
30701 2001-08-26 Miguel de Icaza <miguel@ximian.com>
30703 * typemanager.cs (InitCoreTypes): Initialize the various core
30704 types after we have populated the type manager with the user
30705 defined types (this distinction will be important later while
30706 compiling corlib.dll)
30708 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
30709 on Expression Classification. Now all expressions have a method
30710 `Resolve' and a method `Emit'.
30712 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
30713 generation from working. Also add some temporary debugging
30716 2001-08-24 Miguel de Icaza <miguel@ximian.com>
30718 * codegen.cs: Lots of code generation pieces. This is only the
30719 beginning, will continue tomorrow with more touches of polish. We
30720 handle the fundamentals of if, while, do, for, return. Others are
30721 trickier and I need to start working on invocations soon.
30723 * gen-treedump.cs: Bug fix, use s.Increment here instead of
30726 * codegen.cs (EmitContext): New struct, used during code
30727 emission to keep a context. Most of the code generation will be
30730 * cs-parser.jay: Add embedded blocks to the list of statements of
30731 this block. So code generation proceeds in a top down fashion.
30733 2001-08-23 Miguel de Icaza <miguel@ximian.com>
30735 * statement.cs: Add support for multiple child blocks.
30737 2001-08-22 Miguel de Icaza <miguel@ximian.com>
30739 * codegen.cs (EmitCode): New function, will emit the code for a
30740 Block of code given a TypeContainer and its ILGenerator.
30742 * statement.cs (Block): Standard public readonly optimization.
30743 (Block::Block constructors): Link children.
30744 (Block::Child): Child Linker.
30745 (Block::EmitVariables): Emits IL variable declarations.
30747 * class.cs: Drop support for MethodGroups here, delay until
30749 (Method::): Applied the same simplification that I did before, and
30750 move from Properties to public readonly fields.
30751 (Method::ParameterTypes): Returns the parameter types for the
30752 function, and implements a cache that will be useful later when I
30753 do error checking and the semantic analysis on the methods is
30755 (Constructor::GetCallingConvention): Renamed from CallingConvetion
30756 and made a method, optional argument tells whether this is a class
30757 or a structure to apply the `has-this' bit.
30758 (Method::GetCallingConvention): Implement, returns the calling
30760 (Method::Define): Defines the type, a second pass is performed
30761 later to populate the methods.
30763 (Constructor::ParameterTypes): implement a cache similar to the
30764 one on Method::ParameterTypes, useful later when we do semantic
30767 (TypeContainer::EmitMethod): New method. Emits methods.
30769 * expression.cs: Removed MethodGroup class from here.
30771 * parameter.cs (Parameters::GetCallingConvention): new method.
30773 2001-08-21 Miguel de Icaza <miguel@ximian.com>
30775 * class.cs (TypeContainer::Populate): Drop RootContext from the
30778 (Constructor::CallingConvention): Returns the calling convention.
30779 (Constructor::ParameterTypes): Returns the constructor parameter
30782 (TypeContainer::AddConstructor): Keep track of default constructor
30783 and the default static constructor.
30785 (Constructor::) Another class that starts using `public readonly'
30786 instead of properties.
30788 (Constructor::IsDefault): Whether this is a default constructor.
30790 (Field::) use readonly public fields instead of properties also.
30792 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
30793 track of static constructors; If none is used, turn on
30794 BeforeFieldInit in the TypeAttributes.
30796 * cs-parser.jay (opt_argument_list): now the return can be null
30797 for the cases where there are no arguments.
30799 (constructor_declarator): If there is no implicit `base' or
30800 `this', then invoke the default parent constructor.
30802 * modifiers.cs (MethodAttr): New static function maps a set of
30803 modifiers flags into a MethodAttributes enum
30804 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
30805 MethodAttr, TypeAttr to represent the various mappings where the
30806 modifiers are used.
30807 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
30809 2001-08-19 Miguel de Icaza <miguel@ximian.com>
30811 * parameter.cs (GetParameterInfo): Fix bug where there would be no
30814 * interface.cs (PopulateIndexer): Implemented the code generator
30815 for interface indexers.
30817 2001-08-17 Miguel de Icaza <miguel@ximian.com>
30819 * interface.cs (InterfaceMemberBase): Now we track the new status
30822 (PopulateProperty): Implement property population. Woohoo! Got
30823 Methods and Properties going today.
30825 Removed all the properties for interfaces, and replaced them with
30826 `public readonly' fields.
30828 2001-08-16 Miguel de Icaza <miguel@ximian.com>
30830 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
30831 initialize their hashtables/arraylists only when they are needed
30832 instead of doing this always.
30834 * parameter.cs: Handle refs and out parameters.
30836 * cs-parser.jay: Use an ArrayList to construct the arguments
30837 instead of the ParameterCollection, and then cast that to a
30840 * parameter.cs: Drop the use of ParameterCollection and use
30841 instead arrays of Parameters.
30843 (GetParameterInfo): Use the Type, not the Name when resolving
30846 2001-08-13 Miguel de Icaza <miguel@ximian.com>
30848 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
30849 and instead use public readonly fields.
30851 * class.cs: Put back walking code for type containers.
30853 2001-08-11 Miguel de Icaza <miguel@ximian.com>
30855 * class.cs (MakeConstant): Code to define constants.
30857 * rootcontext.cs (LookupType): New function. Used to locate types
30860 2001-08-08 Miguel de Icaza <miguel@ximian.com>
30862 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
30863 this System.Reflection code is. Kudos to Microsoft
30865 * typemanager.cs: Implement a type cache and avoid loading all
30866 types at boot time. Wrap in LookupType the internals. This made
30867 the compiler so much faster. Wow. I rule!
30869 * driver.cs: Make sure we always load mscorlib first (for
30870 debugging purposes, nothing really important).
30872 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
30873 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
30875 * rootcontext.cs: Lookup types on their namespace; Lookup types
30876 on namespaces that have been imported using the `using' keyword.
30878 * class.cs (TypeContainer::TypeAttr): Virtualize.
30879 (Class::TypeAttr): Return attributes suitable for this bad boy.
30880 (Struct::TypeAttr): ditto.
30881 Handle nested classes.
30882 (TypeContainer::) Remove all the type visiting code, it is now
30883 replaced with the rootcontext.cs code
30885 * rootcontext.cs (GetClassBases): Added support for structs.
30887 2001-08-06 Miguel de Icaza <miguel@ximian.com>
30889 * interface.cs, statement.cs, class.cs, parameter.cs,
30890 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
30891 Drop use of TypeRefs, and use strings instead.
30893 2001-08-04 Miguel de Icaza <miguel@ximian.com>
30897 * class.cs (Struct::Struct): set the SEALED flags after
30898 checking the modifiers.
30899 (TypeContainer::TypeAttr): new property, returns the
30900 TypeAttributes for a class.
30902 * cs-parser.jay (type_list): Oops, list production was creating a
30903 new list of base types.
30905 * rootcontext.cs (StdLib): New property.
30906 (GetInterfaceTypeByName): returns an interface by type name, and
30907 encapsulates error handling here.
30908 (GetInterfaces): simplified.
30909 (ResolveTree): Encapsulated all the tree resolution here.
30910 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
30913 * driver.cs: Add support for --nostdlib, to avoid loading the
30914 default assemblies.
30915 (Main): Do not put tree resolution here.
30917 * rootcontext.cs: Beginning of the class resolution.
30919 2001-08-03 Miguel de Icaza <miguel@ximian.com>
30921 * rootcontext.cs: Provide better error reporting.
30923 * cs-parser.jay (interface_base): set our $$ to be interfaces.
30925 * rootcontext.cs (CreateInterface): Handle the case where there
30926 are no parent interfaces.
30928 (CloseTypes): Routine to flush types at the end.
30929 (CreateInterface): Track types.
30930 (GetInterfaces): Returns an array of Types from the list of
30931 defined interfaces.
30933 * typemanager.c (AddUserType): Mechanism to track user types (puts
30934 the type on the global type hash, and allows us to close it at the
30937 2001-08-02 Miguel de Icaza <miguel@ximian.com>
30939 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
30940 RecordInterface instead.
30942 * cs-parser.jay: Updated to reflect changes above.
30944 * decl.cs (Definition): Keep track of the TypeBuilder type that
30945 represents this type here. Not sure we will use it in the long
30946 run, but wont hurt for now.
30948 * driver.cs: Smaller changes to accomodate the new code.
30950 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
30953 * rootcontext.cs (CreateInterface): New method, used to create
30954 the System.TypeBuilder type for interfaces.
30955 (ResolveInterfaces): new entry point to resolve the interface
30957 (CodeGen): Property, used to keep track of the code generator.
30959 2001-07-26 Miguel de Icaza <miguel@ximian.com>
30961 * cs-parser.jay: Add a second production for delegate_declaration
30964 (enum_body): Put an opt_comma here instead of putting it on
30965 enum_body or enum_member_declarations so we can handle trailing
30966 commas on enumeration members. Gets rid of a shift/reduce.
30968 (type_list): Need a COMMA in the middle.
30970 (indexer_declaration): Tell tokenizer to recognize get/set
30972 * Remove old targets.
30974 * Re-add the parser target.
30976 2001-07-13 Simon Cozens <simon@simon-cozens.org>
30978 * cs-parser.jay: Add precendence rules for a number of operators
30979 ot reduce the number of shift/reduce conflicts in the grammar.
30981 2001-07-17 Miguel de Icaza <miguel@ximian.com>
30983 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
30986 Get rid of old crufty code.
30988 * rootcontext.cs: Use this to keep track of the parsed
30989 representation and the defined types available to the program.
30991 * gen-treedump.cs: adjust for new convention.
30993 * type.cs: Split out the type manager, and the assembly builder
30996 * typemanager.cs: the type manager will live here now.
30998 * cil-codegen.cs: And the code generator here.
31000 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
31002 * makefile: Fixed up for easy making.
31004 2001-07-13 Simon Cozens <simon@simon-cozens.org>
31006 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
31009 (unary_expression): Expand pre_increment_expression and
31010 post_decrement_expression to reduce a shift/reduce.
31012 2001-07-11 Simon Cozens
31014 * cs-tokenizer.cs: Hex numbers should begin with a 0.
31016 Improve allow_keyword_as_indent name.
31018 2001-06-19 Miguel de Icaza <miguel@ximian.com>
31020 * Adjustments for Beta2.
31022 2001-06-13 Miguel de Icaza <miguel@ximian.com>
31024 * decl.cs: Added `Define' abstract method.
31025 (InTransit): new property, used to catch recursive definitions.
31027 * interface.cs: Implement `Define'.
31029 * modifiers.cs: Map Modifiers.constants to
31030 System.Reflection.TypeAttribute flags.
31032 * class.cs: Keep track of types and user-defined types.
31033 (BuilderInit): New method for creating an assembly
31034 (ResolveType): New function to launch the resolution process, only
31035 used by interfaces for now.
31037 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
31038 that are inserted into the name space.
31040 2001-06-08 Miguel de Icaza <miguel@ximian.com>
31042 * ARGH. I have screwed up my tree so many times due to the use of
31043 rsync rather than using CVS. Going to fix this at once.
31045 * driver.cs: Objetify driver. Load assemblies, use assemblies to
31048 2001-06-07 Miguel de Icaza <miguel@ximian.com>
31050 * Experiment successful: Use System.Type rather that our own
31053 2001-05-25 Miguel de Icaza <miguel@ximian.com>
31055 * cs-parser.jay: Removed nsAliases from here.
31057 Use new namespaces, handle `using XXX;'
31059 * namespace.cs: Reimplemented namespace handling, use a recursive
31060 definition of the class. Now we can keep track of using clauses
31061 and catch invalid using clauses.
31063 2001-05-24 Miguel de Icaza <miguel@ximian.com>
31065 * gen-treedump.cs: Adapted for all the renaming.
31067 * expression.cs (Expression): this class now has a Type property
31068 which returns an expression Type.
31070 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
31071 `Type', as this has a different meaning now in the base
31073 2001-05-22 Miguel de Icaza <miguel@ximian.com>
31075 * interface.cs, class.cs: Removed from all the sources the
31076 references to signature computation, as we can not do method
31077 signature computation during the parsing time, as we are not
31078 trying to solve at that point distinguishing:
31082 void a (NS.Blah x) {}
31085 Which depending on the context might be valid or not, as we do not
31086 know if Blah is the same thing as NS.Blah at that point.
31088 * Redid everything so the code uses TypeRefs now instead of
31089 Types. TypeRefs are just temporary type placeholders, that need
31090 to be resolved. They initially have a pointer to a string and the
31091 current scope in which they are used. This is used later by the
31092 compiler to resolve the reference to an actual Type.
31094 * DeclSpace is no longer a CIR.Type, and neither are
31095 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
31096 are all DeclSpaces, but no Types.
31098 * type.cs (TypeRefManager): This implements the TypeRef manager,
31099 which keeps track of all the types that need to be resolved after
31100 the parsing has finished.
31102 2001-05-13 Miguel de Icaza <miguel@ximian.com>
31104 * ARGH. We are going to have to store `foreach' as a class rather
31105 than resolving it, as we need to verify error 1579 after name
31106 resolution. *OR* we could keep a flag that says `This request to
31107 IEnumerator comes from a foreach statement' which we can then use
31108 to generate the error.
31110 2001-05-10 Miguel de Icaza <miguel@ximian.com>
31112 * class.cs (TypeContainer.AddMethod): we now add methods to the
31113 MethodGroup instead of the method hashtable.
31115 * expression.cs: Add MethodGroup abstraction, which gets us one
31116 step closer to the specification in the way we handle method
31119 * cs-parser.jay (primary_expression): qualified_identifier now
31120 tried to match up an identifier to a local variable reference or
31121 to a parameter reference.
31123 current_local_parameters is now a parser global variable that
31124 points to the current parameters for the block, used during name
31127 (property_declaration): Now creates an implicit `value' argument to
31130 2001-05-09 Miguel de Icaza <miguel@ximian.com>
31132 * parameter.cs: Do not use `param' arguments as part of the
31133 signature, per the spec.
31135 2001-05-08 Miguel de Icaza <miguel@ximian.com>
31137 * decl.cs: Base class for classes, structs and interfaces. This
31138 is the "Declaration Space"
31140 * cs-parser.jay: Use CheckDef for checking declaration errors
31141 instead of having one on each function.
31143 * class.cs: Factor out some code for handling error handling in
31144 accordance to the "Declarations" section in the "Basic Concepts"
31145 chapter in the ECMA C# spec.
31147 * interface.cs: Make all interface member classes derive from
31148 InterfaceMemberBase.
31150 2001-05-07 Miguel de Icaza <miguel@ximian.com>
31152 * Many things: all interfaces are parsed and generated in
31153 gen-treedump. Support for member variables, constructors,
31154 destructors, properties, constants is there.
31156 Beginning of the IL backend, but very little done, just there for
31159 2001-04-29 Miguel de Icaza <miguel@ximian.com>
31161 * cs-parser.jay: Fix labeled statement.
31163 * cs-tokenizer.cs (escape): Escape " and ' always.
31164 ref_line, ref_name: keep track of the line/filename as instructed
31165 by #line by the compiler.
31168 2001-04-27 Miguel de Icaza <miguel@ximian.com>
31170 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
31171 to match the values in System.CodeDOM.
31173 Divid renamed to Divide.
31175 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
31177 (Statements.set): remove.
31179 * System.CodeDOM/CodeCatchClause.cs: always have a valid
31182 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
31183 falseStatements always have valid values.
31185 * cs-parser.jay: Use System.CodeDOM now.