1 2008-10-05 Marek Safar <marek.safar@gmail.com>
3 * cs-parser.jay: Allow parsing weird array creation construct.
5 2008-10-05 Marek Safar <marek.safar@gmail.com>
7 * cs-parser.jay: Conflicts reduction.
9 2008-10-04 Marek Safar <marek.safar@gmail.com>
11 * cs-parser.jay: Conflicts reduction.
13 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
16 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
17 property. Add a 'count' hint about the use of the shared vector.
18 Ensure that we don't leak out dirty bits.
19 (UsageVector.MergeChild): Throw away information about variables
21 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
23 2008-10-03 Marek Safar <marek.safar@gmail.com>
26 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
27 parameters when iterator is created.
29 2008-10-03 Marek Safar <marek.safar@gmail.com>
32 * expression.cs: Fixed right based pointer arithmetic operations
35 2008-10-03 Marek Safar <marek.safar@gmail.com>
38 * assign.cs, expression.cs: Fixed compound assignment conversions.
40 2008-10-02 Marek Safar <marek.safar@gmail.com>
43 * statement.cs: Refactor ArrayForeach to be usable with string
44 indexer. Optimized single dimentional arrays foreach.
46 2008-10-02 Marek Safar <marek.safar@gmail.com>
49 * anonymous.cs, expression.cs: Removed broken optimization.
51 2008-10-01 Marek Safar <marek.safar@gmail.com>
53 * anonymous.cs: Use full type parameters of parent generic
54 containers. Removed unnecessary AddParentStoreyReference call.
56 2008-10-01 Marek Safar <marek.safar@gmail.com>
59 * class.cs: Use better shorter names for explicit interface member
62 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
64 2008-10-01 Marek Safar <marek.safar@gmail.com>
66 * expression.cs: Use new interface to check fixed expression.
68 2008-10-01 Marek Safar <marek.safar@gmail.com>
71 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
72 interface to check for fixed fixed-buffers.
74 2008-10-01 Marek Safar <marek.safar@gmail.com>
77 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
79 * delegate.cs: Removed unnecessary casts.
81 2008-09-30 Marek Safar <marek.safar@gmail.com>
84 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
85 class.cs: Fixed already defined explicit interface members check.
87 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
89 cs-tokenizer.cs: Fix typo.
91 2008-09-28 Miguel de Icaza <miguel@novell.com>
93 * eval.cs (InteractiveBase): The quit command now just sets a
94 flag, instead of calling Environment.Exit(), it is milder on
97 CompiledMethod is now in Mono.CSharp, not nested inside
98 the Evaluator, it was inconvenient to use.
100 2008-09-27 Miguel de Icaza <miguel@novell.com>
102 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
103 code to be invoked without having to reparse.
105 2008-09-27 Miguel de Icaza <miguel@novell.com>
107 * ecore.cs: The recent changes to FieldExpr broke this as well.
108 Fixes LINQ queries in the interactive shell.
110 * Multiple files: indentation fixing for the Mono coding
111 guidelines for the switch statement.
113 * eval.cs: Make the Evaluator API thread safe.
115 2008-09-26 Marek Safar <marek.safar@gmail.com>
117 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
120 2008-09-26 Marek Safar <marek.safar@gmail.com>
122 A fix for bug #325326
123 * statement.cs: Check possible mistaken empty statement using
124 explicit blocks only.
126 2008-09-25 Miguel de Icaza <miguel@novell.com>
128 * eval.cs (LoadAssembly, ReferenceAssembly): Call
129 RootNamespace.ComputeNamespaces to update the internal list of
130 namespaces, this is no longer done for us.
132 (InteractiveBase): Use the Evaluator APIs instead of calling into
135 2008-09-25 Marek Safar <marek.safar@gmail.com>
137 A fix for bug #429264
138 * expression.cs: Missing mutator for access to multidimensional
141 2008-09-25 Marek Safar <marek.safar@gmail.com>
143 * class.cs, statement: Emit DebuggerHidden attribute for iterator
146 * driver.cs: Missing input argument check.
148 2008-09-25 Marek Safar <marek.safar@gmail.com>
150 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
151 expression.cs, statement.cs, rootcontext.cs, class.cs,
152 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
155 2008-09-24 Miguel de Icaza <miguel@novell.com>
157 * ecore.cs (FieldExpr): Only initialize eclass when we return a
158 fully constructed FieldExpr, fixes the regression introduced in
161 * ecore.cs, expression.cs: Plug back the eclass initialization as
162 otherwise it regresses `csharp'.
164 2008-09-24 Marek Safar <marek.safar@gmail.com>
166 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
167 ecore.cs, attribute.cs: Moved obsolete method checks from emit
168 phase to resolve phase. It resolves problems with expression trees
169 and fixes bugs #323796, #325156.
171 2008-09-23 Marek Safar <marek.safar@gmail.com>
173 * codegen.cs: Report better error when symbol writer is missing.
175 2008-09-23 Marek Safar <marek.safar@gmail.com>
177 * codegen.cs: Set .NET symbol writer.
179 * decl.cs: Guard against null generic arguments.
181 * report.cs: Don't report exactly same additional details.
183 2008-09-22 Marek Safar <marek.safar@gmail.com>
185 A fix for bug #324917
186 * cs-parser.jay: Add missing multidimensional non-expression type
189 2008-09-22 Marek Safar <marek.safar@gmail.com>
191 A fix for bug #428191
192 * anonymous.cs: Create an outer generic fields also for non-storey
195 2008-09-22 Marek Safar <marek.safar@gmail.com>
197 A fix for bug #378294
198 * class.cs: Make fixed size buffers gmcs feature only.
200 2008-09-22 Marek Safar <marek.safar@gmail.com>
202 A fix for bug #355622, #324993
203 * assign.cs, const.cs, class.cs: Create new EmitContext for each
206 2008-09-19 Marek Safar <marek.safar@gmail.com>
208 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
211 2008-09-19 Marek Safar <marek.safar@gmail.com>
213 A fix for bug #416110
214 * generic.cs: Struct constraint results in default ctor and
215 ValueType base type constraint to be set.
217 2008-09-19 Marek Safar <marek.safar@gmail.com>
219 A fix for bug #423791
220 * generic.cs: Fixed params output type type-inference.
222 2008-09-19 Marek Safar <marek.safar@gmail.com>
224 * cs-parser.jay, expression.cs: Fixed few expression crashes.
226 2008-09-19 Marek Safar <marek.safar@gmail.com>
228 * cs-tokenizer.cs: Don't break on extra partial modifier.
230 2008-09-19 Marek Safar <marek.safar@gmail.com>
232 A fix for bug #427592
233 * generic.cs: Use common parameter resolve method.
235 2008-09-18 Marek Safar <marek.safar@gmail.com>
237 A fix for bug #414758
238 * expression.cs, ecore.cs: Fixed crash when accessing non-static
241 2008-09-18 Marek Safar <marek.safar@gmail.com>
243 * driver.cs, namespace.cs: Read types and namespaces after all
244 requested assemblies are loaded, fixes issues with System.Core
245 auto-reference, and #419888.
247 2008-09-18 Marek Safar <marek.safar@gmail.com>
249 A fix for bug #417705
250 * cs-parser.jay: Fixed as/is operator expression split.
252 2008-09-18 Marek Safar <marek.safar@gmail.com>
254 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
255 Fixed expression tree representation of empty new expression and
256 new initializer expression.
258 2008-09-18 Miguel de Icaza <miguel@novell.com>
260 * eval.cs: Remove warning, keep reference to driver around.
262 * Hide fields that do not need to be public.
264 2008-09-17 Marek Safar <marek.safar@gmail.com>
266 A fix for bug #426385
267 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
268 conversion for array elements.
270 2008-09-17 Marek Safar <marek.safar@gmail.com>
272 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
273 void parsing conflicts.
275 2008-09-15 Marek Safar <marek.safar@gmail.com>
277 A fix for bug #425601
278 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
279 System.Core only when there is no custom ExtensionAttribute
282 2008-09-15 Miguel de Icaza <miguel@novell.com>
284 * namespace.cs: Do not report CS0246 (name
286 2008-09-12 Marek Safar <marek.safar@gmail.com>
288 A fix for bug #425669
289 * generic.cs: Don't cache generic static anonymous method
292 2008-09-12 Marek Safar <marek.safar@gmail.com>
294 * generic.cs, class.cs, delegate.cs: Check recursive inherited
295 conflicting constraints.
297 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
299 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
302 2008-09-12 Marek Safar <marek.safar@gmail.com>
304 * literal.cs, convert.cs, expression.cs, statement.cs: More null
305 to null pointer conversion fixes.
307 2008-09-11 Marek Safar <marek.safar@gmail.com>
309 * cs-parser.jay, expression.cs: An implicitly typed local variable
310 declarator cannot use an array initializer.
312 2008-09-11 Marek Safar <marek.safar@gmail.com>
314 * cs-parser.jay: Reduced number of printed tokens, add sorting.
316 2008-09-11 Marek Safar <marek.safar@gmail.com>
318 * generic.cs (InflatedConstraints): Don't crash when constraints
321 * cs-parser.jay: const_declarator is a block.
323 * constant.cs: Check for not allowed NaN conversions.
325 2008-09-10 Miguel de Icaza <miguel@novell.com>
327 * driver.cs: Drop --shell argument, the compiler is no longer a
330 * eval.cs: Move most of the code that deals with evaluation into
331 this file and document the public API from repl.cs
333 * repl.cs: Remove from here.
335 2008-09-10 Marek Safar <marek.safar@gmail.com>
337 A fix for bug #424684
338 * generic.cs: Generic class constraints must come first.
340 2008-09-09 Miguel de Icaza <miguel@novell.com>
342 * cs-parser.jay: Improve error reporting for syntax errors in
343 statements and expressions, we now report the expected tokens
344 instead of reporting the useless "; expected".
346 Drop the strings from the token declaration, it turns out that
347 they did not do what I thought they did. Instead they were adding
348 two sets of tokens to the tables.
350 2008-09-09 Marek Safar <marek.safar@gmail.com>
352 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
353 delegate.cs: Share special type check.
355 2008-09-09 Marek Safar <marek.safar@gmail.com>
357 A fix for bug #423981
358 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
360 2008-09-09 Marek Safar <marek.safar@gmail.com>
362 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
365 2008-09-09 Marek Safar <marek.safar@gmail.com>
367 A fix for bugs: #324750, #335946
368 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
369 lookup rule to determine ?-based tokens.
371 2008-09-08 Miguel de Icaza <miguel@novell.com>
373 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
374 expressions (like event adding or removing) end up here, so we
375 need to treat those as statements.
377 Add LoadAssembly method.
379 2008-09-04 Miguel de Icaza <miguel@novell.com>
381 * repl.cs: Add Time method.
383 2008-09-05 Marek Safar <marek.safar@gmail.com>
385 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
387 2008-09-05 Miguel de Icaza <miguel@novell.com>
389 * repl.cs: Add workaround for old compilers.
391 2008-09-04 Jb Evain <jbevain@novell.com>
393 * repl.cs (PrettyPrint): pretty print everything that
394 implements IDictionary, as well as IEnumerables. Also,
395 add a quit helper property.
397 2008-09-04 Marek Safar <marek.safar@gmail.com>
399 * constant.cs: Better error reporting for decimal literals.
401 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
404 2008-09-04 Marek Safar <marek.safar@gmail.com>
405 Miguel de Icaza <miguel@novell.com>
407 A fix for bug #422951
408 * assign.cs (Assign.DoResolve): Perform the type conversions
409 checks before we attempt to initialize `New' initializers.
411 2008-09-04 Marek Safar <marek.safar@gmail.com>
413 A fix for bug #422853
414 * delegate.cs (DelegateCreation): Add special handling for
415 EmptyExpression.Null instance expression which is just another
416 hack for undecided member instance exression.
418 2008-09-04 Marek Safar <marek.safar@gmail.com>
420 * expression.cs, ecore.cs: Emit full expression tree for reduced
423 2008-09-04 Marek Safar <marek.safar@gmail.com>
425 * expression.cs (This): Guard against multi-resolving.
427 * ecore.cs, statement.cs (Throw): Simplified.
429 * flowanalysis.cs: Also verify event fields.
431 2008-09-04 Miguel de Icaza <miguel@novell.com>
433 * assign.cs (Assign.DoResolve): Perform the type conversions
434 checks before we attempt to initialize `New' initializers.
436 * repl.cs (PrettyPrint): Add Hashtable prettyprint
438 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
441 * repl.cs: Update help.
443 2008-09-03 Miguel de Icaza <miguel@novell.com>
445 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
446 handling of the default config handling, including the special
447 treatment of System.Core assembly.
449 Fixes the REPL processing for LINQ.
451 2008-09-03 Marek Safar <marek.safar@gmail.com>
453 A fix for bug #422507
454 * expression.cs (UnboxCast): Add missing child expression mutator.
456 2008-09-03 Marek Safar <marek.safar@gmail.com>
458 * driver.cs: Don't self reference System.Core assembly.
460 2008-09-03 Marek Safar <marek.safar@gmail.com>
462 A fix for bug #422507
463 * expression.cs (StringConcat): Add missing type mutator.
465 2008-09-03 Marek Safar <marek.safar@gmail.com>
467 * generic.cs (TypeInferenceContext): Follow equality rule for
468 constructed type lower bound type inference.
470 2008-09-02 Miguel de Icaza <miguel@novell.com>
472 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
473 <dblank@cs.brynmawr.edu> which updates the cursor position on
476 2008-09-02 Marek Safar <marek.safar@gmail.com>
478 A fix for bug #367145
479 * driver.cs: Fixed import of extension methods when using -noconfig
482 2008-09-02 Marek Safar <marek.safar@gmail.com>
484 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
485 version from non-generic implementation instead.
487 2008-09-01 Marek Safar <marek.safar@gmail.com>
489 A fix for bug #418908
490 * class.cs: Use AddScopeStatement for field initializers.
492 2008-09-01 Marek Safar <marek.safar@gmail.com>
494 A fix for bug #415385
495 * ecore.cs, convert.cs: Do method group conversion for equal group types.
497 2008-09-01 Marek Safar <marek.safar@gmail.com>
499 A fix for bug #421736
500 * iterators.cs: Don't crash on unreachable iterators.
502 2008-09-01 Marek Safar <marek.safar@gmail.com>
504 A fix for bug #421628
505 * parameter.cs, attribute.cs: Clone also parameter attributes.
507 2008-08-30 Miguel de Icaza <miguel@novell.com>
509 * namespace.cs (LookupType): In EvalMode, try to replace
510 the TypeBuilder from our cache with a Type as Reflection.Emit does
511 not like to mix code from older assemblies emitted and new
514 This sounds like a serious Mono bug that prevents multiple
515 assemblies to be generated and consumed at the same time.
517 * cs-parser.jay (push_current_class): Do not make interactive
518 classes internal or private, make them public as we currently
519 generate each new class in a new assembly.
521 2008-08-29 Miguel de Icaza <miguel@novell.com>
523 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
524 remove types that are entered into the global namespace during
525 parsing so that we can remove them on failure.
527 * cs-parser.jay: Parsing: we now keep track of types that are
528 entered into global variables and queue those in case the parsing
531 This happens in a few situations: during partial-input, we invoke
532 the parser repeatedly for example with the string "class X", this
533 would cause X to be registed, and we need to remove this
534 registration so that another parse attempt later with say "class X {"
537 Additionally, if there is an error in the resolution phase, for
538 example: "class X : NonExistant {}" th
540 * cs-parser.jay: Be more precise with the errors being raised,
541 instead of flagging all exceptions during parsing to be attributed
542 to the parsing process, distinguish those from errors happening in
543 the actions and hint that using -v would produce the actual
546 * repl.cs: Do not load all compiler references on each reset,
547 doing the partial reset takes care of this.
549 2008-08-28 Miguel de Icaza <miguel@novell.com>
551 * repl.cs: Add support for loading all the files from
552 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
555 Introduce a micro-parser that is able to deambiguate on its input
556 whether we are dealing with a compilation unit (namespace, class,
557 interface, struct, delegate) declaration or a statement. This
558 allows both declarations and statements to be entered.
560 Set history size by default to 300 lines.
562 Instead of distinguishing based on the parser.InteractiveResult,
563 have only two cases: statements were parsed, or a compilation unit
564 was. Always pull the Using statement additions from the
565 compilation unit parse.
567 * cs-tokenizer.cs: Rename tokens to better describe their intent
568 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
570 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
571 EvalMode is used to trigger the lookup of global variables while
572 StatementMode is used turn variable declarations into static
575 * getline.cs: Allow history size to be set.
577 2008-08-29 Marek Safar <marek.safar@gmail.com>
579 A fix for bug #360755
580 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
582 2008-08-29 Marek Safar <marek.safar@gmail.com>
584 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
586 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
587 member name, it is too confusing
589 * decl.cs, class.cs: Don't report unused fields with attached attribute.
591 * rootcontext.cs: Finally default to warning level 4.
593 2008-08-28 Marek Safar <marek.safar@gmail.com>
595 * class.cs (CheckBase): Ignore overloaded operators.
597 2008-08-28 Marek Safar <marek.safar@gmail.com>
599 A fix for bug #420830
600 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
602 2008-08-28 Marek Safar <marek.safar@gmail.com>
604 A fix for bug #420832
605 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
607 2008-08-28 Marek Safar <marek.safar@gmail.com>
609 A fix for bug #420386
610 * nullables.cs: Fixed logic of nullable user comparison operators involving
613 2008-08-28 Marek Safar <marek.safar@gmail.com>
615 * attribute (IsClsCompliant): Use FALSE value for pointer types.
617 2008-08-27 Miguel de Icaza <miguel@novell.com>
619 * repl.cs: Add support for aborting the running code with C-c.
621 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
623 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
625 2008-08-27 Miguel de Icaza <miguel@novell.com>
627 * cs-parser.jay (interactive_statement_list): A new set of rules
628 for hosting statements that uses the "interactive_" prefix.
630 * repl.cs: Add support for parsing `using' as a statement or as a
631 directive. Deambiguating before passing this to the parser.
633 We need to distinguish statement_expressions that occur at the
634 toplevel vs those that occur embedded into expressions.
636 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
637 that fixes the cursor key handling, and a history bug.
639 2008-08-26 Miguel de Icaza <miguel@novell.com>
641 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
642 limitations in Console, instead the 2.0 bootstrap libraries now
643 include the Console bits.
645 Also, remove the use of Nullables from getline.cs
649 Interactive support for the C# compiler. Use gmcs --shell to
650 enter a read-eval-print loop shell.
652 Docs: http://www.mono-project.com/CsharpRepl
654 * sources: include repl.cs here and getline.cs for gmcs.exe,
655 everything else is getline.cs impaired.
657 * Makefile: when bootstrapping pass a special flag
658 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
659 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
660 This distinguishes those two cases.
662 * repl.cs: Support for a read-eval-print loop. Will be soon
663 refactored into eval support and then REPL on top of it.
665 * ecore.cs: If a simplename lookup fails, before erroring out,
666 if we are in EvalMode to resolve the name to a declaration in the
669 This means that variable declarations that happened in previous
670 classes (as repl puts every statement in a separate class) are
671 made visible in this way.
673 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
674 triggered an error due to the end of file being reached. This is
675 used to do multi-line input, and notify the caller that the user
676 needs to provide more text before a successful parse.
678 Add new grammar rules after the INTERACTIVE_PARSER token is seen
679 to drive the evaluation with a custom wrapper.
681 * driver.cs: Add support for --shell, and refactor some code to be
684 * namespace.cs: Add support for serializing the contents of the
685 namespaces and reloading them.
687 * getline.cs: A managed implementation of ReadLine under
688 X11/Apache2 license terms. Easy to embed in other applications as
691 * namespace.cs: Add some functions to save and restore the
694 * rootcontext.cs: New public field.
696 * cs-tokenizer.cs: Add support for one of the possible characters
697 we introduce into the token stream.
699 This patch does not affect the regular tokenization process, the
700 only performance hit would happen if there is an invalid character
703 * support.cs: Move isatty helper routine here.
705 * codegen.cs: Small cleanup, and add a mechanism to initialize the
706 code generator for in-memory assemblies.
708 2008-08-26 Marek Safar <marek.safar@gmail.com>
710 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
711 parameter cannot be always used as a type.
713 2008-08-21 Marek Safar <marek.safar@gmail.com>
715 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
717 2008-08-21 Marek Safar <marek.safar@gmail.com>
719 * convert.cs: Implement explicit array to IList<T> conversion.
721 2008-08-20 Marek Safar <marek.safar@gmail.com>
723 A fix for bug #362740
724 * cs-tokenizer.cs: Handle UTF-16 surrogates.
726 2008-08-20 Marek Safar <marek.safar@gmail.com>
728 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
729 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
730 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
731 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
732 handling to use just one type of infrastructure and deal with generics
735 2008-07-23 Martin Baulig <martin@ximian.com>
737 *** Merged this from trunk revision 108527 ***
740 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
741 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
744 2008-08-15 Marek Safar <marek.safar@gmail.com>
746 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
749 2008-08-15 Marek Safar <marek.safar@gmail.com>
751 * delegate.cs: Fixed compiler crash when creating delegate using partial
754 * typemanager.cs: MulticastDelegate is not a delegate.
756 2008-08-14 Marek Safar <marek.safar@gmail.com>
758 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
761 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
763 * cs-parser.jay (type): Allow 'var' in mcs too.
764 (local_variable_type): Likewise.
766 2008-08-14 Marek Safar <marek.safar@gmail.com>
768 * driver.cs: Removed broken -noconfig variants.
770 2008-08-14 Marek Safar <marek.safar@gmail.com>
772 A fix for bug #417078
773 * expression.cs: Emit correctly left side pointer operators.
775 2008-08-13 Marek Safar <marek.safar@gmail.com>
777 * generic.cs, lambda.cs: Inflate method generic arguments only.
779 2008-08-12 Marek Safar <marek.safar@gmail.com>
781 * class.cs: Fixed struct layout check regression.
783 2008-08-12 Marek Safar <marek.safar@gmail.com>
785 * cs-parser.jay, enum.cs: Simplified enum parsing.
787 * decl.cs: Check all type parameters conflicts.
789 * expression.cs, statement.cs, attribute.cs: More expression checks.
791 2008-08-11 Marek Safar <marek.safar@gmail.com>
793 * generic.cs: Add type inference types restriction.
795 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
796 anonymous.cs, expression.cs: Allocate less accessor parameters.
798 2008-08-08 Marek Safar <marek.safar@gmail.com>
800 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
803 2008-08-08 Marek Safar <marek.safar@gmail.com>
805 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
807 2008-08-07 Marek Safar <marek.safar@gmail.com>
809 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
810 Also fixes #362146 and #381592.
812 2008-08-07 Marek Safar <marek.safar@gmail.com>
814 * ecore.cs: Reduced constant cannot be used as an attribute value.
816 * cs-parser.jay: Base expression has to be a type.
818 * expression.cs (Conditional): Uses ReducedExpression.
820 2008-08-06 Marek Safar <marek.safar@gmail.com>
822 A fix for bug #376826
823 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
824 address of hoisted local variable or parameter cannot be taken.
826 2008-08-05 Marek Safar <marek.safar@gmail.com>
828 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
829 anonymous method inside checked/unchecked expression.
831 2008-08-05 Marek Safar <marek.safar@gmail.com>
833 * typemanager.cs (IsEqual): Guard against null.
835 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
836 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
837 routine. Fixed few misleading conversion errors.
839 2008-08-04 Marek Safar <marek.safar@gmail.com>
841 * class.cs: Consider generics when checking cycles in struct layout.
843 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
845 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
847 2008-08-04 Marek Safar <marek.safar@gmail.com>
849 A fix for bug #414165
850 * anonymous.cs: Use same anonymous implementation method for all anonymous
853 2008-08-04 Marek Safar <marek.safar@gmail.com>
855 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
858 2008-08-04 Marek Safar <marek.safar@gmail.com>
860 * cs-parser.jay: Typeof argument has to be a type expression.
862 * namespace.cs: Check alias and namespace definitions collisions.
864 * class.cs, pending.cs: Moved explicit interface accessor implementation
867 * delegate.cs, expression.cs: Verify special name invocations.
869 2008-08-01 Marek Safar <marek.safar@gmail.com>
871 * cs-parser.jay: Don't choke on empty generic type arguments.
873 * cs-tokenizer.cs: Handle escaped preprocessor directives.
875 * expression.cs, ecore.cs: Minor expressions bugs.
877 2008-08-01 Marek Safar <marek.safar@gmail.com>
879 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
880 and added more error handling.
882 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
884 * modifiers.cs, enum.cs: Fixed.
886 2008-07-31 Jb Evain <jbevain@novell.com>
888 * driver.cs: remove -pkg ability of smcs.
890 2008-07-30 Marek Safar <marek.safar@gmail.com>
892 * statement.cs (Switch): Correctly set empty default target for single
895 2008-07-30 Marek Safar <marek.safar@gmail.com>
897 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
898 string switch statement implementation to use string dictionary which
899 significantly (2-8x) improves performance of generated code.
901 2008-07-29 Marek Safar <marek.safar@gmail.com>
903 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
904 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
906 2008-07-29 Marek Safar <marek.safar@gmail.com>
908 A fix for bug #412595
909 * typemanager.cs, convert.cs, expression.cs: Some types are never
910 convertible to each other.
912 2008-07-29 Marek Safar <marek.safar@gmail.com>
914 * nullable.cs (CreateNullConstant): An error messages update.
916 2008-07-29 Marek Safar <marek.safar@gmail.com>
918 A fix for bug #412595
919 * cfold.cs: Don't cast undefined bool constant.
921 2008-07-29 Martin Baulig <martin@ximian.com>
924 (SymbolWriter.Reset): New public static method.
927 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
929 2008-07-28 Marek Safar <marek.safar@gmail.com>
931 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
933 * expression.cs (ElementAccess): Exact size allocation.
935 2008-07-26 Marek Safar <marek.safar@gmail.com>
937 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
939 2008-07-25 Marek Safar <marek.safar@gmail.com>
941 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
943 * class.cs: Removed $PRIVATE$ field hack which caused problems during
946 2008-07-25 Marek Safar <marek.safar@gmail.com>
948 A fix for bug #412217
949 * assign.cs: Mutate also assignment type.
951 2008-07-25 Marek Safar <marek.safar@gmail.com>
953 A fix for bug #323644
954 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
957 2008-07-25 Marek Safar <marek.safar@gmail.com>
959 A fix for bug #412134
960 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
961 non-enumerable operands when overloading equality or bitwise operators.
963 2008-07-25 Marek Safar <marek.safar@gmail.com>
965 * anonymous.cs: Cache closed generic anonymous method delegates.
967 2008-07-24 Marek Safar <marek.safar@gmail.com>
969 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
970 anonymous.cs, statement.cs: Always emit anonymous method as static method
971 when is instance free. Use nesting for nested anynomous methods blocks.
973 2008-07-23 Marek Safar <marek.safar@gmail.com>
975 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
978 2008-07-23 Marek Safar <marek.safar@gmail.com>
980 * expression.cs: Removed MakeSimpleCall.
982 2008-07-23 Marek Safar <marek.safar@gmail.com>
984 A fix for bug #323012
985 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
986 Base method implementing interface has to be public.
988 2008-07-23 Marek Safar <marek.safar@gmail.com>
990 * cs-parser.jay: Don't break on missing argument.
992 2008-07-22 Marek Safar <marek.safar@gmail.com>
994 A fix for bug #320993
995 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
996 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
998 2008-07-22 Marek Safar <marek.safar@gmail.com>
1000 A fix for bug #320748
1001 * convert.cs: Implicit user operators cannot convert to interfaces
1003 2008-07-22 Marek Safar <marek.safar@gmail.com>
1005 A fix for bug #312686
1006 * driver.cs: Ignore empty assembly references.
1008 2008-07-22 Marek Safar <marek.safar@gmail.com>
1010 A fix for bug #387040
1011 * ecore.cs: Skip constrains check for an explicit implementation.
1013 2008-07-21 Marek Safar <marek.safar@gmail.com>
1015 A fix for bug #409045
1016 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
1017 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
1018 identifiers are file specific unless passed as input arguments.
1020 2008-07-21 Marek Safar <marek.safar@gmail.com>
1022 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
1023 to emit UnmanagedMarshal data under 2.0 profile.
1025 2008-07-21 Marek Safar <marek.safar@gmail.com>
1027 A fix for bug #410369
1028 * parameter.cs: Clone correctly ParamsParameter.
1030 2008-07-21 Marek Safar <marek.safar@gmail.com>
1032 * expression.cs (Argument): Always report type for type based expressions
1035 2008-07-18 Marek Safar <marek.safar@gmail.com>
1037 A fix for bug #410666
1038 * anonymous.cs: Correctly initialize generic storey reference.
1040 2008-07-18 Marek Safar <marek.safar@gmail.com>
1042 * convert.cs: Don't box same type arguments.
1044 2008-07-18 Marek Safar <marek.safar@gmail.com>
1046 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
1047 Finished missing generic type mutators.
1049 2008-07-18 Marek Safar <marek.safar@gmail.com>
1051 * iterators.cs, statement.cs: Finished statements CloneTo.
1053 2008-07-18 Marek Safar <marek.safar@gmail.com>
1055 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
1057 * expression.cs: Emit optimized default value expressions in expression tree
1060 2008-07-18 Marek Safar <marek.safar@gmail.com>
1062 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
1064 2008-07-17 Marek Safar <marek.safar@gmail.com>
1066 A fix for bug #367536
1067 * cs-parser.jay: Check static constructor of generic types for an access
1070 2008-07-17 Marek Safar <marek.safar@gmail.com>
1072 A fix for bug #353800
1073 * lambda.cs: Emit ret for contextual statements.
1075 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
1076 up emitting redundant ret for all anonymous methods with return.
1078 2008-07-17 Marek Safar <marek.safar@gmail.com>
1080 A fix for bug #365188
1081 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
1082 create anonymous method storey in unreachable block.
1084 2008-07-17 Marek Safar <marek.safar@gmail.com>
1086 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
1087 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
1088 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
1089 statement.cs: Fixed relevant defects found by Gendarme.
1091 2008-07-17 Marek Safar <marek.safar@gmail.com>
1093 A fix for bug #325291
1094 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
1095 statement.cs: Replaced IAnonymousHost with top level block flag.
1097 2008-07-17 Marek Safar <marek.safar@gmail.com>
1099 * cs-parser.jay: Clean up unused open_parens.
1101 2008-07-17 Marek Safar <marek.safar@gmail.com>
1103 * ecore.cs: Custom error message for a range variable assignment.
1105 2008-07-16 Marek Safar <marek.safar@gmail.com>
1107 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
1110 2008-07-16 Marek Safar <marek.safar@gmail.com>
1112 * literal.cs: Null literal is of object type.
1114 2008-07-16 Marek Safar <marek.safar@gmail.com>
1116 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
1117 expression of nullable equality comparison.
1119 2008-07-15 Marek Safar <marek.safar@gmail.com>
1121 * expression.cs(PointerArithmetic): Removed redundant assignment.
1123 2008-07-15 Marek Safar <marek.safar@gmail.com>
1125 * decl.cs (GetSignatureForError): Report full namespace name for containers.
1127 2008-07-14 Marek Safar <marek.safar@gmail.com>
1129 A fix for bug #408361
1130 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
1131 they are replaced by GetMethod.
1133 2008-07-14 Marek Safar <marek.safar@gmail.com>
1135 A fix for bug #408721 by jeremie.laval@gmail.com
1136 * expression.cs (Indirection): Implemented CloneTo.
1138 2008-07-14 Marek Safar <marek.safar@gmail.com>
1140 * statement.cs (AssignableSlots): Temporary disabled variable initialization
1143 2008-07-14 Marek Safar <marek.safar@gmail.com>
1145 * report.cs (EnableReporting): Don't reinitialize 0-based values.
1147 2008-07-11 Marek Safar <marek.safar@gmail.com>
1149 * linq.cs: Reset tranparent parameter counter in probing mode.
1151 2008-07-11 Marek Safar <marek.safar@gmail.com>
1153 * anonymous.cs: Mutate anonymous method type.
1155 2008-07-11 Marek Safar <marek.safar@gmail.com>
1157 * ecore.cs, anonymous.cs: Mutate field expressions.
1159 2008-07-10 Marek Safar <marek.safar@gmail.com>
1161 A fix for bug #369670
1162 * linq.cs, statement.cs: Use explicit block for query expressions variables.
1164 2008-07-10 Marek Safar <marek.safar@gmail.com>
1166 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
1168 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
1171 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
1172 only one '>', and finds a '>>', abort the generic lookahead.
1174 2008-07-10 Marek Safar <marek.safar@gmail.com>
1176 A fix for bug #319902
1177 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
1179 2008-07-10 Marek Safar <marek.safar@gmail.com>
1181 A fix for bug #406371
1182 * statement.cs: Moved EmitSymbolInfo to Block.
1184 2008-07-09 Marek Safar <marek.safar@gmail.com>
1186 * ecore.cs: Report better error for extension method overload failures.
1188 2008-07-09 Marek Safar <marek.safar@gmail.com>
1190 * expression.cs (Is): No need to box reference values.
1192 2008-07-09 Marek Safar <marek.safar@gmail.com>
1194 * class.cs: Use event resolve context when initializing CreateEmitContext.
1196 2008-07-09 Marek Safar <marek.safar@gmail.com>
1198 A fix for bug #394436
1199 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
1200 method used inside expression trees. Added more LINQ to expression tree
1203 2008-07-08 Marek Safar <marek.safar@gmail.com>
1205 A fix for bug #378189, #370577
1206 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
1209 2008-07-08 Marek Safar <marek.safar@gmail.com>
1211 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
1214 2008-07-08 Marek Safar <marek.safar@gmail.com>
1216 A fix for bug #406702
1217 * anonymous.cs: Always park anonymous method in the nearest parent storey.
1219 2008-07-07 Marek Safar <marek.safar@gmail.com>
1221 A fix for bug #406648
1222 * cs-parser.jay: Report nullable use in mcs for some cases.
1224 2008-07-07 Marek Safar <marek.safar@gmail.com>
1226 * ecore.cs: Improved argument mismatch error messages.
1228 2008-07-07 Marek Safar <marek.safar@gmail.com>
1230 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
1232 2008-07-07 Marek Safar <marek.safar@gmail.com>
1234 * expression.cs (TypeOf): Mutate type argument.
1236 2008-07-04 Marek Safar <marek.safar@gmail.com>
1238 * class.cs: Report missing partial modifier for correct type.
1240 2008-07-04 Marek Safar <marek.safar@gmail.com>
1242 * ecore.cs, expression.cs (VariableReference): Variable property is
1245 2008-07-04 Marek Safar <marek.safar@gmail.com>
1247 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
1249 2008-07-04 Marek Safar <marek.safar@gmail.com>
1251 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
1254 2008-07-04 Marek Safar <marek.safar@gmail.com>
1256 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
1257 anonymous method storey to an instance method when only "this" is hoisted.
1259 2008-07-03 Marek Safar <marek.safar@gmail.com>
1261 A fix for bug #321615
1262 * expression.cs: Pointer comparisons use unsigned operator.
1264 2008-07-03 Marek Safar <marek.safar@gmail.com>
1266 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
1268 2008-07-02 Marek Safar <marek.safar@gmail.com>
1270 A fix for bug #404905
1271 * class.cs: Always initialize local unsafe variables.
1273 2008-06-30 Marek Safar <marek.safar@gmail.com>
1275 A fix for bug #396987
1276 * expression.cs (NewInitialize): Clear local temporary variable for next run
1278 2008-06-27 Marek Safar <marek.safar@gmail.com>
1280 A fix for bug #401020
1281 * ecore.cs: Both types and modifiers have to match for ref and out arguments
1283 2008-06-27 Marek Safar <marek.safar@gmail.com>
1285 A fix for bug #398319
1286 * cs-parser.jay: Implemented undocumented base access expression inside
1289 2008-06-26 Marek Safar <marek.safar@gmail.com>
1291 A fix for bug #404227
1292 * cs-parser.jay: Parse namespace declaration using qualified identifier.
1294 2008-06-26 Marek Safar <marek.safar@gmail.com>
1296 A fix for bug #404227
1297 * convert.cs: Fixed explicit array to interface cast.
1299 2008-06-26 Marek Safar <marek.safar@gmail.com>
1301 A fix for bug #403894
1302 * delegate.cs: Mutate DelegateInvocation type.
1304 2008-06-26 Marek Safar <marek.safar@gmail.com>
1306 A fix for bug #379348
1307 * delegate.cs: Box a load of generic parameters.
1309 2008-06-26 Marek Safar <marek.safar@gmail.com>
1311 * expression.cs: Add an array creation arguments mutate.
1313 2008-06-26 Marek Safar <marek.safar@gmail.com>
1315 A fix for bug #386068
1316 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
1319 2008-06-25 Marek Safar <marek.safar@gmail.com>
1321 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
1324 2008-06-25 Marek Safar <marek.safar@gmail.com>
1326 A fix for bug #403518
1327 * delegate.cs: Type correctly anonymous method new invocation.
1329 2008-06-24 Marek Safar <marek.safar@gmail.com>
1331 A fix for bug #394826
1332 * anonymous.cs: Fully qualify members when resolving anonymous type internal
1335 2008-06-24 Marek Safar <marek.safar@gmail.com>
1337 A fix for bug #394826
1338 * anonymous.cs, iterators.cs: Construct generic storey only when is really
1341 2008-06-24 Marek Safar <marek.safar@gmail.com>
1343 * class.cs: Clone indexer parameters for localized capturing.
1345 2008-06-24 Marek Safar <marek.safar@gmail.com>
1347 A fix for bug #402379
1348 * expression.cs: Don't crash when an object initializer resolve fails.
1350 2008-06-24 Marek Safar <marek.safar@gmail.com>
1352 A fix for bug #402888
1353 * expression.cs: Mutate conditional expression.
1355 2008-06-24 Marek Safar <marek.safar@gmail.com>
1357 A fix for bug #401012
1358 * class.cs: Keep StructLayout in shared container.
1360 2008-06-24 Marek Safar <marek.safar@gmail.com>
1362 A fix for bug #400438
1363 * decl.cs, class.cs: Only properties can be automatically implemented.
1365 2008-06-24 Marek Safar <marek.safar@gmail.com>
1367 * statement.cs (ChangeToIterator): Copy also labels.
1369 2008-06-23 Marek Safar <marek.safar@gmail.com>
1371 * ecore.cs: Pass type argument details to parent extension method.
1373 2008-06-23 Marek Safar <marek.safar@gmail.com>
1375 A fix for bug #375966
1376 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
1378 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
1380 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
1382 2008-06-22 Marek Safar <marek.safar@gmail.com>
1384 A fix for bug #394347
1385 * anonymous.cs: Cache compatible delegates as compatibility check produces
1386 a new method every time.
1388 2008-06-20 Marek Safar <marek.safar@gmail.com>
1390 * anonymous.cs: Propagate storey reference for single references.
1392 2008-06-20 Marek Safar <marek.safar@gmail.com>
1394 A fix for bug #387615
1395 * assign.cs, expression.cs: Correctly clone compound assignment.
1397 2008-06-19 Marek Safar <marek.safar@gmail.com>
1399 A fix for bug #359611, #359604
1400 * anonymous.cs: Mutate all types of hoisted parameters.
1402 2008-06-19 Marek Safar <marek.safar@gmail.com>
1404 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
1405 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
1406 expression.cs, codegen.cs, statement.cs
1408 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
1409 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
1411 ** Anonymous methods, lambda expressions rewrite **
1413 Anonymous expressions are now resolved when an explicit block is resolved
1414 and they don't require any registration procedure anymore. Further,
1415 anonymous methods are defined when explicit block is emitted which allows
1416 better control of whole process and opens possibilities for more
1417 optimizations as well as alternative to reverse whole process.
1419 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
1420 process consistent and to correctly emit hoisted generic methods when they
1421 have at least 1 hoisted variable.
1423 2008-06-17 Martin Baulig <martin@ximian.com>
1425 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
1427 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
1428 virtual property; check it in Emit().
1429 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
1431 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
1433 (Indexer.Define): Likewise.
1435 2008-06-17 Marek Safar <marek.safar@gmail.com>
1437 * convert.cs: Don't use IsInterface on type arguments.
1439 * delegate.cs: DelegateInvocation uses MethodInfo.
1441 * parameter.cs: Removed IsTypeParameter.
1443 * generic-mcs.cs: More missing stuff.
1445 2008-06-16 Martin Baulig <martin@ximian.com>
1448 (Modifiers.DEBUGGER_HIDDEN): New public const.
1451 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
1454 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
1455 (AbstractPropertyEventMethod): Likewise.
1456 (Constructor.Emit): Likewise.
1457 (SourceMethod.SetCompilerGenerated): Removed.
1459 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
1463 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
1464 if we're an `IteratorHost'.
1465 (AnonymousMethodMethod..ctor): Don't set
1466 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
1469 2008-06-16 Marek Safar <marek.safar@gmail.com>
1471 * statement.cs: Clean-up foreach statements.
1473 2008-06-12 Marek Safar <marek.safar@gmail.com>
1475 * class.cs: Stop using public method which should not exist
1476 (MethodBuilder.SetGenericMethodSignature).
1478 2008-06-11 Martin Baulig <martin@ximian.com>
1481 (Location.LookupFile): Add `CompilationUnit' argument; when given
1482 a relative file name, make it relative to the directory the .cs
1483 file is located in instead of using the current directory.
1485 2008-06-11 Martin Baulig <martin@ximian.com>
1488 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
1489 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
1490 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
1491 (SourceMethod.SetCompilerGenerated): Likewise.
1493 2008-06-11 Marek Safar <marek.safar@gmail.com>
1495 * codegen.cs, driver: Only write symbol file when it's asked for.
1497 2008-06-11 Marek Safar <marek.safar@gmail.com>
1499 * codegen.cs: Don't use assembly writer error handling for symbol writer.
1501 2008-06-10 Martin Baulig <martin@ximian.com>
1503 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
1505 2008-06-09 Marek Safar <marek.safar@gmail.com>
1507 A fix for bug #316290
1508 * expression.cs: Include decimal operators in predefined table.
1510 * parameters.cs: More readonlyness.
1512 2008-06-09 Marek Safar <marek.safar@gmail.com>
1514 A fix for bug #397213
1515 * cs-parser.jay: One more missing current_local_parameters reset.
1517 2008-06-09 Marek Safar <marek.safar@gmail.com>
1519 A fix for bug #396633
1520 * class.cs: Host backing field in partial container.
1522 2008-06-09 Marek Safar <marek.safar@gmail.com>
1524 A fix for bug #397068
1525 * expression.cs: Check both operand types when predefined operator is used.
1527 2008-06-05 Martin Baulig <martin@ximian.com>
1529 Merged the `debugger-kahalo' branch.
1532 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
1533 we're an iterator method.
1534 (SourceMethod): Reflect latest symbol writer changes;
1535 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
1536 now `start_row' and `end_row'.
1537 (Constructor.Emit): Fix the logic whether to emit symbol information.
1539 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
1543 (CompilationUnit): New public class; derives from `SourceFile'.
1544 (SourceFileEntry.DefineSymbolInfo): New public method.
1545 (SourceFileEntry.SetChecksum): New public method.
1546 (Location): Encode hidden line numbers by using `column == 255';
1547 the .ctor now accepts `column == -1' to mark a hidden line number.
1548 (Location.Hidden): New public property.
1549 (Location.CheckPoint): Add `CompilationUnit'.
1550 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
1551 (Location.Push): Add `CompilationUnit compile_unit' argument.
1552 (Location.CompilationUnit): New public property.
1555 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
1557 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
1559 * driver.cs: `SourceFile' -> `CompilationUnit'.
1561 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
1563 * namespace.cs: `SourceFile' -> `CompilationUnit'.
1565 * cs-tokenizer.cs: Add support for `#pragma checksum' and
1569 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
1570 new symbol writer API to also pass the file.
1572 2008-06-05 Marek Safar <marek.safar@gmail.com>
1574 * statement.cs: Emit catch variable assignment using variable expression.
1576 2008-06-05 Marek Safar <marek.safar@gmail.com>
1578 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
1579 with other variable types.
1581 2008-06-04 Marek Safar <marek.safar@gmail.com>
1583 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
1584 GetLength method emit, it breaks resolve rules.
1586 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
1587 Marek Safar <marek.safar@gmail.com>
1589 A fix for bug #395542
1590 * cs-parser.jay: The trailing comma is allowed in anonymous type member
1593 2008-06-02 Marek Safar <marek.safar@gmail.com>
1595 A fix for bug #395287
1596 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
1598 2008-05-31 Marek Safar <marek.safar@gmail.com>
1600 A fix for bug #395845
1601 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
1602 non-nullable parameter type.
1604 2008-05-31 Marek Safar <marek.safar@gmail.com>
1606 * class.cs: Handle contructor initializer as a statement in top-level block.
1608 2008-05-30 Marek Safar <marek.safar@gmail.com>
1610 * attribute.cs: Don't mix old and new corlib types when emitting corlib
1611 security attributes.
1613 2008-05-24 Marek Safar <marek.safar@gmail.com>
1615 * ecore.cs, expression.cs: Small IVariable refactoring.
1617 2008-05-22 Marek Safar <marek.safar@gmail.com>
1619 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
1621 2008-05-21 Marek Safar <marek.safar@gmail.com>
1623 * cs-parser.jay: Removed redundant catch type check.
1625 2008-05-21 Marek Safar <marek.safar@gmail.com>
1627 A fix for bug #390372
1628 * nullable.cs: Set correct return type.
1630 2008-05-21 Marek Safar <marek.safar@gmail.com>
1632 A fix for bug #391062
1633 * typemanager.cs: Fixed crash when comparing null types.
1635 2008-05-21 Marek Safar <marek.safar@gmail.com>
1637 A fix for bug #391871
1638 * cs-parser.jay: Better error handling for invalid catch type.
1640 2008-05-20 Marek Safar <marek.safar@gmail.com>
1642 A fix for bug #392155
1643 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
1645 2008-05-15 Marek Safar <marek.safar@gmail.com>
1647 A fix for bug #390666
1648 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
1651 2008-05-15 Marek Safar <marek.safar@gmail.com>
1653 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
1656 2008-05-13 Marek Safar <marek.safar@gmail.com>
1658 A fix for bug #389625
1659 * delegate.cs, generic.cs: Some progress on method group return type
1662 2008-05-13 Marek Safar <marek.safar@gmail.com>
1664 A fix for bug #378419
1665 * namespace.cs: Inspect also parent namespaces not only namespace entries.
1667 2008-05-12 Marek Safar <marek.safar@gmail.com>
1669 * class.cs (Constructor): Added IsCompilerGenerated.
1671 2008-05-12 Marek Safar <marek.safar@gmail.com>
1673 * expression.cs: Enum binary operators can accept non-enum operand only when
1674 is implicitly convertible to underlying type.
1676 2008-05-12 Marek Safar <marek.safar@gmail.com>
1678 A fix for bug #389272
1679 * support.cs: Workaround System.InvalidOperationException for enums.
1681 2008-05-12 Marek Safar <marek.safar@gmail.com>
1683 A fix for bug #389073
1684 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
1686 2008-05-10 Marek Safar <marek.safar@gmail.com>
1688 * driver.cs: Split Parse.
1690 * location.cs (LookupFile): Uses string.Empty.
1692 2008-05-07 Marek Safar <marek.safar@gmail.com>
1694 * expression.cs, parameter.cs: Small ParameterReference clean up.
1696 2008-05-07 Marek Safar <marek.safar@gmail.com>
1698 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
1699 hack. Fixes #387502.
1701 2008-05-06 Martin Baulig <martin@ximian.com>
1703 * class.cs (Constructor.Emit): Fix the logic whether to emit
1706 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
1709 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
1710 InvalidOperationException when the iterator is before the start or
1713 2008-05-06 Marek Safar <marek.safar@gmail.com>
1715 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
1716 when left is nullable type.
1718 2008-05-06 Marek Safar <marek.safar@gmail.com>
1720 A fix for bug #386628
1721 * expression.cs (LocalVariableReference): Continue in resolving when
1722 variable is not assigned.
1724 2008-05-05 Marek Safar <marek.safar@gmail.com>
1726 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
1727 nullable operations.
1729 2008-05-04 Marek Safar <marek.safar@gmail.com>
1731 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
1732 it saves many redundant temporary variables for nullable operations.
1734 2008-05-03 Marek Safar <marek.safar@gmail.com>
1736 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
1738 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
1741 * nullable.cs: Constant coalescing operator optimizations.
1743 2008-05-03 Marek Safar <marek.safar@gmail.com>
1745 * constant.cs: Use unsigned conversion for values which are unsigned only.
1747 2008-05-03 Marek Safar <marek.safar@gmail.com>
1749 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
1750 coalescing operator as it should be.
1752 2008-05-02 Marek Safar <marek.safar@gmail.com>
1754 A fix for bug #371016
1755 * expression.cs: All predefined delegate operators require implicit method
1758 2008-05-02 Marek Safar <marek.safar@gmail.com>
1760 * constant.cs: Emit long constant as uint when fits the range.
1762 * convert.cs, expression.cs: Fixed few unsafe conversions.
1764 2008-05-02 Marek Safar <marek.safar@gmail.com>
1766 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
1768 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
1771 * convert.cs (ImplicitNumericConversion): Don't modify the type of
1773 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
1775 2008-05-01 Marek Safar <marek.safar@gmail.com>
1777 * constant.cs, literal.cs: IsLiteral property for error reporting.
1779 * ecore.cs, expression.cs: Implemented Property expression.
1781 2008-05-01 Marek Safar <marek.safar@gmail.com>
1783 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
1785 * nullable.cs: Implemented nullable coalescing null operator.
1787 * ecore.cs, expression.cs: Expression trees work.
1789 2008-05-01 Marek Safar <marek.safar@gmail.com>
1791 * ecore.cs: CreateExpressionTree is finally abstract.
1793 * expression.cs, linq.cs: Updated.
1795 2008-05-01 Marek Safar <marek.safar@gmail.com>
1797 * expression.cs, ecore.cs: Block base access expression inside expression
1800 2008-05-01 Marek Safar <marek.safar@gmail.com>
1802 A fix for bug #385058
1803 * expression.cs: User-defined operator implementations always take
1804 precedence over predefined operator implementations.
1806 2008-04-30 Marek Safar <marek.safar@gmail.com>
1808 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
1809 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
1810 expression tree conversions.
1812 2008-04-30 Marek Safar <marek.safar@gmail.com>
1814 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
1815 operators method details to Operator class.
1817 2008-04-30 Marek Safar <marek.safar@gmail.com>
1819 * anonymous.cs: Pass unsafe flags to anonymous container.
1821 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
1822 inside expression tree.
1824 2008-04-29 Martin Baulig <martin@ximian.com>
1826 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
1827 (Tokenizer.PopPosition): Also restore the `line'.
1829 2008-04-29 Marek Safar <marek.safar@gmail.com>
1831 * delegate.cs: Implemented Invoke expression.
1833 2008-04-29 Marek Safar <marek.safar@gmail.com>
1835 * expression.cs: Fixed equality reference comparison regression.
1837 2008-04-29 Marek Safar <marek.safar@gmail.com>
1839 * ecore.cs: Clean up EmptyCast hack.
1841 * expression.cs, nullable.cs: Implemented enum binary and unary operations
1842 using correct conversion rules. Also fixes #383993.
1844 2008-04-28 Martin Baulig <martin@ximian.com>
1846 * class.cs (Constructor.Emit): Don't emit debugging information
1847 for generated default .ctor's.
1849 2008-04-28 Marek Safar <marek.safar@gmail.com>
1851 * convert.cs: Empty-cast ushort to int conversion.
1853 2008-04-28 Marek Safar <marek.safar@gmail.com>
1855 A fix for bug #384191
1856 * ecore.cs, expression.cs: Fixed expression cloning.
1858 2008-04-28 Marek Safar <marek.safar@gmail.com>
1860 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
1862 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
1864 Fix #381559, test-638.cs, test-639.cs
1865 * assign.cs (CompoundAssign.Helper): New wrapper.
1866 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
1868 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
1869 Pass unconverted expressions to the params array creation expression.
1870 (FieldExpr.EmitAssign): Don't special-case StringConcat.
1871 (PropertyExpr.EmitAssign): Likewise.
1872 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
1873 element if it is of kind CompoundAssign.Helper.
1874 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
1875 first before anything else.
1876 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
1877 (ArrayAccess.LoadArrayAndArguments): Simplify.
1879 2008-04-27 Marek Safar <marek.safar@gmail.com>
1881 * expression.cs: Fixed cloning of typeof(void).
1883 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
1885 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
1886 (Assign.Emit): Likewise. Move it to ...
1887 (CompoundAssign.DoResolve): ... here and ...
1888 (CompoundAssign.Emit): ... here.
1889 (EventAddOrRemove): New helper to handle += and -= on events, and
1890 avoid the use of BinaryDelegates.
1891 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
1892 (EventExpr.EmitAddOrRemove): Improve.
1893 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
1895 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
1896 create VarExprs for 'foo.bar.var'.
1897 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
1898 is a highly inappropriate name for its functionality.
1900 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
1902 Simplify handling of multiple assignments
1903 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
1905 (SimpleAssign): New. Class to be used for normal assignments.
1906 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
1907 * expression.cs, parameter.cs, statement.cs: Likewise.
1909 2008-04-25 Marek Safar <marek.safar@gmail.com>
1911 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
1912 for incompatible underlying types, more to come, uff.
1914 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
1917 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
1918 Handle 'leave_copy'.
1920 2008-04-25 Marek Safar <marek.safar@gmail.com>
1922 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
1924 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
1926 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
1927 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
1928 * statement.cs (While, Do, For): Allow test to have side effects.
1929 (For.DoEmit): Always emit InitStatement.
1932 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
1933 Always create SideEffectConstant.
1934 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
1935 of type EnumConstant.
1937 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
1938 Handle 'right' being SideEffectConstant of type 'bool'.
1940 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
1941 Use left.EmitBranchable instead of open coding it, so as to
1942 improve optimization opportunities.
1944 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
1946 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
1948 (Expression.EmitSideEffect): Document.
1950 2008-04-23 Marek Safar <marek.safar@gmail.com>
1952 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
1954 2008-04-23 Marek Safar <marek.safar@gmail.com>
1956 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
1958 2008-04-23 Marek Safar <marek.safar@gmail.com>
1960 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
1961 conversion to expression tree.
1963 2008-04-23 Marek Safar <marek.safar@gmail.com>
1965 * ecore.cs: Removed unused expression.
1967 2008-04-22 Marek Safar <marek.safar@gmail.com>
1969 * expression.cs: Implemented NegateChecked and New expressions.
1971 2008-04-22 Marek Safar <marek.safar@gmail.com>
1973 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
1975 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
1978 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
1979 needing final 'ret' instruction.
1981 2008-04-22 Marek Safar <marek.safar@gmail.com>
1983 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
1985 2008-04-21 Marek Safar <marek.safar@gmail.com>
1987 * expression.cs: Emit ldnull and not null expression as an instance argument
1988 of static method expression calls.
1990 2008-04-21 Marek Safar <marek.safar@gmail.com>
1992 A fix for bug #378200
1993 * expression.cs: Fixed crash when creating parameterless expression tree
1996 2008-04-21 Marek Safar <marek.safar@gmail.com>
1998 A fix for bug #375297
1999 * anonymous.cs: Fixed crash when inferring from null argument anonymous
2002 2008-04-21 Marek Safar <marek.safar@gmail.com>
2004 A fix for bug #377596
2005 * decl.cs, class.cs: Emit delegate type argument attributes.
2007 2008-04-21 Marek Safar <marek.safar@gmail.com>
2009 A fix for bug #365314
2010 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
2012 2008-04-21 Marek Safar <marek.safar@gmail.com>
2014 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
2017 2008-04-21 Marek Safar <marek.safar@gmail.com>
2019 * generic.cs (TypeParameter): Removed redundant location.
2021 2008-04-19 Marek Safar <marek.safar@gmail.com>
2023 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
2024 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
2025 FullNamedExpression in all declaration type expression, statements will come
2028 2008-04-18 Marek Safar <marek.safar@gmail.com>
2030 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
2031 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
2033 2008-04-18 Marek Safar <marek.safar@gmail.com>
2035 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
2038 2008-04-17 Marek Safar <marek.safar@gmail.com>
2040 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
2043 2008-04-17 Marek Safar <marek.safar@gmail.com>
2045 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
2049 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
2051 Hook up 'EmitSideEffect'
2052 * constant.cs (Constant.EmitSideEffect): New.
2053 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
2054 (SideEffectConstant.EmitSideEffect): New.
2055 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
2056 unconditional branch in EmitBranchable.
2057 (FieldExpr.EmitBranchable): New.
2058 * expression.cs (Unary.EmitSideEffect): New.
2059 (Binary.EmitSideEffect): New.
2060 (VariableReference.EmitSideEffect): New. Do nothing.
2062 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
2064 Introduce 'EmitSideEffect'
2065 * ecore.cs (Expression.EmitSideEffect): New.
2066 (TypeCast): Rename from EmptyCast.
2068 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
2069 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
2070 * convert.cs, nullable.cs: Update to changes.
2072 2008-04-16 Marek Safar <marek.safar@gmail.com>
2074 * class.cs, cs-parser.jay: Early check for base types expression.
2076 2008-04-16 Marek Safar <marek.safar@gmail.com>
2078 * decl.cs (MemberName): Declare PrettyName as obsolete.
2080 2008-04-16 Marek Safar <marek.safar@gmail.com>
2082 * namespace.cs: Use MemberName comparison.
2084 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
2087 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
2089 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
2090 (MemberName.FullyQualifiedName): New. Provides the functionality
2091 that users assume FullName would have.
2092 * ecore.cs, namespace.cs: Update to changes.
2094 * statement.cs (Using.assign): Make into ExpressionStatement.
2095 (Using.EmitPreTryBody): Simplify.
2097 2008-04-16 Marek Safar <marek.safar@gmail.com>
2099 * report.cs: ColorFormat is protected.
2101 * rootcontext.cs: Unused fields clean-up.
2103 * namespace.cs: Made UsingEntry name private.
2105 2008-04-16 Marek Safar <marek.safar@gmail.com>
2107 * cs-tokenizer.cs, location.cs: Removed unused field.
2109 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
2110 Raja R Harinath <harinath@hurrynot.org>
2113 * constant.cs (SideEffectConstant.value): Rename from 'left'.
2114 (SideEffectConstant.side_effect): Rename from 'right'.
2115 (SideEffectConstant..ctor): Normalize 'side_effect'.
2116 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
2117 value of this constant.
2118 * cfold.cs: Update to changes.
2120 2008-04-15 Marek Safar <marek.safar@gmail.com>
2122 * cs-paser.jay: Removed unused variable.
2124 * driver.cs: Made Compile instance method.
2126 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
2128 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
2130 2008-04-15 Marek Safar <marek.safar@gmail.com>
2132 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
2134 2008-04-13 Jb Evain <jbevain@novell.com>
2136 * namespace.cs: update the System.Core fullname for 2.1
2137 * driver.cs: update the list of required assemblies for 2.1.
2138 Merged from the Moonlight 2 branch.
2140 2008-04-11 Marek Safar <marek.safar@gmail.com>
2142 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
2143 types and user defined operators. User operators arguments has to be checked
2144 for null value before invocation, which also means no operator is called
2145 when any argument is not convertible to unwrapped nullable type.
2147 2008-04-09 Marek Safar <marek.safar@gmail.com>
2149 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
2150 of Unary expressions to follow operator overloading rules precisely.
2151 Also fixes #321794, #323794
2153 2008-04-08 Marek Safar <marek.safar@gmail.com>
2155 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
2158 2008-04-08 Marek Safar <marek.safar@gmail.com>
2160 * expression.cs, ecore.cs: Implemented MemberInit expression.
2162 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
2164 Fix mono/tests/exception4.cs
2165 * statement.cs (ExceptionStatement, TryCatch): Revert to using
2166 ec.NeedReturnLabel () rather emitting a 'nop'.
2168 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
2170 (TryCatch.SomeCodeFollows): Likewise.
2171 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
2172 for 'break', 'continue' and 'return' statements inside a try.
2173 We're fairly sure that the generated IL stream will have more
2174 instructions textually following the try.
2175 (FlowBranchingTryCatch): Likewise.
2177 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
2178 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
2181 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
2182 wrapper -- forward everything to CollectionForeach.
2183 (CollectionForeach.NonDisposableWrapper): New.
2184 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
2185 instead of a pop + branch to end.
2187 2008-04-07 Marek Safar <marek.safar@gmail.com>
2189 A fix for bug #377485
2190 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
2191 Propagate location for extension method groups. Report conversion failure at
2194 2008-04-07 Marek Safar <marek.safar@gmail.com>
2196 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
2197 ListInit and Field expressions.
2199 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
2201 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
2202 Since $PC is always -1 inside the body of MoveNext, the fault
2204 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
2205 * statement.cs (ExceptionStatement.emit_finally): Likewise.
2206 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
2208 The denouement! Fix #324708
2209 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
2210 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
2211 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
2212 'finally' inside the finally clause.
2214 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
2215 inside an iterator. Don't emit the body of the 'finally' inside
2216 the finally clause yet.
2218 Use the ResumableStatement infrastructure for MoveNext ()
2219 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
2220 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
2221 'old_resume_points'. Move dispatcher upfront.
2222 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
2223 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
2224 in an enumerator. This encodes the main fix in this patch series
2225 -- we can only jump into the first instruction of a try from the
2226 outside, but we want to emit try/finally regions in iterators and
2227 resume in the middle of them.
2229 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
2231 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
2232 of NeedReturnLabel here.
2234 Introduce a common point for emitting try/finally to IL
2235 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
2236 features of the various subclasses, which are now driven by ...
2237 (ExceptionStatement.EmitPreTryBody): ... this and ...
2238 (ExceptionStatement.EmitTryBody): ... this and the original
2240 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
2241 Remove DoEmit and update to follow above protocol.
2243 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
2244 of the dispatcher are the same, skip emitting the 'switch'.
2245 * iterator.cs (Iterator.EmitDispose): Update to changes.
2247 Clean up handling of 'using' statement
2248 * statement.cs (UsingTemporary): New. Carved out of ...
2249 (Using): ... this. Simplify drastically. Handle exactly
2251 * cs-parser.jay (using_statement): Split. Create UsingTemporary
2252 or Using as appropriate. If there are multiple variable declared,
2253 create nested Using statements.
2254 (resource_acquisition): Kill.
2256 * statement.cs (ExceptionStatement.EmitForDispose): Use
2257 EmitFinallyBody, not EmitFinally.
2259 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
2260 * iterator.cs: Update to changes.
2262 Start using the ResumableStatement infrastructure
2263 * statement.cs (ResumeableStatement.PrepareForDispose): New.
2264 (ResumableStatement.EmitForDispose): New.
2265 (ExceptionStatement): Override them.
2266 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
2267 EmitForDispose to create the body of the Dispose method. Don't
2270 * iterator.cs (Iterator.AddResumePoint): Move here from ...
2271 * statement.cs (Toplevel.AddResumePoint): ... here.
2272 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
2273 * flowanalysis.cs (FlowBranchingIterator): New.
2274 * codegen.cs (EmitContext): Update to changes.
2276 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
2277 (Iterator.old_resume_points): Rename from 'resume_points'.
2278 (Iterator.MoveNextStatement): Remove unused class.
2280 New infrastructure for try/finally in iterators (still unused)
2281 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
2282 (FlowBranchingToplevel.AddResumePoint): Hook into
2283 ToplevelBlock.AddResumePoint.
2284 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
2285 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
2286 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
2287 resume points and assign program-counter values.
2288 (ExceptionBlock.AddResumePoint): Collect resume points for
2289 de-muxer at the top of try block.
2290 * iterators.cs (Yield.CheckContext): Simplify.
2291 (Yield.Resolve): Use FlowBranching.AddResumePoint.
2293 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
2295 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
2296 argument to an ExitStatement.
2297 (FlowBranchingException): Refactor saved origins code.
2298 * statement.cs (ExitStatement): Update to cahges.
2299 * iterator.cs (YieldBreak): Likewise.
2301 * statement.cs (ResumableStatement): New. Common base class for
2302 YieldReturn and ExceptionStatement.
2303 (ExitStatement): New. Common base class for Return and YieldBreak.
2304 (Return): Update to changes.
2305 * iterator.cs (YieldBreak): Likewise.
2306 * lambda.cs (ContextualReturn): Likewise.
2309 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
2310 emit a meaningful error message.
2312 Fix #324765, #319508
2313 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
2314 (VariableInfo.SetAssigned): Set it.
2315 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
2316 determine if CS0219 or CS0168 is appropriate. Don't use
2317 flow-analysis information.
2318 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
2319 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
2320 (EmitContext.EndFlowBranching): ... this.
2322 2008-04-03 Marek Safar <marek.safar@gmail.com>
2324 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
2326 2008-04-03 Marek Safar <marek.safar@gmail.com>
2328 A fix for bug #376508
2329 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
2330 ImplicitConversionExists.
2332 2008-04-03 Marek Safar <marek.safar@gmail.com>
2334 * expression.cs (Binary): Added remaining binary operators to expression
2337 * nullable.cs: Optimize shift with null argument.
2339 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
2341 Fix minor IL regression
2342 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
2343 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
2344 * cs-parser.jay (try_statement): Update to changes.
2346 * statement.cs (TryFinally.need_exc_block): Delete.
2347 (TryFinally): Update to changes.
2349 Now all ExceptionStatements are unconditional
2350 * statement.cs (CollectionForeach.DisposableWrapper): New.
2351 Extract out the try/finally code into a new wrapper.
2352 (CollectionForeach.Resolve): Use it to simplify the code.
2354 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
2356 Start at simplifying ExceptionStatement semantics a bit
2357 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
2358 * cs-parser.jay (try_statement): Update to changes.
2359 (opt_catch_clauses): Remove.
2360 * flowanalysis.cs: Update to changes.
2361 (FlowBranching.BranchingType.TryCatch): New.
2362 (FlowBranchingTryCatch): New.
2364 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
2365 (FlowBranching.CreateBranching): Update to changes.
2366 (FlowBranchingBlock.AddSibling): Add sanity check.
2367 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
2370 * iterators.cs (Iterator.MarkFinally): Remove.
2371 * statement.cs (ExceptionStatement): Update to changes.
2373 Add support for skipping over finally blocks at runtime. First
2374 in a series to fix #324708
2375 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
2376 (Iterator.EmitMoveNext): Initialize it.
2377 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
2378 branch over the body of the 'finally' clause.
2380 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
2382 Avoid lopsided use of Foo/DoFoo names
2383 * statement.cs (ExpressionStatement.EmitFinallyBody):
2384 Rename from EmitFinally.
2385 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
2386 * iterator.cs: Update to changes.
2388 2008-04-02 Marek Safar <marek.safar@gmail.com>
2390 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
2391 based on UserOperatorCall. More binary nullable operators clean up.
2393 2008-04-02 Martin Baulig <martin@ximian.com>
2395 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
2397 2008-04-02 Marek Safar <marek.safar@gmail.com>
2399 * nullable.cs: Merge user and empty conversions when lifting expression
2402 * expression.cs (StringConcat): Implemented expression tree representation.
2404 2008-04-01 Marek Safar <marek.safar@gmail.com>
2406 * nullable.cs: When lifting null literal and a user operator exists, no call
2409 2008-04-01 Marek Safar <marek.safar@gmail.com>
2411 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
2414 2008-04-01 Marek Safar <marek.safar@gmail.com>
2416 * nullable.cs, expression.cs: Use namespace instead heavily nested
2417 monster abstract class.
2419 2008-04-01 Marek Safar <marek.safar@gmail.com>
2421 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
2422 lifting of null literal and user operators. Clean up of some temporary
2425 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
2427 Fix #368224, test-629.cs
2428 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
2429 if it crossed an unwind-protect boundary.
2430 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
2431 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
2432 inside an unwind-protected region.
2433 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
2434 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
2435 'leave' instead of a 'br' if unwind-protected.
2436 (Iterator.EmitYieldBreak): Likewise.
2438 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
2440 * driver.cs: Only define versioninfo resources if no win32 resource
2443 2008-03-28 Marek Safar <marek.safar@gmail.com>
2445 A fix for bug #372375
2446 * convert.cs: Fixed boxing of nullable types.
2448 2008-03-28 Marek Safar <marek.safar@gmail.com>
2450 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
2453 2008-03-28 Marek Safar <marek.safar@gmail.com>
2455 A fix for bug #374619
2456 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
2458 2008-03-27 Marek Safar <marek.safar@gmail.com>
2460 * lambda.cs: Check return type only for invocation.
2462 2008-03-27 Marek Safar <marek.safar@gmail.com>
2464 A fix for bug #374214
2465 * ecore.cs: Correctly report argument type mismatch.
2467 2008-03-27 Marek Safar <marek.safar@gmail.com>
2469 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
2470 and not rely on broken IsEnum.
2472 2008-03-27 Marek Safar <marek.safar@gmail.com>
2474 * nullable.cs: New file, extracted from generic.cs.
2476 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
2478 2008-03-27 Marek Safar <marek.safar@gmail.com>
2480 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
2481 predefined comparison operators and null literals.
2483 * report.cs: New warning ID.
2485 2008-03-25 Marek Safar <marek.safar@gmail.com>
2487 A fix for bug #370577
2488 * lambda.cs: Check return type too.
2490 2008-03-25 Marek Safar <marek.safar@gmail.com>
2492 A fix for bug #372846
2493 * class.cs: Automatic properties can be declared as unsafe.
2495 2008-03-20 Marek Safar <marek.safar@gmail.com>
2497 * location.cs: Use string based concatenation.
2499 * expression.cs: LiftedBinaryOperator is gmcs only.
2501 2008-03-20 Marek Safar <marek.safar@gmail.com>
2503 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
2504 conversions rules and expression trees.
2506 2008-03-19 Marek Safar <marek.safar@gmail.com>
2508 * delegate.cs: Use extension method source as delegate target.
2510 2008-03-19 Marek Safar <marek.safar@gmail.com>
2512 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
2513 binary operations to be purely based on binary operations and optimized
2514 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
2515 and other ET refactoring.
2517 * typemanager.cs: Fixed warning.
2519 2008-03-17 Marek Safar <marek.safar@gmail.com>
2521 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
2523 * symbolwriter.cs: Fixed.
2525 2008-03-17 Marek Safar <marek.safar@gmail.com>
2527 * anonymous.cs, driver.cs: Reset anonymous types counters.
2529 2008-03-17 Marek Safar <marek.safar@gmail.com>
2531 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
2533 * class.cs: Use fullname for all type member definitions.
2535 2008-02-19 Martin Baulig <martin@ximian.com>
2538 (IMethodData.EmitExtraSymbolInfo): New interface method.
2539 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
2540 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
2541 interface method here as an empty public virtual method.
2544 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
2545 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
2546 CodeGen.SymbolWriter.SetRealMethodName().
2548 2008-02-18 Martin Baulig <martin@ximian.com>
2551 (ScopeInfo.EmitType): Override this and emit debugging
2552 information for captured variables.
2553 (RootScopeInfo.EmitType): Override this and emit symbol
2554 information for a captured `this'.
2556 2008-02-15 Martin Baulig <martin@ximian.com>
2558 * iterators.cs: Emit debugging info.
2561 (EmitContext.Flags): Add `OmitDebuggingInfo'.
2562 (EmitContext.OmitDebuggingInfo): New public property.
2565 (While): Override Emit() and don't emit symbol info there; do it
2566 inside DoEmit() instead.
2567 (Block.Emit): Omit symbol information while emitting the scope
2568 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
2570 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
2571 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
2572 .ctor to make `IsIterator' work.
2574 2008-03-14 Martin Baulig <martin@ximian.com>
2576 * symbolwriter.cs: Added the new symbol writer function from the
2577 debugger's `terrania' branch; temporarily enclose them inside
2578 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
2581 2008-03-14 Martin Baulig <martin@ximian.com>
2584 (SymbolWriter): Make this a public static class.
2587 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
2588 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
2590 2008-03-14 Marek Safar <marek.safar@gmail.com>
2592 A fix for bug #370577
2593 * statement.cs, lambda.cs: Added extra limitations when dealing with void
2596 2008-03-14 Marek Safar <marek.safar@gmail.com>
2598 * typemanager.cs (CSharpName): Made 250 times faster.
2600 2008-03-13 Marek Safar <marek.safar@gmail.com>
2602 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
2604 2008-03-12 Marek Safar <marek.safar@gmail.com>
2606 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
2607 crash when predefined field does not exist.
2609 2008-03-12 Marek Safar <marek.safar@gmail.com>
2611 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
2613 2008-03-12 Marek Safar <marek.safar@gmail.com>
2615 * class.cs (FixedField): Don't crash when contructors are missing.
2617 2008-03-11 Marek Safar <marek.safar@gmail.com>
2619 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
2620 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
2621 check internal types accessibility for internal and external types.
2622 Replaced EnumToUnderlying by GetEnumUnderlyingType.
2624 2008-03-11 Marek Safar <marek.safar@gmail.com>
2626 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
2627 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
2628 attribute.cs, statement: Use corect instance of predefined types (work
2629 related to #364674).
2631 2008-03-07 Marek Safar <marek.safar@gmail.com>
2633 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
2635 2008-03-07 Marek Safar <marek.safar@gmail.com>
2637 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
2638 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
2639 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
2640 predefined types clean up, delayed predefined types members initialization
2641 (work related to #364674).
2643 2008-03-05 Marek Safar <marek.safar@gmail.com>
2645 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
2647 2008-03-05 Marek Safar <marek.safar@gmail.com>
2649 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
2650 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
2651 predefined types clean up (work related to #364674).
2653 2008-03-04 Marek Safar <marek.safar@gmail.com>
2655 * ecore.cs: Print an error message instead of throwing exception.
2657 2008-03-04 Marek Safar <marek.safar@gmail.com>
2659 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
2660 expression.cs, statement.cs: Unififed null literal representation.
2662 2008-03-03 Marek Safar <marek.safar@gmail.com>
2664 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
2665 expression.cs: Refactored binary operators resolve phase and improved speed.
2666 The nullable code is still missing and won't work correctly, more fixes
2669 It also fixes #323726, #324312, #324248, and many other unreported issues.
2671 2008-02-29 Zoltan Varga <vargaz@gmail.com>
2673 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
2676 2008-02-27 Marek Safar <marek.safar@gmail.com>
2678 * ecore.cs: Clean-up and split BetterConversion.
2680 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
2683 * enum.cs (EnumMember.Value): Only access 'value' if
2684 ResolveValue says it's ok.
2685 (EnumMember.DoResolveValue): Don't set prev_member.value.
2686 (Enum.GetDefinition): Reverse arguments of Equals --
2687 EnumMember.Value can return 'null'.
2689 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
2691 2008-02-22 Marek Safar <marek.safar@gmail.com>
2693 * generic.cs, expression.cs: More ongoing work on expression trees.
2695 2008-02-21 Marek Safar <marek.safar@gmail.com>
2697 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
2698 handle missing matches when mutiple operators exist.
2700 2008-02-20 Marek Safar <marek.safar@gmail.com>
2702 A fix for bug #363218
2703 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
2706 2008-02-20 Marek Safar <marek.safar@gmail.com>
2708 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
2709 update. This time to deal correctly with SideEffectConstant expression used
2710 as an argument for another constant folding.
2712 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
2714 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
2717 2008-02-19 Marek Safar <marek.safar@gmail.com>
2719 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
2721 2008-02-19 Marek Safar <marek.safar@gmail.com>
2723 A fix for bug #328136
2724 * expression.cs: Do not fold immediately LogicalAnd operators when the left
2725 side is a false constant, because we still need to evaluate the right-hand
2728 * statement.cs (If): Emit two types of boolean constants (simple constant,
2729 side-effect constant).
2731 2008-02-19 Marek Safar <marek.safar@gmail.com>
2733 * constant.cs (SideEffectConstant): Don't emit boolean constant.
2735 * expression.cs: Fold immediately LogicalAnd operators when both sides are
2738 2008-02-18 Marek Safar <marek.safar@gmail.com>
2740 A fix for bug #361457
2741 * ecore.cs (IsApplicable): Params methods have lower priority.
2743 * support.cs: Return correct parameter modifier for params types.
2745 2008-02-18 Marek Safar <marek.safar@gmail.com>
2747 * generic.cs (TypeParameter): Cache attribute target name.
2749 * support.cs: Removed unused variable.
2751 * typemanager.cs: Removed debugging leftover.
2753 * ecore.cs: Use local type instead of a property;
2755 * class.cs (VerifyMembers): Consider also parent to test whether type member
2758 * expression.cs (FullMethodDesc): Removed.
2760 * attribute.cs (IsValidArgumentType): Made static.
2762 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
2764 Cleanup to be more readable.
2765 * Makefile (GMCS_PROFILE): Remove.
2766 (COMPILER_NAME): New helper.
2768 2008-02-15 Miguel de Icaza <miguel@novell.com>
2770 * cs-tokenizer.cs: if a conditional expression happens inside a
2771 (...) this also means that we do not need to de-ambiguate between
2772 an parenthesized expression and a cast.
2776 * constant.cs (SideEffectConstant): a constant value that happens
2777 to have a side effect.
2779 Fixes the build regressions introduced by the fix for #359789
2781 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
2783 * expression.cs (Conditional.Emit): when emitting the ternary
2784 operator, use local variables to generate code verifiable code.
2786 The verifier cannot infer that the type on stack before the
2787 stloc.0 is executed is of type ParentB. This happens because the
2788 stack merge algorithm uses only parent types when deciding which
2789 is the common type. This is described in Part III 1.8.1.3 of ECMA
2792 This code compiled with mcs is not verifiable under MS. The MS
2793 verifier picks the first common interface of Foo and Bar, which is
2794 wrong, but doesn't use a full join type of the 2 interfaces.
2796 CSC uses a clever hack to compile such code in a verifiable
2797 way. It stores the intermediate values in a local variable with
2802 2008-02-14 Miguel de Icaza <miguel@novell.com>
2804 * expression.cs: Do not fold BitwiseAnd operators when the left
2805 side is a false constant, because we still need to evaluate the
2810 * support.cs: Instead of throwing an InternalErrorException when
2811 the position of the stream is outside the boundary of our buffer,
2812 reset the state of the reader, and restart the reading from the
2813 beginning of the file.
2815 2008-02-14 Marek Safar <marek.safar@gmail.com>
2817 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
2819 2008-02-14 Marek Safar <marek.safar@gmail.com>
2821 A fix for bug #361686
2822 * decl.cs: A protected types used inside a private class which parents
2823 derives from the protected class are accessible.
2825 2008-02-13 Marek Safar <marek.safar@gmail.com>
2827 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
2828 the parameterless constructor.
2830 2008-02-13 Marek Safar <marek.safar@gmail.com>
2832 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
2833 lookup methods to use standard member cache when doing member lookup.
2835 2008-02-12 Marek Safar <marek.safar@gmail.com>
2837 * driver.cs: Don't report full path for referenced module as assembly error.
2839 2008-02-12 Marek Safar <marek.safar@gmail.com>
2841 * Makefile: Fixed `qh' target to work on all machines.
2843 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
2844 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
2845 and HasElementType with TypeManager implementation.
2847 2008-02-08 Marek Safar <marek.safar@gmail.com>
2849 A fix for bugs #325134, #359749
2850 * expression.cs, ecore.cs: Try to resolve an extension method even if the
2851 first binds point to non-method member expression.
2853 2008-02-08 Marek Safar <marek.safar@gmail.com>
2855 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
2857 2008-02-08 Marek Safar <marek.safar@gmail.com>
2859 A fix for bugs #321394, #323028
2860 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
2861 Reworked naive IsAccessibleAs implementation to handle nested types.
2863 2008-02-05 Jb Evain <jbevain@novell.com>
2865 * class.cs: use generic type comparison for parameters
2868 2008-02-05 Marek Safar <marek.safar@gmail.com>
2870 A fix for bug #325372
2871 * class.cs: Use generic type comparison when testing method signatures.
2873 2008-02-05 Marek Safar <marek.safar@gmail.com>
2875 A fix for bug #357047
2876 * ecore.cs: Applied C# 3.0 changes to better conversion.
2878 2008-02-05 Marek Safar <marek.safar@gmail.com>
2880 A fix for bug #358374
2881 * cs-parser.jay: Correctly set modifiers for all constructor types.
2883 2008-02-04 Marek Safar <marek.safar@gmail.com>
2885 A fix for bug #355251
2886 * generic.cs: Added base class constraint based type inference.
2888 2008-02-01 Marek Safar <marek.safar@gmail.com>
2890 A fix for bug #357255
2891 * decl.cs: One more missing visibility check.
2893 2008-02-01 Marek Safar <marek.safar@gmail.com>
2895 * support.cs: Fixed broken return.
2897 2008-01-25 Marek Safar <marek.safar@gmail.com>
2899 * report.cs: Correctly reset warnings count after probing.
2901 2008-01-25 Martin Baulig <martin@ximian.com>
2904 (NamespaceEntry.SymbolFileID): Make this work again after
2905 MemberName.ToString() is gone.
2907 2008-01-25 Marek Safar <marek.safar@gmail.com>
2909 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
2912 2008-01-25 Marek Safar <marek.safar@gmail.com>
2914 * generic.cs: Use full implicit conversion for type inference fixing.
2916 2008-01-24 Marek Safar <marek.safar@gmail.com>
2918 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
2919 Fixed user operator conversions.
2921 2008-01-24 Marek Safar <marek.safar@gmail.com>
2923 * generic.cs: Do nullable type to null comparison optimization during
2926 2008-01-24 Marek Safar <marek.safar@gmail.com>
2928 A fix for bug #355163
2929 * generic.cs: Enabled l-value resolve on nullable expressions.
2931 2008-01-24 Marek Safar <marek.safar@gmail.com>
2933 A fix for bug #353986
2934 * class.cs: Ingore static ctors with parameters for any further checks.
2936 2008-01-24 Marek Safar <marek.safar@gmail.com>
2938 A fix for bug #354310
2939 * namespace.cs: Removed redundant check.
2941 2008-01-24 Marek Safar <marek.safar@gmail.com>
2943 A fix for bug #354928
2944 * expression.cs: ElementInitializers can be resolved only once.
2946 2008-01-24 Marek Safar <marek.safar@gmail.com>
2948 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
2949 Condition expressions.
2951 2008-01-23 Marek Safar <marek.safar@gmail.com>
2953 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
2955 2008-01-22 Marek Safar <marek.safar@gmail.com>
2957 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
2960 * generic.cs: Implemented coalesce expression.
2962 2008-01-22 Marek Safar <marek.safar@gmail.com>
2964 A fix for bug #355145
2965 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
2966 expression tree type inference.
2968 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
2971 * expression.cs (Binary.IsUnsignedType): Fix typo.
2973 2008-01-22 Marek Safar <marek.safar@gmail.com>
2975 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
2977 2008-01-22 Marek Safar <marek.safar@gmail.com>
2979 A fix for bug #355161
2980 * ecore.cs, expression.cs: Wider range of extension method supported
2983 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
2985 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
2986 AssemblyBuilder to operate in compiler context. Fixes mcs part of
2989 2008-01-22 Marek Safar <marek.safar@gmail.com>
2991 A fix for bug #355148
2992 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
2994 2008-01-22 Miguel de Icaza <miguel@novell.com>
2996 * expression.cs (CreateExpressionTree): Add support for or and
2997 logical or, and indent following the coding conventions.
2999 * typemanager.cs (LinqExpression): renamed from
3000 ExpressionTreeManager, for a shorter name.
3002 Use TypeManager.CoreLookupType to lookup types from our core
3003 assemblies and turn those into "Type" variables.
3005 Consumers that previously used "Namespace" and "Type" from this
3006 class should instead use the TypeExpression which is a type that
3007 is fully resolved (without involving the regular C# resolution
3010 This typically looks like this:
3012 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
3013 new MemberAccess (texpr, name, type_arguments, loc)
3015 This avoids the problem in: #355178
3017 2008-01-21 Marek Safar <marek.safar@gmail.com>
3019 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
3020 feature in parser only as we do in other cases.
3022 2008-01-21 Marek Safar <marek.safar@gmail.com>
3024 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
3025 typemanager.cs: A refactoring of params arguments to reuse existing
3026 expressions (params -> array initializer) to emit params argument instead
3027 of specialized handling.
3028 It was required by expression tree implementation and it has other benefits
3029 as well, we now apply same optimization for params arguments as we do for
3032 2008-01-18 Marek Safar <marek.safar@gmail.com>
3034 A fix for bug #353526
3035 * generic.cs: A type inference of params arguments may not required any
3036 temporary array creation.
3038 2008-01-18 Marek Safar <marek.safar@gmail.com>
3040 A fix for bug #353534
3041 * generic.cs, ecore.cs, expression.cs: A method group type inference is
3042 supported for delegates only.
3044 2008-01-18 Marek Safar <marek.safar@gmail.com>
3046 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
3047 type for more than 1 candidates.
3049 2008-01-18 Marek Safar <marek.safar@gmail.com>
3051 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
3054 2008-01-16 Marek Safar <marek.safar@gmail.com>
3056 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
3057 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
3058 operator) expressions.
3060 2008-01-16 Zoltan Varga <vargaz@gmail.com>
3062 * statement.cs: Avoid declaring an IL variable for this_variable since it is
3063 not accessed from the generated IL.
3065 2008-01-14 Marek Safar <marek.safar@gmail.com>
3067 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
3068 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
3069 statement.cs: The first expression tree implementation drop, mostly
3070 infrastructure work.
3072 2008-01-14 Marek Safar <marek.safar@gmail.com>
3074 * ecore.cs (IsNestedChild): Refactored.
3076 2008-01-11 Marek Safar <marek.safar@gmail.com>
3078 * lambda.cs: Don't use a cast on unknown expression statement.
3080 2008-01-10 Geoff Norton <gnorton@novell.com>
3082 * cs-tokenizer.cs: One more token to distinguish between method and lambda
3085 2008-01-09 Marek Safar <marek.safar@gmail.com>
3087 * doc.cs: Report better /doc crash details.
3089 2008-01-09 Marek Safar <marek.safar@gmail.com>
3091 A fix for bug #352536
3092 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
3094 2008-01-08 Marek Safar <marek.safar@gmail.com>
3096 A fix for bug #352287
3097 * ecore.cs, expression.cs: Do `this' access checking in all member access
3100 2008-01-08 Marek Safar <marek.safar@gmail.com>
3102 * rootcontext.cs, driver.cs: Switch to linq mode by default.
3104 * report.cs: Reset message stacks.
3106 2008-01-08 Marek Safar <marek.safar@gmail.com>
3108 * generic.cs (InferInPhases): Correctly calculate params position.
3110 2008-01-08 Marek Safar <marek.safar@gmail.com>
3112 * cs-tokenizer.cs: No need to parse full string when parsing lambda
3115 2008-01-07 Marek Safar <marek.safar@gmail.com>
3117 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
3119 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
3121 * driver.cs: Updated --help option.
3123 2008-01-07 Marek Safar <marek.safar@gmail.com>
3125 * generic.cs (InferParamsTypeArguments): Removed.
3126 (InferInPhases): Add params type inference.
3127 (LowerBoundInference): Fixed scoring mechanism.
3129 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
3131 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
3133 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
3134 byte array for unsigned "baked" assemblies.
3136 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
3138 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
3139 array for assemblies that are not strongnamed.
3141 2008-01-04 Marek Safar <marek.safar@gmail.com>
3143 A fix for bug #351481
3144 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
3145 declaring type for nested generic types.
3147 2008-01-04 Marek Safar <marek.safar@gmail.com>
3149 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
3150 instead of ToString.
3152 2008-01-03 Marek Safar <marek.safar@gmail.com>
3154 A fix for bug #351047
3155 * expression.cs (Binary.ResolveOperator): Allow equality operators between
3156 null and structs only when equality and inequality operators are defined
3157 either as an user-operators or predefined operators.
3159 2008-01-03 Marek Safar <marek.safar@gmail.com>
3161 A fix for bug #351047
3162 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
3164 2008-01-03 Marek Safar <marek.safar@gmail.com>
3166 A fix for bug #351257
3167 * cs-tokenizer.cs: Advance line number for '\r' correctly.
3169 2008-01-03 Marek Safar <marek.safar@gmail.com>
3171 A fix for bug #351157
3172 * class.cs (Using): Fixed yet another broken cloning.
3174 (Block): Put back more sensible default value for statements.
3176 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
3178 * codegen.cs: Allow AssemblyVersion with only major version component.
3181 2007-12-29 Marek Safar <marek.safar@gmail.com>
3183 A fix for bug #324654
3184 * class.cs: Use FullName property as member name.
3186 2007-12-28 Marek Safar <marek.safar@gmail.com>
3188 A fix for bug #342117
3189 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
3190 constructor constraint.
3192 2007-12-28 Marek Safar <marek.safar@gmail.com>
3194 A fix for bug #338273
3195 * class.cs (ProbertyBase): Access modifier checks are required for overrides
3198 2007-12-28 Marek Safar <marek.safar@gmail.com>
3200 A fix for bug #350839
3201 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
3203 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
3205 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3208 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
3210 * statement.cs: Changed some Hashtables to use HybridDictionaries
3211 instead. It was observed that some HashTables only contained a few
3212 items in the vast majority of cases. Since HybridDictionary is
3213 more efficient on small sets (<10 elements), "known_variables"
3214 from class ExplicitBlock as well as "labels" and "constants " from
3215 class Block were changed to HybridDictionaries.
3217 Atsai results: (56216kb->54987kb)
3219 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
3222 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
3224 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3227 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
3229 * expression.cs: foreach loop to for loop, saved on allocation of
3230 enumerator (59333kb->59141kb)
3232 * statement.cs. Changed foreach loops to for loops, saved on
3233 allocation of enumerator (59141kb->59006kb)
3235 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
3236 when constructed with no specified capacity. This was causing a
3237 few ArrayLists to allocate more memory than they would potentially
3238 need in the Block class and MemberCache class. Setting the
3239 ArrayLists to construct with a capacity of 1 saves some
3240 memory. (56216kb->55585kb)
3242 2007-12-27 Marek Safar <marek.safar@gmail.com>
3244 A fix for bug #347189 (2nd issue)
3245 * expression.cs (MemberAccess): Nested type can be found in base non-generic
3248 2007-12-27 Miguel de Icaza <miguel@novell.com>
3250 * report.cs: Do not use colors if stdout and stderr are not a
3253 2007-12-27 Marek Safar <marek.safar@gmail.com>
3255 A fix for bug #346998
3256 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
3259 2007-12-27 Marek Safar <marek.safar@gmail.com>
3261 A fix for bug #343465
3262 * class.cs: Explicit method name for nested types uses dots only.
3264 2007-12-27 Marek Safar <marek.safar@gmail.com>
3266 A fix for bug #343707
3267 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
3269 2007-12-27 Marek Safar <marek.safar@gmail.com>
3271 * ecore.cs: Report type inference errors only when arguments count matches
3274 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
3276 * expression.cs, report.cs: New warning.
3278 * typemanager.cs: Catch anonymous method type too.
3280 2007-12-23 Marek Safar <marek.safar@gmail.com>
3282 A fix for bug #346379
3283 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
3285 2007-12-23 Marek Safar <marek.safar@gmail.com>
3287 A fix for bug #347359
3288 * expression.cs (Invocation): Don't resolve already resolved expression.
3290 2007-12-23 Marek Safar <marek.safar@gmail.com>
3292 A fix for bug #347189
3293 * class.cs (FixedField): Use non-dependent code only in the define phase.
3295 2007-12-23 Marek Safar <marek.safar@gmail.com>
3297 A fix for bug #348076
3298 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
3300 2007-12-22 Marek Safar <marek.safar@gmail.com>
3302 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
3303 discovered extension methods.
3305 2007-12-22 Marek Safar <marek.safar@gmail.com>
3307 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
3310 2007-12-21 Miguel de Icaza <miguel@novell.com>
3312 * report.cs (ErrorMessage): Add support for using colors on
3313 terminals that support it.
3315 2007-12-21 Marek Safar <marek.safar@gmail.com>
3317 * ecore.cs: Use information about expanded params for error reporting.
3319 2007-12-21 Marek Safar <marek.safar@gmail.com>
3321 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
3322 and logic for params overloads.
3324 2007-12-15 Miguel de Icaza <miguel@novell.com>
3326 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
3327 as this is also created from the parser. Fixes #349034
3329 2007-12-12 Miguel de Icaza <miguel@novell.com>
3331 * statement.cs (Throw.CloneTo): it is valid to have empty
3332 expressions for throw.
3334 2007-12-03 Marek Safar <marek.safar@gmail.com>
3336 * cs-parser.jay: Set delegate constraint parsing region correctly.
3338 2007-12-03 Marek Safar <marek.safar@gmail.com>
3340 A fix for bug #345467
3341 * typemanager.cs (IsEqual): Compare generic parameters position only.
3343 2007-11-28 Marek Safar <marek.safar@gmail.com>
3345 * expression.cs (BaseAccess): Type arguments can be null.
3347 2007-11-27 Raja R Harinath <harinath@gmail.com>
3349 * statement.cs (Block.Resolve): Ensure flow-branching tree is
3350 consistent even when an error has occured.
3351 (Switch.Resolve): Likewise.
3353 2007-11-22 Marek Safar <marek.safar@gmail.com>
3355 A fix for bug #334505
3356 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
3359 2007-11-22 Marek Safar <marek.safar@gmail.com>
3361 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
3362 refactorings required to resolve extension methods correctly when mixing
3363 generics and non-generics members.
3365 2007-11-20 Marek Safar <marek.safar@gmail.com>
3367 A fix for bug #342584
3368 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
3371 2007-11-19 Marek Safar <marek.safar@gmail.com>
3373 A fix for bug #342512
3374 * delegate.cs: Use delegate argument expression when is available. Don't
3375 emit virtual call when class is sealed.
3377 2007-11-16 Marek Safar <marek.safar@gmail.com>
3379 A fix for bug #325423
3380 * assign.cs (FieldInitializer): Use resolved expression for emit.
3382 * class.cs: Print less confusing error message.
3384 2007-11-16 Marek Safar <marek.safar@gmail.com>
3386 * cs-tokenizer.cs: Removed GMCS ifdefs.
3388 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
3391 * cs-parser.jay: Disabled nullable check.
3393 * generic-mcs: Copied more generic stuff.
3395 2007-11-16 Marek Safar <marek.safar@gmail.com>
3397 * gcs-parser.jay: Merged to cs-parser.jay.
3399 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
3400 * *.csproj, *.sources: Updated to use only jay parser file.
3402 2007-11-16 Marek Safar <marek.safar@gmail.com>
3404 * gcs-parser.jay: Added nullable and default expression feature checks.
3406 2007-11-16 Marek Safar <marek.safar@gmail.com>
3408 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
3409 it fixes many TODOs and hidden bugs.
3411 * expression: Removed duplicate error check.
3413 2007-11-15 Marek Safar <marek.safar@gmail.com>
3415 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
3416 implicitly type local variable only when it is used in a declaration.
3418 2007-11-15 Marek Safar <marek.safar@gmail.com>
3420 * attribute.cs: Use CS0612 for empty strings.
3422 2007-11-14 Marek Safar <marek.safar@gmail.com>
3424 * lambda.cs, statement.cs: Contextual return may act as a statement.
3426 2007-11-14 Marek Safar <marek.safar@gmail.com>
3428 A fix for a regression cause by #324222
3429 * class.cs: Don't report unused even when it implements an interface.
3431 2007-11-13 Marek Safar <marek.safar@gmail.com>
3433 A fix for bug #341205
3434 * ecore.cs, expression.cs: Method group expression cannot do static
3435 method access with an instance reference check before overloading takes
3438 2007-11-13 Marek Safar <marek.safar@gmail.com>
3440 A fix for bug #325359
3441 * class.cs: Use predictable name for automatically generated property.
3443 2007-11-12 Marek Safar <marek.safar@gmail.com>
3445 A fix for bug #324996
3446 * expression.cs (Is): Handle case where D is nullable and T is not
3449 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
3451 2007-11-12 Marek Safar <marek.safar@gmail.com>
3453 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
3454 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
3455 Flush small error reporting changes.
3457 2007-11-09 Marek Safar <marek.safar@gmail.com>
3459 A fix for bug #324996
3460 * expression.cs: Rewrote Is expression implementation to work with
3461 generics, nullable types, anonymous method. A const result expression
3462 uses existing infrastructure instead of custom not fully-featured one.
3464 2007-11-08 Marek Safar <marek.safar@gmail.com>
3466 A fix for bug #340202
3467 * class.cs: Consider generics for volatile field.
3469 2007-11-08 Marek Safar <marek.safar@gmail.com>
3471 A fix for bug #335594
3472 * expression.cs: Use conversion rules when handling string addition.
3474 2007-11-07 Marek Safar <marek.safar@gmail.com>
3476 A fix for bug #336651
3477 * expression.cs: Fixed a crash when probing is on.
3479 2007-11-07 Marek Safar <marek.safar@gmail.com>
3481 A fix for bug #324242
3482 * covert.cs: Added a conversion from any nullable-type with an
3483 underlying enum-type to the type System.Enum.
3485 2007-11-07 Marek Safar <marek.safar@gmail.com>
3487 A fix for bug #324222
3488 * class.cs: Report all non-used event fields.
3490 2007-11-07 Marek Safar <marek.safar@gmail.com>
3492 A fix for bug #325161
3493 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
3494 qualifier for generic types.
3496 2007-11-07 Marek Safar <marek.safar@gmail.com>
3498 A fix for bug #322971
3499 * expression.cs, ecore.cs: Added intermediate result value check for
3502 2007-11-07 Marek Safar <marek.safar@gmail.com>
3504 A fix for bug #324754
3505 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
3506 when it was requested.
3508 2007-11-07 Marek Safar <marek.safar@gmail.com>
3510 A fix for bug #325101
3511 * expression.cs: Do type not value comparison for `is' expression.
3513 2007-11-07 Marek Safar <marek.safar@gmail.com>
3515 A fix for bug #320236
3516 * convert.cs: Don't apply user conversion on underlying target type.
3518 2007-11-06 Marek Safar <marek.safar@gmail.com>
3520 * expression.cs: Don't use unresolved expression for error reporting.
3522 2007-11-06 Marek Safar <marek.safar@gmail.com>
3524 A fix for bugs #337712, #324490
3525 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
3526 overloading resolution too.
3528 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
3529 the process consistent and more robust.
3531 * expression.cs, linq.cs, report.cs: Update.
3533 2007-11-02 Marek Safar <marek.safar@gmail.com>
3535 A fix for bug #332909
3536 * attribute.cs: Resolve attributes in correct context using error
3539 * rootcontext.cs: Define Obsolete attribute members as core members.
3541 2007-11-02 Marek Safar <marek.safar@gmail.com>
3543 * statement.cs: Removed unused methods.
3545 2007-10-31 Wade Berrier <wberrier@novell.com>
3547 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
3548 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
3551 2007-10-31 Marek Safar <marek.safar@gmail.com>
3553 A fix for bug #338102
3554 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
3555 methods registered as non-generics.
3557 2007-10-31 Marek Safar <marek.safar@gmail.com>
3559 A fix for bugs #337712, #324490
3560 * delegate.cs: Delegate covariance and contravariance is not allowed for
3563 2007-10-31 Marek Safar <marek.safar@gmail.com>
3565 A fix for bug #337719
3566 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
3569 2007-10-30 Marek Safar <marek.safar@gmail.com>
3571 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
3573 2007-10-29 Marek Safar <marek.safar@gmail.com>
3575 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
3578 2007-10-29 Raja R Harinath <rharinath@novell.com>
3580 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
3582 2007-10-29 Marek Safar <marek.safar@gmail.com>
3584 A fix for bug #334652
3585 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
3586 extension methods when we have not found the best candidate in normal
3589 2007-10-27 Marek Safar <marek.safar@gmail.com>
3591 * AssemblyInfo.cs: Keep up-to-date.
3593 2007-10-27 Marek Safar <marek.safar@gmail.com>
3595 * Makefile: Fixed generics compiler name.
3597 2007-10-27 Marek Safar <marek.safar@gmail.com>
3599 * lambda.test: removed, lambda parsing is done differently.
3601 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
3603 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
3605 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
3607 2007-10-27 Marek Safar <marek.safar@gmail.com>
3609 * Makefile, *.sources : All C# compilers are in mcs folder.
3611 * *.cs: Use existing 2_1 define for smcs.
3613 2007-10-26 Marek Safar <marek.safar@gmail.com>
3615 A fix for bug #335847
3616 * assign.cs, expression.cs: Couple of changes to avoid creating a
3617 temporary variable for each object initializer assignment statement. It
3618 simplifies struct initialization too, otherwise two temporary variables
3620 Implemented optimization of redundant default element initializers.
3622 2007-10-25 Marek Safar <marek.safar@gmail.com>
3624 A fix for bug #336766
3625 * expression.cs (Class.CheckBase): Use generic name when method is
3628 2007-10-25 Marek Safar <marek.safar@gmail.com>
3630 A fix for bug #334737
3631 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
3632 variable and not variable argument for prepared copies.
3634 2007-10-24 Marek Safar <marek.safar@gmail.com>
3636 A fix for bug #325110
3637 * class.cs, expression.cs, attribute.cs: Use open generic method when
3638 checking conditional attribute.
3640 2007-10-24 Marek Safar <marek.safar@gmail.com>
3642 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
3643 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
3644 FeatureIsNotAvailable.
3646 2007-10-24 Marek Safar <marek.safar@gmail.com>
3648 ** C# 3.0 Partial methods
3650 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
3651 methods support. Because of member cache issue with generics only
3652 non-generics partial methods are fully supported.
3654 2007-10-23 Marek Safar <marek.safar@gmail.com>
3656 * class.cs, decl.cs: Rewrote member overloads check to cope with
3657 generics and to use member cache for member checking. It also improves
3658 performance and fixes remaining overloads issues.
3660 2007-10-20 Marek Safar <marek.safar@gmail.com>
3662 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
3663 roottypes.cs, typemanager.cs:
3665 A member cache creation logic changed to add members immediately and
3666 not rely on fallback. The member cache is now only prefered way
3667 how to access and find type declaration members. It saves 5 MB of memory
3668 during MWF compilation and makes code ready for more optimizations and
3669 clean-ups, it's also a pre-requirement for partial methods.
3671 2007-10-18 Raja R Harinath <harinath@gmail.com>
3673 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
3674 handling for generic parameters.
3676 2007-10-15 Marek Safar <marek.safar@gmail.com>
3678 * class.cs (FixedField): Removed redundant volatile check.
3680 2007-10-15 Marek Safar <marek.safar@gmail.com>
3682 * class.cs, decl.cs: Fixed overload members verification to do only one
3683 check per possible collision.
3685 2007-10-13 Marek Safar <marek.safar@gmail.com>
3687 A fix for bug #325478
3688 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
3689 and create only one disposable flags container.
3691 2007-10-12 Marek Safar <marek.safar@gmail.com>
3693 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
3694 * statement.cs (Fixed): Fixed variables cloning.
3696 2007-10-12 Marek Safar <marek.safar@gmail.com>
3698 A fix for bug #333342
3699 * class.cs (EventField): Don't mark value type event as synchronized.
3701 2007-10-12 Marek Safar <marek.safar@gmail.com>
3703 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
3704 inference to identify best candidate method correctly.
3705 (ProperyExpr): A range variable is read only and cannot be modified.
3707 2007-10-11 Marek Safar <marek.safar@gmail.com>
3709 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
3710 logic to identify best candidate method correctly.
3712 2007-10-11 Marek Safar <marek.safar@gmail.com>
3714 * location.cs (Equals, GetHashCode): Removed.
3716 2007-10-11 Marek Safar <marek.safar@gmail.com>
3718 * report.cs: Implemented message recorder. It is used mainly for lambda
3719 expressions to capture otherwise swallowed error messages.
3721 * anonymous.cs, lambda.cs.cs: Do full parameters check.
3723 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
3725 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
3727 * expression.cs (MemberAccess): Always report lookup failure.
3729 * location.cs: Implemented Equals, GetHashCode.
3731 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
3733 2007-10-10 Jb Evain <jbevain@novell.com>
3735 * codegen.cs: re-enable assembly version check.
3737 2007-10-09 Marek Safar <marek.safar@gmail.com>
3739 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
3742 * namespace.cs (UsingAlias): Do correct version check.
3744 2007-10-08 Marek Safar <marek.safar@gmail.com>
3746 * expresison.cs, ecore.cs: Issue extension method error message when
3749 * rootcontext.cs: Added ISO_2 compiler mode option.
3751 2007-10-08 Marek Safar <marek.safar@gmail.com>
3753 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
3756 2007-10-08 Marek Safar <marek.safar@gmail.com>
3758 * attribute.cs (GetString, GetBoolean): Work with both literal and
3761 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
3762 Moved method overload specific methods to MethodGroupExpr.
3764 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
3765 it should be less memory consuming.
3767 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
3769 * codegen.cs: remove the assembly version check until the buildbot is
3772 2007-10-07 Jb Evain <jbevain@novell.com>
3774 * attribute.cs (Attribute.GetString): if the value
3775 expression is a StringConstant, return its string value.
3777 2007-10-07 Jb Evain <jbevain@novell.com>
3779 * typemanager.cs: add `assembly_version_attribute_type`.
3780 * codegen.cs: on attribute emission, check that the
3781 AssemblyVersionAttribute doesn't overflow.
3783 2007-10-05 Marek Safar <marek.safar@gmail.com>
3785 A fix for bug #324677
3786 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
3787 parent container of a scope container with currently resolved one.
3789 2007-10-05 Marek Safar <marek.safar@gmail.com>
3791 A fix for bug #325534
3792 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
3795 2007-10-05 Marek Safar <marek.safar@gmail.com>
3797 A fix for bug #327504
3798 * class.cs (Operator.Define): Refactored implicit and explicit user
3799 operator conversion rules.
3801 2007-10-05 Marek Safar <marek.safar@gmail.com>
3803 A fix for bug #327520
3804 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
3806 2007-10-04 Marek Safar <marek.safar@gmail.com>
3808 A fix for bug #328022
3809 * class.cs (MethodData.Define): Use correct method to check whether
3810 a method implementents an accessor.
3812 2007-10-04 Marek Safar <marek.safar@gmail.com>
3814 A fix for bug #330069
3815 * statement.cs (Fixed.Resolve): Read the first array element only when
3816 an array is instantiated.
3818 2007-10-04 Marek Safar <marek.safar@gmail.com>
3820 * expression.cs, assign.cs, generics.cs: Print correct operator when
3821 compound assignment is used.
3823 2007-10-04 Marek Safar <marek.safar@gmail.com>
3825 A fix for bug #325841
3826 * expression.cs (ArrayAccess): Use full argument cloning only for
3827 string compound concatenation.
3829 2007-10-03 Marek Safar <marek.safar@gmail.com>
3831 A fix for bug #328774
3832 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
3834 (PropertyExpr.EmitAssign): Fixed string concatenation compound
3837 2007-10-03 Raja R Harinath <rharinath@novell.com>
3840 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
3841 Event accessibility checks here. Remove some bogus code that
3842 accidently made GenericMethods work.
3843 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
3845 2007-09-25 Marek Safar <marek.safar@gmail.com>
3847 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
3849 * statement.cs (Block): Refactored AddVariable to allow error handling
3852 * generic.cs: New stub.
3854 2007-09-23 Marek Safar <marek.safar@gmail.com>
3856 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
3859 2007-09-17 Marek Safar <marek.safar@gmail.com>
3861 * class.cs: Use partial container to record whether any partial part
3862 contains static field initializer and therefore default contructor has
3865 2007-09-14 Marek Safar <marek.safar@gmail.com>
3867 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
3868 mono-list when only one of two partial parts has defined accessibility
3871 2007-09-14 Marek Safar <marek.safar@gmail.com>
3873 A fix for bug #82845
3875 * class.cs (TypeContainer): Set correct resolve context for all field
3878 2007-09-13 Marek Safar <marek.safar@gmail.com>
3880 * assign.cs: Fixed a crash when field is resolved twice with an error.
3882 * codegen.cs: Changed InFieldInitializer to be flag.
3884 * anonymous.cs, ecore.cs, expression.cs: Update after
3885 IsInFieldInitializer rename.
3887 * const.cs: Removed unused parameter.
3889 * class.cs: Changed the way how we resolve and emit field initializers.
3890 The field initilizers have to have access to contructor block to emit
3891 compiler generated code.
3893 2007-09-13 Marek Safar <marek.safar@gmail.com>
3895 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
3896 generics use TypeContainer instead.
3898 2007-09-12 Marek Safar <marek.safar@gmail.com>
3900 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
3902 * lambda.cs (ResolveParameters): Use more powerful
3903 InflateGenericArgument.
3905 * parameters.cs: Better exception message.
3907 2007-09-10 Marek Safar <marek.safar@gmail.com>
3909 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
3910 correct expression block type.
3912 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
3914 * expression.cs (Invocation): Extracted method group resolve to
3917 2007-09-07 Marek Safar <marek.safar@gmail.com>
3919 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
3920 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
3922 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
3923 generic extension methods.
3925 2007-09-06 Marek Safar <marek.safar@gmail.com>
3927 A fix for bug #82676 (Do I get it right now?)
3928 * convert.cs (Binary.ResolveOperator): An interface is converted to the
3929 object before a standard conversion is applied.
3931 2007-09-06 Marek Safar <marek.safar@gmail.com>
3933 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
3936 2007-09-05 Marek Safar <marek.safar@gmail.com>
3938 A fix for bug #82676
3939 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
3940 non-generic interface types.
3942 2007-09-05 Marek Safar <marek.safar@gmail.com>
3944 A fix for bug #82690
3945 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
3947 2007-09-05 Marek Safar <marek.safar@gmail.com>
3949 A fix for bug #82571
3950 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
3951 modifier for container based methods.
3953 2007-09-05 Marek Safar <marek.safar@gmail.com>
3955 A fix for bug #82676
3956 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
3957 any interface-type T means to any of interface type T.
3959 2007-09-04 Marek Safar <marek.safar@gmail.com>
3961 * namespace.cs: We have 2 versions of System.Core assembly.
3963 2007-09-04 Marek Safar <marek.safar@gmail.com>
3965 A fix for bug #82652
3966 * class.cs (Class.GetClassBases): Compare types and not expressions.
3968 2007-09-04 Marek Safar <marek.safar@gmail.com>
3970 A fix for bug #82620
3971 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
3972 actually never worked before.
3973 (IndexerAccess): Emit prepared arguments before they are modified.
3975 2007-09-04 Marek Safar <marek.safar@gmail.com>
3977 A fix for bug #82563
3978 * assign.cs: Revert wrong fix.
3980 * expression.cs (VariableReference.EmitAssign): Handle ref reference
3982 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
3983 Instead of ldelema/stdind we have to use temporary variables to handle
3984 cases like String.Concat (params string[]).
3986 2007-08-31 Marek Safar <marek.safar@gmail.com>
3988 * class.cs: EmitAttributes to Emit rename.
3990 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
3992 (MemberCore.HasClsCompliantAttribute): Don't depend on
3993 GetClsCompliantAttributeValue execution.
3995 2007-08-31 Marek Safar <marek.safar@gmail.com>
3997 * anonymous.cs: Use shorter type prefix.
3999 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
4002 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
4003 variables when probing is on.
4005 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
4006 unresolved variables.
4007 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
4008 handle transparent identifiers.
4010 2007-08-26 Marek Safar <marek.safar@gmail.com>
4012 * attribute.cs (IsClsCompliant): Add nullable types test.
4014 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
4016 * doc.cs : catch other types of exception than XmlException to
4017 report CS1570. Fixed bug #82565.
4019 2007-08-23 Marek Safar <marek.safar@gmail.com>
4021 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
4022 The number of delegate parameters has to match.
4023 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
4026 2007-08-21 Marek Safar <marek.safar@gmail.com>
4028 * anonymous.cs (AnonymousMethod): Generate private anonymous method
4029 to fix problem with private arguments.
4031 2007-08-20 Marek Safar <marek.safar@gmail.com>
4033 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
4035 * decl.cs (MemberName): Ignore generic type with no generic arguments.
4037 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
4038 empty. Add cloning suport.
4040 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
4042 2007-08-20 Marek Safar <marek.safar@gmail.com>
4044 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
4045 to create EmptyCast. It handles EmptyConstantCast specialization for
4048 2007-08-18 Marek Safar <marek.safar@gmail.com>
4050 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
4051 (EmitArrayArgument): One routine for array arguments.
4052 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
4054 2007-08-17 Marek Safar <marek.safar@gmail.com>
4056 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
4058 2007-08-17 Marek Safar <marek.safar@gmail.com>
4060 * anonymous.cs: MemberLookupFinal update.
4062 * class.cs (ConstructorInitializer): Is expression based.
4064 * delegate.cs: MethodGroupExpr update.
4066 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
4068 (Error_MemberLookupFailed): Customizable error override.
4069 (MethodGroupExpr): Keep queried type for later usage.
4070 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
4073 * expression.cs: Error_MemberLookupFailed refactoring.
4074 (New.DoResolve): Resolve as much as possible.
4075 (ElementInitializer.Error_MemberLookupFailed): Object initializer
4076 customization for invalid member types.
4078 * statement.cs: MethodGroupExpr update.
4080 2007-08-16 Marek Safar <marek.safar@gmail.com>
4082 * modifier.cs (Check): Check all modifiers and not only accessibility
4085 2007-08-16 Marek Safar <marek.safar@gmail.com>
4087 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
4088 type and not an expression.
4090 2007-08-16 Marek Safar <marek.safar@gmail.com>
4092 * statement.cs (Catch.Clone): Type and variable can be null.
4094 2007-08-16 Marek Safar <marek.safar@gmail.com>
4096 A fix for bug #81979
4097 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
4098 I am really not sure whether this is the best fix.
4100 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
4103 2007-08-14 Marek Safar <marek.safar@gmail.com>
4105 ** C# 3.0 Object and collection initializers (major re-write)
4107 * assign.cs (DoResolve): Initializers are not assign related.
4109 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
4110 used during collection or object initialization.
4112 * expression.cs (Error_InvalidArguments): Add initializers specific
4113 messages. More will come later because it requires some general
4115 (New.DoResolve): Better error handling for unsafe types.
4116 (EmptyExpressionStatement): New class.
4117 (ElementInitializer): An object initializer expression.
4118 (CollectionElementInitializer): A collection initializer expression.
4119 (CollectionOrObjectInitializers): A block of object or collection
4121 (NewInitialize): New expression with element/object initializers.
4123 * statement.cs: Reverted object/collection initializer hacks.
4125 * typemanager.cs (CSharpName): Filter __arglist type.
4127 2007-08-09 Marek Safar <marek.safar@gmail.com>
4129 ** C# 3.0 Anonymous Types (update to the latest standard)
4131 * expression.cs (Binary.ResolveOperator): Threat all null based types
4133 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
4134 (AnonymousTypeParameter): Updated.
4136 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
4137 (AnonymousTypeClass): New anonymous type container.
4139 * class.cs (AddField): Return operation result.
4141 * generic.cs: Another empty TypeArguments overload.
4143 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
4144 are stored at top of normal hierarchy.
4146 * typemanager.cs (CSharpName): Filter anonymous types.
4148 2007-08-09 Marek Safar <marek.safar@gmail.com>
4150 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
4151 as single Concat call. How could we miss that :-(
4153 2007-08-08 Marek Safar <marek.safar@gmail.com>
4155 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
4157 2007-08-07 Miguel de Icaza <miguel@novell.com>
4159 * expression.cs: Fix the previous commit, the creation of the
4160 arguments array list needs also to be conditional on the arguments
4163 * class.cs: Add a little bit of help to help narrow down problems.
4165 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
4166 not try to copy in that case.
4168 * driver.cs: When building SMCS, include a new different set of
4169 default assemblies here. Do this here so we can control whether
4170 to include the default assemblies with /noconfig.
4172 2007-08-03 Marek Safar <marek.safar@gmail.com>
4174 A fix for bug #81979
4175 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
4178 2007-08-03 Marek Safar <marek.safar@gmail.com>
4180 A fix for bug #82300
4182 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
4183 we are in probing scope.
4185 2007-08-03 Marek Safar <marek.safar@gmail.com>
4187 A fix for bug #82301
4189 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
4190 (Statement.CloneTo): Clone and not map children blocks.
4192 2007-08-03 Marek Safar <marek.safar@gmail.com>
4194 A fix for bug #82299
4196 * expression.cs (LocalVariableReference.CloneTo): Remap local info
4199 * statement.cs (Statement.CloneTo): Clone variables before statements
4200 to allow remaping of local variables.
4202 2007-08-03 Marek Safar <marek.safar@gmail.com>
4204 A fix for bug #82296
4207 * report.cs: Log crash details for future clone problems.
4209 * statement.cs (Return.Clone): Don't clone non-existent expression.
4211 2007-08-03 Raja R Harinath <harinath@gmail.com>
4213 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
4214 (Class.AddBasesForPart): Move CS0537 check here from ...
4215 * cs-parser.jay (class_declaration): ... here. Move calling of
4216 'AddBasesForPart' to ...
4217 (class_bases): ... here.
4218 (struct_declaration, interface_declaration): Update to changes.
4220 2007-08-02 Marek Safar <marek.safar@gmail.com>
4222 A fix for bug #81923
4224 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
4225 conversion is allowed.
4227 2007-08-02 Marek Safar <marek.safar@gmail.com>
4229 A fix for bug #81564
4231 * ecore.cs (EventExpr): Add IsBase handling.
4233 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
4236 2007-08-02 Raja R Harinath <harinath@gmail.com>
4238 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
4239 * cs-parser.jay: Some whitespace cleanups.
4240 (current_delegate): New.
4242 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
4243 a dummy code block, and use 'type_name' instead of 'member_name'.
4244 (interface_declaration, class_declaration): Likewise.
4245 (delegate_declaration): Likewise. Rearrange slightly and use
4247 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
4248 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
4250 2007-08-02 Marek Safar <marek.safar@gmail.com>
4252 A fix for bug #82039
4254 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
4257 * typemanager.cs (CSharpName): Split to string overload.
4259 2007-08-02 Marek Safar <marek.safar@gmail.com>
4262 * report.cs: Updated warning CS0472.
4264 2007-08-01 Marek Safar <marek.safar@gmail.com>
4266 A fix for bug #82181
4268 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
4270 2007-08-01 Marek Safar <marek.safar@gmail.com>
4272 A fix for bug #82277
4273 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
4275 2007-08-01 Marek Safar <marek.safar@gmail.com>
4277 ** C# 3.0 Type Inference (major bits are working)
4279 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
4280 (.ImplicitStandardConversionExists): Uses compatible.
4281 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
4282 (.InferReturnType): New method.
4283 (.Compatible): Refactored.
4284 (.ResolveParameters): Uses factory to create resolved parameters.
4285 (.CompatibleMethod): Add probing mode support.
4286 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
4287 clearly distinguish between 2 different operations.
4288 (LambdaMethod): Moved to lambda.cs.
4289 (AnonymousMethod): Removed unused fields and methods.
4290 (AnonymousDelegate): Simplified.
4292 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
4294 * convert. cs (ImplicitConversionStandard): Compatible works differently.
4296 * delegate.cs (Delegate): New mehods to reduce code duplication.
4297 (.GetConstructor): New method.
4298 (.GetInvokeMethod): New method.
4299 (DelegateCreation): Updated.
4301 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
4303 (OverloadResolve): Made probing little bit faster.
4305 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
4308 * generic.cs (TypeInferenceContext): Dummy implementation.
4310 * iterators.cs: Updated after Resolve/Define rename.
4312 * lambda.cs (LambdaExpression)
4313 (.ResolveParameters): Handles both type of arguments and type inference too.
4315 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
4316 (InflateTypes): Updated.
4318 * support.cs (InflateTypes): Changed signature and updated.
4320 * typemanager.cs (LookupMemberCache): Better dynamic type check.
4321 (MemberLookup_FindMembers): More MS tricks.
4322 (GetParameterData): Ditto.
4323 (GetDelegateParameters): Uses quick path for dynamic types.
4325 2007-08-01 Marek Safar <marek.safar@gmail.com>
4327 * class.cs (MethodData.Define): EmitContext is required for generic stuff
4330 2007-07-31 Marek Safar <marek.safar@gmail.com>
4332 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
4335 2007-07-26 Jb Evain <jbevain@novell.com>
4337 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
4338 which takes a boolean 'report_errors', similar to the GetMethod.
4339 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
4340 in .net 2.1, do not report errors here.
4342 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
4343 System.Runtime.CompilerServices.RequiredAttributeAttribute and
4344 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
4347 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
4348 of the type InternalsVisibleToAttribute before the first call
4349 to CoreLookupType which is allowed to fail (third boolean parameter
4350 to true). Because, during the resolution for a type that is not
4351 immediately found, we try to check if the type is not defined in
4352 a friend assembly, and to do so, we need the
4353 InternalVisibleToAttribute.
4355 2007-07-23 Miguel de Icaza <miguel@novell.com>
4357 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
4358 feature that allows structs to be compared against null and inline
4359 the result as true or false.
4361 Notice that the same code is not permitted inside a generic block
4362 of code that would do:
4364 class Foo<T> where T : struct {
4371 It is only allowed if the type of T is not bound (no where
4372 clause). In my opinion, this CSC 2 behavior is broken but people
4373 seem to be using it (IronRuby does, a few bug reports on bugzilla
4374 have it and some people have complained about it).
4376 All of the users that depend on this behavior have code that is
4379 * report.cs (Warning, Error): make these take object arguments,
4380 not strings, as that allows us to take advantage of Format.
4382 2007-07-20 William Holmes <billholmes54@gmail.com>
4384 * decl.cs: Changed MemberName.CountTypeArguments to also check the
4385 Left member variable for the Count.
4386 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
4387 MemberName.CountTypeArguments to avoid a NRE.
4389 This code is contributed under the MIT X11 license
4391 2007-07-18 Marek Safar <marek.safar@gmail.com>
4393 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
4395 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
4397 * doc.cs : generic method arguments are written as ``x while generic
4398 type arguments are `x. Combined with the previous change, fixed bug
4401 2007-07-18 Raja R Harinath <rharinath@novell.com>
4404 * expression.cs (Binary.ResolveOperator): When converting
4405 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
4407 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
4409 * doc.cs : when T: or whatever x: is specified, it does not really
4410 check the doc comment's syntax correctness. Fixed bug #82006.
4412 2007-07-18 Marek Safar <marek.safar@gmail.com>
4414 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
4415 LambdaExpression better.
4417 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
4419 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
4421 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
4422 as it can be generated.
4424 * expression.cs (Invocation.Error_InvalidArguments): Show correct
4427 * lambda.cs (LambdaExpression): Refactored to share same code with
4428 AnonymousMethodExpression.
4430 2007-07-17 Marek Safar <marek.safar@gmail.com>
4432 * anonymous.cs (MakeName): Include host name for easier debugging.
4433 (LambdaMethod): New class for lambda spcecific stuff.
4435 * attribute.cs: Set EmitContext return type.
4437 * class.cs: Set EmitContext return type.
4439 * codegen.cs (EmitContext): Return type cannot be null to stop messing
4440 with null/void meaning.
4442 * iterators.cs (ContainerType): Implemented.
4444 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
4446 * statement.cs (Return): Updated to lambda expressions.
4447 (Block.CloneTo): Parent can be null.
4449 2007-07-13 Marek Safar <marek.safar@gmail.com>
4451 A fix for bug #81917
4452 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
4454 * class.cs (FixedField): Check whether field is in unsafe scope.
4456 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
4457 (FieldExpr.Emit): Fixed buffers cannot be volatile.
4459 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
4462 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
4464 2007-07-13 Marek Safar <marek.safar@gmail.com>
4466 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
4467 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
4470 2007-07-13 Marek Safar <marek.safar@gmail.com>
4472 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
4474 2007-07-13 Marek Safar <marek.safar@gmail.com>
4476 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
4477 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
4479 * codegen.cs(EmitContext): Add ProbingMode flag.
4481 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
4483 * driver.cs: For now set both warning values.
4485 * ecore.cs (SimpleName): Name is readonly.
4486 (MethodGroup.OverloadResolve): One quick path for probing.
4488 * expression.cs (Unary): Set Oper r/o.
4489 (Binary): Set Oper r/o.
4490 (ParameterReference): Set few instance variables as r/o.
4491 (ParameterReference.DoResolveBase): Don't capture aruments when
4493 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
4494 (Arglist): arguments are private.
4495 (SizeOf): type is private and r/o.
4496 (MemberAccess): arguments are private.
4498 * report.cs: Enhanced reporting on/off capabilities.
4500 * lambda.cs: Uses ec.IsInProbingMode.
4501 (ContextualReturn): Derives from return.
4503 * rootcontext.cs: For now set both warning values.
4505 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
4507 (Return.Resolve): Don't die immediately.
4508 (Block.Resolve): Speed-up probing.
4509 (Block.CloneTo): Clone only child blocks.
4511 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
4513 * iterators.cs: reverted Miguel's latest change (r81925) as it
4514 breaks the build in System.
4516 2007-07-13 Miguel de Icaza <miguel@novell.com>
4518 * iterators.cs (Yield.CheckContext): Check for the iterator type
4519 also here as we can call into Yield even in codepaths that are not
4521 (MethodOrOperator is the only path that was checked).
4523 In addition to the standard check, use a more specific check for
4524 constructors to report a more verbose error.
4526 2007-07-12 Miguel de Icaza <miguel@novell.com>
4528 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
4529 report the warning and continue
4531 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
4532 values on the stack on the call to Emit. Use EmitStatement if
4533 possible, or using Emit + Pop if not possible. Fixes #82064
4535 2007-07-12 Raja R Harinath <rharinath@novell.com>
4537 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
4538 avoid try...finally in some cases.
4540 2007-07-10 Marek Safar <marek.safar@gmail.com>
4542 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
4544 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
4545 instead of method. Re-use standard error handling.
4546 (ConstructorInitializer.Emit): Simplified.
4548 * delegate.cs: Updated after Invocation.EmitCall change.
4550 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
4551 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
4552 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
4553 method and don't permanently changing input arguments.
4554 (MethodGroupExpr): Introduced resolved best_candidate, when method group
4555 is resolved it has one of the candidates is the best one which is later
4556 used to emit. Removed a few unused method.
4557 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
4559 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
4560 (Binary.ResolveOperator): Ditto.
4561 (ConditionalLogicalOperator.DoResolve): Ditto.
4562 (Invocation): Uses method group.
4563 (Invocation.DoResolve): Simplified.
4564 (Invocation.EmitCall): Removed useless is_static.
4565 (Invocation.Emit): Delegate to method group.
4566 (Invocation.EmitStatement): Simplified.
4567 (New): Uses method group.
4568 (MemberAccess.DoResolve): Don't destroy original expression.
4570 * statement.cs (ForEach.Resolve): Use null for no method arguments.
4572 2007-07-04 Marek Safar <marek.safar@gmail.com>
4574 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
4577 * lambda.cs: Add custom error message type.
4579 2007-07-03 Marek Safar <marek.safar@gmail.com>
4581 * lambda.cs: Simplified little bit.
4583 * parameter.cs: Introduced ImplicitLambdaParameter.
4584 (Parameters.CreateFullyResolved): New factory instead of ctor.
4588 * delegate.cs: Updated parameter creation.
4590 2007-07-03 Marek Safar <marek.safar@gmail.com>
4592 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
4595 * generic.cs: Synchronized with gmcs.
4597 2007-07-03 Marek Safar <marek.safar@gmail.com>
4599 * class.cs (Indexer): Check return type as soon as possible.
4601 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
4604 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
4606 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
4608 * parameter.cs (Parameter): Use expression type when it is available.
4610 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
4611 method modifier for the first parameter only.
4613 2007-06-24 Marek Safar <marek.safar@gmail.com>
4615 A fix for bug #81938
4616 * typemanager.cs (ChangeType): Fixed couple of char conversions.
4618 * constant.cs: Tide up an exception message.
4620 2007-06-22 Marek Safar <marek.safar@gmail.com>
4622 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
4623 an uninitialized variable is used.
4625 * expression.cs (LocalVariableReference.DoResolve): Ditto.
4627 2007-06-22 Marek Safar <marek.safar@gmail.com>
4629 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
4630 not found error handling.
4632 * expression.cs (ArrayCreation): Removed redundant fields and little bit
4634 (ArrayCreation.ResolveArrayElement): To be ready to customization.
4635 (ArrayCreation.DoResolve): Simplified.
4636 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
4637 its own resolve process.
4638 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
4640 2007-06-20 Marek Safar <marek.safar@gmail.com>
4642 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
4645 2007-06-20 Marek Safar <marek.safar@gmail.com>
4647 * cs-tokenizer.cs: Removed var related stuff.
4649 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
4650 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
4651 a type and a keyword at same time.
4653 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
4656 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
4657 implicitly typed arrays, more changes will follow.
4659 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
4661 2007-06-19 Marek Safar <marek.safar@gmail.com>
4663 * ecore.cs (VarExpr): Removed Handled field.
4665 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
4666 build-in assign functionality.
4667 (ForEach.Resolve): Removed all implicitly typed local variable code and
4669 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
4670 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
4672 2007-06-18 Marek Safar <marek.safar@gmail.com>
4674 * assign.cs: Removed implicitly typed local variable check.
4676 * expression.cs (LocalVariableReference.DoResolve): Add check for self
4677 referencing implicitly typed local variable.
4678 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
4681 * statement.cs (Fixed): Removed unsupported implicitly typed local
4684 2007-06-15 Marek Safar <marek.safar@gmail.com>
4686 * decl.cs (MemberName): Moved all Unbound stuff to parser.
4688 2007-06-14 Marek Safar <marek.safar@gmail.com>
4690 A fix for bugs #81855 and #76274
4691 * attribute.cs (AttachTo): Always set owner for global attributes to
4694 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
4697 * cs-parser.jay: Assembly and module attributes must precede all other
4698 elements except using clauses and extern alias declarations.
4700 2007-06-13 Marek Safar <marek.safar@gmail.com>
4702 A fix for bug #81748
4704 * expression.cs: More checks for non ISO-1 features.
4706 2007-06-12 Marek Safar <marek.safar@gmail.com>
4708 A fix for bug #81807
4709 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
4710 present inside switch statement and it is required by nullable check.
4712 2007-06-12 Marek Safar <marek.safar@gmail.com>
4714 A fix for bug #81840
4715 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
4716 when type matching fails.
4718 * namespace.cs: Tiny error message change.
4720 2007-06-12 Marek Safar <marek.safar@gmail.com>
4722 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
4723 reporting. Added automatic property check.
4725 * class.cs: Updated after CheckAbstractAndExtern relocation.
4726 (AEventPropertyAccessor.GetSignatureForError): Customized.
4728 2007-06-11 Marek Safar <marek.safar@gmail.com>
4730 * class.cs (DefineBaseTypes): Base type can be undefined.
4732 * ecore.cs (TypeLookup): Minor refactoring.
4733 (DoResolveAsTypeStep): Removed redundant check.
4735 * namespace.cs (Lookup): Removed redundant check.
4737 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
4738 ResolveAsTypeTerminal step.
4739 (BootstrapCorlib_*): Simplified.
4740 (PopulateCoreType): Core types can be now external.
4742 2007-06-07 Marek Safar <marek.safar@gmail.com>
4744 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
4746 (InferTypeArguments): Infers anonymous expression type arguments.
4747 (Compatible): Split to Compatible and InferTypeArguments.
4749 * lambda.cs: Updated.
4751 2007-06-08 Marek Safar <marek.safar@gmail.com>
4753 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
4755 2007-06-07 Raja R Harinath <harinath@gmail.com>
4757 Fix #80477, cs0135-2.cs, cs0135-3.cs
4758 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
4759 names to the "known" variables list.
4760 (Block.CheckInvariantMeaningInBlock): Handle the fact the
4761 parameter names are also "known".
4762 (Block.CheckError136): Remove.
4763 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
4766 2007-06-07 Marek Safar <marek.safar@gmail.com>
4768 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
4770 2007-06-06 Marek Safar <marek.safar@gmail.com>
4772 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
4773 internal error not an user error.
4775 * expression.cs (IsApplicable): Refactored to make debugging easier.
4777 * support.cs: More tricks for non-mono runtimes.
4779 * typemanager.cs (CoreLookupType): Made public.
4780 (InitSystemCore): All linq specific stuff moved to linq.cs
4782 2007-06-05 Marek Safar <marek.safar@gmail.com>
4784 * typemanager.cs (CSharpSignature): One more missing build-in types
4786 More tricks for non-mono runtime.
4788 2007-06-05 Raja R Harinath <harinath@gmail.com>
4790 * statement.cs (Block.CheckError136_InParents): Remove.
4791 (Block.AddVariable): Use GetParameterInfo instead.
4792 (ToplevelBlock.ProcessArguments): Likewise.
4794 2007-06-04 Raja R Harinath <rharinath@novell.com>
4796 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
4798 (ToplevelBlock.GetParameterInfo): Split out of ...
4799 (ToplevelBlock.GetParameterRefernce): ... this.
4800 (ToplevelBlock.ParameterMap): Remove.
4801 * expression.cs (ParameterReference): Update to use
4802 ToplevelParameterInfo.
4804 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
4807 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
4808 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
4810 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
4811 (ToplevelBlock.ProcessParameters) ... here.
4812 (ToplevelBlock..ctor): Invoke it.
4814 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
4817 * statement.cs (IKnownVariable): New interface.
4818 (LocalInfo): Implement it.
4819 (ToplevelParameterInfo): New class.
4820 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
4821 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
4822 GetKnownVariableInfo.
4824 2007-06-03 Raja R Harinath <harinath@gmail.com>
4826 Partly speed up CS0136 error checks.
4827 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
4828 'recurse' parameter.
4829 (Block.DoCheckError136): Only check errors in parameters. Move
4830 local variable checks ...
4831 (Block.AddVariable): ... here, and ...
4832 (ToplevelBlock.ResolveMeta): ... here.
4834 2007-06-02 Raja R Harinath <harinath@gmail.com>
4836 * statement.cs (Block.IsChildOf): Remove.
4838 * statement.cs (Statement.Clone): Move special case code ...
4839 (Block.CloneTo): ... here.
4841 2007-05-29 Raja R Harinath <rharinath@novell.com>
4843 * statement.cs (ToplevelBlock.container): Remove field. It's
4844 redundant with 'Parent'.
4845 (ToplevelBlock.ContainerBlock): Remove accessor.
4846 (ToplevelBlock..ctor): Update to changes. Register anonymous
4847 child with parent here, ...
4848 * cs-parser.jay (end_anonymous): ... not here. Don't modify
4850 (start_anonymous): Don't save current_block.
4851 (top_current_block): Remove.
4853 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
4854 (Block.Resolve): Update to changes.
4855 (Block..ctor): Move setting of "correct" 'Toplevel'
4856 and 'Explicit' fields to ...
4857 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
4859 2007-05-27 Raja R Harinath <harinath@gmail.com>
4862 * statement.cs (Block.Implicit): Remove.
4863 (Block): Update to changes.
4864 * flowanalysis.cs: Likewise.
4866 Mildly speed up CheckInvariantMeaningInBlock
4867 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
4868 Recursively call AddKnownVariable to all enclosing blocks.
4869 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
4870 Remove recursive calls.
4871 (Block): Update to changes.
4873 New ExplicitBlock invariants
4874 * statement.cs (Block.Explicit): New field. It points to the
4875 immediately enclosing non-implicit block.
4876 (Block..ctor): Maintain the invariant.
4877 * cs-parser.jay: Take advantage of invariant.
4879 Introduce ExplicitBlock
4880 * statement.cs (ExplicitBlock): New.
4881 (ToplevelBlock): Derive from it.
4882 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
4884 (Block.Implicit): Update to changes.
4885 * cs-parser.jay: Update to changes.
4888 * codegen.cs (EmitContext.IsLastStatement): Remove.
4889 * statement.cs (Block.DoEmit): Update to changes.
4891 2007-05-25 Raja R Harinath <rharinath@novell.com>
4893 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
4894 modifying current_block directly.
4896 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
4898 * class.cs: Implemented automatic properties (C# 3.0)
4899 Thanks to Marek for the help.
4901 2007-05-23 Raja R Harinath <rharinath@novell.com>
4903 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
4904 variable as assigned, note also that all its components are
4906 (MyBitVector.SetRange): New. Function to set multiple bits to true.
4908 2007-05-19 Marek Safar <marek.safar@gmail.com>
4910 * anonymous.cs, class.cs: Emit Compiler generated attribute when
4911 member is marked as compiler generated.
4913 * decl.cs (MemberCore): Refactored ModFlags into property.
4915 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
4916 (Check): Check only accessibility modifiers.
4918 2007-05-18 Raja R Harinath <rharinath@novell.com>
4920 Track all assignable slots in one bit array
4921 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
4922 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
4923 logic from VariableMap constructor here. Use the same 'offset'
4924 variable that's later used for computing offsets of local
4926 * flowanalysis.cs (UsageVector.parameters): Remove.
4927 (UsageVector): Update to changes.
4928 (VariableMap): Remove.
4930 Avoid creating ParameterMap in every block
4931 * statement.cs (Block.ParameterMap): Move ...
4932 (ToplevelBlock.ParameterMap): ... here.
4933 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
4935 * flowanalysis.cs (FlowBranching.param_map): Remove.
4936 (FlowBranching.UsageVector): Update to changes.
4937 (FlowBranchingToplevel.CheckOutParameters): Likewise.
4939 * statement.cs (Block.CloneTo): Clone Toplevel field too.
4941 * expression.cs (ParameterReference): Distinguish between block
4942 where parameter was referenced and declared.
4944 2007-05-18 Marek Safar <marek.safar@gmail.com>
4946 * flowanalysis.cs, statement.cs: Put back improved error handling.
4948 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
4952 Imporved object and collection initialization (C# 3.0).
4954 2007-05-15 Marek Safar <marek.safar@gmail.com>
4956 A fix for bug #81380
4957 * expression.cs (Is.DoResolve): Only value types have constant `is'
4960 2007-05-15 Raja R Harinath <rharinath@novell.com>
4962 * statement.cs (ToplevelBlock.child): Remove.
4964 2007-05-15 Raja R Harinath <harinath@gmail.com>
4966 Rationalize ResolveMeta: refactoring
4967 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
4968 out constant handling code into ...
4969 (Block.DoResolveConstants): ... this.
4971 Rationalize ResolveMeta: kill local_map
4972 * statement.cs (Block.local_map, Block.LocalMap): Remove.
4973 (Block.AssignableSlots): New.
4974 (Block.ResolveMeta): Make protected. Don't create a VariableMap
4975 for locals -- move code from VariableMap here. Avoid unnecessary
4977 * flowanalysis.cs (FlowBranching.local_map): Remove.
4978 (FlowBranching..ctor): Use Block.AssignableSlots.
4979 (VariableMap): Remove unused constructors.
4981 2007-05-11 Raja R Harinath <rharinath@novell.com>
4983 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
4985 2007-05-11 Marek Safar <marek.safar@gmail.com>
4987 * typemanager.cs (IsFriendAssembly): Should not be called for building
4990 2007-05-09 Marek Safar <marek.safar@gmail.com>
4992 * literal.cs (NullConstant): Print null in all cases.
4994 * expression.cs (Binary.ResolveOperator): Implemented delegate
4995 comparison based on C# 2.0 changes.
4997 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
4999 This code is contributed under the MIT X11 license
5001 The following enables support for several C# 3.0 language features:
5003 * cs-tokenizer.cs: Added support for the "var" keyword.
5005 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
5006 Added VarExpr class to facilitate type inferencing.
5008 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
5009 to support anonymous types.
5011 * assign.cs: Added support for type inferencing and initialization.
5013 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
5015 * expression.cs: Added implicit array support to ArrayCreation.
5016 Added 5 types and 1 interface:
5018 IInitializable Implementing classes can inject initializing
5019 statements after object instantiation.
5021 Initializer Stores data for object initialization.
5023 AnonymousType An expression for anonymous types.
5025 AnonymousTypeParameter Stores data about an anonymous type's field.
5027 NewInitialize An expression for object initialization.
5029 CollectionInitialize An expression for collection initialization.
5031 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
5034 2007-05-06 Marek Safar <marek.safar@gmail.com>
5036 A fix for bug #81500
5037 * cs-tokenizer.cs: Add special handling for coalescing operator.
5039 2007-05-06 Marek Safar <marek.safar@gmail.com>
5041 A fix for bug #81529
5042 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
5043 its value from base class until it is redefined.
5045 2007-05-02 Raja R Harinath <rharinath@novell.com>
5047 Fix regression in cs0631-3.cs
5048 * cs-parser.jay (operator_declarator): Add opt_attributes to error
5049 fallback. Make error fallback catch more cases.
5051 2007-05-01 Miguel de Icaza <miguel@novell.com>
5053 * cs-parser.jay: Allow parameters in operator declarations to have
5056 2007-04-27 Miguel de Icaza <miguel@novell.com>
5058 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
5061 * lambda.cs (ContextualReturn.Resolve): An expression is valid
5062 inside the ContextualReturn, it does not have to be an
5063 ExpressionStatement.
5065 2007-04-24 Miguel de Icaza <miguel@novell.com>
5067 * lambda.cs (ContextualReturn.Resolve): if the return type is not
5070 2007-04-23 Miguel de Icaza <miguel@novell.com>
5072 * anonymous.cs (AnonymousContainer): split the virtual Resolve
5073 method in two methods: ResolveNoDefine and Resolve.
5075 ResolveNoDefine will stop just after ResolveTopBlock has been
5078 Resolve will then continue by creating a method and issuing the
5079 call to method.Define ().
5081 (AnonymousMethod): Split and implement the new Resolve and
5082 ResolveNoDefine as well.
5084 * lambda.cs (LambdaExpression): Split the anonymous method
5085 resolution code into a separate routine (CoreCompatibilityTest)
5086 from DoCompatibleTest.
5088 (LambdaExpression.TryBuild): New method, this method tries to
5089 build the LambdaExpression with the given set of types to be used
5090 as the types for the various parameters of the lambda expression.
5092 If the compilation succeed with the given types, the infered type
5093 of the Anonymous method is returned, otherwise null is returned.
5095 2007-04-23 Marek Safar <marek.safar@gmail.com>
5097 A fix for bug #81414
5098 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
5100 2007-04-22 Miguel de Icaza <miguel@novell.com>
5102 * cs-tokenizer.cs: Change various identifiers here from the
5103 camelCasing to the recommended Linux-like style for instance
5104 variables from the Coding Guidelines.
5106 2007-04-19 Martin Baulig <martin@ximian.com>
5109 (Convert.ImplicitReferenceConversionCore): Allow conversions from
5110 System.Enum to System.ValueType.
5112 2007-04-13 Martin Baulig <martin@ximian.com>
5114 Rewrote implicit reference conversions. We need to distinguish
5115 between implicit reference conversions (13.1.4) and implicit
5116 boxing conversions (13.1.5).
5118 According to the spec, there's an an implicit conversion
5119 "From a one-dimensional array-type S[] to IList<T> and base
5120 interfaces of this interface, provided there is an implicit
5121 reference conversion from S to T." Note that this does not
5122 include boxing conversions.
5125 (Convert.ImplicitTypeParameterBoxingConversion): New method.
5126 (Convert.ImplicitReferenceConversion): Split into
5127 ImplicitReferenceConversionCore() and
5128 ImplicitBoxingConversionExist().
5129 (Convert.ImplicitReferenceConversionExists): Use the new
5130 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
5132 2007-04-12 Martin Baulig <martin@ximian.com>
5134 * convert.cs (Convert.ImplicitReferenceConversion): Move the
5135 `TypeManager.null_type' checks up to the top of the method.
5137 2007-04-11 Marek Safar <marek.safar@gmail.com>
5139 A fix for bug #81350
5140 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
5143 2007-04-11 Martin Baulig <martin@ximian.com>
5145 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
5146 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
5147 to make this work for generic classes; fixes #79561.
5149 2007-04-11 Martin Baulig <martin@ximian.com>
5151 * expression.cs (As): Add support for nullable types; fixes #79371.
5153 2007-04-11 Martin Baulig <martin@ximian.com>
5155 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
5156 `type.FullName' is null; fixes #80243.
5158 2007-04-11 Martin Baulig <martin@ximian.com>
5160 * expression.cs (Invocation.IsApplicable): Don't modify the method
5161 if type inference succeeded, but the method was not applicable.
5164 2007-04-10 Marek Safar <marek.safar@gmail.com>
5166 A fix for bug #81324
5167 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
5168 internal and external namespaces containers.
5170 2007-04-10 Martin Baulig <martin@ximian.com>
5172 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
5173 TypeManager.DropGenericMethodArguments() so we also call
5174 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
5176 2007-04-10 Martin Baulig <martin@ximian.com>
5178 * iterators.cs (Iterator.CreateIterator): Don't crash if
5179 `method.ReturnType' is null. This happens if something went wrong
5180 while resolving that typ (we already reported an error in this case).
5182 2007-04-10 Martin Baulig <martin@ximian.com>
5184 * expression.cs (New.DoResolve): Don't call CheckComImport() on
5185 generic interfaces; report the CS0144 directly.
5187 2007-04-10 Martin Baulig <martin@ximian.com>
5189 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
5190 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
5192 2007-04-10 Martin Baulig <martin@ximian.com>
5194 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
5196 2007-04-09 Raja R Harinath <rharinath@novell.com>
5199 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
5200 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
5203 * statement.cs (For.Resolve): If resolution fails, use
5206 2007-04-08 Marek Safar <marek.safar@gmail.com>
5208 * anonymous.cs (MakeName): Make faster and zero-based.
5209 (VerifyExplicitParameterCompatibility): Back to mode where generic
5210 parameter is ignored.
5211 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
5213 * class.cs (EmitType): Method can emit another new method.
5215 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
5217 * driver.cs: Updated.
5219 * lambda.cs: Reuse predefined empty parameters.
5221 * parameter.cs: Updated
5223 * support.cs: Implemented InflateTypes.
5225 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
5226 (InitSystemCore): Introduced to isolate 3.0 dependencies.
5228 2007-04-03 Martin Baulig <martin@ximian.com>
5232 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
5233 version of TypeManager.IsOverride() which also works with generic
5236 2007-04-03 Martin Baulig <martin@ximian.com>
5241 (Convert.ExplicitReferenceConversion): We need to cast when
5242 converting from IList<T> to S[].
5244 2007-04-01 Marek Safar <marek.safar@gmail.com>
5246 * decl.cs (FindExtensionMethods): Consider all candidates with same name
5249 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
5251 2007-03-31 Marek Safar <marek.safar@gmail.com>
5253 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
5254 argument and return type inferring.
5256 * codegen.cs (InferReturnType): Flag whether return can be inferred.
5257 (ReturnType): Turned to property.
5259 * statement.cs (Return): Implemented return type inferring.
5261 * support.cs (ReflectionParameters): Use local types if possible.
5263 2007-03-30 Raja R Harinath <rharinath@novell.com>
5265 * flowanalysis.cs (FlowBranching.Reachability): Remove.
5266 (FlowBranching.UsageVector): Update to changes.
5268 Prepare to kill 'Reachability'
5269 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
5270 argument of constructor.
5272 2007-03-29 Raja R Harinath <rharinath@novell.com>
5274 Prepare to kill 'Reachability'
5275 * flowanalysis.cs (UsageVector.is_unreachable): New.
5276 (UsageVector): Update to maintain 'is_unreachable' in parallel to
5277 'reachability', and verify they're consistent.
5280 * expression.cs (New.EmitStatement): Handle type parameters here too.
5282 2007-03-29 Martin Baulig <martin@ximian.com>
5287 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
5288 CompilerGeneratedClass.
5289 (ScopeInfo.EmitScopeInstance): Make this protected.
5290 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
5291 `ec.CurrentAnonymousMethod.Scope == Scope'.
5293 * statement.cs (Block.ScopeInfo): Make this a property.
5295 2007-03-27 Raja R Harinath <harinath@gmail.com>
5297 Prepare to kill 'Reachability'
5298 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
5299 (FlowBranching.UsageVector.Reachability): Remove property.
5300 (FlowBranching.UsageVector.IsUnreachable): New property.
5301 (FlowBranching.UsageVector.ResetBarrier): New.
5302 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
5303 * codegen.cs, statement.cs: Update to changes.
5305 2007-03-27 Martin Baulig <martin@ximian.com>
5310 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
5313 2007-03-26 Raja R Harinath <rharinath@novell.com>
5315 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
5316 instead of TriState. Remove all mention of TriState.
5318 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
5319 replaced by a boolean. Add boolean 'is_unreachable' field, check
5320 and maintain invariants.
5322 2007-03-25 Marek Safar <marek.safar@gmail.com>
5324 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
5326 2007-03-25 Marek Safar <marek.safar@gmail.com>
5328 * expression.cs: Stop using obsolete 2.0 opcodes.
5330 2007-03-25 Marek Safar <marek.safar@gmail.com>
5332 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
5333 one of the latests Martin's fixes.
5335 2007-03-23 Miguel de Icaza <miguel@novell.com>
5337 * expression.cs: On BigEndian systems, swap the bytes, temporary
5338 solution until we get a new bitconverter class.
5340 2007-03-23 Martin Baulig <martin@ximian.com>
5344 * decl.cs (MemberCache.AddMembers): Add generic methods both as
5345 "Method" and "Method`1". Normally, a cache lookup is done on the
5346 "Method" form (ie. without the generic arity), but this one makes
5347 lookups on the full form work as well.
5349 2007-03-22 Raja R Harinath <rharinath@novell.com>
5351 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
5354 2007-03-20 Bill Holmes <billholmes54@gmail.com>
5356 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
5357 ordered_member_list, to TypeBuilder to store members to be defined
5358 in the order they were parsed in.
5359 - ordered_explicit_member_list contains all properties indexers
5360 and methods that are defined as explicit implementation of an
5361 interface or base class.
5362 - ordered_member_list contains all properties indexers and methods
5363 that are not defined as explicit implementation of an interface
5366 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
5367 functionality in these removed classes has been replaced with
5368 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
5369 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
5371 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
5372 to CheckForDuplications inside GetMethod and SetMethod Define Method
5373 to handle method property and indexer name conflicts.
5377 All code is contributed under the MIT/X11 license.
5379 2007-03-20 Martin Baulig <martin@ximian.com>
5381 * class.cs (TypeContainer.Interfaces): Removed; they're now
5382 included in `TypeContainer.Types'.
5384 2007-03-20 Martin Baulig <martin@ximian.com>
5386 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
5388 * class.cs (TypeContainer.CreateType): New public method. This is
5389 now called before DefineType() to create the TypeBuilders.
5390 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
5391 has already been created by CreateType().
5392 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
5393 don't resolve our base classes here; this has been moved into
5394 DefineBaseTypes(). We're now called from CreateType().
5395 (TypeContainer.DefineBaseTypes): New private method; resolve our
5396 base classes here. We're now called from DefineType().
5399 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
5400 our types first to create all the TypeBuilders. After that, call
5401 TypeContainer.DefineType() on all the types which'll resolve their
5402 base classes and setup the resolve order.
5404 2007-03-20 Martin Baulig <martin@ximian.com>
5406 * class.cs (TypeContainer.Enums): Removed; they're now included in
5407 `TypeContainer.Types'.
5409 2007-03-20 Martin Baulig <martin@ximian.com>
5412 (TypeContainer.DefineType): Don't call ResolveMembers() here.
5413 (TypeContainer.DoResolveMembers): Call DefineType() on our
5414 `compiler_generated' classes; moved here from DefineNestedTypes().
5417 (RootContext.ResolveTree): Call ResolveMembers() on all
5418 TypeContainer's in the `type_container_resolve_order'.
5420 2007-03-19 Marek Safar <marek.safar@gmail.com>
5422 * class.cs: Use corlib to handle InternalMethodImplAttribute.
5424 2007-03-17 Marek Safar <marek.safar@gmail.com>
5426 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
5427 implementation flags.
5429 2007-03-17 Marek Safar <marek.safar@gmail.com>
5431 * class.cs: More optimizations for type parameters.
5433 2007-03-15 Marek Safar <marek.safar@gmail.com>
5435 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
5437 * ecore.cs, parameter.cs: More common code for both corlibs.
5439 * typemanager.cs (IsGenericMethod): Simplified.
5441 2007-03-15 Raja R Harinath <rharinath@novell.com>
5443 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5445 * statement.cs, iterators.cs, lambda.cs: Update to changes.
5447 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
5448 unconditionally. Simplify explanation.
5449 (Try.Resolve, Using.Resolve): Likewise.
5451 2007-03-15 Martin Baulig <martin@ximian.com>
5455 * decl.cs (DeclSpace): If we're a partial class, use our
5456 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
5458 2007-03-15 Raja R Harinath <rharinath@novell.com>
5460 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5462 (FlowBranching.UsageVector): Update to changes.
5463 (FlowBranching.MergeSiblings): Likewise.
5464 * statement.cs: Likewise.
5466 2007-03-15 Martin Baulig <martin@ximian.com>
5471 (MemberCache): Added a special .ctor for type parameters.
5474 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
5477 2007-03-09 Martin Baulig <martin@ximian.com>
5479 * enum.cs (Enum): Make this a TypeContainer.
5480 (EnumMember): Derive from `Const'.
5483 (Const.DoResolveValue): New protected virtual method; move most of
5484 the functionality of ResolveValue() here so we can override it in
5486 (Const.CreateConstantReference): Make this virtual.
5488 * class.cs (Kind): Add `Kind.Enum'.
5489 (TypeContainer.Emit): Don't emit the enums here; they're already
5490 in the `RootContext.typecontainer_resolve_order'.
5492 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
5493 here; they're already in the `typecontainer_resolve_order'.
5495 * ecore.cs (EnumConstant.ConvertImplicitly): Add
5496 TypeManager.DropGenericTypeArguments().
5499 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
5500 (TypeManager.IsEnumType): Likewise.
5501 (TypeManager.EnumToUnderlying): Likewise.
5502 (TypeManager.IsEqual): Add support for enums.
5504 2007-03-12 Raja R Harinath <rharinath@novell.com>
5506 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
5507 DefaultParameterValueAttribute to be undefined, say if System.dll
5510 2007-03-11 Marek Safar <marek.safar@gmail.com>
5512 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
5515 2007-03-10 Marek Safar <marek.safar@gmail.com>
5517 * class.cs, parameter.cs: Unified parameters verification.
5519 2007-03-08 Martin Baulig <martin@ximian.com>
5521 * cs-parser.jay (constructor_header): Pass the location to the
5522 newly created TopLevelBlock.
5524 2007-03-07 Martin Baulig <martin@ximian.com>
5526 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
5528 2007-03-06 Miguel de Icaza <miguel@novell.com>
5530 * convert.cs (ExplicitReferenceConversionExists): Sync this method
5531 with the changes from David, fixes the build.
5533 2007-03-05 David Mitchell <dmitchell@logos.com>
5535 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
5536 and its base interfaces to a one-dimensional array type S[],
5537 provided there is an implicit or explicit reference conversion
5540 2007-03-03 Marek Safar <marek.safar@gmail.com>
5542 * cs-tokenizer.cs: Implemented basic linq grammar.
5544 * driver.cs: Set linq lang version on demand.
5546 2007-02-26 Marek Safar <marek.safar@gmail.com>
5548 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
5550 2007-02-25 Marek Safar <marek.safar@gmail.com>
5552 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
5555 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
5557 Check property and event extern attributes.
5559 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
5562 2007-02-24 Marek Safar <marek.safar@gmail.com>
5564 A fix for bug #80407
5565 * ecore.cs: Don't report ambiguity error when methods have same parent.
5567 2007-02-23 Marek Safar <marek.safar@gmail.com>
5569 A fix for bug #80878
5570 * class.cs, cs-parser.jay: Event property can host anonymous methods.
5572 2007-02-22 Marek Safar <marek.safar@gmail.com>
5574 * attribute.cs: Enable ExtensionAttribute presence test.
5576 2007-02-22 Marek Safar <marek.safar@gmail.com>
5578 * class.cs: Warn about missing GetHashCode only when Equals is override.
5580 * decl.cs: Check accessibility of type arguments.
5582 * typemanager.cs: Correctly report nullable array.
5584 2007-02-20 Marek Safar <marek.safar@gmail.com>
5586 * class.cs, report.cs: Capture more details when things go wrong.
5588 2007-02-20 Marek Safar <marek.safar@gmail.com>
5590 A fix for bug #80650
5591 * cs-parser.jay: Anonymous container starts at constructor declaration
5592 and not at block beginning because it has to be usable in constructor
5595 * statement.cs: Use context location and not block one for error reporting.
5597 2007-02-18 Marek Safar <marek.safar@gmail.com>
5599 A fix for bug #78712
5600 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
5603 2007-02-18 Marek Safar <marek.safar@gmail.com>
5605 A fix for bug #80493 by Atsushi Enomoto
5606 * cs-parser.jay: Ignore invalid attribute target.
5608 2007-02-18 Marek Safar <marek.safar@gmail.com>
5610 * cs-tokenizer.cs: Ignore '\0' as white space character.
5612 2007-02-17 Miguel de Icaza <miguel@novell.com>
5614 * cs-parser.jay: Add support for lambda expressions to the mcs
5617 * lambda.cs: Only clone when we are probing, not on the final call
5618 (Compatible is the final call).
5620 * statement.cs (CloneContext): Introduce class to provide block
5621 remapping during clone.
5623 All statements Clone themselves now.
5625 (Clone): special handling for blocks, when we clone a block, we
5626 register the block inside this routine, as children of the block
5627 might trigger a lookup.
5629 * expression.cs: Add support for CloneContext in all expressions.
5631 2007-02-17 Marek Safar <marek.safar@gmail.com>
5633 A fix for bug #80493
5634 * statement.cs: Report ambiguous warning when interfaces are not related.
5636 2007-02-15 Marek Safar <marek.safar@gmail.com>
5638 C# 3.0 extension methods.
5640 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
5641 cannot be used directly.
5643 * class.cs (Class.Emit): Emit extension attribute if any class method
5644 is extension method.
5645 (Method.Define): Add basic extension method validation conditions.
5646 (Method.Emit): Emit extension attribute for method.
5648 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
5649 extension method exists. Currently we follow same approach as Microsoft
5650 does, emit even if a method or a class are private but this can change
5653 * cs-parser.jay: Add handling of `this' keyword in method parameters
5656 * decl.cs (DeclSpace.IsStaticClass): New property.
5657 (MemberCache.FindExtensionMethods): Looks for extension methods with
5658 defined name and extension type.
5660 * doc.cs: Updated after OverloadResolve changes.
5662 * driver.cs: Add new soft reference to System.Core.dll.
5664 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
5665 (ExtensionMethodGroupExpr): Represents group of extension methods.
5667 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
5668 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
5669 to MethodGroupExpr and made non-static for easier customization.
5670 (Invocation.DoResolve): Add extension method lookup when no standard
5672 (MemberAccess.DoResolve): Try extension methods if no member exists.
5674 * modifiers.cs: Add METHOD_EXTENSION modifier.
5676 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
5677 as well as candidate extension type.
5678 (ComputeNamespaces): When assembly constains extension methods registers
5680 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
5681 extension method lookup.
5682 (Namespace.LookupExtensionMethod): Looks for extension method in this
5684 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
5685 find a method which matches name and extensionType.
5687 * parameter.cs (Parameter): Add This modifer.
5688 (HasExtensionMethodModifier): New property.
5689 (Resolve): Add extension parameter check.
5690 (ModFlags): turned to property to exclude this modifier as it is not real
5692 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
5694 * support.cs (ParameterData): Add ExtensionMethodType.
5695 (ReflectionParameters): Implemented ExtensionMethodType interface property.
5697 * typemanager.cs: Add type and ctor extension attribute type.
5699 2007-02-15 Miguel de Icaza <miguel@novell.com>
5701 * report.cs (DisableErrors, EnableErrors): used to prevent error
5702 output when we are "trying" to compile various methods with
5705 * ecore.cs (Expression): Add Clone method that calls the virtual
5706 CloneTo method. The current CloneTo method in Expression throws
5707 an exception so we can track down all the places where this must
5708 be implemented (not using abstract, because that would be a lot of
5709 up-front-work before we can start testing the implementation
5712 Important: we only need Clone capabilities for expressions created
5713 by the parser, as the expressions we will be cloning are
5714 expressions in the pre-resolved state. This vastly simplifies
5717 (SimpleName): Add CloneTo that does nothing.
5718 (EmptyCast): Add CloneTo.
5720 * expression.cs (Binary): Implement CloneTo.
5721 (Invocation.IsApplicable): Store the current ec in
5722 EmitContext.TempEc and restore it on return. This is used so we
5723 do not have to sprinkle hundres of methods with an extra
5724 EmitContext, we know that the only user is the lambda expression
5725 ImplicitConversionExists code.
5727 (Argument): Add Cloning capabilities.
5728 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
5729 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
5730 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
5731 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
5732 IndexerAccess): Add Clone capability.
5734 (LocalVariableReference, This): TODO: needs cloned Block mapping.
5736 (Argument): Add cloning capability.
5738 * assign.cs (Assign): Implement CloneTo.
5740 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
5742 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
5743 version by calling Convert with the EmitContext (that we are
5744 currently storing in ec, this is not great, but will do for now,
5745 to avoid passing EmitContext parameters to hundreds of functions
5746 that do not need them now).
5748 (SetExpression): Remove, it is not needed.
5750 (ContextualReturn): Implement CloneTo.
5752 * statement.cs (Statement): Implement cloning infrastructure,
5753 similar to expressions.
5755 (Block): Partial implementation of Clone for statements.
5757 (Return): Implement clone.
5759 * constant.cs (Constant.CloneTo): New method, does nothing.
5761 * codegen.cs (TempEc): Add a static EmitContext as a temporary
5762 solution, until we decide how to exactly do this.
5764 2007-02-14 Marek Safar <marek.safar@gmail.com>
5766 A fix for bug #80493
5767 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
5768 a property is override we need to use second accessor.
5770 2007-02-13 Marek Safar <marek.safar@gmail.com>
5772 A fix for bug #80418
5773 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
5776 2007-02-13 Marek Safar <marek.safar@gmail.com>
5778 Another fix for bug #80749
5779 * pending.cs: Abstract class has priority over interfaces.
5781 2007-02-13 Marek Safar <marek.safar@gmail.com>
5783 Another fix for bug #80749
5784 * pending.cs: Abstract class has priority over interfaces.
5786 2007-02-13 Marek Safar <marek.safar@gmail.com>
5788 Another fix for bug #80749
5789 * pending.cs: Abstract class has priority over interfaces.
5791 2007-02-13 Marek Safar <marek.safar@gmail.com>
5793 Another fix for bug #80749
5794 * pending.cs: Abstract class has priority over interfaces.
5796 2007-02-13 Marek Safar <marek.safar@gmail.com>
5798 * class.cs Better error message.
5800 * driver.cs: Add shorter versions of -optimize option.
5802 2007-02-13 Martin Baulig <martin@ximian.com>
5804 * class.cs (Constructor.Emit): Check the return value of
5805 ec.ResolveTopBlock() and return on error.
5807 2007-02-13 Raja R Harinath <rharinath@novell.com>
5809 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
5810 message to fix error message regression.
5812 2007-02-12 Marek Safar <marek.safar@gmail.com>
5814 * delegate.cs: Delegate creation expression cannot be of Nullable type.
5816 2007-02-12 Marek Safar <marek.safar@gmail.com>
5818 A fix for bug #80749
5819 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
5820 its parent container.
5822 * class.cs (DefineFieldInitializers): Each initializer can has different
5825 * const.cs: Updated.
5827 2007-02-11 Miguel de Icaza <miguel@novell.com>
5829 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
5830 now all the heavy lifting to check that embedded statements or
5831 expressions have the right form is done in the ContextualReturn.
5833 (ContextualReturn): New class.
5835 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
5836 method that can be invoked to report 201, so we do not replicate
5839 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
5841 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
5842 treating tabs as spaces.
5844 2007-02-09 Marek Safar <marek.safar@gmail.com>
5846 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
5847 * assign.cs: Use full implicit conversion for right side check.
5849 2007-02-09 Marek Safar <marek.safar@gmail.com>
5851 * statement.cs (Switch): Switch over boolean type is not standardized.
5853 2007-02-08 Marek Safar <marek.safar@gmail.com>
5855 A fix for bug #80755
5856 * decl.cs (FindBaseEvent): Don't use method cache for events.
5858 2007-02-07 Marek Safar <marek.safar@gmail.com>
5860 * cs-parser.jay: Better syntax error handling.
5862 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
5863 instead of underlying type value.
5865 2007-02-06 Marek Safar <marek.safar@gmail.com>
5867 * driver.cs: Check define identifier before is registered.
5869 * namespace.cs: Use existing error message.
5871 * report.cs: New warning.
5873 2007-02-06 Marek Safar <marek.safar@gmail.com>
5875 A fix for bug #80742
5876 * expression.cs: Delegate Invoke method can be called directly.
5878 2007-02-06 Marek Safar <marek.safar@gmail.com>
5880 A fix for bug #80676
5881 * class.cs (IsEntryPoint): The Main method can have params modifier.
5883 2007-02-04 Miguel de Icaza <miguel@novell.com>
5885 * parameter.cs (Parameter, Parameters): Add Clone method.
5887 * anonymous.cs (Compatible): Turn method into virtual method, so
5888 LambdaExpression can implement a different behavior.
5890 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
5891 out the basic checking here, so it can be used by
5894 * lambda.cs: Introduce "Compatible" function that will do the
5897 2007-02-02 Marek Safar <marek.safar@gmail.com>
5899 * attribute.cs: Unified one error message.
5901 * class.cs (Class): Use type attributes and not properties to test static
5903 (IsEntryPoint): Don's pass local variable.
5905 * convert.cs: Removed duplicate check.
5907 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
5909 * driver.cs: Don't crash when soft reference does not exist.
5911 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
5912 (UsingEntry): Removed redundant allocation.
5914 * parameter.cs: Add fast path for type parameters.
5916 * support.cs: Don't allocate attribute when it's not used.
5918 2007-01-30 Miguel de Icaza <miguel@novell.com>
5921 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
5922 this into a virtual method, so we can override it in LambdaExpression.
5924 * driver.cs: Improve diagnostics in case of failure.
5926 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
5927 write a function that is slightly more complex and that parses:
5929 type identifier [, type identifier]* )
5931 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
5934 (canEmpty ? i >= 0 : i > 0)
5936 2007-01-30 Raja R Harinath <rharinath@novell.com>
5938 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
5939 exception on possibly valid code.
5941 2007-01-29 Raja R Harinath <rharinath@novell.com>
5943 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
5945 (parse_opt_type_arguments): Remove. It's almost the same as
5947 (parse_namespace_or_typename): Use parse_less_than.
5949 2007-01-28 Miguel de Icaza <miguel@novell.com>
5951 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
5952 this bug took a few hours to find, because the state saved and
5953 restored by PushPosition and PopPosition was ignoring the state of
5954 parse_generic_less_than.
5956 I can also now remove the handling of OP_LT and OP_GT, this solves
5959 * cs-tokenizer.cs: store the location for the ARROW token, we use
5962 (PushPosition, PopPosition): save/restore also `current_token',
5963 restore `parse_generic_less_than' (was missing).
5965 (parse_opt_type_arguments): use parse_type, not
5966 parse_namespace_or_typename to parse types.
5968 * lambda.cs: Empty new file, will eventually have the lambda
5969 expression implementation.
5971 * lambda.test: used to test the internal tokenizer.
5973 * report.cs (FeatureIsNotISO1): Rename from
5974 FeatureIsNotStandardized, because it was about the language level
5975 (1 vs 2) it was not about standarization.
5977 (FeatureRequiresLINQ): New.
5979 * support.cs (SeekableStreamReader): Only require that the reader
5980 is a TextReader, not a StreamReader, so we can plug StringReader.
5982 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
5983 given position in the input stream the following tokens can be
5984 parsed as a type followed by an identifier.
5986 (is_punct): after a '(' if parse_type_and_parameter returns true,
5987 then return a special token OPEN_PARENS_LAMBDA which is used to
5988 avoid reduce/reduce errors in the grammar for the
5989 lambda_expression rules.
5991 (parse_type): implement a type parser inside the
5992 tokenizer, the parser only returns true or false depending on
5993 whether the input at a given position can be parsed as a type.
5995 (peek_token): new method used during type parsing.
5997 2007-01-28 Raja R Harinath <rharinath@novell.com>
6000 * anonymous.cs (ScopeInfo.InflateParameters): New.
6001 (AnonymousContainer.Resolve): Use it to redirect types of
6002 delegate parameters.
6004 2007-01-27 Raja R Harinath <rharinath@novell.com>
6007 * expression.cs (Error_InvalidArguments): Don't use two different
6008 messages for CS1503. Use ExtraInformation and
6009 SymbolRelatedToPreviousError instead.
6012 * decl.cs (DeclSpace.initialize_type_params): Don't access
6013 'type_params' of a partial class directly.
6015 2007-01-26 Miguel de Icaza <miguel@novell.com>
6017 * constant.cs: Removed a handful of out-of-range checks that were
6020 2007-01-25 Marek Safar <marek.safar@gmail.com>
6022 * expression.cs (CheckUselessComparison): Add additional check for char
6025 * namespace.cs: Fixed typo.
6027 2007-01-23 Miguel de Icaza <miguel@novell.com>
6029 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
6030 gone, instead we inline the test, preventing the needless casts to
6031 longs, ulongs and doubles for the parameters, avoiding calls to
6032 methods that overchecked stuff, and instead inlined things
6035 2007-01-20 Marek Safar <marek.safar@gmail.com>
6037 * cs-parser.jay: Better parameter error handling.
6039 2007-01-17 Marek Safar <marek.safar@gmail.com>
6041 A fix for bug #80368, #80522
6042 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
6043 whether array initializer contains constants only.
6044 (ArrayCreation.Emit): Use better formula to decide when
6045 are array initializers for static initialization.
6046 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
6047 have to emit even constants otherwise they are pre-initialized.
6049 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
6050 Raja R Harinath <rharinath@novell.com>
6052 Fix emit order of 'get' vs. 'set'.
6053 * support.cs (Accessors): New.
6054 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
6055 Note the order in which accessors are declared in the source.
6056 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
6057 Refactored from Property.Define and Indexer.Define.
6058 (PropertyBase.DefineAccessors): New helper that calls the above in
6059 appropriate order as noted by the parser.
6060 (Property.Define, Indexer.Define): Update to changes.
6061 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
6063 2007-01-17 Raja R Harinath <rharinath@novell.com>
6065 Fix cs0029-6.cs and gcs0029-2.cs (regression)
6066 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
6067 there's an implicit conversion from the current type to the target
6068 type before converting the underlying constant.
6070 2007-01-16 Marek Safar <marek.safar@gmail.com>
6072 * const.cs (ResolveValue): Updated after constant conversion was made more
6075 * constant.cs (GetAttributableValue): constant to object conversion is
6076 used for attributes only.
6077 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
6078 constant conversions.
6079 (LongConstant.ConvertImplicitly): Ditto.
6081 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
6082 (ImplicitConversionStandard): Handle constant conversion as extra step.
6083 It solves the issue when constant conversion was called indirectly like
6084 inside array initializer and constant folding was skipped.
6086 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
6089 * statement.cs(ImplicitConversionStandard): Updated after constant
6090 conversion was made more generic.
6092 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
6094 * expression.cs (As.DoResolve): Use GenericConstraints instead of
6095 Constraints, solves the problem where the compiler incorrectly
6096 reported that a type parameter was not constrained to a class (Bug
6099 2007-01-14 Marek Habersack <grendello@gmail.com>
6101 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
6103 2007-01-14 Marek Safar <marek.safar@gmail.com>
6105 A fix for bug #80368
6106 * assign.cs (FieldInitializer): New class implements field
6107 initializer statement.
6109 * attribute.cs: Update after FieldMember rename.
6111 * class.cs (PropertyBasedMember): New common class for property based
6113 (InterfaceMemberBase): New base class for all members which can be used as
6114 an interface members.
6115 (MethodCore): Moved really common code to InterfaceMemberBase.
6116 (Method.Define): Equal and GetHasCode detection is relevant for methods
6118 (MethodData.Define): Don't assume that public event implements an
6119 interface automatically.
6120 (MethodData.DefineMethodBuilder): Issue an error even if only extern
6122 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
6123 (FieldMember): Merged with FieldBase.
6124 (EventProperty.AEventPropertyAccessor): New specialization to check whether
6125 event extern modifier can be used.
6126 (EventField.EventFieldAccessor): Moved event field specific code here.
6127 (Event.AllowedModifiers): Even event can be extern.
6128 (Event.FindOutBaseMethod): New override specific to events.
6129 (Indexer.parameters): Reintroduce parameters because base class holds
6130 only properties common data.
6131 (Indexer.CheckForDuplications): Indexers are threated as methods so we
6132 need do extra parameters check.
6134 * const.cs: Update after FieldMember rename.
6136 * decl.cs (MemberCache.FindBaseEvent): New method.
6138 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
6139 to reflect that indexer is now derived from PropertyBased.
6141 * ecore.cs (GetMemberType): Made public.
6142 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
6145 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
6147 * typemanager.cs (CSharpSignature): Correctly print event accessors.
6148 (RegisterEvent): Removed.
6149 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
6150 (GetPrivateFieldOfEvent): Renamed to GetEventField.
6152 2007-01-11 Raja R Harinath <rharinath@novell.com>
6155 * statement.cs (CollectionForeach.TryType): Prefer generic
6156 GetEnumerator over non-generic variant. Fix code to follow comments.
6158 2007-01-09 Raja R Harinath <rharinath@novell.com>
6161 * support.cs (ReflectionParameter): Don't use an invalid index on
6162 the generic parameter data.
6164 2007-01-08 Miguel de Icaza <miguel@novell.com>
6166 * driver.cs: Just add a tiny bit of infrastructure.
6168 2007-01-02 Marek Safar <marek.safar@gmail.com>
6170 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
6171 where field type is struct from current assembly.
6173 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
6176 2007-01-02 Marek Safar <marek.safar@gmail.com>
6178 A fix for bug #80381
6179 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
6182 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
6184 (Namespace.LookupType): Always use core types from corlib when speficied.
6186 * report.cs: A new warning.
6188 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
6189 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
6190 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
6192 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
6193 (InitCoreTypes): Set expression type of object_type and value_type
6194 immediately after lookup.
6196 2007-01-01 Miguel de Icaza <miguel@novell.com>
6198 * cs-tokenizer.cs: Accept Pc class characters (Connector
6199 Punctuation) as valid identifiers. Fixes #78259
6201 * expression.cs (Invocation.DoResolve): Moved the check for the
6202 use of `this' for doing method calls to the Invocation resolution
6203 step, after overload resolution has taken place instead of doing
6204 the check at the low-level `This.DoResolve' level.
6206 The `This.DoResolve'(appens before overload resolution, so it has
6207 no way of knowing if the method that will be called will be
6208 instace or static, triggering an erroneous report for cs0188 (Bug
6211 We now do the check for instance method invocations after we know
6212 what method will be called.
6214 (This.CheckThisUsage): Move the actual use of this structure
6215 checking into its own method and expose it.
6217 * Everywhere that called Error_ValueCannotBeConverted: pass a new
6220 Exceptions: Null.ConvertImplicitly,
6221 Constant.ImplicitConversionRequired as there are too many call
6222 sites for passing the ec.
6224 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
6225 EmitContext, if the value is null, then we do not try to provide
6226 the extra information from the error (If a userdefined conversion
6227 exists, as UserDefinedConversion requires a non null-EmitContext).
6231 2006-12-30 Raja R Harinath <rharinath@novell.com>
6233 * flowanalysis.cs (MyBitVector): Document some invariants.
6234 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
6235 introduced below, and add a couple of others,
6237 2006-12-30 Marek Safar <marek.safar@gmail.com>
6239 * attribute.cs (GetMethodObsoleteAttribute): Uses new
6240 GetPropertyFromAccessor and GetEventFromAccessor.
6242 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
6243 overrides non-obsolete one.
6244 (Indexer.Define): Error message has been moved to the parser.
6246 * cs-parser.jay: Better syntax errors handling.
6248 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
6249 when an invocation has no arguments.
6251 * ecore.cs: Removed not used caching.
6253 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
6256 * report.cs: Add a new warning.
6258 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
6260 * typemanager.cs (enumeration_type): Removed.
6261 (CSharpSignature): Reuses IsSpecialMethod.
6262 (IsEqual): Hack for MS BCL.
6263 (GetPropertyFromAccessor): New method.
6264 (GetEventFromAccessor): New method.
6265 (IsSpecialMethod): Fixed to handle more cases.
6267 2006-12-30 Marek Safar <marek.safar@gmail.com>
6269 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
6270 Made white spaces array static.
6272 * ecore.cs (RemoveGenericArity): Optimized.
6274 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
6276 (MyBitVector.initialize_vector): Simplified.
6278 2006-12-22 Miguel de Icaza <miguel@novell.com>
6280 * ecore.cs: Am not entirely happy with this hack, but it seems to
6281 address the issue in 80257 (a small test case for
6284 I set the MethodGroupExpr.Type to an internal compiler type
6285 (itself in this case) to force the resolution to take place. Why
6286 it does not take place with a null is beyond me.
6288 2006-12-20 Marek Safar <marek.safar@gmail.com>
6290 A fix for bug #80288
6291 * expression.cs (ResolveOperator): Consider user defined conversion for
6292 logical and operator too.
6293 (EmitBranchable): Optimization for logical and when full constant folding
6294 could not be applied but one operand is constant.
6296 2006-12-19 Marek Safar <marek.safar@gmail.com>
6298 * class.cs (GetClassBases): Write 5 times every day, will never use
6299 FullName for error reporting.
6301 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
6303 2006-12-19 Martin Baulig <martin@ximian.com>
6305 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
6306 the symbol file info here.
6308 2006-12-18 Marek Safar <marek.safar@gmail.com>
6310 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
6311 of `elseif' is taking then following sections are not taking.
6312 Fixes an issue reported on mono mailing list.
6314 2006-12-18 Marek Safar <marek.safar@gmail.com>
6316 A fix for bug #80300
6317 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
6318 a caller is not taking.
6320 2006-12-18 Raja R Harinath <rharinath@novell.com>
6322 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
6323 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
6324 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
6325 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
6326 * class.cs: Update to changes.
6328 2006-12-17 Marek Safar <marek.safar@gmail.com>
6330 A fix for bug #79934
6331 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
6334 * class.cs (ResolveMembers): Register an iterator in current container and
6337 2006-12-16 Raja R Harinath <rharinath@novell.com>
6340 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
6341 satisfy a params annotated parameter.
6343 2006-12-16 Marek Safar <marek.safar@gmail.com>
6345 A fix for bug #77014
6346 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
6347 paramters correctly and not rely on hacks in Parameters class.
6348 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
6350 (Invocation.VerifyArgumentsCompat): Ditto.
6351 (Invocation.EmitArguments): Changed to correctly emit params arguments at
6354 * parameter.cs (HasParams): Don't assume that params is the last one.
6356 * support.cs (ReflectionParameters.ctor): Look for params attribute
6358 (ReflectionParameters.ParameterType): Removed hack when we returned last
6359 parameter for out of range parameters.
6360 (ParameterName, ParameterModifier): Ditto.
6362 2006-12-14 Marek Safar <marek.safar@gmail.com>
6364 A fix for bug #79987
6365 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
6366 when assembly is not CLS compliant but type is. I have no idea why is this
6369 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
6371 2006-12-13 Miguel de Icaza <miguel@novell.com>
6373 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
6374 in struct constructors, they are basically no-ops.
6376 2006-12-12 Marek Safar <marek.safar@gmail.com>
6378 * cs-tokenizer.cs (Position): Save preprocessor status too.
6380 2006-12-12 Marek Safar <marek.safar@gmail.com>
6382 A fix for bug #77794
6383 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
6385 2006-12-12 Marek Safar <marek.safar@gmail.com>
6387 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
6389 (pp_expr): Report error for an invalid expression.
6390 (handle_preprocessing_directive): Simplified; add more error checking.
6392 2006-12-11 Marek Safar <marek.safar@gmail.com>
6394 A fix for bug #74939
6395 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
6396 directives handling.
6398 2006-12-10 Marek Safar <marek.safar@gmail.com>
6400 A fix for bugs #80093, and #75984
6401 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
6402 logic, it seems to me as it worked before "by coincidence".
6403 (xtoken): Simplified to use reworked handle_preprocessing_directive.
6404 (cleanup): Enabled endif check.
6406 2006-12-09 Marek Safar <marek.safar@gmail.com>
6408 A fix for bug #80162
6409 * statement.cs (CollectionForeach.TryType): Generics and non-generics
6410 enumerators are never ambiguous.
6412 2006-12-08 Raja R Harinath <rharinath@novell.com>
6415 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
6417 2006-12-06 Marek Safar <marek.safar@gmail.com>
6419 A fix for bug #80144
6420 * class.cs (EventProperty.Define): Explicit implementation means
6421 that an even is used.
6423 2006-12-06 Marek Safar <marek.safar@gmail.com>
6425 Fixes the operators implementation (part II)
6427 * cfold.cs (DoConstantNumericPromotions): Renamed to
6428 DoBinaryNumericPromotions and simplified.
6429 (BinaryFold): Couple of conversion fixes; simplified.
6431 * constant.cs, ecore.cs, literal.cs
6432 (ToType): Renamed to ConvertImplicitly.
6433 (Reduce): Renamed to ConvertExplicitly.
6435 * class.cs, convert.cs: Updated.
6437 * expression.cs: TryReduce doesn't throw an exception.
6439 2006-12-01 Marek Safar <marek.safar@gmail.com>
6441 A fix for bug #80108
6442 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
6445 2006-11-30 Marek Safar <marek.safar@gmail.com>
6447 Fixes unary operators implementation (part I)
6450 * cfold.cs (Error_CompileTimeOverflow): Made internal
6452 * const.cs (IConstant): Changed to use reference to constant and
6453 not constant itself.
6454 Updated IConstant implementations.
6456 * constant.cs (CreateConstant): New factory method.
6457 Updated IConstant implementation.
6459 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
6461 * ecore.cs: Updated to use CreateConstantReference.
6463 * enum.cs: Reflects IConstant changes.
6465 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
6467 * literal.cs (NullConstant): Change to be independently usable.
6469 2006-11-29 Martin Baulig <martin@ximian.com>
6471 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
6472 we need to emit the scope initializer before calling the base .ctor.
6474 * anonymous.cs: Merged back from the new anonymous methods branch.
6475 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
6477 * expression.cs (ParameterReference.DoResolveBase): Create a
6478 "normal" ScopeInfo when capturing parameters rather than using the
6479 root scope; this makes things work with anonymous methods having
6483 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
6485 2006-11-22 Marek Safar <marek.safar@gmail.com>
6487 A fix for bug #79987
6488 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
6489 check to a base class.
6490 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
6491 only when assembly has missing attribute.
6492 * report.cs: Update.
6494 2006-11-21 Marek Safar <marek.safar@gmail.com>
6496 * cs-tokenizer.cs: Merged with gmcs version.
6498 2006-11-20 Marek Safar <marek.safar@gmail.com>
6501 * cs-parser.jay: Better error message when partial keyword is misplaced.
6503 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
6505 A fix for bug #79810
6506 report.cs: CS1058 only applies to 2.0 profile (gmcs).
6507 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
6508 a RuntimeWrappedException by default.
6510 2006-11-18 Marek Safar <marek.safar@gmail.com>
6512 A fix for bug #79843
6513 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
6515 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
6517 2006-11-18 Marek Safar <marek.safar@gmail.com>
6519 * driver.cs, namespace.cs: Uses faster IndexOf version.
6521 2006-11-17 Marek Safar <marek.safar@gmail.com>
6523 A fix for bug #79941
6524 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
6526 (Operator.Define): Implicit/Explicit operator of same type is duplicate
6527 even if internal name is different.
6528 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
6529 (UserDefinedConversion): Simplified as the operators cannot be internal.
6530 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
6532 (MethodLookup): Replaced EmitContext with parentType.
6533 * expression.cs: Updated.
6535 2006-11-09 Raja R Harinath <rharinath@novell.com>
6537 * driver.cs (BadAssembly): Handle all the ugliness of
6538 DefineDynamicAssembly.
6540 2006-11-08 Raja R Harinath <rharinath@novell.com>
6542 Address parts of #58244 -- most of what's left is in the runtime
6543 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
6544 CS1509 error checks, and handle them for all assembly loads, not
6545 just the first invocation.
6546 (LoadModule): Likewise. Move handling of 'adder_method' ...
6547 * codegen.cs (AssemblyClass.AddModule): ... here.
6549 2006-11-02 Marek Safar <marek.safar@gmail.com>
6551 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
6552 IEnumerable<T> is ambiguous.
6554 2006-10-31 Marek Safar <marek.safar@gmail.com>
6556 A fix for bug #67689
6557 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
6558 GetEnumerator is ambiguous.
6560 * report.cs: Add new warning.
6562 2006-10-29 Marek Safar <marek.safar@gmail.com>
6564 A fix for bug #78602
6565 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
6566 to protected member can be nested type.
6568 2006-10-28 Marek Safar <marek.safar@gmail.com>
6570 A fix for bug #78965
6571 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
6572 to protected member must derive from current type.
6574 2006-10-27 Marek Safar <marek.safar@gmail.com>
6576 assign.cs: Reuses error method.
6578 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
6579 instead of type for constants.
6580 (Expression.Error_ValueAssignment): Common error method.
6582 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
6585 2006-10-27 Marek Safar <marek.safar@gmail.com>
6587 A fix for bug #79081
6588 * expression.cs (MemberAccess.DoResolve): Check nested type
6591 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
6593 * doc.cs : nested delegates were not handled. Fixed bug #79754.
6595 2006-10-26 Marek Safar <marek.safar@gmail.com>
6597 A fix for bug #76591
6598 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
6600 2006-10-26 Marek Safar <marek.safar@gmail.com>
6602 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
6603 type forwarder of the same type multiple times.
6605 2006-10-26 Raja R Harinath <rharinath@novell.com>
6608 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
6609 instance as an rvalue, even when we later resolve as an lvalue.
6611 2006-10-25 Martin Baulig <martin@ximian.com>
6613 * anonymous.cs: Fix #79673.
6615 2006-10-24 Marek Safar <marek.safar@seznam.cz>
6617 A fix for bug #79666
6618 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
6619 ignored when is optimized (= default value) as its value is already set.
6621 2006-10-23 Marek Safar <marek.safar@seznam.cz>
6623 A fix for bug #79724
6624 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
6625 TypeContainer for type lookup.
6627 2006-10-23 Marek Safar <marek.safar@seznam.cz>
6629 A fix for bug #79231
6630 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
6631 * expression.cs (OverloadResolve): Always convert type name for
6633 (ResolveNamespaceOrType): Don't confuse a nested type with any
6636 2006-10-18 Martin Baulig <martin@ximian.com>
6638 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
6640 2006-10-17 Miguel de Icaza <miguel@novell.com>
6642 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
6643 an int32, but requesting an int64 from the conversion
6645 2006-10-12 Martin Baulig <martin@ximian.com>
6648 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
6650 2006-10-12 Martin Baulig <martin@ximian.com>
6653 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
6655 2006-10-11 Miguel de Icaza <miguel@novell.com>
6657 * convert.cs: Remove broken code: I was doing the "Existance"
6658 tests for Implicit conversions.
6660 2006-10-10 Miguel de Icaza <miguel@novell.com>
6662 * convert.cs: Added one missing case in
6663 ImplicitStandardConversionExists uint64 to intptr.
6667 * typemanager.cs (uintptr_type): another core known type.
6669 * ecore.cs (OperatorCast): routine used to do cast operations that
6670 depend on op_Explicit. We could change some of the Decimal
6671 conversions to use this.
6673 This one has a probe mechanism that checks both types for an op_
6674 which it coudl be used to eliminate two classes: CastToDecimal
6675 and CastFromDecimal.
6677 * convert.cs: Implement the conversions documented in #59800
6679 2006-10-10 Martin Baulig <martin@ximian.com>
6681 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
6682 before RootScope.ResolveMembers().
6684 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
6685 `CurrentType' if appropriate.
6687 2006-10-09 Marek Safar <marek.safar@seznam.cz>
6689 A fix for bug #78568
6690 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
6691 when contains binary operators.
6692 * cs-parser.jay: Updated.
6694 2006-10-09 Martin Baulig <martin@ximian.com>
6697 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
6698 moved that into Define() and also do the other type parameter
6699 checks there. Fixes #79094. Added gtest-292.cs.
6702 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
6703 since that doesn't include type parameters; don't use `Ldelema'
6704 for type parameters. Fixes #78980. Added gtest-293.cs.
6706 2006-10-08 Marek Safar <marek.safar@seznam.cz>
6709 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
6710 conversion is allowed.
6712 2006-10-06 Marek Safar <marek.safar@seznam.cz>
6714 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
6715 error reporting when no error occurs.
6717 2006-10-06 Marek Safar <marek.safar@seznam.cz>
6719 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
6722 2006-10-06 Raja R Harinath <rharinath@novell.com>
6725 * class.cs (DefineTypeBuilder): Check circular dependencies before
6726 setting the parent of the TypeBuilder.
6727 (CheckRecursiveDefinition): Don't use 'BaseType', since
6728 it may not be valid until after DefineTypeBuilder. Use
6729 'base_type' instead.
6731 2006-10-04 Martin Baulig <martin@ximian.com>
6733 Merged the Anonymous Methods patch.
6735 * anonymous.cs, iterators.cs: The new anonymous methods code.
6737 * statement.cs (Variable): New public abstract class.
6738 (LocalInfo.Variable): New public property.
6739 (LocalInfo.ResolveVariable): New public method.
6740 (Block.Flags): Add `IsIterator'.
6741 (Block.AddVariable): Improved the CS0136 check.
6742 (Block.AnonymousChildren): New public property.
6743 (Block.AddAnonymousChild): New public method.
6744 (ToplevelBlock): Update to use the new anonymous method framework.
6745 (ToplevelBlock.ctor): `container' is now a `Block' and not a
6746 `ToplevelBlock'; this is required to correctly implement the
6748 (Fixed, Using): Use `TemporaryVariable' instead of directly
6749 creating the `LocalBuilder'.
6751 * parameter.cs (Parameter.ResolveVariable): New public method.
6752 (Parameters.ResolveVariable): Likewise.
6754 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
6756 * class.cs (TypeContainer): Replaced the `iterators' list and
6757 corresponding methods with a list of `CompilerGeneratedClass'es.
6758 (TypeContainer.ResolveMembers): New public method.
6759 (Method): `IIteratorContainer' has been replaced by
6762 * expression.cs (VariableReference): New public abstract base
6763 class for `LocalVariableReference', `ParameterReference' and
6766 * codegen.cs (EmitContext): Removed `capture_context',
6767 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
6768 (EmitContext.EmitThis): Removed.
6770 * cs-parser.jay: Replace `iterator_container' with
6773 2006-10-04 Martin Baulig <martin@ximian.com>
6775 * generic.cs (GenericMethod): Don't make this abstract.
6776 (Constraints.Clone): Added dummy implementation.
6778 2006-10-04 Raja R Harinath <harinath@gmail.com>
6781 * namespace.cs (LookForAnyGenericType): Avoid nullref on
6782 'declspaces'. Avoid allocating arrays willy-nilly.
6785 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
6786 cases out of the switch.
6788 2006-09-28 Marek Safar <marek.safar@seznam.cz>
6790 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
6791 message when non-generic type is used with the type arguments.
6792 * expression.cs: Updated.
6794 2006-09-28 Raja R Harinath <rharinath@novell.com>
6797 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
6798 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6799 Change semantics slightly. Don't insist on having only one
6800 temporary EmptyExpression -- just throttle the creation of new ones.
6803 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
6804 non-interfaces too. If no methods are found, don't try to create
6807 2006-09-28 Marek Safar <marek.safar@seznam.cz>
6809 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
6812 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
6813 us produce better error message.
6815 2006-09-27 Marek Safar <marek.safar@seznam.cz>
6817 * expression.cs (Binary.ResolveOperator): Warn about a side effect
6818 of the `|' operator.
6820 * report.cs: A new warning added.
6822 2006-09-27 Martin Baulig <martin@ximian.com>
6824 * generic.cs (GenericMethod): Don't make this abstract.
6826 2006-09-27 Martin Baulig <martin@ximian.com>
6829 (InternalErrorException): Added overloaded ctor taking a params array.
6831 2006-09-26 Marek Safar <marek.safar@seznam.cz>
6833 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
6834 Fixed the cases when same error was reported twice.
6836 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
6837 now report symbol information.
6839 2006-09-25 Martin Baulig <martin@ximian.com>
6841 * class.cs: Completely unified with the gmcs version.
6843 2006-09-25 Martin Baulig <martin@ximian.com>
6845 * typemanager.cs (TypeManager.IsNullableType): New public function.
6846 (TypeManager.IsNullableTypeOf): Likewise.
6847 (TypeManager.IsNullableValueType): Likewise.
6849 * class.cs (MethodCore): Added the `GenericMethod' argument from
6850 gmcs and also unified all classes derived from `MethodCore' with gmcs.
6852 2006-09-24 Raja R Harinath <harinath@gmail.com>
6854 * convert.cs: Unify with gmcs version.
6856 2006-09-24 Marek Safar <marek.safar@seznam.cz>
6858 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
6859 verify them as well.
6861 * report.cs: New warning.
6863 2006-09-24 Marek Safar <marek.safar@seznam.cz>
6865 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
6866 for anonymous block with out argument.
6868 2006-09-24 Marek Safar <marek.safar@seznam.cz>
6870 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
6871 not used private events only.
6873 2006-09-23 Marek Safar <marek.safar@seznam.cz>
6875 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
6877 * const.cs (Const.Define): Check for constant type.
6878 (Const.IsConstantTypeValid): Looks for valid constant types.
6880 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
6882 * ecore.cs (EmptyConstantCast): New common class for all constant based
6885 * expression.cs (Is.DoResolve): Handle null constant especially.
6886 (New.DoResolve): Check for new void().
6887 (MemberAccess.DoResolve): Cope with all kind of nulls.
6889 * literal.cs (NullConstant): Uses EmptyConstantCast.
6890 (NullDefault): Based on EmptyConstantCast.
6891 (NullLiteral): Uses EmptyConstantCast.
6893 * statement.cs (Block.ResolveMeta): Check for constant type.
6895 2006-09-22 Martin Baulig <martin@ximian.com>
6897 * delegate.cs, attribute.cs: Merged with the gmcs versions.
6899 2006-09-22 Raja R Harinath <rharinath@novell.com>
6901 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
6905 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
6906 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
6909 2006-09-22 Martin Baulig <martin@ximian.com>
6911 * ecore.cs: Merged with the gmcs version.
6913 * generic.cs (ConstructedType): New dummy class.
6914 (TypeArguments): Don't make this abstract.
6917 (TypeManager.IsGenericTypeDefinition): New method.
6918 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
6920 2006-09-22 Raja R Harinath <rharinath@novell.com>
6922 * expression.cs (ComposedCast): Check for arrays of TypedReference
6923 before creating the type, not after.
6925 2006-09-21 Marek Safar <marek.safar@seznam.cz>
6927 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
6928 after ToType change.
6930 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
6931 when constant must be implicitly convertible.
6933 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
6935 * ecore.cs (NullCast): Derives from NullConstant.
6937 * expression.cs (Is.DoResolve): Removed useless variables.
6938 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
6939 (New.Constantify): Add enum support.
6940 (MemberAccess.DoResolve): Add warning when accessing null constant or
6943 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
6946 * literal.cs (NullConstant): New abstract class with common
6947 functionality for all null specializations.
6948 (NullDefault): Represents default(X) when result can be
6950 (NullLiteral): Updated.
6952 * report.cs: Add new warning.
6954 2006-09-21 Martin Baulig <martin@ximian.com>
6956 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
6958 2006-09-21 Martin Baulig <martin@ximian.com>
6960 * generic.cs (GenericConstraints): New dummy class.
6961 (Constraints): Likewise.
6962 (TypeParameter): Likewise.
6963 (TypeParameterName): Likewise.
6964 (GenericMethod): Likewise.
6966 * typemanager.cs (TypeManager.GetGenericArguments): New method.
6968 * decl.cs: Merged with the gmcs version.
6970 2006-09-21 Raja R Harinath <rharinath@novell.com>
6972 * generic.cs (TypeParameter): Implement IMemberContainer.
6973 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
6975 * rootcontext.cs: Unify with gmcs version.
6977 * report.cs: Unify with gmcs version.
6978 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
6979 from gmcs/generics.cs.
6980 * generics.cs (TypeParameter): New dummy class.
6982 * support.cs: Unify with gmcs version.
6984 2006-09-20 Raja R Harinath <rharinath@novell.com>
6986 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
6987 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
6989 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
6990 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
6991 * mcs.exe.sources: Add generic.cs.
6993 * codegen.cs: Unify with gmcs version.
6995 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
6996 (EmitContext): Add GenericDeclContainer implementation.
6997 * decl.cs (MemberCore, DeclSpace): Likewise.
6998 * namespace.cs: Remove #ifdef GMCS_SOURCE.
7000 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
7001 MCS TypeManager has a corresponding dummy method.
7003 2006-09-19 Martin Baulig <martin@ximian.com>
7005 * expression.cs: Completely merged with the gmcs version.
7007 2006-09-19 Martin Baulig <martin@ximian.com>
7009 * expression.cs (Invocation): Merged with the gmcs version.
7010 (ArrayAccess.GetStoreOpcode): Likewise.
7012 2006-09-19 Martin Baulig <martin@ximian.com>
7015 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
7016 (TypeManager.IsGenericMethodDefinition): Likewise.
7018 2006-09-19 Martin Baulig <martin@ximian.com>
7021 (TypeManager.IsEqual): Moved the gmcs implementation here.
7022 (TypeManager.DropGenericTypeArguments): Likewise.
7023 (TypeManager.DropGenericMethodArguments): Likewise.
7024 (TypeManager.GetTypeArguments): Moved here from gmcs.
7025 (TypeManager.HasGenericArguments): Likewise.
7027 2006-09-19 Martin Baulig <martin@ximian.com>
7029 * expression.cs (Binary): Merged with the gmcs version.
7031 2006-09-19 Martin Baulig <martin@ximian.com>
7033 * expression.cs (Probe, As, Is): Merged with the gmcs version.
7035 2006-09-19 Martin Baulig <martin@ximian.com>
7037 * typemanager.cs: Merged with the gmcs version.
7039 2006-09-16 Raja R Harinath <rharinath@novell.com>
7041 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
7042 * driver.cs: Likewise.
7044 2006-09-16 Marek Safar <marek.safar@seznam.cz>
7047 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
7048 only if parent type is class.
7049 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
7052 2006-09-15 Marek Safar <marek.safar@seznam.cz>
7055 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
7057 * typemanager.cs(CSharpName): Converts NullType to null.
7059 2006-09-15 Martin Baulig <martin@ximian.com>
7062 (TypeManager.GetMethodName): Added mcs implementation.
7063 (TypeManager.IsEqual): Likewise.
7066 (SimpleName.RemoveGenericArity): Added dummy implementation.
7068 * pending.cs: Merged with the gmcs version.
7070 2006-09-15 Martin Baulig <martin@ximian.com>
7072 * statement.cs: Merge with the gmcs version.
7074 2006-09-15 Martin Baulig <martin@ximian.com>
7076 * statement.cs (Switch): Merge with the gmcs implementation
7077 (without nullables), which is newer.
7079 2006-09-15 Martin Baulig <martin@ximian.com>
7081 * statement.cs (Block.Variables): Make this public.
7082 (ToplevelBlock.Parameters): Make this a property.
7083 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
7085 2006-09-15 Martin Baulig <martin@ximian.com>
7087 * namespace.cs: Merge with the gmcs version.
7089 2006-09-15 Martin Baulig <martin@ximian.com>
7091 * decl.cs (MemberName): Minor code cleanups.
7093 2006-09-15 Martin Baulig <martin@ximian.com>
7095 * parameter.cs: Merge with the gmcs version.
7097 2006-09-15 Martin Baulig <martin@ximian.com>
7099 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
7100 and an error in mcs.
7102 2006-09-15 Martin Baulig <martin@ximian.com>
7104 * flowanalysis.cs: Merged from GMCS; added the generics code into
7105 a `GMCS_SOURCE' conditional so we can share this file.
7107 2006-09-08 Martin Baulig <martin@ximian.com>
7109 * typemanager.cs (TypeManager.interlocked_type): New public field.
7110 (TypeManager.int_interlocked_compare-exchange): New public field.
7111 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
7112 enumerator types here and call InitGenericCoreTypes().
7113 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
7114 after calling InitEnumUnderlyingTypes().
7117 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
7118 `classes_second_stage'.
7120 2006-09-14 Marek Safar <marek.safar@seznam.cz>
7122 * assign.cs, ecore.cs, expression.cs: Share error message text.
7123 * class.cs (FieldMember.Define): Check for varible of static type.
7124 * driver.cs (LoadAssembly): Uses error output for errors.
7125 * statement.cs: Updated.
7127 2006-09-08 Marek Safar <marek.safar@seznam.cz>
7129 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
7132 2006-09-07 Martin Baulig <martin@ximian.com>
7135 (MainDriver): Revert r62663 from Marek; see #70506 for details.
7137 2006-08-29 Miguel de Icaza <miguel@novell.com>
7139 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
7141 2006-08-17 Miguel de Icaza <miguel@novell.com>
7143 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
7144 #52019 and #79064, the use of the \uXXXX sequence in source code
7145 to represent unicode characters.
7147 2006-08-15 Marek Safar <marek.safar@seznam.cz>
7149 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
7151 * class.cs, ecore.cs, statement.cs: Merged to one error message.
7153 2006-08-13 Miguel de Icaza <miguel@novell.com>
7155 * assign.cs: Catch attempts to assign to a method groups in += and
7158 2006-08-13 Marek Safar <marek.safar@seznam.cz>
7161 * cs-parser.jay: Don't destroy current array type by typeof of array's.
7163 2006-08-12 Marek Safar <marek.safar@seznam.cz>
7165 * class.cs (Method.Define): Issue a warning when generic method looks like
7167 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
7170 2006-08-09 Marek Safar <marek.safar@seznam.cz>
7172 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
7174 * decl.cs (MemberCache.FindMembers): When container is interface we need to
7175 search all base interfaces as a member can be ambiguous.
7176 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
7177 Constructor member type filter.
7178 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
7179 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
7180 reporting for returned memberinfos.
7181 * report.cs: Updated.
7182 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
7183 version to work on all runtimes.
7184 (TypeManager.RealMemberLookup): Removed members filtering.
7186 2006-08-08 Raja R Harinath <rharinath@novell.com>
7188 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
7189 (PropertyExpr.EmitAssign): Likewise.
7190 * expression.cs (Indirection.EmitAssign): Likewise.
7191 (LocalVariableReference.EmitAssign): Likewise.
7192 (ParameterReference.EmitAssign): Likewise.
7193 (Invocation.EmitArguments): Likewise.
7194 (ArrayAccess.EmitAssign): Likewise.
7195 (IndexerAccess.EmitAssign): Likewise.
7196 (This.EmitAssign): Likewise.
7197 (ConditionalLogicalOperator.Emit): Likewise.
7200 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
7201 instead of ArrayList. If the hashtable has a LocalBuilder, don't
7202 leave it in after returning it.
7203 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
7205 2006-08-06 Marek Safar <marek.safar@seznam.cz>
7207 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
7210 2006-08-03 Raja R Harinath <rharinath@novell.com>
7212 Fix cs0146-3.cs and cs0146-4.cs.
7213 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
7214 enclosing types don't depend on the current type.
7216 2006-08-02 Raja R Harinath <rharinath@novell.com>
7219 * class.cs (TypeContainer.DoDefineMembers): Use
7220 FindBaseMemberWithSameName on Parent, since we're interested in
7221 whether we hide inherited members or not.
7222 (FindBaseMemberWithSameName): Make slightly more robust.
7224 Fix the non-generic testcase from #77396
7225 * decl.cs (DeclSpace.DeclContainer): Remove override.
7227 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
7228 declspaces for doppelgangers too.
7229 (UsingEntry): Implement IResolveContext.
7230 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
7231 'this' as the resolve context.
7232 (LocalAliasEntry): Likewise.
7234 Implement parts of #77403
7235 * roottypes.cs (RootDeclSpace): New. Used to represent the
7236 toplevel declaration space. Each namespace declaration introduces
7237 a "partial" root declaretion space.
7238 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
7239 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
7240 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
7241 from 'current_namespace.SlaveDeclSpace'.
7242 (namespace_declaration): Likewise.
7243 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
7244 check. It can't happen now.
7245 * decl.cs (DeclSpace.LookupType): Likewise.
7246 * driver.cs (MainDriver): Sanity check.
7248 2006-08-01 Raja R Harinath <rharinath@novell.com>
7250 * decl.cs (DeclSpace.FindNestedType): Remove.
7251 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
7252 LookupTypeContainer to get the container of the nested type.
7253 * class.cs (TypeContainer.FindNestedType): Make non-override.
7255 2006-07-31 Raja R Harinath <rharinath@novell.com>
7257 * decl.cs (DeclSpace.PartialContainer): Move field from ...
7258 * class.cs (TypeContainer.PartialContainer): ... here.
7259 (TypeContainer.AddBasesForPart): New helper.
7260 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
7262 * cs-parser.jay (current_class): Convert to DeclSpace.
7263 (struct_declaration, interface_declaration, class_declaration):
7264 Use AddBasesForPart instead of .Bases directly.
7265 * const.cs, iterators.cs: Update to changes.
7267 2006-07-28 Raja R Harinath <rharinath@novell.com>
7269 * class.cs (TypeContainer.AddMemberType): Rename from
7271 (TypeContainer.AddMember): Rename from AddToMemberContainer.
7272 (AddTypeContainer): New. Combine AddClassOrStruct and
7274 (AddPartial): Update. Add 'is_partial' argument.
7275 * roottypes.cs: Update to changes.
7276 * cs-parser.jay (push_current_class): New helper for handling
7277 current_container and current_class.
7278 (struct_declaration, interface_declaration, class_declaration):
7281 2006-07-26 Raja R Harinath <rharinath@novell.com>
7283 * roottypes.cs: Rename from tree.cs.
7285 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
7286 * tree.cs (Tree, ITreeDump): Remove types.
7287 * rootcontext.cs (tree, Tree): Remove fields.
7288 (root, ToplevelTypes): New.
7289 * *.cs: Update to rename.
7291 * tree.cs (Tree.RecordDecl): Remove.
7292 (RootTypes.AddToTypeContainer): Record the toplevel type in its
7294 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
7296 2006-07-23 Raja R Harinath <harinath@gmail.com>
7298 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
7299 DoFlowAnalysis and OmitStructFlowAnalysis here.
7300 (ec.With): Rename from WithUnsafe and generalize.
7301 (ec.WithCheckState): Remove. All users can be handled by 'With'.
7302 (ec.WithFlowAnalyis): New.
7303 * ecore.cs, expression.cs, statement.cs: Update.
7305 2006-07-22 Raja R Harinath <harinath@gmail.com>
7307 * statement.cs (Block.ResolveMeta): Simplify slightly.
7309 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
7310 multiple boolean fields. Convert InUnsafe, constant_check_state,
7311 check_state to flags.
7312 (CheckState, ConstantCheckState): Update.
7313 (InUnsafe): New read-only property.
7314 (FlagsHandle): Rename from CheckStateHandle and convert to handle
7316 (WithUnsafe): New helper similar to WithCheckState.
7317 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
7318 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
7320 2006-07-21 Raja R Harinath <rharinath@novell.com>
7322 Make comparisons use the same IL irrespective of whether they're
7323 in a 'checked' or 'unchecked' context: one of the issues in #78899
7324 * codegen.cs (EmitContext.CheckState): Make read-only property.
7325 (EmitContext.ConstantCheckState): Likewise.
7326 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
7327 helper that implement a save/restore stack for CheckState
7328 values. This is the only way to change check-state.
7329 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
7330 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
7331 (CheckedExpr.EmitBranchable): New forwarding method.
7332 (UnCheckedExpr): Likewise.
7333 * statement.cs (Block.ResolveMeta): Use WithCheckState.
7334 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
7335 (Checked.Resolve, checked.DoEmit): Likewise.
7337 2006-07-20 Miguel de Icaza <miguel@novell.com>
7339 * anonymous.cs: Cache the resolved anonymous delegate, and return
7340 this so that the ResolveTopBlock is only triggered once, not
7343 Currently we trigger ResolvetopBlock twice due to a first pass of
7344 argument check compatibility, and a second pass that does the
7347 2006-07-15 Marek Safar <marek.safar@seznam.cz>
7349 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
7351 * rootcontext.cs (Reset): Add helper_classes.
7353 2006-07-15 Marek Safar <marek.safar@seznam.cz>
7356 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
7359 2006-07-13 Miguel de Icaza <miguel@novell.com>
7361 * statement.cs (Lock): Handle expressions of type
7362 TypeManager.null_type specially. Fixes #78770
7364 2006-07-08 Marek Safar <marek.safar@seznam.cz>
7366 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
7369 2006-07-08 Marek Safar <marek.safar@seznam.cz>
7371 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
7372 for accessors as well.
7373 * ecore.cs (EventExpr): Add AccessorTable.
7375 2006-07-01 Marek Safar <marek.safar@seznam.cz>
7378 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
7379 for CS0122 where appropriate.
7380 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
7382 (Filter): Assembly can be null in the case of top level attributes.
7384 2006-06-25 Marek Safar <marek.safar@seznam.cz>
7388 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
7389 is done at global level.
7391 2006-06-24 Marek Safar <marek.safar@seznam.cz>
7393 A fix for #77002, Implemented TypeForwarder support.
7395 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
7396 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
7397 * typemanager.cs (): Add type_forwarder_attr_type.
7399 2006-06-24 Marek Safar <marek.safar@seznam.cz>
7401 * report.cs: Add CS0469 warning.
7403 2006-06-21 Martin Baulig <martin@ximian.com>
7405 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
7406 the `try'-block, so we also report CS0016 etc. there.
7408 2006-06-21 Martin Baulig <martin@ximian.com>
7411 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
7413 2006-06-21 Martin Baulig <martin@ximian.com>
7415 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
7416 also report CS1686 for parameters.
7418 2006-06-21 Martin Baulig <martin@ximian.com>
7420 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
7421 instead of an error if the value is not implicitly convertible to
7422 the switch types; fixes #77964.
7424 2006-06-21 Raja R Harinath <rharinath@novell.com>
7427 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
7428 FieldBuilder is null.
7431 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
7432 'left' and 'right' before error-checking.
7434 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
7436 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
7438 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
7439 (FieldExpr.DoResolve): likewise.
7440 (PropertyExpr.InstanceResolve): likewise.
7441 (EventExpr.InstanceResolve): likewise.
7443 2006-06-04 Marek Safar <marek.safar@seznam.cz>
7445 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
7446 attribute applicable tests for attribute argument.
7448 2006-06-02 Raja R Harinath <rharinath@novell.com>
7451 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
7452 (Binary.OverloadResolve_PredefinedIntegral): New.
7453 (Binary.OverloadResolve_PredefinedFloating): New.
7454 (Binary.OverloadResolve_PredefinedString): New.
7455 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
7456 Follow the standard more closely, and treat numeric promotions in
7457 terms of overload resolution.
7458 (Binary.CheckShiftArguments): Simplify.
7460 2006-06-01 Raja R Harinath <rharinath@novell.com>
7462 * flowanalysis.cs (MyBitVector): Simplify representation.
7463 (MyBitVector.Clone): Avoid allocating BitArray.
7464 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
7465 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
7466 (*): Update. Change all references to MyBitVector.And and
7467 MyBitVector.Or to &= and |=.
7469 2006-05-29 Raja R Harinath <rharinath@novell.com>
7472 * cs-parser.jay (formal_parameter_list): Extend the pattern below
7473 to param arguments too.
7475 2006-05-26 Miguel de Icaza <miguel@novell.com>
7477 * cs-parser.jay: Catch another parsing form for arglist being
7478 followed by other arguments. Fixes #78313.
7480 2006-05-24 Raja R Harinath <rharinath@novell.com>
7482 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
7483 checking of out parameters to ...
7484 (FlowBranchingToplevel.Merge): ... here.
7485 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
7486 set, propagate the origin upward, and only complain if there was
7488 (FlowBranchingException.AddContinueOrigin): Likewise.
7489 (FlowBranchingException.AddReturnOrigin): Likewise.
7490 (FlowBranchingException.AddGotoOrigin): Likewise.
7492 2006-05-23 Raja R Harinath <rharinath@novell.com>
7494 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
7495 unreachable, skip it.
7496 (FlowBranchingException.Merge): Always propagate jumps, even if
7497 the finally block renders subsequent code unreachable.
7499 2006-05-18 Raja R Harinath <rharinath@novell.com>
7502 * statement.cs (Goto.Resolve): Move responsibility for resolving
7503 'goto' to FlowBranching.AddGotoOrigin.
7504 (Goto.SetResolvedTarget): New. Callback to set the
7505 LabeledStatement that's the target of the goto.
7506 (Goto.DoEmit): Use Leave instead of Br when crossing an
7507 unwind-protect boundary.
7508 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
7509 LookupLabel and adjust to new semantics.
7510 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
7511 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
7512 Goto.SetResolvedTarget to update target.
7513 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
7514 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
7515 AddBreakOrigin & co. Delay propagation until ...
7516 (FlowBranchingException.Merge): ... this.
7518 * statement.cs (Block.Resolve): Always depend on flow-branching to
7519 determine unreachability. Kill workaround that originally emitted
7520 only one statement after an "unreachable" label (see infloop in
7523 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
7524 This is still "wrong", but anything better would probably need a
7525 multi-pass algorithm.
7526 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
7527 usage vector. Force current usage vector to be reachable, to
7528 optimistically signify backward jumps.
7529 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
7531 (FlowBranchingLabeled.Merge): New. If no backward jump was
7532 detected, return the original salted-away usage vector instead,
7533 updated with appropriate changes. Print unreachable warning if
7535 * statement.cs (Block.Resolve): Don't print unreachable warning on
7536 a labeled statement.
7538 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
7540 * driver.cs: Pass filename without path to AssemblyBuilder's
7541 AddResourceFile. Fixes bug #78407.
7543 2006-05-17 Raja R Harinath <rharinath@novell.com>
7545 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
7546 * flowanalysis.cs (FlowBranchingLabeled): ... here.
7547 (FlowBranching.MergeChild): Overwrite
7548 reachability information from Labeled branchings too.
7550 2006-05-16 Raja R Harinath <rharinath@novell.com>
7552 * statement.cs (Goto.Resolve): Merge jump origins here ...
7553 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
7555 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
7556 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
7557 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
7558 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
7560 * statement.cs (Goto.Resolve): ... not here.
7561 (Goto.Emit): Remove CS1632 check.
7563 2006-05-14 Marek Safar <marek.safar@seznam.cz>
7565 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
7568 2006-05-11 Raja R Harinath <rharinath@novell.com>
7570 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
7571 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
7572 (FlowBranchingException.Label): Likewise.
7574 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
7576 (MyBitVector.Or): Use it to avoid losing information (Count).
7577 (FlowBranching.MergeOrigins): Likewise.
7579 * flowanalysis.cs (UsageVector.IsDirty): Remove.
7580 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
7581 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
7582 (UsageVector.ToString): Simplify.
7583 (UsageVector.MergeSiblings): Move here from ...
7584 (FlowBranching.Merge): ... here.
7585 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
7588 2006-05-10 Raja R Harinath <rharinath@novell.com>
7590 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
7591 null bitvector is treated as all-true.
7593 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
7594 (MyBitVector): Rationalize invariants. 'vector != null' implies
7595 that we have our own copy of the bitvector. Otherwise,
7596 'InheritsFrom == null' implies all inherited bits are true.
7598 2006-05-09 Marek Safar <marek.safar@seznam.cz>
7600 * statement.cs (LocalInfo): Add IsConstant.
7601 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
7602 local variable for constants.
7604 2006-05-09 Raja R Harinath <rharinath@novell.com>
7606 * flowanalysis.cs (MyBitVector.Empty): New.
7607 (MyBitVector): Don't allow InheritedFrom to be null.
7608 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
7609 (UsageVector, FlowBranching): Update to changes.
7611 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
7612 recursion. The 'Parent == null' condition isn't sufficient for
7614 (FlowBranching.AddBreakOrigin): Likewise.
7615 (FlowBranching.AddContinueOrigin): Likewise.
7616 (FlowBranching.AddReturnOrigin): Likewise.
7617 (FlowBranching.StealFinallyClauses): Likewise.
7618 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
7619 (FlowBranching.CheckOutParameters): Likewise.
7620 (FlowBranchingToplevel): Terminate all the above recursions here.
7621 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
7622 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
7624 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
7626 (FlowBranchingToplevel): New. Empty for now.
7627 (FlowBranching.MergeTopBlock): Update.
7628 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
7629 branching for the anonymous delegate.
7630 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
7632 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
7633 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
7634 information at the start of the merge. Reorganize.
7636 2006-05-07 Marek Safar <marek.safar@seznam.cz>
7638 * class.cs (MethodData.Define): Method cannot implement interface accessor.
7640 2006-05-07 Marek Safar <marek.safar@seznam.cz>
7642 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
7643 to newly introduced ctor.
7645 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
7646 message to one place.
7647 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
7650 2006-05-07 Marek Safar <marek.safar@seznam.cz>
7652 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
7654 * ecore.cs (Expression.ResolveAsConstant): Updated.
7656 * statement.cs (ResolveMeta): Updated.
7658 2006-05-06 Marek Safar <marek.safar@seznam.cz>
7660 * cs-parser.jay: __arglist cannot be used in initializer.
7662 2006-05-06 Marek Safar <marek.safar@seznam.cz>
7665 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
7668 2006-05-05 Raja R Harinath <rharinath@novell.com>
7670 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
7671 (LabeledStatement): Add 'name' parameter.
7672 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
7673 (Block.AddLabel): Update to changes.
7674 * cs-parser.jay (labeled_statement): Likewise.
7676 * flowanalysis.cs (BranchingType.Labeled): New.
7677 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
7678 (FlowBranchingLabeled): New. Does nothing for now, but will
7679 eventually handle 'goto' flows.
7680 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
7681 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
7682 that's terminated ...
7683 (Block.Resolve): ... here.
7685 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
7686 (UsageVector.MergeFinallyOrigins): Likewise.
7687 (FlowBranching.InTryOrCatch): Likewise.
7688 (FlowBranching.AddFinallyVector): Likewise.
7689 (FlowBranchingException): Update to changes.
7692 * statement.cs (Return.Resolve): Move error checking to ...
7693 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
7694 (FlowBranchingException): Handle return origins like break and
7696 (FlowBranching.UsageVector.CheckOutParameters): Remove.
7698 2006-05-04 Marek Safar <marek.safar@seznam.cz>
7701 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
7704 2006-05-04 Marek Safar <marek.safar@seznam.cz>
7707 * class.cs (MethodData.Define): Do public accessor check only when method
7708 implements an interface.
7710 2006-05-04 Raja R Harinath <rharinath@novell.com>
7712 Remove special handling of 'break'
7713 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
7714 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
7715 (UsageVector.Break): Remove.
7716 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
7718 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
7720 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
7721 UsageVector.Breaks (). Don't set NeedsReturnLabel.
7723 2006-05-03 Marek Safar <marek.safar@seznam.cz>
7726 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
7727 be the interface member.
7729 2006-05-03 Marek Safar <marek.safar@seznam.cz>
7732 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
7733 for emitting small (int) values.
7735 2006-05-03 Raja R Harinath <rharinath@novell.com>
7738 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
7739 control-flow passes through the 'finally' after merging-in all the
7740 control-flows from 'try' and the 'catch' clauses.
7742 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
7743 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
7744 always true at the only non-recursive entry point.
7745 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
7746 FlowBranchingBreakable.
7747 (FlowBranchingLoop): Remove.
7748 * statement.cs (Return.DoResolve): Update to changes.
7751 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
7752 (FlowBranching.CreateBranching): Handle it: create a
7753 FlowBranchingContinuable.
7754 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
7755 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
7756 except that it handles the 'continue' command.
7757 (FlowBranching.UsageVector.MergeOrigins): Rename from
7759 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
7760 except that it overrides AddContinueOrigin.
7761 (FlowBranchingException): Override AddContinueOrigin, similar to
7763 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
7764 Create a new branching around the embedded statement.
7765 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
7766 control flow after the embedded statement.
7767 (Continue.Resolve): Move all error checking to AddContinueOrigin.
7769 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
7770 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
7771 FlowBranchingBreakable.
7772 (FlowBranchingSwitch): Remove.
7775 * statement.cs (Break.Resolve): Simplify. Move responsibility for
7776 error reporting to ...
7777 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
7778 Rename from 'AddBreakVector'. Add new location argument. Return
7779 a bool indicating whether the 'break' crosses an unwind-protect.
7780 (FlowBranchingException.AddBreakOrigin): Add.
7781 (FlowBranchingException.Merge): Propagate 'break's to surrounding
7782 flowbranching after updating with the effects of the 'finally'
7784 (FlowBranchingBreakable): New common base class for
7785 FlowBranchingLoop and FlowBranchingSwitch.
7787 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
7789 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
7791 2006-05-02 Raja R Harinath <rharinath@novell.com>
7793 * statement.cs (Do.Resolve): If the loop is infinite, set the
7795 (While.Resolve, For.Resolve): Set a barrier after the embedded
7796 statement. There's no direct control flow that goes from the end
7797 of the embedded statement to the end of the loop.
7798 * flowanalysis.cs (FlowBranching.Infinite): Remove.
7799 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
7800 above ensure that the reachability is correctly computed.
7802 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
7803 (UsageVector.MergeBreakOrigins): If the current path is
7804 unreachable, treat it as if all parameters/locals are initialized.
7805 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
7806 infinite loops before merging-in break origins.
7808 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
7809 (Reachability.Reachable): Split part into ...
7810 (Reachability.Unreachable): ... this. Simplify.
7811 (Reachability.IsUnreachable): Use 'Unreachable' instead.
7813 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
7814 (Reachability.SetThrowsSometimes): Likewise.
7815 (FlowBranchingBlock.MergeTopBlock): Don't compare against
7816 TriState.Always, use corresponding property.
7817 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
7818 (Block.Resolve): Likewise. Remove some redundant checks.
7820 2006-05-02 Raja R Harinath <harinath@gmail.com>
7822 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
7823 (Reachability.Meet): Don't bother checking AlwaysThrows --
7824 barrier is always set.
7825 (FlowBranchingBlock.Merge): Likewise.
7827 2006-05-01 Raja R Harinath <harinath@gmail.com>
7829 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
7830 checks for unreachable.
7832 2006-05-01 Marek Safar <marek.safar@seznam.cz>
7835 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
7837 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
7838 whether field is really assigned.
7840 2006-04-30 Raja R Harinath <harinath@gmail.com>
7842 * flowanalysis.cs (Reachability): Make 4-argument constructor
7844 (Reachability.Meet): Rename from 'And'. Remove static variant.
7845 (Reachability.Always): Rename from the highly misleading
7846 'Reachability.Never'.
7847 (FlowBranching.Merge): Update to changes. Mark an impossible
7848 situation with a 'throw'.
7849 (*): Update to changes.
7851 2006-04-29 Raja R Harinath <harinath@gmail.com>
7853 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
7855 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
7856 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
7857 (*): Update to changes.
7858 * statement.cs: Update to changes.
7860 2006-04-28 Marek Safar <marek.safar@seznam.cz>
7863 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
7865 2006-04-28 Raja R Harinath <harinath@gmail.com>
7867 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
7870 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
7871 argument to two arguments: an usage-vector and a bool. Move call
7872 to FlowBranching.Merge () ...
7873 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
7875 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
7876 handling of loop and switch reachability to ...
7877 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
7879 2006-04-27 Raja R Harinath <harinath@gmail.com>
7881 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
7882 handling to FlowBranchingLoop.InLoop.
7883 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
7885 2006-04-26 Marek Safar <marek.safar@seznam.cz>
7888 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
7889 anonymous method is allowed from AnonymousContainer here.
7891 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
7893 2006-04-24 Raja R Harinath <rharinath@novell.com>
7896 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
7898 2006-04-23 Marek Safar <marek.safar@seznam.cz>
7901 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
7902 (DoubleConstant.Reduce): Ditto.
7904 2006-04-23 Raja R Harinath <rharinath@novell.com>
7906 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
7907 Remove 'lvalue_right_side' argument. Move parts to ...
7908 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
7909 (LocalVariable.DoResolveLValue): ... these.
7911 2006-04-21 Raja R Harinath <rharinath@novell.com>
7914 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
7915 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
7916 (LocalVariableReference.DoResolveBase): Use it to implement new
7918 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
7919 (Argument.Resolve): Simplify. Move CS1510 check ...
7920 * ecore.cs (Expression.ResolveLValue): ... here.
7921 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
7922 (PropertyExpr.DoResolveLValue): Likewise.
7923 (FieldExpr.Report_AssignToReadonly): Likewise.
7924 (FieldExpr.DoResolve): Add 'out_access' argument. Use
7925 LValueMemberAccess or LValueMemberOutAccess on instance depending
7927 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
7928 DoResolve as appropriate.
7930 2006-04-20 Raja R Harinath <rharinath@novell.com>
7933 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
7934 implicit conversions on 'out' and 'ref' arguments.
7936 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
7937 improve clarity. Remove dead code.
7940 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
7941 (Catch.Resolve): Resolve VarBlock if it exists.
7943 2006-04-19 Miguel de Icaza <miguel@novell.com>
7945 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
7946 twice, this was some residual code, the enumerator was emitted
7947 properly in the two branche of if later.
7949 2006-04-19 Raja R Harinath <rharinath@novell.com>
7951 * expression.cs (Cast.ResolveLValue): Remove. The result of a
7952 cast is never an lvalue.
7953 (Cast.DoResolve, Cast.ResolveRest): Combine.
7954 (Argument.Emit): Simplify slightly. Move 'Expr is
7955 IMemoryLocation' check ...
7956 (Argument.Resolve): ... here.
7957 (Argument.Error_LValueRequired): Remove. Inline into only user.
7959 Simplifications. Fix cs0191-2.cs
7960 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
7961 CS1649 and CS1651 to ...
7962 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
7963 the actual selection of the error code and message to a lookup
7964 table. Add a dummy return value to simplify callsites.
7965 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
7966 readonly fields of other instances of the same type. Move CS0197
7968 * expression.cs (Argument.Resolve): ... here. Simplify code.
7969 Ensure that ec.InRefOutArgumentResolving is only set during LValue
7970 resolution of an out or ref argument. The code simplification
7971 above uses this invariant.
7973 2006-04-18 Raja R Harinath <rharinath@novell.com>
7975 Possibly fix #77752. Fix cs1690-[4-7].cs.
7976 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
7977 CheckMarshallByRefAccess. Drop parameter.
7978 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
7980 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
7982 * report.cs (AllWarnings): Add CS1690.
7983 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
7985 (LocalVariableReference.DoResolveBase): Update.
7987 2006-04-09 Marek Safar <marek.safar@seznam.cz>
7989 * class.cs (MethodOrOperator): Moved common parts from method class.
7990 detect obsolete attributes.
7991 (Method.Define): Simplified as it reuses code from base.
7992 (Constructor.ValidAttributeTargets): Fixed issue found during
7994 (Destructor.ValidAttributeTargets): Fixed issue found during
7996 (Operator): Finished refactoring set off by #78020. Operator class is now
7997 ordinary method class.
7999 * anonymous.cs: Updated.
8001 * decl.cs (DeclSpace): Add IsGeneric
8003 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8005 * class.cs (Constructor.Emit): Don't emit the attributes twice.
8007 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8009 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
8010 detect obsolete attributes.
8011 (Method.CreateEmitContext): Moved to MethodOrOperator.
8013 2006-04-09 Marek Safar <marek.safar@seznam.cz>
8016 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
8017 customized exception to make crash detection easier.
8018 (MethodOrOperator): Started to work on new base class for methods and
8020 (Method): Derives from MethodOrOperator.
8021 (Constructor.Emit): Emits its own attributes.
8022 (AbstractPropertyEventMethod.Emit): Ditto.
8023 (Operator): Derives from MethodOrOperator, will refactor fully in extra
8025 (Operator.Emit): It's temporary more tricky than should be.
8027 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
8029 * report.cs (InternalErrorException): Add ctor with inner exception.
8031 2006-04-08 Marek Safar <marek.safar@seznam.cz>
8034 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
8037 2006-04-07 Marek Safar <marek.safar@seznam.cz>
8040 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
8043 2006-04-06 Marek Safar <marek.safar@seznam.cz>
8045 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
8046 attribute is present and Guid not.
8047 (Interface.ApplyAttributeBuilder): Ditto.
8049 * attribute.cs: Add error message.
8051 2006-04-06 Marek Safar <marek.safar@seznam.cz>
8055 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
8056 sources (it's composite) so hold them in extra array as they are used in
8057 Emit phase only. It worked in the previous versions by mistake.
8058 (Attribute.Emit): Emit attribute for more owners when exist.
8060 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
8061 it has now different behaviour.
8063 2006-04-04 Marek Safar <marek.safar@seznam.cz>
8065 * constant.cs (Constant.IsDefaultInitializer): New method.
8067 * class.cs: Updated.
8069 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
8070 re-initialize default values. It saves KBs almost for every assembly.
8071 Thanks Zoltan for the idea.
8072 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
8073 (ArrayCreation.DoResolve): Resolve only once.
8074 (ArrayCreation.Emit): Emit static initializer only when it is faster.
8075 (ArrayCreation.GetAttributableValue): Cope with optimized values.
8077 2006-04-03 Zoltan Varga <vargaz@gmail.com>
8079 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
8082 2006-04-01 Marek Safar <marek.safar@seznam.cz>
8084 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
8085 in an embedded statement too.
8087 2006-04-01 Raja R Harinath <rharinath@novell.com>
8090 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
8092 2006-04-01 Marek Safar <marek.safar@seznam.cz>
8096 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
8099 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
8101 2006-03-31 Marek Safar <marek.safar@seznam.cz>
8103 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
8106 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
8107 LocalTemporary change.
8109 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
8111 (ClassOrStruct.DefineFieldInitializers): Implemented static field
8112 initializers optimization.
8113 (ClassOrStruct.TypeAttr): Moved from modifiers.
8114 (Constructor.CheckBase): Don't crash when static ctor has parameters.
8115 (FieldBase.ResolveInitializer): Resolves initializer.
8116 (FieldBase.HasDefaultInitializer): New property.
8118 * cs-parser.jay: Removed message.
8120 * expression.cs (CompilerGeneratedThis): New specialization.
8122 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
8124 2006-03-28 Marek Safar <marek.safar@seznam.cz>
8126 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
8128 2006-03-27 Marek Safar <marek.safar@seznam.cz>
8130 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
8131 be now EnumConstants only.
8133 2006-03-27 Marek Safar <marek.safar@seznam.cz>
8135 * attribute.cs, driver.cs: Reset more caches.
8137 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8139 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
8141 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8143 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
8144 for easier reuse. Updated all overrides.
8145 (IntegralConstant): New base class for all integral constants.
8146 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
8147 of the constant range, report custom error.
8148 (UIntConstant.Reduce): Fixed uint conversion.
8150 * ecore.cs, literal.cs: Reduce updates.
8152 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8156 * class.cs (Constructor.Define): Removed extra if for default ctors.
8157 A patch from Atsushi Enomoto.
8159 2006-03-26 Marek Safar <marek.safar@seznam.cz>
8161 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
8162 GetAttributableValue.
8164 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
8167 * convert.cs (ImplicitConversionRequired): Error message moved to
8170 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
8171 automatic implicit conversion of an output value.
8172 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
8174 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
8176 (TypeOf.GetAttributableValue): Add extra handling for object type.
8178 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
8179 special error message.
8181 2006-03-25 Marek Safar <marek.safar@seznam.cz>
8183 * class.cs (Constructor.Emit): Don't crash when struct ctor is
8185 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
8186 compatible with MS runtime.
8188 2006-03-23 Marek Safar <marek.safar@seznam.cz>
8190 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
8191 attribute arguments here.
8193 * class.cs (Indexer.Define): The check was moved to attribute class.
8195 2006-03-22 Marek Safar <marek.safar@seznam.cz>
8197 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
8198 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
8201 2006-03-22 Raja R Harinath <rharinath@novell.com>
8203 Support ParameterDefaultValueAttribute in gmcs. Also applied to
8204 mcs to keep code differences small.
8205 * attribute.cs (Attribute.GetParameterDefaultValue): New.
8206 * typemanager.cs (parameter_default_value_attribute_type): New.
8207 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
8210 2006-03-21 Marek Safar <marek.safar@seznam.cz>
8212 * expression.cs (StringConcat.Append): Reverted back to no warning state.
8214 2006-03-21 Marek Safar <marek.safar@seznam.cz>
8216 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
8218 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
8221 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
8223 * doc-bootstrap.cs : fix build.
8225 2006-03-20 Marek Safar <marek.safar@seznam.cz>
8227 * expression.cs (StringConcat.Append): Issue a warning when empty string
8230 2006-03-20 Marek Safar <marek.safar@seznam.cz>
8232 * assign.cs (CompoundAssign.ResolveSource): Removed.
8234 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
8237 * class.cs (TypeContainer.FindMethods): Removed.
8238 (TypeContainer.CheckMemberUsage): Made static.
8240 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
8242 * constant.cs (CheckRange): Removed unused type argument.
8243 (CheckUnsigned): Removed unused type argument.
8245 * cs-parser.jay: Updated after MemberAccess clean up.
8246 Uses Length for empty string test.
8248 * cs-tokenizer.cs: Uses Length for empty string test.
8249 (IsCastToken): Made static.
8250 (is_hex): Made static.
8251 (real_type_suffix): Made static.
8253 * decl.cs (SetupCache): Made static.
8254 (OnGenerateDocComment): Removed unused ds argument.
8256 * delegate.cs (VerifyDelegate): Removed unused argument.
8258 * doc.cs: Uses Length for empty string test.
8260 * driver.cs: Uses Length for empty string test.
8262 * enum.cs (IsValidEnumType): Made static
8264 * expression.cs (EnumLiftUp): Removed unused argument.
8265 (ResolveMethodGroup): Ditto.
8266 (BetterConversion): Ditto.
8267 (GetVarargsTypes): Ditto.
8268 (UpdateIndices): Ditto.
8269 (ValidateInitializers): Ditto.
8270 (MemberAccess.ctor): Ditto.
8271 (GetIndexersForType): Ditto.
8273 * flowanalysis.cs: (MergeFinally): Removed unused argument.
8275 * iterators.cs: Updated after MemberAccess clean up.
8277 * location.cs: Uses Length for empty string test.
8279 * namespace.cs: Uses Length for empty string test.
8281 * report.cs (CheckWarningCode): Made static.
8283 * statement.cs (LabeledStatement): Removed unused argument.
8285 * typemanager.cs (FilterNone): Removed.
8287 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8289 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
8292 * class.cs: Updated.
8294 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8296 * cs-parser.jay.cs: __arglist is not allowed for delegates.
8298 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8302 * expression.cs (VerifyArgumentsCompat): Reverted to double error
8303 reporting, it's more tricky than I thought.
8305 2006-03-18 Marek Safar <marek.safar@seznam.cz>
8309 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
8311 (AnonymousMethod.ImplicitStandardConversionExists): New method.
8312 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
8313 Add more error reporting; Fixed issue with params.
8315 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
8317 * cs-parser.jay: AnonymousMethod requires host container.
8319 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
8321 2006-03-18 Raja R Harinath <harinath@gmail.com>
8323 * class.cs: Change 'TypeContainer ds' constructor argument to
8324 'DeclSpace parent'. Some classes were missed below due to
8325 different naming convention.
8327 * class.cs (MemberCore.Parent): Delete. This makes the
8328 ParentContainer changes below enforceable by the compiler.
8330 Treat pointers to enclosing declaration space as 'DeclSpace', not
8332 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
8333 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
8335 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
8337 (Block.AddThisVariable): Likewise.
8338 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
8339 (AbstractPropertyEventMethod.Emit): Likewise.
8340 (AbstractPropertyEventMethod.EmitMethod): Likewise.
8341 (GetMethod.Define, SetMethod.Define): Likewise.
8342 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
8343 (DelegateMethod.EmitMethod): Likewise.
8345 Fix regression test-partial-13.cs.
8346 Rationalize use of PartialContainer. Ensure that the partial
8347 class semantics can be tied to type-correctness, i.e., any
8348 violation will cause a compile error.
8349 * class.cs, const.cs: Access all fields that belong to class
8350 TypeContainer via ParentContainer. Arguments of EmitContexts and
8351 Resolve()-like functions still use 'Parent'.
8353 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
8354 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
8355 (PropertyMethod.CheckModifiers): Remove unused argument.
8356 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
8359 2006-03-17 Raja R Harinath <harinath@gmail.com>
8361 Make semantics of PartialContainer simpler.
8362 * decl.cs (DeclSpace.IsPartial): Remove.
8363 * class.cs (TypeContainer.IsPartial): Likewise.
8364 (TypeContainer..ctor): Set PartialContainer to point to self.
8365 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
8366 (TypeContainer.FindNestedType): Likewise.
8367 (MemberCore.ParentContainer): Simplify. Remove deprecation.
8369 2006-03-17 Marek Safar <marek.safar@seznam.cz>
8371 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
8373 2006-03-15 Marek Safar <marek.safar@seznam.cz>
8375 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
8378 2006-03-15 Marek Safar <marek.safar@seznam.cz>
8380 * class.cs (Operator.Define): An error for base conversion was not
8383 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
8385 * iterator.cs : yield break is allowed in try statement which has
8386 catch clauses. Fixed bug #77767.
8388 2006-03-13 Marek Safar <marek.safar@seznam.cz>
8390 A fix for #77593, #77574.
8392 * class.cs (MethodCore.CheckBase): Another if for operator.
8394 2006-03-09 Marek Safar <marek.safar@seznam.cz>
8396 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
8399 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
8400 (DelegateCreation.ImplicitStandardConversionExists): New method for just
8403 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
8406 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
8407 Updated after another emitcontext usage was clean up. It should help us to
8408 synchronize with gmcs easier.
8410 2006-03-04 Marek Safar <marek.safar@seznam.cz>
8414 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
8415 (Event.Define): ditto
8416 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
8418 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
8419 Removed redundant code and set NewSlot for Invoke method too.
8421 * parameter.cs (Parameters.ctor): Add custom, type ctor.
8422 (Parameters.MergeGenerated): New method. Use this method when you merge
8423 compiler generated argument with user arguments.
8425 2006-03-03 Marek Safar <marek.safar@seznam.cz>
8427 * attribute.cs (ResolveAsTypeTerminal): Removed.
8429 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
8430 specialization for predefined types; 30% speed up.
8431 Finally placed obsolete check to right place.
8432 (Expression.ResolveType): Removed.
8434 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
8435 Updated after ResolveType was removed.
8437 * expression.cs (Cast.ctor): Check void cast.
8438 (Binary.ResolveAsTypeTerminal): Is never type.
8439 (Conditional.ResolveAsTypeTerminal): Is never type.
8441 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
8443 2006-03-01 Raja R Harinath <rharinath@novell.com>
8446 * expression.cs (ParameterReference.DoResolveBase): Change return
8448 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
8452 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
8455 * typemanager.cs (GetFullNameSignature): Don't nullref on
8456 protected accessors.
8458 2006-02-27 Marek Safar <marek.safar@seznam.cz>
8460 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
8461 these two separated members to simplify the code.
8462 (Attribute.Resolve): Refactored to use new fields and methods.
8463 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
8464 implemented obsolete attribute checking.
8465 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
8466 implemented obsolete checking again. It look line never ending quest ;-)
8467 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
8469 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
8471 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
8473 *class.cs (Property.Define): Add RegisterProperty call.
8475 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
8476 argument groups (only 2).
8478 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
8479 encoding expression to arguments.
8480 (Expression.ExprClassToResolveFlags): Just turned to property.
8482 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
8483 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
8484 optimized as well as implemented support for zero-length attributes.
8486 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
8487 Add caching of PropertyInfo's.
8489 2006-02-25 Marek Safar <marek.safar@seznam.cz>
8491 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
8492 error multiple times.
8494 2006-02-25 Marek Safar <marek.safar@seznam.cz>
8496 New partial class implementation.
8497 A fix for #77027, #77029, #77403
8499 * attribute.cs (Attributable): Made attributes protected.
8501 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
8502 the replacements of ClassPart and PartialContainer.
8503 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
8504 (TypeContainer.AddInterface): Ditto.
8505 (TypeContainer.AddPartial): The main method for partial classes. It checks
8506 for errors and merges ModFlags and attributes. At the end class is added to
8508 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
8510 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
8511 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
8512 from the rest of partial classes.
8513 (TypeContainer.GetClassBases): Simplified.
8514 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
8516 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
8517 (TypeContainer.HasExplicitLayout): Uses Flags now.
8518 (PartialContainer): Removed.
8519 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
8520 (StaticClass): Was merged with Class.
8521 (Class.GetClassBases): class and static class bases are verified here.
8522 (Class.TypeAttr): Added static attributes when class is static.
8523 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
8524 (MemberBase): In some cases we need to call parent container for partial
8525 class. It should be eliminated but it's not easy now.
8527 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
8529 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
8530 partial classed to accumulate class comments.
8531 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
8533 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
8535 * driver.cs (MainDriver): Tree.GetDecl was removed.
8537 * modifiers.cs (Modifiers): Add partial modifier.
8539 * tree.cs (Tree.decl): Removed.
8540 (RootTypes): Started to use this class more often for root types
8543 2006-02-22 Marek Safar <marek.safar@seznam.cz>
8547 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
8548 external interface does not have an attribute.
8550 2006-02-22 Marek Safar <marek.safar@seznam.cz>
8552 Another prerequisites for new partial classs implementation.
8554 * attribute.cs (Attribute.Equal): Implemented.
8555 (Attribute.Emit): Changed as attributes can be applied more than twice.
8556 (Attributes.Emit): Check for duplicate attributes here.
8558 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
8559 as a parameter, clean-up.
8561 2006-02-11 Marek Safar <marek.safar@seznam.cz>
8565 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
8566 contains obsolete attribute check which can in some cases look for base
8567 type of current class which is not initialized yet.
8568 (TypeContainer.BaseType): Replacement of ptype.
8570 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
8572 2006-02-11 Marek Safar <marek.safar@seznam.cz>
8574 First of prerequisites for new partial classs implemention.
8576 * attribute.cs (Attributable): Extended by ResolveContext;
8577 Attributes finally have correct context for resolving in all cases.
8578 (AttachTo): Attribute owner is assigned here.
8580 * codegen.cs (IResolveContext): Introduce new interface to hold
8581 all information needed in resolving phase.
8582 (EmitContext): Implements IResolveContext; more clean-up needed here.
8584 * decl.cs (MemberCore): Implemented IResolveContext.
8586 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
8587 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
8588 parameter.cs, statement.cs, tree.cs, typemanager.cs:
8589 Refactored to use new IResolveContext instead of EmitContext; cleanup
8591 2006-02-06 Miguel de Icaza <miguel@novell.com>
8593 * codegen.cs (EmitScopeInitFromBlock): check here the
8594 capture_context, there is no need to make two calls to the
8597 * anonymous.cs: Add some debugging messages that might help me
8598 track other instances of this problem in the future (the
8599 regression of test 467).
8601 * cs-parser.jay: track the variable block, as we need to initalize
8602 any captured variables declared in this block for the "catch"
8603 portion of the "Try" statement.
8605 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
8606 scope initialization for captured variables.
8608 Also, move the emit for the variables after the block location has
8611 2006-02-06 Marek Safar <marek.safar@seznam.cz>
8613 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
8615 2006-02-02 Miguel de Icaza <miguel@novell.com>
8617 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
8618 commit yesterday, the initialization for the roots is necessary.
8619 What is not necessary is the scope activation.
8621 2006-02-02 Raja R Harinath <rharinath@novell.com>
8623 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
8624 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
8626 (Argument.Resolve): Remove CS0206 checks.
8628 2006-02-01 Miguel de Icaza <miguel@novell.com>
8630 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
8631 scopes for all the roots, the scopes will now be emitted when the
8632 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
8634 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
8635 code. This reduces a lot of existing cruft.
8637 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
8638 that the ScopeInfo is generated as we enter the scope, not at the
8639 time of use, which is what we used to do before.
8641 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
8642 every time a Block is about to be emitted if we have a
8645 2006-02-01 Raja R Harinath <rharinath@novell.com>
8647 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
8649 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
8651 * typemanager.cs (cons_param_array_attribute): Make private.
8652 (Reset): Set it to null.
8653 (InitCoreHelpers): Don't initialize it.
8654 (ConsParamArrayAttribute): New. Initialize it as needed.
8655 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
8657 2006-01-31 Miguel de Icaza <miguel@novell.com>
8659 * expression.cs: There might be errors reported during the
8660 selection of applicable methods. If there are errors, do not
8661 continue execution as it will lead the compiler to crash.
8663 2006-01-30 Miguel de Icaza <miguel@novell.com>
8665 * expression.cs: Member access is not allowed on anonymous
8666 methods. Fixes #77402.
8668 2006-01-30 Raja R Harinath <rharinath@novell.com>
8671 * cs-parser.jay (VariableDeclaration): Don't set
8672 current_array_type to null.
8673 (field_declaration, event_declaration, declaration_statement):
8674 Set it to null here.
8676 2006-01-28 Raja R Harinath <harinath@gmail.com>
8678 * typemanager.cs (GenericParameterPosition): New.
8681 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
8683 * doc.cs : To process "include" elements, first we should create
8684 another list than XmlNodeList, because it could result in node
8685 removal, which could result in that the XmlNodeList gives up
8688 (Also made code identical to gmcs again.)
8690 2006-01-25 Miguel de Icaza <miguel@novell.com>
8692 * ecore.cs: Introduce an error report that we were not catching
8693 before, if not silent, we must report the error. Gonzalo ran into
8696 2006-01-23 Miguel de Icaza <miguel@novell.com>
8698 A fix for bug: #76957
8700 * iterators.cs (MoveNextMethod.CreateMethodHost): call
8701 ComputeMethodHost before creating the method, this is a new
8704 * anonymous.cs (AnonymousContainer): Now we track all the scopes
8705 that this method references (RegisterScope). The actual scope
8706 where the method is hosted is computed with the ComputeMethodHost
8707 before we create the method.
8709 Moved the Deepest routine here.
8711 (AnonymousContainer.ComputeMethodHost): New routine used to
8712 compute the proper ScopeInfo that will host the anonymous method.
8714 (ScopeInfo): Deal with multiple roots. The problem was that we
8715 did not have a unique root where all ScopeInfos could be hanged
8716 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
8719 Remove AdjustMethodScope which is now computed at the end. Remove
8720 LinkScope which did a partial link, instead link all ScopeInfos
8721 before code generation from the new "LinkScopes" routine.
8723 Simplify all the Add* routines as they no longer need to maintain
8724 the tree, they just need to record that they are using variables
8727 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
8728 routines to produce the forest of ScopeInfo trees.
8730 * class.cs (TypeContainer.AppendMethod): This is just like
8731 AddMethod, but ensures that an interface implementation method
8732 (IEnumerable.XXX) is not inserted at the beginning of the queue of
8733 methods, but at the end.
8735 We use this functionality to ensure that the generated MoveNext
8736 method in the iterator class is resolved/emitted before the
8737 enumerator methods created.
8739 This is required because the MoveNext method computes the right
8740 ScopeInfo for the method. And the other methods will eventually
8741 need to resolve and fetch information computed from the anonymous
8744 2006-01-21 Raja R Harinath <harinath@gmail.com>
8745 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8748 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
8750 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
8751 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
8753 2006-01-18 Raja R Harinath <rharinath@novell.com>
8755 Fix #76656, cs0231-2.cs.
8756 * cs-parser.jay (formal_parameter_list): Make error case catch
8758 (parenthesized_expression_0): Add CS1026 check.
8759 (invocation_expression): Remove unused { $$ = lexer.Location }.
8761 2006-01-17 Raja R Harinath <rharinath@novell.com>
8764 * cs-parser.jay (statement_expression): Don't list out the
8765 individual statement-expressions. Convert syntax error into
8768 2006-01-16 Raja R Harinath <rharinath@novell.com>
8771 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
8772 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
8773 CheckIntermediateModification.
8774 (FieldExpr.DoResolve): Add new two-argument version that
8775 allows us to resolve the InstanceExpression as an lvalue.
8776 The one-argument variant is now just a wrapper.
8777 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
8778 Resolve the lhs as an lvalue if the it has a value type.
8779 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
8780 from Assign.DoResolve.
8781 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
8782 resolved as an lvalue.
8783 (PropertyExpr.DoResolve): Update.
8784 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
8785 has a value type. Move CS1612 check here from
8786 CheckIntermediateModification.
8787 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
8788 * expression.cs (EmptyExpression.OutAccess): New. Used as the
8789 'right_side' of a ResolveLValue on an 'out' argument.
8790 (EmptyExpression.LValueMemberAccess): New. Used as the
8791 'right_side' of a propagated ResolveLValue on a value type.
8792 (LocalVariableReference.DoResolveBase): Recognize
8793 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
8795 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
8796 EmptyExpression.Null.
8798 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
8800 * typemanager.cs : added IsGenericParameter(). In mcs it always
8802 * doc.cs : for generic parameters, use GenericParameterPosition,
8805 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
8807 * expression.cs: Fix Console.WriteLine ((this = x).foo);
8809 2006-01-12 Miguel de Icaza <miguel@novell.com>
8811 This fixes the problem where we used ldfld instead of ldflda to
8812 load the "THIS" pointer on captured parameters, when THIS is a
8813 value type. See bug #77205.
8815 * iterators.cs (CapturedThisReference.Emit): Pass false to
8816 EmitThis (we do not need the address).
8818 * codegen.cs (EmitThis): it needs to know whether we need the
8819 address of `this' or not. This is used by value types.
8821 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
8822 every other call passes false.
8824 2006-01-12 Raja R Harinath <rharinath@novell.com>
8827 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
8829 * expression.cs (Invocation.OverloadResolve): Update.
8830 (Invocation.DoResolve): Avoid double resolution of invocation.
8832 2006-01-11 Raja R Harinath <rharinath@novell.com>
8835 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
8836 unary negation of floating point types as 0-expr; negation cannot
8837 overflow in floating point types.
8840 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
8841 on operands of 'void' type.
8844 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
8845 and ExclusiveOr for boolean constants too.
8847 2006-01-09 Raja R Harinath <rharinath@novell.com>
8850 * expression.cs (Invocation.OverloadResolve): Replace reflected
8851 override methods with their base virtual methods, rather than
8853 * typemanager.cs (TypeManager.GetOverride): New.
8855 2006-01-05 Jb Evain <jbevain@gmail.com>
8857 * class.cs (Property.Define, Indexer.Define): do not tag the
8858 properties as SpecialName | RTSpecialName.
8860 2006-01-04 Miguel de Icaza <miguel@novell.com>
8862 * class.cs (MethodCore.IsDuplicateImplementation): This method was
8863 doing a low-level comparission of parameter types. It was lacking
8864 a check for __argslist.
8866 2005-12-30 Miguel de Icaza <miguel@novell.com>
8868 * expression.cs (ParameterReference.DoResolveBase): Allow
8869 reference parameters if they are local to this block.
8871 This allows the ref and out parameters of a delegate to be used in
8872 an anonymous method, for example:
8874 delegate void set (out int x);
8876 set s = delegate (out int x){
8880 This is used by functionality introduced late in the C# language.
8882 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
8883 method that take ref and out parameters.
8885 Fixes #77119 which was a late change in the spec.
8887 2005-12-23 Miguel de Icaza <miguel@novell.com>
8889 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
8890 parent if its the same scope. Fixes #77060.
8892 2005-12-21 Miguel de Icaza <miguel@novell.com>
8894 * driver.cs: Report the case of no source files and no -out:
8897 2005-12-20 Raja R Harinath <rharinath@novell.com>
8900 * expression.cs (ComposedCast.GetSignatureForError): Define.
8902 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8906 * namespace.cs (NamespaceEntry): Add extern_aliases as a
8907 ListDictionary, to contain the ExternAliasEntry entries (in
8908 addition to the NamespaceEntry.aliases hashtable). This field is
8909 shared between the original entry and its doppelganger (bodyless
8911 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
8912 extern_aliases field.
8913 (NamespaceEntry.Lookup): Move the IsImplicit check after the
8914 lookup in extern_aliases.
8916 2005-12-16 Raja R Harinath <rharinath@novell.com>
8919 * class.cs (TypeContainer.Mark_HasEquals): New.
8920 (TypeContainer.Mark_HasGetHashCode): New.
8921 (ClassPart): Override them.
8922 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
8925 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
8926 'parent' argument to the base constructor.
8928 Remove all mention of TypeContainer from decl.cs.
8929 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
8930 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
8931 (DeclSpace.DeclSpace): Likewise.
8932 (DeclSpace.DefineMembers): Remove unused argument.
8933 * cs-parser.jay (pop_current_class): Update to changes. Simplify
8934 debugging check -- we don't care if the debug code throws an
8935 InvalidCastException instead of an InternalErrorException.
8936 * class.cs (TypeContainer.DefineMembers): Update to changes.
8937 (TypeContainer.DoDefineMembers): Likewise.
8938 (TypeContainer.GetMethods): Likewise.
8939 (PropertyMember.Define): Likewise.
8940 (MemberBase.Parent): New property that forwards to
8941 MemberCore.Parent, but ensures that we get a TypeContainer.
8942 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
8943 (RootContext.PopulateTypes): Likewise. Remove special case code
8944 for !RootContext.StdLib: DefineMembers is idempotent.
8946 2005-12-14 Miguel de Icaza <miguel@novell.com>
8948 * convert.cs (ExplicitConversionCore): Check the return value from
8949 ExplicitConversionCore which can return null on failure. Fixes #76914
8951 2005-12-13 Marek Safar <marek.safar@seznam.cz>
8953 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
8955 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
8957 * doc.cs : The search for referenced namespace was insufficient to
8958 get global one as it used to do. Fixed bug #76965.
8960 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
8962 * doc.cs : check name in cref in the last phase that whether it is
8965 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
8967 * cs-tokenizer.cs : reverted the latest change: it somehow broke
8970 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
8972 * doc.cs : so it turned out that we cannot skip override check for
8973 interface members. Fixed bug #76954.
8975 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
8977 * cs-tokenizer.cs : fixed bug #75984:
8978 - #warning and #error should not be handled when the source line
8980 - #line is not checked strictly when the source line is disabled.
8981 - #define and #undef is on the other hand checked strictly at any
8984 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
8986 * cs-tokenizer.cs : missing Location (actually, filename) in one of
8989 2005-12-05 Marek Safar <marek.safar@seznam.cz>
8991 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
8993 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
8995 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
8996 (FieldBase.Initializer): Initializer is now optional.
8997 (EventField.Define): Only event field can have initializer.
8999 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
9001 * const.cs (Const): Reuse initializer.
9003 * cs-parser.jay: Updated after FieldBase changes.
9004 Added current_array_type to simplify array initializers.
9006 * ecore.cs (NullCast.IsDefaultValue): Implemented.
9008 * expression.cs, iterators.cs: Updated.
9010 * namespace.cs (NamespaceEntry): Made UsingFound private.
9012 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9014 * parameterCollection.cs: Obsolete, removed.
9015 * parser.cs: Obsolete, removed.
9017 2005-12-05 Marek Safar <marek.safar@seznam.cz>
9020 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
9022 * enum.cs (Enum.Define): Set obsolete context here.
9024 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
9027 - FindDocumentedMember() now expects 1) paramList as null
9028 when "we don't have to check the number of parameters" and
9029 2) Type.EmptyTypes when "there is no arguments".
9030 - Introduced FoundMember struct to hold the exact type which was
9031 used to find the documented member (the above change broke
9032 test-xml-044; it might be better just to use DeclaringType than
9033 what MS does, like this change does, but it depends on usage.)
9035 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
9037 * doc.cs : documented member might be from DeclaringType for nested
9038 types. Fixed bug #76782.
9040 2005-12-03 Ben Maurer <bmaurer@ximian.com>
9042 * anonymous.cs: Have the param code handle leaving copies on the
9043 stack etc. Allows anonymous params to take part in the assignment
9044 code (++, +=, etc). Fixes bug #76550
9046 * expression.cs: Handle the prepare_for_load/leave_copy by passing
9047 it down to the anon code.
9049 * iterators.cs: Use dummy var here
9051 * codegen.cs: Handle new vars
9053 2005-12-01 Marek Safar <marek.safar@seznam.cz>
9056 * class.cs (MethodData.Define): Set proper Obsolete context.
9058 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
9060 (FieldExpr.DoResolve): Ditto.
9062 2005-12-01 Marek Safar <marek.safar@seznam.cz>
9065 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
9066 parent is not obsolete.
9068 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
9070 * doc.cs : (FindDocumentedMember) find parameterless members first
9071 and get CS0419 in the early stage. Fixed first case of bug #76727.
9073 2005-11-30 Marek Safar <marek.safar@seznam.cz>
9076 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
9077 no error was reported.
9079 *expression.cs (Binary.DoResolve): left can be null.
9081 2005-11-22 Marek Safar <marek.safar@seznam.cz>
9084 * class.cs (MethodData.Emit): Parameters should be labeled first.
9086 2005-11-21 Marek Safar <marek.safar@seznam.cz>
9089 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
9091 2005-11-18 Marek Safar <marek.safar@seznam.cz>
9093 * attribute.cs (AreParametersCompliant): Moved to Parameter.
9095 * class.cs (MethodCore): Parameter clean up.
9096 (IMethodData): Added ParameterInfo.
9097 (MethodData): Parameter clean up.
9098 (Indexer.Define): Parameter clean up.
9110 * typemanager.cs: Parameter clean up.
9112 * delegate.cs (Define): Get rid of duplicated code.
9114 * expression.cs (ParameterReference): Removed useless parameters
9116 (Invocation): Ditto.
9118 * parameter.cs (ParamsParameter): New class, params specialization.
9119 (ArglistParameter): Attemp to separate arglist.
9120 (Parameter): Refactored to be reusable and faster.
9121 (Parameter.Modifier): Made understandable.
9122 (Parameters): Changed to be used as a class for `this' assembly
9123 parameters. Refactored to use new specialized classes.
9125 * support.cs (ParameterData): Added Types property.
9126 (InternalParameters): Deleted.
9128 2005-08-20 Martin Baulig <martin@ximian.com>
9130 Merging this patch from GMCS to fix #75867.
9132 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9133 scope if we don't already have it.
9135 2005-11-17 Martin Baulig <martin@ximian.com>
9138 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
9139 inherit the scope from our parent. Fixes #76653.
9141 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9143 * doc.cs : the previous patch does not actually fix the bug.
9144 PropertyInfo override check is now implemented and really fixed it.
9145 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
9147 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9149 * doc.cs : apply "override filter" also to properties.
9152 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
9154 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
9155 no need to check overrides. For classes, omit those results from
9156 interfaces since they must exist in the class. Fixed bug #76726.
9158 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9160 * typemanager.cs : (GetFullNameSignature) differentiate indexers
9161 with different parameters. Fixed the second problem in #76685.
9163 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9165 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
9166 get expected 'protected' access in CheckValidFamilyAccess()).
9169 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
9171 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
9172 Fixed bug #76705. CS1569 was incorrectly commented out.
9174 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
9176 * doc.cs : use Invocation.IsOverride() to do real override check.
9177 * expression.cs : made Invocation.IsOverride() internal.
9179 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
9181 * doc.cs : use TypeManager.FindMembers() instead of (possible)
9182 TypeBuilder.FindMembers() and filter overriden base members out.
9185 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9187 * doc.cs : ref/out parameters are represented as '@' (instead of
9188 '&' in type FullName). Fixed bug #76630 (additionally crefs).
9190 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9192 * doc.cs : when there was no '.' in cref to methods in doc comment,
9193 then parameters were missing in the output. Fixed bug #76691.
9195 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9197 * driver.cs : don't output docs when there is an error.
9200 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9203 Now it should detect indexers. Fixed primary concern in bug #76685.
9204 Fixed CS0419 message to not show the identical member signature in
9207 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
9209 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
9210 instead of Type.FindMembers() since it does not handle events.
9213 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
9215 * codegen.cs: Fixed typo (speficied -> specified).
9217 2005-11-11 Marek Safar <marek.safar@seznam.cz>
9220 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
9222 2005-11-11 Marek Safar <marek.safar@seznam.cz>
9224 * attribute.cs: Changed error message.
9226 * cs-tokenizer.cs: One more check.
9228 2005-11-10 Marek Safar <marek.safar@seznam.cz>
9230 * statement.cs (Block.Resolve): Ignore empty statement.
9232 2005-11-10 Marek Safar <marek.safar@seznam.cz>
9234 * report.cs: Made error/warning methods more strict to avoid
9237 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
9238 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
9239 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
9240 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
9242 2005-11-08 Marek Safar <marek.safar@seznam.cz>
9244 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
9245 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
9247 * class.cs (TypeContainer.IsComImport): New property.
9248 (Constructor.Define): Create proper ctor for ComImport types.
9250 * expression.cs (New.CheckComImport): Fixed.
9252 2005-11-07 Miguel de Icaza <miguel@novell.com>
9254 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
9255 that a parameter has been captured does not mean that we do not
9256 have to do the rest of the processing. This fixes the second part
9257 of #76592. If there was another anonymous method capturing
9258 values in the past, the Scope would never be set for the second
9259 method that captured the same parameter.
9261 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
9262 properly manipulate the stack. Second part of fix for #76592.
9264 * expression.cs (New): Add support for invoking "new" on
9265 interfaces that have been flagged with the ComImport attribute and
9266 the CoClass. Fixes #76637
9268 * statement.cs (Try.DoEmit): When a variable is captured, do not
9269 try to emit the vi.LocalBuilder variable as it has been captured.
9270 Create a temporary variable and store the results on the
9271 FieldBuilder. Fixes #76642
9273 2005-11-07 Marek Safar <marek.safar@seznam.cz>
9275 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
9277 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
9279 * expression.cs (Binary.DoResolve): Added && optimalization.
9281 * typemanager.cs (AddUserType): Removed useless argument.
9283 2005-11-04 Marek Safar <marek.safar@seznam.cz>
9285 * statement.cs (Block.variables): Uses ListDictionary.
9287 2005-11-03 Marek Safar <marek.safar@seznam.cz>
9290 * class.cs (PartialContainer.EmitType): Customized to emit
9291 security attributes.
9292 (ClassPart.ApplyAttributeBuilder): Transform security attribute
9293 for partial classes.
9295 2005-11-03 Marek Safar <marek.safar@seznam.cz>
9298 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
9299 access has to be fixed.
9301 * typemanager.cs (IsUnmanagedType): Wrong common field type.
9303 2005-11-01 Marek Safar <marek.safar@seznam.cz>
9306 * ecore.cs (NullCast.Reduce): Implemented.
9308 * expression.cs (ArrayCreation.CheckIndices): Correcly check
9311 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
9313 (Foreach.Resolve): Catch null properly.
9315 2005-10-29 Marek Safar <marek.safar@seznam.cz>
9317 * cs-tokenizer.cs: Warning text fix.
9319 * driver.cs: AllWarningNumbers exposed on public interface.
9321 * report.cs (): Reviewed warning numbers.
9322 (IsValidWarning): Use binary search.
9324 2005-10-29 Marek Safar <marek.safar@seznam.cz>
9326 * driver.cs: Implemeted resource visibility.
9327 (Resources): New class for code sharing between /res: and
9330 2005-10-28 Marek Safar <marek.safar@seznam.cz>
9333 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
9336 * convert (Convert.ImplicitReferenceConversion): NullCast holds
9339 * ecore.cs (NullCast): Child is contant only.
9341 * literal.cs (NullLiteral.Reduce): null can be converted to any
9344 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
9346 * driver.cs: Use Encoding.Default as default code page instead
9349 2005-10-27 Raja R Harinath <rharinath@novell.com>
9352 * expression.cs (Invocation.Error_InvalidArguments): Handle
9353 __arglist parameters.
9354 (Invocation.VerifyArgumentsCompat): Likewise.
9355 * support.cs (ReflectionParameters.GetSignatureForError): Print
9356 __arglist parameters.
9357 (InternalParamters.GetSignatureForError): Likewise.
9358 * parameter.cs (Parameters.GetSignatureForError): Likewise.
9360 2005-10-26 Marek Safar <marek.safar@seznam.cz>
9362 * attribute.cs (GetPropertyValue): Made public.
9364 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
9366 Add new property WrapNonExceptionThrows to handle 2.0 assembly
9368 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
9371 * driver.cs: Reflect method name change.
9373 * statement.cs (Try.Resolve): Warn when try has both general
9376 * typemanager.cs: runtime_compatibility_attr_type new predefined
9379 2005-10-26 Raja R Harinath <harinath@gmail.com>
9382 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
9383 treat it as an empty parameter list.
9385 2005-10-26 Raja R Harinath <rharinath@novell.com>
9388 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
9389 ResolveAsTypeStep silent.
9390 * statement.cs (Block.AddConstant): Mark block as used.
9391 (Block.ResolveMeta): Avoid piling on error messages
9392 if a constant initializer resolution fails.
9394 2005-10-25 Raja R Harinath <rharinath@novell.com>
9396 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
9398 (NamespaceEntry.VerifyAllUsing): New.
9399 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
9400 behaviour. Delegates actual resolution of alias to ...
9401 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
9402 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
9404 * driver.cs (Driver.MainDriver): Update.
9406 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
9407 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
9409 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
9411 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
9412 RootNamespace.DefineNamespacesForAll.
9414 2005-10-24 Raja R Harinath <harinath@gmail.com>
9416 * typemanager.cs (assemblies, external_aliases, modules)
9417 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
9418 (ComputeNamespaces, GetRootNamespace): Remove extra staging
9419 overhead. Move resposibility ...
9420 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
9421 * driver.cs, attribute.cs, codegen.cs: Update to changes.
9423 2005-10-23 Raja R Harinath <harinath@gmail.com>
9425 * namespace.cs (RootNamespace.all_namespaces): Renamed from
9426 cached_namespaces. Improve usage.
9427 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
9428 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
9429 Move from GlobalRootNamespace and simplify.
9430 (RootNamespace.Global): Make instance variable.
9431 (RootNamespace.RootNamespace): Add "alias name" parameter.
9432 (GlobalRootNamespace): Simplify drastically.
9433 (Namespace.Lookup): Don't use GetNamespace.
9434 * typemanager.cs (GetRootNamespace): Rename from
9435 ComputeNamespaceForAlias.
9436 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
9438 2005-10-23 Marek Safar <marek.safar@seznam.cz>
9440 * anonymous.cs (AnonymousContainer): Don't crash when container
9443 2005-10-23 Marek Safar <marek.safar@seznam.cz>
9445 * expression.cs (Binary.DoResolve): Warn when comparing same
9448 2005-10-23 Marek Safar <marek.safar@seznam.cz>
9451 * expression.cs (Binary.DoResolve): It looks like there are no
9452 convetsion rules in enum context.
9454 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9456 Add support for extern alias qualifiers.
9457 * typemanager.cs: Move some LookupTypeReflection code
9458 to namespace.cs, to have cleaner code. Added some methods
9459 to help us keep track of the extern aliased references.
9460 * driver.cs: Add suport for extern alias assemblies on command
9461 line and check for their warnings/errors. Also keep track of the
9462 extern aliased assemblies.
9463 * namespace.cs: Move the global functionality of Namespace
9464 to GlobalRootNamespace/RootNamespace. Now the global namespace
9465 is GlobalRootNamespace.Globa. Also the code moved from
9466 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
9467 Finally added LocalAliasEntry (AliasEntry before) and
9468 ExternAliasEntry, to handle alias statements.
9469 * cs-parser.jay: Add support in the grammar for extern alias
9471 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
9472 Update callings to Namespace (now in GlobalRootNamespace).
9474 2005-10-18 Raja R Harinath <rharinath@novell.com>
9477 * class.cs (TypeContainer.DefineType): Move updating of
9478 topological sort earlier in the code.
9479 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
9481 2005-10-18 Marek Safar <marek.safar@seznam.cz>
9484 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
9486 * constant.cs (Constant.TryReduce): Moved from Cast class.
9487 (Reduce): Made little bit more OO and fixed missing conversions.
9489 * ecore.cs (Reduce): Implemented.
9490 (Binary.EnumLiftUp): New method to upgrade values to enum values.
9492 * literal.cs (Reduce): Implemented.
9494 * class.cs: Reverted Miguel's wrong commit.
9496 2005-10-14 Miguel de Icaza <miguel@novell.com>
9498 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
9500 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
9502 * cs-parser.jay, expression.cs : CS0214 was missing error location
9503 for constants. Fixed bug #76404.
9505 2005-10-11 Marek Safar <marek.safar@seznam.cz>
9508 * convert.cs (ExplicitConversionCore): Fixed object->enum
9511 2005-10-10 Raja R Harinath <rharinath@novell.com>
9513 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
9515 (PropertyExpr.EmitCall): Likewise.
9516 * expression.cs (Invocation.EmitArguments): Handle case where
9518 (Invocation.EmitCall): Avoid allocating temporary variable if
9519 there are no arguments.
9521 2005-10-07 Raja R Harinath <rharinath@novell.com>
9524 * convert.cs (ImplicitConversionStandard): Move conversion of
9525 void* to arbitrary pointer types ...
9526 (ExplicitConversionStandard): .. here.
9527 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
9528 error to always print typenames.
9530 2005-10-07 Raja R Harinath <rharinath@novell.com>
9532 * convert.cs (GetConversionOperator): Rename from
9533 GetConversionOperators. Move operator selection code from ...
9534 (UserDefinedConversion): ... here.
9536 2005-10-06 Marek Safar <marek.safar@seznam.cz>
9538 * convert.cs (ExplicitConversionCore): Removed duplicate enum
9541 2005-10-05 Marek Safar <marek.safar@seznam.cz>
9543 * assign.cs (Assign.DoResolve): Error method changed.
9545 * cfold.cs (DoConstantNumericPromotions): Error method changed.
9547 * const.cs (ResolveValue): Reset in_transit immediately.
9549 * constant.cs: Error method changed.
9551 * convert.cs: Removed useless location parameter.
9552 (ExplicitNumericConversion): Don't do double enum check.
9553 (ExplicitConversionCore): Renamed from ExplicitConversion.
9554 (ExplicitUnsafe): Extracted from ExplicitConversion.
9555 (ExplicitConversion): Uses for error reporting.
9557 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
9559 (ResolveBoolean): Uses common error method.
9560 (CastToDecimal): Get rid of ec.
9561 (CastFromDecimal): Optimized.
9562 (ConvCast): Get rid of ec.
9564 * enum.cs (ResolveValue): Reset in_transit immediately.
9565 (Emit): Return after first error.
9567 * expression.cs: Convert changes.
9569 * literal.cs: Error method changed.
9571 * statement.cs: Error method changed.
9573 2005-10-03 Raja R Harinath <rharinath@novell.com>
9575 * support.cs (SeekableStreamReader.Position): Don't error out when
9576 the requested position is just beyond the end of the current
9579 2005-09-28 Raja R Harinath <rharinath@novell.com>
9581 * support.cs (SeekableStreamReader): Simplify drastically. Don't
9582 try to keep in sync with the byte count of the underlying Stream.
9583 However, this limits us to a window size of 2048 characters: i.e.,
9584 the maximum lookahead of our lexer/parser can be 2048 characters.
9586 2005-09-28 Marek Safar <marek.safar@seznam.cz>
9589 * driver.cs: Fix compilation files with full root path.
9591 2005-09-25 Miguel de Icaza <miguel@novell.com>
9593 * report.cs (SymbolRelatedToPreviousError): Format the output so
9594 it does not use an open parenthesis that is never closed.
9596 * driver.cs: Follow coding guidelines
9598 2005-09-27 Marek Safar <marek.safar@seznam.cz>
9601 * const.cs (Const.ResolveValue): Check for assigning non-null
9602 value to reference type.
9604 2005-09-27 Marek Safar <marek.safar@seznam.cz>
9606 * anonymous.cs: Implemented ExprClassName.
9608 * assign.cs (Assign.DoResolve): Don't chrash when type is not
9611 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
9614 * class.cs (StaticClass.DefineContainerMembers): Report protected
9617 * codegen.cs: if(ed) PRODUCTION.
9619 * convert.cs (Error_CannotImplicitConversion): Better error
9622 * cs-parser.jay: More error checks.
9624 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
9626 * driver.cs (CSCParseOption): Enabled wrong option check.
9628 * ecore.cs (Expression.ExprClassName): Turned to property.
9629 (MemberExpr.CheckIntermediateModification): For checking boxed
9630 value types modification.
9632 * statement.cs (Fixed.Resolve): Expression type must be
9633 convertible to fixed type.
9634 (CollectionForeach.GetEnumeratorFilter,TryType):
9635 Small refactoring for easier error checking.
9637 2005-09-26 Marek Safar <marek.safar@seznam.cz>
9639 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
9642 * class.cs (GeneratedBaseInitializer): New class for customization
9643 compiler generated initializers.
9644 (MemberBase.DoDefine): Check Obsolete attribute here.
9645 (FieldMember.DoDefine): Ditto.
9647 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
9650 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
9651 (MemberCore.GetObsoleteAttribute): Removed argument.
9652 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
9653 (MemberCore.CheckObsoleteType): New helper.
9657 * statement.cs: Updates after MemberCore changes.
9659 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
9660 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
9662 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
9663 obsolete attribute for compiler construct.
9664 (As.DoResolve): Cache result.
9666 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
9668 2005-09-26 Raja R Harinath <rharinath@novell.com>
9671 * expression.cs (This.VerifyFixed): In a value type T, the type of
9672 'this' is T&, iow, 'this' is either an out or ref parameter. In a
9673 value type R, 'this' is treated as a value parameter.
9675 2005-09-22 Miguel de Icaza <miguel@novell.com>
9677 * statement.cs (Lock): Use the TemporaryVariable class instead of
9678 manually using local variables as those do not work when variables
9681 * ecore.cs: Moved the TemporaryVariable class from being a nested
9682 class inside Foreach to be a public class that can be employed in
9685 2005-09-19 Marek Safar <marek.safar@seznam.cz>
9687 * cs-parser.jay: interface_accessors replaced by
9688 accessor_declarations.
9690 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
9693 * statement.cs (GotoCase.Resolve): Convert null constant to
9695 (SwitchLabel.ResolveAndReduce): Ditto.
9696 (SwitchLabel.NullStringCase): Custom null stamp.
9697 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
9699 typemanager.cs (CSharpSignature): Don't skip first argument
9702 2005-09-18 Miguel de Icaza <miguel@novell.com>
9704 * driver.cs: Set InEmacs based on the environment variable EMACS.
9706 * location.cs (InEmacs): in this mode, do not report column
9707 location as it confuses Emacs.
9709 2005-09-16 Marek Safar <marek.safar@seznam.cz>
9711 * cfold.cs, constant.cs, convert.cs, ecore.cs,
9712 expression.cs, iterators.cs, literal.cs: Store constants and
9715 * class.cs (MemberBase.ShortName): Pass location.
9717 * cs-parser.jay: Some location fixes.
9719 * ecore.cs (Expression.Location): Made virtual.
9721 2005-09-05 Miguel de Icaza <miguel@novell.com>
9723 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
9724 if the underlying types are the same, otherwise we need to produce
9725 code that will do the proper cast.
9727 This was exposed by Marek's constant rewrite which produced
9728 invalid code for the call site:
9731 void Method (X v) {}
9735 This fixes test-49.cs
9737 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
9739 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
9740 Type/Object should be allowed as well. Fixed bug #75968.
9742 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
9744 * expression.cs : (Binary.DoResolve): when one is enum constant and
9745 another is constant 0, then return enum one *as enum type*.
9748 2005-09-02 Raja R Harinath <rharinath@novell.com>
9750 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
9754 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
9755 flow-branching for LocalVariableReferences in case we were invoked
9756 from a MemberAccess.
9757 * expression.cs (LocalVariableReference.VerifyAssigned): New.
9759 (LocalVariableReference.DoResolveBase): ... this.
9760 (MemberAccess.Resolve): Do the check that was disabled during
9763 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
9766 (PartialContainer.Create): check abstract/sealed/static strictly
9767 but abstract/sealed can exist only at one side. Fixed bug #75883.
9769 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
9772 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
9773 specified, don't default to UnmanagedType.I4.
9775 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
9777 * expression.cs : conditional operator should check possibly
9778 incorrect assign expression. Fixed bug #75946.
9780 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
9782 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
9783 Reverting the change. gmcs is much complex than mcs on this matter.
9785 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
9787 * cs-tokenizer.cs : To read another token ahead of the actual
9788 consumption, use new SavedToken and cache token instead of moving
9789 back the stream with SeekableStreamReader (it seemed problematic).
9791 driver.cs : Thus use StreamReader directly.
9792 * support.cs : Thus removed SeekableStreamReader.
9794 2005-08-30 Raja R Harinath <rharinath@novell.com>
9797 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
9798 (ScopeInfo.EmitScopeType): Use it to construct field names from
9799 names of captured locals.
9802 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
9803 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
9804 Pass 'target_type' to BoxedCast. Don't default to 'object'.
9805 (ExplicitConversion): Remove enum cases already handled by
9806 implicit conversion. Move implicit conversion check to the beginning.
9807 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
9808 * expression.cs (ArrayCreation.EmitDynamicInitializers):
9809 Don't treat System.Enum as a struct.
9811 2005-08-30 Jb Evain <jbevain@gmail.com>
9813 * attribute.cs: handles as expression in parameters.
9815 2005-08-30 Raja R Harinath <rharinath@novell.com>
9818 * class.cs (TypeContainer.VerifyClsName): Don't use a
9819 PartialContainer when verifying CLS compliance.
9820 (AbstractPropertyEventMethod): Set Parent here, ...
9821 (PropertyMethod): ... not here.
9823 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
9825 * attribute.cs : escaped attribute name should not be allowed to be
9826 resolved (e.g. @class as classAttribute). Fixed bug #75930.
9828 2005-08-29 Raja R Harinath <rharinath@novell.com>
9831 * convert.cs (ImplicitStandardConversionExists): Allow zero also
9832 when converting a long constant to unsigned long.
9833 * expression.cs (Invocation.OverloadResolve): Add sanity check to
9834 detect where IsApplicable and VerifyArgumentsCompat disagree.
9836 2005-08-29 Raja R Harinath <rharinath@novell.com>
9837 and Carlos Alberto Cortez <carlos@unixmexico.org>
9840 * class.cs (TypeContainer.CanElideInitializer): New helper.
9841 (TypeContainer.EmitFieldInitializers): Use it to determine if we
9842 can safely emitting the initializer of a field.
9844 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
9846 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
9847 allowed inside a switch (without loop). Fixed bug #75433.
9849 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
9851 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
9852 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
9854 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
9856 * driver.cs : kinda reverting the default encoding changes (not exact
9857 revert since I noticed that "codepage:reset" might not work fine).
9859 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
9861 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
9862 Location. Now getter and setter store location correctly.
9863 (errors/cs0111-12.cs now reports the expected location.)
9865 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
9867 * driver.cs : Use default encoding on the environment.
9868 Removed (now that) extra parameter for SeekableStreamReader.
9869 * support.cs : (SeekableStreamReader) third .ctor() argument for
9870 StreamReader is not required (always true). preamble size could
9871 be acquired in simpler and safe way.
9873 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
9875 * cs-parser.jay: report CS0642 at warning level 3
9876 and report CS0642 for an if else statement also
9877 fixes bug #74745. Patch by John Luke (and a bit
9879 Removed extra CS0642 warning check for "while",
9881 * statement.cs: In Block.Resolve(), CS0642 check
9882 is reimplemented to check a sequence of an empty
9883 statement and a block.
9885 Both fix bug #66777.
9887 2005-08-24 Marek Safar <marek.safar@seznam.cz>
9889 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
9890 detection until I fix it.
9892 * cs-tokenizer.cs: Changed error message.
9894 * cs-parser.jay: Fixed 2 error locations.
9896 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
9897 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
9900 * enum.cs (GetSignatureForError): Fixed.
9902 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
9906 * typemanager.cs (RegisterProperty): Removed.
9908 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
9910 2005-08-24 Raja R Harinath <rharinath@novell.com>
9913 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
9914 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
9916 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9918 * expression.cs : tiny fix is required for not warning positive ulong.
9921 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9923 * expression.cs : add CS0652 check for constant and integral
9924 expression. Fixed bug #53974.
9926 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9928 * expression.cs : in DoNumericPromotions(), check if there is implicit
9929 conversion overload for string (to check CS0034). Fixed bug #52492.
9931 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9933 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
9935 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9937 * ecore.cs : report location when it is *not* Null.
9939 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
9945 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
9946 correctly. Fixed bug #75721.
9948 2005-08-23 Raja R Harinath <rharinath@novell.com>
9950 * support.cs (SeekableStreamReader.Position): Avoid an expensive
9951 loop that performs 'min (pos, char_count)'.
9954 * expression.cs (Unary.ResolveOperator): Don't discard implicit
9955 converted value in Operator.OnesComplement.
9957 2005-08-22 Ben Maurer <bmaurer@ximian.com>
9959 * anonymous.cs: If the anon method is pulled into a helper class,
9960 it needs to be `internal' not `private'. Fixes runtime behavior on
9963 2005-08-20 Martin Baulig <martin@ximian.com>
9965 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9966 scope if we don't already have it.
9968 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
9969 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
9972 2005-08-17 Marek Safar <marek.safar@seznam.cz>
9975 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
9978 2005-08-16 Marek Safar <marek.safar@seznam.cz>
9980 The big constants rewrite
9981 Fix #75746, #75685 and more
9982 As a side effect saved 1MB for MWF ;-)
9984 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
9985 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
9986 enum based for corlib compilation.
9988 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
9991 * class.cs (FixedField.Define): Use ResolveAsConstant.
9993 * const.cs (IConstant): Interface constants and enums.
9994 (Const.ResolveValue): New method for constant resolvning.
9995 (ExternalConstant): Constants from imported assemblies.
9997 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
9998 conversion; like enums.
9999 (Constant.ToType): Converts this constant to different type.
10000 (Constant.Increment): Adds 1.
10002 * convert.cs (ImplicitConversionRequired): Simplified.
10004 * cs-parser.jay: Create EnumMember directly.
10006 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
10008 * doc.cs (GenerateEnumDocComment): Removed.
10010 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
10011 (ConvertIntLiteral): Removed.
10012 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
10014 * enum.cs (EnumMember): Implement IConstant.
10015 (Enum.IsValidEnumConstant): Removed.
10016 (Enum.GetNextDefaultValue): Removed.
10017 (Enum.FindMembers): Updated.
10018 (Enum.GenerateDocComment): Iterate enum members.
10020 * expression.cs (Cast.TryReduce): Handle enums correctly.
10021 (New.Constantify): Made public.
10022 (MemberAccess.DoResolve): Removed contant specific if(s).
10024 * literal.cs (NullLiteral): Implement new abstract methods.
10026 * statement.cs (GotoCase.Resolve): Use new constant methods.
10027 (SwitchLabel.ResolveAndReduce): Use new constant methods.
10029 * typemanager.cs (LookupEnum): Removed.
10030 (IsEnumType): Fixed to work with corlib.
10031 (RegisterConstant): Removed.
10032 (LookupConstant): Removed.
10033 (GetConstant): Changed to work with IConstant.
10035 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
10037 * location.cs : Fixed overflown (>255) column number.
10039 2005-08-03 Raja R Harinath <rharinath@novell.com>
10041 First cut of the qualified-alias-member feature.
10042 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
10044 * cs-parser.jay (DOUBLE_COLON): New token.
10045 (namespace_or_type_name): Add rule for recognizing
10046 qualified-alias-members.
10047 (primary_expression): Likewise.
10048 (element_access): Allow QualifiedAliasMember as a possible
10049 type-bearing expression.
10050 (local_variable_type, local_variable_pointer_type): Likewise.
10051 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
10052 aliases in the current and enclosing namespace declarations.
10053 (NamespaceEntry.UsingAlias): Add CS0440 warning.
10054 * decl.cs (MemberName.is_double_colon): New.
10055 (MemberName.MemberName): Add new constructor for alias-member.
10056 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
10057 * expression.cs (QualifiedAliasMember): New expression type.
10059 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10061 * location.cs : it borked when no argument was specified.
10063 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10065 * location.cs : tiny ToString() format fix.
10067 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10069 * statement.cs : oops, it was missing.
10071 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
10073 A set of fixes for precise line/column location.
10076 "token" field now holds a file/line "delta", a line number offset
10077 from the segment, and a column number. See also:
10078 http://lists.ximian.com/pipermail/mono-devel-list/2004-
10079 December/009508.html
10080 Removed static IsNull. Use instance IsNull property instead.
10081 * cs-tokenizer.cs :
10082 For some tokens it stores Location. For Identifier it stores
10083 LocatedToken which is a pair of string name and location.
10084 Column numbers are adjusted only at getChar().
10086 Use Location.ToString() for reporting (it now contains column).
10088 Largely modified to use LocatedToken instead of
10089 string (IDENTIFIER), and to acquire Location from some tokens.
10090 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
10091 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
10093 Now MemberName holds Location. DeclSpace.ctor() receives Location
10094 as a parameter. Removed extra parameters to all derived classes.
10095 Replaced Location.IsNull() with instance property.
10096 * assign.cs, expression.cs :
10097 Added .ctor() overload that omits Location.
10099 Added "nameEscaped" flag that indicates the identifier was escaped
10100 in the source file. This fixes bug #57047.
10102 2005-08-02 Marek Safar <marek.safar@seznam.cz>
10104 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
10105 New method, looking for lo-case imported cls type.
10107 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
10110 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10112 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
10114 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
10115 all_imported_types.
10116 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
10118 Optimized to save 3.5 MB for SWF compilation.
10120 2005-08-01 Marek Safar <marek.safar@seznam.cz>
10122 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
10123 (PartialContainer.Create): Moved logic AddToContainer.
10124 (PartialContainer.MarkForDuplicationCheck): Shares name.
10126 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
10129 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
10131 (Namespace.GetSignatureForError): New method.
10133 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
10134 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
10136 2005-08-01 Raja R Harinath <rharinath@novell.com>
10139 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
10140 member lookup rather than qualifier_type, since qualifier_type can
10143 2005-08-01 Marek Safar <marek.safar@seznam.cz>
10145 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
10148 2005-07-31 Miguel de Icaza <miguel@novell.com>
10150 * statement.cs: Copy the local exception into the exception
10151 captured local. Fixes 75674
10153 2005-07-31 Raja R Harinath <harinath@gmail.com>
10156 * expression.cs (Invocation.OverloadResolve): Don't report error
10157 CS1501 if error CS1502 has been reported.
10158 (New.DoResolve): Delegate CS1501 reporting to
10159 Invocation.OverloadResolve.
10162 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
10163 invariant-meaning-in-block property in an enclosing block if
10166 2005-07-29 Marek Safar <marek.safar@seznam.cz>
10168 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
10169 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
10170 (Switch.CheckSwitch): Just save 50kb for SWF.
10172 2005-07-27 Martin Baulig <martin@ximian.com>
10174 * anonymous.cs (CaptureContext.AddField): Added
10175 `AnonymousContainer am' argument; compute its toplevel scope if
10176 it's not already computed. Fixes #75649.
10178 2005-07-26 Raja R Harinath <rharinath@novell.com>
10181 * class.cs (Constructor.Emit): Reset block to null if the block
10184 2005-07-25 Marek Safar <marek.safar@seznam.cz>
10186 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
10188 2005-07-25 Marek Safar <marek.safar@seznam.cz>
10190 * class.cs (MethodData.Define): Check whether accessor implementing
10191 interface is public.
10193 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
10195 2005-07-22 Marek Safar <marek.safar@seznam.cz>
10198 * namespace.cs (LookupType): Moved same type check to...
10200 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
10201 with the same name.
10203 2005-07-21 Raja R Harinath <rharinath@novell.com>
10205 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
10206 already found a typebuilder.
10207 * class.cs (MethodCore.IsDuplicateImplementation): Compare
10208 MemberNames, not strings.
10210 * const.cs (Error_ExpressionMustBeConst):
10211 Rename from Error_EpressionMustBeConst.
10212 * const.cs, class.cs, statement.cd: Update.
10214 2005-07-21 Marek Safar <marek.safar@seznam.cz>
10218 * const.cs (Const.LookupConstantValue): Report missing contant expression
10220 (Error_EpressionMustBeConstant): Only one error method.
10222 * class.cs, statement.c: Updated.
10224 2005-07-20 Raja R Harinath <rharinath@novell.com>
10226 * statement.cs (Block.Flags): Add back HasVarargs.
10227 (Block.flags): Make protected.
10228 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
10230 * typemanager.cs (types, typecontainers, user_types): Remove.
10231 (UserTypes, TypeContainers): Likewise.
10232 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
10233 (CleanUp, Reset): Update.
10234 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
10235 (GetNestedType): Use Type.GetNestedType.
10236 (CoreLookupType): Take two arguments, the namespace and the
10237 basename of the type. Update to use the Namespace.Lookup
10239 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
10240 (RealMemberLookup): Use IsNestedChildOf instead of playing with
10241 string concatenation and substring matches.
10242 * class.cs, enum.cs, delegate.cs: Update to changes.
10244 2005-07-20 Marek Safar <marek.safar@seznam.cz>
10246 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
10247 Expression and made virtual.
10249 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
10250 (ImplicitStandardConversionExists): Fixed `byte' typo ?
10252 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
10254 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
10257 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
10260 2005-07-18 Marek Safar <marek.safar@seznam.cz>
10263 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
10264 AssemblyCultureAttribute is not used on executable.
10267 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
10269 2005-07-16 Raja R Harinath <rharinath@novell.com>
10272 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
10273 New. Reports CS0252/CS0253.
10274 Mostly taken from preliminary patch by Duncak Mak.
10275 (Binary.DoResolveOperator): Store results of operator lookup.
10276 Use them to detect if we need to warn about unintended reference
10279 2005-07-15 Raja R Harinath <rharinath@novell.com>
10282 * namespace.cs (Namespace.Lookup): Add back location parameter.
10283 (Namespace.LookupType): Add CS0436 report. Add location parameter.
10284 * delegate.cs, ecore.cs, expression.cs: Update to changes.
10286 * codegen.cs (EmitContext.DeclSpace): Make readonly.
10287 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
10288 (Namespace.LookupType): ... this.
10289 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
10291 * typemanager.cs (LookupTypeReflection): Remove buggy code that
10292 purported to handle pointers.
10293 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
10296 2005-07-15 Marek Safar <marek.safar@seznam.cz>
10298 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
10301 2005-07-15 Raja R Harinath <rharinath@novell.com>
10303 * namespace.cs (Namespace.Lookup): Drop location parameter.
10304 (NamespaceEntry.LookupAlias): Remove. Merge into ...
10305 (NamespaceEntry.Lookup): ... this.
10306 (NamespaceEntry.Error_AmbiguousTypeReference):
10307 Move here from DeclSpace.
10308 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
10310 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
10311 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
10312 Move to NamespaceEntry.
10313 * delegate.cs, expression.cs: Update to changes.
10315 2005-07-14 Marek Safar <marek.safar@seznam.cz>
10317 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
10318 CheckAttributeType and refactored.
10319 (Attribute.ResolvePossibleAttributeType): Changed to reuse
10320 ResolveAsTypeTerminal error handling.
10321 (ResolveAsTypeTerminal): Introduced because of global attributes extra
10323 (GetSignatureForError): Print errors in same way.
10326 * codegen.cs: Reflect attribute GetSignatureForError change.
10329 * expression.cs: Add silent parameter to ResolveAsTypeStep.
10331 * namespace.cs (UsingEntry): Refactored to make fields private.
10334 statement.cs: Error_UnexpectedKind has extra parameter.
10336 2005-07-14 Raja R Harinath <rharinath@novell.com>
10338 * ecore.cs (IAlias): Remove.
10339 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
10340 that implement the interface.
10341 * namespace.cs (Namespace): Likewise.
10342 (Namespace.declspaces): Renamed from 'defined_names'.
10343 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
10344 DeclSpace instead of an IAlias.
10345 * tree.cs (Tree.AddDecl): Update.
10347 2005-07-12 Raja R Harinath <rharinath@novell.com>
10349 * statement.cs (Block.Flags); Remove HasVarargs.
10350 (Block.HasVarargs): Move to ToplevelBlock.
10351 (Block.ThisVariable, Block.AddThisVariable): Likewise.
10352 (Block.Variables): Make protected. Initialize variable hashtable
10354 (Block.AddVariable): Update.
10355 (Block.Resolve): Update to changes.
10356 (ToplevelBlock.HasVarargs): New boolean.
10357 (ToplevelBlock.ThisVariable): Move here from Block.
10358 (ToplevelBlock.AddThisVariable): Likewise.
10359 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
10360 * expression.cs (This.ResolveBase): Update to changes.
10361 (ArglistAccess.DoResolve): Likewise.
10363 2005-07-11 Marek Safar <marek.safar@seznam.cz>
10366 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
10368 * class.cs (TypeContainer.VerifyMembers): Distinguish between
10369 not used and not used & assigned.
10370 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
10372 2005-07-11 Marek Safar <marek.safar@seznam.cz>
10375 * expression.cs (Is.DoResolve): null is never provided type.
10377 2005-07-08 Marek Safar <marek.safar@seznam.cz>
10380 * cs-parser.jay: Less strict event error rule to catch more errors.
10382 2005-07-08 Martin Baulig <martin@ximian.com>
10384 Fix test-iter-10.cs - distinguish whether we `yield' in a property
10385 gettter (allowed) or setter (not allowed).
10387 * class.cs (Accessor): Implement IIteratorContainer.
10388 (Accessor.Yields): New public field.
10389 (PropertyBase.PropertyMethod.Define): Handle iterators on a
10390 per-accessor basis.
10393 (get_accessor_declaration, set_accessor_declaration): Set the
10394 `yields' flag on the accessor, not the property.
10395 (property_declaration): Do the iterators check on a per-accessor
10396 basis and not for the whole property.
10398 2005-07-08 Martin Baulig <martin@ximian.com>
10400 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
10401 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
10403 2005-07-07 Marek Safar <marek.safar@seznam.cz>
10406 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
10407 (ExtractSecurityPermissionSet): Cope with self referencing security
10408 attributes properly.
10410 * driver.cs (SetOutputFile): Made public property OutputFile.
10412 2005-07-07 Raja R Harinath <rharinath@novell.com>
10415 * class.cs (TypeContainer.first_nonstatic_field): Rename from
10416 has_nonstatic_fields. Make into a FieldBase pointer.
10417 (TypeContainer.AddField): Add CS0282 check.
10418 (TypeContainer.EmitType): Update.
10420 2005-07-06 Miguel de Icaza <miguel@novell.com>
10422 * cs-tokenizer.cs (consume_identifier): Do not create strings to
10423 compare if they start with __.
10425 2005-07-06 Raja R Harinath <rharinath@novell.com>
10427 * statement.cs (Switch.SwitchGoverningType): Only look at
10428 UserCasts that don't need implicit standard conversions to one of
10429 the allowed switch types (Fixes test-322.cs).
10430 (LocalInfo.Resolve): Re-enable sanity-test.
10432 2005-07-06 Marek Safar <marek.safar@seznam.cz>
10434 * cs-tokenizer.cs (consume_identifier): Detect double undescores
10436 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
10438 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
10440 2005-07-06 Raja R Harinath <rharinath@novell.com>
10443 * ecore.cs (SimpleName.GetSignatureForError): Add.
10444 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
10445 (MemberAccess.GetSignatureForError): Add.
10447 2005-07-05 Marek Safar <marek.safar@seznam.cz>
10449 The big error and warning messages review.
10479 * typemanager.cs: Updated.
10481 * class.cs: (MethodCore.SetYields): Moved here to share.
10482 (PropertyMethod.Define): Moved iterator setup here.
10484 * iterators.cs: Add orig_method to have full access to parent
10487 2005-07-05 Raja R Harinath <rharinath@novell.com>
10489 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
10490 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
10491 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
10492 variable of struct type.
10493 * expression.cs (Unary.ResolveOperator): Update to change.
10494 (Indirection.VerifyFixed): Likewise.
10495 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
10496 (ParameterReference.VerifyFixed): Value parameters are fixed.
10497 (This.VerifyFixed): Treat 'this' as a value parameter.
10498 * statement.cs (LocalInfo.IsFixed): Remove.
10500 2005-07-01 Martin Baulig <martin@ximian.com>
10502 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
10503 `ec.EmitThis ()' to get the correct scope.
10505 2005-07-01 Martin Baulig <martin@ximian.com>
10507 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
10508 instance is a ParameterReference; fixes #75299.
10510 2005-07-01 Martin Baulig <martin@ximian.com>
10512 Reverted Marek's latest patch (r46725):
10513 - it contains structural changes which are neither mentioned in
10514 the ChangeLog nor explained anywhere; for example the additional
10515 argument of EmitContext's and Iterator's .ctor's and the
10516 TypeContainer.DefineMembers() change.
10517 - structural changes like this should go in in seperate patches
10518 and not be hidden in a huge patch which just seems to affect
10519 warnings and errors.
10520 a big and hard to understand patch.
10521 - it breaks iterators and causes regressions, for instance in
10524 2005-06-30 Raja R Harinath <rharinath@novell.com>
10527 * expression.cs (Indexers.map): Remove.
10528 (Indexers.Append): Filter out inaccessible setters and getters.
10529 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
10532 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
10533 Refactored from ...
10534 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
10535 (FieldExpr.Emit, PropertyExpr.Emit): Update.
10536 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
10537 * expression.cs (Invocation.EmitCall): Add CS0120 check.
10539 2005-06-30 Marek Safar <marek.safar@seznam.cz>
10542 * class.cs (FieldBase.GetInitializerExpression): One more field
10545 2005-06-28 Miguel de Icaza <miguel@novell.com>
10547 * pending.cs: Do not define a proxy if the base method is virtual,
10548 it will be picked up by the runtime (bug 75270).
10550 2005-06-08 Martin Baulig <martin@ximian.com>
10552 The big Iterators rewrite :-)
10554 * iterators.cs: Rewrite this to use the anonymous methods framework.
10556 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
10557 before the TypeContainers; see 2test-21.cs.
10560 (TypeContainer.DefineType): Don't create a new EmitContext if we
10561 already have one (this only happens if we're an Iterator).
10562 (TypeContainer.Define): Also call Define() on all our iterators.
10563 (Method.CreateEmitContext): Added support for iterators.
10566 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
10567 (AnonymousContainer.CreateMethodHost): Moved here from
10568 AnonymousMethod and made abstract.
10569 (AnonymousContainer.CreateScopeType): New abstract method.
10570 (AnonymousContainer.IsIterator): New public property.
10571 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
10572 get the ScopeTypeBuilder rather than manually defining it here.
10573 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
10576 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
10577 before RootContext.DefineTypes().
10579 * codegen.cs (EmitContext.RemapToProxy): Removed.
10580 (EmitContext.CurrentAnonymousMethod): Changed type from
10581 AnonymousMethod -> AnonymousContainer.
10582 (EmitContext.ResolveTopBlock): Protect from being called twice.
10583 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
10584 (EmitContext.EmitThis): Removed the iterators hacks; use the
10585 anonymous methods framework for that.
10588 (ToplevelBlock.Container): Make this a property, not a field.
10589 (ToplevelBlock.ReParent): New public method; move the
10590 ToplevelBlock into a new container.
10591 (Foreach.TemporaryVariable): Simplify.
10593 2005-06-05 Martin Baulig <martin@ximian.com>
10595 * statement.cs (LocalInfo.CompilerGenerated): New flag.
10596 (Block.AddTemporaryVariable): New public method; creates a new
10597 `LocalInfo' for a temporary variable.
10598 (Block.EmitMeta): Create the LocalBuilders for all the temporary
10600 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
10601 non-iterator variables.
10603 2005-06-05 Martin Baulig <martin@ximian.com>
10605 * statement.cs (Foreach.TemporaryVariable): Create the
10606 LocalBuilder in the Emit phase and not in Resolve since in some
10607 situations, we don't have an ILGenerator during Resolve; see
10608 2test-19.cs for an example.
10610 2005-06-04 Martin Baulig <martin@ximian.com>
10612 **** Merged r45395 from GCS ****
10614 The big Foreach rewrite - Part II.
10616 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
10617 with `PropertyInfo ienumerator_getcurrent'.
10619 * codegen.cs (VariableStorage): Removed.
10622 (Foreach): Derive from Statement, not ExceptionStatement.
10623 (Foreach.CollectionForeach): New nested class. Moved all the code
10624 dealing with collection foreach here.
10625 (Foreach.ForeachHelperMethods): Removed.
10626 (Foreach.TemporaryVariable): Implement IMemoryLocation.
10628 2005-05-23 Martin Baulig <martin@ximian.com>
10630 * statement.cs (Try.DoResolve): Don't create a `finally' if we
10631 don't need to. Fix #75014.
10633 2005-05-20 Martin Baulig <martin@ximian.com>
10635 Merged r44808 from GMCS.
10637 * class.cs (TypeContainer.CircularDepException): Removed.
10638 (TypeContainer.DefineType): Removed the `InTransit' stuff.
10639 (TypeContainer.CheckRecursiveDefinition): Check for circular class
10640 (CS0146) and interface (CS0529) dependencies here.
10642 2005-06-21 Raja R Harinath <rharinath@novell.com>
10644 * expression.cs (Invocation.EmitCall): Fix initialization
10645 'this_call' to reflect current behaviour. Fix indentation.
10647 * convert.cs (FindMostEncompassedType): Add two trivial special
10648 cases (number_of_types == 0 || number_of_types == 1).
10649 (FindMostEncompasingType): Likewise.
10651 2005-06-17 Raja R Harinath <rharinath@novell.com>
10653 Some cleanups preparing for the fix of #75283.
10654 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
10656 (EventExpr.InstanceResolve): Likewise.
10657 (EventExpr.DoResolve): Remove redundant checks.
10659 2005-06-10 Duncan Mak <duncan@novell.com>
10661 * cs-tokenizer.cs (process_directives): New flag for controlling
10662 the processing of preprocessor directives.
10663 (x_token): After seeing a '#', return Token.NONE instead of going
10664 to handle_preprocessing_directive() when not processing
10665 directives. This avoids unnecessary processing during the token peek in
10670 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
10671 the existing error reporting methods instead of Report.Error.
10673 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
10674 after Raja's rewrite.
10676 2005-06-08 Miguel de Icaza <miguel@novell.com>
10678 * class.cs: Small fix.
10680 2005-06-08 Raja R Harinath <rharinath@novell.com>
10683 * class.cs (GetPartialBases): Fix return value check of
10684 part.GetClassBases.
10686 2005-06-07 Raja R Harinath <rharinath@novell.com>
10688 Ensure that partial classes are registered in their enclosing
10689 namespace. Initial part of fix of #75160.
10690 * tree.cs (Tree.RecordDecl): Add new namespace argument.
10691 Register declspace with namespace here, not in
10692 DeclSpace.RecordDecl.
10693 * cs-parser.jay: Pass namespace to RecordDecl.
10694 * class.cs (PartialContainer.Create): Likewise.
10695 (ClassPart.DefineType): New sanity-check. Throws an exception if
10697 * decl.cs (Declspace.RecordDecl): Remove.
10698 * namespace.cs (NamespaceEntry.DefineName): Remove.
10700 2005-06-06 Marek Safar <marek.safar@seznam.cz>
10702 * rootcontext.cs: Reset TargetExt as well.
10704 2005-06-03 Raja R Harinath <rharinath@novell.com>
10706 * ecore.cs (Expression.Resolve): Emit CS0654 error when
10707 -langversion:ISO-1.
10709 2005-06-02 Raja R Harinath <rharinath@novell.com>
10711 Fix #75080, cs0119.cs.
10712 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
10714 (Expression.Resolve): ... this. Use it. Remove bogus code
10715 allowing ExprClass.Type and ExprClass.Namespace for
10716 ResolveFlags.VariableOrValue.
10717 (Expression.Resolve) [1-argument variant]: Change default resolve
10718 flags based on language version.
10719 (Expression.Error_UnexpectedKind): Use a simple string array
10720 rather than an ArrayList.
10721 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
10722 not ExprClass.Type.
10723 (TypeOfVoid.DoResolve): Likewise.
10724 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
10725 flags argument -- it always has the same value.
10727 2005-05-31 Raja R Harinath <rharinath@novell.com>
10730 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
10731 Use it in the error message.
10732 * assign.cs, expression.cs, statement.cs: Update.
10734 2005-05-30 Raja R Harinath <rharinath@novell.com>
10737 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
10738 the "almostMatchedMember" case too.
10739 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
10740 that failed the accessibility checks to 'almost_match'.
10742 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
10744 * attribute.cs: Use internal MethodBuilder methods to set
10745 ExactSpelling and SetLastError on PInvoke methods, instead
10746 of passing them via charset. Fixes #75060.
10748 2005-05-27 Raja R Harinath <rharinath@novell.com>
10750 * parameter.cs (Parameter): Remove TODO comment.
10751 (Parameter.DefineParameter): Remove Location parameter.
10752 (Parameters.LabelParameters): Likewise.
10753 * class.cs (Constructor.Emit): Update to change.
10754 (MethodData.Emit): Likewise.
10755 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
10756 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
10758 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
10761 Removed Parameters.Location and added Parameter.Location instead.
10762 Removed Location parameter from Emit() and GetSignature().
10769 Modified all related calls.
10771 2005-05-26 Raja R Harinath <rharinath@novell.com>
10773 Improve user-defined conversion handling.
10774 * convert.cs (GetConversionOperators): Rewrite. Return only the
10775 applicable operators.
10776 (AddConversionOperators): New. Helper for GetConversionOperators.
10777 (FindMostEncompassedType, FindMostEncompassingType): Verify that
10778 there is only one most encompassed/encompassing type.
10779 (FindMostSpecificSource, FindMostSpecificTarget): Remove
10780 "applicable operator" handling.
10781 (UserConversion): Move cache here from GetConversionOperators.
10782 Directly cache the chosen operator, rather than the whole
10784 (ExplicitNumericConversion): Fix buggy implementation of Decimal
10785 case. Allow conversion of decimal to sbyte and byte too.
10786 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
10787 New static methods. Used to avoid allocating EmptyExpressions in
10790 2005-05-24 Duncan Mak <duncan@novell.com>
10792 * ecore.cs (CastFromDecimal): New class for casting a decimal to
10793 another class, used in Convert.ExplicitNumericConversion.
10794 (CastToDecimal): New class, similar to above, but casts to
10795 System.Decimal, used in Convert.ImplicitNumericConversion and also
10796 in explicit convesion from double/float to decimal.
10798 * convert.cs (ImplicitNumericConversion): Handle implicit
10799 conversions to System.Decimal.
10800 (ExplicitNumericConversion): handle explicit conversions to
10805 2005-05-20 Miguel de Icaza <miguel@novell.com>
10807 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
10808 know the type at this stage, just break through. Fixes #75008
10810 2005-05-19 Martin Baulig <martin@ximian.com>
10813 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
10814 to disable error reporting.
10816 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
10817 here since we don't want to report an error; see the new test-336.cs.
10819 2005-05-19 Raja R Harinath <rharinath@novell.com>
10821 * statement.cs (ToplevelBlock.GetParameterReference)
10822 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
10823 Move here from class Block.
10824 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
10825 * expression.cs (ParameterReference.DoResolveBase): Likewise.
10827 2005-05-18 Martin Baulig <martin@ximian.com>
10832 (FlowBranching.Reachability): Add non-static public And() and Or()
10834 (FlowBranchingSwitch): New class; do the `break_origins' thing
10835 like in FlowBranchingLoop.
10836 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
10837 reachability, not just locals and parameters.
10838 (FlowBranching.MergeChild): Remove some of the hacks for loop and
10839 switch; MergeBreakOrigins() now takes care of that.
10841 2005-05-18 Martin Baulig <martin@ximian.com>
10843 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10844 a loop and may leave it, reset the barrier; fixes #74974.
10846 2005-05-17 Marek Safar <marek.safar@seznam.cz>
10848 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
10851 * cs-parser.jay: Catch more lexical errors.
10853 * report.cs: Add one more Error method.
10856 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
10858 2005-05-17 Martin Baulig <martin@ximian.com>
10860 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
10863 2005-05-16 Raja R Harinath <rharinath@novell.com>
10865 Fix test-382.cs. Emit values of decimal constants.
10866 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
10868 (TypeContainer.AddField): ... this.
10869 (TypeContainer.EmitFieldInitializers): Allow the list of fields
10870 with initializers to include 'Const's.
10871 (ClassPart.RegisterFieldForInitialization): Forward to
10873 * const.cs (Const.Const): Pass initializer to base class.
10874 (Const.Define): In case of decimal constants, register them for
10875 initialization in a static constructor.
10877 2005-05-14 Martin Baulig <martin@ximian.com>
10879 * statement.cs (Block.Resolve): Correctly handle unreachable code;
10880 do not call ResolveUnreachable() on unreachable statements in
10881 here, see the comment in the source code.
10883 2005-05-13 Raja R Harinath <rharinath@novell.com>
10886 * expression.cs (BinaryResolveOperator): If one of the operands of
10887 an equality comparison is 'null' and the other is a pointer type,
10888 convert the null to a NullPointer.
10889 * convert.cs (ImplicitReferenceConversion): If the expression is a
10890 NullLiteral and the target type is a pointer type, return a
10891 NullPointer instead.
10892 (ImplicitConversionStandard): Likewise.
10894 2005-05-13 Marek Safar <marek.safar@seznam.cz>
10896 * cs-parser.jay: Set readonly context based on special constructs.
10898 * expression.cs (LocalVariableReference.DoResolveBase): Improved
10899 readonly variable error handling.
10901 * rootcontext.cs (EmitCode): Don't verify members when error
10904 * statement.cs (LocalInfo): Add reaodnly context information.
10905 (SetReadOnlyContext, GetReadOnlyContext): New methods.
10907 2005-05-13 Raja R Harinath <rharinath@novell.com>
10909 * statement.cs (Block.Resolve): Revert change below. Modify fix
10910 for #74041 to initialize 'resolved' to false only for explicit
10911 blocks. Fixes #74873.
10913 2005-05-12 Raja R Harinath <harinath@gmail.com>
10916 * typemanager.cs (unmanaged_enclosing_types): New.
10917 (IsUnmanagedType): Avoid infloops by using
10918 'unmanaged_enclosing_types' to talk with recursive invocations.
10920 2005-05-13 Martin Baulig <martin@ximian.com>
10922 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
10923 instance variable, not a local. Fix #74873.
10924 (Block.ResolveUnreachable): Set it to true here.
10926 2005-05-11 Duncan Mak <duncan@novell.com>
10928 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
10929 continuing to process for 'arg'.
10930 (handle_preprocessing_directive): Check the argument of the #endif
10931 directive and report error CS1025 if there are any trailing
10934 According to the C# spec, having even whitespace after the #endif
10935 directive is illegal; however, because we call arg.TrimEnd ()
10936 beforehand, we have the same behavior as csc, allowing whitespace
10937 after the directive.
10941 2005-05-11 Marek Safar <marek.safar@seznam.cz>
10945 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
10946 (Constructor.GetObsoleteAttribute): Implemented correctly.
10948 2005-05-10 Martin Baulig <martin@ximian.com>
10950 * support.cs (ReflectionParameters.ParameterModifier): Use
10951 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
10952 and `ParameterAttributes.In'. Fixes #74884.
10954 2005-05-10 Marek Safar <marek.safar@seznam.cz>
10956 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
10958 * expression.cs (Argument.GetParameterModifier): Turned to property.
10959 (Invocation.Error_InvalidArguments): Add more descriptive errors.
10961 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
10964 2005-05-09 Raja R Harinath <rharinath@novell.com>
10967 * decl.cs (MemberCache.AddMethods): Register override methods,
10968 rather than non-override methods.
10969 * typemanager.cs (RegisterOverride): New.
10970 (IsOverride): Update.
10972 2005-05-09 Marek Safar <marek.safar@seznam.cz>
10976 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
10977 recursive declaration.
10979 * statement.cs (Block.ResolveMeta): Report any error in resolving.
10981 2005-05-06 Marek Safar <marek.safar@seznam.cz>
10983 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
10985 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
10987 2005-05-05 Raja R Harinath <rharinath@novell.com>
10990 * decl.cs (DeclSpace.FamilyAccessible):
10991 Use TypeManager.IsNestedFamilyAccessible.
10993 Fix reopened #64812.
10994 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
10997 2005-05-04 Raja R Harinath <rharinath@novell.com>
10998 Abin Thomas <projectmonokochi@rediffmail.com>
10999 Anoob V E <projectmonokochi@rediffmail.com>
11000 Harilal P R <projectmonokochi@rediffmail.com>
11003 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
11004 allow access to all static members.
11006 2005-05-04 Martin Baulig <martin@ximian.com>
11008 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
11010 2005-05-04 Martin Baulig <martin@ximian.com>
11014 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
11015 section at the end; make things work if `default' is not the last
11018 2005-05-04 Martin Baulig <martin@ximian.com>
11022 * statement.cs (Switch): Replaced the `got_default' field with a
11023 `default_section' one.
11024 (Switch.CheckSwitch): Set `default_section' here.
11025 (Switch.Resolve): If we're a constant switch and the constant is
11026 not found, use the default section.
11028 2005-05-03 Martin Baulig <martin@ximian.com>
11030 * expression.cs (ArrayAccess.EmitGetLength): New public method.
11032 * statement.cs (Foreach.ArrayForeach): New nested class.
11033 (Foreach.TemporaryVariable): New nested class.
11034 (Foreach.EmitArrayForeach): Removed; this is now in the new
11035 ArrayForeach class.
11037 2005-05-03 Raja R Harinath <rharinath@novell.com>
11039 * pending.cs (BaseImplements): Move the #74773 fix here. This is
11041 (VerifyPendingMethods): Revert change below.
11043 * typemanager.cs (IsOverride, RegisterNonOverride): New.
11044 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
11045 that used to trigger warning -28. Remove warning -28.
11046 * expression.cs (Invocation.OverloadResolve): Use
11047 TypeManager.IsOverride to distinguish override methods.
11050 * pending.cs (VerifyPendingMethods): If a base type implements the
11051 requested interface, don't bother checking individual methods of
11052 the base type. As a side-effect, this prevents the creation of
11053 unnecessary proxies.
11055 2005-05-02 Martin Baulig <martin@ximian.com>
11059 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11060 Also `And' the locals if the old vector is null.
11061 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
11062 null; in this case we basically reset all the variables.
11064 2005-05-02 Martin Baulig <martin@ximian.com>
11068 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
11069 Added `FlowBranching branching' argument; always `and' the
11070 variables instead of `or'ing them unless we're an infinite loop.
11072 * statement.cs (While.Resolve): Create a new sibling unless we're
11075 2005-05-02 Martin Baulig <martin@ximian.com>
11079 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
11080 arguments; use it instead of creating a new TopLevelBlock.
11081 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
11082 our ConstructorInitializer.
11085 (TopLevelBlock.TopLevelBranching): New public property.
11086 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
11087 and create our `TopLevelBranching'.
11089 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
11090 anonymous method host, use `block.TopLevelBranching' rather than
11091 creating a new branching.
11093 2005-04-20 Miguel de Icaza <miguel@novell.com>
11095 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
11096 a ScopeInfo, if any of the current children is a child of the new
11097 entry, move those children there.
11099 2005-04-30 Martin Baulig <martin@ximian.com>
11101 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
11102 at the beginning of a SwitchSection. Fix #73335.
11104 2005-04-27 Marek Safar <marek.safar@seznam.cz>
11107 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
11109 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
11110 (FieldExpr.DoResolve): Obsolete members are ignored for field
11113 2005-04-26 Marek Safar <marek.safar@seznam.cz>
11115 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
11116 of arrays detection.
11118 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
11120 (Field.VerifyClsCompliance): Volatile fields are not compliant.
11122 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
11125 2005-04-25 Ben Maurer <bmaurer@ximian.com>
11127 * cs-parser.jay: Use the prefered version of -unsafe in error
11130 2005-04-22 Marek Safar <marek.safar@seznam.cz>
11132 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
11135 2005-04-20 John Luke <john.luke@gmail.com>
11137 * driver.cs: fix typo in error message, --outout to --output
11139 2005-04-20 Marek Safar <marek.safar@seznam.cz>
11141 * codegen.cs (InRefOutArgumentResolving): New field.
11143 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
11144 fields outside contructor.
11146 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
11148 2005-04-19 Miguel de Icaza <miguel@novell.com>
11150 * anonymous.cs (CaptureContext.EmitParameterInstance): The
11151 parameter code was not completed ever, so it was not as up-to-date
11152 as local variables. Must finish it.
11154 The bug fix was to compare the Toplevel of the block, not the
11155 current block. Thanks for Ben for pointing this out.
11157 2005-04-19 Raja R Harinath <rharinath@novell.com>
11159 * decl.cs (AddMethods): Use the declaring type of the problem
11160 method to determine if we want to squash a warning.
11162 2005-04-19 Marek Safar <marek.safar@seznam.cz>
11164 * attribute.cs: Removed debug output.
11166 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
11168 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
11171 2005-04-18 Raja R Harinath <rharinath@novell.com>
11174 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
11175 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
11176 all null comparisons against reference types.
11178 2005-04-18 Marek Safar <marek.safar@seznam.cz>
11181 * class.cs (TypeContainer.CircularDepException) New nested
11183 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
11184 (TypeContainer.DefineType): Removed error, reset InTransit before
11186 (Class.DefineType): Throw exception when is in Transit.
11187 Catch exception and report error.
11188 (Struct.DefineType): Throw exception when is in Transit.
11189 Catch exception and report error.
11190 (Interface.DefineType): Throw exception when is in Transit.
11191 Catch exception and report error.
11193 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
11194 handle nested exception handlers.
11196 * flowanalysis.cs (InTryWithCatch): New method, search for try with
11199 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
11200 InFinally and InCatch storage.
11202 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
11203 (Catch.Resolve): Set and Restore ec.InCatch.
11204 (Try.Resolve): Set and Restore ec.InFinally.
11205 (Try.HasCatch): True when try has catch.
11207 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
11209 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
11210 for the same event member, so exclude such cases from warning 419.
11213 2005-04-16 Miguel de Icaza <miguel@novell.com>
11215 * expression.cs (Binary.ResolveOperator): Apply patch from John
11216 Luke to fix bug 59864: operators &, | and ^ on enumerations
11217 require that the same enum type on both sides.
11219 * driver.cs: Add warnings to old flag usage, this is to assist
11220 people who produce Makefiles and hope that the Makefiles will be
11223 * class.cs (TypeContainer.EmitType): Moved the definition of the
11224 special $PRIVATE$ field from the resolve phase to the Emit phase.
11225 During resolve we do not know if we are a struct with
11226 HasExplicitLayout, we know this only after the attributes for the
11229 Set the FieldOffset to zero on the dummy field that we create for
11230 the class. Fixes 74590.
11232 2005-04-16 Raja R Harinath <rharinath@novell.com>
11235 * ecore.cs (PropertyExpr.resolved): New.
11236 (DoResolve): Use it to handle a case of double resolution here.
11237 Handle a case of identical-name-and-type-name.
11238 * expression.cs (ArrayCreation.CheckIndices): Avoid double
11239 resolution by storing the results of expression resolution back
11240 into the "probes" array.
11242 2005-04-15 Raja R Harinath <rharinath@novell.com>
11244 Fix cs0208-7.cs and cs0208-8.cs.
11245 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
11246 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
11247 error reporting to point out the reason a struct is not unmanaged.
11249 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11251 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
11252 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
11254 2005-04-13 Raja R Harinath <rharinath@novell.com>
11257 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
11258 IdenticalNameAndTypeName here.
11259 (EventExpr.InstanceResolve): Likewise.
11261 2005-04-13 Marek Safar <marek.safar@seznam.cz>
11263 C# 2.0 DefaultCharSetAttribute implementation
11265 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
11266 which allows us to set GlobalNamespace for every resolve.
11267 (Attribute.ResolveArguments): Cut from Resolve.
11268 (Attribute.GetCharSetValue): Returns CharSet named argument.
11269 (Attribute.DefinePInvokeMethod): Gets default charset from
11271 (GlobalAttribute.ResolveAsTypeStep): Override.
11272 (GlobalAttribute.ResolveArguments): Override.
11274 * class.cs (TypeAttr): Is protected.
11276 * codegen.cs (ModuleClass.DefaultCharSet): New member.
11277 (ModuleClass.DefaultCharSetType): New memeber.
11278 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
11280 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
11281 charset from module.
11283 * delegate.cs (TypeAttr): Override.
11284 (Delegate.DefineType): Use this TypeAttr.
11286 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
11287 at very early stage (before types are defined) to resolve model
11288 module attributes. It will probably not work with corlib but it
11291 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
11292 charset from module.
11294 * typemanager.cs (default_charset_type): New type.
11296 2005-04-13 Raja R Harinath <rharinath@novell.com>
11298 * decl.cs (MemberCache.AddMethods): Don't warn if
11299 System.Object.Finalize has buggy MethodAttributes.
11301 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
11304 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11306 * doc.cs : detect ambiguous reference to overloaded members.
11307 Fixed bug #71603. MS 1.1 csc does not detect it.
11309 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
11311 * doc.cs : delegates must not be referenced with parameters.
11314 2005-04-12 Miguel de Icaza <miguel@novell.com>
11316 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
11318 2005-04-10 Miguel de Icaza <miguel@novell.com>
11320 * driver.cs (MainDriver): Stop processing if the CLS stage found
11323 (CompilerCallableEntryPoint.InvokeCompiler): Always
11324 reset after execution; Take a TextWriter argument for the
11327 * report.cs: Use the error stream instead of hardcoding stderr.
11329 2005-04-09 Miguel de Icaza <miguel@novell.com>
11331 * class.cs: Reduce code paths to test, too small of an
11332 optimization to make it worth the extra testing. Always perform
11335 2005-04-08 Raja R Harinath <rharinath@novell.com>
11338 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
11339 operators that had errors reported on them.
11341 2005-04-08 Marek Safar <marek.safar@seznam.cz>
11343 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
11345 (Attribute.Resolve): Add named argument type checking.
11347 * class.cs (FixedField.Define): Use IsPrimitiveType
11349 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
11351 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
11352 unsafe parameter types.
11354 * statement.cs (Using.ResolveExpression): Add better error description.
11356 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
11358 2005-04-08 Raja R Harinath <rharinath@novell.com>
11361 * attribute.cs (Attribute.GetAttributeUsage): Resolve
11362 AttributeUsageAttribute in the emitcontext of the attribute class,
11363 not in the emitcontext of the attributable entity it was attached to.
11364 * cs-parser.jay: Use 'current_class', not 'current_container',
11365 when creating a GlobalAttribute.
11367 2005-04-08 Alp Toker <alp@atoker.com>
11369 * pending.cs: The fix to #58413 failed to compile methods implementing
11370 interfaces with/without params modifiers and vice versa, even though
11371 params modifiers aren't part of the signature. Make the modifier check
11372 less strict as in csc.
11374 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
11375 Anoob V E <projectmonokochi@rediffmail.com>
11376 Harilal P R <projectmonokochi@rediffmail.com>
11379 * pending.cs (TypeAndMethods.mods): New. Store the parameter
11380 modifiers of pending methods.
11381 (PendingImplementation.PendingImplementation): Initialize it.
11382 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
11383 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
11384 with ParameterData. Add check for modifiers.
11385 * class.cs (MethodData.Define): Update to changes.
11387 2005-04-07 Raja R Harinath <rharinath@novell.com>
11389 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
11391 2005-04-07 Marek Safar <marek.safar@seznam.cz>
11393 * class.cs (PropertyMethod.Define): Check private accessor in abstract
11396 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
11399 * typemanager.cs: Registered RequiredAttributeAttribute.
11401 2005-04-06 Marek Safar <marek.safar@seznam.cz>
11403 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
11404 Warning CS0169 is back at level 3.
11405 (IMethodData.SetMemberIsUsed): New method.
11407 * decl.cs (IsUsed): New value; moved from FieldBase.Status
11408 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
11410 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
11412 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
11414 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
11417 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
11420 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
11421 to avoid the problems with nested types.
11423 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
11424 Anoob V.E <projectmonokochi@rediffmail.com>
11425 Harilal P.R <projectmonokochi@rediffmail.com>
11426 Raja R Harinath <rharinath@novell.com>
11429 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
11431 * typemanager (GetConstructor): Make public.
11433 2005-04-05 John Luke <john.luke@gmail.com>
11434 Raja R Harinath <rharinath@novell.com>
11437 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
11438 struct too. Return false quicker in a few cases.
11439 (VerifyUnManaged): Use it.
11441 2005-04-05 Raja R Harinath <rharinath@novell.com>
11444 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
11445 not 'unreachable_seen'.
11447 2005-04-04 Marek Safar <marek.safar@seznam.cz>
11449 * attribute.cs (Attribute.GetValue): Removed unused.
11451 * codegen.cs (CodeGen.TrimExt): Removed unused.
11453 * cs-parser.jay (output): Removed unused.
11455 * cs-tokenizer.cs (hex_digits): Removed unused.
11457 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
11459 * expression.cs (Indirection.LoadExprValue): Removed unused.
11460 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
11462 * iterators.cs (Iterator.param_types): Removed unused.
11464 * statement.cs (Goto.block): Removed unused.
11465 (ToplevelBlock.did): Removed unused.
11466 (Switch.ResolveConstantSwitch): Removed unused.
11468 2005-04-01 Ben Maurer <bmaurer@ximian.com>
11470 * rootcontext.cs: Allow mcs to bootstrap with the compilation
11473 2005-04-01 Raja R Harinath <rharinath@novell.com>
11475 Fix #74232 and cs0208-3.cs.
11476 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
11477 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
11478 unmanaged type. Don't use FieldBuilders when 't' is a
11479 TypeBuilder. Use ModFlags and MemberType fields.
11480 * class.cs (MemberBase.member_type): Rename from MemberType.
11481 (MemberBase.MemberType): New property. Determines member_type on
11483 (MemberBase.DoDefine): Don't initialize MemberType here.
11484 (FieldMember.Define): Likewise.
11486 2005-04-01 Marek Safar <marek.safar@seznam.cz>
11489 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
11490 Attributes are emitted there.
11492 2005-04-01 Raja R Harinath <rharinath@novell.com>
11494 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
11495 keyword in 'partial enum' too.
11496 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
11498 Report from Kamil Skalski <nazgul@omega.pl>.
11501 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
11502 have partial containers too.
11504 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
11505 in block' checks to Block.CheckInvariantMeaningInBlock.
11506 * statement.cs (Block.GetKnownVariableInfo): Make private.
11507 (Block.IsVariableUsedInChildBlock): Remove.
11508 (Block.IsVariableUsedInBlock): Likewise.
11509 (Block.CheckInvariantMeaningInBlock): New. Show location of
11510 conflicting declaration.
11511 (Block.AddVariable): Make error messages less long-winded and more
11512 specific. Show location of conflicting declaration.
11513 * parameter.cs (Parameters.Location): New readonly property.
11515 2005-03-31 Raja R Harinath <rharinath@novell.com>
11517 Clean up semantics of invoking ResolveMemberAccess.
11518 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
11519 can have an instance, ensure that we pass in a non-TypeExpression
11520 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
11521 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
11522 argument. Update to changes and simplify.
11523 (FieldExpr.Emitinstance): Remove CS0120 check.
11524 (PropertyExpr.EmitInstance): Likewise.
11525 * expression.cs (Argument.Resolve): Likewise.
11526 (Invocation.DoResolve): Update to changes in semantics of
11527 InstanceExpression.
11529 2005-03-31 Marek Safar <marek.safar@seznam.cz>
11532 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
11535 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
11537 2005-03-31 Raja R Harinath <rharinath@novell.com>
11539 Fix difference in behaviour with commandline invocation.
11540 * driver.cs (Driver.Reset): New.
11541 (CompilerCallableEntryPoint): Call it.
11543 * statement.cs (If.Resolve): Avoid spurious "uninitialized
11544 variable" warnings if the boolean expression failed to resolve.
11546 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
11548 * attribute.cs: Fix the union of several permissions when some of them
11549 are unrestricted (so the result isn't an unrestricted permission set).
11552 2005-03-30 Raja R Harinath <rharinath@novell.com>
11554 * ecore.cs (MemberExpr): New class. Convert from interface
11556 (MemberExpr.ResolveMemberAccess): Refactor and move here from
11557 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
11559 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
11560 (MethodGroupExpr.IsExplicitImpl): Remove.
11561 (Expression.GetFieldFromEvent): Remove.
11562 (SimpleName.MemberStaticCheck): Remove.
11563 (SimpleName.DoSimpleNameResolve): Update to changes.
11564 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
11565 (MemberAccess.IdenticalNameAndTypeName): Remove.
11566 (MemberAccess.error176): Move to MemberExpr.
11567 (MemberAccess.DoResolve): Update to changes.
11568 (BaseAccess.DoResolve): Likewise.
11570 2005-03-30 Marek Safar <marek.safar@seznam.cz>
11572 C# 2.0 Conditional attribute class implementation
11574 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
11575 Analyzes class whether it has attribute which has ConditionalAttribute
11576 and its condition is not defined.
11578 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
11579 (Class.IsExcluded): New method. Search for at least one defined
11580 condition in ConditionalAttribute of attribute class.
11582 2005-03-30 Raja R Harinath <rharinath@novell.com>
11584 * ecore.cs (PropertyExpr): Derive from Expression, not
11585 ExpressionStatement.
11586 (PropertyExpr.EmitStatement): Remove.
11588 2005-03-29 Raja R Harinath <rharinath@novell.com>
11591 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
11592 internal field "value__" of an enum be private. The examples for
11593 "value__" that I found on MSDN all used FieldAttributes.Private.
11595 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
11596 Don't mention IL method attribute names.
11598 Fix #47991. Remove a TODO.
11599 * statement.cs (Block.Toplevel): Make into a field.
11600 (Block.Parameters): Move into ToplevelBlock.
11601 (Block.known_variables): Rename from child_variable_names.
11602 (Block.Block): Remove variants that take Parameters. Initialize
11603 'Toplevel' with the immediately surrounding toplevel block.
11604 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
11605 LocalInfo parameter.
11606 (Block.GetKnownVariableInfo): New.
11607 (Block.IsVariableNameUsedInChildBlock): Update.
11608 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
11609 the block, even though it may not be in scope.
11610 (Block.AddVariable): Remove Parameters parameter. Use
11611 Toplevel.Parameters instead.
11612 (Block.AddConstant): Remove Parameters parameter.
11613 (Block.GetParameterReference): Update to use Toplevel.Parameters.
11614 (Block.IsParamaterReference): Likewise.
11615 (Block.IsLocalParameter): Likewise. Simplify a lot.
11616 (ToplevelBlock.Parameters): New. Moved from Block.
11617 (ToplevelBlock.ToplevelBlock): Update to changes. Always
11618 initialize Parameters to a non-null value.
11619 * cs-parser.jay: Update to changes.
11620 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
11621 simple names that mean different things in the same block. Use
11622 Block.IsVariableNameUsedInBlock.
11624 2005-03-28 Raja R Harinath <rharinath@novell.com>
11626 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
11627 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
11628 GetTypeHandle. It is possible for a reflected type to derive from
11629 a TypeBuilder (e.g., int[] derives from the TypeBuilder
11630 System.Array during mscorlib compilation).
11631 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
11632 contain a method_hash, don't create one either. Don't create a
11633 deep copy of the base cache's method_hash.
11634 (MemberCache.SetupCache): Rename back from DeepCopy.
11635 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
11636 already initialized. If we see an override function, add its
11637 underlying base virtual function to the member_hash too.
11639 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
11641 2005-03-26 Raja R Harinath <harinath@acm.org>
11644 * assign.cs (Assign.DoResolve): When the RHS of an assignment
11645 fails to resolve, ensure that the LHS is still resolved as an
11648 2005-03-25 Raja R Harinath <harinath@acm.org>
11650 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
11652 (Enum.current_ec): Remove.
11653 (Enum.LookupEnumValue): Remove EmitContext argument.
11654 Just uses the one created during DefineType.
11655 (Enum.FindMembers): Update.
11656 * expression.cs (MemberAccess.DoResolve): Update.
11658 2005-03-22 Marek Safar <marek.safar@seznam.cz>
11660 * assign.cs (Assign.DoResolve): Check for CS1717 when
11661 source and target are same (uses Equals).
11663 * expression.cs (LocalVariableReference, ParameterReference,
11664 This): Implemented Equals, GetHashCode.
11666 * statement.cs (Block.GetParameterReference): Removed useless
11669 2005-03-22 Raja R Harinath <rharinath@novell.com>
11672 * statement.cs (Block.AddVariable): Ensure that we skip implicit
11673 blocks before deciding whether the error is cs0136 or cs0128.
11675 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
11676 (using_alias_directive, using_namespace_directive): Pass
11677 MemberName, not an expression to Namespace.UsingAlias and
11679 (MakeName): Use the MemberName of the namespace.
11680 * namespace.cs (Namespace.MemberName): New.
11681 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
11682 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
11684 * decl.cs (MemberName.Name): Make readonly.
11685 (MemberName.FromDotted): New "constructor".
11686 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
11687 (MemberCore.Name): Compute from MemberName on demand.
11688 (MemberCore.SetMemberName): Provide a way to change the
11690 (MemberCore.AddToContainer): Don't take a fullname parameter.
11691 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
11692 fully qualified name of the container to the member name.
11693 (TypeContainer.AddToTypeContainer): Use a fully qualified name
11694 only if the type is a member of the root container.
11695 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
11696 MemberName.Left rather than searching for an embedded ".".
11697 (PartialContainer.CreatePart): Update to changes in RootContext.
11698 (MemberBase.ShortName): Turn into a property. Use
11699 MemberCore.SetMemberName.
11700 (MemberBase.ExplicitInterfaceName): Remove.
11701 (MemberBase.UpdateMemberName): Remove.
11702 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
11703 (PropertyBase.SetMemberName): New override.
11704 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
11705 (Tree.GetDecl): New.
11706 (Tree.AllDecls): Rename from Decls.
11707 * attribute.cs, enum.cs, report.cs: Update to changes.
11708 * driver.cs (MainDriver): Use MemberName.FromDotted on
11709 RootContext.MainClass.
11711 2005-03-21 Marek Safar <marek.safar@seznam.cz>
11713 * class.cs (FixedField.Define): Check for CS1664 and more sanity
11716 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
11718 2005-03-18 Marek Safar <marek.safar@seznam.cz>
11720 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
11721 property accessor modifiers.
11723 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
11724 fixed buffer attribute (CS1716).
11725 (PropertyMethod.HasCustomAccessModifier): When property accessor
11726 has custom modifier.
11728 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
11730 (PropertyExpr.DoResolveLValue): Add CS0272.
11732 2005-03-17 Miguel de Icaza <miguel@novell.com>
11734 * convert.cs: When converting to a pointer, use the proper Conv.U
11735 or Conv.I depending on the source data type.
11737 * cs-tokenizer.cs: Make the size for large decimal constants,
11740 2005-03-17 Martin Baulig <martin@ximian.com>
11742 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
11743 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
11745 2005-03-17 Martin Baulig <martin@ximian.com>
11747 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
11748 to bool so we can return an error condition.
11749 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
11752 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
11754 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
11757 2005-03-16 Raja R Harinath <rharinath@novell.com>
11759 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
11760 Refactor to avoid traversing the list of assemblies, and to avoid
11761 string concatenation.
11762 * typemanager.cs (guid_attr_type): Remove.
11763 (negative_hits, pointers, references): Remove hashes.
11765 (GetConstructedType): New. Uses type_hash to handle constructed
11766 types (arrays, references, pointers).
11767 (GetReferenceType, GetPointerType): Use it.
11768 (GetNestedType): New. Uses type_hash to handle nested types of
11770 (LookupType, LookupTypeDirect): Remove.
11771 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
11772 'types' hash and LookupTypeReflection directly.
11773 (params_string, params_object): Use GetConstructedType.
11774 * namespace.cs (Namespace.cached_types): New. Cache of reflected
11776 (Namespace.Lookup): Use cached_types.
11777 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
11778 provided by old TypeManager.LookupType.
11779 * rootcontext.cs (MakeFQN): Remove.
11780 * decl.cs (DeclSpace.MakeFQN): Likewise.
11781 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
11782 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
11783 TypeManager.GetConstructedType.
11784 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
11786 2005-03-15 Marek Safar <marek.safar@seznam.cz>
11788 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
11791 * cs-parser.jay: Reports CS1527 for any namespace element.
11793 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
11796 * expression.cs (ParameterReference.IsAssigned): Changed error to
11798 (Error_WrongNumArguments): Moved CS0245 detection here.
11800 * statement.cs (Return.Resolve): Add CS1622 report.
11802 2005-03-11 Marek Safar <marek.safar@seznam.cz>
11804 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
11806 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
11808 * attribute.cs expression.cs: Get rid of some allocations.
11810 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
11812 * doc.cs : just eliminate the latest change.
11814 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
11816 * doc.cs : commented out the latest change. It breaks xml-030.cs
11818 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
11820 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
11821 fail. So invoke CreateType() in FindDocumentedType().
11823 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
11825 * cs-tokenizer.cs : added IsKeyword().
11826 * doc.cs : Detect keyword incorrectly used as identifier.
11827 Allow identifiers prefixed by @.
11829 2005-03-10 Marek Safar <marek.safar@seznam.cz>
11831 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
11832 It caused exception in namespace resolving (again!).
11834 * class.cs (Class.ctor): Removed exit.
11835 (PropertyMethod.ctor): ditto.
11837 * codegen.cs (Codegen.Reset): Reset static data.
11838 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
11840 * cs-tokenizer.cs (Cleanup): Removed.
11842 * driver.cs (GetSystemDir): Rewrote to one line command.
11843 It caused problem with unloaded dynamic modules.
11844 (UnixParseOption): Removed Exit.
11845 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
11846 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
11847 Now can be mcs used as library.
11849 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
11852 * location.cs (Reset): Reset static data.
11854 * namespace.cs (Reset): Reset static data.
11856 * report.cs (Report.Reset): Reset static data.
11858 * rootcontext.cs (RootContext.Reset): Reset static data.
11860 * tree.cs (RootTypes.ctor): Use Location.Null
11862 * typemanager.cs (TypeManager.Reset): Reset static data.
11863 (CoreLookupType): Removed Exit.
11864 (TypeHandle.Reset): Reset static data.
11866 2005-03-10 Raja R Harinath <rharinath@novell.com>
11869 * typemanager.cs (ComputeNamespaces): Import namespaces from
11870 referenced modules too.
11872 2005-03-09 Raja R Harinath <rharinath@novell.com>
11874 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
11877 2005-03-09 Raja R Harinath <rharinath@novell.com>
11879 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
11880 enclosing DeclSpace. This ensures that a name-lookup populates
11881 more caches and there are fewer 'TypeExpression's. Carve out
11882 nested type lookup into ...
11883 (LookupNestedTypeInHierarchy): ... this.
11885 2005-03-09 Raja R Harinath <rharinath@novell.com>
11887 Clean up a few partial-class semantics.
11888 Fixes test-357.cs and cs1618-2.cs.
11889 * cs-parser.jay (struct_declaration): Use 'current_class' as
11890 parent of newly-created struct. Remove call to Register ().
11891 Use 'pop_current_class' to complete handing the current struct.
11892 (interface_declaration): Likewise.
11893 (class_declaration): Likewise.
11894 (enum_declaration): Use 'current_class' as parent of newly created
11896 (delegate_declaration): Likewise.
11897 (pop_current_class): New function. This is used to handle closing
11898 up the 'current_class' and 'current_container', and pointing them
11899 to the enclosing class/container.
11900 (CSharpParser): Initialize 'current_class' too.
11901 * decl.cs (MemberCore): Add check for invariant: a partial
11902 container is not a parsed entity, and thus does not enclose any
11904 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
11905 (DeclSpace.BaseTypeExpr): Use it.
11906 (DeclSpace.LookupType): Add check for invariant.
11907 * class.cs (TypeContainer): Add check for invariant: a nested
11908 class should have the same NamespaceEntry as its enclosing class.
11909 (TypeContainer.EmitFieldInitializers): Make virtual.
11910 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
11912 (TypeContainer.Register): Remove.
11913 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
11914 null. Use TypeResolveEmitContext for resolving base types and
11915 interfaces. Move initialization of Parts.TypeBuilder here from
11917 (TypeContainer.DefineNestedTypes): ... here.
11918 (PartialContainer): Take a Namespace not a NamespaceEntry.
11919 (PartialContainer.Create): Don't use Register. Call the
11920 appropriate Add... function directly.
11921 (ClassPart): Take both the PartialContainer and the enclosing
11922 class as constructor arguments.
11923 (ClassPart.EmitFieldInitializers): Override.
11924 (ClassPart.PartFindNestedTypes): Remove.
11925 (FieldBase.GetInitializerExpression): Resolve the initializer
11926 expression in the emit context of the enclosing class.
11927 * tree.cs (RootTypes): Remove Register ().
11929 2005-03-08 Marek Safar <marek.safar@seznam.cz>
11931 * cs-parser.jay: Removed CS0134.
11933 * driver.cs: Removed CS1901.
11935 * expression.cs (SizeOf.DoResolve): Don't report CS0233
11936 for predefined types.
11938 2005-03-07 Duncan Mak <duncan@novell.com>
11940 * codegen.cs (Save): Catch UnauthorizedAccessException as
11941 well. Fixes bug #73454.
11943 2005-03-07 Marek Safar <marek.safar@seznam.cz>
11945 * cs-tokenizer.cs (xtoken): Add CS1035.
11947 * class.cs (MethodData.Define): Add CS0683.
11948 (FieldMember.ctor): Add CS0681.
11950 2005-03-07 Raja R Harinath <rharinath@novell.com>
11952 * ecore.cs (SimpleName.DoResolve): Rename from
11953 SimpleName.DoResolveAllowStatic.
11954 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
11955 Pass 'intermediate' flag to MemberStaticCheck.
11956 (SimpleName.MemberStaticCheck): Skip "static check" only in case
11957 of "intermediate" lookups via MemberAccess.
11958 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
11959 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
11961 2005-03-07 Raja R Harinath <rharinath@novell.com>
11964 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
11965 slipped in because of variable names that are identical to a
11966 builtin type's BCL equivalent ('string String;', 'int Int32;').
11967 (PropertyExpr.EmitInstance): Likewise.
11969 2005-03-04 Marek Safar <marek.safar@seznam.cz>
11971 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
11973 * report.cs (warning_ignore_table): Made public.
11975 2005-03-04 Raja R Harinath <rharinath@novell.com>
11978 * class.cs (MethodData.Emit): Pass 'container' to
11979 container.GetObsoleteAttribute instead of 'container.Parent'.
11981 2005-03-03 Marek Safar <marek.safar@seznam.cz>
11983 * cs-parser.jay: Add 1534 error test.
11985 * iterators.cs (Yield.CheckContext): Add error 1629.
11986 (Iterator.ctor): Save unsafe modifier.
11987 (MoveNextMethod.DoEmit): Restore unsafe context.
11989 * namespace.cs (UsingAlias): Better error message.
11991 2005-03-03 Dan Winship <danw@novell.com>
11993 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
11994 the warning message [#73219]
11996 2005-03-03 Raja R Harinath <rharinath@novell.com>
11998 Fix compile with MCS 1.0.0.0.
11999 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
12000 w_restore to not depend on string constant folding.
12002 2005-03-03 Raja R Harinath <rharinath@novell.com>
12004 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
12005 CS0246 check to users who passed 'silent = false'.
12006 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
12008 (SimpleName.SimpleNameResolve): Update.
12009 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
12010 (MemberAccess.IdenticalNameAndTypeName): Update.
12011 * doc.cs (FindDocumentedTypeNonArray): Update.
12013 2005-03-03 Raja R Harinath <rharinath@novell.com>
12015 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
12016 * parameters.cs (ComputeAndDefineParameters): Remove.
12017 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
12018 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
12019 Use GetParameterInfo.
12021 2005-03-02 Marek Safar <marek.safar@seznam.cz>
12023 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
12025 2005-03-02 Raja R Harinath <rharinath@novell.com>
12027 Unify DeclSpace.LookupType and DeclSpace.FindType.
12028 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
12029 is in charge of defining nested types on demand.
12030 (DeclSpace.LookupType): Use it when the current_type is a
12031 TypeBuilder. Use LookupTypeDirect for reflected types.
12032 (DeclSpace.FindType): Remove.
12033 (DeclSpace.LookupInterfaceOrClass): Likewise.
12034 (DeclSpace.DefineTypeAndParents): Likewise.
12035 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
12036 DeclSpace.LookupType.
12037 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
12038 * typemanager.cs (LookupType): Simplify.
12039 (AddUserType): Remove type from negative_hits.
12040 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
12041 * class.cs (TypeContainer.FindMembers): Move handling of nested
12043 (TypeContainer.FindMembers_NestedTypes): ... here.
12044 (TypeContainer.FindNestedType): Implement override.
12045 (ClassPart.FindNestedType): Delegate to PartialContainer.
12046 (ClassPart.PartFindNestedType): Looks up the nested types of the
12049 2005-03-02 Martin Baulig <martin@ximian.com>
12051 * class.cs (TypeContainer.DoDefineMembers): We also need a default
12052 static constructor in static classes.
12054 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
12056 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
12057 sizeParamIndex is not specified.
12059 2005-03-01 Marek Safar <marek.safar@seznam.cz>
12062 * report.cs (WarningMessage.IsEnabled): Missing null check.
12064 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12066 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
12067 in the fields and not in the properties.
12069 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
12071 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
12074 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12076 * attribute.cs: Small refactoring (improved robustness).
12077 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
12078 (ValidateGuid): Removed.
12079 (Resolve): Removed referenced to above mentioned.
12080 (GetAttributeUsage): Made private and changed to work without
12082 (GetIndexerAttributeValue): Don't crash.
12083 (GetConditionalAttributeValue): Ditto.
12084 (GetClsCompliantAttributeValue): Ditto.
12085 (ExtractSecurityPermissionSet): All attributes exceptions are
12087 (GetPropertyValue): New helper.
12088 (GetMethodImplOptions): New method.
12089 (DefinePInvokeMethod): Reuse common code. Implemented handling of
12090 some missing properties.
12092 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
12093 (Method.ApplyAttributeBuilder): Updated.
12095 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
12098 2005-02-28 Raja R Harinath <rharinath@novell.com>
12101 * report.cs (Report.SymbolRelatedToPreviousError): Handle
12102 non-simple types (array, pointer, reference).
12104 2005-02-28 Marek Safar <marek.safar@seznam.cz>
12106 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
12108 * class.cs (MethodCore.IsDuplicateImplementation): Special error
12110 (Method.CheckBase): Catch wrong destructor here.
12111 (MethodData.Define): Add errors 550, 668.
12113 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
12115 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
12117 * pending.cs (VerifyPendingMethods): Add error 551.
12119 * typemanager.cs (CSharpName): Next error report helper.
12121 2005-02-25 Marek Safar <marek.safar@seznam.cz>
12123 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
12124 attributes. Removed useless attribute double check.
12125 It saves almost 2MBs for corlib.
12127 2005-02-25 Raja R Harinath <rharinath@novell.com>
12130 * statement.cs (ExpressionStatement.Resolve): Make robust to being
12131 called twice in case of error.
12133 2005-02-23 Chris Toshok <toshok@ximian.com>
12135 Fix compiler portions of #72827.
12136 * statement.cs (Block.Emit): call Begin/EndScope on the
12137 EmitContext instead of the ILGenerator.
12139 * codegen.cs (EmitContext.BeginScope): new method, call
12140 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
12142 (EmitContext.BeginScope): same, but EndScope and CloseScope
12144 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
12145 offset and call the superclass's OpenScope(int) with it.
12146 (SymbolWriter.CloseScope): get the current il
12147 offset and call superclass's CloseScope(int) with it.
12149 2005-02-23 Marek Safar <marek.safar@seznam.cz>
12151 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
12152 CS1677 for out and ref as well.
12154 * class.cs (Method.Define): Add error CS1599 detection.
12156 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
12158 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
12160 * delegate.cs (Delegate.Define): Add error CS1599 detection.
12162 * support.cs.cs (ModifierDesc): New helper method.
12164 2005-02-23 Raja R Harinath <rharinath@novell.com>
12165 Abin Thomas <projectmonokochi@rediffmail.com>
12166 Anoob V E <projectmonokochi@rediffmail.com>
12167 Harilal P R <projectmonokochi@rediffmail.com>
12169 Fix #57851, #72718.
12170 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
12171 MemberLookup (used for error reporting) actually returns a result.
12172 Fix error report number (122, not 112).
12174 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
12175 Anoob V E <projectmonokochi@rediffmail.com>
12176 Harilal P R <projectmonokochi@rediffmail.com>
12179 * pending.cs (PendingImplementation.GetAbstractMethods):
12180 Find NonPublic members too.
12182 2005-02-22 Marek Safar <marek.safar@seznam.cz>
12184 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
12187 * class.cs (MethodCore.CheckMethodAgainstBase):
12188 Add error 239 report.
12190 2005-02-21 Raja R Harinath <rharinath@novell.com>
12193 * expression.cs (Invocation.IsApplicable): Make public.
12194 (Invocation.IsParamsMethodApplicable): Likewise.
12195 * delegate.cs (Delegate.VerifyApplicability): Don't use
12196 Invocation.VerifyArgumentCompat for parameter applicability
12197 testing. Use Invocation.IsApplicable and
12198 Invocation.IsParamsMethodApplicable.
12200 2005-02-21 Marek Safar <marek.safar@seznam.cz>
12202 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
12204 * class.cs (Operator.Define): Add error 217 report.
12206 2005-02-21 Raja R Harinath <rharinath@novell.com>
12208 * namespace.cs (UsingEntry.Resolve): Undo change below.
12210 2005-02-21 Raja R Harinath <rharinath@novell.com>
12213 * ecore.cs (Expression.MemberLookupFailed): Add argument to
12214 disable the error message when the extended MemberLookup also
12216 (Expression.MemberLookupFinal): Update.
12217 (SimpleName.DoSimpleNameResolve): Update.
12218 * expression.cs (MemberAccess.ResolveNamespaceOrType):
12219 Don't use MemberLookupFinal.
12220 (New.DoResolve): Update.
12221 (BaseAccess.CommonResolve): Update.
12223 2005-02-21 Raja R Harinath <rharinath@novell.com>
12226 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
12227 occured previously, don't resolve again.
12229 2005-02-21 Marek Safar <marek.safar@seznam.cz>
12232 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
12233 argument. Call ResolveAttributeUsage for unresolved.
12234 when types doesn't match ctor arguments.
12236 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
12237 for nested attribute classes.
12238 (Class.attribute_usage): Removed.
12239 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
12240 for attribute class.
12242 * ecore.cs (IsAttribute): Removed.
12244 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
12246 * rootcontext.cs (RegisterAttribute): Removed, attributes are
12248 (attribute_types): Removed.
12249 (EmitCode): Global attributes are emited as the latest.
12251 2005-02-18 Marek Safar <marek.safar@seznam.cz>
12253 * class.cs (EmitFieldInitializers): Don't emit field initializer
12254 for default values when optimilization is on.
12256 * constant.cs (Constant.IsDefaultValue): New property.
12258 * driver.cs: Add /optimize handling.
12262 * literal.cs: Implement new IsDefaultValue property.
12264 * rootcontext.cs (Optimize): New field, holds /optimize option.
12266 2005-02-18 Raja R Harinath <rharinath@novell.com>
12268 Fix crasher in re-opened #72347.
12269 * namespace.cs (Namespace.Lookup): Return null if
12270 DeclSpace.DefineType returns null.
12273 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
12275 2005-02-18 Raja R Harinath <rharinath@novell.com>
12277 Fix remainder of #63202. Change semantics of DoResolveLValue: it
12278 now returns null if it cannot resolve to an lvalue.
12279 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
12280 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
12281 returned null. Remove check for SimpleName.
12282 (EventExpr.DoResolveLValue): New.
12283 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
12284 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
12286 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
12287 avoid CS0131 error.
12288 (Unary.ResolveOperator): Move CS0211 check ...
12289 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
12291 (Unary.DoResolveLValue): Simplify.
12292 (AddressOf.DoResolveLValue): New.
12293 (ArrayAccess.DoResolveLValue): New.
12295 2005-02-16 Marek Safar <marek.safar@seznam.cz>
12297 * attribute.cs (Attribute.Resolve): Add arguments casting for
12298 when types doesn't match ctor arguments.
12300 2005-02-16 Raja R Harinath <rharinath@novell.com>
12302 Fix parts of #63202.
12303 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
12304 lookup of operator in base type. Ensure that all checks happen
12305 when the operator resolves to an "op_..." method.
12307 2005-02-15 Raja R Harinath <rharinath@novell.com>
12310 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
12311 'ignore_cs0104' parameter. Pass it to ...
12312 (NamespaceEntry.Lookup): ... this.
12313 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
12314 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
12315 (TypeLookupExpression.DoResolveAsTypeStep): Update.
12316 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
12317 Update. Request that cs0104 errors be ignored.
12318 (ComposedCast.ResolveAsTypeStep): Update.
12320 2005-02-14 Raja R Harinath <rharinath@novell.com>
12323 * expression.cs (Invocation.BetterFunction): Remove support for
12324 comparing virtual functions and their overrides.
12325 (Invocation.IsOverride): New.
12326 (Invocation.OverloadResolve): Don't consider 'override' functions
12327 during candidate selection. Store them in a lookaside list.
12328 If the selected method is a 'virtual' function, use the list to
12329 find any overrides that are closer to the LHS type.
12331 2005-02-14 Marek Safar <marek.safar@seznam.cz>
12333 * expression.cs (New.DoResolve): Add complex core type reduction.
12334 (New.Constantify): Converts complex core type syntax like 'new int ()'
12335 to simple constant.
12337 2005-02-14 Raja R Harinath <rharinath@novell.com>
12339 * decl.cs (EntryType.EntryType): New constructor to create an
12340 updated copy of a cache entry.
12341 (MemberCache.AddMethods): Use it.
12342 (MemberCache.ClearDeclaredOnly): Remove.
12343 (MemberCache.MemberCache): Update.
12345 2005-02-11 Miguel de Icaza <miguel@novell.com>
12347 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
12348 variable. This one is represents the actual low-level declaration
12349 of the method, as opposed to the semantic level `IsStatic'.
12351 An anonymous method which is hosted into a static method might be
12352 actually an instance method. IsStatic would reflect the
12353 container, while MethodIsStatic represents the actual code
12356 * expression.cs (ParameterReference): Use the new MethodIsStatic
12357 instead of IsStatic.
12359 * anonymous.cs (AnonymousMethod.Compatible): Pass the
12360 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
12361 set on the current EmitContext.
12363 * expression.cs (Cast): Overload DoResolveLValue so we can pass
12364 resolve our casted expression as an LValue. This triggers the
12365 proper LValue processing that is later required by Assign.
12369 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
12371 2005-02-11 Marek Safar <marek.safar@seznam.cz>
12373 C# 2.0 Fixed buffer implementation
12375 * anonymous.cs: Update after RegisterHelperClass renaming.
12377 * attribute.cs (AttributeTester.fixed_buffer_cache):
12378 Cache of external fixed buffers.
12379 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
12380 implementation if field is fixed buffer else null.
12383 (TypeContainer.AddField): Accept FieldMember instead of Field.
12384 (FieldBase.IsFieldClsCompliant): Extracted code from
12385 VerifyClsCompliance descendant customization.
12386 (FixedField): New class handles fixed buffer fields.
12387 (FixedFieldExternal): Keeps information about imported fixed
12389 (IFixedField): Make access to internal or external fixed buffer
12392 * cs-parser.jay: Add fixed buffer parsing.
12394 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
12397 * expression.cs (Indirection): Extended implementation to accept
12398 fixed buffer field.
12399 (PointerArithmetic.Emit): Get element from fixed buffer as well.
12400 (ElementAccess.MakePointerAccess): Get type as parameter.
12401 (DoResolve): Add fixed buffer field expression conversion.
12402 (DoResolveLValue): Ditto.
12403 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
12404 (ArrayPtr): Derives from FixedBufferPtr.
12405 (ArrayPtr.Emit): Add extra emit for array elements.
12407 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
12409 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
12410 for compiler generated types.
12411 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
12413 * statement.cs (Fixed): Refactored to be easier add fixed buffer
12414 and consume less memory.
12415 (Fixed.Resolve): Add fixed buffer case.
12417 * typemanager.cs (compiler_generated_attr_ctor,
12418 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
12419 (HasElementType): Add our own implementation to work on every
12422 2005-02-11 Miguel de Icaza <miguel@novell.com>
12424 * anonymous.cs (CaptureContext): Track whether `this' has been
12427 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
12428 only captured `this' if it was implicitly done (instance
12429 methods/variables were used).
12431 * codegen.cs (EmitContext.CaptureThis): New method to flag that
12432 `this' must be captured.
12434 2005-01-30 Miguel de Icaza <miguel@novell.com>
12436 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
12437 is null it means that there has been no need to capture anything,
12438 so we just create a sibling.
12440 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
12442 Just a partial fix. The other half is fairly elusive.
12444 2005-02-10 Raja R Harinath <rharinath@novell.com>
12446 Fix #52586, cs0121-4.cs.
12447 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
12448 and return a hashtable.
12449 (MemberCache.ClearDeclaredOnly): New.
12450 (MemberCache.MemberCache): Update to change. Make a deep copy of
12451 the method_hash of a base type too.
12452 (MemberCache.AddMethods): Adapt to having a deep copy of the base
12453 type methods. Overwrite entries with the same MethodHandle so
12454 that the ReflectedType is correct. The process leaves in base
12455 virtual functions and their overrides as distinct entries.
12456 (CacheEntry): Now a class instead of a struct. It shouldn't alter
12457 matters since it was boxed in a ArrayList before.
12458 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
12460 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
12461 case of a virtual function and its override (choose the overload
12463 (Invocation.OverloadResolve): Avoid 'override' members during
12464 'applicable_type' calculation.
12466 2005-02-09 Raja R Harinath <rharinath@novell.com>
12468 Combine two near-redundant caches.
12469 * typemanager.cs (method_params): Rename from method_internal_params.
12470 (TypeManager.GetParameterData): New. Replace
12471 Invocation.GetParameterData.
12472 (TypeManager.LookupParametersByBuilder): Remove.
12473 * expression.cs (Invocation.method_parameter_cache): Remove.
12474 (Invocation.GetParameterData): Remove.
12476 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
12479 2005-02-08 Raja R Harinath <rharinath@novell.com>
12482 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
12483 TypeManager.multicast_delegate_type is null, resolve it by looking
12484 up "System.MulticastDelegate".
12485 * rootcontext.cs (RootContext.ResolveCore): Simplify.
12487 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
12488 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
12489 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
12492 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
12493 (LabeledStatement.AddReference): New. Set 'referenced'.
12494 (Goto.Resolve): Use it.
12496 2005-02-05 John Luke <john.luke@gmail.com>
12498 * driver.cs: remove duplicate -doc line in Usage ()
12500 2005-02-04 Raja R Harinath <rharinath@novell.com>
12502 * location.cs (Location.AddFile): Fix CS2002 error report.
12504 2005-02-02 Martin Baulig <martin@ximian.com>
12506 * delegate.cs (Delegate.DefineType): Report an internal error if
12507 TypeManager.multicast_delegate_type is null. See bug #72015 for
12510 2005-02-02 Raja R Harinath <rharinath@novell.com>
12512 Fix a crasher in a variant of #31984.
12513 * const.cs (Constant.CheckBase): New override that defers the
12514 new-or-override check in case the base type hasn't been populated
12516 (Constant.Define): Ensure the new-or-override check is performed.
12518 2005-02-01 Duncan Mak <duncan@ximian.com>
12520 * const.cs (LookupConstantValue): Check that `ce' is not null
12521 before calling GetValue ().
12523 2005-02-01 Raja R Harinath <rharinath@novell.com>
12525 Fix test-334.cs (#69519).
12526 * cs-parser.jay (using_alias_directive): Pass in an expression to
12527 NamespaceEntry.UsingAlias.
12528 (using_namespace_directive): Pass in an expression to
12529 NamespaceEntry.Using.
12530 (namespace_name): Don't flatten to a string.
12531 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
12532 (NamespaceEntry.AliasEntry.Resolve): Lookup using
12534 (NamespaceEntry.UsingEntry): Likewise.
12535 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
12537 (NamespaceEntry.LookupForUsing): Remove.
12538 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
12540 (NamespaceEntry.Lookup): Remove support for dotted names.
12542 2005-02-01 Raja R Harinath <rharinath@novell.com>
12544 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
12546 (NamespaceEntry.ImplicitParent): Compute on demand.
12547 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
12548 parallels the current.
12549 (NamespaceEntry.LookupForUsing): Use it.
12550 (NamespaceEntry.Lookup): If the current namespace-entry is
12551 implicit, don't search aliases and using tables.
12553 2005-02-01 Raja R Harinath <rharinath@novell.com>
12556 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
12558 (TypeContainer.BaseCache): Compute on demand.
12559 (TypeContainer.FindMembers): Define constants and types if they're
12560 not already created.
12561 (FieldMember.Define): Move resetting of ec.InUnsafe before error
12563 * const.cs (Constant.Define): Make idempotent.
12565 2005-01-29 Miguel de Icaza <miguel@novell.com>
12567 * pending.cs: Produce better code (no nops produced by using Ldarg
12570 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
12571 i - 1' it should be arg + 1.
12575 2005-01-28 Raja R Harinath <rharinath@novell.com>
12577 * attribute.cs (Attribute.CheckAttributeType): Make private
12579 (Attribute.ResolveType): Make virtual.
12580 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
12581 handling of RootContext.Tree.Types.
12583 2005-01-27 Raja R Harinath <rharinath@novell.com>
12585 Update attribute-handling to use the SimpleName/MemberAccess
12587 * cs-parser.jay (attribute): Pass in an expression to the
12588 constructors of Attribute and GlobalAttribute.
12589 * attribute.cs (Attribute): Take an expression for the name.
12590 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
12591 passed in attribute name expression.
12592 (Attribute.CheckAttributeType): Use it.
12593 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
12594 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
12595 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
12596 argument to prevent error messages if the lookup fails.
12598 2005-01-27 Marek Safar <marek.safar@seznam.cz>
12600 * expression.cs (Indirection): Implemented IVariable interface
12601 to support indirection in AddressOf operator.
12602 (PointerArithmetic.Emit): Add optimalization for case where
12603 result can be precomputed.
12605 2005-01-26 Martin Baulig <martin@ximian.com>
12607 * class.cs (TypeContainer.AttributeTargets): Return the correct
12608 AttributeTargets depending on our `Kind' instead of throwing an
12609 exception; fixes #71632.
12611 2005-01-26 Marek Safar <marek.safar@seznam.cz>
12614 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
12617 2005-01-25 Raja R Harinath <rharinath@novell.com>
12620 * expression.cs (MemberAccess.DoResolve): Don't complain with
12621 cs0572 when the LHS of a member access has identical name and type
12624 2005-01-25 Marek Safar <marek.safar@seznam.cz>
12627 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
12629 Create custom PermissionSet only for PermissionSetAttribute.
12631 2005-01-24 Marek Safar <marek.safar@seznam.cz>
12634 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
12635 delegates in static class.
12637 2005-01-24 Martin Baulig <martin@ximian.com>
12639 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12640 merging an implicit block, just use its reachability.
12642 * statement.cs (Block.Resolve): Make the unreachable code check
12643 work wrt. implicit blocks; see test-337 from #63842.
12645 2005-01-21 Alp Toker <alp@atoker.com>
12647 * cs-parser.jay: destructor_declaration's container is PartialContainer
12648 not Class when partial types are used, so use Kind prop instead of
12651 2005-01-22 Miguel de Icaza <miguel@ximian.com>
12653 * cs-parser.jay: Improve error reporting when an interface
12654 declares new types.
12656 2005-01-20 Dick Porter <dick@ximian.com>
12658 * support.cs: SeekableStreamReader fix from Sandor Dobos
12659 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
12660 chars are read. Fixes bug 70369.
12662 2005-01-20 Raja R Harinath <rharinath@novell.com>
12664 * cs-parser.jay (catch_clause): Simplify current_block handling
12667 2005-01-17 Miguel de Icaza <miguel@ximian.com>
12669 * convert.cs (ImplicitStandardConversionExists): Synchronize the
12670 code with ImplicitStandardConversion to handle the implicit
12671 conversion of method groups into valid delegate invocations.
12673 The problem is that in parameter handling we were using this code
12674 path. Fixes bug #64698
12676 2005-01-19 Raja R Harinath <rharinath@novell.com>
12678 * cs-parser.jay: Fix several infelicities.
12679 - Avoid assigning to the parser value stack. Code like
12680 '$3 = null' is unclean. Synthesize a value for the code block
12682 - Avoid using oob_stack for storing location information. Use ...
12683 (_mark_): ... this. New (empty) rule. Saves the current location
12685 (foreach_statement): Avoid using oob_stack for current_block
12686 handling. Use technique used in for_statement and
12687 using_statement. Synthesize a value for the code block to store
12688 additional intermediate information.
12690 2005-01-13 Miguel de Icaza <miguel@ximian.com>
12692 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
12693 of a different type is only allowed to private fields of a
12694 containing type, not on fields of a base class.
12696 See test-174.cs and error cs0122-9.cs
12698 2005-01-13 Raja R Harinath <rharinath@novell.com>
12700 Fix test-335.cs (bug #58126).
12701 * cs-parser.jay (argument): Split out non-expression parts of the
12702 rule into 'non_simple_argument'.
12703 (invocation_expression): Support parenthesized invocations with
12704 multiple arguments, and with single non-simple arguments.
12706 2005-01-13 Raja R Harinath <rharinath@novell.com>
12708 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
12711 2005-01-12 Raja R Harinath <rharinath@novell.com>
12713 Fix cs0038-1.cs, cs1640-6.cs.
12714 * ecore.cs (Expression.Resolve): Remove special-case for
12715 SimpleName in error-handling.
12716 (Expression.almostMatchedMembers): Relax access permission to
12718 (Expression.MemberLookupFailed): Handle duplicates in
12719 almostMatchedMembers list.
12720 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
12721 * expression.cs (New.DoResolve): Report CS1540 for more cases.
12722 * typemanager.cs (GetFullNameSignature): Use the MethodBase
12723 overload if the passed in MemberInfo is a MethodBase.
12725 2005-01-12 Marek Safar <marek.safar@seznam.cz>
12728 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
12729 for non-CAS & merge permission sets properly.
12731 2005-01-11 Raja R Harinath <rharinath@novell.com>
12733 Improve standard-compliance of simple name and member access
12734 resolution. Fixes bugs #52697, #57200, #67520, #69519.
12735 * ecore.cs (FullNamedExpression): New abstract base class
12736 for Namespaces and TypeExpressions.
12737 (ResolveFlags.SimpleName): Remove.
12738 (SimpleName): Remove support for dotted names.
12739 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
12740 DeclSpace.FindType and DeclSpace.LookupType.
12741 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
12742 (Expression.ExprClassName): Make member function.
12743 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
12744 a namespace. Remove creation of dotted "SimpleName"s.
12745 (MemberAccess.DoResolve): Likewise.
12746 * decl.cs (DeclSpace.Cache): Make private.
12747 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
12748 (DeclSpace.FindType): Update.
12749 (DeclSpace.LookupType): Move here from RootContext. Return a
12750 FullNamedExpression.
12751 * namespace.cs (Namespace): Derive from FullNamedExpression
12752 so that it can be part of expression resolution.
12753 (Namespace.Lookup): Return an FullNamedExpression.
12754 (NamespaceEntry.LookupAlias): Lookup aliases only in current
12756 * rootcontext.cs (NamespaceLookup): Remove.
12757 (LookupType): Move to DeclSpace.
12758 * attribute.cs (CheckAttributeType): Update.
12759 * doc.cs (FindDocumentedType): Remove allowAlias argument.
12760 (FindDocumentedTypeNonArray): Likewise.
12762 2005-01-11 Raja R Harinath <rharinath@novell.com>
12764 Fix cs0509.cs, cs1632.cs.
12765 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
12766 is the same as IsInterface.
12767 (TypeContainer.GetClassBases): Likewise.
12768 * statement.cs (LabeledStatement.ig): New field.
12769 (LabeledStatement.LabelTarget): Save ILGenerator which created the
12771 (LabeledStatement.DoEmit): Check that the label was created with
12772 the same ILGenerator.
12774 2005-01-10 Marek Safar <marek.safar@seznam.cz>
12777 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
12778 accessors to its properties.
12780 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
12781 from accessors to property.
12783 2005-01-10 Marek Safar <marek.safar@seznam.cz>
12786 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
12787 only for overrides.
12789 2005-01-08 Miguel de Icaza <miguel@ximian.com>
12791 * attribute.cs: Check for null and empty strings.
12793 I have lost another battle to Paolo.
12795 2005-01-07 Marek Safar <marek.safar@seznam.cz>
12798 * class.cs (PropertyMethod): Set Parent field in ctors.
12799 (SetMethod.InternalParameters): Add unsafe switch hack.
12800 Override MarkForDuplicationCheck where it is appropriate.
12802 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
12803 It says whether container allows members with the same name.
12804 Base default is no.
12805 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
12806 Removed is_method parameter.
12808 2005-01-06 Duncan Mak <duncan@ximian.com>
12810 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
12811 because the previous change led to incorrect reporting of CS1032
12812 ("Cannot define/undefine preprocessor symbols after first token in
12813 file"). Instead of using `tokens_seen' as the only flag that
12814 triggers CS1040, introduce `comments_seen'. This new flag is used
12815 to signify having seen comments on the current line, so it is
12816 unset after a newline.
12818 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
12820 * doc.cs : When searching for a type, find nested type too.
12821 This fixes bug #71040.
12823 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
12826 - Warn missing member comment on those classes which also does not
12827 have doc comments. Fixed bug #71041.
12828 - Don't warn missing doc comment on default constructor.
12831 2005-01-06 Duncan Mak <duncan@ximian.com>
12833 * cs-tokenizer.cs (xtoken): After handling traditional C-style
12834 comments, set `tokens_seen' to true. This allows us to detect
12835 misplaced preprocessor directives (i.e. not at the beginning of
12836 the a line, nor after whitespaces). In that case, report error
12837 CS1040. This fixes bug #56460.
12839 * cs-parser.jay (interface_member_declaration): Add checks for
12840 IsExplicitImpl, and report CS0541 error if an interface member is
12841 defined as an explicit interface declaration.
12843 2005-01-06 Marek Safar <marek.safar@seznam.cz>
12846 * class.cs (PropertyMethod): Set Parent field in ctors.
12847 (SetMethod.InternalParameters): Add unsafe switch hack.
12849 * decl.cs (MemberCore.Parent): Cannot be readonly.
12851 2005-01-06 Raja R Harinath <rharinath@novell.com>
12853 * decl.cs (DeclSpace.ResolveType): Remove.
12854 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
12855 Merge in code from ...
12856 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
12857 * class.cs, enum.cs: Update to changes.
12859 2005-01-06 Miguel de Icaza <miguel@ximian.com>
12861 * anonymous.cs: Ensure that we init the scope of our parent if it
12862 has not been initialized yet.
12864 2004-12-30 Duncan Mak <duncan@ximian.com>
12866 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
12867 if field.FieldBuilder is null. Fixes #70758.
12869 * convert.cs: Fixed some typos and updated some of the comments.
12870 (ImplicitStandardConversionExists):
12871 (TryImplicitIntConversion): If `target_type' is an interface and
12872 the type of `ic' implements this interface, return true or a new
12873 BoxedCast instead of null. This fixes #70468.
12875 2004-12-29 Duncan Mak <duncan@ximian.com>
12877 * expression.cs (Argument.Emit): Check that Expr is
12878 IMemoryLocation before casting to it, and report CS1510 otherwise.
12882 2004-12-21 Ben Maurer <bmaurer@ximian.com>
12884 * statement.cs (Block.ThisVariable): remove the recursion here, to
12885 make the --profile more sane.
12887 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
12889 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
12890 assembly, by JB Evain.
12892 2004-12-17 Raja R Harinath <rharinath@novell.com>
12894 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
12895 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
12896 "parent" refers to enclosing type/class. "base" refers to superclass.
12898 2004-12-17 Raja R Harinath <rharinath@novell.com>
12900 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
12901 Ensure that we only have GlobalAttributes.
12902 * attribute.cs (Attribute.Emit): Make non-virtual.
12903 (GlobalAttribute.Emit): Remove.
12904 (Attribute.Resolve): Make virtual.
12905 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
12906 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
12907 the argument. Don't create one.
12908 (Attribute.GetObsoleteAttribute): Likewise.
12909 (Attribute.GetClsCompliantAttributeValue): Likewise.
12910 * class.cs, decl.cs: Update to changes.
12912 2004-12-17 Marek Safar <marek.safar@seznam.cz>
12914 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
12916 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
12918 * statement.cs (Foreach.Resolve): Add error 186 report.
12920 2004-12-16 Marek Safar <marek.safar@seznam.cz>
12922 * expression.cs (Conditional.DoResolve): Add warning 429.
12924 * statement.cs (If.Resolve): Add warning 665.
12926 2004-12-16 Raja R Harinath <rharinath@novell.com>
12928 New invariant: RootContext.Tree.Types.NamespaceEntry == null
12929 except when in the parser, and in GlobalAttribute.
12930 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
12931 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
12932 RootContext.Tree.Types.NamespaceEntry once work is done.
12933 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
12934 and resets RootContext.Tree.Types.NamespaceEntry.
12936 2004-12-15 Marek Safar <marek.safar@seznam.cz>
12938 * cs-parser.jay: Don't create a block for every variable.
12940 2004-12-14 Miguel de Icaza <miguel@ximian.com>
12942 * location.cs: Provide extra information.
12944 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
12945 variables from the captured environment, it is the ldarg_0.
12947 2004-12-14 Marek Safar <marek.safar@seznam.cz>
12949 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
12952 * class.cs: Changed warning level for 169 to avoid developer
12953 displeasure from warning flooding. It will be changed back when they
12954 fix most of current BCL warnings.
12956 * RootContext.cs: Pushed default WarningLevel to 3.
12958 * statement.cs: Removed unused variable.
12960 2004-12-14 Marek Safar <marek.safar@seznam.cz>
12962 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
12963 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
12964 Add error 502 report.
12965 (StaticClass.DefineType): Add error 441 report.
12966 (Class.AllowedModifiersProp): New virtual property as temporary
12967 extension to AllowedModifiers.
12968 (Class.DefineType): Add error 418 report. Moved ModFlags check here
12969 to share implementation with StaticClass and don't call virtual
12972 * driver.cs (MainDriver): Add error 1558 test.
12974 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
12975 report. Moved error 36 test here.
12977 * statement.cs (Throw.Resolve): Add error 724 report.
12979 * typemanager.cs: Add out_attribute_type core type.
12981 2004-12-13 Marek Safar <marek.safar@seznam.cz>
12983 * class.cs (TypeContainer.VerifyClsCompliance): Add error
12985 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
12987 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
12990 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
12992 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
12993 Add error 3023 report.
12994 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
12996 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
12999 2004-12-12 John Luke <john.luke@gmail.com>
13001 * driver.cs (AddArgs): take -- into account when
13002 adding arguments, fixes bug 65710
13004 2004-12-12 Martin Baulig <martin@ximian.com>
13006 * expression.cs (Unary.TryReduceNegative): Added support for
13007 SByteConstant and ByteConstant.
13008 (Unary.Reduce): Check error values from TryReduceNegative().
13010 2004-12-10 Marek Safar <marek.safar@seznam.cz>
13012 * attributes.cs (Attribute.Resolve): Avoid multiple error report
13013 and report exception as error 182.
13015 2004-12-10 Raja R Harinath <rharinath@novell.com>
13017 * driver.cs (Main): Fix message when there are warnings.
13019 2004-12-09 Miguel de Icaza <miguel@ximian.com>
13021 * delegate.cs: Fixed my fix from yesterday, sorry about that.
13023 2004-12-09 Marek Safar <marek.safar@seznam.cz>
13025 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
13026 Reduced number of warnings.
13028 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
13030 2004-12-08 Miguel de Icaza <miguel@ximian.com>
13032 * driver.cs: Removed message.
13034 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
13036 2004-12-08 <vargaz@freemail.hu>
13038 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
13040 2004-12-08 Martin Baulig <martin@ximian.com>
13042 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
13043 instead of a CS3002 for properties and indexer.
13045 2004-12-08 Martin Baulig <martin@ximian.com>
13047 * decl.cs (MemberName.ToString): Make this work again.
13049 2004-12-08 Marek Safar <marek.safar@seznam.cz>
13051 * attribute.cs (Resolve): Add error 591 detection.
13053 * class.cs (FieldMember.Define): Add error 1547 detection.
13054 (Indexer.Define): Add error 620 detection.
13055 (Operator.Define): Add error 590 detection.
13057 * ecore.cs: Missing argument for error 79.
13059 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
13062 2004-12-07 Marek Safar <marek.safar@seznam.cz>
13065 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
13068 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
13070 * cs-parser.jay : handle doc comments on implicit/explicit operators.
13071 Some operator comments were suppressed.
13072 * doc.cs : Implicit/explicit operator name in doc comments are like
13073 "op_Explicit(type)~returnType", so added suffix handling.
13075 2004-12-07 Martin Baulig <martin@ximian.com>
13078 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
13079 (MemberCore.GetClsCompliantAttributeValue): Likewise.
13080 (DeclSpace.ec): New protected field; store the EmitContext here.
13081 (DeclSpace.EmitContext): New public property; moved here from
13083 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
13086 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
13087 (Enum.Emit): Don't create a new EmitContext.
13089 * delegate.cs (Delegate.DefineType): Always create the
13092 * iterators.cs (Iterators.DefineIterator): Create a new
13093 EmitContext and store it in `ec'.
13095 2004-08-24 Martin Baulig <martin@ximian.com>
13098 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
13099 this for accessibility checks.
13100 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
13101 IsNestedFamilyAccessible.
13102 (TypeManager.IsSubclassOf): New method, do what the name actually
13105 2004-12-06 Raja R Harinath <rharinath@novell.com>
13107 Fix crash on cs0657-17.cs.
13108 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13109 Use RootContext.Tree.Types, not 'new RootTypes ()'.
13110 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
13111 the case where the NamespaceEntry gets overwritten.
13113 2004-12-06 Marek Safar <marek.safar@seznam.cz>
13115 Fixed #69195, #56821
13116 * ecore.cs (ResolveBoolean): Tiny refactoring.
13118 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
13119 of right expression resolving when left is false constant and
13120 operator is LogicalAnd OR true constant and operator is LogicalOr.
13122 * statement.cs (ResolveUnreachable): Always reports warning.
13124 2004-12-05 Miguel de Icaza <miguel@ximian.com>
13126 * class.cs: Distinguish between 1721 and 1722 (just a little help
13127 for the programmer).
13129 2004-12-03 Miguel de Icaza <miguel@ximian.com>
13131 * delegate.cs: Only allow this on new versions of the language.
13133 2004-12-02 Duncan Mak <duncan@ximian.com>
13135 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
13137 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
13138 here as a static method. Take an additional bool out parameter
13139 `must_do_cs1540_check' for signaling to InstanceResolve.
13140 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
13141 member field from PropertyExpr class and made it an argument of
13142 the method instead.
13143 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
13144 check for MarshalByRefObject, and report CS0122 instead of CS1540.
13145 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
13146 and `remove_accessor' as well as InstanceResolve: report CS0122
13151 2004-12-03 Raja R Harinath <rharinath@novell.com>
13153 Fix test-327.cs, test-328.cs, and put in early infrastructure
13154 for eventually fixing #52697.
13155 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
13156 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
13157 from other methods.
13158 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
13159 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
13160 (VerifyUsing, error246): Update.
13161 * rootcontext.cs (RootContext.NamespaceLookup): Just use
13162 'NamespaceEntry.LookupNamespaceOrType'.
13164 2004-12-03 Martin Baulig <martin@ximian.com>
13166 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13167 method as our child, call AnonymousMethod.Compatible() on it.
13169 2004-12-03 Raja R Harinath <rharinath@novell.com>
13171 Disable XML documentation support in 'basic' profile.
13172 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
13173 Redirect XmlElement to System.Object.
13174 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
13175 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
13176 * mcs.exe.sources: Add doc-bootstrap.cs.
13177 * doc-bootstrap.cs: New file. Contains empty stub implementation
13180 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
13182 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
13183 comments are allowed.
13185 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
13187 * delegate.cs: Add checks for subtypes in paramaters and return values
13188 in VerifyMethod () to add support for Covariance/Contravariance
13191 2004-12-02 Miguel de Icaza <miguel@ximian.com>
13193 * report.cs: Remove extra closing parenthesis.
13195 * convert.cs (Error_CannotImplicitConversion): If the name of the
13196 types are the same, provide some extra information.
13198 * class.cs (FieldBase): Use an unused bit field from the field to
13199 encode the `has_offset' property from the FieldMember. This saves
13200 a couple of Ks on bootstrap compilation.
13202 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13203 method as our child, return the AnonymousMethod resolved
13206 * expression.cs (New.DoResolve): Allow return values from
13207 NewDelegate to also include AnonymousMethods.
13211 2004-12-02 Marek Safar <marek.safar@seznam.cz>
13214 * attribute.cs (Resolve): Improved implementation of params
13215 attribute arguments.
13217 * support.cs (ParameterData): Add HasParams to be faster.
13219 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
13221 all things are for /doc support:
13223 * doc.cs: new file that supports XML documentation generation.
13224 * mcs.exe.sources: added doc.cs.
13226 Handle /doc command line option.
13227 Report error 2006 instead of 5 for missing file name for /doc.
13228 Generate XML documentation when required, after type resolution.
13230 Added support for picking up documentation (/// and /** ... */),
13231 including a new XmlCommentState enumeration.
13233 Added lines to fill Documentation element for field, constant,
13234 property, indexer, method, constructor, destructor, operator, event
13235 and class, struct, interface, delegate, enum.
13236 Added lines to warn incorrect comment.
13238 Added Documentation field (passed only when /doc was specified).
13240 Added DocComment, DocCommentHeader, GenerateDocComment() and
13241 OnGenerateDocComment() and some supporting private members for
13242 /doc feature to MemberCore.
13244 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
13246 Added overriden DocCommentHeader.
13248 Added overriden DocCommentHeader and GenerateDocComment().
13250 2004-12-01 Miguel de Icaza <miguel@ximian.com>
13252 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
13253 unwrapping the enumeration values, chain to
13254 DoConstantNumericPromotions again, so we can promote things to the
13255 fundamental types (takes care of enums that are bytes, sbytes).
13259 2004-12-01 Raja R Harinath <rharinath@novell.com>
13261 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
13262 Fix long-standing bug in type-lookup. Use FindType instead of
13263 LookupType when ec.ResolvingTypeTree.
13264 (Attribute.ResolveType, Attribute.Resolve)
13265 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
13267 (Attributes.Search): Remove internal version. Update.
13268 (Attributes.SearchMulti): Update.
13269 (Attributes.GetClsCompliantAttribute): Remove.
13270 (Attributes.GetIndexerNameAttribute): Remove.
13271 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
13272 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
13273 * class.cs (Indexer.Define): Likewise.
13275 2004-12-01 Marek Safar <marek.safar@seznam.cz>
13278 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
13279 MarshallByReference members access.
13281 * expression.cs: Use CheckMarshallByRefAccess;
13282 Better error CS0197 message.
13284 * report.cs: Print whole related error message.
13286 2004-11-30 Raja R Harinath <rharinath@novell.com>
13288 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
13289 the current directory to help debugging.
13291 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13293 * class (GetClassBases): Better error 60 report.
13294 (EventProperty): Disabled warning 67 detection.
13296 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13299 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
13301 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
13304 2004-11-29 Marek Safar <marek.safar@seznam.cz>
13307 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
13309 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
13311 2004-11-26 Miguel de Icaza <miguel@ximian.com>
13313 * attribute.cs (Attribute.Resolve): Refine error reporting and
13314 report a cs0117 if the identifier does not exist, to distinguish
13315 from 0617 which is a miss-use of the actual identifier.
13317 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
13318 between cs0070 and cs0079.
13320 * class.cs (MemberBase.DoDefine): When reporting a wrong
13321 accessibility level, we use MethodCore to compare instead of
13322 Method (this was a regression in some refactoring effort).
13324 So now we correctly report cs0056 again.
13326 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
13327 testing the target_type (which was known to be object_type) and
13328 not the source type (which is anonymous_method).
13330 Fixed reporting of error cs1660.
13332 * expression.cs (UserCast.Source): Expose the underlying cast.
13334 * statement.cs (Switch.SwitchGoverningType): Sort the list of
13335 allowed types to find a match to int32 first (most common).
13337 In addition, it ignores any ImplicitUserConversions that did an
13338 internal implicit conversion (as the switch statement allows only
13339 one integral conversion to exist).
13341 * class.cs (PartialContainer.Create): rename `name' to
13342 `member_name' for clarity. Then replace the string calls with a
13343 call to MemberName.GetPartialName, as now using
13344 MemberName.ToString is an error (this is due to the side effects
13345 it had, that were fixed in the past).
13347 This will restore the error reporting on a number of partial class
13348 errors that were missusing this (and getting an exception as a
13349 results, which is now just a plain textual warning, because
13350 yyparse debug output would crash otherwise).
13352 2004-11-26 Raja R Harinath <rharinath@novell.com>
13354 * Makefile (PROGRAM_INSTALL_DIR): Remove.
13356 2004-11-25 Ben Maurer <bmaurer@ximian.com>
13358 * rootcontext.cs (LookupType): Make sure to cache lookups that
13359 don't give us a negative result. This saves about 5% of corlib
13362 2004-11-25 Miguel de Icaza <miguel@ximian.com>
13364 * report.cs (AbstractMessage.Print): messages are sent to stderr
13366 * class.cs (TypeContainer.GetClassBases): It is an error to have a
13367 non-interface in the list of interfaces (at this point, either
13368 parent was properly set, or a base class is being listed in the
13369 interfaces section).
13371 This flags error 1722, and resolves the crash from bug 69259.
13373 2004-11-25 Ben Maurer <bmaurer@ximian.com>
13375 * statement.cs (Using.EmitExpressionFinally): make this work right
13376 for valuetypes. Fixes 69926.
13378 2004-11-25 Miguel de Icaza <miguel@ximian.com>
13380 * const.cs (Const.ChangeType): Cope with the "0 literal can be
13381 converted to an enum" here, before we try to change the underlying
13382 type. This code exists, but it is a different code path than the
13383 one used while encoding constants.
13385 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
13386 old bug: when converting from the null literal to a pointer,
13387 return an EmptyCast, not the NullLiteral.
13389 This fixes #69921, the recent null_type changes probably made this
13390 bug more prominent.
13392 (ImplicitReferenceConversionExists): In addition, resynchronized
13393 the code here, so it matches the same code in
13394 ImplicitReferenceConversionExists for the `from any class-type S
13395 to any interface-type T'.
13398 2004-11-25 Marek Safar <marek.safar@seznam.cz>
13400 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
13402 2004-11-24 Miguel de Icaza <miguel@ximian.com>
13404 * cs-parser.jay: Use verbosity accordingly.
13406 2004-11-24 Marek Safar <marek.safar@seznam.cz>
13408 * expression.cs (Unary.ResolveOperator): Do not report warning;
13409 AddressOf reads from variable.
13411 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
13413 2004-11-24 Marek Safar <marek.safar@seznam.cz>
13417 * attribute.cs (Attributable): Removed CheckTargets.
13418 (Attributes.Emit): Explicit attribute targets are tested here.
13420 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
13421 not enabled for interfaces.
13423 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
13424 (GetAssemblyName): Ouch next bug there.
13426 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
13428 * expression.cs: Error 275 added.
13430 2004-11-23 Marek Safar <marek.safar@seznam.cz>
13432 Fix bug #69177 (Implemented decimal constant support)
13434 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
13435 (BinaryFold): Add DecimalConstant.
13437 * const.cs (Define): Decimal constant
13439 (ChangeType): Add decimal type handling.
13440 (LookupConstantValue): Don't set value for decimal type but
13441 emit DecimalConstantAttribute. Needed for constant optimization.
13443 * constant.cs (ToDecimal): New method.
13444 (ConvertToDecimal): New method.
13445 (IntConstant): Implemented ConvertToDecimal.
13446 (DecimalConstant.Emit): Emit optimized version for decimals in
13449 * expression.cs (ResolveOperator): Changed order of constant
13450 reduction to work correctly with native types which have
13451 overloaded operators.
13452 (ResolveMemberAccess): Extract constant value from attribute
13455 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
13457 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
13458 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
13459 (ChangeType): Decimal is special.
13460 (TypeToCoreType): Add decimal type.
13462 2004-11-22 Marek Safar <marek.safar@seznam.cz>
13464 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
13467 2004-11-22 Marek Safar <marek.safar@seznam.cz>
13469 * class.cs (EventField.ApplyAttributeBuilder): Fix error
13472 2004-11-19 Marek Safar <marek.safar@seznam.cz>
13474 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
13476 * pending.cs (PendingImplementation): Grab only interfaces.
13478 2004-11-19 Marek Safar <marek.safar@seznam.cz>
13480 * statement.cs (ForeachHelperMethods): Add location member and
13481 error 202 detection.
13483 2004-11-19 Raja R Harinath <rharinath@novell.com>
13485 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
13486 automatically handled by executable.make.
13487 (PROGRAM): Make profile-specific.
13489 2004-11-18 Marek Safar <marek.safar@seznam.cz>
13491 * expression.cs (DoResolveBase): Fixed wrong warning for out
13494 2004-11-18 Martin Baulig <martin@ximian.com>
13496 Merged latest changes into gmcs. Please keep this comment in
13497 here, it makes it easier for me to see what changed in MCS since
13498 the last time I merged.
13500 2004-11-17 Raja R Harinath <rharinath@novell.com>
13502 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
13503 (TypeHandle.GetMemberCache): New.
13504 (TypeHandle.TypeHandle): Update.
13505 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
13506 (TypeManager.LookupParentInterfacesCache):
13507 Rename from LookupInterfaceCache. Optimize slightly.
13508 (TypeManager.MemberLookup_FindMembers): Update.
13509 * decl.cs (MemberCache.MemberCache): Set Container to null in the
13510 multi-type variant.
13511 (AddCacheContents): Rename from AddHashtable.
13512 * class.cs (TypeContainer.parent_container): Remove.
13513 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
13514 (TypeContainer.DoDefineMembers): Don't initialize it.
13515 Update to name changes.
13517 2004-11-17 Miguel de Icaza <miguel@ximian.com>
13519 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
13520 that factors the code to check access modifiers on override.
13522 (PropertyBase): Use the code here.
13524 Patch from Lluis S'anchez, fixes bug #69361.
13526 2004-11-15 Miguel de Icaza <miguel@ximian.com>
13528 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
13529 routine that is used to report the use of a captured variable
13530 whose address has been taken.
13532 There are two checks: one when variables are being captured and
13533 the other check is when the address of a variable is taken.
13535 (because an anonymous methods might be resolved before *or* after
13536 the address has been taken) and
13538 * expression.cs (Conditional.DoResolve): Remove the special
13539 casing that Martin added to trueExpr and falseExpr being both
13540 NullLiteral. We get the right behavior now just by introducing
13541 the null_type into the compiler.
13543 * convert.cs (ExplicitConversion): Change the code to use
13544 null_type instead of testing `expr is NullLiteral'.
13545 (ImplicitConversionStandard): use null_type too.
13546 (ImplicitReferenceConversionExists): use null_type too.
13547 (ImplicitReferenceConversion): use null_type too.
13549 * literal.cs: The type of `NullLiteral' is now null_type instead
13551 (Resolve): Set the type here.
13553 * typemanager.cs: Introduce null_type.
13555 2004-11-17 Martin Baulig <martin@ximian.com>
13557 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
13558 direction, like FindMembers() does. Fixes #69546, testcase is in
13561 2004-11-16 Martin Baulig <martin@ximian.com>
13563 This is based on a patch from Marek Safar, see bug #69082.
13564 Fixes bugs #63705 and #67130.
13566 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
13567 method; create a MemberCache for an interface type and cache the
13570 * decl.cs (IMemberContainer.ParentContainer): Removed.
13571 (IMemberContainer.ParentCache): New property.
13572 (MemberCache.SetupCacheForInterface): Removed.
13573 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
13574 to create a cache for an interface's "parent".
13576 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
13579 2004-11-16 Martin Baulig <martin@ximian.com>
13581 Merged back from gmcs; these changes already went into gmcs a
13582 couple of weeks ago.
13585 (TypeManager.AddUserType): Removed the `ifaces' argument.
13586 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
13588 (TypeManager.AddUserInterface): Removed.
13589 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
13591 (TypeManager.GetInterfaces): Likewise.
13592 (TypeManager.GetExplicitInterfaces): Likewise.
13594 * ecore.cs (TypeExpr.GetInterfaces): Removed.
13596 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
13597 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
13599 2004-11-14 Ben Maurer <bmaurer@ximian.com>
13601 * statement.cs: Avoid adding bools to a hashtable.
13603 2004-11-07 Miguel de Icaza <miguel@ximian.com>
13605 * expression.cs (Invocation.OverloadResolve): Flag error if we are
13606 calling an unsafe method from a safe location.
13608 2004-11-06 Marek Safar <marek.safar@seznam.cz>
13611 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
13613 2004-11-06 Miguel de Icaza <miguel@ximian.com>
13615 * namespace.cs (VerifyUsing): use GetPartialName instead of
13618 2004-11-05 Miguel de Icaza <miguel@ximian.com>
13620 * statement.cs (Return.Resolve): Fix regression in typo: if
13621 `in_exc', we have to request a NeedReturnLabel, this was a typo
13622 introduced in the anonymous method check-in. Fixes #69131.
13624 * Indexers were using the ShortName when defining themselves,
13625 causing a regression in the compiler bootstrap when applying the
13626 patch from 2004-11-02 (first part), now they use their full name
13627 and the bug is gone.
13629 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
13631 * driver.cs: Strip the path from the names of embedded resources. Fixes
13634 2004-11-04 Raja R Harinath <rharinath@novell.com>
13636 Fix error message regression: cs0104-2.cs.
13637 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
13638 (AliasEntry.Resolve): Update.
13639 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
13641 (RootContext.LookupType): Update.
13643 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
13645 * cs-parser.jay: Add support for handling accessor modifiers
13646 * class: Add support port accessor modifiers and error checking,
13647 define PropertyMethod.Define as virtual (not abstract anymore)
13648 * ecore.cs: Add checking for proeprties access with access modifiers
13649 * iterators.cs: Modify Accessor constructor call based in the modified
13651 2004-11-02 Ben Maurer <bmaurer@ximian.com>
13653 * expression.cs (StringConcat): Handle being called twice,
13654 as when we have a concat in a field init with more than two
13657 2004-11-02 Miguel de Icaza <miguel@ximian.com>
13659 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
13660 special case explicit implementations, we should always produce
13661 the .property or .event declaration.
13663 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
13664 since it will not return correct data if people use this
13665 unresolved in the presence of using statements (see test-313).
13667 * class.cs (MethodData.Define): If we are an explicit interface
13668 implementation, set the method name to the full name of the
13669 interface plus the name of the method.
13671 Notice that using the method.MethodName.GetFullName() does not
13672 work, as it will only contain the name as declared on the source
13673 file (it can be a shorthand in the presence of using statements)
13674 and not the fully qualifed type name, for example:
13678 class D : ICloneable {
13679 object ICloneable.Clone () {
13683 Would produce a method called `ICloneable.Clone' instead of
13684 `System.ICloneable.Clone'.
13686 * namespace.cs (Alias.Resolve): Use GetPartialName.
13688 2004-11-01 Marek Safar <marek.safar@seznam.cz>
13690 * cs-parser.jay: Add error 1055 report.
13692 2004-11-01 Miguel de Icaza <miguel@ximian.com>
13694 * assign.cs (Assign.DoResolve): Only do the transform of
13695 assignment into a New if the types are compatible, if not, fall
13696 through and let the implicit code deal with the errors and with
13697 the necessary conversions.
13699 2004-11-01 Marek Safar <marek.safar@seznam.cz>
13701 * cs-parser.jay: Add error 1031 report.
13703 * cs-tokenizer.cs: Add location for error 1038.
13705 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13707 * cs-parser.jay: Add error 1016 report.
13709 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13711 * cs-parser.jay: Add errors 1575,1611 report.
13713 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13715 * cs-parser.jay: Add error 1001 report.
13717 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13720 * attribute.cs (GetMarshal): Add method argument for
13721 caller identification.
13723 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
13724 agument for GetMarshal and RuntimeMissingSupport.
13726 2004-10-31 Marek Safar <marek.safar@seznam.cz>
13728 * attribute.cs (ExtractSecurityPermissionSet): Removed
13729 TypeManager.code_access_permission_type.
13731 * typemanager.cs: Removed TypeManager.code_access_permission_type.
13733 2004-10-27 Miguel de Icaza <miguel@ximian.com>
13735 * expression.cs (LocalVariableReference.DoResolveLValue): Check
13736 for obsolete use of a variable here. Fixes regression on errors
13737 cs0619-25 and cs0619-26.
13739 2004-10-27 Marek Safar <marek.safar@seznam.cz>
13741 Fix #62358, implemented security attribute encoding.
13743 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
13744 Tests permitted SecurityAction for assembly or other types.
13745 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
13746 data from SecurityPermissionAttribute to PermisionSet class.
13748 * class.cs (ApplyAttributeBuilder): Added special handling
13749 for System.Security.Permissions.SecurityAttribute based types.
13751 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
13752 special handling for System.Security.Permissions.SecurityAttribute
13755 * enum.cs (ApplyAttributeBuilder): Added special handling
13756 for System.Security.Permissions.SecurityAttribute based types.
13758 * parameter.cs (ApplyAttributeBuilder): Added special handling
13759 for System.Security.Permissions.SecurityAttribute based types.
13761 * rootcontext.cs: Next 2 core types.
13763 * typemanager.cs (TypeManager.security_permission_attr_type):
13764 Built in type for the SecurityPermission Attribute.
13765 (code_access_permission_type): Build in type.
13767 2004-10-17 Miguel de Icaza <miguel@ximian.com>
13769 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
13770 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
13771 all of this information into
13772 EmitContext.EmitCapturedVariableInstance.
13774 * codegen.cs (EmitCapturedVariableInstance): move here the
13775 funcionality of emitting an ldarg.0 in the presence of a
13776 remapping. This centralizes the instance emit code.
13778 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
13779 then emit a load of this: it means that we have reached the
13780 topmost ScopeInfo: the one that contains the pointer to the
13781 instance of the class hosting the anonymous method.
13783 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
13784 captures to the topmost CaptureContext.
13786 2004-10-12 Miguel de Icaza <miguel@ximian.com>
13788 * expression.cs (LocalVariableReference): Move the knowledge about
13789 the iterators into codegen's EmitCapturedVariableInstance.
13791 2004-10-11 Miguel de Icaza <miguel@ximian.com>
13793 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
13794 all code paths return a value from an anonymous method (it is the
13795 same as the 161 error, but for anonymous methods).
13797 2004-10-08 Miguel de Icaza <miguel@ximian.com>
13799 The introduction of anonymous methods in the compiler changed
13800 various ways of doing things in the compiler. The most
13801 significant one is the hard split between the resolution phase
13802 and the emission phases of the compiler.
13804 For instance, routines that referenced local variables no
13805 longer can safely create temporary variables during the
13806 resolution phase: they must do so from the emission phase,
13807 since the variable might have been "captured", hence access to
13808 it can not be done with the local-variable operations from the runtime.
13812 (Block.Flags): New flag `IsTopLevel' to indicate that this block
13813 is a toplevel block.
13815 (ToplevelBlock): A new kind of Block, these are the blocks that
13816 are created by the parser for all toplevel method bodies. These
13817 include methods, accessors and anonymous methods.
13819 These contain some extra information not found in regular blocks:
13820 A pointer to an optional CaptureContext (for tracking captured
13821 local variables and parameters). A pointer to the parent
13824 (Return.Resolve): Catch missmatches when returning a value from an
13825 anonymous method (error 1662).
13826 Invoke NeedReturnLabel from the Resolve phase instead of the emit
13829 (Break.Resolve): ditto.
13831 (SwitchLabel): instead of defining the labels during the
13832 resolution phase, we now turned the public ILLabel and ILLabelCode
13833 labels into methods called GetILLabelCode() and GetILLabel() that
13834 only define the label during the Emit phase.
13836 (GotoCase): Track the SwitchLabel instead of the computed label
13837 (its contained therein). Emit the code by using
13838 SwitchLabel.GetILLabelCode ().
13840 (LocalInfo.Flags.Captured): A new flag has been introduce to track
13841 whether the Local has been captured or not.
13843 (LocalInfo.IsCaptured): New property, used to tell whether the
13844 local has been captured.
13846 * anonymous.cs: Vastly updated to contain the anonymous method
13849 The main classes here are: CaptureContext which tracks any
13850 captured information for a toplevel block and ScopeInfo used to
13851 track the activation frames for various local variables.
13853 Each toplevel block has an optional capture context associated
13854 with it. When a method contains an anonymous method both the
13855 toplevel method and the anonymous method will create a capture
13856 context. When variables or parameters are captured, they are
13857 recorded on the CaptureContext that owns them, for example:
13861 MyDelegate d = delegate {
13866 Here `a' will be recorded as captured on the toplevel
13867 CapturedContext, the inner captured context will not have anything
13868 (it will only have data if local variables or parameters from it
13869 are captured in a nested anonymous method.
13871 The ScopeInfo is used to track the activation frames for local
13872 variables, for example:
13874 for (int i = 0; i < 10; i++)
13875 for (int j = 0; j < 10; j++){
13876 MyDelegate d = delegate {
13881 At runtime this captures a single captured variable `i', but it
13882 captures 10 different versions of the variable `j'. The variable
13883 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
13884 recorded on a child.
13886 The toplevel ScopeInfo will also track information like the `this'
13887 pointer if instance variables were referenced (this is necessary
13888 as the anonymous method lives inside a nested class in the host
13889 type of the method).
13891 (AnonymousMethod): Expanded to track the Toplevel, implement
13892 `AnonymousMethod.Compatible' to tell whether an anonymous method
13893 can be converted to a target delegate type.
13895 The routine now also produces the anonymous method content
13897 (AnonymousDelegate): A helper class that derives from
13898 DelegateCreation, this is used to generate the code necessary to
13899 produce the delegate for the anonymous method that was created.
13901 * assign.cs: API adjustments for new changes in
13902 Convert.ImplicitStandardConversionExists.
13904 * class.cs: Adjustments to cope with the fact that now toplevel
13905 blocks are of type `ToplevelBlock'.
13907 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
13908 insteda of standard blocks.
13910 Flag errors if params arguments are passed to anonymous methods.
13912 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
13913 `CurrentAnonymousMethod' which points to the current Anonymous
13914 Method. The variable points to the AnonymousMethod class that
13915 holds the code being compiled. It is set in the new EmitContext
13916 created for the anonymous method.
13918 (EmitContext.Phase): Introduce a variable and an enumeration to
13919 assist in enforcing some rules about when and where we are allowed
13920 to invoke certain methods (EmitContext.NeedsReturnLabel is the
13921 only one that enfonces this right now).
13923 (EmitContext.HaveCaptureInfo): new helper method that returns
13924 whether we have a CapturedContext initialized.
13926 (EmitContext.CaptureVariable): New method used to register that a
13927 LocalInfo must be flagged for capturing.
13929 (EmitContext.CapturedParameter): New method used to register that a
13930 parameters must be flagged for capturing.
13932 (EmitContext.CapturedField): New method used to register that a
13933 field must be flagged for capturing.
13935 (EmitContext.HaveCapturedVariables,
13936 EmitContext.HaveCapturedFields): Return whether there are captured
13937 variables or fields.
13939 (EmitContext.EmitMethodHostInstance): This is used to emit the
13940 instance for the anonymous method. The instance might be null
13941 (static methods), this (for anonymous methods that capture nothing
13942 and happen to live side-by-side with the current method body) or a
13943 more complicated expression if the method has a CaptureContext.
13945 (EmitContext.EmitTopBlock): Routine that drives the emission of
13946 code: it will first resolve the top block, then emit any metadata
13947 and then emit the code. The split is done so that we can extract
13948 any anonymous methods and flag any captured variables/parameters.
13950 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
13951 during this phase, the ILGenerator should not be used as labels
13952 and local variables declared here might not be accessible to any
13953 code that is part of an anonymous method.
13955 Exceptions to this include the temporary variables that are
13956 created by some statements internally for holding temporary
13959 (EmitContext.EmitMeta): New routine, in charge of emitting all the
13962 (EmitContext.TemporaryReturn): This method is typically called
13963 from the Emit phase, and its the only place where we allow the
13964 ReturnLabel to be defined other than the EmitMeta. The reason is
13965 that otherwise we would have to duplicate a lot of logic in the
13966 Resolve phases of various methods that today is on the Emit
13969 (EmitContext.NeedReturnLabel): This no longer creates the label,
13970 as the ILGenerator is not valid during the resolve phase.
13972 (EmitContext.EmitThis): Extended the knowledge in this class to
13973 work in anonymous methods in addition to iterators.
13975 (EmitContext.EmitCapturedVariableInstance): This emits whatever
13976 code is necessary on the stack to access the instance to a local
13977 variable (the variable will be accessed as a field).
13979 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
13980 EmitContext.EmitAddressOfParameter): Routines to support
13981 parameters (not completed at this point).
13983 Removals: Removed RemapLocal and RemapLocalLValue. We probably
13984 will also remove the parameters.
13986 * convert.cs (Convert): Define a `ConstantEC' which points to a
13987 null. This is just to prefity some code that uses
13988 ImplicitStandardConversion code and do not have an EmitContext
13991 The idea is to flag explicitly that at that point in time, it is
13992 known that the conversion will not trigger the delegate checking
13993 code in implicit conversions (which requires a valid
13996 Everywhere: pass new EmitContext parameter since
13997 ImplicitStandardConversionExists now requires it to check for
13998 anonymous method conversions.
14000 (Convert.ImplicitStandardConversionExists): If the type of an
14001 expression is the anonymous_method_type, and the type is a
14002 delegate, we invoke the AnonymousMethod.Compatible method to check
14003 whether an implicit conversion is possible.
14005 (Convert.ImplicitConversionStandard): Only do implicit method
14006 group conversions if the language level is not ISO_1.
14008 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
14009 MethodInfo for the Invoke method. used by Delegate and
14012 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
14013 method conversions if the target type is a delegate.
14015 Removed extra debugging nops.
14017 (LocalVariableReference): Turn the `local_info' into a public
14020 Add `prepared' field, the same hack used for FieldExprs to cope
14021 with composed assignments, as Local variables do not necessarily
14022 operate purely on the stack as they used to: they can be captured
14025 Add `temp' for a temporary result, like fields.
14027 Refactor DoResolve and DoResolveLValue into DoResolveBase.
14029 It now copes with Local variables that are captured and emits the
14030 proper instance variable to load it from a field in the captured
14033 (ParameterReference.DoResolveBase): During the resolve phase,
14034 capture parameters if we are in an anonymous method.
14036 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
14037 anonymous method, use the EmitContext helper routines to emit the
14038 parameter reference.
14040 * iterators.cs: Set RemapToProxy to true/false during the
14043 * parameters.cs (GetParameterByName): New helper method.
14045 * typemanager.cs (anonymous_method_type) a new type that
14046 represents an anonyous method. This is always an internal type,
14047 used as a fencepost to test against the anonymous-methodness of an
14050 2004-10-20 Marek Safar <marek.safar@seznam.cz>
14052 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
14054 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
14056 2004-10-18 Martin Baulig <martin@ximian.com>
14058 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
14059 `Type' directly, but call ResolveType() on it.
14060 (Catch.Resolve): Likewise.
14061 (Foreach.Resolve): Likewise.
14063 2004-10-18 Martin Baulig <martin@ximian.com>
14065 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
14066 `Type' directly, but call ResolveType() on it.
14067 (Probe.DoResolve): Likewise.
14068 (ArrayCreation.LookupType): Likewise.
14069 (TypeOf.DoResolve): Likewise.
14070 (SizeOf.DoResolve): Likewise.
14072 2004-10-18 Martin Baulig <martin@ximian.com>
14074 * expression.cs (Invocation.BetterFunction): Put back
14075 TypeManager.TypeToCoreType().
14077 2004-10-18 Raja R Harinath <rharinath@novell.com>
14079 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
14082 2004-10-18 Martin Baulig <martin@ximian.com>
14084 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
14085 `Type' directly, but call ResolveType() on it.
14087 2004-10-18 Martin Baulig <martin@ximian.com>
14089 * class.cs (FieldMember.Define): Don't access the TypeExpr's
14090 `Type' directly, but call ResolveType() on it.
14091 (MemberBase.DoDefine): Likewise.
14093 * expression.cs (New.DoResolve): Don't access the TypeExpr's
14094 `Type' directly, but call ResolveType() on it.
14095 (ComposedCast.DoResolveAsTypeStep): Likewise.
14097 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
14098 `Type' directly, but call ResolveType() on it.
14100 2004-10-17 John Luke <john.luke@gmail.com>
14102 * class.cs (Operator.GetSignatureForError): use CSharpName
14104 * parameter.cs (Parameter.GetSignatureForError): Returns
14105 correct name even if was not defined.
14107 2004-10-13 Raja R Harinath <rharinath@novell.com>
14110 * class.cs (TypeContainer.EmitContext): New property.
14111 (DefineNestedTypes): Create an emitcontext for each part.
14112 (MethodCore.DoDefineParameters): Use container's emitcontext.
14113 Pass type array to InternalParameters.
14114 (MemberBase.DoDefine): Use container's emitcontext.
14115 (FieldMember.Define): Likewise.
14116 (Event.Define): Likewise.
14117 (SetMethod.GetParameterInfo): Change argument to EmitContext.
14118 Pass type array to InternalParameters.
14119 (SetIndexerMethod.GetParameterInfo): Likewise.
14120 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
14121 * delegate.cs (Define): Pass emitcontext to
14122 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
14123 array to InternalParameters.
14124 * expression.cs (ParameterReference.DoResolveBase): Pass
14125 emitcontext to GetParameterInfo.
14126 (ComposedCast.DoResolveAsTypeStep): Remove check on
14127 ec.ResolvingTypeTree.
14128 * parameter.cs (Parameter.Resolve): Change argument to
14129 EmitContext. Use ResolveAsTypeTerminal.
14130 (Parameter.GetSignature): Change argument to EmitContext.
14131 (Parameters.ComputeSignature): Likewise.
14132 (Parameters.ComputeParameterTypes): Likewise.
14133 (Parameters.GetParameterInfo): Likewise.
14134 (Parameters.ComputeAndDefineParameterTypes): Likewise.
14135 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
14136 * support.cs (InternalParameters..ctor): Remove variant that takes
14138 * typemanager.cs (system_intptr_expr): New.
14139 (InitExpressionTypes): Initialize it.
14141 2004-10-12 Chris Toshok <toshok@ximian.com>
14143 * cs-parser.jay: fix location for try_statement and catch_clause.
14145 2004-10-11 Martin Baulig <martin@ximian.com>
14147 * report.cs: Don't make --fatal abort on warnings, we have
14148 -warnaserror for that.
14150 2004-10-07 Raja R Harinath <rharinath@novell.com>
14152 More DeclSpace.ResolveType avoidance.
14153 * decl.cs (MemberCore.InUnsafe): New property.
14154 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
14155 with newly created EmitContext.
14156 (FieldMember.Define): Likewise.
14157 * delegate.cs (Delegate.Define): Likewise.
14158 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
14159 only if normal name-lookup fails.
14160 (TypeExpr.DoResolve): Enable error-checking.
14161 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
14162 (SizeOf.DoResolve): Likewise.
14163 (ComposedCast.DoResolveAsTypeStep): Likewise.
14164 (StackAlloc.DoResolve): Likewise.
14165 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
14166 (Block.Unsafe): New property.
14167 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
14168 (Unsafe): Set 'unsafe' flag of contained block.
14169 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
14170 (Fixed.Resolve): Likewise.
14171 (Catch.Resolve): Likewise.
14172 (Using.ResolveLocalVariableDecls): Likewise.
14173 (Foreach.Resolve): Likewise.
14175 2004-10-05 John Luke <john.luke@gmail.com>
14177 * cs-parser.jay: add location to error CS0175
14179 2004-10-04 Miguel de Icaza <miguel@ximian.com>
14181 * ecore.cs (Expression.Constantity): Add support for turning null
14184 * const.cs (Const.Define): Allow constants to be reference types
14185 as long as the value is Null.
14187 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
14189 * namespace.cs (NamespaceEntry.Using): No matter which warning
14190 level is set, check if this namespace name has already been added.
14192 2004-10-03 Ben Maurer <bmaurer@ximian.com>
14194 * expression.cs: reftype [!=]= null should always use br[true,false].
14197 2004-10-03 Marek Safar <marek.safar@seznam.cz>
14200 * attribute.cs: Enum conversion moved to
14201 GetAttributeArgumentExpression to be applied to the all
14204 2004-10-01 Raja R Harinath <rharinath@novell.com>
14206 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
14207 * class.c (TypeContainer.DefineType): Flag error if
14208 base types aren't accessible due to access permissions.
14209 * decl.cs (DeclSpace.ResolveType): Move logic to
14210 Expression.ResolveAsTypeTerminal.
14211 (DeclSpace.ResolveTypeExpr): Thin layer over
14212 Expression.ResolveAsTypeTerminal.
14213 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
14214 Refactor code into NestedAccess. Use it.
14215 (DeclSpace.NestedAccess): New.
14216 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
14217 argument to silence errors. Check access permissions.
14218 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
14219 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
14220 (Cast.DoResolve): Likewise.
14221 (New.DoResolve): Likewise.
14222 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
14223 (TypeOf.DoResolve): Likewise.
14225 * expression.cs (Invocation.BetterConversion): Return the Type of
14226 the better conversion. Implement section 14.4.2.3 more faithfully.
14227 (Invocation.BetterFunction): Make boolean. Make correspondence to
14228 section 14.4.2.2 explicit.
14229 (Invocation.OverloadResolve): Update.
14230 (Invocation): Remove is_base field.
14231 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
14232 (Invocation.Emit): Likewise.
14234 2004-09-27 Raja R Harinath <rharinath@novell.com>
14236 * README: Update to changes.
14238 2004-09-24 Marek Safar <marek.safar@seznam.cz>
14240 * cs-parser.jay: Reverted 642 warning fix.
14242 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14245 * decl.cs (FindMemberWithSameName): Indexer can have more than
14248 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14250 * expression.cs (LocalVariableReference.DoResolveLValue):
14251 Do not report warning 219 for out values.
14252 (EmptyExpression.Null): New member to avoid extra allocations.
14254 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14256 * cs-parser.jay: Fix wrong warning 642 report.
14258 * cs-tokenizer.cs (CheckNextToken): New helper;
14259 Inspect next character if is same as expected.
14261 2004-09-23 Martin Baulig <martin@ximian.com>
14263 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
14264 (Convert.ImplicitReferenceConversionExists): Likewise.
14266 2004-09-23 Marek Safar <marek.safar@seznam.cz>
14268 * class.cs (Operator.Define): Add error 448 and 559 report.
14270 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14272 * class.cs (MemberBase.IsTypePermitted): New protected
14273 method for checking error CS0610.
14275 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14277 * class.cs (TypeContainer.HasExplicitLayout): New property
14278 Returns whether container has StructLayout attribute set Explicit.
14279 (FieldMember): New abstract class for consts and fields.
14280 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
14281 (Field): Reuse FieldMember.
14283 * const.cs (Const): Reuse FieldMember.
14285 * rootcontext.cs: EmitConstants call moved to class.
14287 2004-09-22 Martin Baulig <martin@ximian.com>
14289 Thanks to Peter Sestoft for this bug report.
14291 * expression.cs (Conditional): If both the `trueExpr' and the
14292 `falseExpr' is a NullLiteral, return a NullLiteral.
14294 2004-09-22 Martin Baulig <martin@ximian.com>
14296 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
14297 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
14298 for the "get_Current" call.
14300 2004-09-22 Martin Baulig <martin@ximian.com>
14302 Marek and me just fixed one of our oldest bugs: #28562 :-)
14304 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
14306 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
14307 we're an EnumConstant, just return that.
14308 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
14309 an EnumConstant. In this case, we need to use GetValueAsEnumType()
14310 to get the value which'll actually be written into the attribute.
14311 However, we have to use GetValue() to access the attribute's value
14314 2004-09-22 Marek Safar <marek.safar@seznam.cz>
14316 * constant.cs (Constant.IsNegative): New abstract property
14319 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
14320 (StackAlloc.DoResolve): Reused IsNegative.
14322 2004-09-21 Martin Baulig <martin@ximian.com>
14324 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
14325 if we're used in an iterator, we may be called from different
14328 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
14329 we actually have an exception block.
14331 2004-09-20 John Luke <jluke@cfl.rr.com>
14333 * class.cs, cs-parser.jay: Improve the error report for 1520:
14334 report the actual line where the error happens, not where the
14335 class was declared.
14337 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
14338 Pass location information that was available elsewhere.
14340 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
14342 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
14343 runtime to delay sign assemblies.
14345 2004-09-19 Miguel de Icaza <miguel@ximian.com>
14347 * cs-parser.jay: Do not report the stack trace, this is barely
14350 2004-08-22 John Luke <john.luke@gmail.com>
14352 * driver.cs : check that a resource id is not already used
14353 before adding it, report CS1508 if it is, bug #63637
14355 2004-09-19 Miguel de Icaza <miguel@ximian.com>
14357 * ecore.cs: Removed dead code.
14359 2004-09-18 Marek Safar <marek.safar@seznam.cz>
14361 * class.cs: Do not report warning CS0067 on the interfaces.
14363 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14365 * cs-parser.jay: Add error 504 report.
14367 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14369 * rootcontext.cs: WarningLevel is 4 by default now.
14371 * statement.cs (Fixed.Resolve): Do not null
14374 2004-09-16 Marek Safar <marek.safar@seznam.cz>
14377 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
14378 deep search when property is not virtual.
14379 (PropertyExpr.ResolveAccessors): Make one call for both
14382 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14385 * statement.cs: Error 152 report constains also location.
14387 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14390 * const.cs: Explicitly set constant as static.
14392 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14395 * cs-parser.jay: Add error 1017 report.
14397 2004-09-15 Marek Safar <marek.safar@seznam.cz>
14399 Fixed bug #59980, #64224
14400 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
14402 * typemanager.cs (IsSpecialMethod): Simplified
14404 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14406 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
14407 condition with better params.
14409 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14412 * attribute.cs (Resolve): Property has to have both
14415 2004-09-14 Martin Baulig <martin@ximian.com>
14417 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
14419 2004-09-14 Marek Safar <marek.safar@seznam.cz>
14422 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
14423 called and is obsolete then this member suppress message
14424 when call is inside next [Obsolete] method or type.
14426 * expression.cs: Use TestObsoleteMethodUsage member.
14428 2004-09-14 Martin Baulig <martin@ximian.com>
14430 * cs-parser.jay: Sync a bit with the GMCS version.
14432 2004-09-14 Martin Baulig <martin@ximian.com>
14434 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
14435 (CSharpParser.yacc_verbose_flag): New public field.
14437 * genericparser.cs: Removed.
14439 2004-09-14 Raja R Harinath <rharinath@novell.com>
14441 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
14443 2004-09-13 Marek Safar <marek.safar@seznam.cz>
14445 * class.cs (MethodCore.CheckBase): Fix bug #65757.
14447 2004-09-10 Martin Baulig <martin@ximian.com>
14449 Backported my MemberName changes from GMCS into MCS.
14451 - we are now using a special `MemberName' class instead of using
14452 strings; in GMCS, the `MemberName' also contains the type
14455 - changed the grammar rules a bit:
14456 * the old `member_name' is now a `namespace_or_type_name':
14457 The rule is that we use `namespace_or_type_name' everywhere
14458 where we expect either a "member name" (GetEnumerator) or a
14459 "member name" with an explicit interface name
14460 (IEnumerable.GetEnumerator).
14461 In GMCS, the explicit interface name may include type arguments
14462 (IEnumerable<T>.GetEnumerator).
14463 * we use `member_name' instead of just `IDENTIFIER' for
14465 The rule is that we use `member_name' wherever a member may
14466 have type parameters in GMCS.
14468 * decl.cs (MemberName): New public class.
14469 (MemberCore.MemberName): New public readonly field.
14470 (MemberCore.ctor): Take a `MemberName' argument, not a string.
14471 (DeclSpace): Likewise.
14473 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
14474 * enum.cs (Enum.ctor): Likewise.
14476 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
14478 (AliasEntry.ctor): Take a MemberName, not an Expression.
14479 (AliasEntry.UsingAlias): Likewise.
14481 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
14482 (IMethodData.MemberName): Changed type from string to MemberName.
14483 (MemberBase.ExplicitInterfaceName): Likewise.
14484 (AbstractPropertyEventMethod.SetupName): Make this private.
14485 (AbstractPropertyEventMethod.ctor): Added `string prefix'
14486 argument; compute the member name here.
14487 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
14488 on the `member.MemberName' and the `prefix'.
14490 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
14492 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
14493 thus, we get a `MemberName' instead of a `string'. These
14494 declarations may have type parameters in GMCS.
14495 (interface_method_declaration, delegate_declaration): Likewise.
14496 (class_declaration, interface_declaration): Likewise.
14497 (method_header): Use `namespace_or_type_name' instead of
14498 `member_name'. We may be an explicit interface implementation.
14499 (property_declaration, event_declaration): Likewise.
14500 (member_name): This is now just an `IDENTIFIER', not a
14501 `namespace_or_type_name'.
14502 (type_name, interface_type): Removed.
14503 (namespace_or_type_name): Return a MemberName, not an Expression.
14504 (primary_expression): Use `member_name' instead of `IDENTIFIER';
14505 call GetTypeExpression() on the MemberName to get an expression.
14506 (IndexerDeclaration.interface_type): Changed type from string to
14508 (MakeName): Operate on MemberName's instead of string's.
14510 2004-09-13 Raja R Harinath <rharinath@novell.com>
14513 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
14514 (NamespaceEntry.Lookup): Add new argument to flag if we want the
14515 lookup to avoid symbols introduced by 'using'.
14516 * rootcontext.cs (NamespaceLookup): Update.
14518 2004-09-12 Marek Safar <marek.safar@seznam.cz>
14520 * class.cs (TypeContainer.DoDefineMembers): Do not call
14521 DefineDefaultConstructor for static classes.
14523 2004-09-12 Marek Safar <marek.safar@seznam.cz>
14525 * attribute.cs (Attribute.Resolve): Add error 653 report.
14527 * class.cs (Class.ApplyAttributeBuilder): Add error 641
14529 (Method.ApplyAttributeBuilder): Add error 685 report.
14530 (Operator.Define): Add error 564 report.
14532 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
14534 * expression.cs (Invocation.DoResolve): Add error
14535 245 and 250 report.
14537 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
14540 2004-09-11 Marek Safar <marek.safar@seznam.cz>
14542 * class.cs (ConstructorInitializer.Resolve):
14543 Wrong error number (515->516).
14545 2004-09-11 Marek Safar <marek.safar@seznam.cz>
14547 * class.cs (Indexer.Define): Add error 631 report.
14549 2004-09-11 Marek Safar <marek.safar@seznam.cz>
14551 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
14553 2004-09-11 Marek Safar <marek.safar@seznam.cz>
14555 * expression.cs (Probe.DoResolve): Add error CS0241 report.
14557 2004-09-10 Marek Safar <marek.safar@seznam.cz>
14559 * cs-parser.jay: Added error CS0241 report.
14561 2004-09-10 Raja R Harinath <rharinath@novell.com>
14563 * cs-parser.jay (fixed_statement): Introduce a scope for the
14564 declaration in the 'fixed' statement.
14566 2004-09-09 Marek Safar <marek.safar@seznam.cz>
14568 * cs-parser.jay: Added CS0230 error report.
14570 2004-09-09 Marek Safar <marek.safar@seznam.cz>
14572 * cs-parser.jay: Added errors CS0231 and CS0257 report.
14574 2004-09-09 Marek Safar <marek.safar@seznam.cz>
14576 * expression.cs (Argument.Resolve): Added error CS0192 and
14579 2004-09-09 Marek Safar <marek.safar@seznam.cz>
14581 C# 2.0 #pragma warning feature
14583 * cs-tokenizer.cs (PreProcessPragma): New method;
14584 Handles #pragma directive.
14586 * report.cs (WarningRegions): New class; Support
14587 class for #pragma warning directive. It tests whether
14588 warning is enabled for a given line.
14590 2004-09-08 Miguel de Icaza <miguel@ximian.com>
14592 * const.cs: Add more descriptive error report, tahnks to
14595 2004-09-08 Marek Safar <marek.safar@seznam.cz>
14597 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
14599 2004-09-07 Miguel de Icaza <miguel@ximian.com>
14601 * expression.cs: Apply patch from Ben: Remove dead code from
14602 ArrayCreation, and remove the TurnintoConstant call in const.cs,
14603 as that code just threw an exception anwyays.
14605 * const.cs: Remove the call to the turnintoconstant, for details
14608 * literal.cs: The type of the null-literal is the null type; So
14609 we use a placeholder type (literal.cs:System.Null, defined here)
14612 * expression.cs (Conditional.DoResolve): Remove some old code that
14613 is no longer needed, conversions have been fixed.
14615 (ArrayCreationExpression.DoResolve): Return false if we fail to
14616 resolve the inner expression.
14618 2004-09-07 Raja R Harinath <rharinath@novell.com>
14621 * cs-parser.jay (delegate_declaration): Record a delegate
14622 declaration as a type declaration.
14623 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
14625 2004-09-06 Miguel de Icaza <miguel@ximian.com>
14627 * parameter.cs: Do not crash if the type can not be resolved.
14629 * expression.cs: Report errors with unsafe pointers, fixes #64896
14631 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
14633 * expression.cs: Pointer arith always needs to do a conv.i
14634 if the operand is a long. fix 65320
14636 2004-09-04 Marek Safar <marek.safar@seznam.cz>
14638 Fixed cs0619-37.cs, cs0619-38.cs
14640 * enum.cs (GetObsoleteAttribute): Removed.
14642 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
14643 on Enum member is double staged. The first is tested member
14646 2004-09-04 Marek Safar <marek.safar@seznam.cz>
14648 Fixed #56986, #63631, #65231
14650 * class.cs: (TypeContainer.AddToMemberContainer): New method,
14651 adds member to name container.
14652 (TypeContainer.AddToTypeContainer): New method, adds type to
14654 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
14655 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
14656 AddOperator): Simplified by reusing AddToMemberContainer.
14657 (TypeContainer.UserDefinedStaticConstructor): Changed to property
14659 (Method.CheckForDuplications): Fixed implementation to test all
14661 (MemberBase): Detection whether member is explicit interface
14662 implementation is now in constructor.
14663 (MemberBase.UpdateMemberName): Handles IndexerName.
14664 (Accessor): Changed to keep also location information.
14665 (AbstractPropertyEventMethod): Is derived from MemberCore.
14666 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
14667 will be emited or not.
14668 (PropertyBase.AreAccessorsDuplicateImplementation):
14669 Tests whether accessors are not in collision with some method.
14670 (Operator): Is derived from MethodCore to simplify common
14673 * decl.cs (Flags.TestMethodDuplication): Test for duplication
14675 (DeclSpace.AddToContainer): Adds the member to defined_names
14676 table. It tests for duplications and enclosing name conflicts.
14678 * enum.cs (EnumMember): Clean up to reuse the base structures
14680 2004-09-03 Martin Baulig <martin@ximian.com>
14682 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
14683 into TypeContainer, to make partial classes work again.
14685 2004-09-03 Martin Baulig <martin@ximian.com>
14687 * rootcontext.cs (RootContext.V2): Removed.
14689 2004-03-23 Martin Baulig <martin@ximian.com>
14691 * expression.cs (Invocation.OverloadResolve): Added `bool
14692 may_fail' argument and use it instead of the Location.IsNull() hack.
14694 2004-09-03 Martin Baulig <martin@ximian.com>
14696 Merged latest changes into gmcs. Please keep this comment in
14697 here, it makes it easier for me to see what changed in MCS since
14698 the last time I merged.
14700 2004-09-03 Raja R Harinath <rharinath@novell.com>
14703 * expression.cs (BetterConversion): Don't allow either conversion
14704 to be null. Remove redundant implicit conversion test when 'q ==
14705 null' -- when this function is invoked, we already know that the
14706 implicit conversion exists.
14707 (BetterFunction): Assume that 'best' is non-null. Remove
14708 redundant reimplementation of IsApplicable when 'best' is null.
14709 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
14710 number of arguments.
14711 (IsAncestralType): Extract from OverloadResolve.
14712 (OverloadResolve): Make robust to the MethodGroupExpr being
14713 unsorted. Implement all the logic of Section 14.5.5.1, and
14714 support overloading of methods from multiple applicable types.
14715 Clean up logic somewhat. Don't pass null methods to BetterFunction.
14717 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
14718 (RealError, Warning): Append type of report to related symbol.
14720 2004-09-03 Marek Safar <marek.safar@seznam.cz>
14722 * enum.cs: Fixed CLS-Compliance checks for enum members.
14723 Error tests cs3008-8.cs, cs3014-8.cs
14725 2004-09-02 Marek Safar <marek.safar@seznam.cz>
14727 Fixed bug #62342, #63102
14728 * class.cs: ImplementIndexer uses member.IsExplicitImpl
14729 like ImplementMethod.
14731 2004-09-02 Marek Safar <marek.safar@seznam.cz>
14733 * attribute.cs (Attribute.GetAttributeArgumentExpression):
14736 2004-09-02 Martin Baulig <martin@ximian.com>
14738 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
14739 TypeManager.GetArgumentTypes() rather than calling GetParameters()
14742 2004-09-01 Marek Safar <marek.safar@seznam.cz>
14744 C# 2.0 Static classes implemented
14746 * class.cs (TypeContainer): instance_constructors,
14747 initialized_fields, initialized_static_fields,
14748 default_constructor, base_inteface_types are protected to be
14749 accessible from StaticClass.
14750 (TypeContainer.DefineDefaultConstructor): New virtual method
14751 for custom default constructor generating
14752 (StaticClass): New class to handle "Static classes" feature.
14754 * cs-parser.jay: Handle static keyword on class like instance
14757 * driver.cs: Added "/langversion" command line switch with two
14758 options (iso-1, default).
14760 2004-08-31 Marek Safar <marek.safar@seznam.cz>
14762 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
14764 2004-08-31 Miguel de Icaza <miguel@ximian.com>
14766 * delegate.cs: Style.
14768 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
14770 * delegate.cs: Add seperate instance expr field for miguel.
14772 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
14774 * PointerArithmetic (Resolve): make sure we are not doing
14775 pointer arith on void*. Also, make sure we are resolved
14776 by not setting eclass until resolve.
14778 All callers: Make sure that PointerArithmetic gets resolved.
14780 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
14782 * ArrayCreation (LookupType): If the type does not resolve
14783 to an array, give an error.
14785 2004-08-27 Marek Safar <marek.safar@seznam.cz>
14787 * statement.cs (Try.Resolve): Fixed bug #64222
14789 2004-08-27 Martin Baulig <martin@ximian.com>
14792 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
14795 2004-08-26 Marek Safar <marek.safar@seznam.cz>
14797 * ecore.cs (Constantify): Get underlying type via
14798 System.Enum.GetUnderlyingType to avoid StackOverflow on the
14799 Windows in special cases.
14801 2004-08-26 Marek Safar <marek.safar@seznam.cz>
14803 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
14804 for obtaining also private methods.
14805 (GetRemoveMethod): Used GetRemoveMethod (true)
14806 for obtaining also private methods.
14808 2004-08-24 Martin Baulig <martin@ximian.com>
14810 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
14811 MethodAttributes.HideBySig for operators.
14813 2004-08-23 Martin Baulig <martin@ximian.com>
14815 Back to the old error reporting system :-)
14817 * report.cs (Message): Removed.
14818 (Report.MessageData, ErrorData, WarningData): Removed.
14819 (Report.Error, Warning): Back to the old system.
14821 2004-08-23 Martin Baulig <martin@ximian.com>
14823 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
14825 * class.cs (TypeContainer.ParentContainer): New public virtual
14826 method; replaces the explicit interface implementation.
14827 (ClassPart.ParentContainer): Override.
14829 2004-08-23 Martin Baulig <martin@ximian.com>
14831 * statement.cs (Switch): Added support for constant switches; see
14832 #59428 or test-285.cs.
14834 2004-08-22 Marek Safar <marek.safar@seznam.cz>
14837 * statement.cs (GetEnumeratorFilter): Removed useless
14838 logic because C# specs is strict. GetEnumerator must be
14841 2004-08-22 Martin Baulig <martin@ximian.com>
14843 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
14844 a switch and may break, reset the barrier. Fixes #59867.
14846 2004-08-22 Marek Safar <marek.safar@seznam.cz>
14848 CLS-Compliance speed up (~5% for corlib)
14850 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
14851 New method. Tests container for CLS-Compliant names
14853 * class.cs (TypeContainer.VerifyClsName): New method.
14854 Checks whether container name is CLS Compliant.
14855 (Constructor): Implements IMethodData.
14857 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
14858 low-case table for CLS Compliance test.
14859 (MemberCache.VerifyClsParameterConflict): New method.
14860 Checks method parameters for CS3006 error.
14862 * enum.cs (EnumMember): Is derived from MemberCore.
14863 (Enum.VerifyClsName): Optimized for better performance.
14865 2004-08-06 Marek Safar <marek.safar@seznam.cz>
14867 * report.cs: Renamed Error_T to Error and changed all
14870 2004-08-06 Marek Safar <marek.safar@seznam.cz>
14872 * class.cs (TypeContainer.IndexerArrayList): New inner class
14873 container for indexers.
14874 (TypeContainer.DefaultIndexerName): New constant for default
14875 indexer name. Replaced all "Item" with this constant.
14876 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
14878 * typemanager.cs (TypeManager.default_member_ctor): Cache here
14879 DefaultMemberAttribute constructor.
14881 2004-08-05 Martin Baulig <martin@ximian.com>
14883 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
14886 2004-08-05 Marek Safar <marek.safar@seznam.cz>
14888 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
14889 multi platforms problem.
14891 * compiler.csproj: Included shared files.
14893 2004-08-04 Marek Safar <marek.safar@seznam.cz>
14895 Fix bug 60333, 55971 in the more general way
14896 * attribute.cs (Attribute.GetAttributeArgumentExpression):
14897 Added arg_type argument for constant conversion.
14898 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
14900 2004-08-04 Marek Safar <marek.safar@seznam.cz>
14903 * class.cs (TypeContainer ): New inner classes MethodArrayList,
14904 OperatorArrayList, MethodCoreArrayList for typecontainer
14905 containers. Changed class member types to these new types.
14906 (MethodArrayList.DefineMembers): Added test for CS0659.
14908 2004-08-04 Miguel de Icaza <miguel@ximian.com>
14910 * cfold.cs: Synchronize the folding with the code in expression.cs
14911 Binary.DoNumericPromotions for uint operands.
14913 * attribute.cs: Revert patch from Raja, it introduced a regression
14914 while building Blam-1.2.1 (hard to isolate a test case).
14916 2004-08-04 Marek Safar <marek.safar@seznam.cz>
14920 (TypeContainer.Define): Renamed to DefineContainerMembers because of
14922 (MethodCore.parent_method): New member. The method we're overriding
14923 if this is an override method.
14924 (MethodCore.CheckBase): Moved from Method class and made common.
14925 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
14927 (MethodCore.CheckForDuplications): New abstract method. For custom
14928 member duplication search in a container
14929 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
14930 method and its return type.
14931 (Event.conflict_symbol): New member. Symbol with same name in the
14935 (MemberCache.FindMemberWithSameName): New method. The method
14936 is looking for conflict with inherited symbols.
14938 2004-08-04 Martin Baulig <martin@ximian.com>
14940 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
14942 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
14944 2004-08-03 Marek Safar <marek.safar@seznam.cz>
14946 * report.cs (Message): New enum for better error, warning reference in
14948 (MessageData): New inner abstract class. It generally handles printing of
14949 error and warning messages.
14950 Removed unused Error, Warning, Message methods.
14952 2004-08-03 Marek Safar <marek.safar@seznam.cz>
14954 Fix for cs0592-8.cs test
14956 (Attributable.ValidAttributeTargets): Made public.
14957 (Attribute.ExplicitTarget): New member for explicit target value.
14958 (Attribute.CheckTargets): Now we translate explicit attribute
14959 target to Target here.
14961 2004-08-03 Ben Maurer <bmaurer@ximian.com>
14963 * ecore.cs (MethodGroupExpr): new IsBase property.
14965 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
14967 * delegate.cs (DelegateCreation): store a MethodGroupExpr
14968 rather than an instance expr.
14970 (DelegateCreation.Emit): Use the method group rather than
14971 the instance expression. Also, if you have base.Foo as the
14972 method for a delegate, make sure to emit ldftn, not ldftnvirt.
14974 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
14976 (NewDelegate.DoResolve): Only check for the existance of Invoke
14977 if the method is going to be needed. Use MethodGroupExpr.
14979 (NewDelegate.Emit): Remove, DelegateCreation implements this.
14981 * expression.cs: For pointer arith., make sure to use
14982 the size of the type, not the size of the pointer to
14985 2004-08-03 Marek Safar <marek.safar@seznam.cz>
14988 * class.cs (Class): Added error CS0502 test.
14990 2004-08-03 John Luke <jluke@cfl.rr.com>
14991 Raja R Harinath <rharinath@novell.com>
14994 * attribute.cs (Attribute.complained_before): New flag.
14995 (Attribute.ResolveType, Attribute.Resolve),
14996 (Attribute.DefinePInvokeMethod): Set it.
14997 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
14999 2004-08-03 Martin Baulig <martin@ximian.com>
15001 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
15002 use a user-defined operator; we still need to do numeric
15003 promotions in case one argument is a builtin type and the other
15004 one has an implicit conversion to that type. Fixes #62322.
15006 2004-08-02 Martin Baulig <martin@ximian.com>
15008 * statement.cs (LocalInfo.Flags): Added `IsThis'.
15009 (LocalInfo.IsThis): New public property.
15010 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
15012 2004-08-01 Martin Baulig <martin@ximian.com>
15014 * class.cs (TypeContainer.GetClassBases): Don't set the default
15015 here since we may get called from GetPartialBases().
15016 (TypeContainer.DefineType): If GetClassBases() didn't return a
15017 parent, use the default one.
15019 2004-07-30 Duncan Mak <duncan@ximian.com>
15021 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
15023 2004-07-30 Martin Baulig <martin@ximian.com>
15025 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
15027 * class.cs (SourceMethod): New public class, derive from the
15028 symbol writer's ISourceMethod.
15029 (Method): Use the new symbol writer API.
15031 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
15032 as argument and use the new symbol writer.
15035 (SourceFile): Implement the symbol writer's ISourceFile.
15036 (Location.SymbolDocument): Removed.
15037 (Location.SourceFile): New public property.
15039 * symbolwriter.cs: Use the new symbol writer API.
15041 2004-07-30 Raja R Harinath <rharinath@novell.com>
15043 * Makefile (install-local): Remove. Functionality moved to
15046 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
15048 * Makefile: Install mcs.exe.config file together with mcs.exe.
15049 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
15050 correct runtime version.
15052 2004-07-25 Martin Baulig <martin@ximian.com>
15055 (TypeContainer.RegisterOrder): Removed, this was unused.
15056 (TypeContainer, interface_order): Removed.
15057 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
15058 TypeContainer as argument since we can also be called with a
15059 `PartialContainer' for a partial class/struct/interface.
15060 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
15061 of checking whether we're an `Interface' - we could be a
15062 `PartialContainer'.
15063 (PartialContainer.Register): Override; call
15064 AddClass()/AddStruct()/AddInterface() on our parent.
15066 * cs-parser.jay (interface_member_declaration): Add things to the
15067 `current_container', not the `current_class'.
15069 * rootcontext.cs (RegisterOrder): The overloaded version which
15070 takes an `Interface' was unused, removed.
15072 * typemanager.cs (TypeManager.LookupInterface): Return a
15073 `TypeContainer', not an `Interface'.
15074 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
15075 contain a `PartialContainer' for an interface, so check it's
15076 `Kind' to figure out what it is.
15078 2004-07-25 Martin Baulig <martin@ximian.com>
15080 * class.cs (Class.DefaultTypeAttributes): New public constant.
15081 (Struct.DefaultTypeAttributes): Likewise.
15082 (Interface.DefaultTypeAttributes): Likewise.
15083 (PartialContainer.TypeAttr): Override this and add the
15084 DefaultTypeAttributes.
15086 2004-07-25 Martin Baulig <martin@ximian.com>
15088 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
15089 we can just use the `Parent' field instead.
15091 2004-07-25 Martin Baulig <martin@ximian.com>
15093 * class.cs (TypeContainer.Emit): Renamed to EmitType().
15095 2004-07-25 Martin Baulig <martin@ximian.com>
15097 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
15098 our parts before defining any methods.
15099 (TypeContainer.VerifyImplements): Make this virtual.
15100 (ClassPart.VerifyImplements): Override and call VerifyImplements()
15101 on our PartialContainer.
15103 2004-07-25 Martin Baulig <martin@ximian.com>
15105 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
15107 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
15108 argument, we can just use the `Parent' field instead.
15111 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
15112 (MemberBase.DoDefine): Likewise.
15114 2004-07-24 Martin Baulig <martin@ximian.com>
15116 * decl.cs (MemberCore.Parent): New public field.
15117 (DeclSpace.Parent): Moved to MemberCore.
15119 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
15120 (MemberBase.ctor): Added TypeContainer argument, pass it to our
15122 (FieldBase, Field, Operator): Likewise.
15123 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
15124 (EventField, Event): Likewise.
15126 2004-07-23 Martin Baulig <martin@ximian.com>
15128 * class.cs (PartialContainer): New public class.
15129 (ClassPart): New public class.
15130 (TypeContainer): Added support for partial classes.
15131 (TypeContainer.GetClassBases): Splitted some of the functionality
15132 out into GetNormalBases() and GetPartialBases().
15134 * cs-tokenizer.cs (Token.PARTIAL): New token.
15135 (Tokenizer.consume_identifier): Added some hacks to recognize
15136 `partial', but only if it's immediately followed by `class',
15137 `struct' or `interface'.
15139 * cs-parser.jay: Added support for partial clases.
15141 2004-07-23 Martin Baulig <martin@ximian.com>
15143 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
15144 a `DeclSpace' and also made it readonly.
15145 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
15146 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
15147 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
15149 * cs-parser.jay: Pass the `current_class', not the
15150 `current_container' (at the moment, this is still the same thing)
15151 to a new Method, Property, Event, Indexer or Constructor.
15153 2004-07-23 Martin Baulig <martin@ximian.com>
15155 * cs-parser.jay (CSharpParser): Added a new `current_class' field
15156 and removed the `current_interface' one.
15157 (struct_declaration, class_declaration, interface_declaration):
15158 Set `current_class' to the newly created class/struct/interface;
15159 set their `Bases' and call Register() before parsing their body.
15161 2004-07-23 Martin Baulig <martin@ximian.com>
15163 * class.cs (Kind): New public enum.
15164 (TypeContainer): Made this class abstract.
15165 (TypeContainer.Kind): New public readonly field.
15166 (TypeContainer.CheckDef): New public method; moved here from
15168 (TypeContainer.Register): New public abstract method.
15169 (TypeContainer.GetPendingImplementations): New public abstract
15171 (TypeContainer.GetClassBases): Removed the `is_class' and
15172 `is_iface' parameters.
15173 (TypeContainer.DefineNestedTypes): Formerly known as
15175 (ClassOrStruct): Made this class abstract.
15177 * tree.cs (RootTypes): New public type.
15179 2004-07-20 Martin Baulig <martin@ximian.com>
15181 * tree.cs (Tree.RecordNamespace): Removed.
15182 (Tree.Namespaces): Removed.
15184 * rootcontext.cs (RootContext.IsNamespace): Removed.
15186 * cs-parser.jay (namespace_declaration): Just create a new
15187 NamespaceEntry here.
15189 2004-07-20 Martin Baulig <martin@ximian.com>
15191 * statement.cs (ExceptionStatement): New abstract class. This is
15192 now used as a base class for everyone who's using `finally'.
15193 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
15194 our local variables before using them.
15196 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
15197 virtual method. This is used by Yield.Resolve() to "steal" an
15198 outer block's `finally' clauses.
15199 (FlowBranchingException): The .ctor now takes an ExceptionStatement
15202 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
15203 version which takes an ExceptionStatement. This version must be
15204 used to create exception branchings.
15207 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
15208 (Iterator.EmitMoveNext): Added exception support; protect the
15209 block with a `fault' clause, properly handle 'finally' clauses.
15210 (Iterator.EmitDispose): Run all the `finally' clauses here.
15212 2004-07-20 Martin Baulig <martin@ximian.com>
15214 * iterator.cs: This is the first of a set of changes in the
15215 iterator code. Match the spec more closely: if we're an
15216 IEnumerable, then GetEnumerator() must be called. The first time
15217 GetEnumerator() is called, it returns the current instance; all
15218 subsequent invocations (if any) must create a copy.
15220 2004-07-19 Miguel de Icaza <miguel@ximian.com>
15222 * expression.cs: Resolve the constant expression before returning
15225 2004-07-19 Martin Baulig <martin@ximian.com>
15227 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
15228 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
15229 the return type of the new EmitContext.
15231 2004-07-18 Martin Baulig <martin@ximian.com>
15233 * class.cs (Property.Define): Fix iterators.
15235 * iterators.cs (Iterator.Define): Moved the
15236 `container.AddInterator (this)' call here from the .ctor; only do
15237 it if we resolved successfully.
15239 2004-07-17 Miguel de Icaza <miguel@ximian.com>
15241 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
15242 `true' for preprocessing directives that we parse. The return
15243 value indicates whether we should return to regular tokenizing or
15244 not, not whether it was parsed successfully.
15246 In the past if we were in: #if false ... #line #endif, we would
15247 resume parsing after `#line'. See bug 61604.
15249 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
15250 building: IsEnumType should return true only for enums, not for
15251 enums or System.Enum itself. This fixes #61593.
15253 Likely what happened is that corlib was wrong: mcs depended on
15254 this bug in some places. The bug got fixed, we had to add the
15255 hack, which caused bug 61593.
15257 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
15258 that was a workaround for the older conditions.
15260 2004-07-16 Ben Maurer <bmaurer@ximian.com>
15262 * assign.cs: IAssignMethod has a new interface, as documented
15263 inline. All assignment code now uses this new api.
15265 * ecore.cs, expression.cs: All classes which implement
15266 IAssignMethod now use the new interface.
15268 * expression.cs (Invocation): add a hack to EmitCall so that
15269 IndexerAccess can be the target of a compound assignment without
15270 evaluating its arguments twice.
15272 * statement.cs: Handle changes in Invocation api.
15274 2004-07-16 Martin Baulig <martin@ximian.com>
15276 * iterators.cs: Rewrote this. We're now using one single Proxy
15277 class for both the IEnumerable and the IEnumerator interface and
15278 `Iterator' derives from Class so we can use the high-level API.
15280 * class.cs (TypeContainer.AddIterator): New method.
15281 (TypeContainer.DoDefineType): New protected virtual method, which
15282 is called from DefineType().
15283 (TypeContainer.DoDefineMembers): Call DefineType() and
15284 DefineMembers() on all our iterators.
15285 (TypeContainer.Emit): Call Emit() on all our iterators.
15286 (TypeContainer.CloseType): Call CloseType() on all our iterators.
15288 * codegen.cs (EmitContext.CurrentIterator): New public field.
15290 2004-07-15 Martin Baulig <martin@ximian.com>
15293 (TypeManager.not_supported_exception_type): New type.
15295 2004-07-14 Martin Baulig <martin@ximian.com>
15297 * iterators.cs: Use real error numbers.
15299 2004-07-14 Martin Baulig <martin@ximian.com>
15301 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
15302 requires this to be a System.Collection.IEnumerable and not a
15303 class implementing that interface.
15304 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
15306 2004-07-13 Marek Safar <marek.safar@seznam.cz>
15308 * class.cs: Fixed previous fix, it broke some error tests.
15310 2004-07-12 Martin Baulig <martin@ximian.com>
15312 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
15315 2004-07-09 Miguel de Icaza <miguel@ximian.com>
15317 * assign.cs (LocalTemporary): Add new argument: is_address,If
15318 `is_address' is true, then the value that we store is the address
15319 to the real value, and not the value itself.
15321 * ecore.cs (PropertyExpr): use the new local temporary
15322 stuff to allow us to handle X.Y += z (where X is a struct)
15324 2004-07-08 Martin Baulig <martin@ximian.com>
15326 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
15327 not always return, just like we're doing in Using.Resolve().
15329 2004-07-07 Miguel de Icaza <miguel@ximian.com>
15331 * cs-parser.jay (fixed_statement): flag this as Pinned.
15333 2004-07-06 Miguel de Icaza <miguel@ximian.com>
15335 * typemanager.cs (TypeManager): Removed MakePinned method, this
15336 mechanism is replaced with the .NET 2.x compatible mechanism of
15337 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
15339 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
15340 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
15341 `IsFixed' property which has a different meaning.
15343 2004-07-02 Raja R Harinath <rharinath@novell.com>
15345 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
15346 visible from inside a nested class, not just the names of the
15347 immediately enclosing class.
15348 Fix for bug #60730.
15350 2004-06-24 Raja R Harinath <rharinath@novell.com>
15352 * expression.cs (BetterConversion): Remove buggy special-case
15353 handling of "implicit constant expression conversions". At this
15354 point, we already know that the conversion is possible -- we're
15355 only checking to see which is better.
15357 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15359 * cs-parser.jay: Added error CS0210 test.
15361 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15363 * cs-parser.jay: Added error CS0134 test.
15365 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15368 * cs-parser.jay: Added error CS0145 test.
15370 2004-06-24 Marek Safar <marek.safar@seznam.cz>
15372 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
15374 2004-06-23 Ben Maurer <bmaurer@ximian.com>
15376 * expression.cs (StackAlloc.Resolve): The argument may not
15377 be a constant; deal with this case.
15379 2004-06-23 Marek Safar <marek.safar@seznam.cz>
15381 * attribute.cs (IndexerName_GetIndexerName): Renamed to
15382 GetIndexerAttributeValue.
15383 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
15385 * class.cs (Indexer.Define): Added error tests for CS0415,
15388 2004-06-23 Miguel de Icaza <miguel@ximian.com>
15390 * attribute.cs (Attribute.Resolve): Keep field code in sync with
15393 2004-06-23 Martin Baulig <martin@ximian.com>
15395 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
15396 neither return nor throw, reset the barrier as well. Fixes #60457.
15398 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
15400 * class.cs : EventAttributes is now set to None by default.
15401 This fixes bug #60459.
15403 2004-06-18 Marek Safar <marek.safar@seznam.cz>
15406 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15407 Don't throw exception but return null (it's sufficient now).
15409 2004-06-18 Marek Safar <marek.safar@seznam.cz>
15411 * typemanager.cs (GetArgumentTypes): Faster implementation.
15413 2004-06-18 Martin Baulig <martin@ximian.com>
15415 * attribute.cs (Attribute.Resolve): Check whether we're an
15416 EmptyCast which a Constant child. Fixes #60333.
15418 2004-06-17 Ben Maurer <bmaurer@ximian.com>
15420 * statement.cs (EmitCollectionForeach): Account for the fact that
15421 not all valuetypes are in areas which we can take the address of.
15422 For these variables, we store to a temporary variable. Also, make
15423 sure that we dont emit a `callvirt' on a valuetype method.
15425 2004-06-15 Marek Safar <marek.safar@seznam.cz>
15427 * expression.cs (StackAlloc.DoReSolve): Added test for
15428 negative parameter (CS0247).
15430 2004-06-15 Marek Safar <marek.safar@seznam.cz>
15433 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
15435 2004-06-15 Marek Safar <marek.safar@seznam.cz>
15438 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
15441 2004-06-14 Marek Safar <marek.safar@seznam.cz>
15443 Fix bug #58254 & cs1555.cs, cs1556.cs
15444 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
15446 2004-06-14 Marek Safar <marek.safar@seznam.cz>
15448 * cs-parser.jay: Added error CS1669 test for indexers.
15450 2004-06-11 Martin Baulig <martin@ximian.com>
15452 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
15453 call this twice: for params and varargs methods.
15455 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15458 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
15460 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15462 * attribute.cs (Attribute.GetValidTargets): Made public.
15465 (AbstractPropertyEventMethod): New class for better code sharing.
15466 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
15468 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
15470 2004-06-11 Raja R Harinath <rharinath@novell.com>
15473 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
15474 that the call to Resolve is part of a MemberAccess.
15475 (Expression.Resolve): Use it for SimpleName resolution.
15476 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
15477 Add 'intermediate' boolean argument.
15478 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
15479 error message when the SimpleName can be resolved ambiguously
15480 between an expression and a type.
15481 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
15483 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
15484 call on the left-side.
15486 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15489 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
15491 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15493 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
15495 2004-06-11 Martin Baulig <martin@ximian.com>
15497 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
15498 varargs methods if applicable.
15500 2004-06-11 Martin Baulig <martin@ximian.com>
15502 * expression.cs (Invocation.EmitCall): Don't use
15503 `method.CallingConvention == CallingConventions.VarArgs' since the
15504 method could also have `CallingConventions.HasThis'.
15506 2004-06-11 Marek Safar <marek.safar@seznam.cz>
15508 * class.cs (Event.GetSignatureForError): Implemented.
15509 Fixed crash in error test cs3010.cs
15511 2004-06-10 Miguel de Icaza <miguel@ximian.com>
15513 * cs-tokenizer.cs: Change the way we track __arglist to be
15514 consistent with the other keywords.
15516 2004-06-09 Miguel de Icaza <miguel@ximian.com>
15518 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
15521 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
15523 * codegen.cs: Check that all referenced assemblies have a strongname
15524 before strongnaming the compiled assembly. If not report error CS1577.
15525 Fix bug #56563. Patch by Jackson Harper.
15526 * typemanager.cs: Added a method to return all referenced assemblies.
15527 Fix bug #56563. Patch by Jackson Harper.
15529 2004-06-08 Marek Safar <marek.safar@seznam.cz>
15532 (Method.ApplyAttributeBuilder): Moved and added conditional
15533 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
15536 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
15538 2004-06-08 Marek Safar <marek.safar@seznam.cz>
15541 * class.cs: (EventField.attribute_targets): Changed default target.
15543 2004-06-08 Martin Baulig <martin@ximian.com>
15545 * expression.cs (Invocation.EmitCall): Enable varargs methods.
15547 2004-06-08 Martin Baulig <martin@ximian.com>
15549 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
15551 2004-06-07 Martin Baulig <martin@ximian.com>
15553 Added support for varargs methods.
15555 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
15558 * cs-parser.jay: Added support for `__arglist'.
15560 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
15562 * expression.cs (Argument.AType): Added `ArgList'.
15563 (Invocation): Added support for varargs methods.
15564 (ArglistAccess): New public class.
15565 (Arglist): New public class.
15567 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
15569 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
15570 a method's top-level block if the method has varargs.
15572 * support.cs (ReflectionParameters, InternalParameters): Added
15573 support for varargs methods.
15575 2004-06-07 Miguel de Icaza <miguel@ximian.com>
15577 * class.cs: Provide location in indexer error report.
15579 * driver.cs: Use standard names.
15581 * namespace.cs: Catch the use of using after a namespace has been
15582 declared also on using aliases.
15584 2004-06-03 Raja R Harinath <rharinath@novell.com>
15587 * typemanager.cs (closure_private_ok, closure_invocation_type)
15588 (closure_qualifier_type, closure_invocation_assembly)
15589 (FilterWithClosure): Move to ...
15590 (Closure): New internal nested class.
15591 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
15592 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
15593 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
15594 (MemberLookup, MemberLookupFailed): Use it.
15595 * expression.cs (New.DoResolve): Treat the lookup for the
15596 constructor as being qualified by the 'new'ed type.
15597 (Indexers.GetIndexersForTypeOrInterface): Update.
15599 2004-06-03 Marek Safar <marek.safar@seznam.cz>
15602 (GetConditionalAttributeValue): New method. Returns
15603 condition of ConditionalAttribute.
15604 (SearchMulti): New method. Returns all attributes of type 't'.
15605 Use it when attribute is AllowMultiple = true.
15606 (IsConditionalMethodExcluded): New method.
15609 (Method.IsExcluded): Implemented. Returns true if method has conditional
15610 attribute and the conditions is not defined (method is excluded).
15611 (IMethodData): Extended interface for ConditionalAttribute support.
15612 (PropertyMethod.IsExcluded): Implemented.
15615 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
15618 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
15621 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
15623 * expression.cs (ArrayCreationExpression): Make this just an
15624 `expression'. It can't be a statement, so the code here was
15627 2004-06-02 Marek Safar <marek.safar@seznam.cz>
15630 * typemanager.cs (GetFullNameSignature): New method for
15633 2004-06-02 Marek Safar <marek.safar@seznam.cz>
15636 * class.cs (MemberBase.GetSignatureForError): New virtual method.
15637 Use this method when MethodBuilder is null.
15638 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
15639 Added test for error CS0626 (MONO reports error for this situation).
15640 (IMethodData.GetSignatureForError): Extended interface.
15642 2004-06-01 Marek Safar <marek.safar@seznam.cz>
15645 (AttributeTester.GetObsoleteAttribute): Returns instance of
15646 ObsoleteAttribute when type is obsolete.
15649 (TypeContainer.VerifyObsoleteAttribute): Override.
15650 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
15651 (MethodCode.VerifyObsoleteAttribute): Override.
15652 (MemberBase.VerifyObsoleteAttribute): Override.
15655 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
15656 and report proper error.
15659 Delegate.VerifyObsoleteAttribute): Override.
15662 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
15663 and report proper error.
15664 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
15667 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
15671 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
15672 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
15673 Added test for ObsoleteAttribute.
15676 (Catch): Derived from Statement.
15678 2004-06-01 Marek Safar <marek.safar@seznam.cz>
15680 Fixed bug #59071 & cs0160.cs
15682 * statement.cs (Try.Resolve): Check here whether order of catch
15683 clauses matches their dependencies.
15685 2004-05-31 Miguel de Icaza <miguel@ximian.com>
15687 * Reverted patch to namespace.cs (Use lookuptypedirect). This
15688 caused a regression: #59343. Referencing nested classes from an
15689 assembly stopped working.
15691 2004-05-31 Martin Baulig <martin@ximian.com>
15693 MCS is now frozen for beta 2.
15695 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
15697 * convert.cs: add a trivial cache for overload operator resolution.
15699 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
15701 * decl.cs: If possible, use lookuptypedirect here. We can only do
15702 this if there is no `.' after the namespace. Avoids using
15703 LookupType, which does lots of slow processing.
15704 (FindNestedType) New method, does what it says :-).
15705 * namespace.cs: use LookupTypeDirect.
15706 * rootcontext.cs: use membercache, if possible.
15707 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
15709 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
15712 According to the spec,
15714 In a member access of the form E.I, if E is a single identifier,
15715 and if the meaning of E as a simple-name (§7.5.2) is a constant,
15716 field, property, localvariable, or parameter with the same type as
15717 the meaning of E as a type-name (§3.8), then both possible
15718 meanings of E are permitted.
15720 We did not check that E as a simple-name had the same type as E as
15723 This trivial check gives us 5-7% on bootstrap time.
15725 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
15727 * expression.cs (Invocation.OverloadResolve): Avoid the
15728 use of hashtables and boxing here by allocating on demand.
15730 2004-05-30 Martin Baulig <martin@ximian.com>
15732 * rootcontext.cs (RootContext.LookupType): Don't cache things if
15733 we're doing a silent lookup. Don't try to lookup nested types in
15734 TypeManager.object_type (thanks to Ben Maurer).
15736 2004-05-30 Martin Baulig <martin@ximian.com>
15738 Committing a patch from Ben Maurer.
15740 * rootcontext.cs (RootContext.LookupType): Cache negative results.
15742 2004-05-29 Martin Baulig <martin@ximian.com>
15744 * class.cs (IMethodData.ShouldIgnore): New method.
15746 * typemanager.cs (TypeManager.MethodFlags): Don't take a
15747 `Location' argument, we don't need it anywhere. Use
15748 `IMethodData.ShouldIgnore ()' instead of
15749 `MethodData.GetMethodFlags ()'.
15750 (TypeManager.AddMethod): Removed.
15751 (TypeManager.AddMethod2): Renamed to AddMethod.
15753 2004-05-29 Martin Baulig <martin@ximian.com>
15755 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
15757 * convert.cs (Convert.ImplicitReferenceConversion): If we're
15758 converting from a class type S to an interface type and we already
15759 have an object on the stack, don't box it again. Fixes #52578.
15761 2004-05-29 Martin Baulig <martin@ximian.com>
15763 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15764 Added support for `params' parameters. Fixes #59267.
15766 2004-05-29 Martin Baulig <martin@ximian.com>
15768 * literal.cs (NullPointer): Provide a private .ctor which sets
15769 `type' to TypeManager.object_type. Fixes #59048.
15771 2004-05-29 Martin Baulig <martin@ximian.com>
15773 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
15774 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
15776 * ecore.cs (EventExpr.instance_expr): Make the field private.
15778 2004-05-26 Marek Safar <marek.safar@seznam.cz>
15780 Fixed bug #50080 & cs0214-2.cs
15781 * expression.cs (Cast.DoResolve): Check unsafe context here.
15783 * statement.cs (Resolve.DoResolve): Likewise.
15785 2004-05-26 Martin Baulig <martin@ximian.com>
15787 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
15789 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
15790 (RootContext.LookupType): Pass down the `silent' flag.
15792 2004-05-25 Martin Baulig <martin@ximian.com>
15795 (MethodGroupExpr.IdenticalTypeName): New public property.
15796 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
15797 expression actually refers to a type.
15799 2004-05-25 Martin Baulig <martin@ximian.com>
15801 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
15802 for #56176 and made it actually work.
15804 2004-05-25 Martin Baulig <martin@ximian.com>
15806 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
15807 (FieldExpr, PropertyExpr): Override and implement
15808 CacheTemporaries. Fixes #52279.
15810 2004-05-25 Miguel de Icaza <miguel@ximian.com>
15812 * location.cs: In the new compiler listing a file twice is a
15813 warning, not an error.
15815 2004-05-24 Martin Baulig <martin@ximian.com>
15817 * enum.cs (Enum.DefineType): For the `BaseType' to be a
15818 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
15820 2004-05-24 Martin Baulig <martin@ximian.com>
15822 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
15823 walking the `using' list. Fixes #53921.
15825 2004-05-24 Martin Baulig <martin@ximian.com>
15827 * const.cs (Const.LookupConstantValue): Added support for
15828 EmptyCast's; fixes #55251.
15830 2004-05-24 Martin Baulig <martin@ximian.com>
15832 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
15833 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
15834 which does the CS0135 check. The reason is that we first need to
15835 check whether the variable actually exists.
15837 2004-05-24 Martin Baulig <martin@ximian.com>
15839 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
15840 than RootContext.LookupType() to find the explicit interface
15841 type. Fixes #58584.
15843 2004-05-24 Raja R Harinath <rharinath@novell.com>
15845 * Makefile: Simplify. Use executable.make.
15846 * mcs.exe.sources: New file. List of sources of mcs.exe.
15848 2004-05-24 Anders Carlsson <andersca@gnome.org>
15852 Use the invariant culture when doing String.Compare for CLS case
15855 2004-05-23 Martin Baulig <martin@ximian.com>
15857 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
15858 don't have any dots. Fixes #52622, added cs0246-8.cs.
15860 * namespace.cs (NamespaceEntry.Lookup): Likewise.
15862 2004-05-23 Marek Safar <marek.safar@seznam.cz>
15864 * class.cs (MemberBase.Define): Reuse MemberType member for
15865 resolved type. Other methods can use it too.
15867 2004-05-23 Martin Baulig <martin@ximian.com>
15869 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
15870 the variable also exists in the current block (otherwise, we need
15871 to report a CS0103). Fixes #58670.
15873 2004-05-23 Martin Baulig <martin@ximian.com>
15875 * flowanalysis.cs (Reachability.Reachable): Compute this
15876 on-the-fly rather than storing it as a field.
15878 2004-05-23 Martin Baulig <martin@ximian.com>
15880 * flowanalysis.cs (Reachability.And): Manually compute the
15881 resulting `barrier' from the reachability.
15883 2004-05-23 Marek Safar <marek.safar@seznam.cz>
15886 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
15887 instance of ObsoleteAttribute when symbol is obsolete.
15890 (IMethodData): Extended interface for ObsoleteAttribute support.
15892 2004-05-22 Marek Safar <marek.safar@seznam.cz>
15894 * attribute.cs: Fix bug #55970
15896 2004-05-22 Marek Safar <marek.safar@seznam.cz>
15900 (GetObsoleteAttribute): New method. Creates the instance of
15902 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
15903 ObsoleteAttribute when member is obsolete.
15904 (AttributeTester.Report_ObsoleteMessage): Common method for
15905 Obsolete error/warning reporting.
15908 (TypeContainer.base_classs_type): New member for storing parent type.
15911 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
15912 for this MemberCore.
15914 2004-05-21 Marek Safar <marek.safar@seznam.cz>
15916 * attribute.cs, const.cs: Fix bug #58590
15918 2004-05-21 Martin Baulig <martin@ximian.com>
15920 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
15921 out parameters if the end of the method is unreachable. Fixes
15924 2004-05-21 Marek Safar <marek.safar@seznam.cz>
15926 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
15927 Hari was right, why extra method.
15929 2004-05-21 Marek Safar <marek.safar@seznam.cz>
15931 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
15933 2004-05-20 Martin Baulig <martin@ximian.com>
15935 Merged this back from gmcs to keep the differences to a minumum.
15937 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
15938 instead of a Declspace.
15939 (Attribute.ResolveType): Likewise.
15940 (Attributes.Search): Likewise.
15941 (Attributes.Contains): Likewise.
15942 (Attributes.GetClsCompliantAttribute): Likewise.
15944 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
15946 (MethodData.ApplyAttributes): Take an EmitContext instead of a
15949 2004-05-19 Marek Safar <marek.safar@seznam.cz>
15951 Fix bug #58688 (MCS does not report error when the same attribute
15954 * attribute.cs (Attribute.Emit): Distinction between null and default.
15956 2004-05-19 Raja R Harinath <rharinath@novell.com>
15958 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
15959 of a top-level attribute without an attribute target.
15960 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
15962 (Attribute.Conditional_GetConditionName),
15963 (Attribute.Obsolete_GetObsoleteMessage): Update.
15964 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
15965 part of ScanForIndexerName.
15966 (Attribute.CanIgnoreInvalidAttribute): New function.
15967 (Attribute.ScanForIndexerName): Move to ...
15968 (Attributes.ScanForIndexerName): ... here.
15969 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
15970 (Attributes.Search): New internal variant that can choose not to
15971 complain if types aren't resolved. The original signature now
15973 (Attributes.GetClsCompliantAttribute): Use internal variant, with
15974 complaints suppressed.
15975 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
15976 only if it not useful.
15977 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
15978 top-level for attributes that are shared between the assembly
15979 and a top-level class.
15980 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
15981 * class.cs: Update to reflect changes.
15982 (DefineIndexers): Fuse loops.
15983 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
15984 a couple more variants of attribute names.
15986 2004-05-18 Marek Safar <marek.safar@seznam.cz>
15988 Fix bug #52585 (Implemented explicit attribute declaration)
15991 (Attributable.ValidAttributeTargets): New abstract method. It gets
15992 list of valid attribute targets for explicit target declaration.
15993 (Attribute.Target): It holds target itself.
15994 (AttributeSection): Removed.
15995 (Attribute.CheckTargets): New method. It checks whether attribute
15996 target is valid for the current element.
15999 (EventProperty): New class. For events that are declared like
16000 property (with add and remove accessors).
16001 (EventField): New class. For events that are declared like field.
16004 * cs-parser.jay: Implemented explicit attribute target declaration.
16006 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
16007 Override ValidAttributeTargets.
16010 (ReturnParameter): Class for applying custom attributes on
16012 (ParameterAtribute): New class. Class for applying custom
16013 attributes on the parameter type.
16015 2004-05-17 Miguel de Icaza <miguel@ximian.com>
16017 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
16020 (Method): Allow UNSAFE here.
16022 * modifiers.cs: Support unsafe reporting.
16024 2004-05-17 Marek Safar <marek.safar@seznam.cz>
16026 * decl.cs: Fix bug #58478.
16028 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16030 * statement.cs: When checking for unreachable code on an EmptyStatement,
16031 set the location. Fixes bug #58488.
16033 2004-05-13 Miguel de Icaza <miguel@ximian.com>
16035 * driver.cs: Add -pkg handling.
16037 From Gonzalo: UseShelLExecute=false
16039 2004-05-12 Marek Safar <marek.safar@seznam.cz>
16042 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
16044 (Attribute.IsClsCompliaceRequired): Moved to base for better
16046 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
16047 when attribute is AttributeUsageAttribute.
16048 (Attribute.GetValidTargets): Simplified.
16049 (Attribute.GetAttributeUsage): New method returns AttributeUsage
16050 attribute for this type.
16051 (Attribute.ApplyAttributes): Method renamed to Emit and make
16053 (GlobalAttributeSection): New class for special handling of global
16054 attributes (assembly, module).
16055 (AttributeSection.Emit): New method.
16057 * class.cs: Implemented Attributable abstract methods.
16058 (MethodCore.LabelParameters): Moved to Parameter class.
16059 (Accessor): Is back simple class.
16060 (PropertyMethod): Implemented Attributable abstract class.
16061 (DelegateMethod): Implemented Attributable abstract class.
16062 (Event): New constructor for disctintion between normal Event
16063 and Event with accessors.
16065 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
16067 * codegen.cs, const.cs, decl.cs, delegate.cs:
16068 (CommonAssemblyModulClass): Implemented Attributable abstract class
16071 * enum.cs: Implement IAttributeSupport interface.
16072 (EnumMember): New class for emum members. Implemented Attributable
16076 (ParameterBase): Is abstract.
16077 (ReturnParameter): New class for easier [return:] attribute handling.
16079 * typemanager.cs: Removed builder_to_attr.
16081 2004-05-11 Raja R Harinath <rharinath@novell.com>
16084 * attribute.cs (Attribute.GetPositionalValue): New function.
16085 * class.cs (TypeContainer.VerifyMembers): New function.
16086 (TypeContainer.Emit): Use it.
16087 (ClassOrStruct): New base class for Class and Struct.
16088 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
16089 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
16091 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
16092 then each non-static field should have a FieldOffset attribute.
16093 Otherwise, none of the fields should have a FieldOffset attribute.
16094 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
16095 and FieldOffset attributes.
16096 * typemanager.cs (TypeManager.struct_layout_attribute_type)
16097 (TypeManager.field_offset_attribute_type): New core types.
16098 (TypeManager.InitCoreTypes): Initialize them.
16100 2004-05-11 Michal Moskal <malekith@pld-linux.org>
16102 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
16103 Return correct type.
16106 2004-05-09 Miguel de Icaza <miguel@ximian.com>
16108 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
16109 be implicitly converted to ulong.
16111 * expression.cs: The logic for allowing operator &, | and ^ worked
16112 was wrong, it worked before because we did not report an error in
16113 an else branch. Fixes 57895.
16115 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
16116 allow volatile fields to be reference types.
16118 2004-05-07 Miguel de Icaza <miguel@ximian.com>
16120 * driver.cs: Add support for /debug-
16122 2004-05-07 Raja R Harinath <rharinath@novell.com>
16124 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
16125 Add a 'complain' parameter to silence errors.
16126 (Attribute.Resolve): Update to changes. Put in sanity check to catch
16127 silently overlooked type-resolutions.
16128 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
16129 to reflect changes.
16130 (Attributes.Search): New function.
16131 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
16132 (Attributes.GetAttributeFullName): Remove hack.
16133 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
16134 Update to reflect changes.
16135 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16136 Use Attributes.Search instead of nested loops.
16138 2004-05-07 Marek Safar <marek.safar@seznam.cz>
16141 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
16142 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
16143 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
16145 * report.cs: (Report.Warning): Renamed to Warning_T because of
16146 parameter collision.
16148 2004-05-05 Raja R Harinath <rharinath@novell.com>
16150 * expression.cs (MemberAccess.ResolveMemberAccess):
16151 Exit with non-zero status after Report.Error.
16152 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
16154 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
16156 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
16158 * support.cs: Don't hang when the file is empty.
16160 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
16162 * support.cs: In SeekableStreamReader, compute the preamble size of the
16163 underlying stream. Position changes should take into account that initial
16166 2004-05-03 Todd Berman <tberman@sevenl.net>
16168 * driver.cs: remove unused GetSysVersion function.
16170 2004-05-03 Todd Berman <tberman@sevenl.net>
16172 * driver.cs: Remove the hack from saturday, as well as the hack
16173 from jackson (LoadAssemblyFromGac), also adds the CWD to the
16174 link_paths to get that bit proper.
16176 2004-05-01 Todd Berman <tberman@sevenl.net>
16178 * driver.cs: Try a LoadFrom before a Load, this checks the current
16179 path. This is currently a bug in mono that is be fixed, however, this
16180 provides a workaround for now. This will be removed when the bug
16183 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
16185 * CryptoConvert.cs: Updated to latest version. Fix issue with
16186 incomplete key pairs (#57941).
16188 2004-05-01 Todd Berman <tberman@sevenl.net>
16190 * driver.cs: Remove '.' from path_chars, now System.* loads properly
16193 2004-04-30 Jackson Harper <jackson@ximian.com>
16195 * codegen.cs: Open keys readonly.
16197 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16199 * typemanager.cs: don't report cyclic struct layout when a struct
16200 contains 2 or more fields of the same type. Failed for Pango.AttrShape
16201 which has 2 Pango.Rectangle fields.
16203 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
16205 * expression.cs: Handle IntPtr comparisons with IL code
16206 rather than a method call.
16208 2004-04-29 Martin Baulig <martin@ximian.com>
16210 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
16211 the list of PropertyInfo's in class hierarchy and find the
16212 accessor. Fixes #56013.
16214 2004-04-29 Martin Baulig <martin@ximian.com>
16216 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
16218 2004-04-29 Martin Baulig <martin@ximian.com>
16220 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16222 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
16224 2004-04-29 Martin Baulig <martin@ximian.com>
16226 * class.cs (ConstructorInitializer.Resolve): Check whether the
16227 parent .ctor is accessible. Fixes #52146.
16229 2004-04-29 Martin Baulig <martin@ximian.com>
16231 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16233 * statement.cs (Using.EmitLocalVariableDecls): Use
16234 TypeManager.idisposable_type, not typeof (IDisposable).
16235 (Foreach.EmitCollectionForeach): Added support for valuetypes.
16237 2004-04-29 Martin Baulig <martin@ximian.com>
16239 * class.cs (Event.Define): Don't emit the field and don't set
16240 RTSpecialName and SpecialName for events on interfaces. Fixes
16243 2004-04-29 Raja R Harinath <rharinath@novell.com>
16245 Refactor Attribute.ApplyAttributes.
16246 * attribute.cs (Attributable): New base class for objects that can
16247 have Attributes applied on them.
16248 (Attribute): Make AttributeUsage fields public.
16249 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
16250 (Attribute.IsInternalCall): New property.
16251 (Attribute.UsageAttr): Convert to a public read-only property.
16252 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
16253 (Attribute.ResolveType, Attribute.Resolve)
16254 (Attribute.ScanForIndexerName): Update to reflect changes.
16255 (Attribute.CheckAttributeTarget): Re-format.
16256 (Attribute.ApplyAttributes): Refactor, to various
16257 Attributable.ApplyAttributeBuilder methods.
16258 * decl.cs (MemberCore): Make Attributable.
16259 * class.cs (Accessor): Make Attributable.
16260 (MethodData.ApplyAttributes): Use proper attribute types, not
16262 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
16263 (TypeContainer.ApplyAttributeBuilder)
16264 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
16265 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
16266 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
16267 (Operator.ApplyAttributeBuilder): New factored-out methods.
16268 * const.cs (Const.ApplyAttributeBuilder): Likewise.
16269 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
16270 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
16271 * parameter.cs (ParameterBase): New Attributable base class
16272 that can also represent Return types.
16273 (Parameter): Update to the changes.
16275 2004-04-29 Jackson Harper <jackson@ximian.com>
16277 * driver.cs: Prefer the corlib system version when looking for
16278 assemblies in the GAC. This is still a hack, but its a better hack
16281 2004-04-29 Marek Safar <marek.safar@seznam.cz>
16283 * decl.cs, enum.cs: Improved error 3005 reporting.
16285 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
16286 (related_symbols): New private member for list of symbols
16287 related to reported error/warning.
16289 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
16291 2004-04-29 Martin Baulig <martin@ximian.com>
16293 * ecore.cs (Expression.Constantify): If we're an enum and
16294 TypeManager.TypeToCoreType() doesn't give us another type, use
16295 t.UnderlyingSystemType. Fixes #56178.
16297 2004-04-29 Martin Baulig <martin@ximian.com>
16299 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
16300 interfaces and for each interface, only add members directly
16301 declared in that interface. Fixes #53255.
16303 2004-04-28 Martin Baulig <martin@ximian.com>
16305 * expression.cs (ConditionalLogicalOperator): Use a temporary
16306 variable for `left' to avoid that we evaluate it more than once;
16309 2004-04-28 Martin Baulig <martin@ximian.com>
16311 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
16314 2004-04-28 Martin Baulig <martin@ximian.com>
16316 * statement.cs (LocalInfo.Resolve): Check whether the type is not
16319 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
16320 whether the type is not void (CS1547).
16322 2004-04-28 Martin Baulig <martin@ximian.com>
16324 * expression.cs (Unary.DoResolveLValue): Override this and report
16325 CS0131 for anything but Operator.Indirection.
16327 2004-04-28 Martin Baulig <martin@ximian.com>
16329 Committing a patch from Ben Maurer; see bug #50820.
16331 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16334 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16337 2004-04-28 Martin Baulig <martin@ximian.com>
16339 Committing a patch from Ben Maurer; see bug #50820.
16341 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16344 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16347 2004-04-28 Martin Baulig <martin@ximian.com>
16349 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
16350 (Block.AddLabel): Call DoLookupLabel() to only search in the
16353 2004-04-28 Martin Baulig <martin@ximian.com>
16355 * cfold.cs (ConstantFold.BinaryFold): Added special support for
16356 comparing StringConstants and NullLiterals in Equality and Inequality.
16358 2004-04-28 Jackson Harper <jackson@ximian.com>
16360 * driver.cs: Attempt to load referenced assemblies from the
16361 GAC. This is the quick and dirty version of this method that
16362 doesnt take into account versions and just takes the first
16363 canidate found. Will be good enough for now as we will not have more
16364 then one version installed into the GAC until I update this method.
16366 2004-04-28 Martin Baulig <martin@ximian.com>
16368 * typemanager.cs (TypeManager.CheckStructCycles): New public
16369 static method to check for cycles in the struct layout.
16371 * rootcontext.cs (RootContext.PopulateTypes): Call
16372 TypeManager.CheckStructCycles() for each TypeContainer.
16373 [Note: We only need to visit each type once.]
16375 2004-04-28 Martin Baulig <martin@ximian.com>
16377 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
16379 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
16380 success and added `out object value'. Use a `bool resolved' field
16381 to check whether we've already been called rather than
16382 `ConstantValue != null' since this breaks for NullLiterals.
16384 2004-04-28 Raja R Harinath <rharinath@novell.com>
16386 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
16387 setting of this flag, since the 'set' method may be non-public.
16389 2004-04-28 Raja R Harinath <rharinath@novell.com>
16391 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
16392 check on current_vector.Block.
16394 2004-04-27 Martin Baulig <martin@ximian.com>
16396 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
16397 a field initializer. Fixes #56459.
16399 2004-04-27 Martin Baulig <martin@ximian.com>
16401 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
16402 we're not attempting to use an indexer. Fixes #52154.
16404 2004-04-27 Martin Baulig <martin@ximian.com>
16406 * statement.cs (Return): Don't create a return label if we don't
16407 need it; reverts my change from January 20th. Thanks to Ben
16410 2004-04-27 Martin Baulig <martin@ximian.com>
16412 According to the spec, `goto' can only leave a nested scope, but
16415 * statement.cs (Block.LookupLabel): Only lookup in the current
16416 block, don't recurse into parent or child blocks.
16417 (Block.AddLabel): Check in parent and child blocks, report
16418 CS0140/CS0158 if we find a duplicate.
16419 (Block): Removed this indexer for label lookups.
16420 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
16421 this already does the error reporting for us.
16424 (FlowBranching.UsageVector.Block): New public variable; may be null.
16425 (FlowBranching.CreateSibling): Added `Block' argument.
16426 (FlowBranching.LookupLabel): New public virtual method. Lookup a
16427 label for the target of a `goto' and check whether we're not
16428 leaving a `finally'.
16430 2004-04-27 Martin Baulig <martin@ximian.com>
16432 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16433 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
16436 2004-04-27 Martin Baulig <martin@ximian.com>
16438 * statement.cs (Block.AddLabel): Also check for implicit blocks
16439 and added a CS0158 check.
16441 2004-04-27 Martin Baulig <martin@ximian.com>
16443 * flowanalysis.cs (FlowBranchingLoop): New class.
16444 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
16445 UsageVector's instead of an ArrayList.
16446 (FlowBranching.Label): Likewise.
16447 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
16448 (FlowBranching.AddBreakVector): New method.
16450 2004-04-27 Miguel de Icaza <miguel@ximian.com>
16452 * attribute.cs: Small regression fix: only convert the type if we
16453 the type is different, fixes System.Drawing build.
16455 2004-04-27 Martin Baulig <martin@ximian.com>
16457 * attribute.cs (Attribute.Resolve): If we have a constant value
16458 for a named field or property, implicity convert it to the correct
16461 2004-04-27 Raja R Harinath <rharinath@novell.com>
16463 * statement.cs (Block.Block): Implicit blocks share
16464 'child_variable_names' fields with parent blocks.
16465 (Block.AddChildVariableNames): Remove.
16466 (Block.AddVariable): Mark variable as "used by a child block" in
16467 every surrounding block.
16468 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
16469 been used in a child block, complain about violation of "Invariant
16470 meaning in blocks" rule.
16471 * cs-parser.jay (declare_local_variables): Don't use
16472 AddChildVariableNames.
16473 (foreach_statement): Don't create an implicit block: 'foreach'
16474 introduces a scope.
16476 2004-04-23 Miguel de Icaza <miguel@ximian.com>
16478 * convert.cs (ImplicitNumericConversion): 0 is also positive when
16479 converting from 0L to ulong. Fixes 57522.
16481 2004-04-22 Marek Safar <marek.safar@seznam.cz>
16483 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
16484 derived class hides via 'new' keyword field from base class (test-242.cs).
16485 TODO: Handle this in the more general way.
16487 * class.cs (CheckBase): Ditto.
16489 2004-04-22 Marek Safar <marek.safar@seznam.cz>
16491 * decl.cs (caching_flags): New member for storing cached values
16493 (MemberCore.Flags): New enum where bit flags for caching_flags
16495 (MemberCore.cls_compliance): Moved to caching_flags.
16496 (DeclSpace.Created): Moved to caching_flags.
16498 * class.cs: Use caching_flags instead of DeclSpace.Created
16500 2004-04-21 Miguel de Icaza <miguel@ximian.com>
16502 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
16503 if we are only a derived class, not a nested class.
16505 * typemanager.cs: Same as above, but do this at the MemberLookup
16506 level (used by field and methods, properties are handled in
16507 PropertyExpr). Allow for the qualified access if we are a nested
16510 2004-04-21 Marek Safar <marek.safar@seznam.cz>
16512 * class.cs: Refactoring.
16513 (IMethodData): New inteface; Holds links to parent members
16514 to avoid member duplication (reduced memory allocation).
16515 (Method): Implemented IMethodData interface.
16516 (PropertyBase): New inner classes for get/set methods.
16517 (PropertyBase.PropertyMethod): Implemented IMethodData interface
16518 (Event): New inner classes for add/remove methods.
16519 (Event.DelegateMethod): Implemented IMethodData interface.
16521 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
16522 EmitContext (related to class.cs refactoring).
16524 2004-04-21 Raja R Harinath <rharinath@novell.com>
16526 * delegate.cs (Delegate.VerifyApplicability): If the number of
16527 arguments are the same as the number of parameters, first try to
16528 verify applicability ignoring any 'params' modifier on the last
16532 2004-04-16 Raja R Harinath <rharinath@novell.com>
16534 * class.cs (TypeContainer.AddIndexer): Use
16535 'ExplicitInterfaceName' to determine if interface name was
16536 explicitly specified. 'InterfaceType' is not initialized at this time.
16537 (TypeContainer.DefineIndexers): Remove use of temporary list. The
16538 Indexers array is already in the required order. Initialize
16539 'IndexerName' only if there are normal indexers.
16540 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
16541 (TypeContainer.Emit): Emit DefaultMember attribute only if
16542 IndexerName is initialized.
16545 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
16547 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
16550 2004-04-15 Raja R Harinath <rharinath@novell.com>
16552 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
16556 * attribute.cs (Attribute.Resolve): Check for duplicate named
16560 2004-04-15 Miguel de Icaza <miguel@ximian.com>
16562 * iterators.cs (MarkYield): track whether we are in an exception,
16563 and generate code accordingly. Use a temporary value to store the
16564 result for our state.
16566 I had ignored a bit the interaction of try/catch with iterators
16567 since their behavior was not entirely obvious, but now it is
16568 possible to verify that our behavior is the same as MS .NET 2.0
16572 2004-04-14 Miguel de Icaza <miguel@ximian.com>
16574 * iterators.cs: Avoid creating temporaries if there is no work to
16577 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
16578 Enumerations, use TypeManager.EnumToUnderlying and call
16581 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
16584 (This.Emit): Use EmitContext.EmitThis to emit our
16587 (This.EmitAssign): Ditto.
16589 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
16590 codepaths, we will move all the functionality into
16593 (FieldExpr.EmitAssign): Ditto.
16595 This fixes several hidden bugs that I uncovered while doing a code
16596 review of this today.
16598 * codegen.cs (EmitThis): reworked so the semantics are more clear
16599 and also support value types "this" instances.
16601 * iterators.cs: Changed so that for iterators in value types, we
16602 do not pass the value type as a parameter.
16604 Initialization of the enumerator helpers is now done in the caller
16605 instead of passing the parameters to the constructors and having
16606 the constructor set the fields.
16608 The fields have now `assembly' visibility instead of private.
16610 2004-04-11 Miguel de Icaza <miguel@ximian.com>
16612 * expression.cs (Argument.Resolve): Check if fields passed as ref
16613 or out are contained in a MarshalByRefObject.
16615 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
16616 another compiler type.
16618 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
16620 * class.cs (Indexer.Define): use the new name checking method.
16621 Also, return false on an error.
16622 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
16623 (is_identifier_[start/part]_character): make static.
16625 2004-04-10 Miguel de Icaza <miguel@ximian.com>
16627 * expression.cs (Binary.ResolveOperator): Do no append strings
16628 twice: since we can be invoked more than once (array evaluation)
16629 on the same concatenation, take care of this here. Based on a fix
16630 from Ben (bug #56454)
16632 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
16634 * codegen.cs: Fix another case where CS1548 must be reported (when
16635 delay-sign isn't specified and no private is available #56564). Fix
16636 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
16637 error when MCS is used on the MS runtime and we need to delay-sign
16638 (which seems unsupported by AssemblyBuilder - see #56621).
16640 2004-04-08 Marek Safar <marek.safar@seznam.cz>
16642 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
16643 (TypeManager.ComputeNamespaces): Faster implementation for
16646 * compiler.csproj: Updated AssemblyName to mcs.
16648 2004-04-07 Miguel de Icaza <miguel@ximian.com>
16650 * rootcontext.cs: Add new types to the boot resolution.
16652 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
16653 MulticastDelegate is not allowed.
16655 * typemanager.cs: Add new types to lookup: System.TypedReference
16658 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
16659 check for TypedReference or ArgIterator, they are not allowed.
16661 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
16662 makes us properly catch 1510 in some conditions (see bug 56016 for
16665 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
16667 * CryptoConvert.cs: update from corlib version
16670 2004-04-05 Miguel de Icaza <miguel@ximian.com>
16672 * class.cs (Indexer.Define): Check indexername declaration
16674 2004-04-05 Marek Safar <marek.safar@seznam.cz>
16676 * attribute.cs (IsClsCompliant): Fixed problem with handling
16677 all three states (compliant, not-compliant, undetected).
16679 2004-03-30 Marek Safar <marek.safar@seznam.cz>
16681 * attribute.cs (Attribute): Location is now public.
16682 (Resolve): Store resolved arguments (pos_values) in attribute class.
16683 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
16684 (GetClsCompliantAttributeValue): New method that gets
16685 CLSCompliantAttribute value.
16686 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
16687 if exists else null.
16688 (AttributeTester): New class for CLS-Compliant verification routines.
16690 * class.cs (Emit): Add CLS-Compliant verification.
16691 (Method.GetSignatureForError): Implemented.
16692 (Constructor.GetSignatureForError): Implemented
16693 (Constructor.HasCompliantArgs): Returns if constructor has
16694 CLS-Compliant arguments.
16695 (Constructor.Emit): Override.
16696 (Construcor.IsIdentifierClsCompliant): New method; For constructors
16697 is needed to test only parameters.
16698 (FieldBase.GetSignatureForError): Implemented.
16699 (TypeContainer): New member for storing base interfaces.
16700 (TypeContainer.FindMembers): Search in base interfaces too.
16702 * codegen.cs (GetClsComplianceAttribute): New method that gets
16703 assembly or module CLSCompliantAttribute value.
16704 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
16706 (ModuleClass.Emit): Add error 3012 test.
16708 * const.cs (Emit): Override and call base for CLS-Compliant tests.
16710 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
16711 state for all decl types.
16712 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
16713 if CLS-Compliant tests are required.
16714 (IsClsCompliaceRequired): New method. Analyze whether code
16715 must be CLS-Compliant.
16716 (IsExposedFromAssembly): New method. Returns true when MemberCore
16717 is exposed from assembly.
16718 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
16719 value or gets cached value.
16720 (HasClsCompliantAttribute): New method. Returns true if MemberCore
16721 is explicitly marked with CLSCompliantAttribute.
16722 (IsIdentifierClsCompliant): New abstract method. This method is
16723 used to testing error 3005.
16724 (IsIdentifierAndParamClsCompliant): New method. Common helper method
16725 for identifier and parameters CLS-Compliant testing.
16726 (VerifyClsCompliance): New method. The main virtual method for
16727 CLS-Compliant verifications.
16728 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
16729 null. I don't know why is null (too many public members !).
16730 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
16731 and get value of first CLSCompliantAttribute that found.
16733 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
16734 (VerifyClsCompliance): Override and add extra tests.
16736 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
16737 clscheck- disable CLS-Compliant verification event if assembly is has
16738 CLSCompliantAttribute(true).
16740 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
16741 ApllyAttribute is now called in emit section as in the other cases.
16742 Possible future Emit integration.
16743 (IsIdentifierClsCompliant): New override.
16744 (VerifyClsCompliance): New override.
16745 (GetEnumeratorName): Returns full enum name.
16747 * parameter.cs (GetSignatureForError): Implemented.
16749 * report.cs (WarningData): New struct for Warning message information.
16750 (LocationOfPreviousError): New method.
16751 (Warning): New method. Reports warning based on the warning table.
16752 (Error_T): New method. Reports error based on the error table.
16754 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
16755 verifications are done here.
16757 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
16759 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
16760 CLSCompliantAttribute.
16761 (all_imported_types): New member holds all imported types from other
16763 (LoadAllImportedTypes): New method fills static table with exported types
16764 from all referenced assemblies.
16765 (Modules): New property returns all assembly modules.
16767 2004-03-30 Miguel de Icaza <miguel@ximian.com>
16769 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
16770 throwing a parser error.
16772 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
16773 which removes the hardcoded get_/set_ prefixes for properties, as
16774 IL allows for the properties to be named something else.
16778 * expression.cs: Do not override operand before we know if it is
16779 non-null. Fix 56207
16781 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
16783 * typemanager.cs: support for pinned variables.
16785 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
16787 * decl.cs, typemanager.cs: Avoid using an arraylist
16788 as a buffer if there is only one result set.
16790 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
16792 * expression.cs: Make sure you cant call a static method
16793 with an instance expression, bug #56174.
16795 2004-03-29 Miguel de Icaza <miguel@ximian.com>
16797 * class.cs (IsDuplicateImplementation): Improve error reporting to
16798 flag 663 (method only differs in parameter modifier).
16800 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
16801 in preprocessor directives.
16803 * location.cs (LookupFile): Allow for the empty path.
16805 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
16806 better approach for some of that patch, but its failing with the
16807 CharSet enumeration. For now try/catch will do.
16809 * typemanager.cs: Do not crash if a struct does not have fields.
16812 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
16814 * expression.cs: cs0213, cant fix a fixed expression.
16817 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
16819 * cs-parser.jay: detect invalid embeded statements gracefully.
16822 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
16824 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
16827 the invocation type may not be a subclass of the tye of the item/
16828 The type of the item must be a subclass of the invocation item.
16833 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
16835 * attribute.cs: Added methods to get a string and a bool from an
16836 attribute. Required to information from AssemblyKeyFileAttribute,
16837 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
16838 * codegen.cs: Modified AssemblyName creation to include support for
16839 strongnames. Catch additional exceptions to report them as CS1548.
16840 * compiler.csproj: Updated include CryptoConvert.cs.
16841 * compiler.csproj.user: Removed file - user specific configuration.
16842 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
16843 Mono.Security assembly. The original class is maintained and tested in
16844 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
16845 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
16846 like CSC 8.0 (C# v2) supports.
16847 * Makefile: Added CryptoConvert.cs to mcs sources.
16848 * rootcontext.cs: Added new options for strongnames.
16850 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
16852 * driver.cs: For --expect-error, report error code `2'
16853 if the program compiled with no errors, error code `1' if
16854 it compiled with an error other than the one expected.
16856 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
16858 * compiler.csproj: Updated for Visual Studio .NET 2003.
16859 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
16860 * compiler.sln: Updated for Visual Studio .NET 2003.
16862 2004-03-24 Ravi Pratap M <ravi@ximian.com>
16864 * expression.cs: Fix bug #47234. We basically need to apply the
16865 rule that we prefer the conversion of null to a reference type
16866 when faced with a conversion to 'object' (csc behaviour).
16868 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
16870 * statement.cs: Shorter form for foreach, eliminates
16871 a local variable. r=Martin.
16873 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
16875 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
16876 checks if we can use brtrue/brfalse to test for 0.
16877 * expression.cs: use the above in the test for using brtrue/brfalse.
16878 cleanup code a bit.
16880 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
16882 * expression.cs: Rewrite string concat stuff. Benefits:
16884 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
16885 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
16886 rather than a concat chain.
16888 * typemanager.cs: Add lookups for more concat overloads.
16890 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
16892 * expression.cs: Emit shorter il code for array init.
16909 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
16911 * statement.cs: Before, two switch blocks would be merged if the
16912 total size of the blocks (end_item - begin_item + 1) was less than
16913 two times the combined sizes of the blocks.
16915 Now, it will only merge if after the merge at least half of the
16920 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
16922 * class.cs : csc build fix for GetMethods(). See bug #52503.
16924 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
16926 * expression.cs: Make sure fp comparisons work with NaN.
16927 This fixes bug #54303. Mig approved this patch a long
16928 time ago, but we were not able to test b/c the runtime
16931 2004-03-19 Miguel de Icaza <miguel@ximian.com>
16933 * ecore.cs (TypExpr.GetHashCode): implement this overload.
16935 2004-03-19 Martin Baulig <martin@ximian.com>
16937 * class.cs (MemberCore.IsDuplicateImplementation): Report the
16938 error here and not in our caller.
16940 2004-03-19 Martin Baulig <martin@ximian.com>
16942 * interface.cs: Completely killed this file.
16943 (Interface): We're now a TypeContainer and live in class.cs.
16945 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
16946 argument; we're now also called for interfaces.
16947 (TypeContainer.DefineMembers): Allow this method being called
16949 (TypeContainer.GetMethods): New public method; formerly known as
16950 Interface.GetMethod(). This is used by PendingImplementation.
16951 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
16952 it's now private and non-static.
16953 (Interface): Moved this here; it's now implemented similar to
16955 (Method, Property, Event, Indexer): Added `bool is_interface'
16956 argument to their .ctor's.
16957 (MemberBase.IsInterface): New public field.
16959 * cs-parser.jay: Create normal Method, Property, Event, Indexer
16960 instances instead of InterfaceMethod, InterfaceProperty, etc.
16961 (opt_interface_base): Removed; we now use `opt_class_base' instead.
16962 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
16964 2004-03-19 Martin Baulig <martin@ximian.com>
16966 * class.cs (MethodCore.IsDuplicateImplementation): New private
16967 method which does the CS0111 checking.
16968 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
16969 Use IsDuplicateImplementation().
16971 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
16973 * decl.cs (FindMemberToOverride): New method to find the correct
16974 method or property to override in the base class.
16976 - Make Method/Property use the above method to find the
16977 version in the base class.
16978 - Remove the InheritableMemberSignatureCompare as it is now
16981 This patch makes large code bases much faster to compile, as it is
16982 O(n) rather than O(n^2) to do this validation.
16984 Also, it fixes bug 52458 which is that nested classes are not
16985 taken into account when finding the base class member.
16987 Reviewed/Approved by Martin.
16989 2004-03-17 Marek Safar <marek.safar@seznam.cz>
16991 * interface.cs: In all interface classes removed redundant
16992 member initialization.
16994 2004-03-16 Martin Baulig <martin@ximian.com>
16996 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
16998 2004-03-15 Miguel de Icaza <miguel@ximian.com>
17000 * decl.cs (DefineTypeAndParents): New helper method to define a
17001 type's containers before the type itself is defined; This is a
17002 bug exposed by the recent changes to Windows.Forms when an
17003 implemented interface was defined inside a class that had not been
17006 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
17008 (Check): Loop correctly to report errors modifiers
17009 (UNSAFE was not in the loop, since it was the same as TOP).
17011 * interface.cs: Every interface member now takes a ModFlags,
17012 instead of a "is_new" bool, which we set on the base MemberCore.
17014 Every place where we called "UnsafeOk" in the interface, now we
17015 call the proper member (InterfaceMethod.UnsafeOK) instead to get
17016 the unsafe settings from the member declaration instead of the
17017 container interface.
17019 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
17021 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
17022 `set_indexer_name' to the pending bits (one per type).
17024 We fixed a bug today that was picking the wrong method to
17025 override, since for properties the existing InterfaceMethod code
17026 basically ignored the method name. Now we make sure that the
17027 method name is one of the valid indexer names.
17029 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
17031 * support.cs (SeekableStreamReader): Keep track of stream byte
17032 positions and don't mix them with character offsets to the buffer.
17034 Patch from Gustavo Giráldez
17036 2004-03-15 Marek Safar <marek.safar@seznam.cz>
17038 * interface.cs (InterfaceSetGetBase): Removed double member
17039 initialization, base class does it as well.
17041 2004-03-13 Martin Baulig <martin@ximian.com>
17043 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
17044 when compiling corlib.
17046 2004-03-13 Miguel de Icaza <miguel@ximian.com>
17048 * convert.cs (ExplicitConversion): We were reporting an error on
17049 certain conversions (object_type source to a value type, when the
17050 expression was `null') before we had a chance to pass it through
17051 the user defined conversions.
17053 * driver.cs: Replace / and \ in resource specifications to dots.
17056 * class.cs: Add check for duplicate operators. Fixes 52477
17058 2004-03-11 Miguel de Icaza <miguel@ximian.com>
17060 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
17061 that are in the middle of the statements, not only at the end.
17064 * class.cs (TypeContainer.AddField): No longer set the
17065 `HaveStaticConstructor' flag, now we call it
17066 `UserDefineStaticConstructor' to diferentiate the slightly
17067 semantic difference.
17069 The situation is that we were not adding BeforeFieldInit (from
17070 Modifiers.TypeAttr) to classes that could have it.
17071 BeforeFieldInit should be set to classes that have no static
17076 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
17078 And most importantly Zoltan's comment:
17080 http://bugzilla.ximian.com/show_bug.cgi?id=44229
17082 "I think beforefieldinit means 'it's ok to initialize the type sometime
17083 before its static fields are used', i.e. initialization does not need
17084 to be triggered by the first access to the type. Setting this flag
17085 helps the JIT to compile better code, since it can run the static
17086 constructor at JIT time, and does not need to generate code to call it
17087 (possibly lots of times) at runtime. Unfortunately, mcs does not set
17088 this flag for lots of classes like String.
17090 csc sets this flag if the type does not have an explicit static
17091 constructor. The reasoning seems to be that if there are only static
17092 initalizers for a type, and no static constructor, then the programmer
17093 does not care when this initialization happens, so beforefieldinit
17096 This bug prevents the AOT compiler from being usable, since it
17097 generates so many calls to mono_runtime_class_init that the AOT code
17098 is much slower than the JITted code. The JITted code is faster,
17099 because it does not generate these calls if the vtable is type is
17100 already initialized, which is true in the majority of cases. But the
17101 AOT compiler can't do this."
17103 2004-03-10 Miguel de Icaza <miguel@ximian.com>
17105 * class.cs (MethodData.Emit): Refactor the code so symbolic
17106 information is generated for destructors; For some reasons we
17107 were taking a code path that did not generate symbolic information
17110 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
17112 * class.cs: Create a Constructor.CheckBase method that
17113 takes care of all validation type code. The method
17114 contains some code that was moved from Define.
17116 It also includes new code that checks for duplicate ctors.
17117 This fixes bug #55148.
17119 2004-03-09 Joshua Tauberer <tauberer@for.net>
17121 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
17122 a { ... }-style array creation invokes EmitStaticInitializers
17123 which is not good for reference-type arrays. String, decimal
17124 and now null constants (NullCast) are not counted toward
17125 static initializers.
17127 2004-03-05 Martin Baulig <martin@ximian.com>
17129 * location.cs (SourceFile.HasLineDirective): New public field;
17130 specifies whether the file contains or is referenced by a "#line"
17132 (Location.DefineSymbolDocuments): Ignore source files which
17133 either contain or are referenced by a "#line" directive.
17135 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
17137 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
17138 direct access to our parent, so check the method inline there.
17140 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
17142 * expression.cs (Invocation.EmitCall): Miguel's last commit
17143 caused a regression. If you had:
17148 In Foo the implict this would be null.
17150 2004-02-27 Miguel de Icaza <miguel@ximian.com>
17152 * expression.cs (Invocation.EmitCall): If the method is not
17153 virtual, do not emit a CallVirt to it, use Call.
17155 * typemanager.cs (GetFullNameSignature): Improve the method to
17156 cope with ".ctor" and replace it with the type name.
17158 * class.cs (ConstructorInitializer.Resolve): Now the method takes
17159 as an argument the ConstructorBuilder where it is being defined,
17160 to catch the recursive constructor invocations.
17162 2004-02-26 Miguel de Icaza <miguel@ximian.com>
17164 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
17165 routines to check if a type is an enumerable/enumerator allow
17166 classes that implement the IEnumerable or IEnumerator interfaces.
17168 * class.cs (Property, Operator): Implement IIteratorContainer, and
17169 implement SetYields.
17171 (Property.Define): Do the block swapping for get_methods in the
17172 context of iterators. We need to check if Properties also
17173 include indexers or not.
17175 (Operator): Assign the Block before invoking the
17176 OperatorMethod.Define, so we can trigger the Iterator code
17179 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
17180 Property and Operator classes are not created when we parse the
17181 declarator but until we have the block completed, so we use a
17182 singleton SimpleIteratorContainer.Simple to flag whether the
17183 SetYields has been invoked.
17185 We propagate this setting then to the Property or the Operator to
17186 allow the `yield' to function.
17188 2004-02-25 Marek Safar <marek.safar@seznam.cz>
17190 * codegen.cs: Implemented attribute support for modules.
17191 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
17192 Assembly/Module functionality.
17194 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
17195 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
17196 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
17198 2004-02-16 Marek Safar <marek.safar@seznam.cz>
17200 * interface.cs (FindMembers): The operation is performed on all base
17201 interfaces and not only on the first. It is required for future CLS Compliance patch.
17203 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
17205 * statement.cs, codegen.cs:
17206 This patch deals with patterns such as:
17208 public class List : IEnumerable {
17210 public MyEnumerator GetEnumerator () {
17211 return new MyEnumerator(this);
17214 IEnumerator IEnumerable.GetEnumerator () {
17218 public struct MyEnumerator : IEnumerator {
17223 Before, there were a few things we did wrong:
17224 1) we would emit callvirt on a struct, which is illegal
17225 2) we emited ldarg when we needed to emit ldarga
17226 3) we would mistakenly call the interface methods on an enumerator
17227 type that derived from IEnumerator and was in another assembly. For example:
17229 public class MyEnumerator : IEnumerator
17231 Would have the interface methods called, even if there were public impls of the
17232 method. In a struct, this lead to invalid IL code.
17234 2004-02-11 Marek Safar <marek.safar@seznam.cz>
17236 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
17239 * delegate.cs (Define): Fixed crash when delegate type is undefined.
17241 2004-02-11 Miguel de Icaza <miguel@ximian.com>
17243 * cs-parser.jay: Fix small regression: we were not testing V2
17244 compiler features correctly.
17246 * interface.cs: If the emit context is null, then create one
17248 2004-02-09 Marek Safar <marek.safar@seznam.cz>
17250 * decl.cs (GetSignatureForError): New virtual method to get full name
17251 for error messages.
17253 * attribute.cs (IAttributeSupport): New interface for attribute setting.
17254 Now it is possible to rewrite ApplyAttributes method to be less if/else.
17256 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
17257 Duplicated members and code in these classes has been removed.
17258 Better encapsulation in these classes.
17260 2004-02-07 Miguel de Icaza <miguel@ximian.com>
17262 * assign.cs (Assign.DoResolve): When dealing with compound
17263 assignments, there is a new rule in ECMA C# 2.4 (might have been
17264 there before, but it is documented here) that states that in:
17268 If b is of type int, and the `op' is a shift-operator, then the
17269 above is evaluated as:
17273 * expression.cs (Binary.ResolveOperator): Instead of testing for
17274 int/uint/long/ulong, try to implicitly convert to any of those
17275 types and use that in pointer arithmetic.
17277 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
17278 method to print information for from the type, not from the
17279 null-method we were given.
17281 2004-02-01 Duncan Mak <duncan@ximian.com>
17283 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
17284 parsing for cmd, fixes bug #53694.
17286 2004-02-04 Marek Safar <marek.safar@seznam.cz>
17288 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
17289 in the member name duplication tests. Property and operator name duplication
17290 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
17292 2004-02-03 Marek Safar <marek.safar@seznam.cz>
17294 * interface.cs (PopulateMethod): Fixed crash when interface method
17295 returns not existing type (error test cs0246-3.cs).
17297 2004-02-02 Ravi Pratap M <ravi@ximian.com>
17299 * cs-parser.jay (interface_accessors): Re-write actions to also
17300 store attributes attached to get and set methods. Fix spelling
17303 (inteface_property_declaration): Modify accordingly.
17305 (InterfaceAccessorInfo): New helper class to store information to pass
17306 around between rules that use interface_accessors.
17308 * interface.cs (Emit): Apply attributes on the get and set
17309 accessors of properties and indexers too.
17311 * attribute.cs (ApplyAttributes): Modify accordingly to use the
17312 right MethodBuilder when applying attributes to the get and set accessors.
17314 2004-01-31 Miguel de Icaza <miguel@ximian.com>
17316 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
17318 2004-01-26 Miguel de Icaza <miguel@ximian.com>
17320 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
17322 2004-01-25 Miguel de Icaza <miguel@ximian.com>
17324 * cs-parser.jay: Remove YIELD token, instead use the new grammar
17325 changes that treat `yield' specially when present before `break'
17326 or `return' tokens.
17328 * cs-tokenizer.cs: yield is no longer a keyword.
17330 2004-01-23 Marek Safar <marek.safar@seznam.cz>
17332 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
17333 setting for default constructors.
17334 For default constructors are almost every time set wrong Modifier. The
17335 generated IL code has been alright. But inside mcs this values was
17336 wrong and this was reason why several of my CLS Compliance tests
17339 2004-01-22 Martin Baulig <martin@ximian.com>
17341 * cs-parser.jay (namespace_or_type_name): Return an Expression,
17342 not a QualifiedIdentifier. This is what `type_name_expression'
17343 was previously doing.
17344 (type_name_expression): Removed; the code is now in
17345 `namespace_or_type_name'.
17346 (qualified_identifier): Removed, use `namespace_or_type_name'
17348 (QualifiedIdentifier): Removed this class.
17350 2004-01-22 Martin Baulig <martin@ximian.com>
17352 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
17353 not a string as alias name.
17355 2004-01-21 Miguel de Icaza <miguel@ximian.com>
17357 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
17358 #52730 bug, and instead compute correctly the need to use a
17359 temporary variable when requesting an address based on the
17360 static/instace modified of the field and the constructor.
17362 2004-01-21 Martin Baulig <martin@ximian.com>
17364 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
17365 class and namespace before looking up aliases. Fixes #52517.
17367 2004-01-21 Martin Baulig <martin@ximian.com>
17369 * flowanalysis.cs (UsageVector.Merge): Allow variables being
17370 assinged in a 'try'; fixes exception4.cs.
17372 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17373 * class.cs : Implemented parameter-less constructor for TypeContainer
17375 * decl.cs: Attributes are now stored here. New property OptAttributes
17377 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
17379 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
17381 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17383 * typemanager.cs (CSharpSignature): Now reports also inner class name.
17384 (CSharpSignature): New method for indexer and property signature.
17386 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17388 * pending.cs (IsVirtualFilter): Faster implementation.
17390 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17392 * typemanager.cs: Avoid inclusion of same assembly more than once.
17394 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17396 * cs-parser.jay: Fixed problem where the last assembly attribute
17397 has been applied also to following declaration (class, struct, etc.)
17399 2004-01-21 Marek Safar <marek.safar@seznam.cz>
17401 * class.cs: Added error CS0538, CS0539 reporting.
17402 Fixed crash on Microsoft runtime when field type is void.
17404 * cs-parser.jay: Added error CS0537 reporting.
17406 * pending.cs: Added error CS0535 reporting.
17407 Improved error report for errors CS0536, CS0534.
17409 2004-01-20 Miguel de Icaza <miguel@ximian.com>
17411 Merge a few bits from the Anonymous Method MCS tree.
17413 * statement.cs (ToplevelBlock): New class for toplevel methods,
17414 will hold anonymous methods, lifted variables.
17416 * cs-parser.jay: Create toplevel blocks for delegates and for
17417 regular blocks of code.
17419 2004-01-20 Martin Baulig <martin@ximian.com>
17421 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
17422 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
17423 and `NeedExplicitReturn'; added `IsLastStatement'.
17424 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
17425 have a `ReturnLabel' or we're not unreachable.
17427 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
17428 child's reachability; don't just override ours with it. Fixes
17429 #58058 (lluis's example).
17430 (FlowBranching): Added public InTryOrCatch(), InCatch(),
17431 InFinally(), InLoop(), InSwitch() and
17432 BreakCrossesTryCatchBoundary() methods.
17434 * statement.cs (Return): Do all error checking in Resolve().
17435 Unless we are the last statement in a top-level block, always
17436 create a return label and jump to it.
17437 (Break, Continue): Do all error checking in Resolve(); also make
17438 sure we aren't leaving a `finally'.
17439 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
17440 statement in a top-level block.
17441 (Block.Flags): Added `IsDestructor'.
17442 (Block.IsDestructor): New public property.
17444 2004-01-20 Martin Baulig <martin@ximian.com>
17446 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
17448 2004-01-20 Martin Baulig <martin@ximian.com>
17450 * statement.cs (Statement.ResolveUnreachable): New public method.
17451 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
17452 (Block.Resolve): Resolve unreachable statements.
17454 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
17456 * expression.cs: We need to fix the case where we do
17457 not have a temp variable here.
17459 * assign.cs: Only expression compound assignments need
17460 temporary variables.
17462 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
17464 * flowanalysis.cs: Reduce memory allocation in a few ways:
17465 - A block with no variables should not allocate a bit
17467 - A method with no out parameters does not need any tracking
17468 for assignment of the parameters, so we need not allocate
17471 public readonly Type[] VariableTypes;
17472 public readonly string[] VariableNames;
17473 Are redundant. The data is already stored in the variable
17474 map, so we need not allocate another array for it.
17475 - We need to add alot of checks for if (params | locals) == null
17476 due to the first two changes.
17478 2004-01-18 Miguel de Icaza <miguel@ximian.com>
17480 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
17481 implement IMemoryLocation, we store a copy on a local variable and
17482 take the address of it. Patch from Benjamin Jemlich
17484 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
17485 to use a special "type_name_expression" rule which reduces the
17486 number of "QualifiedIdentifier" classes created, and instead
17487 directly creates MemberAccess expressions.
17489 2004-01-17 Miguel de Icaza <miguel@ximian.com>
17491 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
17492 that fixes #52853. Null literal assignment to ValueType
17494 * class.cs (MethodData.Emit): Instead of checking the name of the
17495 method to determine if its a destructor, create a new derived
17496 class from Method called Destructor, and test for that.
17498 * cs-parser.jay: Create a Destructor object instead of a Method.
17500 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
17504 2004-01-16 Miguel de Icaza <miguel@ximian.com>
17506 * expression.cs (Binary.ResolveOperator): Perform an implicit
17507 conversion from MethodGroups to their delegate types on the
17508 Addition operation.
17510 * delegate.cs: Introduce a new class DelegateCreation that is the
17511 base class for `NewDelegate' and `ImplicitDelegateCreation',
17512 factor some code in here.
17514 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
17515 conversion from MethodGroups to compatible delegate types.
17517 * ecore.cs (Expression.Resolve): Do not flag error 654
17518 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
17519 we allow conversions from MethodGroups to delegate types now.
17521 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
17522 assignments in v2 either.
17524 2004-01-10 Miguel de Icaza <miguel@ximian.com>
17526 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
17527 static read-only fields in ctors.
17529 Applied patch from Benjamin Jemlich
17531 * expression.cs (UnaryMutator): Avoid leaking local variables.
17533 2004-01-09 Miguel de Icaza <miguel@ximian.com>
17535 * cs-tokenizer.cs (IsCastToken): Allow the various native types
17536 here to return true, as they can be used like this:
17538 (XXX) int.MEMBER ()
17540 Fixed 49836 and all the other dups
17542 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
17544 * driver.cs: Implement /win32res and /win32icon.
17546 2004-01-08 Miguel de Icaza <miguel@ximian.com>
17548 * cs-parser.jay: Add a rule to improve error handling for the
17549 common mistake of placing modifiers after the type.
17551 2004-01-07 Miguel de Icaza <miguel@ximian.com>
17553 * cs-parser.jay (interface_event_declaration): Catch
17554 initialization of events on interfaces, and report cs0068
17556 * cs-parser.jay (interface_event_declaration): Catch
17557 initialization of events.
17559 * ecore.cs: Better report missing constructors.
17561 * expression.cs (Binary.ResolveOperator): My previous bug fix had
17562 the error reporting done in the wrong place. Fix.
17564 * expression.cs (Binary.ResolveOperator): Catch the
17565 operator + (E x, E y) error earlier, and later allow for implicit
17566 conversions in operator +/- (E e, U x) from U to the underlying
17569 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
17570 52596, if the container class is abstract, the default constructor
17571 is protected otherwise its public (before, we were always public).
17573 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
17576 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
17577 Jemlich that fixes bug #52597, MCS was generating invalid code for
17578 idisposable structs. Thanks to Ben for following up with this
17581 2004-01-06 Miguel de Icaza <miguel@ximian.com>
17583 * driver.cs: Allow assemblies without code to be generated, fixes
17586 2004-01-07 Nick Drochak <ndrochak@gol.com>
17588 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
17590 2004-01-05 Miguel de Icaza <miguel@ximian.com>
17592 * cs-parser.jay: Add rules to improve error reporting if fields or
17593 methods are declared at the namespace level (error 116)
17595 * Add rules to catch event add/remove
17597 2004-01-04 David Sheldon <dave-mono@earth.li>
17599 * expression.cs: Added matching ")" to error message for
17602 2004-01-03 Todd Berman <tberman@gentoo.org>
17604 * ecore.cs, attribute.cs:
17605 Applying fix from #52429.
17607 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
17609 * ecore.cs, expression.cs, statement.cs:
17610 Total rewrite of how we handle branching. We
17611 now handle complex boolean expressions with fewer
17612 jumps. As well if (x == 0) no longer emits a ceq.
17614 if (x is Foo) is much faster now, because we generate
17617 Overall, we get a pretty big improvement on our benchmark
17618 tests. The code we generate is smaller and more readable.
17620 I did a full two-stage bootstrap. The patch was reviewed
17621 by Martin and Miguel.
17623 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
17625 * cs-parser.jay: Make primary_expression not take a QI.
17626 we dont need this because the member_access rule covers
17627 us here. So we replace the rule with just IDENTIFIER.
17629 This has two good effects. First, we remove a s/r conflict.
17630 Second, we allocate many fewer QualifiedIdentifier objects.
17632 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
17634 * attribute.cs: Handle MarshalAs attributes as pseudo, and
17635 set the correct information via SRE. This prevents
17636 hanging on the MS runtime. Fixes #29374.
17638 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
17640 * convert.cs: correctly handle conversions to value types
17641 from Enum and ValueType as unboxing conversions.
17643 Fixes bug #52569. Patch by Benjamin Jemlich.
17645 2004-01-02 Ravi Pratap <ravi@ximian.com>
17647 * expression.cs (BetterConversion): Prefer int -> uint
17648 over int -> ulong (csc's behaviour). This fixed bug #52046.
17650 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
17652 * decl.cs (MemberCache.FindMembers): now returns a
17655 * typemanager.cs: In general, go with with ^^.
17656 (CopyNewMethods): take an IList.
17657 (RealMemberLookup): Only allocate an arraylist
17658 if we copy from two sets of methods.
17660 This change basically does two things:
17661 1) Fewer array lists allocated due to CopyNewMethods.
17662 2) the explicit cast in MemberList costed ALOT.
17664 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
17666 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
17667 a hashtable to avoid needless string allocations when an identifier is
17668 used more than once (the common case).
17670 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
17672 * pending.cs: MS's TypeBuilder.GetInterfaces ()
17673 is broken, it will not return anything. So, we
17674 have to use the information we have in mcs to
17677 * typemanager.cs: Add a cache for GetInterfaces,
17678 since this will now be used more often (due to ^^)
17680 (GetExplicitInterfaces) New method that gets the
17681 declared, not effective, interfaces on a type
17682 builder (eg, if you have interface IFoo, interface
17683 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
17686 This patch makes MCS able to bootstrap itself on
17689 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
17691 * expression.cs: Remove the Nop's that Miguel put
17694 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
17696 * report.cs, codegen.cs: Give the real stack trace to
17697 the error when an exception is thrown.
17699 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
17701 * decl.cs: only allocate hashtables for ifaces if
17704 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
17706 * expression.cs: fix the error from cs0121-2.cs
17707 (a parent interface has two child interfaces that
17708 have a function with the same name and 0 params
17709 and the function is called through the parent).
17711 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
17713 * class.cs, rootcontext.cs, typmanager.cs: do not
17716 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
17718 * codegen.cs: remove stack for the ec flow branching.
17719 It is already a linked list, so no need.
17721 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
17723 * Makefile: Allow custom profiler here.
17725 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
17727 * typemanager.cs (LookupType):
17728 - Use a static char [], because split takes
17729 a param array for args, so it was allocating
17731 - Do not store true in a hashtable, it boxes.
17733 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
17735 * flowanalysis.cs: bytify common enums.
17737 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
17739 * modifiers.cs: Add a new set of flags for the
17740 flags allowed on explicit interface impls.
17741 * cs-parser.jay: catch the use of modifiers in
17742 interfaces correctly.
17743 * class.cs: catch private void IFoo.Blah ().
17745 All related to bug #50572.
17747 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
17749 * decl.cs: Rewrite the consistant accessability checking.
17750 Accessability is not linear, it must be implemented in
17751 a tableish way. Fixes #49704.
17753 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
17755 * expression.cs: Handle negation in a checked context.
17756 We must use subtraction from zero. Fixes #38674.
17758 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
17760 * class.cs: Ignore static void main in DLLs.
17761 * rootcontext.cs: Handle the target type here,
17762 since we are have to access it from class.cs
17763 * driver.cs: account for the above.
17765 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
17767 * report.cs: Give line numbers and files if available.
17769 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
17771 * driver.cs: Implement /addmodule.
17773 * typemanager.cs: Change 'modules' field so it now contains Modules not
17776 2003-12-20 Martin Baulig <martin@ximian.com>
17778 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
17779 (FieldBase.IsAssigned): Removed this field.
17780 (FieldBase.SetAssigned): New public method.
17781 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
17783 2003-12-20 Martin Baulig <martin@ximian.com>
17785 * expression.cs (LocalVariableReference.DoResolve): Don't set
17786 `vi.Used' if we're called from DoResolveLValue().
17788 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
17789 returns the usage vector it just merged into the current one -
17790 pass this one to UsageWarning().
17791 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
17792 of the `EmitContext', don't call this recursively on our children.
17794 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
17796 * driver.cs: Implement /target:module.
17798 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
17800 * support.cs (CharArrayHashtable): New helper class.
17802 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
17803 char arrays, not strings, so we can avoid creating a string in
17804 consume_identifier if the identifier is a keyword.
17806 2003-12-16 Martin Baulig <martin@ximian.com>
17808 * statement.cs (LocalInfo.Assigned): Removed this property.
17809 (LocalInfo.Flags): Removed `Assigned'.
17810 (LocalInfo.IsAssigned): New public method; takes the EmitContext
17811 and uses flow analysis.
17812 (Block.UsageWarning): Made this method private.
17813 (Block.Resolve): Call UsageWarning() if appropriate.
17815 * expression.cs (LocalVariableReference.DoResolve): Always set
17816 LocalInfo.Used here.
17818 2003-12-13 Martin Baulig <martin@ximian.com>
17820 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
17821 any value here; we're now using flow analysis to figure out
17822 whether a statement/block returns a value.
17824 2003-12-13 Martin Baulig <martin@ximian.com>
17826 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
17828 (FlowBranching.MergeFinally): Don't call
17829 `branching.CheckOutParameters()' here, this is called in
17831 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
17832 when adding the `finally' vector.
17834 2003-12-13 Martin Baulig <martin@ximian.com>
17837 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
17838 actually work and also fix #48962.
17840 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
17842 * decl.cs: Do not check System.Object for nested types,
17843 since we know it does not have any. Big bang for buck:
17846 Run 1: 8.35 seconds
17847 Run 2: 8.32 seconds
17848 corlib: 17.99 seconds
17850 Run 1: 8.17 seconds
17851 Run 2: 8.17 seconds
17852 corlib: 17.39 seconds
17854 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
17856 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
17857 time we are returning 0 members, so we save alot here.
17859 2003-12-11 Martin Baulig <martin@ximian.com>
17861 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
17862 `MergeChild()', also just take the `FlowBranching' as argument;
17863 call Merge() on it and return the result.
17864 (FlowBranching.Merge): We don't need to do anything if we just
17867 2003-12-11 Martin Baulig <martin@ximian.com>
17869 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
17870 them in an `ArrayList' to reduce memory usage. Thanks to Ben
17871 Maurer for this idea.
17873 2003-12-11 Martin Baulig <martin@ximian.com>
17875 * flowanalysis.cs (MergeResult): This class is now gone; we now
17876 use the `UsageVector' for this. The reason for this is that if a
17877 branching just has one sibling, we don't need to "merge" them at
17878 all - that's the next step to do.
17879 (FlowBranching.Merge): We now return a `UsageVector' instead of a
17882 2003-12-11 Martin Baulig <martin@ximian.com>
17884 Reworked flow analyis and made it more precise and bug-free. The
17885 most important change is that we're now using a special `Reachability'
17886 class instead of having "magic" meanings of `FlowReturns'. I'll
17887 do some more cleanups and optimizations and also add some more
17888 documentation this week.
17890 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
17891 largely reworked this class.
17892 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
17893 the new `Reachability' class instead of having "magic" values here.
17894 (FlowBranching): We're now using an instance of `Reachability'
17895 instead of having separate `Returns', `Breaks' etc. fields.
17897 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
17898 based on flow analysis; ignore the return value of block.Emit ().
17900 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
17902 * driver.cs typemanager.cs: Find the mono extensions to corlib even
17903 if they are private.
17905 2003-12-09 Martin Baulig <martin@ximian.com>
17907 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
17908 call them directly on the UsageVector.
17910 2003-12-09 Martin Baulig <martin@ximian.com>
17912 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
17913 Changed return type from `FlowReturns' to `Reachability'.
17915 2003-12-09 Martin Baulig <martin@ximian.com>
17917 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
17918 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
17919 `Reachable' fields with a single `Reachability' one.
17921 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
17923 * class.cs (FindMembers): Remove foreach's.
17928 Run 1: 8.74 seconds
17929 Run 2: 8.71 seconds
17932 Run 1: 8.64 seconds
17933 Run 2: 8.58 seconds
17936 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
17941 This patch does a few things:
17942 1. EmptyStatement is now a singleton, so it is never reallocated.
17943 2. All blah is EmptyStatement constructs have been changed to
17944 blah == EmptyStatement.Value, which is much faster and valid
17945 now that EmptyStatement is a singleton.
17946 3. When resolving a block, rather than allocating a new array for
17947 the non-empty statements, empty statements are replaced with
17948 EmptyStatement.Value
17949 4. Some recursive functions have been made non-recursive.
17950 Mainly the performance impact is from (3), however (1) and (2) are needed for
17951 this to work. (4) does not make a big difference in normal situations, however
17952 it makes the profile look saner.
17957 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
17958 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
17959 Total memory allocated: 56397 KB
17962 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
17963 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
17964 Total memory allocated: 55666 KB
17966 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
17968 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
17969 than the hashtable in a hashtable version
17971 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
17972 we always end up concating a string. This results in a huge perf
17973 loss, because many strings have to be tracked by the GC. In this
17974 patch, we first use a hashtable that works with two keys, so that
17975 the strings do not need to be concat'ed.
17979 Run 1: 8.74 seconds
17980 Run 2: 8.71 seconds
17983 Run 1: 8.65 seconds
17984 Run 2: 8.56 seconds
17986 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
17988 * Makefile: Add a new target `do-time' that does a quick and simple
17989 profile, leaving easy to parse output.
17991 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
17993 * codegen.cs (Init): Create the dynamic assembly with
17994 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
17996 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
17998 * support.cs: Make the PtrHashtable use only one
17999 instance of its comparer.
18001 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
18003 * typemanager.cs: Fix lookup of GetNamespaces.
18005 2003-11-29 Miguel de Icaza <miguel@ximian.com>
18007 * expression.cs: Removed redundant line.
18009 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
18010 ArrayLists, use for loops with bounds.
18012 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
18015 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
18016 arraylists, use for loop with bounds.
18018 The above three changes give us a 0.071 second performance
18019 improvement out of 3.294 seconds down to 3.223. On my machine
18020 the above changes reduced the memory usage by 1,387 KB during
18021 compiler bootstrap.
18023 * cs-parser.jay (QualifiedIdentifier): New class used to represent
18024 QualifiedIdentifiers. Before we created a new string through
18025 concatenation, and mostly later on, the result would be
18026 manipulated by DecomposeQI through string manipulation.
18028 This reduced the compiler memory usage for bootstrapping from
18029 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
18030 compile times in 0.05 seconds.
18032 2003-11-28 Dick Porter <dick@ximian.com>
18034 * support.cs: Do string compares with the Invariant culture.
18042 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
18043 the comparison is done with the Invariant culture.
18045 2003-11-27 Miguel de Icaza <miguel@ximian.com>
18047 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
18048 GetEnumerator method.
18050 (ProbeCollectionType): Iterate starting at the most specific type
18051 upwards looking for a GetEnumerator
18053 * expression.cs: Shift count can be up to 31 for int/uint and 63
18056 2003-11-26 Miguel de Icaza <miguel@ximian.com>
18058 * statement.cs (Block.LookupLabel): Also look for the label on the
18059 children blocks. Use a hash table to keep track of visited
18062 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
18063 we actually did transform the other operand, otherwise fall back
18064 to the common codepath that casts to long.
18066 * cs-tokenizer.cs: Use the same code pattern as the int case.
18067 Maybe I should do the parsing myself, and avoid depending on the
18068 Parse routines to get this done.
18070 2003-11-25 Miguel de Icaza <miguel@ximian.com>
18072 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
18073 which fixes bug 51347. This time test it.
18075 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
18076 attributes for example can not tell the difference between these.
18077 The difference was only a syntax feature of the language.
18079 * attribute.cs: Apply attributes to delegates.
18081 * delegate.cs: Call the apply attributes method.
18083 2003-11-24 Miguel de Icaza <miguel@ximian.com>
18085 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
18086 comparing 0 vs Byte.MinValue, not the value
18088 (ImplicitConversionRequired): When reporting a conversion error,
18089 use error 31 to print out the constant error instead of the
18092 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
18093 which fixes bug 51347.
18095 2003-11-22 Miguel de Icaza <miguel@ximian.com>
18097 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
18098 which fixes the -warnaserror command line option.
18100 2003-11-21 Miguel de Icaza <miguel@ximian.com>
18102 * cfold.cs (DoNumericPromotions): During constant folding of
18103 additions on UIntConstant, special case intconstants with
18104 IntConstants like we do on the expression binary operator.
18106 2003-11-12 Miguel de Icaza <miguel@ximian.com>
18108 * convert.cs (ImplicitReferenceConversion): We were missing a case
18109 (System.Enum are not value types or class types, so we need to
18110 classify them separatedly).
18112 * driver.cs: We do not support error 2007.
18114 2003-11-12 Jackson Harper <jackson@ximian.com>
18116 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
18117 system directory. Also use the full file name so users can
18118 libraries names mscorlib-o-tron.dll in a non system dir.
18120 2003-11-10 Martin Baulig <martin@ximian.com>
18122 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
18123 (TypeManager.InitCoreTypes): Initialize them here, but instead of
18124 calling `ResolveType()' on them, directly assign their `Type'.
18126 2003-11-08 Martin Baulig <martin@ximian.com>
18128 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
18129 return value and the `out parent' parameter.
18130 (TypeContainer.DefineType): Moved the CS0644 check into
18131 GetClassBases(). Don't pass the interface types to the
18132 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
18133 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
18135 * ecore.cs (TypeExpr.IsAttribute): New property.
18136 (TypeExpr.GetInterfaces): New method.
18138 * interface.cs (Interface.GetInterfaceTypeByName): Return a
18139 TypeExpr instead of a Type.
18140 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
18141 (Interface.DefineType): Don't pass the interface types to the
18142 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
18143 them later and then call `TypeBulider.AddInterfaceImplementation()'.
18145 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
18146 instead of a `Type[]'.
18147 (TypeManager.RegisterBuilder): Likewise.
18148 (TypeManager.AddUserInterface): Likewise.
18149 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
18150 `Type[]' and also return a `TypeExpr[]'.
18151 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
18153 2003-11-08 Martin Baulig <martin@ximian.com>
18155 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
18158 2003-11-08 Martin Baulig <martin@ximian.com>
18160 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
18161 TypeManager.ResolveExpressionTypes().
18163 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
18164 instead of an Expression.
18165 (TypeExpr): This is now an abstract base class for `TypeExpression'.
18166 (TypeExpression): New public class; formerly known as `TypeExpr'.
18168 * expression.cs (ComposedCast): Derive from TypeExpr.
18170 * typemanager.cs (TypeManager.system_*_expr): These are now
18171 TypExpr's instead of Expression's.
18172 (TypeManager.ResolveExpressionTypes): New public static function;
18173 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
18176 2003-11-06 Miguel de Icaza <miguel@ximian.com>
18178 * expression.cs (New.DoResolve): Do not dereference value that
18179 might be a null return.
18181 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
18182 sure that the constant value has the right type. Fixes an
18183 unreported bug, similar to 50425.
18185 * const.cs (Const.LookupConstantValue): Call
18186 ImplicitStandardConversionExists before doing a conversion to
18187 avoid havng the TypeManager.ChangeType do conversions.
18189 Reduced the number of casts used
18191 (Const.ChangeType): New routine to enable reuse of the constant
18192 type changing code from statement.
18194 * typemanager.cs (ChangeType): Move common initialization to
18195 static global variables.
18199 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
18200 every value type to go through, even if it was void. Fix that.
18202 * cs-tokenizer.cs: Use is_identifier_start_character on the start
18203 character of the define, and the is_identifier_part_character for
18204 the rest of the string.
18206 2003-11-05 Miguel de Icaza <miguel@ximian.com>
18208 * expression.cs (UnaryMutator.EmitCode): When I updated
18209 LocalVariableReference.DoResolve, I overdid it, and dropped an
18210 optimization done on local variable references.
18212 2003-11-04 Miguel de Icaza <miguel@ximian.com>
18214 * ecore.cs: Convert the return from Ldlen into an int.
18216 2003-10-20 Miguel de Icaza <miguel@ximian.com>
18218 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
18219 the accessibility, this is a special case for toplevel non-public
18220 classes (internal for instance).
18222 2003-10-20 Nick Drochak <ndrochak@gol.com>
18224 * ecore.cs: Fix typo and build. Needed another right paren.
18226 2003-10-19 Miguel de Icaza <miguel@ximian.com>
18228 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
18229 `internal' case regular and protected, but not allowing protected
18230 to be evaluated later. Bug 49840
18232 2003-10-15 Miguel de Icaza <miguel@ximian.com>
18234 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
18235 to kb.Nlast, and not the kb.nFirst to isolate the switch
18238 Extract the underlying type, so enumerations of long/ulong are
18239 treated like long/ulong.
18241 2003-10-14 Miguel de Icaza <miguel@ximian.com>
18243 * expression.cs (New): Overload the meaning of RequestedType to
18244 track the possible creation of the NewDelegate type, since
18245 DoResolve is invoked more than once for new constructors on field
18248 See bugs: #48800 and #37014
18250 * cs-parser.jay (declare_local_constants): Take an arraylist
18251 instead of a single constant.
18253 (local_constant_declaration): It should take a
18254 constant_declarators, not a constant_declarator. Fixes 49487
18256 * convert.cs: Fix error report.
18258 2003-10-13 Jackson Harper <jackson@ximian.com>
18260 * typemanager.cs (TypeToCoreType): Add float and double this fixes
18263 2003-10-09 Martin Baulig <martin@ximian.com>
18265 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
18267 (MethodCore.DoDefineParameters): Removed the TypeContainer
18268 argument; use the DeclSpace which was passed to the .ctor instead.
18269 (MethodCore.CheckParameter): Take a DeclSpace instead of a
18270 TypeContainer; we only need a DeclSpace here.
18272 2003-10-09 Martin Baulig <martin@ximian.com>
18274 * class.cs (MethodData): Added additional `DeclSpace ds' argument
18276 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
18277 EmitContext's .ctor.
18279 2003-10-09 Martin Baulig <martin@ximian.com>
18281 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
18282 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
18283 AsAccessible(), moved them as well.
18285 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
18287 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
18289 * cs-parser.jay : Renamed yyName to yyNames related to jay.
18291 2003-10-07 Miguel de Icaza <miguel@ximian.com>
18293 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
18294 generation for >=, as spotted by Paolo, bug 48679.
18295 Patch from David Waite.
18297 * cs-tokenizer.cs: Add handling for #pragma.
18299 * cs-parser.jay: Allow for both yield and yield return in the
18300 syntax. The anti-cobolization of C# fight will go on!
18302 * class.cs (TypeBuilder.DefineType): Catch error condition here
18303 (Parent.DefineType erroring out and returning null).
18305 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18306 coping with enumerations variables, we were mistakenly processing
18307 them as a regular value type instead of built-in types. Fixes the
18310 * typemanager.cs (IsBuiltinOrEnum): New method.
18312 2003-09-30 Miguel de Icaza <miguel@ximian.com>
18314 * cs-parser.jay: Upgrade: yield now needs the return clause.
18316 2003-09-19 Martin Baulig <martin@ximian.com>
18318 * decl.cs (MemberCache.SetupCacheForInterface): Take a
18319 `MemberCache parent' argument. Normally, an interface doesn't
18320 have a parent type except System.Object, but we use this in gmcs
18321 for generic type parameters.
18323 2003-09-18 Martin Baulig <martin@ximian.com>
18325 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
18326 on `type.IsInterface'; don't check whether the type has a parent
18327 to determine whether it's an interface.
18329 2003-09-15 Martin Baulig <martin@ximian.com>
18331 * class.cs (TypeContainer.DefineType): Added an error flag to
18332 avoid reporting duplicate CS0146's ("class definition is
18335 * driver.cs (Driver.MainDriver): Abort if
18336 RootContext.ResolveTree() reported any errors.
18338 2003-09-07 Martin Baulig <martin@ximian.com>
18340 * report.cs (Error, Warning): Added overloaded versions which take
18341 a `params object[] args' and call String.Format().
18343 2003-09-07 Martin Baulig <martin@ximian.com>
18345 * decl.cs (DeclSpace..ctor): Don't call
18346 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
18347 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
18348 (DeclSpace.RecordDecl): New method.
18350 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
18352 2003-09-02 Ravi Pratap <ravi@ximian.com>
18354 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
18355 value attributes to be applied to ParameterBuilders.
18357 * class.cs (MethodCore.LabelParameters): Make static and more
18358 generic so that it can be used from other places - like interface
18359 methods, for instance.
18361 * interface.cs (Interface.Emit): Call LabelParameters before
18362 emitting attributes on the InterfaceMethod.
18364 2003-08-26 Martin Baulig <martin@ximian.com>
18366 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
18367 resolving aliases; fixes #47927.
18369 2003-08-26 Martin Baulig <martin@ximian.com>
18371 * statement.cs (Using.DoResolve): This is internally emitting a
18372 try/finally clause, so we need to set ec.NeedExplicitReturn if we
18373 do not always return. Fixes #47681.
18375 2003-08-26 Martin Baulig <martin@ximian.com>
18377 * decl.cs (MemberCore): Moved WarningNotHiding(),
18378 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
18380 (AdditionResult): Make this nested in DeclSpace.
18381 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
18382 argument; call NamespaceEntry.Define() unless we're nested in a
18385 * namespace.cs (Namespace.DefineName): New public function. This
18386 is called from DeclSpace's .ctor to add
18387 (Namespace.Lookup): Include DeclSpaces in the lookup.
18389 * class.cs (Operator): Derive from MemberBase, not MemberCore.
18391 * const.cs (Const): Derive from MemberBase, not MemberCore.
18393 2003-08-25 Martin Baulig <martin@ximian.com>
18395 * convert.cs (Convert.ExplicitReferenceConversion): When
18396 converting from an interface type to a class, unbox if the target
18397 type is a struct type. Fixes #47822.
18399 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18401 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
18404 2003-08-22 Martin Baulig <martin@ximian.com>
18406 * class.cs (TypeManager.DefineType): When defining a nested type,
18407 call DefineType() on our parent; fixes #47801.
18409 2003-08-22 Martin Baulig <martin@ximian.com>
18411 * class.cs (MethodData.Define): While checking if a method is an
18412 interface implementation, improve the test a bit more to fix #47654.
18414 2003-08-22 Martin Baulig <martin@ximian.com>
18416 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
18417 correctly; fixes #47722.
18419 2003-08-22 Martin Baulig <martin@ximian.com>
18421 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
18422 LocalVariableReference, ensure it's not read-only. Fixes #47536.
18424 * statement.cs (Fixed.DoResolve): Make all variables read-only.
18426 2003-08-22 Martin Baulig <martin@ximian.com>
18428 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
18429 can only be assigned in static constructors. Fixes #47161.
18431 2003-08-22 Martin Baulig <martin@ximian.com>
18433 Rewrote and improved the flow analysis code.
18435 * flowbranching.cs (FlowBranching): Make this class abstract.
18436 (FlowBranching.CreateBranching): New static function to create a
18437 new flow branching.
18438 (FlowBranchingBlock, FlowBranchingException): New classes.
18439 (FlowBranching.UsageVector.Type): New public readonly field.
18440 (FlowBranching.UsageVector.Breaks): Removed the setter.
18441 (FlowBranching.UsageVector.Returns): Removed the setter.
18442 (FlowBranching.UsageVector): Added Break(), Return(),
18443 NeverReachable() and Throw() methods to modify the reachability.
18444 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
18445 done by FlowBranching.Merge().
18446 (FlowBranching.UsageVector.MergeChild): New method; merges the
18447 merge result into the current vector.
18448 (FlowBranching.Merge): New abstract method to merge a branching.
18450 2003-08-12 Martin Baulig <martin@ximian.com>
18452 * expression.cs (Indirection.CacheTemporaries): Create the
18453 LocalTemporary with the pointer type, not its element type.
18455 2003-08-10 Miguel de Icaza <miguel@ximian.com>
18457 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
18458 token was a keyword or not.
18460 Add `error' options where an IDENTIFIER was expected; Provide
18461 CheckToken and CheckIdentifierToken convenience error reporting
18464 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
18466 * decl.cs: Rename `NamespaceEntry Namespace' public field into
18467 NameSpaceEntry NameSpaceEntry.
18469 (LookupInterfaceOrClass): Avoid creating a full qualified name
18470 from namespace and name: avoid doing lookups when we know the
18471 namespace is non-existant. Use new Tree.LookupByNamespace which
18472 looks up DeclSpaces based on their namespace, name pair.
18474 * driver.cs: Provide a new `parser verbose' to display the
18475 exception thrown during parsing. This is turned off by default
18476 now, so the output of a failure from mcs is more graceful.
18478 * namespace.cs: Track all the namespaces defined in a hashtable
18481 (IsNamespace): New method
18483 2003-08-09 Miguel de Icaza <miguel@ximian.com>
18485 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
18486 we know that we need to concatenate (full typename can never be
18491 * statement.cs: Use a bitfield; Do not initialize to null things
18492 which are done by the constructor by default.
18494 * cs-parser.jay: bug fix, parameter was 4, not 3.
18496 * expression.cs: Just use the property;
18498 * statement.cs: No need for GetVariableInfo method.
18500 2003-08-08 Martin Baulig <martin@ximian.com>
18502 * flowanalysis.cs (FlowReturns): This is now nested in the
18503 `FlowBranching' class.
18504 (MyBitVector): Moved this here from statement.cs.
18505 (FlowBranching.SiblingType): New enum type.
18506 (FlowBranching.CreateSibling): Added `SiblingType' argument.
18508 2003-08-07 Martin Baulig <martin@ximian.com>
18510 * flowanalysis.cs (FlowBranchingType): This is now nested in the
18511 `FlowBranching' class and called `BranchingType'.
18513 2003-08-07 Martin Baulig <martin@ximian.com>
18515 * flowanalysis.cs: Moved all the control flow analysis code into
18518 2003-08-07 Martin Baulig <martin@ximian.com>
18520 * assign.cs (Assign.DoResolve): `target' must either be an
18521 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
18524 2003-08-07 Miguel de Icaza <miguel@ximian.com>
18526 * expression.cs (BinaryMethod): This kind of expression is created by the
18527 Binary class if it determines that the operator has to be handled
18530 (BinaryDelegate): This kind of expression is created if we are
18531 dealing with a + or - operator on delegates.
18533 (Binary): remove method, argumetns, and DelegateOperator: when
18534 dealing with methods,
18536 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
18538 * statement.cs (Block): use bitfields for the three extra booleans
18539 we had in use. Remove unused topblock parameter.
18541 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
18543 * assign.cs: Drop extra unneeded tests.
18545 2003-08-06 Miguel de Icaza <miguel@ximian.com>
18547 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
18549 * statement.cs (Foreach): Use VariableStorage instead of
18552 * codegen.cs (VariableStorage): New class used by clients that
18553 require a variable stored: locals or fields for variables that
18554 need to live across yield.
18556 Maybe provide a convenience api for EmitThis+EmitLoad?
18558 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
18561 2003-08-05 Miguel de Icaza <miguel@ximian.com>
18563 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
18564 RemapParameterLValue): New methods that are used to turn a
18565 precomputed FieldInfo into an expression like this:
18569 The idea is to use this instead of making LocalVariableReference
18570 have more than one meaning.
18572 * cs-parser.jay: Add error production to BASE.
18574 * ecore.cs: Deal with TypeManager.GetField returning null, which
18575 is now a valid return value.
18577 (FieldExprNoAddress): New expression for Fields whose address can
18580 * expression.cs (LocalVariableReference): During the resolve
18581 phases, create new expressions if we are in a remapping context.
18582 Remove code that dealt with remapping here.
18584 (ParameterReference): same.
18586 (ProxyInstance): New expression, like the `This' expression, but
18587 it is born fully resolved. We know what we are doing, so remove
18588 the errors that are targeted to user-provided uses of `this'.
18590 * statement.cs (Foreach): our variable is now stored as an
18591 Expression; During resolution, follow the protocol, dont just
18592 assume it will return this.
18594 2003-08-06 Martin Baulig <martin@ximian.com>
18596 * support.cs (SeekableStreamReader.cs): New public class.
18598 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
18599 SeekableStreamReader instead of the normal StreamReader.
18601 2003-08-04 Martin Baulig <martin@ximian.com>
18603 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
18604 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
18605 deambiguate casts and delegate invocations.
18606 (parenthesized_expression): Use the new tokens to ensure this is
18607 not a cast of method invocation.
18609 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
18610 when reading a `)' and Deambiguate_CloseParens () was previously
18613 * expression.cs (ParenthesizedExpression): New class. This is
18614 just used for the CS0075 test.
18615 (Binary.DoResolve): Check for CS0075.
18617 2003-07-29 Ravi Pratap <ravi@ximian.com>
18619 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
18620 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
18621 reference comparison.
18623 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
18624 examine the ReturnType for equality - this is necessary in the
18625 cases of implicit and explicit operators whose signature also
18626 includes the return type.
18628 2003-07-26 Miguel de Icaza <miguel@ximian.com>
18630 * namespace.cs: Cache the result of the namespace computation,
18631 instead of computing it every time.
18633 2003-07-24 Miguel de Icaza <miguel@ximian.com>
18635 * decl.cs: Use a global arraylist that we reuse over invocations
18636 to avoid excesive memory consumption. Reduces memory usage on an
18637 mcs compile by one meg (45 average).
18639 * typemanager.cs (LookupTypeReflection): In .NET pointers are
18640 private, work around that.
18642 2003-07-23 Miguel de Icaza <miguel@ximian.com>
18644 * literal.cs (IntLiteral): Define Zero and One static literals.
18646 * cs-parser.jay (integer_literal): use static literals to reduce
18647 memory usage for the most used literals (0, 1 and -1). 211kb
18648 reduced in memory usage.
18650 Replace all calls to `new ArrayList' with `new
18651 ArrayList(4)' which is a good average number for most allocations,
18652 and also requires only 16 bytes of memory for its buffer by
18655 This reduced MCS memory usage in seven megabytes for the RSS after
18658 2003-07-28 Ravi Pratap <ravi@ximian.com>
18660 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
18661 handle params methods the correct way by forming only one
18662 applicable set with params and normal methods in them. Earlier we
18663 were looking at params methods only if we found no normal methods
18664 which was not the correct thing to do.
18666 (Invocation.BetterFunction): Take separate arguments indicating
18667 when candidate and the best method are params methods in their
18670 This fixes bugs #43367 and #46199.
18672 * attribute.cs: Documentation updates.
18674 (CheckAttribute): Rename to CheckAttributeTarget.
18675 (GetValidPlaces): Rename to GetValidTargets.
18677 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
18678 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
18682 2003-07-28 Martin Baulig <martin@ximian.com>
18684 * class.cs (TypeContainer.DefineMembers): Use the base type's full
18685 name when looking up the base class of a nested class. Fixes #46977.
18687 2003-07-26 Martin Baulig <martin@ximian.com>
18689 * expression.cs (Indexers.Indexer): New nested struct; contains
18690 getter, setter and the indexer's type.
18691 (Indexers.Properties): This is now an ArrayList of
18692 Indexers.Indexer's.
18693 (IndexerAccess.DoResolveLValue): Correctly set the type if the
18694 indexer doesn't have any getters.
18696 * assign.cs (Assign.DoResolve): Also do the implicit conversions
18697 for embedded property and indexer assignments.
18699 2003-07-26 Martin Baulig <martin@ximian.com>
18701 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
18702 preprocessor directive is not the first non-whitespace character
18705 2003-07-26 Martin Baulig <martin@ximian.com>
18707 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
18708 namespace parsing, follow the spec more closely.
18710 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
18711 NamespaceEntry.Lookup().
18713 2003-07-25 Martin Baulig <martin@ximian.com>
18715 * MethodCore.cs (OverridesSomething): New public field; it's set
18716 from TypeContainer.DefineMembers if this method overrides
18717 something (which doesn't need to be a method). Fix #39462.
18719 2003-07-25 Ravi Pratap <ravi@ximian.com>
18721 * typemanager.cs (GetMembers): Ensure that the list of members is
18722 reversed. This keeps things in sync.
18724 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
18725 find an AttributeUsage attribute.
18727 * expression.cs (Invocation.OverloadResolve): Perform the check
18728 which disallows Invoke to be directly called on a Delegate.
18730 (Error_InvokeOnDelegate): Report error cs1533.
18732 2003-07-25 Martin Baulig <martin@ximian.com>
18734 * expression.cs (Indexers.GetIndexersForType): Only look in the
18735 interface hierarchy if the requested type is already an
18736 interface. Fixes #46788 while keeping #46502 fixed.
18738 2003-07-25 Martin Baulig <martin@ximian.com>
18740 * class.cs (TypeContainer.DefineMembers): Check whether all
18741 readonly fields have been assigned and report warning CS0649 if
18744 * statement.cs (LocalInfo.IsFixed): Always return true if this is
18747 2003-07-24 Ravi Pratap <ravi@ximian.com>
18749 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
18750 returned from GetMethods to make things consistent with the
18751 assumptions MCS makes about ordering of methods.
18753 This should comprehensively fix bug #45127 and it does :-)
18755 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
18756 ordering is actually reverse.
18758 * Clean up some debug messages I left lying around.
18760 * interface.cs (Populate*): Get rid of code which emits attributes
18761 since the stage in which we emit attributes is the 'Emit' stage,
18762 not the define stage.
18764 (Emit): Move attribute emission for interface members here.
18766 2003-07-22 Ravi Pratap <ravi@ximian.com>
18768 * expression.cs (Invocation.OverloadResolve): Follow the spec more
18769 closely: we eliminate methods in base types when we have an
18770 applicable method in a top-level type.
18772 Please see section 14.5.5.1 for an exact description of what goes
18775 This fixes bug #45127 and a host of other related to corlib compilation.
18777 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
18778 array is the method corresponding to the top-level type (this is
18779 because of the changes made to icall.c) so we change this
18782 (MethodGroupExpr.Name): This too.
18784 * typemanager.cs (GetElementType): New method which does the right
18785 thing when compiling corlib.
18787 * everywhere: Make use of the above in the relevant places.
18789 2003-07-22 Martin Baulig <martin@ximian.com>
18791 * cs-parser.jay (invocation_expression): Moved
18792 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
18793 `cast_expression', but create a InvocationOrCast which later
18794 resolves to either an Invocation or a Cast.
18796 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
18797 method; call this before EmitStatement() to make sure that this
18798 expression can be used as a statement.
18800 * expression.cs (InvocationOrCast): New class; resolves to either
18801 an Invocation or a Cast.
18803 * statement.cs (StatementExpression): Call ResolveStatement() on
18804 the ExpressionStatement before emitting it.
18806 2003-07-21 Martin Baulig <martin@ximian.com>
18808 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
18809 `ref' and `out' attributes match; fixes #46220.
18810 (MemberAccess.ResolveMemberAccess): You can't reference a type
18811 through an expression; fixes #33180.
18812 (Indexers.GetIndexersForType): Don't return the indexers from
18813 interfaces the class implements; fixes #46502.
18815 2003-07-21 Martin Baulig <martin@ximian.com>
18817 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
18818 CS0661 checks; fixes bug #30442.
18820 2003-07-21 Martin Baulig <martin@ximian.com>
18822 * decl.cs (AdditionResult): Added `Error'.
18824 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
18826 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
18827 makes cs0031.cs actually work.
18829 2003-07-20 Martin Baulig <martin@ximian.com>
18831 * namespace.cs: Fixed that bug which caused a crash when compiling
18832 the debugger's GUI.
18834 2003-07-20 Miguel de Icaza <miguel@ximian.com>
18836 * typemanager.cs (LookupTypeReflection): Never expose types which
18837 are NotPublic, NestedPrivate, NestedAssembly, or
18838 NestedFamANDAssem. We used to return these, and later do a check
18839 that would report a meaningful error, but the problem is that we
18840 would not get the real match, if there was a name override.
18842 2003-07-18 Miguel de Icaza <miguel@ximian.com>
18844 * namespace.cs (Namespace, Name): Do not compute the namespace
18845 name dynamically, compute it in the constructor. This reduced
18846 memory usage by 1697 KB.
18848 * driver.cs: Use --pause to pause at the end.
18850 2003-07-17 Peter Williams <peter@newton.cx>
18852 * Makefile: Change the name of the test target so that it doesn't
18853 conflict with the recursive test target.
18855 2003-07-17 Miguel de Icaza <miguel@ximian.com>
18857 * expression.cs (LocalVariableReference.Emit, EmitAssign,
18858 AddressOf): Do not use EmitThis, that was wrong, use the actual
18861 2003-07-15 Miguel de Icaza <miguel@ximian.com>
18863 * class.cs (MethodData.Define): While checking if a method is an
18864 interface implementation, improve the test: If we are not public
18865 (use new test here: use the computed MethodAttributes directly,
18866 instead of the parsed modifier flags) check if the `implementing'
18867 method comes from an interface or not.
18869 * pending.cs (VerifyPendingMethods): Slightly better error
18872 * makefile: add test target that does the mcs bootstrap.
18874 2003-07-16 Ravi Pratap <ravi@ximian.com>
18876 * interface.cs (Define): Do nothing here since there are no
18877 members to populate etc. Move the attribute emission out of here
18878 since this was just totally the wrong place to put it. Attribute
18879 application happens during the 'Emit' phase, not in the 'Define'
18882 (Emit): Add this method and move the attribute emission here
18884 * rootcontext.cs (EmitCode): Call the Emit method on interface
18887 2003-07-14 Ravi Pratap M <ravi@ximian.com>
18889 * expression.cs (OverloadResolve): Report error only if Location
18890 is not 'Null' which means that there was a probe going on.
18892 2003-07-14 Martin Baulig <martin@ximian.com>
18894 * expression.cs (ConditionalLogicalOperator): New public class to
18895 implement user defined conditional logical operators.
18896 This is section 14.11.2 in the spec and bug #40505.
18898 2003-07-14 Martin Baulig <martin@ximian.com>
18900 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
18902 2003-07-14 Martin Baulig <martin@ximian.com>
18904 * codegen.cs (EmitContext.InFixedInitializer): New public field.
18906 * ecore.cs (IVariable.VerifyFixed): New interface method.
18908 * expression.cs (Unary.ResolveOperator): When resolving the `&'
18909 operator, check whether the variable is actually fixed. Fixes bug
18910 #36055. Set a variable definitely assigned when taking its
18911 address as required by the spec.
18913 * statement.cs (LocalInfo.IsFixed): New field.
18914 (LocalInfo.MakePinned): Set `IsFixed' to true.
18916 2003-07-14 Ravi Pratap M <ravi@ximian.com>
18918 * attribute.cs (Attribute.Resolve): While doing a Member lookup
18919 for .ctors, ensure that we only ask for members declared in the
18920 attribute type (BindingFlags.DeclaredOnly).
18924 * expression.cs (Error_WrongNumArguments): Report error 1501
18925 correctly the way CSC does.
18927 2003-07-13 Martin Baulig <martin@ximian.com>
18929 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
18930 lookup on the fully qualified name, to make things like "X.X" work
18931 where "X.X" is a fully qualified type name, but we also have a
18932 namespace "X" in the using list. Fixes #41975.
18934 2003-07-13 Martin Baulig <martin@ximian.com>
18936 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
18937 function. If we're a CompoundAssign, we need to create an embedded
18938 CompoundAssign, not an embedded Assign.
18939 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
18942 2003-07-13 Martin Baulig <martin@ximian.com>
18944 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
18945 work to fix bug #46088.
18947 2003-07-13 Ravi Pratap <ravi@ximian.com>
18949 * class.cs (Operator.Emit): Do not emit attributes here - it is
18950 taken care of by the Method class that we delegate too. This takes
18951 care of bug #45876.
18953 2003-07-10 Martin Baulig <martin@ximian.com>
18955 * expression.cs (TypeOfVoid): New class.
18956 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
18958 2003-07-10 Martin Baulig <martin@ximian.com>
18960 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
18963 2003-07-10 Martin Baulig <martin@ximian.com>
18965 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
18966 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
18968 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
18970 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
18972 2003-07-10 Martin Baulig <martin@ximian.com>
18974 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
18975 of decimal. Fixes #42850.
18977 NOTE: I also fixed the created byte blob, but this doesn't work on
18978 the MS runtime and csc never produces any byte blobs for decimal
18981 2003-07-10 Martin Baulig <martin@ximian.com>
18983 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
18984 structs; fixes #32068.
18985 (Block.AddChildVariableNames): Fixed #44302.
18987 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18989 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
18991 2003-07-07 Miguel de Icaza <miguel@ximian.com>
18993 * attribute.cs: And this test is onger needed.
18995 2003-07-08 Martin Baulig <martin@ximian.com>
18997 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
18998 inaccessible types. Fixes #36313.
19000 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
19002 * namespace.cs (NamespaceEntry): Create implicit entries for all
19003 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
19004 implicit entries for N1.N2 and N1.
19006 2003-07-08 Martin Baulig <martin@ximian.com>
19008 Rewrote the handling of namespaces to fix a lot of the issues
19009 wrt. `using' aliases etc.
19011 * namespace.cs (Namespace): Splitted this class into a
19012 per-assembly `Namespace' and a per-file `NamespaceEntry'.
19014 * typemanager.cs (TypeManager.IsNamespace): Removed.
19015 (TypeManager.ComputeNamespaces): Only compute namespaces from
19016 loaded assemblies here, not the namespaces from the assembly we're
19017 currently compiling.
19019 2003-07-08 Martin Baulig <martin@ximian.com>
19021 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
19023 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19025 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
19028 I thought about the memory savings here, but LookupTypeReflection
19029 is used under already very constrained scenarios. Compiling
19030 corlib or mcs only exposes one hit, so it would not really reduce
19031 any memory consumption.
19033 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19035 * typemanager.cs: fixes bug #45889 by only adding public types from
19036 other assemblies to the list of known types.
19038 2003-07-07 Miguel de Icaza <miguel@ximian.com>
19040 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
19041 on the type we resolved.
19043 2003-07-05 Martin Baulig <martin@ximian.com>
19045 * pending.cs (PendingImplementation.ParentImplements): Don't
19046 create the proxy if the parent is abstract.
19048 * class.cs (TypeContainer.DefineIndexers): Process explicit
19049 interface implementations first. Fixes #37714.
19051 2003-07-04 Miguel de Icaza <miguel@ximian.com>
19053 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
19054 defined recursively; but since we modify the input parameters
19055 (left is set to `this' temporarily), we reset this value if the
19056 left_is_explicit is false, which gives the original semantics to
19059 * literal.cs (NullPointer): new class used to represent a null
19060 literal in a pointer context.
19062 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
19063 type is a pointer, use a NullPointer object instead of a
19064 NullLiteral. Closes 43687
19066 (ExplicitConversion): Convert pointer values using
19067 the conv opcode to the proper type.
19069 * ecore.cs (New): change ValueTypeVariable property into a method,
19070 that returns whether the valuetype is suitable for being used.
19072 * expression.cs (Binary.DoNumericPromotions): Only return if we
19073 the int constant was a valid uint, and we can return both left and
19074 right as uints. If not, we continue processing, to trigger the
19075 type conversion. This fixes 39018.
19077 * statement.cs (Block.EmitMeta): During constant resolution, set
19078 the CurrentBlock property on the emitcontext, so that we resolve
19079 constants propertly.
19081 2003-07-02 Martin Baulig <martin@ximian.com>
19083 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
19084 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
19086 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
19087 than emitting it here.
19089 * statement.cs: Fixed some more flow analysis bugs.
19091 2003-07-02 Martin Baulig <martin@ximian.com>
19093 * class.cs (MethodData.Define): When implementing interface
19094 methods, set Final unless we're Virtual.
19096 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
19097 check work for interface methods.
19099 2003-07-01 Martin Baulig <martin@ximian.com>
19101 * ecore.cs (EmitContext.This): Replaced this property with a
19102 GetThis() method which takes a Location argument. This ensures
19103 that we get the correct error location for a CS0188.
19105 2003-07-01 Miguel de Icaza <miguel@ximian.com>
19107 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
19108 ImplicitStandardConversion.
19110 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
19112 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
19114 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
19117 2003-06-30 Miguel de Icaza <miguel@ximian.com>
19119 * class.cs (Constructor.Define): Turn off initlocals for unsafe
19122 (MethodData.Define): Turn off initlocals for unsafe methods.
19124 2003-06-29 Miguel de Icaza <miguel@ximian.com>
19126 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
19127 complete; Fixes #37521.
19129 * delegate.cs: Use Modifiers.TypeAttr to compute the
19130 TypeAttributes, instead of rolling our own. This makes the flags
19131 correct for the delegates.
19133 2003-06-28 Miguel de Icaza <miguel@ximian.com>
19135 * class.cs (Constructor.Define): Set the private flag for static
19136 constructors as well.
19138 * cs-parser.jay (statement_expression): Set the return value to
19139 null, to avoid a crash when we catch an error.
19141 2003-06-24 Miguel de Icaza <miguel@ximian.com>
19143 * cs-parser.jay: Applied patch from Jackson that adds support for
19144 extern and unsafe modifiers to destructor declarations.
19146 * expression.cs: Report error 21 if the user is trying to index a
19149 * driver.cs: Add an error message, suggested by the bug report.
19151 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
19152 if we do not have a ": this ()" constructor initializer. Fixes 45149
19154 2003-06-14 Miguel de Icaza <miguel@ximian.com>
19156 * namespace.cs: Add some information to reduce FAQs.
19158 2003-06-13 Miguel de Icaza <miguel@ximian.com>
19160 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
19161 underlying enumeration types. Fixes #43915.
19163 * expression.cs: Treat ushort/short as legal values to be used in
19164 bitwise operations.
19166 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
19168 * delegate.cs: transfer custom attributes for paramenters from
19169 the delegate declaration to Invoke and BeginInvoke.
19171 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
19173 * attribute.cs: handle custom marshalers and emit marshal info
19176 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
19178 * makefile.gnu: Added anonymous.cs to the compiler sources.
19180 2003-05-28 Miguel de Icaza <miguel@ximian.com>
19182 * iterators.cs: Change the name of the proxy class to include two
19185 * cs-parser.jay: Update grammar to include anonymous methods.
19187 * anonymous.cs: new file.
19189 2003-05-27 Miguel de Icaza <miguel@ximian.com>
19191 * class.cs (Field.Define): Add missing test for pointers and
19194 2003-05-27 Ravi Pratap <ravi@ximian.com>
19196 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
19197 we use the stobj opcode.
19199 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
19200 since it wasn't the correct fix.
19202 It still is puzzling that we are required to use stobj for IntPtr
19203 which seems to be a ValueType.
19205 2003-05-26 Miguel de Icaza <miguel@ximian.com>
19207 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
19208 during regular simple name resolution. Now, the trick is that
19209 instead of returning for processing the simplename, we do a
19210 TypeManager.LookupType (ie, a rooted lookup as opposed to a
19211 contextual lookup type). If a match is found, return that, if
19212 not, return for further composition.
19214 This fixes long-standing 30485.
19216 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19217 using the address to initialize an object, do an Stobj instead of
19218 using the regular Stelem.
19220 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
19221 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
19222 Because if we are a BaseIndexerAccess that value will be true.
19225 * statement.cs (GotoCase.Resolve): Return after reporting an
19226 error, do not attempt to continue.
19228 * expression.cs (PointerArithmetic.Emit): If our operand is a
19229 long, convert our constants to match the operand before
19230 multiplying. Convert to I type before adding. Fixes 43670.
19232 2003-05-14 Ravi Pratap <ravi@ximian.com>
19234 * enum.cs (ImplicitConversionExists) : Rename to
19235 ImplicitEnumConversionExists to remove ambiguity.
19237 * ecore.cs (NullCast): New type of cast expression class which
19238 basically is very similar to EmptyCast with the difference being
19239 it still is a constant since it is used only to cast a null to
19241 (eg. (string) null)
19243 * convert.cs (ImplicitReferenceConversion): When casting a null
19244 literal, we return a NullCast.
19246 * literal.cs (NullLiteralTyped): Remove - I don't see why this
19247 should be around anymore.
19249 The renaming (reported was slightly wrong). Corrections:
19251 ConvertImplicitStandard -> ImplicitConversionStandard
19252 ConvertExplicitStandard -> ExplicitConversionStandard
19254 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
19255 before passing them in !
19257 * convert.cs (ImplicitConversionStandard): When comparing for
19258 equal expr and target types, ensure that expr is not a
19261 In general, we must not be checking (expr_type ==
19262 target_type) in the top level conversion methods
19263 (ImplicitConversion, ExplicitConversion etc). This checking is
19264 done in the methods that they delegate to.
19266 2003-05-20 Miguel de Icaza <miguel@ximian.com>
19268 * convert.cs: Move Error_CannotConvertType,
19269 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
19270 ImplicitNumericConversion, ImplicitConversionExists,
19271 ImplicitUserConversionExists, StandardConversionExists,
19272 FindMostEncompassedType, FindMostSpecificSource,
19273 FindMostSpecificTarget, ImplicitUserConversion,
19274 ExplicitUserConversion, GetConversionOperators,
19275 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
19276 TryImplicitIntConversion, Error_CannotConvertImplicit,
19277 ConvertImplicitRequired, ConvertNumericExplicit,
19278 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
19279 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
19282 Perform the following renames:
19284 StandardConversionExists -> ImplicitStandardConversionExists
19285 ConvertImplicit -> ImplicitConversion
19286 ConvertImplicitStandard -> ImplicitStandardConversion
19287 TryImplicitIntConversion -> ImplicitIntConversion
19288 ConvertImplicitRequired -> ImplicitConversionRequired
19289 ConvertNumericExplicit -> ExplicitNumericConversion
19290 ConvertReferenceExplicit -> ExplicitReferenceConversion
19291 ConvertExplicit -> ExplicitConversion
19292 ConvertExplicitStandard -> ExplicitStandardConversion
19294 2003-05-19 Martin Baulig <martin@ximian.com>
19296 * statement.cs (TypeInfo.StructInfo): Made this type protected.
19297 (TypeInfo): Added support for structs having structs as fields.
19299 * ecore.cs (FieldExpr): Implement IVariable.
19300 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
19301 VariableInfo for the field.
19303 2003-05-18 Martin Baulig <martin@ximian.com>
19305 * expression.cs (This.DoResolve): Report a CS0027 if we're
19306 emitting a field initializer.
19308 2003-05-18 Martin Baulig <martin@ximian.com>
19310 * expression.cs (This.ResolveBase): New public function.
19311 (This.DoResolve): Check for CS0188.
19313 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
19316 * ecore.cs (MethodGroupExpr.DoResolve): Set the
19317 `instance_expression' to null if we don't have any non-static
19320 2003-05-18 Martin Baulig <martin@ximian.com>
19322 Reworked the way how local variables and parameters are handled by
19323 the flow analysis code.
19325 * statement.cs (TypeInfo, VariableMap): New public classes.
19326 (VariableInfo): New public class. This is now responsible for
19327 checking whether a variable has been assigned. It is used for
19328 parameters and local variables.
19329 (Block.EmitMeta): Take the InternalParameters as argument; compute
19330 the layout of the flow vectors here.
19331 (Block.LocalMap, Block.ParameterMap): New public properties.
19332 (FlowBranching): The .ctor doesn't get the InternalParameters
19333 anymore since Block.EmitMeta() now computes the layout of the flow
19335 (MyStructInfo): This class is now known as `StructInfo' and nested
19336 in `TypeInfo'; we don't access this directly anymore.
19338 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
19339 property and removed IsAssigned(), IsFieldAssigned(),
19340 SetAssigned() and SetFieldAssigned(); we now call them on the
19341 VariableInfo so we don't need to duplicate this code everywhere.
19343 * expression.cs (ParameterReference): Added `Block block' argument
19345 (LocalVariableReference, ParameterReference, This): The new
19346 VariableInfo class is now responsible for all the definite
19349 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
19350 IsParameterAssigned, SetParameterAssigned): Removed.
19352 2003-05-18 Martin Baulig <martin@ximian.com>
19354 * typemanager.cs (InitCoreTypes): Try calling
19355 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
19356 the 3-args-version. Corlib now also needs our `void_type'.
19357 (GetMethod): Added overloaded version which takes an optional
19358 `bool report_errors' to allow lookups of optional methods.
19360 2003-05-12 Martin Baulig <martin@ximian.com>
19362 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
19363 only used for locals and not for parameters.
19365 2003-05-12 Miguel de Icaza <miguel@ximian.com>
19367 * support.cs (InternalParameters.ParameterType): Return the
19368 ExternalType of the parameter.
19370 * parameter.cs (Parameter.ExternalType): drop the two arguments,
19373 2003-05-11 Miguel de Icaza <miguel@ximian.com>
19375 * class.cs (MethodData.Define): Do not set the `newslot' on
19376 interface members, if they are also flagged as "override".
19378 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
19379 better code for ++i and i++. This only works for static fields
19380 and local variables.
19382 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
19383 want to pull the DeclSpace out of the builder_to_declspace instead
19384 of the TypeBuilder (like in TypeContainer.FindMembers).
19386 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
19387 instead of LookupTypeContainer. Fixes the crash on .NET for
19388 looking up interface members.
19390 * const.cs: Create our own emit context during the Definition
19391 stage, so that constants are evaluated in the proper context, when
19392 a recursive definition happens.
19394 2003-05-11 Martin Baulig <martin@ximian.com>
19396 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
19397 new block for a switch section.
19398 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
19399 the adding/lookup in the switch block. Fixes #39828.
19401 2003-05-09 Miguel de Icaza <miguel@ximian.com>
19403 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
19404 functionality: I needed to convert the data after I had performed
19405 the add/sub operation into the operands type size.
19407 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
19408 pass the type for the box operation, otherwise the resulting
19409 object would have been of type object.
19411 (BoxedCast): Add constructor to specify the type to box as.
19413 2003-05-07 Miguel de Icaza <miguel@ximian.com>
19415 * iterators.cs: I was reusing the `count' variable inadvertently,
19416 take steps to not allow this to happen.
19418 2003-05-06 Miguel de Icaza <miguel@ximian.com>
19420 * attribute.cs (Attribute.Resolve): Params attributes are encoded
19421 by creating an array at the point where the params starts and
19422 putting all those arguments there, then adjusting the size of the
19425 2003-05-05 Miguel de Icaza <miguel@ximian.com>
19427 * expression.cs (New.AddressOf): Implement interface
19428 IMemoryLocation. This is used when the `new' operator is used in
19429 the context of an invocation to a method on a value type.
19431 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
19434 * namespace.cs: Also check the using aliases here.
19436 * driver.cs: Move the test for using validity after the types have
19437 been entered, so we do a single pass that also includes the using
19440 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
19441 in the regular case. CreateSiblingForFinally is doing extra
19444 * attribute.cs (GetAttributeArgumentExpression): Store the result
19445 on an out value, and use the return value to indicate failure
19446 instead of using null (which is a valid return for Constant.GetValue).
19448 * statement.cs: Perform the analysis flow for the increment
19449 portion after the statement, because this will be the real flow of
19450 execution. Fixes #42385
19452 * codegen.cs (EmitContext.EmitArgument,
19453 EmitContext.EmitStoreArgument): New helper functions when the
19454 RemapToProxy flag is set.
19456 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
19459 Add support for remapping parameters.
19461 * iterators.cs: Propagate parameter values; Store parameter
19462 values in the proxy classes.
19464 2003-05-04 Miguel de Icaza <miguel@ximian.com>
19466 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
19467 need a proxy reference; I do not know what I was thinking
19469 * cs-parser.jay (constructor_initializer): catch another error,
19470 and display nice message.
19472 (field_declaration): catch void field declaration
19473 to flag a better error.
19475 * class.cs (MemberBase.CheckBase): Report an error instead of a
19476 warning if a new protected member is declared in a struct.
19477 (Field.Define): catch the error of readonly/volatile.
19479 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
19481 (FieldExpr.AddressOf): ditto. Catch error where the address of a
19482 volatile variable is taken
19484 2003-05-02 Miguel de Icaza <miguel@ximian.com>
19486 * statement.cs (Fixed.Resolve): Report an error if we are not in
19489 2003-05-01 Miguel de Icaza <miguel@ximian.com>
19491 * typemanager.cs: reuse the code that handles type clashes for
19492 delegates and enumerations.
19494 * class.cs (Report28): Always report.
19496 * expression.cs (EncodeAsAttribute): Allow nulls here.
19498 2003-04-28 Miguel de Icaza <miguel@ximian.com>
19500 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
19501 the functionality for testing whether an expression is valid for
19502 an attribute here. Also handle the case of arrays of elements
19505 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
19506 encoding a linear array into an array of objects that are suitable
19507 to be passed to an CustomAttributeBuilder.
19509 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
19511 * ecore.cs: (FieldExpr): Handle field remapping here.
19513 * iteratators.cs: Pass the instance variable (if the method is an
19514 instance method) to the constructors, so we can access the field
19515 variables on the class.
19517 TODO: Test this with structs. I think the THIS variable on
19518 structs might have to be a pointer, and not a refenrece
19520 2003-04-27 Miguel de Icaza <miguel@ximian.com>
19522 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
19523 local variables to fields in a proxy class.
19525 * iterators.cs (PopulateProxy): Rename our internal fields to
19527 Create a <THIS> field if we are an instance method, so we can
19528 reference our parent container variables.
19529 (MapVariable): Called back from the EmitContext code to enter a
19530 new variable to field mapping into the proxy class (we just create
19534 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
19535 for using the remapped locals to fields.
19537 I placed the code here, because that gives the same semantics to
19538 local variables, and only changes the Emit code.
19540 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
19541 statements inside iterators.
19542 (VariableInfo): Add a FieldBuilder for the cases when we are
19543 remapping local variables to fields in a proxy class
19545 * ecore.cs (SimpleNameResolve): Avoid testing two times for
19546 current_block != null.
19548 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
19549 not cope with strings, as it has been moved to the
19550 TableSwitchEmit. Fixed bug in switch generation.
19552 * expression.cs (New.DoResolve): Provide more context for the user
19553 when reporting an error.
19555 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
19558 * expression.cs (MemberAccess.DoResolve): When we get a type back,
19559 check the permissions for it. Note than in a type-resolution
19560 context the check was already present in DeclSpace.ResolveType,
19561 but was missing from the MemberAccess.
19563 (ArrayCreation.CheckIndices): warn if the user has
19564 more nested levels of expressions, but there are no more
19565 dimensions specified. Avoids crash on bug 41906.
19567 2003-04-26 Miguel de Icaza <miguel@ximian.com>
19569 * statement.cs (Block): replace Implicit bool, for a generic
19571 New flag: `Unchecked'. This is used during the EmitMeta phase
19572 (which is out-of-line with the regular Resolve/Emit process for a
19573 statement, as this is done ahead of time, but still gets a chance
19574 to call constant resolve).
19576 (Block.Flags): new enum for adding a new flag.
19578 (Block.EmitMeta): track the state of unchecked.
19580 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
19581 to enable constant resolution to work there as well.
19583 2003-04-22 Miguel de Icaza <miguel@ximian.com>
19585 * typemanager.cs (ienumerable_type): Also look up
19586 System.Collections.IEnumerable.
19588 2003-04-21 Miguel de Icaza <miguel@ximian.com>
19590 TODO: Test more than one conditional per method.
19592 * class.cs (Indexer.Define): Report the location where the user is
19593 referencing the unsupported feature.
19595 (MethodData): Overload the use of `conditionals' to
19596 minimize the creation of needless ArrayLists. This saves roughly
19597 212kb on my machine.
19599 (Method): Implement the new IIteratorContainer interface.
19600 (Method.SetYields): Implement the method by setting the ModFlags
19601 to contain METHOD_YIELDS.
19603 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
19604 which just got set to null.
19606 * iterators.cs: New file.
19608 (Yield, YieldBreak): New statements.
19610 * statement.cs (Return.Resolve): Flag an error if we are used in
19611 an iterator method.
19613 * codegen.cs (InIterator): New flag set if the code is being
19614 compiled in an iterator method.
19616 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
19617 internal modifier, and we just use it to avoid adding extra
19618 fields, as this is seldom used.
19620 * cs-parser.jay: Add yield_statement (yield and yield break).
19622 * driver.cs: New flag -v2 to turn on version 2 features.
19624 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
19625 hashtable when v2 is enabled.
19627 2003-04-20 Miguel de Icaza <miguel@ximian.com>
19629 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
19630 there is already a namespace defined with this name.
19632 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
19633 people upgraded their corlibs.
19635 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
19636 always use fully qualified types, no need to use the compiler
19639 (TypeManager.IsNamespace): Use binarysearch.
19641 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
19642 AddDelegate): I did not quite use the new IsValid API properly: I
19643 have to pass the short-name and the fullname. I was passing only
19644 the basename instead of the fullname sometimes.
19646 (TypeContainer.DefineType): call NamespaceClash.
19648 * interface.cs (Interface.DefineType): use NamespaceClash before
19651 * delegate.cs (Delegate.DefineType): use NamespaceClash before
19654 * enum.cs: (Enum.DefineType): use NamespaceClash before
19657 * typemanager.cs (: 3-line patch that gives us some tasty 11%
19658 speed increase. First, use the negative_hits cache when we get a
19659 negative. Second, add the type with its full original name
19660 instead of the new . and + encoded name (reflection uses + to
19661 separate type from a nested type). Use LookupTypeReflection
19662 directly which bypasses the type->name hashtable (that we already
19663 know does not contain the type.
19665 * decl.cs (DeclSpace.ResolveTypeExpr): track the
19666 location/container type.
19668 * driver.cs: When passing utf8, use directly the UTF8Encoding.
19670 2003-04-19 Miguel de Icaza <miguel@ximian.com>
19672 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
19674 * delegate.cs (NewDelegate.Resolve): Test whether an instance
19675 method is being referenced in the method group from a static
19676 context, and report error 120 if so.
19678 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
19681 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
19682 is created, we create the A namespace).
19684 * cs-parser.jay: A namespace also introduces a DeclarationFound.
19687 2003-04-18 Miguel de Icaza <miguel@ximian.com>
19689 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
19690 invocation to ModuleBuilder.GetType with the same values will
19691 return a new type instance, so we need to cache its return
19694 * expression.cs (Binary.ResolveOperator): Only allow the compare
19695 operators on enums if they are of the same type.
19697 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
19698 types of ValueType on their own case. Before we were giving them
19699 the same treatment as objects.
19701 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
19702 fullname. Short name is used to compare against container name.
19703 Fullname is used to check against defined namespace names.
19705 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
19706 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
19708 (Method.CheckBase): Call parent.
19709 (MemberBase.CheckBase): Check for protected members on sealed
19711 (PropertyBase.CheckBase): Call parent.
19712 (Field.Define): Call parent.
19714 * report.cs: Negative error codes are now mapped to 8000 - code,
19715 so that the display is render more nicely.
19717 * typemanager.cs: Do not use try/catch, instead report a regular
19720 (GetPointerType, GetReferenceType): These methods provide
19721 mechanisms to obtain the T* and T& from a T. We had the code
19722 previously scattered around the code base, and it also used
19723 TypeManager.LookupType that would go through plenty of caches.
19724 This one goes directly to the type source.
19726 In some places we did the Type.GetType followed by
19727 ModuleBuilder.GetType, but not in others, so this unifies the
19728 processing as well.
19730 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
19731 statements now that we have namespace information.
19733 * typemanager.cs (IsNamespace): New method, returns whether the
19734 string presented is a namespace or not.
19736 (ComputeNamespaces): New public entry point, computes the list of
19737 available namespaces, using the GetNamespaces API call in Mono, or
19738 the slower version in MS.NET.
19740 Now before we start the semantic analysis phase, we have a
19741 complete list of namespaces including everything that the user has
19744 Deleted old code to cache namespaces in .nsc files.
19746 2003-04-17 Miguel de Icaza <miguel@ximian.com>
19748 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
19749 class/struct location definition Location for the implicit
19750 constructor location.
19752 (Operator.Define): Use the location of the operator for the
19753 implicit Method definition.
19755 (Constructor.Emit): use the constructor location for the implicit
19756 base initializer constructor.
19758 * ecore.cs: Remove ITypeExpression. This interface is now gone,
19759 and the Expression class now contains two new methods:
19761 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
19762 isolate type lookup from the rest of the resolution process.
19764 Since we use Expressions to hold type definitions due to the way
19765 we parse the input we have historically overloaded Resolve to
19766 perform the Type lookups if a special flag is passed. Now this is
19767 eliminated and two methods take their place.
19769 The differences in the two methods between xStep and xTerminal is
19770 that xStep is involved in our current lookup system that uses
19771 SimpleNames to compose a name, while xTerminal is used just to
19772 catch the case where the simplename lookup failed.
19774 2003-04-16 Miguel de Icaza <miguel@ximian.com>
19776 * expression.cs (ResolveMemberAccess): Remove redundant code.
19777 TypeExpr expressions are always born fully resolved.
19779 * interface.cs (PopulateMethod): Do not lookup the types twice.
19780 We were doing it once during SemanticAnalysis and once during
19783 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
19784 in local variable type definitions, were being returned as a
19785 SimpleName (we decomposed everything into a string), that is
19786 because primary_expression was being used instead of a type in the
19787 grammar (reduce/reduce conflicts).
19789 The part that was wrong is that we converted the expression into a
19790 string (an oversimplification in one hand, compounded with primary
19791 expressions doing string concatenation).
19797 Would return "A.B.C[]" as a SimpleName. This stopped things like
19798 using clauses from working on this particular context. And a type
19799 was being matched directly against "A.B.C[]".
19801 We now use the correct approach, and allow for ComposedCast to be
19802 part of the unary expression. So the "A.B.C []" become a composed
19803 cast of "A.B.C" (as a nested group of MemberAccess with a
19804 SimpleName at the end) plus the rank composition "[]".
19808 2003-04-10 Miguel de Icaza <miguel@ximian.com>
19810 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
19811 for the access level checking.
19813 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
19814 `TypeContainer container', because I kept getting confused when I
19815 was debugging this code.
19817 * expression.cs (Indexers): Instead of tracking getters/setters,
19818 we now track them in parallel. We create one arraylist less, but
19819 most importantly it is possible now for the LValue code to find a
19820 matching get for a set.
19822 (IndexerAccess.DoResolveLValue): Update the code.
19823 GetIndexersForType has been modified already to extract all the
19824 indexers from a type. The code assumed it did not.
19826 Also make the code set the correct return type for the indexer.
19827 This was fixed a long time ago for properties, but was missing for
19828 indexers. It used to be void_type.
19830 (Binary.Emit): Test first for doubles instead of
19831 floats, as they are more common.
19833 (Binary.EmitBranchable): Use the .un version of the branch opcodes
19834 when dealing with floats and the <=, >= operators. This fixes bug
19837 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
19838 to load the array value by emitting a load on the foreach variable
19839 type. This was incorrect.
19841 We now emit the code to load an element using the the array
19842 variable type, and then we emit the conversion operator.
19846 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
19848 * attribute.cs: Avoid allocation of ArrayLists in the common case.
19850 2003-04-09 Miguel de Icaza <miguel@ximian.com>
19852 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
19853 test for protection before we test for signatures.
19855 (MethodSignature.ToString): implement.
19857 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
19858 to the case where we reduced into a LongConstant.
19860 * decl.cs (CheckAccessLevel): If the type is an array, we can not
19861 depend on whether the information is acurrate, because the
19862 Microsoft runtime will always claim that the array type is public,
19863 regardless of the real state.
19865 If the type is a pointer, another problem happens: the type is
19866 reported as non-public in Microsoft.
19868 In both cases we have to call CheckAccessLevel recursively with
19869 the underlying type as the argument to be tested.
19871 2003-04-08 Miguel de Icaza <miguel@ximian.com>
19873 * assign.cs (Assign.Emit): If we are dealing with a compound
19874 assignment expression, we should use the code path that stores the
19875 intermediate result in a temporary value. This fixes #40903.
19877 *expression.cs (Indirection.ToString): Provide ToString method for
19880 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
19882 * class.cs: Null out fields holding references to Block objects so
19883 they can be garbage collected.
19885 * expression.cs (OverloadResolve): Remove unused local.
19887 2003-04-07 Martin Baulig <martin@ximian.com>
19889 * codegen.cs (EmitContext.CurrentFile): New public field.
19890 (EmitContext.Mark): Use the CurrentFile to check whether the
19891 location is in the correct file.
19892 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
19894 2003-04-07 Martin Baulig <martin@ximian.com>
19896 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
19898 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
19899 location. [FIXME: The location argument which gets passed to this
19900 method is sometimes wrong!]
19902 2003-04-07 Nick Drochak <ndrochak@gol.com>
19904 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
19906 2003-04-07 Miguel de Icaza <miguel@ximian.com>
19908 * expression.cs (Indirection.EmitAssign): We were using the
19909 temporary, but returning immediately instead of continuing the
19912 2003-04-06 Martin Baulig <martin@ximian.com>
19914 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
19915 if it's a nested child, but also deriving from the outer class.
19918 * typemanager.cs (IsNestedChildOf): Make this work if it's a
19919 nested child, but also deriving from the outer class. See
19921 (FilterWithClosure): We may access private members of the outer
19922 class if we're a nested child and deriving from the outer class.
19923 (RealMemberLookup): Only set `closure_private_ok' if the
19924 `original_bf' contained BindingFlags.NonPublic.
19926 2003-04-05 Martin Baulig <martin@ximian.com>
19928 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
19930 2003-04-02 Miguel de Icaza <miguel@ximian.com>
19932 * class.cs (Event.Define): Do not allow abstract events to have
19935 2003-04-01 Miguel de Icaza <miguel@ximian.com>
19937 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
19938 block in event declarations.
19940 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
19941 value type, get its address.
19943 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
19944 leaving a class on the stack instead of a boolean value (int
19945 0/1). Change the code so we compare against null, and then the
19946 result against zero.
19948 * class.cs (TypeContainer.GetClassBases): We were checking for the
19949 parent class being sealed too late.
19951 * expression.cs (Binary.Emit): For <= and >= when dealing with
19952 floating point values, use cgt.un and clt.un instead of cgt and
19955 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
19957 * statement.cs: Apply the same optimization as MS: skip the
19958 GetEnumerator returning an IEnumerator, and use the one returning a
19959 CharEnumerator instead. This allows us to avoid the try-finally block
19962 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
19964 * cs-parser.jay: Attributes cannot be applied to
19965 namespaces. Fixes #40473
19967 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19970 (Add*): check if the name is valid using the full name for constants,
19971 fields, properties and events.
19973 2003-03-28 Miguel de Icaza <miguel@ximian.com>
19975 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
19976 char constants to be part of the enumeration.
19978 * expression.cs (Conditional.DoResolve): Add support for operator
19979 true. Implements the missing functionality from 14.12
19981 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
19982 operator true/false as required by the spec.
19984 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
19985 implicit conversion to boolean.
19987 * statement.cs (Statement.ResolveBoolean): A boolean expression is
19988 also one where the type implements `operator true'.
19990 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
19991 get an expression that will invoke operator true based on an
19994 (GetConversionOperators): Removed the hack that called op_True
19997 (Expression.ResolveBoolean): Move this from Statement.
19999 2003-03-17 Miguel de Icaza <miguel@ximian.com>
20001 * ecore.cs (FieldExpr): do not allow initialization of initonly
20002 fields on derived classes
20004 2003-03-13 Martin Baulig <martin@ximian.com>
20006 * statement.cs (Block.Emit): Call ig.BeginScope() and
20007 ig.EndScope() when compiling with debugging info; call
20008 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
20010 2003-03-08 Miguel de Icaza <miguel@ximian.com>
20012 * expression.cs (Indexers): Do not construct immediately, allow
20013 for new members to be appended as we go. Fixes 38143
20015 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20017 * expression.cs: save/restore context when resolving an unchecked
20020 2003-03-05 Miguel de Icaza <miguel@ximian.com>
20022 * cfold.cs: Catch division by zero in modulus operator during
20025 2003-03-03 Miguel de Icaza <miguel@ximian.com>
20027 * interface.cs (Interface.DefineMembers): Avoid defining members
20030 2003-02-27 Miguel de Icaza <miguel@ximian.com>
20032 * driver.cs: handle the +/- options for -noconfig
20034 * statement.cs (Unckeched.Resolve): Also track the state of
20035 unchecked in the Resolve phase.
20037 2003-02-27 Martin Baulig <martin@ximian.com>
20039 * ecore.cs (Expression.MemberLookup): Don't create a
20040 MethodGroupExpr for something which is not a method. Fixes #38291.
20042 2003-02-25 Miguel de Icaza <miguel@ximian.com>
20044 * class.cs (MemberBase.CheckParameters): Also check that the type
20045 is unmanaged if it is a pointer.
20047 * expression.cs (SizeOf.Resolve): Add location information.
20049 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
20050 a managed type is declared.
20052 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
20053 parameter modifiers as well. Fixes bug 38606
20055 * class.cs: Very sad. Am backing out the speed up changes
20056 introduced by the ArrayList -> Array in the TypeContainer, as they
20057 were not actually that much faster, and introduced a bug (no error
20058 reports on duplicated methods).
20060 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
20061 source first, this will guarantee that we have a valid expression
20062 before calling in lower levels functions that will require a
20063 resolved object. Then use this original_source in the
20064 target.ResolveLValue instead of the original source that was
20067 Another change. Use target.Resolve instead of LValueResolve.
20068 Although we are resolving for LValues, we will let the Assign code
20069 take care of that (it will be called again from Resolve). This
20070 basically allows code like this:
20072 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
20073 class Y { void A (X x) { x [0] += o; }
20075 The problem was that the indexer was trying to resolve for
20076 set_Item (idx, object o) and never finding one. The real set_Item
20077 was set_Item (idx, X). By delaying the process we get the right
20082 2003-02-23 Martin Baulig <martin@ximian.com>
20084 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
20085 while calling DoEmit ().
20087 * codegen.cs (EmitContext.Mark): Don't mark locations in other
20088 source files; if you use the #line directive inside a method, the
20089 compiler stops emitting line numbers for the debugger until it
20090 reaches the end of the method or another #line directive which
20091 restores the original file.
20093 2003-02-23 Martin Baulig <martin@ximian.com>
20095 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
20097 2003-02-23 Martin Baulig <martin@ximian.com>
20099 * statement.cs (Block.AddChildVariableNames): We need to call this
20100 recursively, not just for our immediate children.
20102 2003-02-23 Martin Baulig <martin@ximian.com>
20104 * class.cs (Event.Define): Always make the field private, like csc does.
20106 * typemanager.cs (TypeManager.RealMemberLookup): Make events
20107 actually work, fixes bug #37521.
20109 2003-02-23 Miguel de Icaza <miguel@ximian.com>
20111 * delegate.cs: When creating the various temporary "Parameters"
20112 classes, make sure that we call the ComputeAndDefineParameterTypes
20113 on those new parameters (just like we do with the formal ones), to
20114 allow them to be resolved in the context of the DeclSpace.
20116 This fixes the bug that Dick observed in Bugzilla #38530.
20118 2003-02-22 Miguel de Icaza <miguel@ximian.com>
20120 * expression.cs (ResolveMemberAccess): When resolving a constant,
20121 do not attempt to pull a constant if the value was not able to
20122 generate a valid constant.
20124 * const.cs (LookupConstantValue): Do not report more errors than required.
20126 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20128 * expression.cs: fixes bug #38328.
20130 2003-02-18 Miguel de Icaza <miguel@ximian.com>
20132 * class.cs: Changed all the various members that can be part of a
20133 class from being an ArrayList to be an Array of the right type.
20134 During the DefineType type_list, interface_list, delegate_list and
20135 enum_list are turned into types, interfaces, delegates and enums
20138 And during the member population, indexer_list, event_list,
20139 constant_list, field_list, instance_constructor_list, method_list,
20140 operator_list and property_list are turned into their real arrays.
20142 Although we could probably perform this operation earlier, for
20143 good error reporting we need to keep the lists and remove the
20144 lists for longer than required.
20146 This optimization was triggered by Paolo profiling the compiler
20147 speed on the output of `gen-sample-program.pl' perl script.
20149 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
20150 not crash in methods like MemberLookupFailed that use this field.
20152 This problem arises when the compiler fails to resolve a type
20153 during interface type definition for example.
20155 2003-02-18 Miguel de Icaza <miguel@ximian.com>
20157 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
20158 inherit from System.Object, so we have to stop at null, not only
20159 when reaching System.Object.
20161 2003-02-17 Miguel de Icaza <miguel@ximian.com>
20163 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
20164 DeclaredOnly because the parent indexer might have had a different
20165 name, but did not loop until the top of the hierarchy was reached.
20167 The problem this one fixes is 35492: when a class implemented an
20168 indexer from an interface, we were getting the interface method
20169 (which was abstract) and we were flagging an error (can not invoke
20172 This also keeps bug 33089 functioning, and test-148 functioning.
20174 * typemanager.cs (IsSpecialMethod): The correct way of figuring
20175 out if a method is special is to see if it is declared in a
20176 property or event, or whether it is one of the predefined operator
20177 names. This should fix correctly #36804.
20179 2003-02-15 Miguel de Icaza <miguel@ximian.com>
20181 The goal here is to remove the dependency on EmptyCast.Peel ().
20182 Killing it completely.
20184 The problem is that currently in a number of places where
20185 constants are expected, we have to "probe" for an EmptyCast, and
20186 Peel, which is not the correct thing to do, as this will be
20187 repetitive and will likely lead to errors.
20189 The idea is to remove any EmptyCasts that are used in casts that
20190 can be reduced to constants, so we only have to cope with
20193 This bug hunt was triggered by Bug 37363 and the desire to remove
20194 the duplicate pattern where we were "peeling" emptycasts to check
20195 whether they were constants. Now constants will always be
20198 * ecore.cs: Use an enumconstant here instead of wrapping with
20201 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
20202 throwing me off. By handling this we can get rid of a few hacks.
20204 * statement.cs (Switch): Removed Peel() code.
20206 2003-02-14 Miguel de Icaza <miguel@ximian.com>
20208 * class.cs: Location information for error 508
20210 * expression.cs (New.DoResolve): Add a guard against double
20211 resolution of an expression.
20213 The New DoResolve might be called twice when initializing field
20214 expressions (see EmitFieldInitializers, the call to
20215 GetInitializerExpression will perform a resolve on the expression,
20216 and later the assign will trigger another resolution
20218 This leads to bugs (#37014)
20220 * delegate.cs: The signature for EndInvoke should contain any ref
20221 or out parameters as well. We were not doing this in the past.
20223 * class.cs (Field.Define): Do not overwrite the type definition
20224 inside the `volatile' group. Turns out that volatile enumerations
20225 were changing the type here to perform a validity test, which
20228 2003-02-12 Miguel de Icaza <miguel@ximian.com>
20230 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
20231 and structs, we do not want to load the instance variable
20233 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
20234 enum_type has to be handled like an object reference (implicit
20235 conversions exists from this to object), but the regular IsClass
20236 and IsValueType tests will never return true for this one.
20238 Also we use TypeManager.IsValueType instead of type.IsValueType,
20239 just for consistency with the rest of the code (this is only
20240 needed if we ever use the construct exposed by test-180.cs inside
20241 corlib, which we dont today).
20243 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
20245 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
20248 2003-02-09 Martin Baulig <martin@ximian.com>
20250 * namespace.cs (Namespace..ctor): Added SourceFile argument.
20251 (Namespace.DefineNamespaces): New static public method; this is
20252 called when we're compiling with debugging to add all namespaces
20253 to the symbol file.
20255 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
20256 pass it to the Namespace's .ctor.
20258 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
20259 and MethodBase arguments; pass the namespace ID to the symwriter;
20260 pass the MethodBase instead of the token to the symwriter.
20261 (SymbolWriter.DefineNamespace): New method to add a namespace to
20264 2003-02-09 Martin Baulig <martin@ximian.com>
20266 * symbolwriter.cs: New file. This is a wrapper around
20267 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
20268 methods here in near future.
20270 2003-02-09 Martin Baulig <martin@ximian.com>
20272 * codegen.cs (EmitContext.Mark): Just pass the arguments to
20273 ILGenerator.MarkSequencePoint() which are actually used by the
20276 2003-02-09 Martin Baulig <martin@ximian.com>
20278 * location.cs (SourceFile): New public sealed class. This
20279 contains the name and an index which is used in the location's token.
20280 (Location): Reserve an appropriate number of bits in the token for
20281 the source file instead of walking over that list, this gives us a
20282 really huge performance improvement when compiling with debugging.
20284 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
20285 `SourceFile' argument instead of a string.
20286 (Driver.ProcessFile): Add all the files via Location.AddFile(),
20287 but don't parse/tokenize here, we need to generate the list of all
20288 source files before we do that.
20289 (Driver.ProcessFiles): New static function. Parses/tokenizes all
20292 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
20293 instead of a string.
20295 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
20298 2003-02-09 Martin Baulig <martin@ximian.com>
20300 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
20301 filename on `#line default'.
20303 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
20305 * statement.cs: don't clear the pinned var when the fixed statement
20306 returns from the method (fixes bug#37752).
20308 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
20310 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
20313 2003-02-07 Martin Baulig <martin@ximian.com>
20315 * driver.cs: Removed the `--debug-args' command line argument.
20317 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
20318 automatically by the AsssemblyBuilder.
20319 (CodeGen.InitializeSymbolWriter): We don't need to call any
20320 initialization function on the symbol writer anymore. This method
20321 doesn't take any arguments.
20323 2003-02-03 Miguel de Icaza <miguel@ximian.com>
20325 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
20326 from referenced assemblies as well.
20328 2003-02-02 Martin Baulig <martin@ximian.com>
20330 * class.cs (MethodData.Emit): Generate debugging info for external methods.
20332 2003-02-02 Martin Baulig <martin@ximian.com>
20334 * class.cs (Constructor.Emit): Open the symbol writer before
20335 emitting the constructor initializer.
20336 (ConstructorInitializer.Emit): Call ec.Mark() to allow
20337 single-stepping through constructor initializers.
20339 2003-01-30 Miguel de Icaza <miguel@ximian.com>
20341 * class.cs: Handle error 549: do not allow virtual methods in
20344 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
20346 * decl.cs: Check access levels when resolving types
20348 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
20350 * statement.cs: Add parameters and locals set in catch blocks that might
20351 return to set vector
20353 2003-01-29 Miguel de Icaza <miguel@ximian.com>
20355 * class.cs (Operator): Set the SpecialName flags for operators.
20357 * expression.cs (Invocation.DoResolve): Only block calls to
20358 accessors and operators on SpecialName methods.
20360 (Cast.TryReduce): Handle conversions from char constants.
20363 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
20365 * statement.cs: small memory and time optimization in FlowBranching.
20367 2003-01-28 Pedro Mart <yoros@wanadoo.es>
20369 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
20370 problem that the last fix but in the other sid (Set).
20372 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
20373 access when there is no indexer in the hierarchy.
20375 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
20377 * class.cs: Combine some if statements.
20379 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20381 * driver.cs: fixed bug #37187.
20383 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
20385 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
20386 any indexer, it's needed to build a list with all the indexers in the
20387 hierarchy (AllGetters), else we have problems. Fixes #35653.
20389 2003-01-23 Miguel de Icaza <miguel@ximian.com>
20391 * class.cs (MethodData.Define): It is wrong for an interface
20392 implementation to be static in both cases: explicit and implicit.
20393 We were only handling this in one case.
20395 Improve the if situation there to not have negations.
20397 * class.cs (Field.Define): Turns out that we do not need to check
20398 the unsafe bit on field definition, only on usage. Remove the test.
20400 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20402 * driver.cs: use assembly.Location instead of Codebase (the latest
20403 patch made mcs fail when using MS assemblies).
20405 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
20407 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
20408 get the path to *corlib.dll.
20410 2003-01-21 Nick Drochak <ndrochak@gol.com>
20414 * typemanager.cs: Remove compiler warnings
20416 2003-01-20 Duncan Mak <duncan@ximian.com>
20418 * AssemblyInfo.cs: Bump the version number to 0.19.
20420 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20422 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
20424 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
20426 * class.cs (Constructor::Emit): Emit debugging info for constructors.
20428 2003-01-17 Miguel de Icaza <miguel@ximian.com>
20430 * cs-parser.jay: Small fix: we were not comparing the constructor
20431 name correctly. Thanks to Zoltan for the initial pointer.
20433 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
20435 * cs-tokenizer.cs: Set file name when specified with #line
20437 2003-01-15 Miguel de Icaza <miguel@ximian.com>
20439 * cs-parser.jay: Only perform the constructor checks here if we
20440 are named like the class; This will help provider a better
20441 error. The constructor path is taken when a type definition is
20442 not found, but most likely the user forgot to add the type, so
20443 report that rather than the constructor error.
20445 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
20447 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
20450 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20452 * cs-parser.jay: Add cleanup call.
20454 2003-01-13 Duncan Mak <duncan@ximian.com>
20456 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
20457 consistent with other methods.
20459 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20461 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
20463 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
20465 * attribute.cs: only set GuidAttr to true when we have a
20468 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20472 * typemanager.cs: fixes to allow mcs compile corlib with the new
20473 Type.IsSubclassOf fix.
20475 2003-01-08 Miguel de Icaza <miguel@ximian.com>
20477 * expression.cs (LocalVariableReference.DoResolve): Classify a
20478 constant as a value, not as a variable. Also, set the type for
20481 * cs-parser.jay (fixed_statement): take a type instead of a
20482 pointer_type, so we can produce a better error message later.
20484 * statement.cs (Fixed.Resolve): Flag types that are not pointers
20487 (For.DoEmit): Make inifinite loops have a
20488 non-conditional branch back.
20490 (Fixed.DoEmit): First populate the pinned variables, then emit the
20491 statement, then clear the variables. Before I was emitting the
20492 code once for each fixed piece.
20495 2003-01-08 Martin Baulig <martin@ximian.com>
20497 * statement.cs (FlowBranching.MergeChild): A break in a
20498 SWITCH_SECTION does not leave a loop. Fixes #36155.
20500 2003-01-08 Martin Baulig <martin@ximian.com>
20502 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
20503 lives in the same number space than `param_map'. Fixes #36154.
20505 2003-01-07 Miguel de Icaza <miguel@ximian.com>
20507 * cs-parser.jay (constructor_declaration): Set the
20508 Constructor.ModFlags before probing for it. This makes the
20509 compiler report 514, 515 and 132 (the code was there, but got
20512 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
20513 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
20514 (GotoCase.Resolve): Set `Returns' to ALWAYS.
20516 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
20518 * enum.cs: create the enum static fields using the enum type.
20520 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
20522 * class.cs: don't try to create the ParamBuilder for the return
20523 type if it's not needed (and handle it breaking for the ms runtime
20526 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
20528 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
20530 2002-12-29 Miguel de Icaza <miguel@ximian.com>
20532 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
20533 the command. This showed up while compiling the JANET source
20534 code, which used \r as its only newline separator.
20536 2002-12-28 Miguel de Icaza <miguel@ximian.com>
20538 * class.cs (Method.Define): If we are an operator (because it
20539 reuses our code), then set the SpecialName and HideBySig. #36128
20541 2002-12-22 Miguel de Icaza <miguel@ximian.com>
20543 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
20544 exception, report error 120 `object reference required'.
20546 * driver.cs: Add --pause option, used during to measure the size
20547 of the process as it goes with --timestamp.
20549 * expression.cs (Invocation.DoResolve): Do not allow methods with
20550 SpecialName to be invoked.
20552 2002-12-21 Miguel de Icaza <miguel@ximian.com>
20554 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
20555 number before adding it.
20557 2002-12-21 Ravi Pratap <ravi@ximian.com>
20559 * ecore.cs (StandardImplicitConversion): When in an unsafe
20560 context, we allow conversion between void * to any other pointer
20561 type. This fixes bug #35973.
20563 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
20565 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
20566 is not thrown when extensionless outputs are used
20568 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20570 * rootcontext.cs: fixed compilation of corlib.
20572 2002-12-19 Miguel de Icaza <miguel@ximian.com>
20574 * attribute.cs (Attributes.Contains): Add new method.
20576 * class.cs (MethodCore.LabelParameters): if the parameter is an
20577 `out' parameter, check that no attribute `[In]' has been passed.
20579 * enum.cs: Handle the `value__' name in an enumeration.
20581 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
20583 * decl.cs: Added special case to allow overrides on "protected
20586 2002-12-18 Ravi Pratap <ravi@ximian.com>
20588 * attribute.cs (Attributes.AddAttributeSection): Rename to this
20589 since it makes much more sense.
20591 (Attributes.ctor): Don't require a Location parameter.
20593 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
20595 * attribute.cs (ApplyAttributes): Remove extra Location parameters
20596 since we already have that information per attribute.
20598 * everywhere : make appropriate changes.
20600 * class.cs (LabelParameters): Write the code which actually
20601 applies attributes to the return type. We can't do this on the MS
20602 .NET runtime so we flag a warning in the case an exception is
20605 2002-12-18 Miguel de Icaza <miguel@ximian.com>
20607 * const.cs: Handle implicit null conversions here too.
20609 2002-12-17 Ravi Pratap <ravi@ximian.com>
20611 * class.cs (MethodCore.LabelParameters): Remove the extra
20612 Type [] parameter since it is completely unnecessary. Instead
20613 pass in the method's attributes so that we can extract
20614 the "return" attribute.
20616 2002-12-17 Miguel de Icaza <miguel@ximian.com>
20618 * cs-parser.jay (parse): Use Report.Error to flag errors instead
20619 of ignoring it and letting the compile continue.
20621 * typemanager.cs (ChangeType): use an extra argument to return an
20622 error condition instead of throwing an exception.
20624 2002-12-15 Miguel de Icaza <miguel@ximian.com>
20626 * expression.cs (Unary.TryReduce): mimic the code for the regular
20627 code path. Perform an implicit cast in the cases where we can
20628 implicitly convert to one of the integral types, and then reduce
20629 based on that constant. This fixes bug #35483.
20631 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20633 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
20635 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20637 * namespace.cs: fixed bug #35489.
20639 2002-12-12 Miguel de Icaza <miguel@ximian.com>
20641 * class.cs: Remove some dead code.
20643 * cs-parser.jay: Estimate the number of methods needed
20644 (RootContext.MethodCount);
20646 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
20647 numbers instead of StringBuilders.
20649 * support.cs (PtrHashtable): Add constructor with initial size;
20650 We can now reduce reallocations of the method table.
20652 2002-12-10 Ravi Pratap <ravi@ximian.com>
20654 * attribute.cs (ApplyAttributes): Keep track of the emitted
20655 attributes on a per-target basis. This fixes bug #35413.
20657 2002-12-10 Miguel de Icaza <miguel@ximian.com>
20659 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
20660 default to the Windows 1252 encoding.
20662 (UnixParseOption): Support version, thanks to Alp for the missing
20665 * AssemblyInfo.cs: Add nice assembly information.
20667 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
20670 * cs-parser.jay: Allow a trailing comma before the close bracked
20671 in the attribute_section production.
20673 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
20674 address of the instance was being taken, I will take this out,
20675 because we take the address of the object immediately here.
20677 2002-12-09 Ravi Pratap <ravi@ximian.com>
20679 * typemanager.cs (AreMultipleAllowed): Take care of the most
20680 obvious case where attribute type is not in the current assembly -
20683 2002-12-08 Miguel de Icaza <miguel@ximian.com>
20685 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
20686 definitions, instead of doing that afterwards.
20688 Also we use a nice little hack, depending on the constructor, we
20689 know if we are a "composed" name or a simple name. Hence, we
20690 avoid the IndexOf test, and we avoid
20692 * codegen.cs: Add code to assist in a bug reporter to track down
20693 the source of a compiler crash.
20695 2002-12-07 Ravi Pratap <ravi@ximian.com>
20697 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
20698 types have been emitted for a given element and flag an error
20699 if something which does not have AllowMultiple set is used more
20702 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
20703 attribute types and their corresponding AllowMultiple properties
20705 (AreMultipleAllowed): Check the property for a given type.
20707 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
20708 property in the case we have a TypeContainer.
20710 (Attributes.AddAttribute): Detect duplicates and just skip on
20711 adding them. This trivial fix catches a pretty gross error in our
20712 attribute emission - global attributes were being emitted twice!
20714 Bugzilla bug #33187 is now fixed.
20716 2002-12-06 Miguel de Icaza <miguel@ximian.com>
20718 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
20719 instead of pp_and).
20721 * expression.cs (Binary.ResolveOperator): I can only use the
20722 Concat (string, string, string) and Concat (string, string,
20723 string, string) if the child is actually a concatenation of
20726 2002-12-04 Miguel de Icaza <miguel@ximian.com>
20728 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
20729 context where we need a 2-character lookahead.
20731 * pending.cs (PendingImplementation): Rework so we can keep track
20732 of interface types all the time, and flag those which were
20733 implemented by parents as optional.
20735 2002-12-03 Miguel de Icaza <miguel@ximian.com>
20737 * expression.cs (Binary.ResolveOperator): Use
20738 String.Concat(string,string,string) or
20739 String.Concat(string,string,string,string) when possible.
20741 * typemanager: More helper methods.
20744 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
20746 * pending.cs: remove the bogus return from GetMissingInterfaces()
20747 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
20749 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20751 * namespace.cs: avoid duplicated 'using xxx' being added to
20752 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
20753 when we get more than one 'using' statement for the same namespace.
20754 Report a CS0105 warning for it.
20756 2002-11-30 Miguel de Icaza <miguel@ximian.com>
20758 * cs-tokenizer.cs (consume_identifier): use read directly, instead
20759 of calling getChar/putback, uses internal knowledge of it.
20761 (xtoken): Reorder tokenizer so most common patterns are checked
20762 first. This reduces the compilation time in another 5% (from 8.11s
20763 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
20765 The parsing time is 22% of the compilation in mcs, and from that
20766 64% is spent on the tokenization process.
20768 I tried using a binary search for keywords, but this is slower
20769 than the hashtable. Another option would be to do a couple of
20772 * Not use a StringBuilder, instead use an array of chars,
20773 with a set value. Notice that this way we could catch
20774 the 645 error without having to do it *afterwards*.
20776 * We could write a hand-parser to avoid the hashtable
20777 compares altogether.
20779 The identifier consumption process takes 37% of the tokenization
20780 time. Another 15% is spent on is_number. 56% of the time spent
20781 on is_number is spent on Int64.Parse:
20783 * We could probably choose based on the string length to
20784 use Int32.Parse or Int64.Parse and avoid all the 64-bit
20787 Another 3% is spend on wrapping `xtoken' in the `token' function.
20789 Handle 0xa0 as whitespace (#34752)
20791 2002-11-26 Miguel de Icaza <miguel@ximian.com>
20793 * typemanager.cs (IsCLRType): New routine to tell whether a type
20794 is one of the builtin types.
20796 Maybe it needs to use TypeCodes to be faster. Maybe we could use
20797 typecode in more places instead of doing pointer comparissions.
20798 We could leverage some knowledge about the way the typecodes are
20801 New code to cache namespaces in assemblies, it is currently not
20802 invoked, to be used soon.
20804 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
20806 * expression.cs (Binary.ResolveOperator): specially handle
20807 strings, and do not perform user-defined operator overloading for
20810 2002-11-24 Miguel de Icaza <miguel@ximian.com>
20812 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
20813 internalcall as it is a pretty simple operation; Avoid whenever
20814 possible to call Char.IsLetter.
20816 (consume_identifier): Cut by half the number of
20817 hashtable calls by merging the is_keyword and GetKeyword behavior.
20819 Do not short-circuit, because if we do, we
20820 report errors (ie, #if false && true would produce an invalid
20824 2002-11-24 Martin Baulig <martin@ximian.com>
20826 * expression.cs (Cast.TryReduce): If we're in checked syntax,
20827 check constant ranges and report a CS0221. Fixes #33186.
20829 2002-11-24 Martin Baulig <martin@ximian.com>
20831 * cs-parser.jay: Make this work for uninitialized variable
20832 declarations in the `for' initializer. Fixes #32416.
20834 2002-11-24 Martin Baulig <martin@ximian.com>
20836 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
20837 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
20839 2002-11-24 Martin Baulig <martin@ximian.com>
20841 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
20842 argument; if true, we also check for user-defined conversions.
20843 This is only needed if both arguments are of a user-defined type.
20844 Fixes #30443, added test-175.cs.
20845 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
20847 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
20849 2002-11-24 Martin Baulig <martin@ximian.com>
20851 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
20852 function to get the store opcode.
20853 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
20854 only emit the Ldelema if the store opcode is Stobj. You must run
20855 both test-34 and test-167 to test this. Fixes #34529.
20857 2002-11-23 Martin Baulig <martin@ximian.com>
20859 * ecore.cs (Expression.MemberLookup): Added additional
20860 `qualifier_type' argument which is used when we're being called
20861 from MemberAccess.DoResolve() and null if we're called from a
20863 (Expression.MemberLookupFailed): New method to report errors; this
20864 does the CS1540 check and reports the correct error message.
20866 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
20867 argument for the CS1540 check and redone the way how we're dealing
20868 with private members. See the comment in the source code for details.
20869 (FilterWithClosure): Reverted this back to revision 1.197; renamed
20870 `closure_start_type' to `closure_qualifier_type' and check whether
20871 it's not null. It was not this filter being broken, it was just
20872 being called with the wrong arguments.
20874 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
20875 and pass it the correct `qualifier_type'; this also does the error
20878 2002-11-22 Miguel de Icaza <miguel@ximian.com>
20880 * expression.cs (Invocation.EmitParams): If the we are dealing
20881 with a non-built-in value type, load its address as well.
20883 (ArrayCreation): Use a a pretty constant instead
20884 of the hardcoded value 2. Use 6 instead of 2 for the number of
20885 static initializers.
20887 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
20888 because they are not really value types, just glorified integers.
20890 * driver.cs: Do not append .exe, the CSC compiler does not do it.
20892 * ecore.cs: Remove redundant code for enumerations, make them use
20893 the same code path as everything else, fixes the casting issue
20894 with enumerations in Windows.Forms.
20896 * attribute.cs: Do only cast to string if it is a string, the
20897 validation happens later.
20899 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
20900 people upgrade their corlibs.
20902 * ecore.cs: Oops, enumerations were not following the entire code path
20904 2002-11-21 Miguel de Icaza <miguel@ximian.com>
20906 * typemanager.cs (FilterWithClosure): Commented out the test for
20907 1540 in typemanager.cs, as it has problems when accessing
20908 protected methods from a parent class (see test-174.cs).
20910 * attribute.cs (Attribute.ValidateGuid): new method.
20911 (Attribute.Resolve): Use above.
20913 2002-11-19 Miguel de Icaza <miguel@ximian.com>
20915 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
20917 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
20918 handling for enumerations, as we only needed the TypeContainer
20919 functionality to begin with (this is required for the fix below to
20920 work for enums that reference constants in a container class for
20923 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
20925 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
20926 a valid TypeBuilder to perform lookups on.o
20928 * class.cs (InheritableMemberSignatureCompare): Use true in the
20929 call to GetGetMethod and GetSetMethod, because we are comparing
20930 the signature, and we need to get the methods *even* if they are
20933 (PropertyBase.CheckBase): ditto.
20935 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
20936 GotoCase.Resolve): Use Peel on EmpytCasts.
20938 * ecore.cs (EmptyCast): drop child, add Peel method.
20940 2002-11-17 Martin Baulig <martin@ximian.com>
20942 * ecore.cs (EmptyCast.Child): New public property.
20944 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
20945 label resolved to an EmptyCast. Fixes #34162.
20946 (GotoCase.Resolve): Likewise.
20947 (Block.EmitMeta): Likewise.
20949 2002-11-17 Martin Baulig <martin@ximian.com>
20951 * expression.cs (Invocation.BetterConversion): Prefer int over
20952 uint; short over ushort; long over ulong for integer literals.
20953 Use ImplicitConversionExists instead of StandardConversionExists
20954 since we also need to check for user-defined implicit conversions.
20955 Fixes #34165. Added test-173.cs.
20957 2002-11-16 Martin Baulig <martin@ximian.com>
20959 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
20960 with the `true' and `false' literals. Fixes #33151.
20962 2002-11-16 Martin Baulig <martin@ximian.com>
20964 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
20965 October 22nd; don't do the cs1540 check for static members.
20967 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
20968 now using our own filter here and doing the cs1540 check again.
20970 2002-11-16 Martin Baulig <martin@ximian.com>
20972 * support.cs (InternalParameters): Don't crash if we don't have
20973 any fixed parameters. Fixes #33532.
20975 2002-11-16 Martin Baulig <martin@ximian.com>
20977 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
20978 when looking up static methods to make this work on Windows.
20981 2002-11-16 Martin Baulig <martin@ximian.com>
20983 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
20984 a setter rather than using PropertyInfo.CanWrite.
20986 2002-11-15 Nick Drochak <ndrochak@gol.com>
20988 * class.cs: Allow acces to block member by subclasses. Fixes build
20991 2002-11-14 Martin Baulig <martin@ximian.com>
20993 * class.cs (Constructor.Emit): Added the extern/block check.
20996 2002-11-14 Martin Baulig <martin@ximian.com>
20998 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
20999 iteration while looking for indexers, this is needed because the
21000 indexer may have a different name in our base classes. Fixed the
21001 error reporting (no indexers at all, not get accessor, no
21002 overloaded match). Fixes bug #33089.
21003 (IndexerAccess.DoResolveLValue): Likewise.
21005 2002-11-14 Martin Baulig <martin@ximian.com>
21007 * class.cs (PropertyBase.CheckBase): Make this work for multiple
21008 indexers. Fixes the first part of bug #33089.
21009 (MethodSignature.InheritableMemberSignatureCompare): Added support
21012 2002-11-13 Ravi Pratap <ravi@ximian.com>
21014 * attribute.cs (Attribute.Resolve): Catch the
21015 NullReferenceException and report it since it isn't supposed to
21018 2002-11-12 Miguel de Icaza <miguel@ximian.com>
21020 * expression.cs (Binary.EmitBranchable): Also handle the cases for
21021 LogicalOr and LogicalAnd that can benefit from recursively
21022 handling EmitBranchable. The code now should be nice for Paolo.
21024 2002-11-08 Miguel de Icaza <miguel@ximian.com>
21026 * typemanager.cs (LookupType): Added a negative-hit hashtable for
21027 the Type lookups, as we perform quite a number of lookups on
21028 non-Types. This can be removed once we can deterministically tell
21029 whether we have a type or a namespace in advance.
21031 But this might require special hacks from our corlib.
21035 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
21036 and double which avoids a conversion from an integer to a double.
21038 * expression.cs: tiny optimization, avoid calling IsConstant,
21039 because it effectively performs the lookup twice.
21041 2002-11-06 Miguel de Icaza <miguel@ximian.com>
21043 But a bogus return here to keep the semantics of the old code
21044 until the Mono runtime is fixed.
21046 * pending.cs (GetMissingInterfaces): New method used to remove all
21047 the interfaces that are already implemented by our parent
21048 classes from the list of pending methods.
21050 * interface.cs: Add checks for calls after ResolveTypeExpr.
21052 2002-11-05 Miguel de Icaza <miguel@ximian.com>
21054 * class.cs (Class.Emit): Report warning 67: event not used if the
21055 warning level is beyond 3.
21057 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
21058 being a NullLiteral.
21060 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
21063 * class.cs (TypeContainer.GetClassBases): Cover a missing code
21064 path that might fail if a type can not be resolved.
21066 * expression.cs (Binary.Emit): Emit unsigned versions of the
21069 * driver.cs: use error 5.
21071 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
21073 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
21075 2002-11-01 Miguel de Icaza <miguel@ximian.com>
21077 * cs-parser.jay (switch_section): A beautiful patch from Martin
21078 Baulig that fixed 33094.
21080 2002-10-31 Miguel de Icaza <miguel@ximian.com>
21082 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
21083 Check whether the base is abstract and report an error if so.
21085 * expression.cs (IndexerAccess.DoResolveLValue,
21086 IndexerAccess.DoResolve): ditto.
21088 (Invocation.DoResolve): ditto.
21090 (Invocation.FullMethodDesc): Improve the report string.
21092 * statement.cs (Block): Eliminate IsVariableDefined as it is
21093 basically just a wrapper for GetVariableInfo.
21095 * ecore.cs (SimpleName): Use new
21097 * support.cs (ReflectionParamter.ParameterType): We unwrap the
21098 type, as we return the actual parameter ref/unref state on a
21101 2002-10-30 Miguel de Icaza <miguel@ximian.com>
21103 * support.cs: Return proper flags REF/OUT fixing the previous
21106 * expression.cs: Reverted last patch, that was wrong. Is_ref is
21107 not used to mean `ref' but `ref or out' in ParameterReference
21109 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
21110 full type signature instead of calling TypeManger.CSharpName
21113 * support.cs (InternalParameters.ParameterDesc): Do not compare
21114 directly to the modflags, because REF/OUT will actually be bitsets
21117 * delegate.cs (VerifyMethod): Check also the modifiers.
21119 * cs-tokenizer.cs: Fix bug where floating point values with an
21120 exponent where a sign was missing was ignored.
21122 * driver.cs: Allow multiple assemblies to be specified in a single
21125 2002-10-28 Miguel de Icaza <miguel@ximian.com>
21127 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
21128 because identifiers after a parenthesis would end up in this kind
21129 of production, and we needed to desamiguate it for having casts
21132 (UserDefinedType *) xxx
21134 2002-10-24 Miguel de Icaza <miguel@ximian.com>
21136 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
21137 we should set on the Bindingflags.NonPublic, but not turn on
21138 private_ok. private_ok controls whether a Private member is
21139 returned (this is chekced on the filter routine), while the
21140 BindingFlags.NonPublic just controls whether private/protected
21141 will be allowed. This fixes the problem part of the problem of
21142 private properties being allowed to be used in derived classes.
21144 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
21145 so we can call the children DoResolveLValue method (this will
21146 properly signal errors on lvalue assignments to base properties)
21148 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
21149 getter are null, and we have a property info, we know that this
21150 happened because the lookup failed, so we report an error 122 for
21151 protection level violation.
21153 We also silently return if setter and getter are null in the
21154 resolve functions, this condition only happens if we have flagged
21155 the error before. This is the other half of the problem.
21157 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
21158 not have accessibility information, that is why we were returning
21159 true in the filter function in typemanager.cs.
21161 To properly report 122 (property is inaccessible because of its
21162 protection level) correctly, we report this error in ResolveAccess
21163 by failing if both the setter and the getter are lacking (ie, the
21166 DoResolve and DoLResolve have been modified to check for both
21167 setter/getter being null and returning silently, the reason being
21168 that I did not want to put the knowledge about this error in upper
21171 int old = Report.Errors;
21172 x = new PropertyExpr (...);
21173 if (old != Report.Errors)
21178 So the property expr is returned, but it is invalid, so the error
21179 will be flagged during the resolve process.
21181 * class.cs: Remove InheritablePropertySignatureCompare from the
21182 class, as we no longer depend on the property signature to compute
21183 whether it is possible to implement a method or not.
21185 The reason is that calling PropertyInfo.GetGetMethod will return
21186 null (in .NET, in Mono it works, and we should change this), in
21187 cases where the Get Method does not exist in that particular
21192 class X { public virtual int A { get { return 1; } } }
21194 class Z : Y { public override int A { get { return 2; } } }
21196 Would fail in Z because the parent (Y) would not have the property
21197 defined. So we avoid this completely now (because the alternative
21198 fix was ugly and slow), and we now depend exclusively on the
21201 (PropertyBase.CheckBase): Use a method-base mechanism to find our
21202 reference method, instead of using the property.
21204 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
21205 routines are gone now.
21207 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
21208 names, they were incorrectly named.
21210 * cs-tokenizer.cs: Return are more gentle token on failure.
21212 * pending.cs (PendingImplementation.InterfaceMethod): This routine
21213 had an out-of-sync index variable, which caused it to remove from
21214 the list of pending methods the wrong method sometimes.
21216 2002-10-22 Miguel de Icaza <miguel@ximian.com>
21218 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
21219 CanWrite, because those refer to this particular instance of the
21220 property, and do not take into account the fact that we can
21221 override single members of a property.
21223 Constructor requires an EmitContext. The resolution process does
21224 not happen here, but we need to compute the accessors before,
21225 because the resolution does not always happen for properties.
21227 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
21228 subclass, before we did not update this flag, but we did update
21231 (GetAccessors): Drop this routine, as it did not work in the
21232 presence of partially overwritten set/get methods.
21234 Notice that this broke the cs1540 detection, but that will require
21237 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21241 * driver.cs: issue a warning instead of an error if we don't support
21242 debugging for the platform. Also ignore a couple of errors that may
21243 arise when trying to write the symbols. Undo my previous patch.
21245 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21247 * driver.cs: ignore /debug switch except for Unix platforms.
21249 2002-10-23 Nick Drochak <ndrochak@gol.com>
21251 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
21253 2002-10-21 Miguel de Icaza <miguel@ximian.com>
21255 * driver.cs: Do not make mcs-debug conditional, so we do not break
21256 builds that use it.
21258 * statement.cs (UsageVector.MergeChildren): I would like Martin to
21259 review this patch. But basically after all the children variables
21260 have been merged, the value of "Breaks" was not being set to
21261 new_breaks for Switch blocks. I think that it should be set after
21262 it has executed. Currently I set this to the value of new_breaks,
21263 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
21264 conservative, but I do not understand this code very well.
21266 I did not break anything in the build, so that is good ;-)
21268 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
21270 2002-10-20 Mark Crichton <crichton@gimp.org>
21272 * cfold.cs: Fixed compile blocker. Really fixed it this time.
21274 2002-10-20 Nick Drochak <ndrochak@gol.com>
21276 * cfold.cs: Fixed compile blocker.
21278 2002-10-20 Miguel de Icaza <miguel@ximian.com>
21280 * driver.cs: I was chekcing the key, not the file.
21282 2002-10-19 Ravi Pratap <ravi@ximian.com>
21284 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
21285 message that we were generating - we just need to silently return
21288 2002-10-19 Miguel de Icaza <miguel@ximian.com>
21290 * class.cs (Event.Define): Change my previous commit, as this
21291 breaks the debugger. This is a temporary hack, as it seems like
21292 the compiler is generating events incorrectly to begin with.
21294 * expression.cs (Binary.ResolveOperator): Added support for
21295 "U operator - (E x, E y)"
21297 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
21300 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
21301 init-only variables, but this path did not take into account that
21302 there might be also instance readonly variables. Correct this
21305 This fixes bug 32253
21307 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
21310 * driver.cs: Change the extension for modules to `netmodule'
21312 * cs-parser.jay: Improved slightly the location tracking for
21313 the debugger symbols.
21315 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
21316 modifiers that were specified instead of the hardcoded value
21317 (FamAndAssem). This was basically ignoring the static modifier,
21318 and others. Fixes 32429.
21320 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
21321 fixed a bug in the process (32476)
21323 * expression.cs (ArrayAccess.EmitAssign): Patch from
21324 hwang_rob@yahoo.ca that fixes bug 31834.3
21326 2002-10-18 Miguel de Icaza <miguel@ximian.com>
21328 * driver.cs: Make the module extension .netmodule.
21330 2002-10-16 Miguel de Icaza <miguel@ximian.com>
21332 * driver.cs: Report an error if the resource file is not found
21333 instead of crashing.
21335 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
21336 false, like Emit does.
21338 2002-10-16 Nick Drochak <ndrochak@gol.com>
21340 * typemanager.cs: Remove unused private member. Also reported mcs
21341 bug to report this as a warning like csc.
21343 2002-10-15 Martin Baulig <martin@gnome.org>
21345 * statement.cs (Statement.Emit): Made this a virtual method; emits
21346 the line number info and calls DoEmit().
21347 (Statement.DoEmit): New protected abstract method, formerly knows
21348 as Statement.Emit().
21350 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
21352 2002-10-11 Miguel de Icaza <miguel@ximian.com>
21354 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
21355 have fixed a remaining problem: not every AddXXXX was adding a
21356 fully qualified name.
21358 Now everyone registers a fully qualified name in the DeclSpace as
21359 being defined instead of the partial name.
21361 Downsides: we are slower than we need to be due to the excess
21362 copies and the names being registered this way.
21364 The reason for this is that we currently depend (on the corlib
21365 bootstrap for instance) that types are fully qualified, because
21366 we dump all the types in the namespace, and we should really have
21367 types inserted into the proper namespace, so we can only store the
21368 basenames in the defined_names array.
21370 2002-10-10 Martin Baulig <martin@gnome.org>
21372 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
21373 from bug #31834, see the bug report for a testcase which is
21376 2002-10-10 Martin Baulig <martin@gnome.org>
21378 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
21379 flow analysis code for this.
21381 * statement.cs (Do, While, For): Tell the flow analysis code about
21383 (FlowBranching.UsageVector): Added support for infinite loops.
21384 (Block.Resolve): Moved the dead code elimination here and use flow
21387 2002-10-09 Miguel de Icaza <miguel@ximian.com>
21389 * class.cs (Field.Define): Catch cycles on struct type
21392 * typemanager.cs (IsUnmanagedtype): Do not recursively check
21393 fields if the fields are static. We only need to check instance
21396 * expression.cs (As.DoResolve): Test for reference type.
21398 * statement.cs (Using.ResolveExpression): Use
21399 ConvertImplicitRequired, not ConvertImplicit which reports an
21401 (Using.ResolveLocalVariableDecls): ditto.
21403 * expression.cs (Binary.ResolveOperator): Report errors in a few
21404 places where we had to.
21406 * typemanager.cs (IsUnmanagedtype): Finish implementation.
21408 2002-10-08 Miguel de Icaza <miguel@ximian.com>
21410 * expression.cs: Use StoreFromPtr instead of extracting the type
21411 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
21413 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
21414 an enumeration value to a System.Enum, but System.Enum is not a
21415 value type, but an class type, so we need to box.
21417 (Expression.ConvertExplicit): One codepath could return
21418 errors but not flag them. Fix this. Fixes #31853
21420 * parameter.cs (Resolve): Do not allow void as a parameter type.
21422 2002-10-06 Martin Baulig <martin@gnome.org>
21424 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
21425 if it's a class type and not a struct. Fixes #31815.
21427 2002-10-06 Martin Baulig <martin@gnome.org>
21429 * statement.cs: Reworked the flow analysis code a bit to make it
21430 usable for dead code elimination.
21432 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21434 * cs-parser.jay: allow empty source files. Fixes bug #31781.
21436 2002-10-04 Miguel de Icaza <miguel@ximian.com>
21438 * expression.cs (ComposedCast.DoResolveType): A quick workaround
21439 to fix the test 165, will investigate deeper.
21441 2002-10-04 Martin Baulig <martin@gnome.org>
21443 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
21444 finally blocks actually work.
21445 (Try.Resolve): We don't need to create a sibling for `finally' if
21446 there is no finally block.
21448 2002-10-04 Martin Baulig <martin@gnome.org>
21450 * class.cs (Constructor.Define): The default accessibility for a
21451 non-default constructor is private, not public.
21453 2002-10-04 Miguel de Icaza <miguel@ximian.com>
21455 * class.cs (Constructor): Make AllowedModifiers public, add
21458 * cs-parser.jay: Perform the modifiers test here, as the
21459 constructor for the Constructor class usually receives a zero
21460 because of the way we create it (first we create, later we
21461 customize, and we were never checking the modifiers).
21463 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
21464 is a version of LookupTypeReflection that includes the type-name
21465 cache. This can be used as a fast path for functions that know
21466 the fully qualified name and are only calling into *.GetType() to
21467 obtain a composed type.
21469 This is also used by TypeManager.LookupType during its type
21472 (LookupType): We now also track the real type name, as sometimes
21473 we can get a quey for the real type name from things like
21474 ComposedCast. This fixes bug 31422.
21476 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
21477 complete type fullname, it does not have to go through the type
21478 resolution system to obtain the composed version of the type (for
21479 obtaining arrays or pointers).
21481 (Conditional.Emit): Use the EmitBoolExpression to
21482 generate nicer code, as requested by Paolo.
21484 (ArrayCreation.CheckIndices): Use the patch from
21485 hwang_rob@yahoo.ca to validate the array initializers.
21487 2002-10-03 Miguel de Icaza <miguel@ximian.com>
21489 * class.cs (ConstructorInitializer.Emit): simplify code by using
21490 Invocation.EmitCall, and at the same time, fix the bugs in calling
21491 parent constructors that took variable arguments.
21493 * ecore.cs (Expression.ConvertNumericExplicit,
21494 Expression.ImplicitNumericConversion): Remove the code that
21495 manually wrapped decimal (InternalTypeConstructor call is now gone
21498 * expression.cs (Cast.TryReduce): Also handle decimal types when
21499 trying to perform a constant fold on the type.
21501 * typemanager.cs (IsUnmanagedtype): Partially implemented.
21503 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
21504 that only turned off an error report, and did nothing else.
21506 2002-10-02 Miguel de Icaza <miguel@ximian.com>
21508 * driver.cs: Handle and ignore /fullpaths
21510 2002-10-01 Miguel de Icaza <miguel@ximian.com>
21512 * expression.cs (Binary.ResolveOperator): Catch the case where
21513 DoNumericPromotions returns true,
21515 (Binary.DoNumericPromotions): Simplify the code, and the tests.
21517 2002-09-27 Miguel de Icaza <miguel@ximian.com>
21519 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
21522 2002-09-26 Miguel de Icaza <miguel@ximian.com>
21524 * ecore.cs (ConvertNumericExplicit): It is not enough that the
21525 conversion exists, but it is also required that the conversion be
21526 performed. This manifested in "(Type64Enum) 2".
21528 * class.cs (TypeManager.AddMethod): The fix is not to change
21529 AddEnum, because that one was using a fully qualified name (every
21530 DeclSpace derivative does), but to change the AddMethod routine
21531 that was using an un-namespaced name. This now correctly reports
21532 the duplicated name.
21534 Revert patch until I can properly fix it. The issue
21535 is that we have a shared Type space across all namespaces
21536 currently, which is wrong.
21538 Options include making the Namespace a DeclSpace, and merge
21539 current_namespace/current_container in the parser.
21541 2002-09-25 Miguel de Icaza <miguel@ximian.com>
21543 * cs-parser.jay: Improve error reporting when we get a different
21544 kind of expression in local_variable_type and
21545 local_variable_pointer_type.
21547 Propagate this to avoid missleading errors being reported.
21549 * ecore.cs (ImplicitReferenceConversion): treat
21550 TypeManager.value_type as a target just like object_type. As
21555 Is valid, and needs to result in the int 1 being boxed before it
21556 is assigned to the value type v.
21558 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
21559 to validate the enumeration name.
21561 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
21562 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
21563 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
21565 * ecore.cs (TryImplicitIntConversion): When doing an
21566 implicit-enumeration-conversion, check if the type is 64-bits and
21567 perform a conversion before passing to EnumConstant.
21569 2002-09-23 Miguel de Icaza <miguel@ximian.com>
21571 * decl.cs (Error_AmbiguousTypeReference); New routine used to
21572 report ambiguous type references. Unlike the MS version, we
21573 report what the ambiguity is. Innovation at work ;-)
21575 (DeclSpace.FindType): Require a location argument to
21576 display when we display an ambiguous error.
21578 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
21580 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
21582 * expression.cs (EmitDynamicInitializers): Apply patch from
21583 hwang_rob@yahoo.ca that fixes the order in which we emit our
21586 2002-09-21 Martin Baulig <martin@gnome.org>
21588 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
21589 delegate takes no arguments.
21591 2002-09-20 Miguel de Icaza <miguel@ximian.com>
21593 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
21596 * expression.cs: Extract the underlying type.
21598 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
21600 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
21602 2002-09-19 Miguel de Icaza <miguel@ximian.com>
21604 * class.cs (TypeContainer.DefineType): We can not use the nice
21605 PackingSize with the size set to 1 DefineType method, because it
21606 will not allow us to define the interfaces that the struct
21609 This completes the fixing of bug 27287
21611 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
21612 means also structs. This fixes part of the problem.
21613 (Expresion.ImplicitReferenceConversionExists): ditto.
21615 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
21616 error if there were no errors reported during the type lookup
21617 process, to avoid duplicates or redundant errors. Without this
21618 you would get an ambiguous errors plus a type not found. We have
21619 beaten the user enough with the first error.
21621 (DeclSparce.FindType): Emit a warning if we have an ambiguous
21624 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
21625 during the resolution process, stop the lookup, this avoids
21626 repeated error reports (same error twice).
21628 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
21630 * typemanager.cs (LookupType): Redo the type lookup code to match
21631 the needs of System.Reflection.
21633 The issue is that System.Reflection requires references to nested
21634 types to begin with a "+" sign instead of a dot. So toplevel
21635 types look like: "NameSpace.TopLevelClass", and nested ones look
21636 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
21639 2002-09-19 Martin Baulig <martin@gnome.org>
21641 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
21642 says that a method always returns or always throws an exception,
21643 don't report the CS0161.
21645 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
21646 set `Returns = new_returns'.
21648 2002-09-19 Martin Baulig <martin@gnome.org>
21650 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
21651 to an enum constant, check for a CS0176.
21653 2002-09-18 Miguel de Icaza <miguel@ximian.com>
21655 * class.cs (TypeContainer.CheckPairedOperators): Now we check
21656 for operators that must be in pairs and report errors.
21658 * ecore.cs (SimpleName.DoResolveType): During the initial type
21659 resolution process, when we define types recursively, we must
21660 check first for types in our current scope before we perform
21661 lookups in the enclosing scopes.
21663 * expression.cs (MakeByteBlob): Handle Decimal blobs.
21665 (Invocation.VerifyArgumentsCompat): Call
21666 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
21667 I thought we were supposed to always call this, but there are a
21668 few places in the code where we dont do it.
21670 2002-09-17 Miguel de Icaza <miguel@ximian.com>
21672 * driver.cs: Add support in -linkres and -resource to specify the
21673 name of the identifier.
21675 2002-09-16 Miguel de Icaza <miguel@ximian.com>
21677 * ecore.cs (StandardConversionExists): Sync with the conversion
21678 code: allow anything-* to void* conversions.
21680 (FindMostSpecificSource): Use an Expression argument
21681 instead of a Type, because we might be handed over a Literal which
21682 gets a few more implicit conversions that plain types do not. So
21683 this information was being lost.
21685 Also, we drop the temporary type-holder expression when not
21688 2002-09-17 Martin Baulig <martin@gnome.org>
21690 * class.cs (PropertyBase.CheckBase): Don't check the base class if
21691 this is an explicit interface implementation.
21693 2002-09-17 Martin Baulig <martin@gnome.org>
21695 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
21696 different `IndexerName' attributes.
21698 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
21699 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
21700 virtual CommonResolve().
21702 2002-09-16 Miguel de Icaza <miguel@ximian.com>
21704 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
21705 and convert that to the UnderlyingType.
21707 * statement.cs (Foreach.Resolve): Indexers are just like variables
21708 or PropertyAccesses.
21710 * cs-tokenizer.cs (consume_string): Track line numbers and columns
21711 inside quoted strings, we were not doing this before.
21713 2002-09-16 Martin Baulig <martin@gnome.org>
21715 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
21716 resolve it. This is needed for the definite assignment check of the
21717 instance expression, fixes bug #29846.
21718 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
21720 2002-09-16 Nick Drochak <ndrochak@gol.com>
21722 * parameter.cs: Fix compile error. Cannot reference static member
21723 from an instance object. Is this an mcs bug?
21725 2002-09-14 Martin Baulig <martin@gnome.org>
21727 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
21728 multiple times. Fixes bug #30295, added test-166.cs.
21730 2002-09-14 Martin Baulig <martin@gnome.org>
21732 * statement.cs (Block.Emit): Don't emit unreachable code.
21733 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
21734 `break' statements.
21735 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
21737 2002-09-14 Martin Baulig <martin@gnome.org>
21739 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
21742 2002-09-14 Martin Baulig <martin@gnome.org>
21744 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
21745 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
21746 be false on the ms runtime.
21748 2002-09-13 Martin Baulig <martin@gnome.org>
21750 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
21751 the CS0038 error message.
21753 2002-09-12 Miguel de Icaza <miguel@ximian.com>
21755 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
21756 constant inside, return it.
21758 2002-09-12 Martin Baulig <martin@gnome.org>
21760 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
21761 implicit conversion can be done between enum types.
21763 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
21764 check whether an implicit conversion to the current enum's UnderlyingType
21765 exists and report an error if not.
21767 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
21768 without debugging support.
21770 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
21771 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
21773 2002-09-12 Martin Baulig <martin@gnome.org>
21775 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
21777 * ecore.cs (IMemberExpr.DeclaringType): New property.
21778 (SimpleName.SimpleNameResolve): Check whether we're accessing a
21779 nonstatic member of an outer type (CS0038).
21781 2002-09-11 Miguel de Icaza <miguel@ximian.com>
21783 * driver.cs: Activate the using-error detector at warning level
21784 4 (at least for MS-compatible APIs).
21786 * namespace.cs (VerifyUsing): Small buglett fix.
21788 * pending.cs (PendingImplementation): pass the container pointer.
21790 * interface.cs (GetMethods): Allow for recursive definition. Long
21791 term, I would like to move every type to support recursive
21792 definitions, not the current ordering mechanism that we have right
21795 The situation is this: Attributes are handled before interfaces,
21796 so we can apply attributes to interfaces. But some attributes
21797 implement interfaces, we will now handle the simple cases
21798 (recursive definitions will just get an error).
21800 * parameter.cs: Only invalidate types at the end if we fail to
21803 2002-09-09 Martin Baulig <martin@gnome.org>
21805 * ecore.cs (PropertyExpr.Emit): Also check for
21806 TypeManager.system_int_array_get_length so this'll also work when
21807 compiling corlib. Fixes #30003.
21809 2002-09-09 Martin Baulig <martin@gnome.org>
21811 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
21812 and throw an exception if we can't get the type's size. Fixed #30040,
21815 2002-09-09 Martin Baulig <martin@gnome.org>
21817 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
21819 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
21820 context. Fixes bug #30027.
21822 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
21823 virtual functions. Fixes bug #30043, added test-164.cs.
21825 2002-09-08 Ravi Pratap <ravi@ximian.com>
21827 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
21829 2002-09-08 Nick Drochak <ndrochak@gol.com>
21831 * driver.cs: Use an object to get the windows codepage since it's not a
21834 2002-09-08 Miguel de Icaza <miguel@ximian.com>
21836 * statement.cs (For.Emit): for infinite loops (test == null)
21837 return whether there is a break inside, not always "true".
21839 * namespace.cs (UsingEntry): New struct to hold the name of the
21840 using definition, the location where it is defined, and whether it
21841 has been used in a successful type lookup.
21843 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
21848 2002-09-06 Ravi Pratap <ravi@ximian.com>
21850 * attribute.cs : Fix incorrect code which relied on catching
21851 a NullReferenceException to detect a null being passed in
21852 where an object was expected.
21854 2002-09-06 Miguel de Icaza <miguel@ximian.com>
21856 * statement.cs (Try): flag the catch variable as assigned
21858 * expression.cs (Cast): Simplified by using ResolveType instead of
21859 manually resolving.
21861 * statement.cs (Catch): Fix bug by using ResolveType.
21863 2002-09-06 Ravi Pratap <ravi@ximian.com>
21865 * expression.cs (BetterConversion): Special case for when we have
21866 a NullLiteral as the argument and we have to choose between string
21867 and object types - we choose string the way csc does.
21869 * attribute.cs (Attribute.Resolve): Catch the
21870 NullReferenceException and report error #182 since the Mono
21871 runtime no more has the bug and having this exception raised means
21872 we tried to select a constructor which takes an object and is
21875 2002-09-05 Ravi Pratap <ravi@ximian.com>
21877 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
21878 message (1502, 1503) when we can't locate a method after overload
21879 resolution. This is much more informative and closes the bug
21882 * interface.cs (PopulateMethod): Return if there are no argument
21883 types. Fixes a NullReferenceException bug.
21885 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
21886 expressions too. Previously we were checking only in one place for
21887 positional arguments leaving out named arguments.
21889 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
21890 type to the enum type is not allowed. Remove code corresponding to
21893 (ConvertNumericExplicit): Allow explicit conversions from
21894 the underlying type to enum type. This precisely follows the spec
21895 and closes a bug filed by Gonzalo.
21897 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21900 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
21902 2002-09-03 Miguel de Icaza <miguel@ximian.com>
21904 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
21905 it was important that we stored the right value after the
21906 reduction in `converted'.
21908 2002-09-04 Martin Baulig <martin@gnome.org>
21910 * location.cs (Location.SymbolDocument): Use full pathnames for the
21913 2002-08-30 Miguel de Icaza <miguel@ximian.com>
21915 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
21916 of the expression resolve mechanism, because that will catch the
21917 SimpleName error failures.
21919 (Conditional): If we can not resolve the
21920 expression, return, do not crash.
21922 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21925 (location): display token name instead of its number.
21927 2002-08-28 Martin Baulig <martin@gnome.org>
21929 * expression.cs (Binary.ResolveOperator): Don't silently return
21930 but return an error if an operator cannot be applied between two
21933 2002-08-28 Martin Baulig <martin@gnome.org>
21935 * class.cs (Constructor.Define): Set the permission attributes
21936 correctly instead of making all constructors public.
21938 2002-08-28 Martin Baulig <martin@gnome.org>
21940 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
21941 for private members before reporting a CS0103; if we find anything,
21944 2002-08-28 Martin Baulig <martin@gnome.org>
21946 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
21947 to check whether `closure_start_type == closure_invocation_type',
21948 we also need to check whether `m.DeclaringType == closure_invocation_type'
21949 before bypassing the permission checks. We might be accessing
21950 protected/private members from the base class.
21951 (TypeManager.RealMemberLookup): Only set private_ok if private
21952 members were requested via BindingFlags.NonPublic.
21954 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
21956 * expression.cs (MemberAccess.ResolveMemberAccess): Set
21957 MethodGroupExpr.IsExplicitImpl if appropriate.
21958 (Invocation.DoResolve): Don't report the CS0120 for explicit
21959 interface implementations.
21961 2002-08-27 Martin Baulig <martin@gnome.org>
21963 * expression.cs (Invocation.DoResolve): If this is a static
21964 method and we don't have an InstanceExpression, we must report
21967 2002-08-25 Martin Baulig <martin@gnome.org>
21969 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
21970 `==' between a valuetype and an object.
21972 2002-08-25 Miguel de Icaza <miguel@ximian.com>
21974 * ecore.cs (TypeExpr): Provide a ToString method.
21976 2002-08-24 Martin Baulig <martin@gnome.org>
21978 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
21979 now called proggie.dbg and it's a binary file.
21981 2002-08-23 Martin Baulig <martin@gnome.org>
21983 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
21985 2002-08-23 Martin Baulig <martin@gnome.org>
21987 * struct.cs (MyStructInfo.ctor): Make this work with empty
21988 structs; it's not allowed to use foreach() on null.
21990 2002-08-23 Martin Baulig <martin@gnome.org>
21992 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
21993 writer the full pathname of the generated assembly.
21995 2002-08-23 Martin Baulig <martin@gnome.org>
21997 * statements.cs (FlowBranching.UsageVector.MergeChildren):
21998 A `finally' block never returns or breaks; improved handling of
22001 2002-08-23 Martin Baulig <martin@gnome.org>
22003 * statement.cs (Throw.Resolve): Allow `throw null'.
22005 2002-08-23 Martin Baulig <martin@gnome.org>
22007 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
22008 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
22009 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
22010 MemberLookup would return a wrong event if this is an explicit
22011 interface implementation and the class has an event with the same
22014 2002-08-23 Martin Baulig <martin@gnome.org>
22016 * statement.cs (Block.AddChildVariableNames): New public method.
22017 (Block.AddChildVariableName): Likewise.
22018 (Block.IsVariableNameUsedInChildBlock): Likewise.
22019 (Block.AddVariable): Check whether a variable name has already
22020 been used in a child block.
22022 * cs-parser.jay (declare_local_variables): Mark all variable names
22023 from the current block as being used in a child block in the
22026 2002-08-23 Martin Baulig <martin@gnome.org>
22028 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
22029 find the symbol writer.
22031 * driver.cs: csc also allows the arguments to /define being
22032 separated by commas, not only by semicolons.
22034 2002-08-23 Martin Baulig <martin@gnome.org>
22036 * interface.cs (Interface.GetMembers): Added static check for events.
22038 2002-08-15 Martin Baulig <martin@gnome.org>
22040 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
22041 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
22043 * ecore.cs (Expression.MemberLookup): Added documentation and explained
22044 why the MethodData.EmitDestructor() change was necessary.
22046 2002-08-20 Martin Baulig <martin@gnome.org>
22048 * class.cs (TypeContainer.FindMembers): Added static check for events.
22050 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
22052 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
22053 use Type.GetEvents(), not Type.FindMembers().
22055 2002-08-20 Martin Baulig <martin@gnome.org>
22057 * decl.cs (MemberCache): Added a special method cache which will
22058 be used for method-only searched. This ensures that a method
22059 search will return a MethodInfo with the correct ReflectedType for
22062 2002-08-20 Martin Baulig <martin@gnome.org>
22064 * decl.cs (DeclSpace.FindMembers): Made this public.
22066 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22068 * delegate.cs: fixed build on windows.
22069 [FIXME: Filed as bug #29150: MCS must report these errors.]
22071 2002-08-19 Ravi Pratap <ravi@ximian.com>
22073 * ecore.cs (StandardConversionExists): Return a false
22074 if we are trying to convert the void type to anything else
22075 since that is not allowed.
22077 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
22078 we flag error 70 in the event an event is trying to be accessed
22079 directly from outside the declaring type.
22081 2002-08-20 Martin Baulig <martin@gnome.org>
22083 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
22084 MemberCache from typemanager.cs to decl.cs.
22086 2002-08-19 Martin Baulig <martin@gnome.org>
22088 * class.cs (TypeContainer): Implement IMemberContainer.
22089 (TypeContainer.DefineMembers): Create the MemberCache.
22090 (TypeContainer.FindMembers): Do better BindingFlags checking; only
22091 return public members if BindingFlags.Public was given, check
22092 whether members are static.
22094 2002-08-16 Martin Baulig <martin@gnome.org>
22096 * decl.cs (DeclSpace.Define): Splitted this in Define and
22097 DefineMembers. DefineMembers is called first and initializes the
22100 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
22101 DefineMembers() on all our DeclSpaces.
22103 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
22104 but call DefineMembers() on all nested interfaces. We call their
22105 Define() in our new Define() function.
22107 * interface.cs (Interface): Implement IMemberContainer.
22108 (Interface.Define): Moved all code except the attribute stuf to
22110 (Interface.DefineMembers): Initialize the member cache.
22112 * typemanager.cs (IMemberFinder): Removed this interface, we don't
22113 need this anymore since we can use MemberCache.FindMembers directly.
22115 2002-08-19 Martin Baulig <martin@gnome.org>
22117 * typemanager.cs (MemberCache): When creating the cache for an
22118 interface type, add all inherited members.
22119 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
22120 to `out bool used_cache' and documented it.
22121 (TypeManager.MemberLookup): If we already used the cache in the first
22122 iteration, we don't need to do the interfaces check.
22124 2002-08-19 Martin Baulig <martin@gnome.org>
22126 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
22127 here from IMemberFinder and don't implement this interface anymore.
22128 (DeclSpace.MemberCache): Moved here from IMemberFinder.
22130 * typemanager.cs (IMemberFinder): This interface is now only used by
22131 classes which actually support the member cache.
22132 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
22133 since we only put DeclSpaces into this Hashtable.
22134 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
22135 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
22137 2002-08-16 Martin Baulig <martin@gnome.org>
22139 * typemanager.cs (ICachingMemberFinder): Removed.
22140 (IMemberFinder.MemberCache): New property.
22141 (TypeManager.FindMembers): Merged this with RealFindMembers().
22142 This function will never be called from TypeManager.MemberLookup()
22143 so we can't use the cache here, just the IMemberFinder.
22144 (TypeManager.MemberLookup_FindMembers): Check whether the
22145 IMemberFinder has a MemberCache and call the cache's FindMembers
22147 (MemberCache): Rewrote larger parts of this yet another time and
22148 cleaned it up a bit.
22150 2002-08-15 Miguel de Icaza <miguel@ximian.com>
22152 * driver.cs (LoadArgs): Support quoting.
22154 (Usage): Show the CSC-like command line arguments.
22156 Improved a few error messages.
22158 2002-08-15 Martin Baulig <martin@gnome.org>
22160 * typemanager.cs (IMemberContainer.Type): New property.
22161 (IMemberContainer.IsInterface): New property.
22163 The following changes are conditional to BROKEN_RUNTIME, which is
22164 defined at the top of the file.
22166 * typemanager.cs (MemberCache.MemberCache): Don't add the base
22167 class'es members, but add all members from TypeHandle.ObjectType
22168 if we're an interface.
22169 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
22170 is the current type.
22171 (MemberCache.CacheEntry.Container): Removed this field.
22172 (TypeHandle.GetMembers): Include inherited members.
22174 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22176 * typemanager.cs: fixed compilation and added a comment on a field that
22179 2002-08-15 Martin Baulig <martin@gnome.org>
22181 * class.cs (ConstructorInitializer.Resolve): In the
22182 Expression.MemberLookup call, use the queried_type as
22185 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
22186 declared' attribute, it's always true.
22187 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
22188 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
22189 temporary wrapper for FindMembers which tells MemberLookup whether
22190 members from the base classes are included in the return value.
22191 This will go away soon.
22192 (TypeManager.MemberLookup): Use this temporary hack here; once the
22193 new MemberCache is completed, we don't need to do the DeclaredOnly
22194 looping here anymore since the MemberCache will take care of this.
22195 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
22196 (MemberCache): When creating the MemberCache for a class, get
22197 members from the current class and all its base classes.
22198 (MemberCache.CacheEntry.Container): New field. This is a
22199 temporary hack until the Mono runtime is fixed to distinguish
22200 between ReflectedType and DeclaringType. It allows us to use MCS
22201 with both the MS runtime and the unfixed Mono runtime without
22202 problems and without accecting performance.
22203 (MemberCache.SearchMembers): The DeclaredOnly looping from
22204 TypeManager.MemberLookup is now done here.
22206 2002-08-14 Martin Baulig <martin@gnome.org>
22208 * statement.cs (MyStructInfo.MyStructInfo): Don't call
22209 Type.GetFields on dynamic types but get the fields from the
22210 corresponding TypeContainer.
22211 (MyStructInfo.GetStructInfo): Added check for enum types.
22213 * typemanager.cs (MemberList.IsSynchronized): Implemented.
22214 (MemberList.SyncRoot): Implemented.
22215 (TypeManager.FilterWithClosure): No need to check permissions if
22216 closure_start_type == closure_invocation_type, don't crash if
22217 closure_invocation_type is null.
22219 2002-08-13 Martin Baulig <martin@gnome.org>
22221 Rewrote TypeContainer.FindMembers to use a member cache. This
22222 gives us a speed increase of about 35% for the self-hosting MCS
22223 build and of about 15-20% for the class libs (both on GNU/Linux).
22225 * report.cs (Timer): New class to get enhanced profiling. This
22226 whole class is "TIMER" conditional since it remarkably slows down
22229 * class.cs (MemberList): New class. This is an IList wrapper
22230 which we're now using instead of passing MemberInfo[]'s around to
22231 avoid copying this array unnecessarily.
22232 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
22233 (ICachingMemberFinder, IMemberContainer): New interface.
22234 (TypeManager.FilterWithClosure): If `criteria' is null, the name
22235 has already been checked, otherwise use it for the name comparision.
22236 (TypeManager.FindMembers): Renamed to RealMemberFinder and
22237 provided wrapper which tries to use ICachingMemberFinder.FindMembers
22238 if possible. Returns a MemberList, not a MemberInfo [].
22239 (TypeHandle): New class, implements IMemberContainer. We create
22240 one instance of this class per type, it contains a MemberCache
22241 which is used to do the member lookups.
22242 (MemberCache): New class. Each instance of this class contains
22243 all members of a type and a name-based hash table.
22244 (MemberCache.FindMembers): This is our new member lookup
22245 function. First, it looks up all members of the requested name in
22246 the hash table. Then, it walks this list and sorts out all
22247 applicable members and returns them.
22249 2002-08-13 Martin Baulig <martin@gnome.org>
22251 In addition to a nice code cleanup, this gives us a performance
22252 increase of about 1.4% on GNU/Linux - not much, but it's already
22253 half a second for the self-hosting MCS compilation.
22255 * typemanager.cs (IMemberFinder): New interface. It is used by
22256 TypeManager.FindMembers to call FindMembers on a TypeContainer,
22257 Enum, Delegate or Interface.
22258 (TypeManager.finder_to_member_finder): New PtrHashtable.
22259 (TypeManager.finder_to_container): Removed.
22260 (TypeManager.finder_to_delegate): Removed.
22261 (TypeManager.finder_to_interface): Removed.
22262 (TypeManager.finder_to_enum): Removed.
22264 * interface.cs (Interface): Implement IMemberFinder.
22266 * delegate.cs (Delegate): Implement IMemberFinder.
22268 * enum.cs (Enum): Implement IMemberFinder.
22270 * class.cs (TypeContainer): Implement IMemberFinder.
22272 2002-08-12 Martin Baulig <martin@gnome.org>
22274 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
22276 2002-08-12 Martin Baulig <martin@gnome.org>
22278 * ecore.cs (ITypeExpression): New interface for expressions which
22280 (TypeExpression): Renamed to TypeLookupExpression.
22281 (Expression.DoResolve): If we're doing a types-only lookup, the
22282 expression must implement the ITypeExpression interface and we
22283 call DoResolveType() on it.
22284 (SimpleName): Implement the new ITypeExpression interface.
22285 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
22286 hack, the situation that we're only looking up types can't happen
22287 anymore when this method is called. Moved the type lookup code to
22288 DoResolveType() and call it.
22289 (SimpleName.DoResolveType): This ITypeExpression interface method
22290 is now doing the types-only lookup.
22291 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
22292 (ResolveFlags): Added MaskExprClass.
22294 * expression.cs (MemberAccess): Implement the ITypeExpression
22296 (MemberAccess.DoResolve): Added support for a types-only lookup
22297 when we're called via ITypeExpression.DoResolveType().
22298 (ComposedCast): Implement the ITypeExpression interface.
22300 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
22301 Expression.Resolve() with ResolveFlags.Type instead.
22303 2002-08-12 Martin Baulig <martin@gnome.org>
22305 * interface.cs (Interface.Define): Apply attributes.
22307 * attribute.cs (Attribute.ApplyAttributes): Added support for
22308 interface attributes.
22310 2002-08-11 Martin Baulig <martin@gnome.org>
22312 * statement.cs (Block.Emit): Only check the "this" variable if we
22313 do not always throw an exception.
22315 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
22316 whether the property has a set accessor.
22318 2002-08-11 Martin Baulig <martin@gnome.org>
22320 Added control flow analysis support for structs.
22322 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
22323 with control flow analysis turned off.
22324 (IVariable): New interface.
22325 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
22326 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
22327 (FieldExpr.DoResolve): Resolve the instance expression with flow
22328 analysis turned off and do the definite assignment check after the
22329 resolving when we know what the expression will resolve to.
22331 * expression.cs (LocalVariableReference, ParameterReference):
22332 Implement the new IVariable interface, only call the flow analysis
22333 code if ec.DoFlowAnalysis is true.
22334 (This): Added constructor which takes a Block argument. Implement
22335 the new IVariable interface.
22336 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
22337 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
22338 This does the definite assignment checks for struct members.
22340 * class.cs (Constructor.Emit): If this is a non-static `struct'
22341 constructor which doesn't have any initializer, call
22342 Block.AddThisVariable() to tell the flow analysis code that all
22343 struct elements must be initialized before control returns from
22346 * statement.cs (MyStructInfo): New public class.
22347 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
22348 argument to this indexer. If non-zero, check an individual struct
22349 member, not the whole struct.
22350 (FlowBranching.CheckOutParameters): Check struct members.
22351 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
22352 overloaded versions of these methods which take an additional
22353 `int field_idx' argument to check struct members.
22354 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
22355 overloaded versions of these methods which take an additional
22356 `string field_name' argument to check struct member.s
22357 (VariableInfo): Implement the IVariable interface.
22358 (VariableInfo.StructInfo): New public property. Returns the
22359 MyStructInfo instance of the variable if it's a struct or null.
22360 (Block.AddThisVariable): New public method. This is called from
22361 Constructor.Emit() for non-static `struct' constructor which do
22362 not have any initializer. It creates a special variable for the
22363 "this" instance variable which will be checked by the flow
22364 analysis code to ensure that all of the struct's fields are
22365 initialized before control returns from the constructor.
22366 (UsageVector): Added support for struct members. If a
22367 variable/parameter is a struct with N members, we reserve a slot
22368 in the usage vector for each member. A struct is considered fully
22369 initialized if either the struct itself (slot 0) or all its
22370 members are initialized.
22372 2002-08-08 Martin Baulig <martin@gnome.org>
22374 * driver.cs (Driver.MainDriver): Only report an error CS5001
22375 if there were no compilation errors.
22377 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
22378 `UnsafeContext' property to determine whether the parent is in
22379 unsafe context rather than checking the parent's ModFlags:
22380 classes nested in an unsafe class are unsafe as well.
22382 2002-08-08 Martin Baulig <martin@gnome.org>
22384 * statement.cs (UsageVector.MergeChildren): Distinguish between
22385 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
22386 we return. Added test17() and test18() to test-154.cs.
22388 2002-08-08 Martin Baulig <martin@gnome.org>
22390 * typemanager.cs (TypeManager.FilterWithClosure): If we have
22391 Family access, make sure the invoking type isn't a subclass of the
22392 queried type (that'd be a CS1540).
22394 * ecore.cs (Expression.MemberLookup): Added overloaded version of
22395 this method which takes an additional `Type invocation_type'.
22397 * expression.cs (BaseAccess.DoResolve): Use the base type as
22398 invocation and query type.
22399 (MemberAccess.DoResolve): If the lookup failed and we're about to
22400 report a CS0122, try a lookup with the ec.ContainerType - if this
22401 succeeds, we must report a CS1540.
22403 2002-08-08 Martin Baulig <martin@gnome.org>
22405 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
22406 (MethodGroupExpr): Implement the IMemberExpr interface.
22408 * expression (MemberAccess.ResolveMemberAccess): No need to have
22409 any special code for MethodGroupExprs anymore, they're now
22412 2002-08-08 Martin Baulig <martin@gnome.org>
22414 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
22415 Family, FamANDAssem and FamORAssem permissions.
22416 (TypeManager.IsSubclassOrNestedChildOf): New public method.
22418 2002-08-08 Martin Baulig <martin@gnome.org>
22420 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
22421 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
22424 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
22426 * driver.cs: implemented /resource option to embed managed resources.
22428 2002-08-07 Martin Baulig <martin@gnome.org>
22430 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
22431 (FieldBase.HasFieldInitializer): New public property.
22432 (FieldBase.GetInitializerExpression): New public method. Resolves and
22433 returns the field initializer and makes sure it is only resolved once.
22434 (TypeContainer.EmitFieldInitializers): Call
22435 FieldBase.GetInitializerExpression to get the initializer, this ensures
22436 that it isn't resolved multiple times.
22438 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
22439 the resolving process (SimpleName/MemberLookup) that we're currently
22440 emitting a field initializer (which must not access any instance members,
22441 this is an error CS0236).
22443 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
22444 argument, if the `IsFieldInitializer' flag is set, we must report and
22445 error CS0236 and not an error CS0120.
22447 2002-08-07 Martin Baulig <martin@gnome.org>
22449 * ecore.cs (IMemberExpr): New public interface.
22450 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
22451 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
22452 if the expression is an IMemberExpr.
22454 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
22455 to be null, implicitly default to `this' if we're non-static in
22456 this case. Simplified the code a lot by using the new IMemberExpr
22457 interface. Also fixed bug #28176 here.
22459 2002-08-06 Martin Baulig <martin@gnome.org>
22461 * cs-parser.jay (SimpleLookup): Removed. We need to create
22462 ParameterReferences during semantic analysis so that we can do a
22463 type-only search when resolving Cast, TypeOf and SizeOf.
22464 (block): Pass the `current_local_parameters' to the Block's
22467 * class.cs (ConstructorInitializer): Added `Parameters parameters'
22468 argument to the constructor.
22469 (ConstructorInitializer.Resolve): Create a temporary implicit
22470 block with the parameters.
22472 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
22473 references here if we aren't doing a type-only search.
22475 * statement.cs (Block): Added constructor which takes a
22476 `Parameters parameters' argument.
22477 (Block.Parameters): New public property.
22479 * support.cs (InternalParameters.Parameters): Renamed `parameters'
22480 to `Parameters' and made it public readonly.
22482 2002-08-06 Martin Baulig <martin@gnome.org>
22484 * ecore.cs (Expression.Warning): Made this public as well.
22486 * report.cs (Report.Debug): Print the contents of collections.
22488 2002-08-06 Martin Baulig <martin@gnome.org>
22490 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
22491 used to tell Resolve() which kinds of expressions it may return.
22492 (Expression.Resolve): Added overloaded version of this method which
22493 takes a `ResolveFlags flags' argument. This can be used to tell
22494 Resolve() which kinds of expressions it may return. Reports a
22496 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
22497 ResolveFlags.SimpleName.
22498 (Expression.Error118): Added overloaded version of this method which
22499 takes a `ResolveFlags flags' argument. It uses the flags to determine
22500 which kinds of expressions are allowed.
22502 * expression.cs (Argument.ResolveMethodGroup): New public method.
22503 Resolves an argument, but allows a MethodGroup to be returned.
22504 This is used when invoking a delegate.
22506 * TODO: Updated a bit.
22508 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22510 Fixed compilation with csc.
22512 * ecore.cs: Expression.Error made public. Is this correct? Should
22513 Warning be made public too?
22515 * expression.cs: use ea.Location instead of ea.loc.
22516 [FIXME: Filed as bug #28607: MCS must report these errors.]
22518 2002-08-06 Martin Baulig <martin@gnome.org>
22520 * ecore.cs (Expression.loc): Moved the location here instead of
22521 duplicating it in all derived classes.
22522 (Expression.Location): New public property.
22523 (Expression.Error, Expression.Warning): Made them non-static and
22524 removed the location argument.
22525 (Expression.Warning): Added overloaded version which takes an
22526 `int level' argument.
22527 (Expression.Error118): Make this non-static and removed the
22528 expression and location arguments.
22529 (TypeExpr): Added location argument to the constructor.
22531 * expression.cs (StaticCallExpr): Added location argument to
22533 (Indirection, PointerArithmetic): Likewise.
22534 (CheckedExpr, UnCheckedExpr): Likewise.
22535 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
22536 (StringPtr): Likewise.
22539 2002-08-05 Martin Baulig <martin@gnome.org>
22541 * expression.cs (BaseAccess.DoResolve): Actually report errors.
22543 * assign.cs (Assign.DoResolve): Check whether the source
22544 expression is a value or variable.
22546 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
22547 while resolving the corresponding blocks.
22549 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
22550 an error, don't silently return null.
22552 * statement.cs (Block.AddVariable): Do the error reporting here
22553 and distinguish between CS0128 and CS0136.
22554 (Block.DoResolve): Report all unused labels (warning CS0164).
22555 (LabeledStatement): Pass the location to the constructor.
22556 (LabeledStatement.HasBeenReferenced): New property.
22557 (LabeledStatement.Resolve): Set it to true here.
22559 * statement.cs (Return.Emit): Return success even after reporting
22560 a type mismatch error (CS0126 or CS0127), this is what csc does and
22561 it avoids confusing the users with any consecutive errors.
22563 2002-08-05 Martin Baulig <martin@gnome.org>
22565 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
22567 * const.cs (Const.LookupConstantValue): Catch circular definitions.
22569 * expression.cs (MemberAccess.DoResolve): Silently return if an
22570 error has already been reported.
22572 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
22573 error has already been reported.
22575 2002-08-05 Martin Baulig <martin@gnome.org>
22577 * statement.cs (UsageVector): Only initialize the `parameters'
22578 vector if we actually have any "out" parameters.
22580 2002-08-05 Martin Baulig <martin@gnome.org>
22582 * expression.cs (Binary.ResolveOperator): When combining delegates,
22583 they must have the same type.
22585 2002-08-05 Martin Baulig <martin@gnome.org>
22587 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
22588 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
22589 work with the ms runtime and we also don't need it: if we're a
22590 PropertyBuilder and not in the `indexer_arguments' hash, then we
22591 are a property and not an indexer.
22593 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
22594 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
22595 since the latter one doesn't work with the ms runtime.
22597 2002-08-03 Martin Baulig <martin@gnome.org>
22599 Fixed bugs #27998 and #22735.
22601 * class.cs (Method.IsOperator): New public field.
22602 (Method.CheckBase): Report CS0111 if there's already a method
22603 with the same parameters in the current class. Report CS0508 when
22604 attempting to change the return type of an inherited method.
22605 (MethodData.Emit): Report CS0179 if a method doesn't have a body
22606 and it's not marked abstract or extern.
22607 (PropertyBase): New abstract base class for Property and Indexer.
22608 (PropertyBase.CheckBase): Moved here from Property and made it work
22610 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
22611 the same so we can reuse it there.
22612 (Property, Indexer): Derive from PropertyBase.
22613 (MethodSignature.inheritable_property_signature_filter): New delegate
22614 to find properties and indexers.
22616 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
22617 argument and improved error reporting.
22619 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
22620 EmptyReadOnlyParameters and made it a property.
22622 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
22623 version of this method which takes a `PropertyInfo indexer'.
22624 (TypeManager.RegisterIndexer): New method.
22626 * class.cs: Added myself as author of this file :-)
22628 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22630 * class.cs: fixed compilation on windoze.
22632 2002-08-03 Martin Baulig <martin@gnome.org>
22634 * interface.cs (Interface.GetInterfaceBases): Check whether all
22635 base interfaces are at least as accessible than the current one.
22637 * class.cs (TypeContainer.GetClassBases): Check whether base types
22638 are at least as accessible than the current type.
22639 (TypeContainer.AsAccessible): Implemented and made non-static.
22640 (MemberBase.CheckParameters): Report errors if the accessibility
22643 * delegate.cs (Delegate.Delegate): The default visibility is
22644 internal for top-level types and private for nested types.
22645 (Delegate.Define): Report errors if the accessibility checks fail.
22647 * enum.cs (Enum.Enum): The default visibility is internal for
22648 top-level types and private for nested types.
22649 (Enum.DefineType): Compute the correct visibility.
22651 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
22652 function which takes a `bool is_toplevel' instead of a TypeContainer.
22654 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
22657 2002-08-02 Martin Baulig <martin@gnome.org>
22659 * expression.cs (LocalVariableReferenc): Added constructor which
22660 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
22661 (LocalVariableReference.IsReadOnly): New property.
22662 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
22663 variable is readonly, use our own readonly flag to do this; you can
22664 use the new constructor to get a writable reference to a read-only
22667 * cs-parser.jay (foreach_statement, using_statement): Get a writable
22668 reference to the local variable.
22670 2002-08-01 Miguel de Icaza <miguel@ximian.com>
22672 * rootcontext.cs (ResolveCore): Also include System.Exception
22674 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
22675 we reach an EmptyStatement.
22677 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
22680 * expression.cs (Binary.ResolveOperator): Check error result in
22683 use brtrue/brfalse directly and avoid compares to null.
22685 2002-08-02 Martin Baulig <martin@gnome.org>
22687 * class.cs (TypeContainer.Define): Define all nested interfaces here.
22688 Fixes bug #28407, added test-155.cs.
22690 2002-08-01 Martin Baulig <martin@gnome.org>
22692 * class.cs (Event.EmitDefaultMethod): Make this work with static
22693 events. Fixes #28311, added verify-3.cs.
22695 2002-08-01 Martin Baulig <martin@gnome.org>
22697 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
22698 `is_disposable' fields.
22699 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
22700 `hm.is_disposable' if we're using the collection pattern.
22701 (Foreach.EmitCollectionForeach): Use the correct type for the
22702 enumerator's local variable, only emit the try/finally block if
22703 necessary (fixes #27713).
22705 2002-08-01 Martin Baulig <martin@gnome.org>
22707 * ecore.cs (Expression.report118): Renamed to Error118 and made
22710 * statement.cs (Throw.Resolve): Check whether the expression is of
22711 the correct type (CS0118) and whether the type derives from
22712 System.Exception (CS0155).
22713 (Catch.Resolve): New method. Do the type lookup here and check
22714 whether it derives from System.Exception (CS0155).
22715 (Catch.CatchType, Catch.IsGeneral): New public properties.
22717 * typemanager.cs (TypeManager.exception_type): Added.
22719 2002-07-31 Miguel de Icaza <miguel@ximian.com>
22721 * driver.cs: Updated About function.
22723 2002-07-31 Martin Baulig <martin@gnome.org>
22725 Implemented Control Flow Analysis.
22727 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
22728 (EmitContext.CurrentBranching): Added.
22729 (EmitContext.StartFlowBranching): Added.
22730 (EmitContext.EndFlowBranching): Added.
22731 (EmitContext.KillFlowBranching): Added.
22732 (EmitContext.IsVariableAssigned): Added.
22733 (EmitContext.SetVariableAssigned): Added.
22734 (EmitContext.IsParameterAssigned): Added.
22735 (EmitContext.SetParameterAssigned): Added.
22736 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
22737 Added control flow analysis stuff here.
22739 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
22740 resolve the expression as lvalue.
22741 (LocalVariableReference.DoResolve): Check whether the variable has
22742 already been assigned.
22743 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
22744 the parameter as assigned here.
22745 (ParameterReference.DoResolve): Check whether the parameter has already
22747 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
22748 expression as lvalue.
22750 * statement.cs (FlowBranching): New class for the flow analysis code.
22751 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
22752 (LabeledStatement.IsDefined): New public property.
22753 (LabeledStatement.AddUsageVector): New public method to tell flow
22754 analyis that the label may be reached via a forward jump.
22755 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
22757 (VariableInfo.Number): New public field. This is used by flow analysis
22758 to number all locals of a block.
22759 (Block.CountVariables): New public property. This is the number of
22760 local variables in this block (including the locals from all parent
22762 (Block.EmitMeta): Number all the variables.
22764 * statement.cs: Added flow analysis support to all classes.
22766 2002-07-31 Martin Baulig <martin@gnome.org>
22768 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
22769 To get debugging messages, compile mcs with /define:MCS_DEBUG and
22770 then use this argument.
22772 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
22774 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
22775 use this to specify /define options.
22777 2002-07-29 Martin Baulig <martin@gnome.org>
22779 * statement.cs (Fixed): Moved all code that does variable lookups
22780 and resolvings from Emit to Resolve.
22782 * statement.cs (For): Moved all code that does variable lookups
22783 and resolvings from Emit to Resolve.
22785 * statement.cs (Using): Moved all code that does variable lookups
22786 and resolvings from Emit to Resolve.
22788 2002-07-29 Martin Baulig <martin@gnome.org>
22790 * attribute.cs (Attribute.Resolve): Explicitly catch a
22791 System.NullReferenceException when creating the
22792 CustromAttributeBuilder and report a different warning message.
22794 2002-07-29 Martin Baulig <martin@gnome.org>
22796 * support.cs (ParameterData.ParameterName): Added method to
22797 get the name of a parameter.
22799 * typemanager.cs (TypeManager.IsValueType): New public method.
22801 2002-07-29 Martin Baulig <martin@gnome.org>
22803 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
22804 is a flag which specifies that it's either ref or out.
22805 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
22806 the out parameter to `out Parameter.Modifier mod', also set the
22807 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
22809 * support.cs (InternalParameters.ParameterModifier): Distinguish
22810 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
22811 Parameter.Modifier.ISBYREF flag if it's either ref or out.
22813 * expression.cs (Argument.GetParameterModifier): Distinguish
22814 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
22815 Parameter.Modifier.ISBYREF flag if it's either ref or out.
22817 2002-07-29 Martin Baulig <martin@gnome.org>
22819 * expression.cs (ParameterReference.ParameterReference): Added
22820 `Location loc' argument to the constructor.
22822 * cs-parser.jay: Pass location to ParameterReference.
22824 2002-07-28 Miguel de Icaza <miguel@ximian.com>
22826 * statement.cs (Try): Initialize the location.
22828 * cs-parser.jay: pass location to Try.
22830 * expression.cs (Unary.Reduce): Change the prototype to return
22831 whether a constant fold could be performed or not. The result is
22832 returned in an out parameters. In the case of Indirection and
22833 AddressOf, we want to perform the full tests.
22835 2002-07-26 Miguel de Icaza <miguel@ximian.com>
22837 * statement.cs (Statement.Emit): Flag dead code.
22839 2002-07-27 Andrew Birkett <andy@nobugs.org>
22841 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
22843 2002-07-27 Martin Baulig <martin@gnome.org>
22845 * class.cs (MethodData.Define): Put back call to
22846 TypeManager.AddMethod(), accidentally commented this out.
22848 * report.cs (Debug): New public method to print debugging information,
22849 this is `[Conditional ("DEBUG")]'.
22851 2002-07-26 Martin Baulig <martin@gnome.org>
22853 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
22854 (switch_statement): Push the current_block to the switch_stack and
22855 pop it again when we're done with the switch.
22856 (switch_section): The new block is a child of the current_block.
22857 Fixes bug #24007, added test-152.cs.
22859 2002-07-27 Martin Baulig <martin@gnome.org>
22861 * expression.cs (Invocation.EmitArguments): When calling a varargs
22862 function with only its fixed arguments, we need to pass an empty
22865 2002-07-27 Martin Baulig <martin@gnome.org>
22867 Mono 0.13 has been released.
22869 2002-07-25 Miguel de Icaza <miguel@ximian.com>
22871 * driver.cs: Rename --resource to --linkres, because that is what
22872 we do currently, we dont support --resource yet.
22874 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
22876 2002-07-25 Martin Baulig <martin@gnome.org>
22878 * class.cs (MethodData): New public class. This is a `method builder'
22879 class for a method or one accessor of a Property/Indexer/Event.
22880 (MethodData.GetMethodFlags): Moved here from MemberBase.
22881 (MethodData.ApplyAttributes): Likewise.
22882 (MethodData.ApplyObsoleteAttribute): Likewise.
22883 (MethodData.ApplyConditionalAttribute): Likewise.
22884 (MethodData.ApplyDllImportAttribute): Likewise.
22885 (MethodData.CheckAbstractAndExternal): Likewise.
22886 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
22887 (MethodData.Emit): Formerly known as Method.Emit().
22888 (MemberBase): Moved everything which was specific to a single
22889 accessor/method to MethodData.
22890 (Method): Create a new MethodData and call Define() and Emit() on it.
22891 (Property, Indexer, Event): Create a new MethodData objects for each
22892 accessor and call Define() and Emit() on them.
22894 2002-07-25 Martin Baulig <martin@gnome.org>
22896 Made MethodCore derive from MemberBase to reuse the code from there.
22897 MemberBase now also checks for attributes.
22899 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
22900 (MemberBase.GetMethodFlags): Moved here from class Method and marked
22902 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
22903 `CallingConventions cc' and `Attributes opt_attrs' arguments.
22904 (MemberBase.ApplyAttributes): New virtual method; applies the
22905 attributes to a method or accessor.
22906 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
22907 (MemberBase.ApplyConditionalAttribute): Likewise.
22908 (MemberBase.ApplyDllImportAttribute): Likewise.
22909 (MemberBase.CheckAbstractAndExternal): Likewise.
22910 (MethodCore.ParameterTypes): This is now a property instead of a
22911 method, it's initialized from DoDefineParameters().
22912 (MethodCore.ParameterInfo): Removed the set accessor.
22913 (MethodCore.DoDefineParameters): New protected virtual method to
22914 initialize ParameterTypes and ParameterInfo.
22915 (Method.GetReturnType): We can now simply return the MemberType.
22916 (Method.GetMethodFlags): Override the MemberBase version and add
22917 the conditional flags.
22918 (Method.CheckBase): Moved some code from Define() here, call
22919 DoDefineParameters() here.
22920 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
22921 here to avoid some larger code duplication.
22922 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
22923 ensure that abstract and external accessors don't declare a body.
22925 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
22926 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
22927 lookup in the attribute's parent classes, so we need to abort as soon
22928 as we found the first match.
22929 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
22930 the attribute has no arguments.
22932 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
22935 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22937 * cs-parser.jay: reverted previous patch.
22939 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22941 * cs-parser.jay: fixed bug #22119.
22943 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22945 * attribute.cs: fixed compilation. The error was:
22946 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
22947 be assigned to before control leaves the current method."
22948 [FIXME: Filed as bug #28186: MCS must report this error.]
22950 2002-07-25 Martin Baulig <martin@gnome.org>
22952 * attribute.cs (Attribute.Conditional_GetConditionName): New static
22953 method to pull the condition name ouf of a Conditional attribute.
22954 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
22955 the obsolete message and error flag out of an Obsolete attribute.
22957 * class.cs (Method.GetMethodFlags): New public method to get the
22958 TypeManager.MethodFlags for this method.
22959 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
22961 (Method.Define): Get and apply the Obsolete and Conditional attributes;
22962 if we're overriding a virtual function, set the new private variable
22963 `parent_method'; call the new TypeManager.AddMethod().
22965 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
22966 the MethodBuilder and the Method in a PtrHashtable.
22967 (TypeManager.builder_to_method): Added for this purpose.
22968 (TypeManager.MethodFlags): Added IsObsoleteError.
22969 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
22970 Obsolete and Conditional arguments in MethodBuilders. If we discover
22971 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
22972 the message from the attribute.
22974 2002-07-24 Martin Baulig <martin@gnome.org>
22976 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
22977 preprocessor directives, ensure that the argument to #define/#undef is
22978 exactly one identifier and that it's actually an identifier.
22980 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
22983 2002-07-24 Martin Baulig <martin@gnome.org>
22985 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
22986 initialize it to TypeManager.object_type in the constructor.
22987 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
22988 of the `hm.get_current' method if we're using the collection pattern.
22989 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
22990 for the explicit conversion to make it work when we're using the collection
22991 pattern and the `Current' property has a different return type than `object'.
22994 2002-07-24 Martin Baulig <martin@gnome.org>
22996 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
22997 does not match, but don't report any errors. This method is called in
22998 order for all methods in a MethodGroupExpr until a matching method is
22999 found, so we don't want to bail out if the first method doesn't match.
23000 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
23001 matches, report the 123. Fixes #28070.
23003 2002-07-24 Martin Baulig <martin@gnome.org>
23005 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
23006 TypeManager.TypeToCoreType() to the top of the method so the
23007 following equality checks will work. Fixes #28107.
23009 2002-07-24 Martin Baulig <martin@gnome.org>
23011 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
23012 operand is of type uint, and the other operand is of type sbyte,
23013 short or int, the operands are converted to type long." -
23014 Actually do what this comment already told us. Fixes bug #28106,
23017 2002-07-24 Martin Baulig <martin@gnome.org>
23019 * class.cs (MethodBase): New abstract class. This is now a base
23020 class for Property, Indexer and Event to avoid some code duplication
23021 in their Define() and DefineMethods() methods.
23022 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
23023 generic methods for Define() and DefineMethods().
23024 (FieldBase): Derive from MemberBase, not MemberCore.
23025 (Property): Derive from MemberBase, not MemberCore.
23026 (Property.DefineMethod): Moved all the code from this method to the
23027 new MethodBase.DefineAccessor(), just call it with appropriate
23029 (Property.Define): Call the new Property.DoDefine(), this does some
23030 sanity checks and we don't need to duplicate the code everywhere.
23031 (Event): Derive from MemberBase, not MemberCore.
23032 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
23033 accessors, this will also make them work with interface events.
23034 (Indexer): Derive from MemberBase, not MemberCore.
23035 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
23036 (Indexer.Define): Use the new MethodBase functions.
23038 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
23039 argument to the constructor.
23040 (Interface.FindMembers): Added support for interface events.
23041 (Interface.PopluateEvent): Implemented.
23043 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
23045 2002-07-22 Miguel de Icaza <miguel@ximian.com>
23047 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
23048 but this is required to check for a method name being the same as
23049 the containing class.
23053 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23055 * interface.cs: initialize variable.
23057 2002-07-23 Martin Baulig <martin@gnome.org>
23059 Implemented the IndexerName attribute in interfaces.
23061 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
23062 name if this is an explicit interface implementation.
23063 (Indexer.InterfaceIndexerName): New public variable. If we're
23064 implementing an interface indexer, this is the IndexerName in that
23065 interface. Otherwise, it's the IndexerName.
23066 (Indexer.DefineMethod): If we're implementing interface indexer,
23067 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
23068 and Pending.ImplementIndexer methods.
23069 (Indexer.Define): Also define the PropertyBuilder if we're
23070 implementing an interface indexer and this is neither an explicit
23071 interface implementation nor do the IndexerName match the one in
23074 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
23075 If a method is defined here, then we always need to create a proxy
23076 for it. This is used when implementing interface indexers.
23077 (Pending.IsInterfaceIndexer): New public method.
23078 (Pending.ImplementIndexer): New public method.
23079 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
23080 This is used when implementing interface indexers to define a proxy
23082 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
23083 define a proxy if necessary.
23085 * interface.cs (Interface.IndexerName): New public variable.
23086 (Interface.PopulateIndexer): Set the IndexerName.
23087 (Interface.DefineIndexers): New private method. Populate all the
23088 indexers and make sure their IndexerNames match.
23090 * typemanager.cs (IndexerPropertyName): Added support for interface
23093 2002-07-22 Martin Baulig <martin@gnome.org>
23095 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
23096 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
23097 ret if HasReturnLabel.
23098 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
23101 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
23102 and set the ec.LoopBeginTryCatchLevel.
23103 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
23104 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
23105 the current ec.TryCatchLevel, the branch goes out of an exception
23106 block. In this case, we need to use Leave and not Br.
23108 2002-07-22 Martin Baulig <martin@gnome.org>
23110 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
23111 block unless the block does not always return or it is contained in
23112 another try { ... } catch { ... } block. Fixes bug #26506.
23113 Added verify-1.cs to the test suite.
23115 2002-07-22 Martin Baulig <martin@gnome.org>
23117 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
23118 then we do not always return. Fixes bug #24985.
23120 2002-07-22 Martin Baulig <martin@gnome.org>
23122 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
23123 lookup on a per-class level; ie. walk up the class hierarchy until we
23124 found at least one applicable method, then choose the best among them.
23125 Fixes bug #24463 and test-29.cs.
23127 2002-07-22 Martin Baulig <martin@gnome.org>
23129 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
23130 return types of the methods. The return type is not part of the
23131 signature and we must not check it to make the `new' modifier work.
23132 Fixes bug #27999, also added test-147.cs.
23133 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
23135 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
23136 on the method's return type.
23138 2002-07-21 Martin Baulig <martin@gnome.org>
23140 * assign.cs: Make this work if the rightmost source is a constant and
23141 we need to do an implicit type conversion. Also adding a few more tests
23142 to test-38.cs which should have caught this.
23144 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
23145 target in the makefile for this. The makefile.gnu is primarily intended
23146 for end-users who don't want to debug the compiler.
23148 2002-07-21 Martin Baulig <martin@gnome.org>
23150 * assign.cs: Improved the Assign class so it can now handle embedded
23151 assignments (X = Y = Z = something). As a side-effect this'll now also
23152 consume less local variables. test-38.cs now passes with MCS, added
23153 a few new test cases to that test.
23155 2002-07-20 Martin Baulig <martin@gnome.org>
23157 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
23158 instructions. Fixes bug #27977, also added test-146.cs.
23160 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23162 * cs-tokenizer.cs: fixed getHex ().
23164 2002-07-19 Martin Baulig <martin@gnome.org>
23166 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
23167 not Type.GetType() to lookup the array type. This is needed when
23168 we're constructing an array of a user-defined type.
23169 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
23170 single-dimensional arrays, but also for single-dimensial arrays of
23173 2002-07-19 Martin Baulig <martin@gnome.org>
23175 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
23176 this function is called, it's not allowed to share LocalBuilders
23177 among ILGenerators.
23179 2002-07-19 Martin Baulig <martin@gnome.org>
23181 * expression.cs (Argument.Resolve): Report an error 118 when trying
23182 to pass a type as argument.
23184 2002-07-18 Martin Baulig <martin@gnome.org>
23186 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
23187 Conv_R_Un for the signed `long' type.
23189 2002-07-15 Miguel de Icaza <miguel@ximian.com>
23191 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
23192 `expr' for the temporary result, as that will fail if we do
23193 multiple resolves on the same expression.
23195 2002-07-05 Miguel de Icaza <miguel@ximian.com>
23197 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
23198 ec.TypeContainer for looking up aliases.
23200 * class.cs (TypeContainer): Remove LookupAlias from here.
23202 * decl.cs (DeclSpace); Move here.
23204 2002-07-01 Miguel de Icaza <miguel@ximian.com>
23206 * class.cs (FindMembers): Only call filter if the constructor
23207 bulider is not null.
23209 Also handle delegates in `NestedTypes' now. Now we will perform
23210 type lookups using the standard resolution process. This also
23213 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
23214 This uses Expressions (the limited kind that can be parsed by the
23215 tree) instead of strings.
23217 * expression.cs (ComposedCast.ToString): Implement, used to flag
23218 errors since now we have to render expressions.
23220 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
23223 * ecore.cs (SimpleName.ToString): ditto.
23225 * cs-parser.jay: Instead of using strings to assemble types, use
23226 Expressions to assemble the type (using SimpleName, ComposedCast,
23227 MemberAccess). This should fix the type lookups in declarations,
23228 because we were using a different code path for this.
23230 * statement.cs (Block.Resolve): Continue processing statements
23231 even when there is an error.
23233 2002-07-17 Miguel de Icaza <miguel@ximian.com>
23235 * class.cs (Event.Define): Also remove the `remove' method from
23236 the list of pending items.
23238 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
23239 generate more compact code.
23241 2002-07-17 Martin Baulig <martin@gnome.org>
23243 * const.cs (Const.LookupConstantValue): Add support for constant
23244 `unchecked' and `checked' expressions.
23245 Also adding test case test-140.cs for this.
23247 2002-07-17 Martin Baulig <martin@gnome.org>
23249 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
23250 check whether mi.ReturnType implements the IEnumerator interface; the
23251 `==' and the IsAssignableFrom() will fail in this situation.
23253 2002-07-16 Ravi Pratap <ravi@ximian.com>
23255 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
23258 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23260 * expression.cs: fixed bug #27811.
23262 2002-07-14 Miguel de Icaza <miguel@ximian.com>
23264 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
23265 Molaro: when we are a ref, the value already contains a pointer
23266 value, do not take the address of it.
23268 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23269 * removed mb-parser.jay and mb-tokenizer.cs
23271 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23273 * expression.cs: check against the building corlib void type.
23275 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
23277 * ecore.cs: fix for valuetype static readonly fields: when
23278 initializing them, we need their address, not the address of a copy.
23280 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23282 * typemanager.cs: register also enum_type in corlib.
23284 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23286 * class.cs: allow calling this (but not base) initializers in structs.
23288 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
23290 * ecore.cs: make sure we compare against the building base types
23293 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
23295 * typemanager.cs: fix TypeToCoreType() to handle void and object
23296 (corlib gets no more typerefs after this change).
23298 2002-07-12 Miguel de Icaza <miguel@ximian.com>
23300 * expression.cs (ArrayCreation.EmitArrayArguments): use
23301 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
23303 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
23304 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
23305 array indexes, the runtime actually forbids them.
23307 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
23308 for array arguments here.
23310 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
23311 instead of the default for ValueTypes.
23313 (New.DoEmit): Use IsValueType instead of
23314 IsSubclassOf (value_type)
23315 (New.DoResolve): ditto.
23316 (Invocation.EmitCall): ditto.
23318 * assign.cs (Assign): ditto.
23320 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
23321 Statements *are* currently doing part of their resolution during
23324 Expressions do always resolve during resolve, but statements are
23325 only required to propagate resolution to their children.
23327 2002-07-11 Miguel de Icaza <miguel@ximian.com>
23329 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
23331 (LoadAssembly): Do not add the dll if it is already specified
23333 (MainDriver): Add the System directory to the link path at the end,
23334 after all the other -L arguments.
23336 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
23337 wrong opcode for loading bytes and bools (ldelem.i1 instead of
23338 ldelem.u1) and using the opposite for sbytes.
23340 This fixes Digger, and we can finally run it.
23342 * driver.cs (UnixParseOption): Move the option parsing here.
23343 (CSCParseOption): Implement CSC-like parsing of options.
23345 We now support both modes of operation, the old Unix way, and the
23346 new CSC-like way. This should help those who wanted to make cross
23347 platform makefiles.
23349 The only thing broken is that /r:, /reference: and /lib: are not
23350 implemented, because I want to make those have the same semantics
23351 as the CSC compiler has, and kill once and for all the confussion
23352 around this. Will be doing this tomorrow.
23354 * statement.cs (Unsafe.Resolve): The state is checked during
23355 resolve, not emit, so we have to set the flags for IsUnsfe here.
23357 2002-07-10 Miguel de Icaza <miguel@ximian.com>
23359 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
23360 not catch the Error_ObjectRefRequired in SimpleName (as it is
23361 possible to have a class/instance variable name that later gets
23362 deambiguated), we have to check this here.
23364 2002-07-10 Ravi Pratap <ravi@ximian.com>
23366 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
23367 make static and put into Expression.
23369 (Event.Define): Register the private field of the event with the
23370 TypeManager so that GetFieldFromEvent can get at it.
23372 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
23373 keep track of the private field associated with an event which
23376 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
23379 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
23381 2002-07-10 Miguel de Icaza <miguel@ximian.com>
23383 * expression.cs (Binary.EmitBranchable): this routine emits the
23384 Binary expression in a branchable context. This basically means:
23385 we need to branch somewhere, not just get the value on the stack.
23387 This works together with Statement.EmitBoolExpression.
23389 * statement.cs (Statement.EmitBoolExpression): Use
23392 2002-07-09 Miguel de Icaza <miguel@ximian.com>
23394 * statement.cs (For): Reduce the number of jumps in loops.
23396 (For): Implement loop inversion for the For statement.
23398 (Break): We can be breaking out of a Try/Catch controlled section
23399 (foreach might have an implicit try/catch clause), so we need to
23400 use Leave instead of Br.
23402 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
23403 now). If the instace expression supports IMemoryLocation, we use
23404 the AddressOf method from the IMemoryLocation to extract the
23405 address instead of emitting the instance.
23407 This showed up with `This', as we were emitting the instance
23408 always (Emit) instead of the Address of This. Particularly
23409 interesting when This is a value type, as we dont want the Emit
23410 effect (which was to load the object).
23412 2002-07-08 Miguel de Icaza <miguel@ximian.com>
23414 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
23416 * statement.cs (Checked): Set the CheckedState during the resolve
23417 process too, as the ConvCast operations track the checked state on
23418 the resolve process, and not emit.
23420 * cs-parser.jay (namespace_member_declaration): Flag that we have
23421 found a declaration when we do. This is used to flag error 1529
23423 * driver.cs: Report ok when we display the help only.
23425 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
23427 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
23429 2002-07-04 Miguel de Icaza <miguel@ximian.com>
23431 * cs-tokenizer.cs (define): We also have to track locally the
23432 defines. AllDefines is just used for the Conditional Attribute,
23433 but we also need the local defines for the current source code.
23435 2002-07-03 Miguel de Icaza <miguel@ximian.com>
23437 * statement.cs (While, For, Do): These loops can exit through a
23438 Break statement, use this information to tell whether the
23439 statement is the last piece of code.
23441 (Break): Flag that we break.
23443 * codegen.cs (EmitContexts): New `Breaks' state variable.
23445 2002-07-03 Martin Baulig <martin@gnome.org>
23447 * class.cs (TypeContainer.MethodModifiersValid): Allow override
23448 modifiers in method declarations in structs. Otherwise, you won't
23449 be able to override things like Object.Equals().
23451 2002-07-02 Miguel de Icaza <miguel@ximian.com>
23453 * class.cs (Method, Property, Indexer): Do not allow the public
23454 modifier to be used in explicit interface implementations.
23456 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
23457 override modifiers in method declarations in structs
23459 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
23461 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
23462 integer or real overflow, report an error
23464 2002-07-02 Martin Baulig <martin@gnome.org>
23466 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
23467 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
23468 to tell the runtime about our newly created System.Object and
23469 System.ValueType types.
23471 2002-07-02 Miguel de Icaza <miguel@ximian.com>
23473 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
23474 struct instead of Ldarg/Starg.
23476 2002-07-02 Martin Baulig <martin@gnome.org>
23478 * expression.cs (Indirection.Indirection): Call
23479 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
23481 2002-07-02 Martin Baulig <martin@gnome.org>
23483 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
23484 ValueType, call TypeManager.TypeToCoreType() on it.
23485 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
23486 the OpCodes.Newarr argument.
23488 2002-07-02 Martin Baulig <martin@gnome.org>
23490 * expression.cs (Invocation.EmitCall): When compiling corlib,
23491 replace all calls to the system's System.Array type to calls to
23492 the newly created one.
23494 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
23495 System.Array methods.
23496 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
23497 from the system's System.Array type which must be replaced.
23499 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
23501 * typemanager.cs: load unverifiable_code_ctor so we can build
23502 corlib using the correct type. Avoid using GetTypeCode() with
23504 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
23505 TypeManager.object_type to allow building corlib.
23507 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
23509 * ecore.cs: handle System.Enum separately in LoadFromPtr().
23511 2002-07-01 Martin Baulig <martin@gnome.org>
23513 * class.cs: Make the last change actually work, we need to check
23514 whether `ifaces != null' to avoid a crash.
23516 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23518 * class.cs: when we build structs without fields that implement
23519 interfaces, we need to add the interfaces separately, since there is
23520 no API to both set the size and add the interfaces at type creation
23523 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23525 * expression.cs: the dimension arguments to the array constructors
23526 need to be converted if they are a long.
23528 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
23530 * class.cs: don't emit ldarg.0 if there is no parent constructor
23531 (fixes showstopper for corlib).
23533 2002-06-29 Martin Baulig <martin@gnome.org>
23535 MCS now compiles corlib on GNU/Linux :-)
23537 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
23538 ie. check for MethodImplOptions.InternalCall.
23540 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
23541 and TypeManager.attribute_type are null, so we must explicitly check
23542 whether parent is not null to find out whether it's an attribute type.
23543 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
23544 and SetBuilder, not only if the property is neither abstract nor external.
23545 This is necessary to set the MethodImplOptions on the accessor methods.
23546 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
23547 SetBuilder, see Property.Emit().
23549 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
23550 populate "System.Object", "System.ValueType" and "System.Attribute" since
23551 they've already been populated from BootCorlib_PopulateCoreTypes().
23553 2002-06-29 Martin Baulig <martin@gnome.org>
23555 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
23556 is the NullLiteral, we also need to make sure that target_type is not
23559 2002-06-29 Martin Baulig <martin@gnome.org>
23561 * rootcontext.cs (RootContext.ResolveCore): We must initialize
23562 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
23563 before calling BootstrapCorlib_ResolveDelegate ().
23565 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23567 * statement.cs: fixed build-breaker. All tests passed ok.
23569 2002-06-27 Martin Baulig <martin@gnome.org>
23571 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
23572 for System.Decimal when compiling corlib.
23574 2002-06-27 Martin Baulig <martin@gnome.org>
23576 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
23577 switch blocks which contain nothing but a default clause.
23579 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
23581 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
23583 2002-06-27 Martin Baulig <martin@gnome.org>
23585 * ecore.cs (PropertyExpr.PropertyExpr): Call
23586 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
23588 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
23589 is already a TypeBuilder.
23591 2002-06-27 Martin Baulig <martin@gnome.org>
23593 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
23594 `target_type == TypeManager.array_type', not IsAssignableFrom() in
23595 the "from an array-type to System.Array" case. This makes it work
23596 when compiling corlib.
23598 2002-06-27 Martin Baulig <martin@gnome.org>
23600 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
23601 non-static PropertyExpr, set its InstanceExpression. This makes
23602 the `ICollection.Count' property work in System/Array.cs.
23604 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
23606 * driver.cs: Made error handling more consistent. Errors now
23607 tracked by Report class, so many methods which used to return int
23608 now return void. Main() now prints success/failure and
23609 errors/warnings message.
23611 Renamed '--probe' compiler argument to '--expect-error'. Removed
23612 the magic number return values (123 and 124). Now, if the
23613 expected error occurs, the compiler exits with success (exit value
23614 0). If the compilation completes without seeing that particular
23615 error, the compiler exits with failure (exit value 1). The
23616 makefile in mcs/errors has been changed to handle the new behaviour.
23618 * report.cs: Made 'expected error' number a property and renamed
23619 it from 'Probe' to 'ExpectedError'.
23621 * genericparser.cs: Removed error handling support, since it is
23622 now all done by Report class.
23624 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
23625 class, so parse() no longer returns an int.
23627 * namespace.cs: Use Report.Error instead of GenericParser.error
23629 2002-06-22 Miguel de Icaza <miguel@ximian.com>
23631 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
23632 TypeContainer.AddOperator): At the front of the list put the
23633 explicit implementations, so they get resolved/defined first.
23635 2002-06-21 Miguel de Icaza <miguel@ximian.com>
23637 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
23638 interface type is implemented by this TypeContainer. Used during
23639 explicit interface implementation.
23641 (Property.Define, Indexer.Define, Method.Define): Validate that
23642 the given interface in the explicit implementation is one of the
23643 base classes for the containing type.
23645 Also if we are explicitly implementing an interface, but there is
23646 no match in the pending implementation table, report an error.
23648 (Property.Define): Only define the property if we are
23649 not explicitly implementing a property from an interface. Use the
23650 correct name also for those properties (the same CSC uses,
23651 although that is really not needed).
23653 (Property.Emit): Do not emit attributes for explicitly implemented
23654 properties, as there is no TypeBuilder.
23656 (Indexer.Emit): ditto.
23658 Hiding then means that we do not really *implement* a pending
23659 implementation, which makes code fail.
23661 2002-06-22 Martin Baulig <martin@gnome.org>
23663 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
23664 the return value of Object.GetType(). [FIXME: we need to do this whenever
23665 we get a type back from the reflection library].
23667 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
23669 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
23671 2002-06-20 Miguel de Icaza <miguel@ximian.com>
23673 * attribute.cs: Return null if we can not look up the type.
23675 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
23676 the interface types found.
23678 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
23679 interface types found.
23681 * typemanager.cs (GetInterfaces): Make this routine returns alll
23682 the interfaces and work around the lame differences between
23683 System.Type and System.Reflection.Emit.TypeBuilder in the results
23684 result for GetInterfaces.
23686 (ExpandInterfaces): Given an array of interface types, expand and
23687 eliminate repeated ocurrences of an interface. This expands in
23688 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
23691 2002-06-21 Martin Baulig <martin@gnome.org>
23693 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
23696 2002-06-21 Martin Baulig <martin@gnome.org>
23698 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
23699 and called with one of the core types, return the corresponding typebuilder for
23702 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
23705 2002-06-21 Martin Baulig <martin@gnome.org>
23707 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
23708 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
23709 (Expression.ConvertReferenceExplicit): Likewise.
23711 * expression.cs (ElementAccess.DoResolve): Likewise.
23712 (ElementAccess.DoResolveLValue): Likewise.
23714 2002-06-10 Martin Baulig <martin@gnome.org>
23716 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
23717 add the "value" parameter to the parameter list.
23719 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
23722 2002-06-19 Miguel de Icaza <miguel@ximian.com>
23724 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
23725 the argument to an int, uint, long or ulong, per the spec. Also
23726 catch negative constants in array creation.
23728 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
23730 * class.cs: do not allow the same interface to appear twice in
23731 the definition list.
23733 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
23735 * ecore.cs: don't use ldlen with System.Array.
23737 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
23739 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
23741 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
23743 * modifiers.cs: produce correct field attributes for protected
23744 internal. Easy fix so miguel can work on ther harder stuff:-)
23746 2002-06-18 Miguel de Icaza <miguel@ximian.com>
23748 * pending.cs: New file. Move the code from class.cs here.
23749 Support clearning the pending flag for all methods (when not doing
23750 explicit interface implementation).
23752 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
23754 * rootcontext.cs: added a couple more types needed to bootstrap.
23756 2002-06-17 Miguel de Icaza <miguel@ximian.com>
23758 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
23759 constructor in the type, instead of any constructor in the type
23760 hierarchy. Thanks to Paolo for finding this bug (it showed up as
23761 a bug in the Mono runtime when applying the params attribute).
23763 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23764 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
23766 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
23768 * expression.cs (Unary.ResolveOperator): Use TypeManager
23769 to resolve the type.
23771 2002-06-13 Ravi Pratap <ravi@ximian.com>
23773 * cs-parser.jay (enum_member_declaration): Pass in the attributes
23776 * enum.cs (AddEnumMember): Add support to store the attributes associated
23777 with each member too.
23779 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
23780 field builders too - this takes care of the enum member case.
23782 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
23784 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
23785 address-of operator on both value types and pointers.
23787 2002-06-10 Martin Baulig <martin@gnome.org>
23789 * interface.cs (Interface.PopulateIndexer): Add the indexer's
23790 PropertyBuilder to the `property_builders' list.
23792 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
23793 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
23794 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
23795 find any indexers which are inherited from an interface.
23797 2002-06-09 Martin Baulig <martin@gnome.org>
23799 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
23800 the same type as the constant if necessary. There's also a test-130.cs
23803 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
23805 * typemanager.cs (TypeManager.ChangeType): Previously known as
23806 Enum.ChangeEnumType().
23808 2002-06-09 Martin Baulig <martin@gnome.org>
23810 * expression.cs (Cast.TryReduce): Added support for consts.
23812 2002-06-08 Ravi Pratap <ravi@ximian.com>
23814 * class.cs (Accessor): Hold attributes information so we can pass
23817 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
23818 Modify to pass in attributes attached to the methods.
23820 (add_accessor_declaration, remove_accessor_declaration): Ditto.
23822 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
23823 to handle the Accessor kind :-)
23825 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
23827 2002-06-08 Martin Baulig <martin@gnome.org>
23829 * expression.cs (Unary.TryReduceNegative): Added support for
23832 2002-06-08 Martin Baulig <martin@gnome.org>
23834 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
23835 name can't be found in the `defined_names' - the caller will do a
23836 MemberLookup in this case and thus find methods in System.Enum
23837 such as Enum.IsDefined().
23839 2002-06-08 Martin Baulig <martin@gnome.org>
23841 * enum.cs (Enum.ChangeEnumType): This is a custom version of
23842 Convert.ChangeType() which works with TypeBuilder created types.
23843 (Enum.LookupEnumValue, Enum.Define): Use it here.
23845 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
23846 `TypeBuilder.BaseType != null' check.
23847 (TypeContainer.FindMembers): Only lookup parent members if we
23848 actually have a parent.
23849 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
23850 (ConstructorInitializer.Resolve): Likewise.
23852 * interface.cs (Interface.FindMembers): Added
23853 `TypeBuilder.BaseType != null' check.
23855 * rootcontext.cs (RootContext.ResolveCore): Added
23856 "System.Runtime.CompilerServices.IndexerNameAttribute" to
23857 classes_second_stage.
23859 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
23860 debug_type and trace_type when compiling with --nostdlib.
23862 2002-06-07 Martin Baulig <martin@gnome.org>
23864 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
23865 (AddField): Set it to true when adding a non-static field.
23866 (DefineType): Use `have_nonstatic_fields' to find out whether we
23867 have non-static fields, not `Fields != null'.
23869 2002-06-02 Miguel de Icaza <miguel@ximian.com>
23871 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
23872 dereferencing a null on the static-field code path)
23874 2002-05-30 Martin Baulig <martin@gnome.org>
23876 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
23877 to take command line arguments. Use reflection to call the new
23878 custom `Initialize' function on the symbol writer and pass it the
23879 command line arguments.
23881 * driver.cs (--debug-args): New command line argument to pass command
23882 line arguments to the symbol writer.
23884 2002-05-28 Miguel de Icaza <miguel@ximian.com>
23886 * assign.cs (DoResolve): Forgot to do the implicit conversion to
23887 the target type for indexers and properties. Thanks to Joe for
23890 2002-05-27 Miguel de Icaza <miguel@ximian.com>
23892 * typemanager.cs (MethodFlags): returns the method flags
23893 (Obsolete/ShouldIgnore) that control warning emission and whether
23894 the invocation should be made, or ignored.
23896 * expression.cs (Invocation.Emit): Remove previous hack, we should
23897 not do this on matching a base type, we should do this based on an attribute
23899 Only emit calls to System.Diagnostics.Debug and
23900 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
23901 on the command line.
23903 * rootcontext.cs: Global settings for tracing and debugging.
23905 * cs-tokenizer.cs (define): New utility function to track
23906 defines. Set the global settings for TRACE and DEBUG if found.
23908 2002-05-25 Ravi Pratap <ravi@ximian.com>
23910 * interface.cs (Populate*): Pass in the TypeContainer as well as
23911 the DeclSpace as parameters so that we can create EmitContexts and
23912 then use that to apply attributes etc.
23914 (PopulateMethod, PopulateEvent, PopulateProperty)
23915 (PopulateIndexer): Apply attributes everywhere.
23917 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
23920 (ApplyAttributes): Update accordingly.
23922 We now apply interface attributes for all members too.
23924 2002-05-26 Miguel de Icaza <miguel@ximian.com>
23926 * class.cs (Indexer.Define); Correctly check if we are explicit
23927 implementation (instead of checking the Name for a ".", we
23928 directly look up if the InterfaceType was specified).
23930 Delay the creation of the PropertyBuilder.
23932 Only create the PropertyBuilder if we are not an explicit
23933 interface implementation. This means that explicit interface
23934 implementation members do not participate in regular function
23935 lookups, and hence fixes another major ambiguity problem in
23936 overload resolution (that was the visible effect).
23938 (DefineMethod): Return whether we are doing an interface
23941 * typemanager.cs: Temporary hack until we get attributes in
23942 interfaces (Ravi is working on that) and we get IndexerName
23943 support in interfaces.
23945 * interface.cs: Register the indexers as properties.
23947 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
23948 warning, I have verified that this is a bug in the .NET runtime
23949 (JavaScript suffers of the same problem).
23951 * typemanager.cs (MemberLookup): When looking up members for
23952 interfaces, the parent of an interface is the implicit
23953 System.Object (so we succeed in searches of Object methods in an
23954 interface method invocation. Example: IEnumerable x; x.ToString
23957 2002-05-25 Miguel de Icaza <miguel@ximian.com>
23959 * class.cs (Event): Events should also register if they do
23960 implement the methods that an interface requires.
23962 * typemanager.cs (MemberLookup); use the new GetInterfaces
23965 (GetInterfaces): The code used to lookup interfaces for a type is
23966 used in more than one place, factor it here.
23968 * driver.cs: Track the errors at the bottom of the file, we kept
23971 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
23972 instance if the method we are calling is static!
23974 2002-05-24 Miguel de Icaza <miguel@ximian.com>
23976 * attribute.cs (ApplyAttributes): Make this function filter out
23977 the IndexerName attribute (as that attribute in reality is never
23978 applied) and return the string constant for the IndexerName
23981 * class.cs (TypeContainer.Emit): Validate that all the indexers
23982 have the same IndexerName attribute, and if so, set the
23983 DefaultName attribute on the class.
23985 * typemanager.cs: The return value might contain other stuff (not
23986 only methods). For instance, consider a method with an "Item"
23987 property and an Item method.
23989 * class.cs: If there is a problem with the parameter types,
23992 2002-05-24 Ravi Pratap <ravi@ximian.com>
23994 * ecore.cs (ImplicitConversionExists): Wrapper function which also
23995 looks at user defined conversion after making a call to
23996 StandardConversionExists - we need this for overload resolution.
23998 * expression.cs : Update accordingly the various method calls.
24000 This fixes 2 bugs filed against implicit user defined conversions
24002 2002-05-22 Miguel de Icaza <miguel@ximian.com>
24004 * statement.cs: Track the result of the assignment.
24006 2002-05-21 Miguel de Icaza <miguel@ximian.com>
24008 * expression.cs (MemberAccess): Improved error reporting for
24009 inaccessible members.
24011 2002-05-22 Martin Baulig <martin@gnome.org>
24013 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
24014 itself with debugging support.
24016 2002-05-22 Martin Baulig <martin@gnome.org>
24018 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
24019 Removed, this isn't needed anymore.
24021 2002-05-20 Martin Baulig <martin@gnome.org>
24023 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
24024 be underlying type for an enum.
24026 2002-05-20 Miguel de Icaza <miguel@ximian.com>
24028 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
24029 that splits out the loading of just the core types.
24031 * rootcontext.cs (ResolveCore): Split the struct resolution in
24032 two, so we can load the enumeration underlying types before any
24035 * expression.cs (Is): Bandaid until we fix properly Switch (see
24036 bug #24985 for details).
24038 * typemanager.cs (ImplementsInterface): The hashtable will contain
24039 a null if there are no interfaces implemented.
24041 2002-05-18 Miguel de Icaza <miguel@ximian.com>
24043 * cs-parser.jay (indexer_declarator): It is fine to have array
24046 2002-05-17 Miguel de Icaza <miguel@ximian.com>
24048 * typemanager.cs: (RegisterBuilder): New function used to register
24049 TypeBuilders that implement interfaces. Since
24050 TypeBuilder.GetInterfaces (as usual) does not work with lame
24052 (AddUserType): register interfaces.
24054 (ImplementsInterface): Use the builder_to_ifaces hash if we are
24055 dealing with TypeBuilder. Also, arrays are showing up as
24056 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
24057 methods can not be invoked on them!
24059 * ecore.cs (ExplicitReferenceConversionExists): Made public.
24060 (ImplicitReferenceConversionExists): Split out from
24061 StandardConversionExists.
24063 * expression.cs (As): We were only implementing one of the three
24064 cases for the as operator. We now implement them all.
24065 (Is): Implement the various other cases for Is as well.
24067 * typemanager.cs (CACHE): New define used to control if we want or
24068 not the FindMembers cache. Seems to have a negative impact on
24069 performance currently
24071 (MemberLookup): Nested types have full acess to
24072 enclosing type members
24074 Remove code that coped with instance/static returns for events, we
24075 now catch this in RealFindMembers.
24077 (RealFindMembers): only perform static lookup if the instance
24078 lookup did not return a type or an event.
24080 2002-05-17 Miguel de Icaza <miguel@ximian.com>
24082 * assign.cs (CompoundAssign): We pass more semantic information
24083 now to Compound Assignments than we did before: now we have all
24084 the information at hand, and now we resolve the target *before* we
24085 do the expression expansion, which allows the "CacheValue" method
24086 to have the effect we intended (before, a [x] += 1 would generate
24087 two differen ArrayAccess expressions from the ElementAccess,
24088 during the resolution process).
24090 (CompoundAssign.DoResolve): Resolve target and original_source here.
24092 2002-05-16 Miguel de Icaza <miguel@ximian.com>
24094 * expression.cs (ArrayAccess): dropped debugging information.
24096 * typemanager.cs: Small bug fix: I was always returning i_members,
24097 instead of one of i_members or s_members (depending on which had
24100 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
24101 method is invoked before any code generation takes place, and it
24102 is a mechanism to inform that the expression will be invoked more
24103 than once, and that the method should use temporary values to
24104 avoid having side effects
24106 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
24108 * ecore.cs (Expression.CacheTemporaries): Provide empty default
24111 * expression.cs (Indirection, ArrayAccess): Add support for
24112 CacheTemporaries in these two bad boys.
24114 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
24115 ldobj or ldind_ref.
24116 (StoreFromPtr): Handle stobj as well.
24118 * expression.cs (UnaryMutator): Share more code.
24120 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
24121 down: I was not tracking the Filter function as well, which
24122 was affecting the results of the cache.
24124 2002-05-15 Miguel de Icaza <miguel@ximian.com>
24126 * attribute.cs: Remove the hack to handle the CharSet property on
24129 2002-05-14 Miguel de Icaza <miguel@ximian.com>
24131 * attribute.cs (DoResolve): More uglyness, we now only try to
24132 resolve the attribute partially, to extract the CharSet
24133 information (only if we are a StructLayout attribute). Otherwise
24135 (GetExtraTypeInfo): Add some code to conditionally kill in the
24136 future this. I am more and more convinced that the .NET
24137 framework has special code to handle the attribute setting on
24140 * expression.cs (IsParamsMethodApplicable): Revert my previous
24141 foreach change here, it was wrong.
24143 2002-05-13 Miguel de Icaza <miguel@ximian.com>
24145 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
24146 (pp_expr): do not abort on unknown input, just return.
24147 (eval): abort if there are pending chars.
24149 * attribute.cs (Attribute.Resolve): Positional parameters are
24150 optional. Deal with that case.
24152 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
24153 the Ansi/Unicode/Auto information for the type.
24155 (TypeContainer.DefineType): instantiate the EmitContext here, as
24156 we will be using it during the type definition (to resolve
24157 attributes) and during the emit phase.
24159 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
24160 to pull type information out of the attributes
24162 (Attribute.Resolve): track the constructor builder, and allow for
24163 multiple invocations (structs and classes will use this).
24165 * ecore.cs (MemberLookupFinal): new version with all the
24166 parameters customizable.
24168 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
24169 constructors. Return if the result value is null (as the error
24170 would have been flagged already by MemberLookupFinal)
24172 Do not allow instances of abstract classes or interfaces to be
24175 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
24176 We have to compare the assembly property here when dealing with
24177 FamANDAssem and Assembly access modifiers, because we might be
24178 creating an assembly from *modules* (that means that we are not
24179 getting TypeBuilders for types defined in other modules that are
24180 part of this assembly).
24182 (Method.Emit): If the method is marked abstract and has a body,
24185 (TypeContainer.DefineMembers): If both the defined member and the
24186 parent name match are methods, then do not emit any warnings: let
24187 the Method.Define routine take care of flagging warnings. But if
24188 there is a mismatch (method overrides something else, or method is
24189 overriwritten by something, then emit warning).
24191 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
24192 set to null, this means `do not check for the return type on the
24195 (Method.Define): set the return type for the method signature to
24196 null, so that we get methods with the same name and parameters and
24197 different return types. This is used to flag warning 114 (you are
24198 hiding a method, and you probably want to use the new/override
24201 * typemanager.cs (MemberLookup): Implemented proper access
24202 control, closing a long standing set of bug reports. The problem
24203 was that the Framework only has two bits: Public and NonPublic,
24204 and NonPublic includes private and protected methods, but we need
24205 to enforce the FamANDAssem, FamOrAssem and Family.
24207 2002-05-11 Miguel de Icaza <miguel@ximian.com>
24209 * statement.cs (GotoCase): Return true: Ammounts to giving up
24210 knowledge on whether we return or not, and letting the other case
24211 be responsible for it.
24213 2002-05-10 Miguel de Icaza <miguel@ximian.com>
24215 * driver.cs: Do not load directories for each file processed, only
24216 do it if there is a pattern.
24218 * ecore.cs: Report readonly assigns here as well, as we might have
24219 been resolved only by MemberAccess.
24221 (SimpleName.SimpleNameResolve): Also be useful for LValue
24222 resolution. We need this to propagate assign to local readonly variables
24224 * typemanager.cs: Use a ptrhashtable for the criteria, because we
24225 do not want to reuse potential criteria memory.
24227 * class.cs (MyEventBuilder): Set reflected_type;
24229 * ecore.cs (Constantify): Added support for constifying bools.
24231 (RootContext.LookupType): Added a cache for values looked up in
24232 the declaration space.
24234 * typemanager.cs (FindMembers): Now is a front-end to
24235 RealFindMembers, and provides a two-level hashtable-based cache to
24238 15% performance improvement: from 22.5 to 19.2 seconds.
24240 * expression.cs (IsParamsMethodApplicable): use foreach.
24241 (Invocation.DoResolve): ditto.
24242 (New.DoResolve): ditto.
24243 (ArrayCreation.DoResolve): ditto.
24245 * ecore.cs (FindMostEncompassingType): use foreach.
24247 * delegate.cs (NewDelegate.DoResolve): Use foreach
24249 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
24250 (RemoveMethods): use foreach.
24252 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
24253 nested foreach statements instead of for, and also break out of
24254 the inner loop once a match is found.
24256 (Invocation.OverloadResolve): Use foreach, simplify the code.
24258 2002-05-08 Miguel de Icaza <miguel@ximian.com>
24260 * cfold.cs (BinaryFold): During an enumeration evaluation context,
24261 we actually unwrap the expression to allow for extra information
24264 * expression.cs: Use Shr_Un on unsigned operations.
24266 2002-05-08 Ravi Pratap <ravi@ximian.com>
24268 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
24269 applicable operators was not being considered correctly. This closes
24270 the bug Miguel reported.
24272 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
24274 * attribute.cs: check that the type derives from System.Attribute
24275 and report the correct error in that case (moved the duplicate code to
24276 its own method, too).
24278 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
24280 * attribute.cs: lookup attribute type name as the spec says: first the
24281 bare attribute name and then name + "Attribute" (nant compiles with
24282 mcs after this fix).
24284 2002-05-07 Miguel de Icaza <miguel@ximian.com>
24286 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
24287 Because of the way we parse things, we should try to see if a
24288 UIntConstant can fit in an integer.
24290 2002-05-07 Ravi Pratap <ravi@ximian.com>
24292 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
24293 when we are in an explicit context.
24295 (ConvertReferenceExplicit): When converting from Iface type S to Class
24296 T make sure the rules are implemented as an OR.
24298 * parameter.cs (ParameterType): Make it a property for now although the
24299 purpose really isn't anything immediate.
24301 * expression.cs (Is*Applicable): Do better checking on the parameter type
24302 of a ref/out parameter. The ones from the system assemblies are already
24303 marked with the correct type so we don't need to do any correction.
24305 * ecore.cs (StandardConversionExists): Conversion from Interface types to
24306 the object type is standard too so include that.
24308 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24310 * ecore.cs (StandardConversionExists): Augment with missing code:
24311 deal with IntConstant, LongConstants and Enumerations.
24313 * assign.cs: Report the error, instead of failing silently
24315 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
24316 typecontainer that they are declared, because the
24317 typecontainer/namespace will have the list of using clauses that
24318 need to be applied.
24320 Assembly Attributes were escaping the normal registration
24323 (EmitCode): Apply attributes within an EmitContext that represents
24324 the container they were declared on.
24326 * cs-parser.jay: Track bases for structs. How did I get this wrong?
24328 2002-05-06 Ravi Pratap <ravi@ximian.com>
24330 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
24331 Revamp completely - make much cleaner as we now operate only
24334 (FindMostSpecificSource, FindMostSpecificTarget): New methods
24335 to implement the logic detailed in the spec more correctly.
24337 (UserDefinedConversion): Update accordingly.
24339 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24341 * statement.cs: Return flow analysis information up.
24343 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
24346 (token): Do not consume an extra character before calling
24349 2002-05-06 Piers Haken <piersh@friskit.com>
24351 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
24353 2002-05-06 Miguel de Icaza <miguel@ximian.com>
24355 * class.cs (Constructor.Emit): Set the IsStatic flag in the
24356 EmitContext during the instance constructor initializer
24357 resolution, to stop access to instance variables.
24359 This is mandated by the spec, last paragraph of the `constructor
24360 initializers' section.
24362 2002-05-05 Miguel de Icaza <miguel@ximian.com>
24364 * cs-parser.jay, class.cs (Accessor): new class used to represent
24365 an accessor (get or set). In the past we used `null' to represent
24366 a missing accessor. But this is ambiguous because there was no
24367 way to tell in abstract indexers/properties if one of them was
24370 Now there is a way of addressing that.
24372 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
24373 instead of FindMembers.
24375 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
24376 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
24378 * attribute.cs: Treat indexers and properties as the same in terms
24379 of applying attributes
24381 * ecore.cs (FindMostEncompassedType): Use statically initialized
24382 EmptyExpressions()s like we do elsewhere to avoid creating useless
24383 objects (and we take this out of the tight loop).
24385 (GetConversionOperators): Move the code to extract the actual
24386 operators to a separate routine to clean things up.
24388 2002-05-04 Miguel de Icaza <miguel@ximian.com>
24390 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
24391 events are always registered FieldBuilders.
24393 * class.cs (FieldBase): New class shared by Fields
24395 * delegate.cs: If we are a toplevel delegate, use our full name.
24396 If we are a nested delegate, then only use our tail name.
24398 2002-05-02 Ravi Pratap <ravi@ximian.com>
24400 * expression.cs (IsApplicable): Ensure that we add the "&" to
24401 ref/out types before comparing it with the type of the argument.
24403 (IsParamsMethodApplicable): Ditto.
24405 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
24408 * delegate.cs : Handle the case when we have more than one applicable
24409 method. Flag an error only when we finish checking all.
24411 2002-05-02 Miguel de Icaza <miguel@ximian.com>
24413 * expression.cs: Add support for boolean static initializers.
24415 2002-05-01 Miguel de Icaza <miguel@ximian.com>
24417 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
24419 * parameter.cs (ComputeParameterTypes,
24420 ComputeAndDefineParameterTypes): Better error handling: now we
24421 clear the `types' cache if we fail during any of the type lookups.
24422 We also return the status code correctly to our caller
24424 * delegate.cs: If we fail to define a delegate, abort the extra
24427 * expression.cs (Binary.ResolveOperator): for
24428 operator==(object,object) and operator !=(object, object) we also
24429 have to verify that there is an implicit conversion from one to
24432 (ArrayAccess.DoResolve): Array Access can operate on
24435 2002-04-30 Miguel de Icaza <miguel@ximian.com>
24437 * assign.cs (CompoundAssign): A new class used as a "flag" that
24438 the assignment actually is happening as part of a compound
24439 assignment operator.
24441 During compound assignment, a few new rules exist to enable things
24448 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
24449 to the type of x) if y is implicitly convertible to the type of x,
24450 and the operator is a builtin operator and the return type of the
24451 operator is explicitly convertible to the type of x.
24453 * rootcontext.cs: Reset warning level to 2. 4 catches various
24454 "interesting" features in mcs, we must clean this up at some
24455 point, but currently am trying to kill other bugs ;-)
24457 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
24458 in container classes as well.
24460 * expression.cs (Binary.ResolveOperator): Handle string case
24461 before anything else (as operator overloading does emit an error
24462 before doing anything else).
24464 This code could go away when we move to a table driven model, but
24465 i could not come up with a good plan last night.
24467 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
24469 * typemanager.cs (CSharpName): reimplementation using regex.
24470 * class.cs: added null check for fields in Emit
24471 * rootcontext.cs: set warninglevel to 4
24473 2002-04-29 Miguel de Icaza <miguel@ximian.com>
24475 * typemanager.cs (CSharpName): reimplemented with Lupus
24478 2002-04-28 Miguel de Icaza <miguel@ximian.com>
24480 * statement.cs (If): correclty implement Resolve, because we were
24481 not catching sem errors in there. The same process is needed
24483 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
24486 (Statement.Warning_DeadCodeFound): Factorize code.
24487 (While): Report dead code here too.
24489 (Statement): Added Resolve virtual method to allow
24490 for resolution split from the emit code.
24492 2002-04-26 Miguel de Icaza <miguel@ximian.com>
24494 * statement.cs (EmitBoolExpression): No longer try to resolve the
24496 (MakeBoolean): New utility function that resolve, implicitly
24497 converts to boolean and tags the expression.
24500 (If, Do): Implement dead code elimination.
24501 (While): Implement loop inversion
24503 (Do, While, For, If): Resolve the expression prior to calling our
24506 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
24509 - added method Report28 (warning: program has more than one entry point)
24510 - added method IsEntryPoint, implements paragraph 10.1 of the spec
24511 - modified method Method.Define, the part at the end of the method
24513 * rootcontext.cs: added static public Location EntryPointLocation;
24515 * ../errors/cs0028.cs : Add test case for the above warning.
24518 - modified method CSharpName to allow arrays of primitive type to
24519 be printed nicely (e.g. instead of System.Int32[][] it now prints
24521 - added method CSharpSignature: returns the signature of a method
24522 in string format to be used in reporting errors, warnings, etc.
24524 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
24527 2002-04-26 Ravi Pratap <ravi@ximian.com>
24529 * delegate.cs (Define): Fix extremely silly bug where I was
24530 setting the type of the 'object' parameter of the BeginInvoke
24531 method to System.IAsyncResult instead of System.Object ;-)
24533 2002-04-26 Miguel de Icaza <miguel@ximian.com>
24535 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
24538 (Constructor.Emit): return if we fail to initialize the
24539 constructor. Another door closed!
24541 * expression.cs (New.DoResolve): Improve error message (from -6 to
24542 1501). Use DeclaredOnly lookup to find the exact constructor.
24544 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
24545 loop. This is useful.
24547 * cs-parser.jay: Adjust the default parameters so that destructors
24548 have the proper signature.
24550 2002-04-26 Martin Baulig <martin@gnome.org>
24552 * driver.cs (LoadAssembly): If `assembly' contains any characters
24553 which are only valid in path names and not in assembly names
24554 (currently slash, backslash and point), use Assembly.LoadFrom ()
24555 instead of Assembly.Load () on the `assembly' (before iteration
24556 over the link_paths).
24558 2002-04-26 Martin Baulig <martin@gnome.org>
24560 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
24562 2002-04-25 Miguel de Icaza <miguel@ximian.com>
24564 * class.cs (Property): use the new typemanager.MemberLookup
24566 (TypeContainer.MemberLookup): Implement using the
24567 TypeManager.MemberLookup now.
24569 * typemanager.cs: Make MemberLookup a function of the TypeManager,
24570 and return MemberInfos, so that these can be used without an
24571 EmitContext (what we had before).
24573 2002-04-24 Miguel de Icaza <miguel@ximian.com>
24575 * expression.cs: Fix the case where the argument to params if the
24576 type of the params. I omitted handling this before. Fixed
24578 2002-04-22 Miguel de Icaza <miguel@ximian.com>
24580 * driver.cs: Call BootCorlib_PopulateCoreType
24582 * class.cs (Property.CheckBase): Check for properties only, not
24585 * interface.cs: Temporary hack: try/catch around the
24586 CustomAttributeBuilder, because I am getting an exception that I
24589 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
24590 types whose definitions are required to be there (attributes are
24591 defined before standard types).
24593 Compute definitions as we boot the various types, as they are used
24594 immediately (value_type class will need object_type, but if we do
24595 not initialize object_type, we will pass a null, which will let
24596 the runtime pick the System.Object from the existing corlib, which
24597 is not what we want).
24599 2002-04-22 Patrik Torstensson <totte@labs2.com>
24601 * cs-tokenizer.cs: fixed a number of trim() issues.
24603 2002-04-22 Ravi Pratap <ravi@ximian.com>
24605 * expression.cs (Argument.Type): Ensure that we return the correct
24606 type when we have out or ref parameters [in which case we
24609 2002-04-22 Miguel de Icaza <miguel@ximian.com>
24611 * class.cs (Property, Indexer): Allow extern modifier in there.
24613 * typemanager.cs (InitBaseTypes): Initializes object_type and
24614 value_type, since those will be used early on during the bootstrap
24615 process to compile corlib.
24617 (InitCoreTypes): Move code from here to InitBaseTypes.
24619 2002-04-21 Miguel de Icaza <miguel@ximian.com>
24621 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
24622 single-dimension arrays as using the ldlen opcode.
24624 Daniel Lewis discovered this optimization.
24626 * typemanager.cs: Add signature for System.Array::get_Length
24628 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24630 * statement.cs: report the error when the foreach does not apply to an
24631 array nor a collection.
24633 2002-04-19 Miguel de Icaza <miguel@ximian.com>
24635 * expression.cs: Add implicit conversions to the operator ~.
24637 * constant.cs (DecimalConstant.Emit): Emit decimal value.
24639 * typemanager.cs: Locate the decimal constructor.
24641 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24643 * attribute.cs: use the new property of TypeOf.
24644 * expression.cs: added 'get' property around typearg.
24646 These changes fix a build breaker reported by NickD. Is this the
24647 correct way to fix? If not, please, revert my changes and make it
24650 2002-04-17 Miguel de Icaza <miguel@ximian.com>
24652 * attribute.cs: Add support for typeof in attribute invocations.
24653 I am not sure that this is right though.
24655 2002-04-14 Duncan Mak <duncan@ximian.com>
24657 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
24658 Binary.Operator.Division case.
24660 2002-04-13 Ravi Pratap <ravi@ximian.com>
24662 * class.cs (DefineType): Ensure that we do a proper check on
24663 attribute types and also register it with the TypeManager.
24665 (TypeContainer.Targets): The default for attribute types is
24666 AttributeTargets.All.
24668 * attribute.cs (ApplyAttributes): Registering the attribute type
24669 is done elsewhere, not when we discover we have a Usage attribute.
24671 2002-04-12 Ravi Pratap <ravi@ximian.com>
24673 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
24674 and get rid of is_delegate parameter.
24676 * everywhere : update.
24678 2002-04-12 Ravi Pratap <ravi@ximian.com>
24680 * cs-parser.jay (compilation_unit): Revamp completely to use
24681 some new ideas that I got from Rhys' grammar to solve the problems
24682 with assembly level attributes.
24684 (outer_declaration): New grammar production.
24686 (attribute_sections): Add.
24688 (opt_attributes): Base on attribute_sections
24690 (namespace_declaration): Allow opt_attributes to tackle the case
24691 when we have assembly level attributes - we are clever in this
24694 * attribute.cs (ApplyAttributes): Do not worry about assembly
24695 attributes in the non-global context.
24697 * rootcontext.cs (AddGlobalAttributes): Go back to using this
24698 instead of SetGlobalAttributes.
24700 * class.cs, rootcontext.cs : Ensure we define and generate
24701 attribute types before anything else.
24703 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
24704 and flag the new error -20 for the case when the attribute type
24705 does not have valid targets specified. csc does not catch this.
24707 * ../errors/errors.txt : update for error # -20
24709 2002-04-11 Ravi Pratap <ravi@ximian.com>
24711 * support.cs (InternalParameters.ParameterModifier): Do some null
24712 checking and return sane values.
24714 * class.cs (Method.Define): If we are a PInvoke method, ensure
24715 that we are static and extern. Report error # 601
24717 * ../errors/cs0601.cs : Add test case for the above error.
24719 2002-04-07 Ravi Pratap <ravi@ximian.com>
24721 * rootcontext.cs (attribute_types): We need to keep type of
24722 all attribute types separately and emit code for them first.
24724 (RegisterAttribute) : Implement.
24726 * class.cs (DefineType): Check if the current Type is a custom
24727 attribute type and register it accordingly.
24729 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
24730 adding the first attribute twice and rename to
24732 (SetGlobalAttributes): this.
24734 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
24737 * attribute.cs (ApplyAttributes): Take an additional argument telling us
24738 if we are processing global arguments. Hmm, I am unsure of this.
24740 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24742 * expression.cs: added static array of strings to avoid calling
24743 Enum.ToString () for Operator in Binary. Significant recover of
24746 2002-04-10 Miguel de Icaza <miguel@ximian.com>
24748 * class.cs (FindMembers): Allow the Builders of the various
24749 members to be null. If they are skip them. This only happens
24750 during the PInvoke declaration.
24752 2002-04-09 Miguel de Icaza <miguel@ximian.com>
24754 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
24755 failure, so we do not keep going afterwards.
24757 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
24758 wanted to pass `false' as the `is_delegate' argument. If this is
24759 the case, why not use delegate_type == null to mean `is_delegate =
24760 false' and anything else as is_delegate = true.
24762 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
24764 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
24765 code for the section, not the beginning of the tests.
24767 2002-04-08 Miguel de Icaza <miguel@ximian.com>
24769 * cfold.cs: Handle operator + (Enum x, Underlying x)
24771 * expression.cs (Binary): same. Warn about errors where we have
24772 Enum/Enum in operator + as well.
24774 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
24777 - added support for switch(bool)
24778 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
24779 - add TableSwitchEmit() to handle table-based switch statements
24781 2002-04-05 Ravi Pratap <ravi@ximian.com>
24783 * expression.cs (Invocation.OverloadResolve): Factor out code which
24784 does parameter compatibility checking with arguments so that we can
24785 re-use the code even from Delegate.VerifyApplicability
24787 (VerifyArgumentsCompat): Move above code here.
24789 * delegate.cs (VerifyApplicability): Get rid of duplicate code
24790 and instead make a call to the above method.
24792 2002-03-31 Ravi Pratap <ravi@ximian.com>
24794 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
24795 We use it to keep track of classes which are attribute types.
24797 2002-04-02 Miguel de Icaza <miguel@ximian.com>
24799 * delegate.cs (Delegate.Define): Correctly define the types in the
24800 presence of fixed and array parameters.
24802 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
24805 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
24806 include NonPublic after the first iteration.
24808 * class.cs (Indexer.CheckBase): Only check if both parents are
24811 * cs-parser.jay (accessor_body): If empty, set to null.
24813 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
24814 same code path here to resolve constants names that we did have in
24815 MemberAccess.DoResolve. There is too much code duplicated here.
24817 2002-04-01 Miguel de Icaza <miguel@ximian.com>
24819 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
24821 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
24824 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
24825 tokens, numbers and strings.
24827 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
24830 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
24831 asyncronous parameters and the regular parameters.
24833 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
24834 specify the target directory.
24836 * expression.cs: (This.DoResolve): Simplify
24837 (As.Emit): Optimize, do not generate IsInst if the expression is
24838 always of the given type.
24840 (Is.DoResolve): Bug fix, we were reporting both always/never for
24843 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
24844 creating too many unnecessary arrays.
24846 2002-03-31 Miguel de Icaza <miguel@ximian.com>
24848 * class.cs (EmitFieldInitializer): Use Assign expression to assign
24849 fields instead of rolling our own initializer. Takes care of all
24850 implicit conversions, and drops unnecessary static checks/argument.
24852 2002-03-31 Dick Porter <dick@ximian.com>
24854 * driver.cs: use the GetDirectories() return values properly, and
24855 use "/" as path separator.
24857 2002-03-30 Miguel de Icaza <miguel@ximian.com>
24859 * expression.cs (Unary): Optimize - - expr into expr.
24860 (Binary): Optimize a + (-b) into a -b.
24862 * codegen.cs (CodeGen): Made all methods static.
24864 2002-03-29 Miguel de Icaza <miguel@ximian.com>
24868 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
24869 TypeBuilder property.
24871 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
24874 * tree.cs: Removed the various RecordXXXX, and replaced with a
24875 single RecordDecl. Removed all the accessor methods, and just
24876 left a single access point Type
24878 * enum.cs: Rename DefineEnum to DefineType.
24880 * decl.cs: New abstract method `DefineType' used to unify the
24881 Defines for Enumerations, Interfaces, TypeContainers and
24884 (FindType): Moved LookupInterfaceOrClass here. Moved the
24885 LookupBaseClasses method that used to live in class.cs and
24886 interface.cs here, and renamed to FindType.
24888 * delegate.cs: Implement DefineType. Take advantage of the
24889 refactored pattern for locating the parent builder without taking
24890 the parent_builder argument (which we know does not work if we are
24891 nested, and triggering a toplevel definition).
24893 2002-03-28 Miguel de Icaza <miguel@ximian.com>
24895 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
24896 accessibility of a member has changed during override and report
24899 * class.cs (Method.Define, Property.Define): Only complain on
24900 overrides if the method is private, any other accessibility is
24901 fine (and since we just checked the permission is the same, we are
24904 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
24905 and elif are processed always. The other pre-processing
24906 directives are only processed if we are "taking" the path
24908 2002-03-29 Martin Baulig <martin@gnome.org>
24910 * class.cs (Method.Emit): Only emit symbolic debugging info if the
24911 current location is not Null.
24913 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
24914 a separate method so we can profile it.
24916 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
24917 `span.Seconds' are just seconds, but no minutes or hours.
24918 (MainDriver): Profile the CodeGen.SaveSymbols calls.
24920 2002-03-28 Miguel de Icaza <miguel@ximian.com>
24922 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
24923 Remove the gratuitous set of Final:
24925 // If an interface implementation, then we can set Final.
24926 if (((flags & MethodAttributes.Abstract) == 0) &&
24927 implementing.DeclaringType.IsInterface)
24928 flags |= MethodAttributes.Final;
24930 I do not know what I was smoking when I used that.
24933 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
24934 step into fixing the name resolution issues for delegates and
24935 unifying the toplevel name resolution.
24937 2002-03-28 Martin Baulig <martin@gnome.org>
24939 * class.cs (Method.Emit): If we have a symbol writer, call its
24940 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
24941 tell it about the current method.
24943 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
24944 writer that we're going to emit the first byte of IL code for a new
24945 statement (a new source line).
24946 (EmitContext.EmitTopBlock): If we have a symbol writer, call
24947 EmitContext.Mark() before emitting any code.
24949 * location.cs (SymbolDocument): Return null when we're Null.
24951 * statement.cs (Statement): Moved the `Location loc' variable here.
24952 (Statement.EmitBoolExpression): If we have a symbol writer, call
24953 ec.Mark() before emitting any code to tell it that we're at the
24954 beginning of a new statement.
24955 (StatementExpression): Added `Location' argument to the constructor.
24956 (Block): Added public readonly variable `StartLocation' and public
24957 variable `EndLocation'. The latter is to be set using SetEndLocation().
24958 (Block): Added constructor which takes a start and end location.
24959 (Block.SetEndLocation): New method. This sets the end location.
24960 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
24961 local variables we create.
24962 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
24963 each statement and do also mark the begin and end of the block.
24965 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
24966 tell it the current lexer.Location, use Location.Null for the end of the
24968 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
24969 current block, set its end location using SetEndLocation().
24970 (statement_expression): StatementExpression constructor now takes the
24971 lexer.Location as additional argument.
24972 (for_statement, declare_local_variables): Likewise.
24973 (declare_local_variables): When creating a new implicit block, use the
24974 new Block constructor and pass it the lexer.Location.
24976 2002-03-28 Miguel de Icaza <miguel@ximian.com>
24978 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
24979 members also on the parent interfaces recursively.
24981 2002-03-27 Miguel de Icaza <miguel@ximian.com>
24983 * report.cs: Use new formats, since Gonzalo finished the missing
24986 * expression.cs (Binary.ResolveOperator): added missing operator|
24987 operator& and operator^ for bool/bool.
24989 * cs-parser.jay: CheckDef now takes a Location argument that is
24990 used to report errors more precisly (instead of reporting the end
24991 of a definition, we try to track something which is a lot closer
24992 to the source of the problem).
24994 * cs-tokenizer.cs: Track global token use, so we can properly flag
24995 the use of #define/#undef after the first token has been seen.
24997 Also, rename the reportXXXX to Error_DescriptiveName
24999 * decl.cs (DeclSpace.IsTopLevel): Move property here from
25000 TypeContainer, so that Enum and Interface can use this too.
25002 * class.cs (TypeContainer.LookupInterfaceOrClass,
25003 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
25004 `builder' argument. Typically this was used to pass the parent
25005 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
25008 The problem is that a nested class could trigger the definition of
25009 a toplevel class, and the builder would be obviously wrong in that
25012 So we drop this argument, and we compute dynamically the
25013 TypeBuilder/ModuleBuilder (the correct information was available
25014 to us anyways from DeclSpace.Parent)
25016 * interface.cs (Interface.DefineInterface): Drop builder
25017 parameter cleanup like class.cs
25019 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
25022 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
25025 (Try.Emit): Propagate the returns value from the statement.
25027 (Return.Emit): Even if we are leavning
25029 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
25031 * modifiers.cs: Fix the computation of MethodAttributes flags.
25033 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
25035 * driver.cs: allow compilation of files that start with '/'.
25036 Add a default case when checking the argument of --target.
25038 2002-03-25 Miguel de Icaza <miguel@ximian.com>
25040 * interface.cs: Implement the same search algorithm for types in
25041 the interface code.
25043 * delegate.cs: Do not allow multiple definition.
25045 * Recovered ChangeLog that got accidentally amputated
25047 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
25049 * rootcontext.cs: Load manually enum to allow core classes to
25050 contain enumerations.
25052 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
25053 Update to new static methods in TypeManager.
25055 * typemanager.cs (GetMethod, GetConstructor): Use our
25056 implementation of FindMembers to find the members, since during
25057 corlib compilation, the types are TypeBuilders and GetMethod and
25058 GetConstructor do not work.
25060 Make all methods in TypeManager static.
25062 (InitCodeHelpers): Split the functionality from
25063 the InitCodeTypes function.
25065 * driver.cs: Call InitCodeHelpers after we have populated the
25068 * cs-parser.jay (delegate_declaration): we did not used to compute
25069 the delegate name correctly for void delegates.
25071 2002-03-24 Miguel de Icaza <miguel@ximian.com>
25073 * rootcontext.cs (RootContext): Init the interface_resolve_order
25074 and type_container_resolve_order always.
25076 (ResolveCore, BootstrapCorlib_ResolveClass,
25077 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
25078 compiler when compiling with --nostdlib
25080 * class.cs (TypeContainer.DefineType): Check that our parent is
25081 not null. This test is most important when we are bootstraping
25084 * codegen.cs: Split out the symbol writing code.
25086 2002-03-25 Martin Baulig <martin@gnome.org>
25088 * driver.cs (-g): Made -g an alias for --debug.
25090 2002-03-24 Martin Baulig <martin@gnome.org>
25092 * codegen.cs (SymbolWriter): New public variable. Returns the
25093 current symbol writer.
25094 (CodeGen): Added `bool want_debugging_support' argument to the
25095 constructor. If true, tell the ModuleBuild that we want debugging
25096 support and ask it for the ISymbolWriter.
25097 (Save): If we have a symbol writer, call it's Close() method after
25098 saving the assembly.
25100 * driver.c (--debug): New command line argument to create a
25101 debugger information file.
25103 * location.cs (SymbolDocument): New public property. Returns an
25104 ISymbolDocumentWriter object for the current source file or null
25105 if we don't have a symbol writer.
25107 2002-03-21 Miguel de Icaza <miguel@ximian.com>
25109 * driver.cs (LoadAssembly): Correctly return when all the paths
25110 have been tried and not before.
25112 * statement.cs (Switch.Emit): return the actual coverage for this
25113 statement (returns/not-returns)
25115 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
25116 switch of the statement if we are the last switch section. That
25117 kills two problems: try/catch problems (we used to emit an empty
25118 nop at the end) and switch statements where all branches would
25121 2002-03-19 Miguel de Icaza <miguel@ximian.com>
25123 * driver.cs: Add default assemblies (the equivalent to the
25124 Microsoft CSC.RSP file)
25126 * cs-tokenizer.cs: When updating `cols and setting it to zero,
25127 also update tokens_seen and set it to false.
25129 * driver.cs: Implement --recurse for Mike.
25131 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
25132 correctly splitting out the paths.
25134 2002-03-18 Miguel de Icaza <miguel@ximian.com>
25136 * interface.cs (Interface.PopulateProperty): Instead of using
25137 `parent' as the declaration space for the set parameters, use
25140 * support.cs (InternalParameters): InternalParameters constructor
25141 takes a DeclSpace instead of a TypeContainer.
25143 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
25144 types are being initialized, load the address of it before calling
25147 (New): Provide a mechanism to disable the generation of local
25148 value type temporaries when the caller will be providing us with
25149 an address to store it.
25151 (ArrayCreation.EmitDynamicInitializers): Use it.
25153 2002-03-17 Miguel de Icaza <miguel@ximian.com>
25155 * expression.cs (Invocation.EmitArguments): Only probe for array
25156 property if there is more than one argument. Sorry about that.
25158 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
25159 empty param arrays.
25161 * class.cs (Method.LabelParameters): Fix incorrect code path that
25162 prevented the `ParamArrayAttribute' from being applied to the
25165 2002-03-16 Miguel de Icaza <miguel@ximian.com>
25167 * support.cs (ReflectionParameters): Correctly compute whether the
25168 last argument is a params array. Fixes the problem with
25171 * typemanager.cs: Make the assemblies array always be non-null
25172 (empty, but non-null)
25174 * tree.cs (RecordDecl): New function that abstracts the recording
25175 of names. This reports error 101, and provides a pointer to the
25176 previous declaration. Fixes a crash in the compiler.
25178 * cs-parser.jay (constructor_declaration): Update to new grammar,
25179 and provide a constructor_body that can be empty.
25181 2002-03-15 Miguel de Icaza <miguel@ximian.com>
25183 * driver.cs: Add support for --resources.
25185 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
25186 Make all types for the various array helper methods be integer.
25188 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
25189 CheckState to ConvCast.
25191 (ConvCast): Now it takes a `checked' state argument, to avoid
25192 depending on the emit context for the conversion, and just using
25193 the resolve time setting.
25195 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
25196 instead of Invocation.EmitArguments. We do not emit the original
25197 arguments, instead we emit those which have been converted to
25198 unsigned int expressions.
25200 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
25202 * codegen.cs: ditto.
25204 * expression.cs (LocalVariableReference): Drop the use of the
25205 Store function that depended on the variable index.
25207 * statement.cs (VariableInfo): Drop the `Idx' property from this
25208 class, as this is not taking into account the indexes for
25209 temporaries tat we generate during the execution, getting the
25212 * class.cs: First emit class initializers, then call the parent
25215 * expression.cs (Binary): Fix opcode emision.
25216 (UnaryMutator.EmitCode): Support checked code generation
25218 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
25219 matches for events for both the Static and Instance scans,
25220 pointing to the same element. Fix that.
25222 2002-03-14 Miguel de Icaza <miguel@ximian.com>
25224 * rootcontext.cs (ResolveTree): Always set the
25225 interface_resolve_order, because nested interfaces will be calling
25228 * class.cs (GetInterfaceOrClass): Track the same resolution
25229 process used by TypeManager.LookupType. This fixes the nested
25230 type lookups in class declarations (separate path from
25233 (TypeContainer.DefineType): Also define nested interfaces.
25234 (TypeContainer.RegisterOrder): New public function used to
25235 register the order in which child interfaces need to be closed.
25237 Nested interfaces need to be closed after their parents have been
25240 * interface.cs (InterfaceAttr): Put all the logic for computing
25241 the interface attribute here.
25243 (DefineInterface): Register our interface order with the
25244 RootContext or with the TypeContainer depending on the case.
25246 2002-03-12 Miguel de Icaza <miguel@ximian.com>
25248 * cs-parser.jay: rework foreach statement to work with the new
25249 changes to the policy on SimpleNames.
25251 * report.cs: support Stacktrace on warnings as well.
25253 * makefile: drop --unsafe and /unsafe from the compile.
25255 2002-03-13 Ravi Pratap <ravi@ximian.com>
25257 * ecore.cs (StandardConversionExists): Modify to take an Expression
25258 as the first parameter. Ensure we do null -> reference type conversion
25261 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
25262 temporary Expression objects.
25264 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
25266 * interface.cs: workaround bug in method overloading resolution
25267 (there is already a bugzilla bug for it).
25269 2002-03-12 Miguel de Icaza <miguel@ximian.com>
25271 We could also solve this problem by having a separate path for
25272 performing type lookups, instead of DoResolve, we could have a
25273 ResolveType entry point, and only participating pieces of the
25274 production (simplename, deref, array) would implement this.
25276 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
25277 signal SimpleName to only resolve type names and not attempt to
25278 resolve anything else.
25280 * expression.cs (Cast): Set the flag.
25282 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
25284 * class.cs: Only report 108 if there is no `new' modifier.
25286 * cs-parser.jay: rework foreach statement to work with the new
25287 changes to the policy on SimpleNames.
25289 * report.cs: support Stacktrace on warnings as well.
25291 * makefile: drop --unsafe and /unsafe from the compile.
25293 2002-03-11 Miguel de Icaza <miguel@ximian.com>
25295 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25296 lookups here, instead of doing that at parse time. This means
25297 that our grammar will not introduce `LocalVariableReferences' as
25298 expressions at this point. That solves the problem of code like
25302 static void Main ()
25306 This is only half the fix. The full fix requires parameters to
25307 also be handled in this way.
25309 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
25310 makes the use more obvious of the DeclSpace. The
25311 ec.TypeContainer.TypeBuilder is now only used to pull the
25312 TypeBuilder for it.
25314 My theory is that I can get rid of the TypeBuilder completely from
25315 the EmitContext, and have typecasts where it is used (from
25316 DeclSpace to where it matters).
25318 The only pending problem is that the code that implements Aliases
25319 is on TypeContainer, and probably should go in DeclSpace.
25321 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25322 lookups here, instead of doing that at parse time. This means
25323 that our grammar will not introduce `LocalVariableReferences' as
25324 expressions at this point. That solves the problem of code like
25328 static void Main ()
25332 This is only half the fix. The full fix requires parameters to
25333 also be handled in this way.
25335 * class.cs (Property.DefineMethod): When implementing an interface
25336 method, set newslot, when implementing an abstract method, do not
25337 set the flag (before we tried never setting it, or always setting
25338 it, which is the difference).
25339 (Indexer.DefineMethod): same.
25340 (Method.DefineMethod): same.
25342 * ecore.cs: Only set the status used flag if we get back a Field.
25344 * attribute.cs: Temporary hack, so Paolo can keep working.
25346 2002-03-08 Ravi Pratap <ravi@ximian.com>
25348 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
25349 the unmanaged type in the case we have a MarshalAs attribute.
25351 (Resolve): Handle the case when we are parsing the special MarshalAs
25352 attribute [we need to store the unmanaged type to use later]
25354 * typemanager.cs (marshal_as_attr_type): Built in type for the
25355 MarshalAs Attribute.
25357 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
25358 on parameters and accordingly set the marshalling info.
25360 2002-03-09 Miguel de Icaza <miguel@ximian.com>
25362 * class.cs: Optimizing slightly by removing redundant code after
25363 we switched to the `NoTypes' return value.
25364 (Property.DefineMethod): use NoTypes here too.
25366 This fixes the bug I introduced in my last batch of changes.
25368 2002-03-05 Ravi Pratap <ravi@ximian.com>
25370 * tree.cs (RecordEnum): Add. We now keep track of enums too.
25372 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
25373 Enums since those are types too.
25375 * cs-parser.jay (enum_declaration): Record enums as we parse them.
25377 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
25378 thanks to a call during the lookup process.
25380 2002-03-07 Miguel de Icaza <miguel@ximian.com>
25382 * statement.cs (Foreach): Lots of work to accomodate a particular
25383 kind of foreach statement that I had not kept in mind. It is
25384 possible to have foreachs on classes that provide a GetEnumerator
25385 method that return objects that implement the "pattern" for using
25386 a foreach, there is no need to support GetEnumerator
25389 This is needed to compile nant.
25391 * decl.cs: Only report 114 if the member is not `Finalize' and if
25392 the warning level is at least 2.
25394 * class.cs: Moved the compare function from Method to
25397 (MethodSignature.InheritableMemberSignatureCompare): Add new
25398 filter function that is used to extract inheritable methods from a
25401 (Method.Define): Use the new `inheritable_method_signature_filter'
25404 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
25407 2002-03-06 Miguel de Icaza <miguel@ximian.com>
25409 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
25411 * cs-parser.jay: Add opt_semicolon to the interface declaration.
25413 * expression.cs: Pass location information to
25414 ConvertImplicitStandard.
25416 * class.cs: Added debugging code to track return values from
25419 2002-03-05 Miguel de Icaza <miguel@ximian.com>
25421 * expression.cs (Is.DoResolve): If either side of the `is' is an
25422 interface, do not flag the warning.
25424 * ecore.cs (ImplicitReferenceConversion): We need a separate test
25427 * report.cs: Allow for --fatal to be used with --probe.
25429 * typemanager.cs (NoTypes): Move the definition for the empty Type
25432 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
25434 (TypeContainer.DefineProxy): New function used to proxy to parent
25435 implementations when implementing interfaces.
25436 (TypeContainer.ParentImplements): used to lookup if our parent
25437 implements a public function that is required by an interface.
25438 (TypeContainer.VerifyPendingMethods): Hook this up.
25440 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
25441 `modules' and `assemblies' arraylists into arrays. We only grow
25442 these are the very early start up of the program, so this improves
25443 the speedof LookupType (nicely measured).
25445 * expression.cs (MakeByteBlob): Replaced unsafe code with
25446 BitConverter, as suggested by Paolo.
25448 * cfold.cs (ConstantFold.Binary): Special case: perform constant
25449 folding of string concatenation, but if either side is a string,
25450 and the other is not, then return null, and let the runtime use
25451 the concatenation on the string plus the object (using
25452 `Object.ToString').
25454 2002-03-04 Miguel de Icaza <miguel@ximian.com>
25456 Constant Folding has been implemented now.
25458 * expression.cs (Unary.Reduce): Do not throw an exception, catch
25459 the error instead on types that are not supported in one's
25462 * constant.cs (Constant and all children): New set of functions to
25463 perform implict and explicit conversions.
25465 * ecore.cs (EnumConstant): Implement the new functions to perform
25466 conversion by proxying to the child expression.
25468 * codegen.cs: (ConstantCheckState): Constant evaluation has its
25469 own separate setting that can not be turned off from the command
25470 line using --unchecked or --checked and is only controlled using
25471 the checked/unchecked statements and expressions. This setting is
25472 used by the constant folder to flag errors.
25474 * expression.cs (CheckedExpr, UncheckedExpr): Set the
25475 ConstantCheckState as well.
25477 During Resolve, they also have to flag the state, because the
25478 constant folder runs completely in the Resolve phase.
25480 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
25483 2002-03-01 Miguel de Icaza <miguel@ximian.com>
25485 * cfold.cs: New file, this file contains the constant folder.
25487 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
25488 argument to track whether we are using the resulting address to
25489 load or store a value and provide better error messages.
25491 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
25492 new AddressOf arguments.
25494 * statement.cs (Foreach.EmitCollectionForeach): Update
25496 * expression.cs (Argument.Emit): Call AddressOf with proper
25497 arguments to track usage.
25499 (New.DoEmit): Call AddressOf with new arguments.
25501 (Unary.Emit): Adjust AddressOf call.
25503 2002-03-01 Ravi Pratap <ravi@ximian.com>
25505 * cs-parser.jay (member_access): Change the case for pre-defined types
25506 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
25509 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
25512 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
25513 essentially like methods and apply attributes like MethodImplOptions to them too.
25515 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
25518 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
25519 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
25522 * Update code everywhere accordingly.
25524 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
25526 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
25528 2002-02-28 Ravi Pratap <ravi@ximian.com>
25530 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
25531 try performing lookups against those instead of jumping straight into using
25532 the 'using' clauses.
25534 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
25536 (LookupType): Perform lookups in implicit parents too.
25538 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
25539 sequence as RootContext.LookupType.
25541 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
25542 the various cases of namespace lookups into this method.
25544 2002-03-01 Miguel de Icaza <miguel@ximian.com>
25546 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
25547 in positional arguments)
25549 * class.cs (Operator): Update the AllowedModifiers to contain
25552 * cs-parser.jay: Update operator declaration to allow for the
25553 operator body to be empty.
25555 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
25558 2002-02-27 Miguel de Icaza <miguel@ximian.com>
25560 * class.cs (Method.Emit): Label parameters.
25562 * driver.cs: Return 1 or 0 as the program exit code.
25564 2002-02-26 Miguel de Icaza <miguel@ximian.com>
25566 * expression.cs: Special case the `null' object when trying to
25567 auto-compute the type, as anything can be explicitly converted to
25570 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
25571 spotting this Paolo.
25573 (Expression.ImplicitNumericConversion): Perform comparissions of
25574 the type using the underlying type in the case of an enumeration
25575 rather than using the enumeration type for the compare.
25577 Cope with the underlying == type case, which is not possible to
25580 (Expression.ConvertNumericExplicit): Perform comparissions of
25581 the type using the underlying type in the case of an enumeration
25582 rather than using the enumeration type for the compare.
25584 * driver.cs: If the user does not supply an extension, assume .exe
25586 * cs-parser.jay (if_statement): Rewrote so that we can track the
25587 location for the if statement.
25589 * expression.cs (Binary.ConstantFold): Only concat strings when
25590 the operation is "+", not everything ;-)
25592 * statement.cs (Statement.EmitBoolExpression): Take a location
25594 (If, While, Do): Track location.
25596 * expression.cs (Binary.ResolveOperator): In the object + string
25597 case, I was missing a call to ConvertImplicit
25599 2002-02-25 Ravi Pratap <ravi@ximian.com>
25601 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
25602 Location arguments. Ensure we use RootContext.LookupType to do our work
25603 and not try to do a direct Type.GetType and ModuleBuilder.GetType
25605 * interface.cs (PopulateMethod): Handle the type of the parameter being
25608 * expression.cs (Invocation.BetterFunction): Handle the case when we
25609 have a params method with no fixed arguments and a call is made with no
25612 2002-02-25 Miguel de Icaza <miguel@ximian.com>
25614 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
25615 the verbatim-string-literal
25617 * support.cs (InternalParameters.ParameterModifier): handle null
25619 (InternalParameters.ParameterType): ditto.
25621 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
25622 duplicating the name of the variable parameter.
25623 (GetParameterByName): Fix bug where we were not looking up array
25624 paramters if they were the only present (thanks Paolo!).
25625 (GetParameterInfo): We only have an empty set of types if both
25626 fixed and array are set to null.
25627 (GetParameterInfo-idx): Handle FixedParameter == null
25629 * cs-parser.jay: Handle the case where there is no catch
25630 statements (missing null test).
25632 2002-02-22 Miguel de Icaza <miguel@ximian.com>
25634 * driver.cs (MainDriver): Be conservative on our command line
25637 Catch DirectoryNotFoundException when calling GetFiles.
25639 (SplitPathAndPattern): Used to split the input specification into
25640 a path and a pattern that we can feed to Directory.GetFiles.
25642 2002-02-21 Miguel de Icaza <miguel@ximian.com>
25644 * statement.cs (Fixed): Implement the last case of the Fixed
25645 statement (string handling).
25647 * expression.cs (StringPtr): New class used to return a char * to
25648 a string; Used by the Fixed statement.
25650 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
25652 * expression.cs (Binary.ResolveOperator): Remove redundant
25653 MemberLookup pn parent type.
25654 Optimize union call, we do not need a union if the types are the same.
25655 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
25658 Specialize the use of MemberLookup everywhere, instead of using
25659 the default settings.
25661 (StackAlloc): Implement stackalloc keyword.
25663 * cs-parser.jay: Add rule to parse stackalloc.
25665 * driver.cs: Handle /h, /help, /?
25667 * expression.cs (MakeByteBlob): Removed the hacks we had in place
25668 before we supported unsafe code.
25670 * makefile: add --unsafe to the self compilation of mcs.
25672 2002-02-20 Miguel de Icaza <miguel@ximian.com>
25674 * expression.cs (PointerArithmetic): New class that is used to
25675 perform pointer arithmetic.
25676 (Binary.Resolve): Handle pointer arithmetic
25677 Handle pointer comparission.
25678 (ArrayPtr): Utility expression class that is used to take the
25679 address of an array.
25681 (ElementAccess): Implement array access for pointers
25683 * statement.cs (Fixed): Implement fixed statement for arrays, we
25684 are missing one more case before we are done.
25686 * expression.cs (Indirection): Implement EmitAssign and set the
25687 ExprClass to Variable. This allows pointer dereferences to be
25688 treated as variables, and to have values assigned to them.
25690 * ecore.cs (Expression.StoreFromPtr): New utility function to
25691 store values dereferencing.
25693 2002-02-20 Ravi Pratap <ravi@ximian.com>
25695 * expression.cs (Binary.ResolveOperator): Ensure that we are
25696 not trying to operate on a void type - this fixes the reported
25699 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
25700 the parent implementation is sealed.
25702 * ../errors/cs0239.cs : Add.
25704 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
25706 * typemanager.cs (unverifiable_code_type): Corresponds to
25707 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
25708 which have unsafe code in them.
25710 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
25713 2002-02-19 Miguel de Icaza <miguel@ximian.com>
25715 * cs-tokenizer.cs: Add support for @"litreal strings"
25717 Make tokenizer accept pre-processor directives
25718 on any column (remove the old C-like limitation).
25720 * rootcontext.cs (EmitCode): Emit any global attributes.
25721 (AddGlobalAttributes): Used to keep track of assembly attributes.
25723 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
25725 * cs-parser.jay: Add support for global attributes.
25727 2002-02-17 Miguel de Icaza <miguel@ximian.com>
25729 * expression.cs (Indirection): New helper class. Unary will
25730 create Indirection classes to be able to implement the
25731 IMemoryLocation interface on it.
25733 2002-02-16 Miguel de Icaza <miguel@ximian.com>
25735 * cs-parser.jay (fixed_statement): reference the right statement.
25737 * statement.cs (Fixed.Emit): Finish implementing the fixed
25738 statement for the &x case.
25740 2002-02-14 Miguel de Icaza <miguel@ximian.com>
25742 * class.cs (Property.Define, Method.Define): Remove newslot when
25745 * modifiers.cs: My use of NewSlot when `Abstract' was set was
25746 wrong. NewSlot should only be used if the `new' keyword is present.
25748 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
25749 locating our system dir. Sorry about this.
25751 2002-02-13 Miguel de Icaza <miguel@ximian.com>
25753 * driver.cs (GetSystemDir): Compute correctly the location of our
25754 system assemblies. I was using the compiler directory instead of
25755 the library directory.
25757 2002-02-13 Ravi Pratap <ravi@ximian.com>
25759 * expression.cs (BetterFunction): Put back in what Miguel commented out
25760 since it is the correct fix. The problem is elsewhere ;-)
25762 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
25763 parameters of the parms method are themselves compatible or not !
25765 (StandardConversionExists): Fix very dangerous bug where we were forgetting
25766 to check that a class implements an interface before saying that an implicit
25767 conversion was allowed. Use ImplementsInterface to do the checking.
25769 2002-02-13 Miguel de Icaza <miguel@ximian.com>
25771 * class.cs (Method.Define): Track whether we are an explicit
25772 implementation or not. And only call DefineMethodOverride if we
25773 are an explicit implementation.
25775 (Property.DefineMethod): Ditto.
25777 2002-02-11 Ravi Pratap <ravi@ximian.com>
25779 * expression.cs (BetterFunction): Catch hideous bug which was
25780 preventing us from detecting ambiguous calls due to implicit casts i.e
25783 2002-01-29 Miguel de Icaza <miguel@ximian.com>
25785 * support.cs (Pair): Remove un-needed method. I figured why I was
25786 getting the error in cs-parser.jay, the variable in a foreach loop
25787 is readonly, and the compiler does not really treat this as a variable.
25789 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
25790 instead of EQUALS in grammar.
25792 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
25794 * expression.cs (Unary.DoResolve): Check whether the argument is
25797 2002-01-28 Miguel de Icaza <miguel@ximian.com>
25799 * support.cs: Api for Pair to set a value. Despite the fact that
25800 the variables are public the MS C# compiler refuses to compile
25801 code that accesses the field if the variable is part of a foreach
25804 * statement.cs (Fixed): Begin implementation of the fixed
25807 (Block.AddVariable): Return the VariableInfo on success and null
25808 on failure instead of true/false.
25810 * cs-parser.jay (foreach): Catch errors on variables already
25811 defined (we were ignoring this value before) and properly unwind
25812 the block hierarchy
25814 (fixed_statement): grammar for the fixed statement.
25816 2002-01-25 Miguel de Icaza <miguel@ximian.com>
25818 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
25819 pointer types to be incretemented.
25821 (SizeOf): Implement.
25823 * cs-parser.jay (pointer_member_access): Implement
25824 expr->IDENTIFIER production.
25826 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
25827 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
25830 (Unary): Implement indirection.
25832 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
25833 use in non-unsafe context).
25835 (SimpleName.DoResolve): Check for pointers in field access on safe
25838 (Expression.LoadFromPtr): Factor the load-indirect code in this
25839 function. This was duplicated in UnboxCast and ParameterReference
25841 2002-01-24 Miguel de Icaza <miguel@ximian.com>
25843 * expression.cs (ComposedCast): report an error if a pointer cast
25844 is used in a safe region.
25846 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
25847 pointer type casts in unsafe context.
25849 * codegen.cs (EmitContext): Set up IsUnsafe.
25851 * cs-parser.jay (non_expression_type): Add productions for pointer
25854 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
25855 code. We should not use force into static mode if the method is
25856 not virtual. Fixes bug in MIS
25858 * statement.cs (Do.Emit, While.Emit, For.Emit,
25859 Statement.EmitBoolExpression): Add support to Do and While to
25860 propagate infinite loop as `I do return' semantics.
25862 Improve the For case to also test for boolean constants.
25864 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
25865 to the list of attributes we can add.
25867 Remove `EmitContext' argument.
25869 * class.cs (Method.Define): Apply parameter attributes.
25870 (Constructor.Define): Apply parameter attributes.
25871 (MethodCore.LabelParameters): Move here the core of labeling
25874 * support.cs (ReflectionParameters.ParameterModifier,
25875 InternalParameters.ParameterModifier): Use IsByRef on the type and
25876 only return the OUT bit for these parameters instead of in/out/ref
25879 This is because I miss-understood things. The ParameterInfo.IsIn
25880 and IsOut represent whether the parameter has the [In] and [Out]
25883 2002-01-22 Miguel de Icaza <miguel@ximian.com>
25885 * ecore.cs (FieldExpr.Emit): Release temporaries.
25887 * assign.cs (LocalTemporary.Release): new function.
25889 * codegen.cs (EmitContext.GetTemporaryStorage,
25890 EmitContext.FreeTemporaryStorage): Rework the way we deal with
25891 temporary storage. Now we can "put back" localbuilders when we
25894 2002-01-21 Miguel de Icaza <miguel@ximian.com>
25896 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
25897 need to make a copy of the variable to generate verifiable code.
25899 2002-01-19 Miguel de Icaza <miguel@ximian.com>
25901 * driver.cs: Compute dynamically the system directory.
25903 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
25904 Slower, but more generally useful. Used by the abstract
25905 registering implementation.
25907 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
25908 the rules for the special rule on Type/instances. First check if
25909 we have the same name, and if so, try that special static path
25910 rather than the instance path.
25912 2002-01-18 Miguel de Icaza <miguel@ximian.com>
25914 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
25917 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
25918 Enum, ValueType, Delegate or Array for non-corlib compiles.
25920 * cs-tokenizer.cs: Catch long identifiers (645)
25922 * typemanager.cs (IndexerPropetyName): Ravi never tested this
25925 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
25926 fix, we were returning too early, so we were not registering
25927 pending methods from abstract classes.
25929 Do not register pending methods if the class is abstract.
25931 * expression.cs (Conditional.DoResolve): Report circular implicit
25932 conversions when we neecd to compute it for conditional
25935 (Is.DoResolve): If the expression is always of the provided type,
25936 flag warning 183. If the expression can not ever be of the
25937 provided type flag warning 184.
25939 * class.cs: Catch 169 as well.
25941 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
25944 2002-01-18 Nick Drochak <ndrochak@gol.com>
25946 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
25948 2002-01-17 Miguel de Icaza <miguel@ximian.com>
25950 * interface.cs: (PopulateMethod): Check for pointers being defined
25951 only if the unsafe context is active.
25952 (PopulateProperty): ditto.
25953 (PopulateIndexer): ditto.
25955 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
25956 specified. If pointers are present, make sure that they are
25957 present in an unsafe context.
25958 (Constructor, Constructor.Define): ditto.
25959 (Field, Field.Define): ditto.
25960 (Property, Property.Define): ditto.
25961 (Event, Event.Define): ditto.
25963 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
25964 hashtable if there are classes or structs defined.
25966 * expression.cs (LocalVariableReference.DoResolve): Simplify this
25967 code, as the constant resolution moved.
25969 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
25970 the metadata, so we can flag error 133.
25972 * decl.cs (MemberCore.UnsafeOK): New function to test that a
25973 pointer is being declared in an unsafe context.
25975 2002-01-16 Miguel de Icaza <miguel@ximian.com>
25977 * modifiers.cs (Modifiers.Check): Require a Location argument.
25978 Report error 227 for Unsafe use.
25980 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
25982 * statement.cs (For.Emit): If the test is null, then report that
25983 we do `return', as we wont reach anything afterwards.
25985 (Switch.SwitchGoverningType): Track the expression that matched
25988 * driver.cs: Allow negative numbers as an error code to flag.
25990 * cs-parser.jay: Handle 1551.
25992 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
25994 2002-01-15 Miguel de Icaza <miguel@ximian.com>
25996 * cs-parser.jay: Report 1518 (type declaration can only contain
25997 class, struct, interface, enum or delegate)
25999 (switch_label): Report 1523 (keywords `case' or `default' must
26002 (opt_switch_sections): Report 1522 (empty switch)
26004 * driver.cs: Report 1515 (response file specified multiple times)
26005 Report 1516 (Source file specified multiple times).
26007 * expression.cs (Argument.Resolve): Signal 1510
26009 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
26010 access not allowed in static code)
26012 2002-01-11 Ravi Pratap <ravi@ximian.com>
26014 * typemanager.cs (IsPointerType): Utility method which we are going
26017 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
26018 the object type, so we take care of that.
26020 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
26022 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
26023 added to non-params parameters :-)
26025 * typemanager.cs (CSharpName): Include 'void' type too.
26027 (void_ptr_type): Include in the set of core types.
26029 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
26032 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
26035 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
26036 completely forgotten about it.
26038 2002-01-10 Ravi Pratap <ravi@ximian.com>
26040 * cs-parser.jay (pointer_type): Add. This begins our implementation
26041 of parsing rules for unsafe code.
26043 (unsafe_statement): Implement.
26045 (embedded_statement): Modify to include the above.
26047 * statement.cs (Unsafe): Implement new class for unsafe blocks.
26049 * codegen.cs (EmitContext.InUnsafe): Add. This determines
26050 if the current context is an unsafe one.
26052 * cs-parser.jay (local_variable_pointer_type): Since local variable types
26053 are handled differently, we need separate rules for them.
26055 (local_variable_declaration): Update to use local_variable_pointer_type
26056 to allow variable declarations of unmanaged pointer types.
26058 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
26059 in unsafe contexts.
26061 * ../errors/cs0214.cs : Add.
26063 2002-01-16 Nick Drochak <ndrochak@gol.com>
26065 * makefile: remove 'response' file when cleaning.
26067 2002-01-15 Miguel de Icaza <miguel@ximian.com>
26069 * cs-parser.jay: Report 1524.
26071 2002-01-14 Miguel de Icaza <miguel@ximian.com>
26073 * typemanager.cs (RegisterMethod): drop checking if we have
26074 registered this from here
26076 2002-01-12 Miguel de Icaza <miguel@ximian.com>
26078 * class.cs (Method.EmitDestructor): Implement calling our base
26081 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
26082 value of InFinally.
26084 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
26085 this routine and will wrap the call in a try/catch block. Deal
26088 2002-01-11 Miguel de Icaza <miguel@ximian.com>
26090 * ecore.cs (Expression.MemberLookup): instead of taking a
26091 parameter `same_type' that was used to tell whether we could
26092 access private members we compute our containing type from the
26095 (FieldExpr): Added partial support for volatile fields. This does
26096 not work for volatile fields exposed from assemblies, as I can not
26097 figure out how to extract the modreq from it.
26099 Updated all the source files to use this.
26101 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
26102 because it is referenced by MemberLookup very often.
26104 2002-01-09 Ravi Pratap <ravi@ximian.com>
26106 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
26107 TypeBuilder.GetCustomAttributes to retrieve what we need.
26109 Get rid of redundant default_member_attr_type as this is the same as
26110 default_member_type which already exists.
26112 * interface.cs, attribute.cs : Update accordingly.
26114 2002-01-08 Miguel de Icaza <miguel@ximian.com>
26116 * typemanager.cs: Enable IndexerPropertyName again. It does not
26117 work for TYpeBuilders though. Ravi, can you please fix this?
26119 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
26121 * expression.cs (Argument.Emit): Handle the case of ref objects
26122 being passed to ref functions;
26124 (ParameterReference.EmitLoad): Loads the content of the pointer
26125 without dereferencing.
26127 2002-01-07 Miguel de Icaza <miguel@ximian.com>
26129 * cs-tokenizer.cs: Implemented the pre-processing expressions.
26131 2002-01-08 Ravi Pratap <ravi@ximian.com>
26133 * class.cs (Indexer.DefineMethod): Incorporate the interface
26134 type in the name of the method if we are doing explicit interface
26137 * expression.cs (ConversionExists): Remove as it is completely obsolete.
26139 (BetterConversion): Fix extremely trivial bug where we were referring to
26140 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
26143 * ../errors/bug16.cs : Add although we have fixed it.
26145 2002-01-07 Miguel de Icaza <miguel@ximian.com>
26147 * expression.cs (BaseIndexer): Begin implementation.
26149 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
26151 * cs-parser.jay (indexer_declarator): Use qualified_identifier
26152 production directly to remove a shift/reduce, and implement
26153 explicit interface implementation.
26155 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
26156 after a floating point suffix.
26158 * expression.cs (DoNumericPromotions): Improved the conversion for
26159 uint/uint. If we have a constant, we avoid doing a typecast to a
26162 * class.cs (Indexer): Implement explicit interface implementation
26165 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
26167 * class.cs: make the default instance constructor public and hidebysig.
26169 2001-01-03 Ravi Pratap <ravi@ximian.com>
26171 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
26172 so we can call it from elsewhere.
26174 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
26175 we emit it internally if the class has a defined indexer; otherwise the user
26176 emits it by decorating the class definition with the DefaultMemberAttribute.
26178 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
26179 attribute is not used on a type which defines an indexer.
26181 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
26182 character when we skip whitespace.
26184 * ../errors/cs0646.cs : Add.
26186 2002-01-03 Miguel de Icaza <miguel@ximian.com>
26188 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
26191 * makefile: Add practical target `mcs3.exe' which builds the third
26192 generation compiler.
26194 * expression.cs (New): Fix structures constructor calling.
26196 * class.cs (Property, Method, Indexer): Emit Final flag on the
26197 method if we are an interface implementation and we are not
26200 * ecore.cs (PropertyExpr): New public field `IsBase', tells
26201 whether this property is referencing a `base' method.
26203 * expression.cs (Invocation.EmitCall): take an extra argument:
26204 is_base, this is used to determine whether the `call' or
26205 `callvirt' opcode should be used.
26208 * delegate.cs: update EmitCall.
26210 * class.cs (Method.Define): Set NewSlot for the cases where we are
26211 not implementing an interface method.
26213 (Property.Define): ditto.
26215 2002-01-02 Miguel de Icaza <miguel@ximian.com>
26217 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
26218 'r'. Allows mcs to parse itself fully.
26220 2002-01-02 Ravi Pratap <ravi@ximian.com>
26222 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
26223 of the number of initializers that require the InitializeArray method.
26225 (CheckIndices): Store the Expression in all cases - not the plain value. Also
26226 update the above field where necessary.
26228 (MakeByteBlob): Update accordingly.
26230 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
26233 (EmitDynamicInitializers): Update in accordance with the new optimization.
26235 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
26236 same OpCode applies.
26238 * cs-parser.jay : Fix some glaring errors I introduced.
26240 2002-01-01 Ravi Pratap <ravi@ximian.com>
26242 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
26243 so that we can check for name clashes there too.
26245 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
26246 for interface indexers.
26248 * interfaces.cs (Define): Emit the default member attribute.
26250 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
26251 variable was being referred to while setting the value ;-)
26253 2002-01-01 Miguel de Icaza <miguel@ximian.com>
26255 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
26256 byte-by-byte information when we know the data is zero.
26258 Make the block always a multiple of 4, because
26259 DefineInitializedData has a bug.
26261 * assign.cs: Fix, we should assign from the temporary, not from
26264 * expression.cs (MakeByteBlob): Fix my incorrect code.
26266 2001-12-31 Miguel de Icaza <miguel@ximian.com>
26268 * typemanager.cs (EnumToUnderlying): This function is used to get
26269 the underlying type from an enumeration, because it does not
26272 * constant.cs: Use the I4_S form for values between -128 and 127.
26274 * statement.cs (Block.LookupLabel): Looks up a label.
26275 (Block): Drop support for labeled blocks.
26277 (LabeledStatement): New kind of statement that represents a label
26280 (Goto): Finally implement this bad boy.
26282 * cs-parser.jay: Update to reflect new mechanism to implement
26285 2001-12-30 Miguel de Icaza <miguel@ximian.com>
26287 * codegen.cs (EmitContext.This): a codegen property that keeps the
26288 a single instance of this instead of creating many different this
26291 * delegate.cs (Delegate.DoResolve): Update to use the property;
26293 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
26295 * expression.cs (BaseAccess.DoResolve): Ditto.
26297 2001-12-29 Ravi Pratap <ravi@ximian.com>
26299 * typemanager.cs (methodimpl_attr_type): Add to hold the type
26300 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
26302 (InitCoreTypes): Update accordingly.
26304 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
26305 so we can quickly store the state.
26307 (ApplyAttributes): Set the correct implementation flags
26308 for InternalCall methods.
26310 2001-12-29 Miguel de Icaza <miguel@ximian.com>
26312 * expression.cs (EmitCall): if a method is not virtual, then do
26313 not use callvirt on it.
26315 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
26316 user defined stuff) requires the use of stobj, which takes an
26317 address on the stack instead of an array and an index. So emit
26318 the Ldelema operation for it.
26320 (EmitStoreOpcode): Use stobj for valuetypes.
26322 (UnaryMutator.EmitCode): Use the right 1 value depending on
26323 whether we are dealing with int64/uint64, float or doubles.
26325 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
26326 constructors that I implemented last night.
26328 (Constructor.IsDefault): Fix to work properly for static
26331 * cs-parser.jay (CheckDef): report method signature errors.
26332 Update error number 103 to be 132.
26334 * decl.cs: New AdditionResult enumeration value: MethodExists.
26335 Although we do this check for methods later on in the semantic
26336 analysis, catching repeated default constructors is so easy that
26337 we catch these here.
26339 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
26342 (ParameterReference.EmitAssign, Emit): handle
26345 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
26346 (ArrayAccess.EmitStoreOpcode): ditto.
26348 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
26350 * expression.cs (MakeByteBlob): Complete all the missing types
26351 (uint, short, ushort, byte, sbyte)
26353 * class.cs: Only init instance field initializers on instance
26356 Rename `constructors' to instance_constructors.
26358 (TypeContainer.AddConstructor): Only add constructors to the list
26359 if it is not static.
26361 Make sure that we handle default_static_constructor independently
26362 everywhere where we handle instance_constructors
26364 2001-12-28 Miguel de Icaza <miguel@ximian.com>
26366 * class.cs: Do not lookup or create a base initializer for a
26367 static constructor.
26369 (ConstructorInitializer.Resolve): use the proper type to lookup
26372 * cs-parser.jay: Report error 1585 (modifiers between type and name).
26374 * enum.cs, interface.cs: Remove CloseType, this is taken care by
26377 * decl.cs: CloseType is now an virtual method, the default
26378 implementation just closes this type.
26380 2001-12-28 Ravi Pratap <ravi@ximian.com>
26382 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
26383 to PreserveSig by default. Also emit HideBySig on such methods.
26385 Basically, set the defaults to standard values.
26387 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
26388 argument, if candidate is better, it can't be worse than the best !
26390 (Invocation): Re-write bits to differentiate between methods being
26391 applicable in their expanded form and their normal form - for params
26394 Get rid of use_standard everywhere as only standard conversions are allowed
26395 in overload resolution.
26397 More spec conformance.
26399 2001-12-27 Miguel de Icaza <miguel@ximian.com>
26401 * driver.cs: Add --timestamp, to see where the compiler spends
26404 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
26405 `this' in static code.
26407 (SimpleName.DoResolve): Implement in terms of a helper function
26408 that allows static-references to be passed upstream to
26411 (Expression.ResolveWithSimpleName): Resolve specially simple
26412 names when called by MemberAccess to implement the special
26415 (Expression.ImplicitReferenceConversion): Handle conversions from
26416 Null to reference types before others, as Null's type is
26419 * expression.cs (Invocation.EmitCall): Handle the special case of
26420 calling methods declared on a reference type from a ValueType
26421 (Base classes System.Object and System.Enum)
26423 (MemberAccess.Resolve): Only perform lookups on Enumerations if
26424 the left hand side is a TypeExpr, not on every enumeration.
26426 (Binary.Resolve): If types are reference types, then do a cast to
26427 object on operators != and == of both arguments.
26429 * typemanager.cs (FindMembers): Extract instance and static
26430 members if requested.
26432 * interface.cs (PopulateProperty): Use void_type instead of null
26433 as the return type for the setter method.
26435 (PopulateIndexer): ditto.
26437 2001-12-27 Ravi Pratap <ravi@ximian.com>
26439 * support.cs (ReflectionParameters): Fix minor bug where we
26440 were examining the wrong parameter for the ParamArray attribute.
26442 Cope with requests for the type of the parameter at position
26443 greater than the params parameter's. We now return the element
26444 type of the params array as that makes more sense.
26446 * expression.cs (Invocation.IsParamsMethodApplicable): Update
26447 accordingly as we no longer have to extract the element type
26450 (Invocation.OverloadResolve): Update.
26452 2001-12-27 Miguel de Icaza <miguel@ximian.com>
26454 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
26455 against IEnumerator, test whether the return value is a descendant
26456 of the IEnumerator interface.
26458 * class.cs (Indexer.Define): Use an auxiliary method to implement
26459 the other bits of the method definition. Begin support for
26460 explicit interface implementation.
26462 (Property.DefineMethod): Use TypeManager.void_type instead of null
26463 for an empty return value.
26465 2001-12-26 Miguel de Icaza <miguel@ximian.com>
26467 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
26468 dealing with a FieldExpr which is composed of a FieldBuilder, in
26469 the code path we did extract the constant, but we should have
26470 obtained the underlying value to be able to cast it (otherwise we
26471 end up in an infinite loop, this is what Ravi was running into).
26473 (ArrayCreation.UpdateIndices): Arrays might be empty.
26475 (MemberAccess.ResolveMemberAccess): Add support for section
26476 14.5.4.1 that deals with the special case of E.I when E is a type
26477 and something else, that I can be a reference to a static member.
26479 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
26480 handle a particular array type to create byte blobs, it is just
26481 something we dont generate byteblobs for.
26483 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
26486 * location.cs (Push): remove the key from the hashtable that we
26487 are about to add. This happens for empty files.
26489 * driver.cs: Dispose files after we have parsed them.
26491 (tokenize): new function that only runs the tokenizer on its
26492 input, for speed testing.
26494 2001-12-26 Ravi Pratap <ravi@ximian.com>
26496 * class.cs (Event.Define): Define the private field only if there
26497 are no accessors defined.
26499 * expression.cs (ResolveMemberAccess): If there is no associated
26500 field with the event, that means we have an event defined with its
26501 own accessors and we should flag error cs0070 since transforming
26502 ourselves into a field is not valid in that case.
26504 * ecore.cs (SimpleName.DoResolve): Same as above.
26506 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
26507 and charset to sane values.
26509 2001-12-25 Ravi Pratap <ravi@ximian.com>
26511 * assign.cs (DoResolve): Perform check on events only if they
26512 are being accessed outside the declaring type.
26514 * cs-parser.jay (event_declarations): Update rules to correctly
26515 set the type of the implicit parameter etc.
26517 (add_accessor, remove_accessor): Set current local parameters.
26519 * expression.cs (Binary): For delegate addition and subtraction,
26520 cast the return value from the method into the appropriate delegate
26523 2001-12-24 Ravi Pratap <ravi@ximian.com>
26525 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
26526 of these as the workaround is unnecessary.
26528 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
26529 delegate data - none of that is needed at all.
26531 Re-write bits to extract the instance expression and the delegate method
26534 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
26537 * attribute.cs (ApplyAttributes): New method to take care of common tasks
26538 of attaching attributes instead of duplicating code everywhere.
26540 * everywhere : Update code to do attribute emission using the above method.
26542 2001-12-23 Miguel de Icaza <miguel@ximian.com>
26544 * expression.cs (IsParamsMethodApplicable): if there are not
26545 parameters, return immediately.
26547 * ecore.cs: The 0 literal can be implicity converted to an enum
26550 (SimpleName.DoResolve): First lookup the type, then lookup the
26553 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
26554 want to get its address. If the InstanceExpression is not
26555 addressable, store the result in a temporary variable, then get
26558 * codegen.cs: Only display 219 errors on warning level or above.
26560 * expression.cs (ArrayAccess): Make it implement the
26561 IMemoryLocation interface.
26563 (Binary.DoResolve): handle the operator == (object a, object b)
26564 and operator != (object a, object b) without incurring into a
26565 BoxedCast (because 5 != o should never be performed).
26567 Handle binary enumerator operators.
26569 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
26570 value type, otherwise use Ldelem_ref.
26572 Use precomputed names;
26574 (AddressOf): Implement address of
26576 * cs-parser.jay (labeled_statement): Fix recursive block
26577 addition by reworking the production.
26579 * expression.cs (New.DoEmit): New has a special case:
26581 If we are dealing with a ValueType, we have a few
26582 situations to deal with:
26584 * The target of New is a ValueType variable, that is
26585 easy, we just pass this as the variable reference
26587 * The target of New is being passed as an argument,
26588 to a boxing operation or a function that takes a
26591 In this case, we need to create a temporary variable
26592 that is the argument of New.
26595 2001-12-23 Ravi Pratap <ravi@ximian.com>
26597 * rootcontext.cs (LookupType): Check that current_type is not null before
26598 going about looking at nested types.
26600 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
26601 not implement the IAssignMethod interface any more.
26603 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
26604 where we tranform them into FieldExprs if they are being resolved from within
26605 the declaring type.
26607 * ecore.cs (SimpleName.DoResolve): Do the same here.
26609 * assign.cs (DoResolve, Emit): Clean up code considerably.
26611 * ../errors/bug10.cs : Add.
26613 * ../errors/cs0070.cs : Add.
26615 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
26617 * assign.cs : Get rid of EventIsLocal everywhere.
26619 2001-12-23 Miguel de Icaza <miguel@ximian.com>
26621 * ecore.cs (ConvertIntLiteral): finished the implementation.
26623 * statement.cs (SwitchLabel): Convert the value we are using as a
26624 key before looking up the table.
26626 2001-12-22 Miguel de Icaza <miguel@ximian.com>
26628 * codegen.cs (EmitTopBlock): Require a Location argument now.
26630 * cs-parser.jay (constructor_declarator): We need to setup
26631 current_local_parameters before we parse the
26632 opt_constructor_initializer, to allow the variables to be bound
26633 to the constructor arguments.
26635 * rootcontext.cs (LookupType): First lookup nested classes in our
26636 class and our parents before we go looking outside our class.
26638 * expression.cs (ConstantFold): Extract/debox the values at the
26641 * rootcontext.cs (EmitCode): Resolve the constants first before we
26642 resolve the types. This is not really needed, but it helps debugging.
26644 * statement.cs: report location.
26646 * cs-parser.jay: pass location to throw statement.
26648 * driver.cs: Small bug fix.
26650 * report.cs: Updated format to be 4-zero filled digits.
26652 2001-12-22 Ravi Pratap <ravi@ximian.com>
26654 * expression.cs (CheckIndices): Fix minor bug where the wrong
26655 variable was being referred to ;-)
26657 (DoEmit): Do not call EmitStaticInitializers when the
26658 underlying type is System.Object.
26660 2001-12-21 Ravi Pratap <ravi@ximian.com>
26662 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
26663 and do the usual workaround for SRE.
26665 * class.cs (MyEventBuilder.EventType): New member to get at the type
26666 of the event, quickly.
26668 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
26670 * assign.cs (Assign.DoResolve): Handle the case when the target
26671 is an EventExpr and perform the necessary checks.
26673 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
26676 (SimpleName.MemberStaticCheck): Include check for EventExpr.
26678 (EventExpr): Set the type in the constructor itself since we
26679 are meant to be born fully resolved.
26681 (EventExpr.Define): Revert code I wrote earlier.
26683 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
26684 instance expression is null. The instance expression is a This in that case
26685 or a null, depending on whether it is a static method or not.
26687 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
26688 refers to more than one method.
26690 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
26691 and accordingly flag errors.
26693 2001-12-21 Miguel de Icaza <miguel@ximian.com>
26695 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
26697 2001-12-22 Miguel de Icaza <miguel@ximian.com>
26699 * location.cs (ToString): Provide useful rutine.
26701 2001-12-21 Miguel de Icaza <miguel@ximian.com>
26703 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
26704 objects, return the actual integral boxed.
26706 * statement.cs (SwitchLabel): define an ILLabel for each
26709 (Switch.CheckSwitch): If the value is a Literal, extract
26710 the underlying literal.
26712 Also in the unused hashtable we had, add the SwitchLabel so we can
26713 quickly look this value up.
26715 * constant.cs: Implement a bunch of new constants. Rewrite
26716 Literal based on this. Made changes everywhere to adapt to this.
26718 * expression.cs (Expression.MakeByteBlob): Optimize routine by
26719 dereferencing array only once, and also copes with enumrations.
26721 bytes are two bytes wide, not one.
26723 (Cast): Perform constant conversions.
26725 * ecore.cs (TryImplicitIntConversion): Return literals instead of
26726 wrappers to the literals here.
26728 * expression.cs (DoNumericPromotions): long literals can converted
26729 to ulong implicity (this is taken care of elsewhere, but I was
26730 missing this spot).
26732 * ecore.cs (Expression.Literalize): Make the return type Literal,
26733 to improve type checking.
26735 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
26737 2001-12-20 Miguel de Icaza <miguel@ximian.com>
26739 * literal.cs: Revert code from ravi that checked the bounds. The
26740 bounds are sane by the definition of the type itself.
26742 * typemanager.cs: Fix implementation of ImplementsInterface. We
26743 need to actually look up in our parent hierarchy for interfaces
26746 * const.cs: Use the underlying type for enumerations
26748 * delegate.cs: Compute the basename for the delegate creation,
26749 that should fix the delegate test case, and restore the correct
26750 Type Lookup semantics in rootcontext
26752 * rootcontext.cs: Revert Ravi's last patch. The correct way of
26753 referencing a nested type with the Reflection API is using the "+"
26756 * cs-parser.jay: Do not require EOF token at the end.
26758 2001-12-20 Ravi Pratap <ravi@ximian.com>
26760 * rootcontext.cs (LookupType): Concatenate type names with
26761 a '.' instead of a '+' The test suite passes again.
26763 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
26764 field of the enumeration.
26766 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
26767 the case when the member is an EventExpr.
26769 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
26770 static has an associated instance expression.
26772 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
26774 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
26776 * class.cs (Event.Define): Register event and perform appropriate checks
26779 We define the Add and Remove methods even if the use provides none because
26780 in that case, we provide default implementations ourselves.
26782 Define a private field of the type of the event. This is done by the CSC compiler
26783 and we should be doing it too ;-)
26785 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
26786 More methods we use in code we generate.
26788 (multicast_delegate_type, delegate_type): Two separate types since the distinction
26791 (InitCoreTypes): Update accordingly for the above.
26793 * class.cs (Event.Emit): Generate code for default accessors that we provide
26795 (EmitDefaultMethod): Do the job in the above.
26797 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
26800 2001-12-20 Miguel de Icaza <miguel@ximian.com>
26802 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
26803 builders even if we were missing one.
26805 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
26806 pass the Basename as our class name instead of the Name. The
26807 basename will be correctly composed for us.
26809 * parameter.cs (Paramters): Now takes a Location argument.
26811 * decl.cs (DeclSpace.LookupType): Removed convenience function and
26812 make all the code call directly LookupType in RootContext and take
26813 this chance to pass the Location information everywhere.
26815 * Everywhere: pass Location information.
26817 2001-12-19 Miguel de Icaza <miguel@ximian.com>
26819 * class.cs (Constructor.Define): Updated way of detecting the
26820 length of the parameters.
26822 (TypeContainer.DefineType): Use basename as the type name for
26825 (TypeContainer.Define): Do not recursively define types here, as
26826 definition is taken care in order by the RootContext.
26828 * tree.cs: Keep track of namespaces in a per-file basis.
26830 * parameter.cs (Parameter.ComputeSignature): Update to use
26833 (Parameters.GetSignature): ditto.
26835 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
26836 instead of a TypeContainer.
26838 (Interface.SemanticAnalysis): Use `this' instead of our parent to
26839 resolve names. Because we need to be resolve in our context, not
26842 * driver.cs: Implement response files.
26844 * class.cs (TypeContainer.DefineType): If we are defined, do not
26845 redefine ourselves.
26847 (Event.Emit): Emit the code for add/remove handlers.
26848 (Event.Define): Save the MethodBuilders for add/remove.
26850 * typemanager.cs: Use pair here too.
26852 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
26853 DictionaryEntry requires the first argument to be non-null.
26855 (enum_declaration): Compute full name for registering the
26858 (delegate_declaration): Instead of using
26859 formal_parameter_list, use opt_formal_parameter_list as the list
26862 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
26863 (EventParsing): New property that controls whether `add' and
26864 `remove' are returned as tokens or identifiers (for events);
26866 2001-12-19 Ravi Pratap <ravi@ximian.com>
26868 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
26869 use MyEventBuilder only and let it wrap the real builder for us.
26871 (MyEventBuilder): Revamp constructor etc.
26873 Implement all operations that we perform on EventBuilder in precisely the same
26876 (FindMembers): Update to use the EventBuilder member.
26878 (Event.Emit): Update accordingly.
26880 2001-12-18 Ravi Pratap <ravi@ximian.com>
26882 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
26883 by calling the appropriate methods.
26885 (GetCustomAttributes): Make stubs as they cannot possibly do anything
26888 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
26890 2001-12-17 Ravi Pratap <ravi@ximian.com>
26892 * delegate.cs (Delegate.Populate): Check that the return type
26893 and various parameters types are indeed accessible.
26895 * class.cs (Constructor.Define): Same here.
26897 (Field.Define): Ditto.
26899 (Event.Define): Ditto.
26901 (Operator.Define): Check that the underlying Method defined itself
26902 correctly - so it's MethodBuilder should not be null.
26904 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
26905 expression happens to be null.
26907 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
26908 members but as of now we don't seem to be able to do anything really useful with it.
26910 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
26911 not the EventBuilder.
26913 2001-12-18 Miguel de Icaza <miguel@ximian.com>
26915 * cs-tokenizer.cs: Add support for defines.
26916 Add support for #if, #elif, #else, #endif
26918 (eval_var): evaluates a variable.
26919 (eval): stubbed for evaluating functions.
26921 * cs-parser.jay: Pass the defines information
26923 * driver.cs: Add --define command line option.
26925 * decl.cs: Move MemberCore here.
26927 Make it the base class for DeclSpace. This allows us to catch and
26928 report 108 and 109 for everything now.
26930 * class.cs (TypeContainer.Define): Extract all the members
26931 before populating and emit the warning 108 (new keyword required
26932 to override) instead of having each member implement this.
26934 (MemberCore.Define): New abstract method, we will be using this in
26935 the warning reporting engine in Populate.
26937 (Operator.Define): Adjust to new MemberCore protocol.
26939 * const.cs (Const): This does not derive from Expression, it is a
26940 temporary object we use to create fields, it is a MemberCore.
26942 * class.cs (Method.Define): Allow the entry point to be in a
26945 * driver.cs: Rewrite the argument handler to clean it up a bit.
26947 * rootcontext.cs: Made it just an auxiliary namespace feature by
26948 making everything static.
26950 * driver.cs: Adapt code to use RootContext type name instead of
26953 * delegate.cs: Remove RootContext argument.
26955 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
26958 * class.cs (Event.Define): The lookup can fail.
26960 * cs-tokenizer.cs: Begin implementation of pre-procesor.
26962 * expression.cs: Resolve the this instance before invoking the code.
26964 2001-12-17 Miguel de Icaza <miguel@ximian.com>
26966 * cs-parser.jay: Add a production in element_access that allows
26967 the thing to become a "type" reference. This way we can parse
26968 things like "(string [])" as a type.
26970 Note that this still does not handle the more complex rules of
26974 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
26976 * ecore.cs: (CopyNewMethods): new utility function used to
26977 assemble the list of methods from running FindMembers.
26979 (MemberLookup): Rework FindMembers so that
26981 2001-12-16 Miguel de Icaza <miguel@ximian.com>
26983 * class.cs (TypeContainer): Remove Delegates who fail to be
26986 * delegate.cs (Populate): Verify that we dont get null return
26987 values. TODO: Check for AsAccessible.
26989 * cs-parser.jay: Use basename to emit error 574 (destructor should
26990 have the same name as container class), not the full name.
26992 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
26993 possible representation.
26995 Also implements integer type suffixes U and L.
26997 2001-12-15 Miguel de Icaza <miguel@ximian.com>
26999 * expression.cs (ArrayCreation.DoResolve): We need to do the
27000 argument resolution *always*.
27002 * decl.cs: Make this hold the namespace. Hold the root context as
27004 (LookupType): Move here.
27006 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
27008 * location.cs (Row, Name): Fixed the code, it was always returning
27009 references to the first file.
27011 * interface.cs: Register properties defined through interfaces.
27013 * driver.cs: Add support for globbing on the command line
27015 * class.cs (Field): Make it derive from MemberCore as well.
27018 2001-12-15 Ravi Pratap <ravi@ximian.com>
27020 * class.cs (Event::Define): Check that the type of the event is a delegate
27021 type else flag error #66.
27023 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
27026 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
27027 values of EntryPoint, CharSet etc etc.
27029 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
27031 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
27032 be null and we should ignore this. I am not sure if this is really clean. Apparently,
27033 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
27034 which needs this to do its work.
27036 * ../errors/cs0066.cs : Add.
27038 2001-12-14 Miguel de Icaza <miguel@ximian.com>
27040 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
27043 * class.cs: (MethodSignature.MethodSignature): Removed hack that
27044 clears out the parameters field.
27045 (MemberSignatureCompare): Cleanup
27047 (MemberCore): New base class used to share code between MethodCore
27050 (RegisterRequiredImplementations) BindingFlags.Public requires
27051 either BindingFlags.Instace or Static. Use instance here.
27053 (Property): Refactored code to cope better with the full spec.
27055 * parameter.cs (GetParameterInfo): Return an empty array instead
27058 * class.cs (Property): Abstract or extern properties have no bodies.
27060 * parameter.cs (GetParameterInfo): return a zero-sized array.
27062 * class.cs (TypeContainer.MethodModifiersValid): Move all the
27063 method modifier validation to the typecontainer so we can reuse
27064 this on properties.
27066 (MethodCore.ParameterTypes): return an empty sized array of types.
27068 (Property.Define): Test property modifier validity.
27070 Add tests for sealed/override too.
27072 (Method.Emit): abstract or extern methods have no bodies.
27074 2001-12-14 Ravi Pratap <ravi@ximian.com>
27076 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
27079 (Method::Define, ::Emit): Modify accordingly.
27081 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
27083 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
27085 * makefile: Pass in /unsafe.
27087 2001-12-13 Miguel de Icaza <miguel@ximian.com>
27089 * class.cs (MakeKey): Kill routine.
27091 * class.cs (TypeContainer.Define): Correctly define explicit
27092 method implementations (they require the full interface name plus
27095 * typemanager.cs: Deply the PtrHashtable here and stop using the
27096 lame keys. Things work so much better.
27098 This of course broke everyone who depended on `RegisterMethod' to
27099 do the `test for existance' test. This has to be done elsewhere.
27101 * support.cs (PtrHashtable): A hashtable that avoid comparing with
27102 the object stupid Equals method (because, that like fails all over
27103 the place). We still do not use it.
27105 * class.cs (TypeContainer.SetRequiredInterface,
27106 TypeContainer.RequireMethods): Killed these two routines and moved
27107 all the functionality to RegisterRequiredImplementations.
27109 (TypeContainer.RegisterRequiredImplementations): This routine now
27110 registers all the implementations required in an array for the
27111 interfaces and abstract methods. We use an array of structures
27112 which can be computed ahead of time to reduce memory usage and we
27113 also assume that lookups are cheap as most classes will not
27114 implement too many interfaces.
27116 We also avoid creating too many MethodSignatures.
27118 (TypeContainer.IsInterfaceMethod): Update and optionally does not
27119 clear the "pending" bit if we find that there are problems with
27122 (TypeContainer.VerifyPendingMethods): Update to report errors of
27123 methods that look like implementations but are not.
27125 (TypeContainer.Define): Add support for explicit interface method
27128 2001-12-12 Miguel de Icaza <miguel@ximian.com>
27130 * typemanager.cs: Keep track of the parameters here instead of
27131 being a feature of the TypeContainer.
27133 * class.cs: Drop the registration of parameters here, as
27134 InterfaceMethods are also interface declarations.
27136 * delegate.cs: Register methods with the TypeManager not only with
27137 the TypeContainer. This code was buggy.
27139 * interface.cs: Full registation here.
27141 2001-12-11 Miguel de Icaza <miguel@ximian.com>
27143 * expression.cs: Remove reducer for binary expressions, it can not
27146 * const.cs: Put here the code that used to go into constant.cs
27148 * constant.cs: Put here the code for constants, this is a new base
27149 class for Literals.
27151 * literal.cs: Make Literal derive from Constant.
27153 2001-12-09 Miguel de Icaza <miguel@ximian.com>
27155 * statement.cs (Return.Emit): Report error 157 if the user
27156 attempts to return from a finally block.
27158 (Return.Emit): Instead of emitting a return, jump to the end of
27161 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
27162 LocalBuilder to store the result of the function. ReturnLabel is
27163 the target where we jump.
27166 2001-12-09 Radek Doulik <rodo@ximian.com>
27168 * cs-parser.jay: remember alias in current namespace
27170 * ecore.cs (SimpleName::DoResolve): use aliases for types or
27173 * class.cs (LookupAlias): lookup alias in my_namespace
27175 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
27177 (LookupAlias): lookup alias in this and if needed in parent
27180 2001-12-08 Miguel de Icaza <miguel@ximian.com>
27184 * rootcontext.cs: (ModuleBuilder) Made static, first step into
27185 making things static. I need this to avoid passing the
27186 TypeContainer when calling ParameterType.
27188 * support.cs (InternalParameters.ParameterType): Remove ugly hack
27189 that did string manipulation to compute the type and then call
27190 GetType. Use Parameter.ParameterType instead.
27192 * cs-tokenizer.cs: Consume the suffix for floating values.
27194 * expression.cs (ParameterReference): figure out whether this is a
27195 reference parameter or not. Kill an extra variable by computing
27196 the arg_idx during emission.
27198 * parameter.cs (Parameters.GetParameterInfo): New overloaded
27199 function that returns whether a parameter is an out/ref value or not.
27201 (Parameter.ParameterType): The type of the parameter (base,
27202 without ref/out applied).
27204 (Parameter.Resolve): Perform resolution here.
27205 (Parameter.ExternalType): The full type (with ref/out applied).
27207 * statement.cs (Using.Emit, Using.EmitExpression): Implement
27208 support for expressions on the using statement.
27210 2001-12-07 Miguel de Icaza <miguel@ximian.com>
27212 * statement.cs (Using.EmitLocalVariableDecls): Split the
27213 localvariable handling of the using statement.
27215 (Block.EmitMeta): Keep track of variable count across blocks. We
27216 were reusing slots on separate branches of blocks.
27218 (Try.Emit): Emit the general code block, we were not emitting it.
27220 Check the type of the declaration to be an IDisposable or
27221 something that can be implicity converted to it.
27223 Emit conversions if required.
27225 * ecore.cs (EmptyExpression): New utility class.
27226 (Expression.ImplicitConversionExists): New utility function.
27228 2001-12-06 Miguel de Icaza <miguel@ximian.com>
27230 * statement.cs (Using): Implement.
27232 * expression.cs (LocalVariableReference): Support read only variables.
27234 * statement.cs: Remove the explicit emit for the Leave opcode.
27235 (VariableInfo): Add a readonly field.
27237 2001-12-05 Miguel de Icaza <miguel@ximian.com>
27239 * ecore.cs (ConvCast): new class used to encapsulate the various
27240 explicit integer conversions that works in both checked and
27241 unchecked contexts.
27243 (Expression.ConvertNumericExplicit): Use new ConvCast class to
27244 properly generate the overflow opcodes.
27246 2001-12-04 Miguel de Icaza <miguel@ximian.com>
27248 * statement.cs: The correct type for the EmptyExpression is the
27249 element_type, not the variable type. Ravi pointed this out.
27251 2001-12-04 Ravi Pratap <ravi@ximian.com>
27253 * class.cs (Method::Define): Handle PInvoke methods specially
27254 by using DefinePInvokeMethod instead of the usual one.
27256 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
27257 above to do the task of extracting information and defining the method.
27259 2001-12-04 Ravi Pratap <ravi@ximian.com>
27261 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
27262 of the condition for string type.
27264 (Emit): Move that here.
27266 (ArrayCreation::CheckIndices): Keep string literals in their expression
27269 (EmitDynamicInitializers): Handle strings appropriately.
27271 2001-12-04 Miguel de Icaza <miguel@ximian.com>
27273 * codegen.cs (EmitContext): Replace multiple variables with a
27274 single pointer to the current Switch statement.
27276 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
27279 2001-12-03 Miguel de Icaza <miguel@ximian.com>
27283 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
27286 (Foreach.Emit): Foreach on arrays was not setting
27287 up the loop variables (for break/continue).
27289 (GotoCase): Semi-implented.
27291 2001-12-03 Ravi Pratap <ravi@ximian.com>
27293 * attribute.cs (CheckAttribute): Handle system attributes by using
27294 Attribute.GetAttributes to examine information we need.
27296 (GetValidPlaces): Same here.
27298 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
27300 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
27302 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
27304 (Method::Define): Set appropriate flags if we have a DllImport attribute.
27306 (Method::Emit): Handle the case when we are a PInvoke method.
27308 2001-12-03 Miguel de Icaza <miguel@ximian.com>
27310 * expression.cs: Use ResolveWithSimpleName on compound names.
27312 2001-12-02 Ravi Pratap <ravi@ximian.com>
27314 * constant.cs (EmitConstant): Make sure we resolve the associated expression
27315 before trying to reduce it.
27317 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
27319 * constant.cs (LookupConstantValue): Implement.
27321 (EmitConstant): Use the above in emitting the constant.
27323 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
27324 that are user-defined by doing a LookupConstantValue on them.
27326 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
27329 2001-11-29 Miguel de Icaza <miguel@ximian.com>
27331 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
27333 (BaseAccess.DoResolve): Implement.
27335 (MemberAccess.DoResolve): Split this routine into a
27336 ResolveMemberAccess routine that can be used independently
27338 2001-11-28 Miguel de Icaza <miguel@ximian.com>
27340 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
27341 As that share bits of the implementation. Is returns a boolean,
27342 while As returns the Type that is being probed.
27344 2001-12-01 Ravi Pratap <ravi@ximian.com>
27346 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
27347 instead of a Literal - much easier.
27349 (EnumInTransit): Remove - utterly useless :-)
27351 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
27353 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
27355 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
27356 chain when we have no associated expression.
27358 2001-11-30 Ravi Pratap <ravi@ximian.com>
27360 * constant.cs (Define): Use Location while reporting the errror.
27362 Also emit a warning when 'new' is used and there is no inherited
27365 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
27368 (LookupEnumValue): Implement to lookup an enum member's value and define it
27371 (Populate): Re-write accordingly to use the above routine.
27373 2001-11-27 Miguel de Icaza <miguel@ximian.com>
27375 * expression.cs (This): Fix prototype for DoResolveLValue to
27376 override the base class DoResolveLValue.
27378 * cs-parser.cs: Report errors cs574 and cs575 (destructor
27381 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
27382 (we need to load the address of the field here). This fixes
27385 (FieldExpr.DoResolveLValue): Call the DoResolve
27386 function to initialize the Instance expression.
27388 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
27389 correctly the GetEnumerator operation on a value type.
27391 * cs-parser.jay: Add more simple parsing error catches.
27393 * statement.cs (Switch): Add support for string switches.
27394 Handle null specially.
27396 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
27398 2001-11-28 Ravi Pratap <ravi@ximian.com>
27400 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
27402 (declare_local_constant): New helper function.
27404 * statement.cs (AddConstant): Keep a separate record of constants
27406 (IsConstant): Implement to determine if a variable is a constant.
27408 (GetConstantExpression): Implement.
27410 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
27412 * statement.cs (IsVariableDefined): Re-write.
27414 2001-11-27 Ravi Pratap <ravi@ximian.com>
27416 * class.cs (TypeContainer::FindMembers): Look for constants
27417 in the case when we are looking for MemberTypes.Field
27419 * expression.cs (MemberAccess::DoResolve): Check that in the
27420 case we are a FieldExpr and a Literal, we are not being accessed
27421 by an instance reference.
27423 * cs-parser.jay (local_constant_declaration): Implement.
27425 (declaration_statement): Implement for constant declarations.
27427 2001-11-26 Miguel de Icaza <miguel@ximian.com>
27429 * statement.cs (Switch): Catch double defaults.
27431 (Switch): More work on the switch() statement
27432 implementation. It works for integral values now, need to finish
27436 2001-11-24 Miguel de Icaza <miguel@ximian.com>
27438 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
27439 integer literals into other integer literals. To be used by
27442 2001-11-24 Ravi Pratap <ravi@ximian.com>
27444 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
27447 (EmitDynamicInitializers): Cope with the above since we extract data
27448 directly from ArrayData now.
27450 (ExpectInitializers): Keep track of whether initializers are mandatory
27453 (Bounds): Make it a hashtable to prevent the same dimension being
27454 recorded for every element in that dimension.
27456 (EmitDynamicInitializers): Fix bug which prevented the Set array method
27459 Also fix bug which was causing the indices to be emitted in the reverse
27462 2001-11-24 Miguel de Icaza <miguel@ximian.com>
27464 * expression.cs (ArrayCreation): Implement the bits that Ravi left
27465 unfinished. They do not work, because the underlying code is
27468 2001-11-22 Miguel de Icaza <miguel@ximian.com>
27470 * cs-parser.jay: Remove bogus fixme.
27472 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
27473 on Switch statement.
27475 2001-11-23 Ravi Pratap <ravi@ximian.com>
27477 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
27480 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
27481 parameter. Apparently, any expression is allowed.
27483 (ValidateInitializers): Update accordingly.
27485 (CheckIndices): Fix some tricky bugs thanks to recursion.
27487 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
27488 I was being completely brain-dead.
27490 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
27491 and re-write acordingly.
27493 (DelegateInvocation): Re-write accordingly.
27495 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
27497 (MakeByteBlob): Handle types more correctly.
27499 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
27500 initialization from expressions but it is incomplete because I am a complete
27503 2001-11-22 Miguel de Icaza <miguel@ximian.com>
27505 * statement.cs (If.Emit): Fix a bug that generated incorrect code
27506 on If. Basically, we have to return `true' (ie, we do return to
27507 our caller) only if both branches of the if return.
27509 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
27510 short-circuit operators, handle them as short circuit operators.
27512 (Cast.DoResolve): Resolve type.
27513 (Cast.Cast): Take an expression as the target type.
27515 * cs-parser.jay (cast_expression): Remove old hack that only
27516 allowed a limited set of types to be handled. Now we take a
27517 unary_expression and we resolve to a type during semantic
27520 Use the grammar productions from Rhys to handle casts (this is
27521 not complete like Rhys syntax yet, we fail to handle that corner
27522 case that C# has regarding (-x), but we will get there.
27524 2001-11-22 Ravi Pratap <ravi@ximian.com>
27526 * class.cs (EmitFieldInitializer): Take care of the case when we have a
27527 field which is an array type.
27529 * cs-parser.jay (declare_local_variables): Support array initialization too.
27531 * typemanager.cs (MakeKey): Implement.
27533 (everywhere): Use the above appropriately.
27535 * cs-parser.jay (for_statement): Update for array initialization while
27536 declaring variables.
27538 * ecore.cs : The error message was correct, it's the variable's names that
27539 were misleading ;-) Make the code more readable.
27541 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
27542 the correct type etc.
27544 (ConvertExplicit): Handle Enum types by examining the underlying type.
27546 2001-11-21 Ravi Pratap <ravi@ximian.com>
27548 * parameter.cs (GetCallingConvention): Always return
27549 CallingConventions.Standard for now.
27551 2001-11-22 Miguel de Icaza <miguel@ximian.com>
27553 * expression.cs (Binary.ResolveOperator): Update the values of `l'
27554 and `r' after calling DoNumericPromotions.
27556 * ecore.cs: Fix error message (the types were in the wrong order).
27558 * statement.cs (Foreach.ProbeCollectionType): Need to pass
27559 BindingFlags.Instance as well
27561 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
27562 implicit int literal conversion in an empty cast so that we
27563 propagate the right type upstream.
27565 (UnboxCast): new class used to unbox value types.
27566 (Expression.ConvertExplicit): Add explicit type conversions done
27569 (Expression.ImplicitNumericConversion): Oops, forgot to test for
27570 the target type before applying the implicit LongLiterals to ULong
27573 2001-11-21 Miguel de Icaza <miguel@ximian.com>
27575 * cs-parser.jay (for_statement): Reworked the way For works: now
27576 we declare manually any variables that are introduced in
27577 for_initializer to solve the problem of having out-of-band code
27578 emition (that is what got for broken).
27580 (declaration_statement): Perform the actual variable declaration
27581 that used to be done in local_variable_declaration here.
27583 (local_variable_declaration): Do not declare anything, just pass
27584 the information on a DictionaryEntry
27586 2001-11-20 Ravi Pratap <ravi@ximian.com>
27588 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
27589 re-write of the logic to now make it recursive.
27591 (UpdateIndices): Re-write accordingly.
27593 Store element data in a separate ArrayData list in the above methods.
27595 (MakeByteBlob): Implement to dump the array data into a byte array.
27597 2001-11-19 Ravi Pratap <ravi@ximian.com>
27599 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
27602 * constant.cs (Define): Implement.
27604 (EmitConstant): Re-write fully.
27606 Pass in location info.
27608 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
27611 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
27612 DictionaryEntry since we need location info too.
27614 (constant_declaration): Update accordingly.
27616 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
27617 code into another method : UpdateIndices.
27619 2001-11-18 Ravi Pratap <ravi@ximian.com>
27621 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
27622 some type checking etc.
27624 2001-11-17 Ravi Pratap <ravi@ximian.com>
27626 * expression.cs (ArrayCreation::ValidateInitializers): Implement
27627 bits to provide dimension info if the user skips doing that.
27629 Update second constructor to store the rank correctly.
27631 2001-11-16 Ravi Pratap <ravi@ximian.com>
27633 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
27634 and try to implement.
27636 * ../errors/cs0150.cs : Add.
27638 * ../errors/cs0178.cs : Add.
27640 2001-11-16 Miguel de Icaza <miguel@ximian.com>
27642 * statement.cs: Implement foreach on multi-dimensional arrays.
27644 * parameter.cs (Parameters.GetParameterByName): Also lookup the
27645 name of the params argument.
27647 * expression.cs: Use EmitStoreOpcode to get the right opcode while
27648 initializing the array.
27650 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
27651 we can use this elsewhere.
27653 * statement.cs: Finish implementation of foreach for single
27656 * cs-parser.jay: Use an out-of-band stack to pass information
27657 around, I wonder why I need this.
27659 foreach_block: Make the new foreach_block the current_block.
27661 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
27662 function used to return a static Parameters structure. Used for
27663 empty parameters, as those are created very frequently.
27665 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
27667 2001-11-15 Ravi Pratap <ravi@ximian.com>
27669 * interface.cs : Default modifier is private, not public. The
27670 make verify test passes again.
27672 2001-11-15 Ravi Pratap <ravi@ximian.com>
27674 * support.cs (ReflectionParameters): Fix logic to determine
27675 whether the last parameter is a params one. Test 9 passes again.
27677 * delegate.cs (Populate): Register the builders we define with
27678 RegisterParameterForBuilder. Test 19 passes again.
27680 * cs-parser.jay (property_declaration): Reference $6 instead
27681 of $$ to get at the location.
27683 (indexer_declaration): Similar stuff.
27685 (attribute): Ditto.
27687 * class.cs (Property): Register parameters for the Get and Set methods
27688 if they exist. Test 23 passes again.
27690 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
27691 call to EmitArguments as we are sure there aren't any params arguments.
27692 Test 32 passes again.
27694 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
27695 IndexOutOfRangeException.
27697 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
27698 Test 33 now passes again.
27700 2001-11-15 Miguel de Icaza <miguel@ximian.com>
27702 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
27703 broke a bunch of things. Will have to come up with a better way
27704 of tracking locations.
27706 * statement.cs: Implemented foreach for single dimension arrays.
27708 2001-11-09 Miguel de Icaza <miguel@ximian.com>
27710 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
27711 an error. This removes the lookup from the critical path.
27713 * cs-parser.jay: Removed use of temporary_loc, which is completely
27716 2001-11-14 Miguel de Icaza <miguel@ximian.com>
27718 * support.cs (ReflectionParameters.ParameterModifier): Report
27719 whether the argument is a PARAMS argument or not.
27721 * class.cs: Set the attribute `ParamArrayAttribute' on the
27722 parameter argument.
27724 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
27725 and cons_param_array_attribute (ConstructorInfo for
27726 ParamArrayAttribute).,
27728 * codegen.cs: Emit the return using the `Return' statement, that
27729 way we can report the error correctly for missing return values.
27731 * class.cs (Method.Emit): Clean up.
27733 * expression.cs (Argument.Resolve): Take another argument: the
27734 location where this argument is used. Notice that this is not
27735 part of the "Argument" class as to reduce the size of the
27736 structure (we know the approximate location anyways).
27738 Test if the argument is a variable-reference, if not, then
27739 complain with a 206.
27741 (Argument.Emit): Emit addresses of variables.
27743 (Argument.FullDesc): Simplify.
27745 (Invocation.DoResolve): Update for Argument.Resolve.
27747 (ElementAccess.DoResolve): ditto.
27749 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
27750 method should be virtual, as this method is always virtual.
27752 (NewDelegate.DoResolve): Update for Argument.Resolve.
27754 * class.cs (ConstructorInitializer.DoResolve): ditto.
27756 * attribute.cs (Attribute.Resolve): ditto.
27758 2001-11-13 Miguel de Icaza <miguel@ximian.com>
27760 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
27762 * expression.cs (ParameterReference): Drop IStackStorage and implement
27763 IAssignMethod instead.
27765 (LocalVariableReference): ditto.
27767 * ecore.cs (FieldExpr): Drop IStackStorage and implement
27768 IAssignMethod instead.
27770 2001-11-13 Miguel de Icaza <miguel@ximian.com>
27772 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
27773 enumerations that are used in heavily used structures derive from
27774 byte in a laughable and pathetic attempt to reduce memory usage.
27775 This is the kind of pre-optimzations that you should not do at
27776 home without adult supervision.
27778 * expression.cs (UnaryMutator): New class, used to handle ++ and
27779 -- separatedly from the other unary operators. Cleans up the
27780 code, and kills the ExpressionStatement dependency in Unary.
27782 (Unary): Removed `method' and `Arguments' from this class, making
27783 it smaller, and moving it all to SimpleCall, so I can reuse this
27784 code in other locations and avoid creating a lot of transient data
27785 strucutres when not required.
27787 * cs-parser.jay: Adjust for new changes.
27789 2001-11-11 Miguel de Icaza <miguel@ximian.com>
27791 * enum.cs (Enum.Populate): If there is a failure during
27794 * cs-parser.jay (opt_enum_base): we used to catch type errors
27795 here, but this is really incorrect. The type error should be
27796 catched during semantic analysis.
27798 2001-12-11 Ravi Pratap <ravi@ximian.com>
27800 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
27801 current_local_parameters as expected since I, in my stupidity, had forgotten
27804 * attribute.cs (GetValidPlaces): Fix stupid bug.
27806 * class.cs (Method::Emit): Perform check on applicability of attributes.
27808 (Constructor::Emit): Ditto.
27810 (Field::Emit): Ditto.
27812 (Field.Location): Store location information.
27814 (Property, Event, Indexer, Operator): Ditto.
27816 * cs-parser.jay (field_declaration): Pass in location for each field.
27818 * ../errors/cs0592.cs : Add.
27820 2001-11-12 Ravi Pratap <ravi@ximian.com>
27822 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
27824 (InitCoreTypes): Update accordingly.
27826 (RegisterAttrType, LookupAttr): Implement.
27828 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
27829 info about the same.
27831 (Resolve): Update to populate the above as necessary.
27833 (Error592): Helper.
27835 (GetValidPlaces): Helper to the above.
27837 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
27839 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
27841 2001-11-12 Ravi Pratap <ravi@ximian.com>
27843 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
27845 * ../errors/cs0617.cs : Add.
27847 2001-11-11 Ravi Pratap <ravi@ximian.com>
27849 * enum.cs (Emit): Rename to Populate to be more consistent with what
27850 we expect it to do and when exactly it is called.
27852 * class.cs, rootcontext.cs : Update accordingly.
27854 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
27855 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
27857 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
27859 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
27860 of a fieldinfo using the above, when dealing with a FieldBuilder.
27862 2001-11-10 Ravi Pratap <ravi@ximian.com>
27864 * ../errors/cs0031.cs : Add.
27866 * ../errors/cs1008.cs : Add.
27868 * ../errrors/cs0543.cs : Add.
27870 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
27873 (FindMembers): Implement.
27875 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
27876 enums and delegates too.
27878 (enum_types): Rename to builder_to_enum.
27880 (delegate_types): Rename to builder_to_delegate.
27882 * delegate.cs (FindMembers): Implement.
27884 2001-11-09 Ravi Pratap <ravi@ximian.com>
27886 * typemanager.cs (IsEnumType): Implement.
27888 * enum.cs (Emit): Re-write parts to account for the underlying type
27889 better and perform checking etc.
27891 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
27892 of the underlying type.
27894 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
27897 * enum.cs (error31): Helper to report error #31.
27899 * cs-parser.jay (enum_declaration): Store location of each member too.
27901 * enum.cs (member_to_location): New hashtable.
27903 (AddEnumMember): Update location hashtable.
27905 (Emit): Use the location of each member while reporting errors.
27907 2001-11-09 Miguel de Icaza <miguel@ximian.com>
27909 * cs-parser.jay: A for_initializer if is a
27910 local_variable_declaration really ammount to have an implicit
27911 block with the variable declaration and no initializer for for.
27913 * statement.cs (For.Emit): Cope with null initializers.
27915 This fixes the infinite loop on for initializers.
27917 2001-11-08 Miguel de Icaza <miguel@ximian.com>
27919 * enum.cs: More cleanup.
27921 * ecore.cs: Remove dead code.
27923 * class.cs (Property.Emit): More simplification.
27924 (Event.Emit): ditto.
27926 Reworked to have less levels of indentation.
27928 2001-11-08 Ravi Pratap <ravi@ximian.com>
27930 * class.cs (Property): Emit attributes.
27940 * enum.cs (Emit): Ditto.
27942 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
27945 * class.cs (Field, Event, etc.): Move attribute generation into the
27946 Emit method everywhere.
27948 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
27949 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
27950 as we had no way of defining nested enums !
27952 * rootcontext.cs : Adjust code accordingly.
27954 * typemanager.cs (AddEnumType): To keep track of enum types separately.
27956 2001-11-07 Ravi Pratap <ravi@ximian.com>
27958 * expression.cs (EvalConstantExpression): Move into ecore.cs
27960 * enum.cs (Enum): Rename some members and make them public and readonly
27961 according to our convention.
27963 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
27966 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
27968 (Enum::Emit): Write a simple version for now which doesn't try to compute
27969 expressions. I shall modify this to be more robust in just a while.
27971 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
27973 (TypeContainer::CloseType): Create the Enum types too.
27975 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
27977 * expression.cs (EvalConstantExpression): Get rid of completely.
27979 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
27980 user-defined values and other cases.
27982 (IsValidEnumLiteral): Helper function.
27984 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
27985 out there in the case we had a literal FieldExpr.
27987 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
27989 (Literalize): Revamp a bit to take two arguments.
27991 (EnumLiteral): New class which derives from Literal to wrap enum literals.
27993 2001-11-06 Ravi Pratap <ravi@ximian.com>
27995 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
27997 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
27999 (Resolve): Use the above to ensure we have proper initializers.
28001 2001-11-05 Ravi Pratap <ravi@ximian.com>
28003 * expression.cs (Expression::EvalConstantExpression): New method to
28004 evaluate constant expressions.
28006 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
28008 2001-11-07 Miguel de Icaza <miguel@ximian.com>
28010 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
28013 (Binary.ResolveOperator): Handle operator != (object a, object b)
28014 and operator == (object a, object b);
28016 (Binary.DoNumericPromotions): Indicate whether the numeric
28017 promotion was possible.
28019 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
28022 Made the ArrayAccess implement interface IAssignMethod instead of
28023 IStackStore as the order in which arguments are passed reflects
28026 * assign.cs: Instead of using expr.ExprClass to select the way of
28027 assinging, probe for the IStackStore/IAssignMethod interfaces.
28029 * typemanager.cs: Load InitializeArray definition.
28031 * rootcontext.cs (RootContext.MakeStaticData): Used to define
28032 static data that can be used to initialize arrays.
28034 2001-11-05 Miguel de Icaza <miguel@ximian.com>
28036 * expression.cs: Handle operator== and operator!= for booleans.
28038 (Conditioal.Reduce): Implement reducer for the ?: operator.
28040 (Conditional.Resolve): Implement dead code elimination.
28042 (Binary.Resolve): Catch string literals and return a new
28043 concatenated string.
28045 (Unary.Reduce): Implement reduction of unary expressions.
28047 * ecore.cs: Split out the expression core handling here.
28049 (Expression.Reduce): New method used to perform constant folding
28050 and CSE. This is needed to support constant-expressions.
28052 * statement.cs (Statement.EmitBoolExpression): Pass true and false
28053 targets, and optimize for !x.
28055 2001-11-04 Ravi Pratap <ravi@ximian.com>
28057 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
28058 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
28059 set custom atttributes.
28061 * literal.cs (Literal::GetValue): New abstract method to return the actual
28062 value of the literal, cast as an object.
28064 (*Literal): Implement GetValue method.
28066 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
28067 expressions to the arraylist but objects of type Argument.
28069 * class.cs (TypeContainer::Emit): Emit our attributes too.
28071 (Method::Emit, Constructor::Emit): Ditto.
28073 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
28074 to be ignoring earlier.
28076 2001-11-03 Ravi Pratap <ravi@ximian.com>
28078 * attribute.cs (AttributeSection::Define): Implement to do the business
28079 of constructing a CustomAttributeBuilder.
28081 (Attribute): New trivial class. Increases readability of code.
28083 * cs-parser.jay : Update accordingly.
28085 (positional_argument_list, named_argument_list, named_argument): New rules
28087 (attribute_arguments): Use the above so that we are more correct.
28089 2001-11-02 Ravi Pratap <ravi@ximian.com>
28091 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
28092 to perform all checks for a method with a params parameter.
28094 (Invocation::OverloadResolve): Update to use the above method and therefore
28095 cope correctly with params method invocations.
28097 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
28100 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
28101 constructors in our parent too because we can't afford to miss out on
28104 * attribute.cs (AttributeSection): New name for the class Attribute
28106 Other trivial changes to improve readability.
28108 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
28109 use the new class names.
28111 2001-11-01 Ravi Pratap <ravi@ximian.com>
28113 * class.cs (Method::Define): Complete definition for params types too
28115 (Indexer::Define): Ditto.
28117 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
28118 Cope everywhere with a request for info about the array parameter.
28120 2001-11-01 Ravi Pratap <ravi@ximian.com>
28122 * tree.cs (RecordNamespace): Fix up to check for the correct key.
28124 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
28125 local_variable_type to extract the string corresponding to the type.
28127 (local_variable_type): Fixup the action to use the new helper method.
28129 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
28132 * expression.cs : Clean out code which uses the above.
28134 2001-10-31 Ravi Pratap <ravi@ximian.com>
28136 * typemanager.cs (RegisterMethod): Check if we already have an existing key
28137 and bale out if necessary by returning a false.
28139 (RegisterProperty): Ditto.
28141 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
28142 and print out appropriate error messages.
28144 * interface.cs (everywhere): Ditto.
28146 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
28147 location to constructor.
28149 * class.cs (Property, Event, Indexer): Update accordingly.
28151 * ../errors/cs111.cs : Added.
28153 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
28154 of a method, as laid down by the spec.
28156 (Invocation::OverloadResolve): Use the above method.
28158 2001-10-31 Ravi Pratap <ravi@ximian.com>
28160 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
28161 now take a TypeContainer and a Parameters object.
28163 (ParameterData): Modify return type of ParameterModifier method to be
28164 Parameter.Modifier and not a string.
28166 (ReflectionParameters, InternalParameters): Update accordingly.
28168 * expression.cs (Argument::GetParameterModifier): Same here.
28170 * support.cs (InternalParameters::ParameterType): Find a better way of determining
28171 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
28172 symbol in it at all so maybe this is only for now.
28174 2001-10-30 Ravi Pratap <ravi@ximian.com>
28176 * support.cs (InternalParameters): Constructor now takes an extra argument
28177 which is the actual Parameters class.
28179 (ParameterDesc): Update to provide info on ref/out modifiers.
28181 * class.cs (everywhere): Update call to InternalParameters to pass in
28182 the second argument too.
28184 * support.cs (ParameterData): Add ParameterModifier, which is a method
28185 to return the modifier info [ref/out etc]
28187 (InternalParameters, ReflectionParameters): Implement the above.
28189 * expression.cs (Argument::ParameterModifier): Similar function to return
28190 info about the argument's modifiers.
28192 (Invocation::OverloadResolve): Update to take into account matching modifiers
28195 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
28196 a new SetFormalParameters object which we pass to InternalParameters.
28198 2001-10-30 Ravi Pratap <ravi@ximian.com>
28200 * expression.cs (NewArray): Merge into the ArrayCreation class.
28202 2001-10-29 Ravi Pratap <ravi@ximian.com>
28204 * expression.cs (NewArray): Merge classes NewBuiltinArray and
28205 NewUserdefinedArray into one as there wasn't much of a use in having
28208 * expression.cs (Argument): Change field's name to ArgType from Type.
28210 (Type): New readonly property which returns the proper type, taking into
28211 account ref/out modifiers.
28213 (everywhere): Adjust code accordingly for the above.
28215 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
28216 whether we are emitting for a ref or out parameter.
28218 * expression.cs (Argument::Emit): Use the above field to set the state.
28220 (LocalVariableReference::Emit): Update to honour the flag and emit the
28223 * parameter.cs (Attributes): Set the correct flags for ref parameters.
28225 * expression.cs (Argument::FullDesc): New function to provide a full desc.
28227 * support.cs (ParameterData): Add method ParameterDesc to the interface.
28229 (ReflectionParameters, InternalParameters): Implement the above method.
28231 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
28234 (Invocation::FullMethodDesc): Ditto.
28236 2001-10-29 Miguel de Icaza <miguel@ximian.com>
28238 * cs-parser.jay: Add extra production for the second form of array
28241 * expression.cs (ArrayCreation): Update to reflect the above
28244 * Small changes to prepare for Array initialization.
28246 2001-10-28 Miguel de Icaza <miguel@ximian.com>
28248 * typemanager.cs (ImplementsInterface): interface might be null;
28249 Deal with this problem;
28251 Also, we do store negative hits on the cache (null values), so use
28252 this instead of calling t.GetInterfaces on the type everytime.
28254 2001-10-28 Ravi Pratap <ravi@ximian.com>
28256 * typemanager.cs (IsBuiltinType): New method to help determine the same.
28258 * expression.cs (New::DoResolve): Get rid of array creation code and instead
28259 split functionality out into different classes.
28261 (New::FormArrayType): Move into NewBuiltinArray.
28263 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
28266 (NewBuiltinArray): New class to handle creation of built-in arrays.
28268 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
28269 account creation of one-dimensional arrays.
28271 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
28273 (NewUserdefinedArray::DoResolve): Implement.
28275 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
28277 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
28278 we maintain inside the TypeManager. This is necessary to perform lookups on the
28281 (LookupType): Update to perform GetType on the module builders too.
28283 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
28285 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
28287 2001-10-23 Ravi Pratap <ravi@ximian.com>
28289 * expression.cs (New::DoResolve): Implement guts of array creation.
28291 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
28293 2001-10-27 Miguel de Icaza <miguel@ximian.com>
28295 * expression.cs: Fix bug I introduced lsat night that broke
28298 (Expression.Resolve): Report a 246 error (can not resolve name)
28299 if we find a SimpleName in the stream.
28301 (Expression.ResolveLValue): Ditto.
28303 (Expression.ResolveWithSimpleName): This function is a variant of
28304 ResolveName, this one allows SimpleNames to be returned without a
28305 warning. The only consumer of SimpleNames is MemberAccess
28307 2001-10-26 Miguel de Icaza <miguel@ximian.com>
28309 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
28310 might arrive here. I have my doubts that this is correct.
28312 * statement.cs (Lock): Implement lock statement.
28314 * cs-parser.jay: Small fixes to support `lock' and `using'
28316 * cs-tokenizer.cs: Remove extra space
28318 * driver.cs: New flag --checked, allows to turn on integer math
28321 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
28322 Threading.Monitor.Exit
28324 2001-10-23 Miguel de Icaza <miguel@ximian.com>
28326 * expression.cs (IndexerAccess::DoResolveLValue): Set the
28327 Expression Class to be IndexerAccess.
28329 Notice that Indexer::DoResolve sets the eclass to Value.
28331 2001-10-22 Miguel de Icaza <miguel@ximian.com>
28333 * class.cs (TypeContainer::Emit): Emit code for indexers.
28335 * assign.cs (IAssignMethod): New interface implemented by Indexers
28336 and Properties for handling assignment.
28338 (Assign::Emit): Simplify and reuse code.
28340 * expression.cs (IndexerAccess, PropertyExpr): Implement
28341 IAssignMethod, clean up old code.
28343 2001-10-22 Ravi Pratap <ravi@ximian.com>
28345 * typemanager.cs (ImplementsInterface): New method to determine if a type
28346 implements a given interface. Provides a nice cache too.
28348 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
28351 (ConvertReferenceExplicit): Ditto.
28353 * delegate.cs (Delegate::Populate): Update to define the parameters on the
28354 various methods, with correct names etc.
28356 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
28357 Operator.UnaryNegation.
28359 * cs-parser.jay (operator_declarator): Be a little clever in the case where
28360 we have a unary plus or minus operator.
28362 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
28365 * everywhere : update accordingly.
28367 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
28370 * class.cs (Method::Define): For the case where we are implementing a method
28371 inherited from an interface, we need to set the MethodAttributes.Final flag too.
28372 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
28374 2001-10-21 Ravi Pratap <ravi@ximian.com>
28376 * interface.cs (FindMembers): Implement to work around S.R.E
28379 * typemanager.cs (IsInterfaceType): Implement.
28381 (FindMembers): Update to handle interface types too.
28383 * expression.cs (ImplicitReferenceConversion): Re-write bits which
28384 use IsAssignableFrom as that is not correct - it doesn't work.
28386 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
28387 and accordingly override EmitStatement.
28389 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
28390 using the correct logic :-)
28392 2001-10-19 Ravi Pratap <ravi@ximian.com>
28394 * ../errors/cs-11.cs : Add to demonstrate error -11
28396 2001-10-17 Miguel de Icaza <miguel@ximian.com>
28398 * assign.cs (Assign::Resolve): Resolve right hand side first, and
28399 then pass this as a hint to ResolveLValue.
28401 * expression.cs (FieldExpr): Add Location information
28403 (FieldExpr::LValueResolve): Report assignment to readonly
28406 (Expression::ExprClassFromMemberInfo): Pass location information.
28408 (Expression::ResolveLValue): Add new method that resolves an
28411 (Expression::DoResolveLValue): Default invocation calls
28414 (Indexers): New class used to keep track of indexers in a given
28417 (IStackStore): Renamed from LValue, as it did not really describe
28418 what this did. Also ResolveLValue is gone from this interface and
28419 now is part of Expression.
28421 (ElementAccess): Depending on the element access type
28423 * typemanager.cs: Add `indexer_name_type' as a Core type
28424 (System.Runtime.CompilerServices.IndexerNameAttribute)
28426 * statement.cs (Goto): Take a location.
28428 2001-10-18 Ravi Pratap <ravi@ximian.com>
28430 * delegate.cs (Delegate::VerifyDelegate): New method to verify
28431 if two delegates are compatible.
28433 (NewDelegate::DoResolve): Update to take care of the case when
28434 we instantiate a delegate from another delegate.
28436 * typemanager.cs (FindMembers): Don't even try to look up members
28437 of Delegate types for now.
28439 2001-10-18 Ravi Pratap <ravi@ximian.com>
28441 * delegate.cs (NewDelegate): New class to take care of delegate
28444 * expression.cs (New): Split the delegate related code out into
28445 the NewDelegate class.
28447 * delegate.cs (DelegateInvocation): New class to handle delegate
28450 * expression.cs (Invocation): Split out delegate related code into
28451 the DelegateInvocation class.
28453 2001-10-17 Ravi Pratap <ravi@ximian.com>
28455 * expression.cs (New::DoResolve): Implement delegate creation fully
28456 and according to the spec.
28458 (New::DoEmit): Update to handle delegates differently.
28460 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
28461 because of which we were printing out arguments in reverse order !
28463 * delegate.cs (VerifyMethod): Implement to check if the given method
28464 matches the delegate.
28466 (FullDelegateDesc): Implement.
28468 (VerifyApplicability): Implement.
28470 * expression.cs (Invocation::DoResolve): Update to accordingly handle
28471 delegate invocations too.
28473 (Invocation::Emit): Ditto.
28475 * ../errors/cs1593.cs : Added.
28477 * ../errors/cs1594.cs : Added.
28479 * delegate.cs (InstanceExpression, TargetMethod): New properties.
28481 2001-10-16 Ravi Pratap <ravi@ximian.com>
28483 * typemanager.cs (intptr_type): Core type for System.IntPtr
28485 (InitCoreTypes): Update for the same.
28487 (iasyncresult_type, asynccallback_type): Ditto.
28489 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
28492 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
28495 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
28496 the builders for the 4 members of a delegate type :-)
28498 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
28501 * expression.cs (New::DoResolve): Implement guts for delegate creation.
28503 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
28505 2001-10-15 Miguel de Icaza <miguel@ximian.com>
28507 * statement.cs (Break::Emit): Implement.
28508 (Continue::Emit): Implement.
28510 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
28511 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
28512 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
28513 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
28516 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
28517 properties that track the label for the current loop (begin of the
28518 loop and end of the loop).
28520 2001-10-15 Ravi Pratap <ravi@ximian.com>
28522 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
28523 use of emitting anything at all.
28525 * class.cs, rootcontext.cs : Get rid of calls to the same.
28527 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
28529 (Populate): Define the constructor correctly and set the implementation
28532 * typemanager.cs (delegate_types): New hashtable to hold delegates that
28535 (AddDelegateType): Implement.
28537 (IsDelegateType): Implement helper method.
28539 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
28541 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
28542 and accordingly handle it.
28544 * delegate.cs (Populate): Take TypeContainer argument.
28545 Implement bits to define the Invoke method. However, I still haven't figured out
28546 how to take care of the native int bit :-(
28548 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
28549 Qualify the name of the delegate, not its return type !
28551 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
28554 (StandardConversionExists): Checking for array types turns out to be recursive.
28556 (ConvertReferenceExplicit): Implement array conversion.
28558 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
28560 2001-10-12 Ravi Pratap <ravi@ximian.com>
28562 * cs-parser.jay (delegate_declaration): Store the fully qualified
28563 name as it is a type declaration.
28565 * delegate.cs (ReturnType, Name): Rename members to these. Make them
28568 (DefineDelegate): Renamed from Define. Does the same thing essentially,
28569 as TypeContainer::DefineType.
28571 (Populate): Method in which all the definition of the various methods (Invoke)
28574 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
28577 (CloseDelegate): Finally creates the delegate.
28579 * class.cs (TypeContainer::DefineType): Update to define delegates.
28580 (Populate, Emit and CloseType): Do the same thing here too.
28582 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
28583 delegates in all these operations.
28585 2001-10-14 Miguel de Icaza <miguel@ximian.com>
28587 * expression.cs: LocalTemporary: a new expression used to
28588 reference a temporary that has been created.
28590 * assign.cs: Handle PropertyAccess back here, so that we can
28591 provide the proper semantic access to properties.
28593 * expression.cs (Expression::ConvertReferenceExplicit): Implement
28594 a few more explicit conversions.
28596 * modifiers.cs: `NEW' modifier maps to HideBySig.
28598 * expression.cs (PropertyExpr): Make this into an
28599 ExpressionStatement, and support the EmitStatement code path.
28601 Perform get/set error checking, clean up the interface.
28603 * assign.cs: recognize PropertyExprs as targets, and if so, turn
28604 them into toplevel access objects.
28606 2001-10-12 Miguel de Icaza <miguel@ximian.com>
28608 * expression.cs: PropertyExpr::PropertyExpr: use work around the
28611 * typemanager.cs: Keep track here of our PropertyBuilders again to
28612 work around lameness in SRE.
28614 2001-10-11 Miguel de Icaza <miguel@ximian.com>
28616 * expression.cs (LValue::LValueResolve): New method in the
28617 interface, used to perform a second resolution pass for LValues.
28619 (This::DoResolve): Catch the use of this in static methods.
28621 (This::LValueResolve): Implement.
28623 (This::Store): Remove warning, assigning to `this' in structures
28626 (Invocation::Emit): Deal with invocation of
28627 methods on value types. We need to pass the address to structure
28628 methods rather than the object itself. (The equivalent code to
28629 emit "this" for structures leaves the entire structure on the
28630 stack instead of a pointer to it).
28632 (ParameterReference::DoResolve): Compute the real index for the
28633 argument based on whether the method takes or not a `this' pointer
28634 (ie, the method is static).
28636 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
28637 value types returned from functions when we need to invoke a
28638 method on the sturcture.
28641 2001-10-11 Ravi Pratap <ravi@ximian.com>
28643 * class.cs (TypeContainer::DefineType): Method to actually do the business of
28644 defining the type in the Modulebuilder or Typebuilder. This is to take
28645 care of nested types which need to be defined on the TypeBuilder using
28646 DefineNestedMethod.
28648 (TypeContainer::GetClassBases): Implement. Essentially the code from the
28649 methods in RootContext, only ported to be part of TypeContainer.
28651 (TypeContainer::GetInterfaceOrClass): Ditto.
28653 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
28655 * interface.cs (Interface::DefineInterface): New method. Does exactly
28656 what RootContext.CreateInterface did earlier, only it takes care of nested types
28659 (Interface::GetInterfaces): Move from RootContext here and port.
28661 (Interface::GetInterfaceByName): Same here.
28663 * rootcontext.cs (ResolveTree): Re-write.
28665 (PopulateTypes): Re-write.
28667 * class.cs (TypeContainer::Populate): Populate nested types too.
28668 (TypeContainer::Emit): Emit nested members too.
28670 * typemanager.cs (AddUserType): Do not make use of the FullName property,
28671 instead just use the name argument passed in as it is already fully
28674 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
28675 to TypeContainer mapping to see if a type is user-defined.
28677 * class.cs (TypeContainer::CloseType): Implement.
28679 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
28680 the default constructor.
28682 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
28685 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
28687 * interface.cs (CloseType): Create the type here.
28689 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
28692 Remove all the methods which are now in TypeContainer.
28694 2001-10-10 Ravi Pratap <ravi@ximian.com>
28696 * delegate.cs (Define): Re-write bits to define the delegate
28699 2001-10-10 Miguel de Icaza <miguel@ximian.com>
28701 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
28703 * expression.cs (ImplicitReferenceConversion): handle null as well
28704 as a source to convert to any reference type.
28706 * statement.cs (Return): Perform any implicit conversions to
28707 expected return type.
28709 Validate use of return statement.
28711 * codegen.cs (EmitContext): Pass the expected return type here.
28713 * class.cs (Method, Constructor, Property): Pass expected return
28714 type to EmitContext.
28716 2001-10-09 Miguel de Icaza <miguel@ximian.com>
28718 * expression.cs: Make DoResolve take an EmitContext instead of a
28721 Replaced `l' and `location' for `loc', for consistency.
28723 (Error, Warning): Remove unneeded Tc argument.
28725 * assign.cs, literal.cs, constant.cs: Update to new calling
28728 * codegen.cs: EmitContext now contains a flag indicating whether
28729 code is being generated in a static method or not.
28731 * cs-parser.jay: DecomposeQI, new function that replaces the old
28732 QualifiedIdentifier. Now we always decompose the assembled
28733 strings from qualified_identifier productions into a group of
28736 2001-10-08 Miguel de Icaza <miguel@ximian.com>
28738 * rootcontext.cs: Deal with field-less struct types correctly now
28739 by passing the size option to Define Type.
28741 * class.cs: Removed hack that created one static field.
28743 2001-10-07 Miguel de Icaza <miguel@ximian.com>
28745 * statement.cs: Moved most of the code generation here.
28747 2001-10-09 Ravi Pratap <ravi@ximian.com>
28749 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
28752 (ElementAccess): Remove useless bits for now - keep checks as the spec
28755 2001-10-08 Ravi Pratap <ravi@ximian.com>
28757 * expression.cs (ElementAccess::DoResolve): Remove my crap code
28758 and start performing checks according to the spec.
28760 2001-10-07 Ravi Pratap <ravi@ximian.com>
28762 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
28763 rank_specifiers instead.
28765 (rank_specifiers): Change the order in which the rank specifiers are stored
28767 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
28769 * expression.cs (ElementAccess): Implement the LValue interface too.
28771 2001-10-06 Ravi Pratap <ravi@ximian.com>
28773 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
28774 except that user defined conversions are not included.
28776 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
28777 perform the conversion of the return type, if necessary.
28779 (New::DoResolve): Check whether we are creating an array or an object
28780 and accordingly do the needful.
28782 (New::Emit): Same here.
28784 (New::DoResolve): Implement guts of array creation.
28786 (New::FormLookupType): Helper function.
28788 2001-10-07 Miguel de Icaza <miguel@ximian.com>
28790 * codegen.cs: Removed most of the code generation here, and move the
28791 corresponding code generation bits to the statement classes.
28793 Added support for try/catch/finalize and throw.
28795 * cs-parser.jay: Added support for try/catch/finalize.
28797 * class.cs: Catch static methods having the flags override,
28798 virtual or abstract.
28800 * expression.cs (UserCast): This user cast was not really doing
28801 what it was supposed to do. Which is to be born in fully resolved
28802 state. Parts of the resolution were being performed at Emit time!
28806 2001-10-05 Miguel de Icaza <miguel@ximian.com>
28808 * expression.cs: Implicity convert the result from UserCast.
28810 2001-10-05 Ravi Pratap <ravi@ximian.com>
28812 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
28813 prevented it from working correctly.
28815 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
28816 merely ConvertImplicit.
28818 2001-10-05 Miguel de Icaza <miguel@ximian.com>
28820 * typemanager.cs: Make the LookupTypeContainer function static,
28821 and not per-instance.
28823 * class.cs: Make static FindMembers (the one that takes a Type
28826 * codegen.cs: Add EmitForeach here.
28828 * cs-parser.jay: Make foreach a toplevel object instead of the
28829 inline expansion, as we need to perform semantic analysis on it.
28831 2001-10-05 Ravi Pratap <ravi@ximian.com>
28833 * expression.cs (Expression::ImplicitUserConversion): Rename to
28834 UserDefinedConversion.
28836 (Expression::UserDefinedConversion): Take an extra argument specifying
28837 whether we look for explicit user conversions too.
28839 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
28841 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
28843 (ExplicitUserConversion): Make it a call to UserDefinedConversion
28844 with the appropriate arguments.
28846 * cs-parser.jay (cast_expression): Record location too.
28848 * expression.cs (Cast): Record location info.
28850 (Expression::ConvertExplicit): Take location argument.
28852 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
28853 to determine if we are doing explicit conversions.
28855 (UserCast::Emit): Update accordingly.
28857 (Expression::ConvertExplicit): Report an error if everything fails.
28859 * ../errors/cs0030.cs : Add.
28861 2001-10-04 Miguel de Icaza <miguel@ximian.com>
28863 * modifiers.cs: If the ABSTRACT keyword is present, also set the
28864 virtual and newslot bits.
28866 * class.cs (TypeContainer::RegisterRequiredImplementations):
28867 Record methods we need.
28869 (TypeContainer::MakeKey): Helper function to make keys for
28870 MethodBases, since the Methodbase key is useless.
28872 (TypeContainer::Populate): Call RegisterRequiredImplementations
28873 before defining the methods.
28875 Create a mapping for method_builders_to_methods ahead of time
28876 instead of inside a tight loop.
28878 (::RequireMethods): Accept an object as the data to set into the
28879 hashtable so we can report interface vs abstract method mismatch.
28881 2001-10-03 Miguel de Icaza <miguel@ximian.com>
28883 * report.cs: Make all of it static.
28885 * rootcontext.cs: Drop object_type and value_type computations, as
28886 we have those in the TypeManager anyways.
28888 Drop report instance variable too, now it is a global.
28890 * driver.cs: Use try/catch on command line handling.
28892 Add --probe option to debug the error reporting system with a test
28895 * report.cs: Add support for exiting program when a probe
28896 condition is reached.
28898 2001-10-03 Ravi Pratap <ravi@ximian.com>
28900 * expression.cs (Binary::DoNumericPromotions): Fix the case when
28901 we do a forcible conversion regardless of type, to check if
28902 ForceConversion returns a null.
28904 (Binary::error19): Use location to report error.
28906 (Unary::error23): Use location here too.
28908 * ../errors/cs0019.cs : Check in.
28910 * ../errors/cs0023.cs : Check in.
28912 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
28913 case of a non-null MethodInfo object with a length of 0 !
28915 (Binary::ResolveOperator): Flag error if overload resolution fails to find
28916 an applicable member - according to the spec :-)
28917 Also fix logic to find members in base types.
28919 (Unary::ResolveOperator): Same here.
28921 (Unary::report23): Change name to error23 and make first argument a TypeContainer
28922 as I was getting thoroughly confused between this and error19 :-)
28924 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
28925 (::FindMostEncompassedType): Implement.
28926 (::FindMostEncompassingType): Implement.
28927 (::StandardConversionExists): Implement.
28929 (UserImplicitCast): Re-vamp. We now need info about most specific
28930 source and target types so that we can do the necessary conversions.
28932 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
28933 mathematical union with no duplicates.
28935 2001-10-03 Miguel de Icaza <miguel@ximian.com>
28937 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
28938 in order from base classes to child classes, so that we can in
28939 child classes look up in our parent for method names and
28940 attributes (required for handling abstract, virtual, new, override
28941 constructs: we need to instrospect our base class, and if we dont
28942 populate the classes in order, the introspection might be
28943 incorrect. For example, a method could query its parent before
28944 the parent has any methods and would determine that the parent has
28945 no abstract methods (while it could have had them)).
28947 (RootContext::CreateType): Record the order in which we define the
28950 2001-10-02 Miguel de Icaza <miguel@ximian.com>
28952 * class.cs (TypeContainer::Populate): Also method definitions can
28953 fail now, keep track of this.
28955 (TypeContainer::FindMembers): Implement support for
28956 DeclaredOnly/noDeclaredOnly flag.
28958 (Constructor::Emit) Return the ConstructorBuilder.
28960 (Method::Emit) Return the MethodBuilder.
28961 Check for abstract or virtual methods to be public.
28963 * rootcontext.cs (RootContext::CreateType): Register all the
28964 abstract methods required for the class to be complete and the
28965 interface methods that must be implemented.
28967 * cs-parser.jay: Report error 501 (method requires body if it is
28968 not marked abstract or extern).
28970 * expression.cs (TypeOf::Emit): Implement.
28972 * typemanager.cs: runtime_handle_type, new global type.
28974 * class.cs (Property::Emit): Generate code for properties.
28976 2001-10-02 Ravi Pratap <ravi@ximian.com>
28978 * expression.cs (Unary::ResolveOperator): Find operators on base type
28979 too - we now conform exactly to the spec.
28981 (Binary::ResolveOperator): Same here.
28983 * class.cs (Operator::Define): Fix minor quirk in the tests.
28985 * ../errors/cs0215.cs : Added.
28987 * ../errors/cs0556.cs : Added.
28989 * ../errors/cs0555.cs : Added.
28991 2001-10-01 Miguel de Icaza <miguel@ximian.com>
28993 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
28994 single integer which is really efficient
28996 2001-10-01 Ravi Pratap <ravi@ximian.com>
28998 * expression.cs (Expression::ImplicitUserConversion): Use location
28999 even in the case when we are examining True operators.
29001 * class.cs (Operator::Define): Perform extensive checks to conform
29002 with the rules for operator overloading in the spec.
29004 * expression.cs (Expression::ImplicitReferenceConversion): Implement
29005 some of the other conversions mentioned in the spec.
29007 * typemanager.cs (array_type): New static member for the System.Array built-in
29010 (cloneable_interface): For System.ICloneable interface.
29012 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
29013 we start resolving the tree and populating types.
29015 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
29017 2001-10-01 Miguel de Icaza <miguel@ximian.com>
29019 * expression.cs (Expression::ExprClassFromMemberInfo,
29020 Expression::Literalize): Create literal expressions from
29021 FieldInfos which are literals.
29023 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
29024 type casts, because they were wrong. The test suite in tests
29027 (ImplicitNumericConversion): ushort to ulong requires a widening
29030 Int32 constant to long requires widening cast as well.
29032 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
29033 for integers because the type on the stack is not i4.
29035 2001-09-30 Miguel de Icaza <miguel@ximian.com>
29037 * expression.cs (report118): require location argument.
29039 * parameter.cs: Do not dereference potential null value.
29041 * class.cs: Catch methods that lack the `new' keyword when
29042 overriding a name. Report warnings when `new' is used without
29043 anything being there to override.
29045 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
29047 * class.cs: Only add constructor to hashtable if it is non-null
29048 (as now constructors can fail on define).
29050 (TypeManager, Class, Struct): Take location arguments.
29052 Catch field instance initialization in structs as errors.
29054 accepting_filter: a new filter for FindMembers that is static so
29055 that we dont create an instance per invocation.
29057 (Constructor::Define): Catch errors where a struct constructor is
29060 * cs-parser.jay: Pass location information for various new
29063 * delegate.cs (Delegate): take a location argument.
29065 * driver.cs: Do not call EmitCode if there were problesm in the
29066 Definition of the types, as many Builders wont be there.
29068 * decl.cs (Decl::Decl): Require a location argument.
29070 * cs-tokenizer.cs: Handle properly hex constants that can not fit
29071 into integers, and find the most appropiate integer for it.
29073 * literal.cs: Implement ULongLiteral.
29075 * rootcontext.cs: Provide better information about the location of
29076 failure when CreateType fails.
29078 2001-09-29 Miguel de Icaza <miguel@ximian.com>
29080 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
29083 * expression.cs (Binary::CheckShiftArguments): Add missing type
29085 (Binary::ResolveOperator): Add type to the logical and and logical
29086 or, Bitwise And/Or and Exclusive Or code paths, it was missing
29089 (Binary::DoNumericPromotions): In the case where either argument
29090 is ulong (and most signed types combined with ulong cause an
29091 error) perform implicit integer constant conversions as well.
29093 2001-09-28 Miguel de Icaza <miguel@ximian.com>
29095 * expression.cs (UserImplicitCast): Method should always be
29097 (Invocation::BetterConversion): Simplified test for IntLiteral.
29099 (Expression::ImplicitNumericConversion): Split this routine out.
29100 Put the code that performs implicit constant integer conversions
29103 (Expression::Resolve): Become a wrapper around DoResolve so we can
29104 check eclass and type being set after resolve.
29106 (Invocation::Badness): Remove this dead function
29108 (Binary::ResolveOperator): Do not compute the expensive argumnets
29109 unless we have a union for it.
29111 (Probe::Emit): Is needs to do an isinst and then
29112 compare against null.
29114 (::CanConvert): Added Location argument. If the Location argument
29115 is null (Location.Null), then we do not report errors. This is
29116 used by the `probe' mechanism of the Explicit conversion. We do
29117 not want to generate an error for something that the user
29118 explicitly requested to be casted. But the pipeline for an
29119 explicit cast first tests for potential implicit casts.
29121 So for now, if the Location is null, it means `Probe only' to
29122 avoid adding another argument. Might have to revise this
29125 (ClassCast): New class used to type cast objects into arbitrary
29126 classes (used in Explicit Reference Conversions).
29128 Implement `as' as well.
29130 Reverted all the patches from Ravi below: they were broken:
29132 * The use of `level' as a mechanism to stop recursive
29133 invocations is wrong. That was there just to catch the
29134 bug with a strack trace but not as a way of addressing
29137 To fix the problem we have to *understand* what is going
29138 on and the interactions and come up with a plan, not
29139 just get things going.
29141 * The use of the type conversion cache that I proposed
29142 last night had an open topic: How does this work across
29143 protection domains. A user defined conversion might not
29144 be public in the location where we are applying the
29145 conversion, a different conversion might be selected
29146 (ie, private A->B (better) but public B->A (worse),
29147 inside A, A->B applies, but outside it, B->A will
29150 * On top of that (ie, even if the above is solved),
29151 conversions in a cache need to be abstract. Ie, `To
29152 convert from an Int to a Short use an OpcodeCast', not
29153 `To convert from an Int to a Short use the OpcodeCast on
29154 the variable 5' (which is what this patch was doing).
29156 2001-09-28 Ravi Pratap <ravi@ximian.com>
29158 * expression.cs (Invocation::ConversionExists): Re-write to use
29159 the conversion cache
29161 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
29162 cache all conversions done, not just user-defined ones.
29164 (Invocation::BetterConversion): The real culprit. Use ConversionExists
29165 to determine if a conversion exists instead of acutually trying to
29166 perform the conversion. It's faster too.
29168 (Expression::ConvertExplicit): Modify to use ConversionExists to check
29169 and only then attempt the implicit conversion.
29171 2001-09-28 Ravi Pratap <ravi@ximian.com>
29173 * expression.cs (ConvertImplicit): Use a cache for conversions
29174 already found. Check level of recursion and bail out if necessary.
29176 2001-09-28 Miguel de Icaza <miguel@ximian.com>
29178 * typemanager.cs (string_concat_string_string, string_concat_object_object):
29179 Export standard methods that we expect for string operations.
29181 * statement.cs (Block::UsageWarning): Track usage of variables and
29182 report the errors for not used variables.
29184 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
29187 2001-09-27 Miguel de Icaza <miguel@ximian.com>
29189 * codegen.cs: remove unnneded code
29191 * expression.cs: Removed BuiltinTypeAccess class
29193 Fix the order in which implicit conversions are
29196 The previous fixed dropped support for boxed conversions (adding a
29197 test to the test suite now)
29199 (UserImplicitCast::CanConvert): Remove test for source being null,
29200 that code is broken. We should not feed a null to begin with, if
29201 we do, then we should track the bug where the problem originates
29202 and not try to cover it up here.
29204 Return a resolved expression of type UserImplicitCast on success
29205 rather than true/false. Ravi: this is what I was talking about,
29206 the pattern is to use a static method as a "constructor" for
29209 Also, do not create arguments until the very last minute,
29210 otherwise we always create the arguments even for lookups that
29211 will never be performed.
29213 (UserImplicitCast::Resolve): Eliminate, objects of type
29214 UserImplicitCast are born in a fully resolved state.
29216 * typemanager.cs (InitCoreTypes): Init also value_type
29217 (System.ValueType).
29219 * expression.cs (Cast::Resolve): First resolve the child expression.
29221 (LValue): Add new method AddressOf to be used by
29224 Change the argument of Store to take an EmitContext instead of an
29225 ILGenerator, because things like FieldExpr need to be able to call
29226 their children expression to generate the instance code.
29228 (Expression::Error, Expression::Warning): Sugar functions for
29231 (Expression::MemberLookup): Accept a TypeContainer instead of a
29232 Report as the first argument.
29234 (Expression::ResolvePrimary): Killed. I still want to improve
29235 this as currently the code is just not right.
29237 (Expression::ResolveMemberAccess): Simplify, but it is still
29240 (Unary::Resolve): Catch errors in AddressOf operators.
29242 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
29243 index to a byte for the short-version, or the compiler will choose
29244 the wrong Emit call, which generates the wrong data.
29246 (ParameterReference::Emit, ::Store): same.
29248 (FieldExpr::AddressOf): Implement.
29250 * typemanager.cs: TypeManager: made public variable instead of
29253 * driver.cs: document --fatal.
29255 * report.cs (ErrorMessage, WarningMessage): new names for the old
29256 Error and Warning classes.
29258 * cs-parser.jay (member_access): Turn built-in access to types
29259 into a normal simplename
29261 2001-09-27 Ravi Pratap <ravi@ximian.com>
29263 * expression.cs (Invocation::BetterConversion): Fix to cope
29264 with q being null, since this was introducing a bug.
29266 * expression.cs (ConvertImplicit): Do built-in conversions first.
29268 2001-09-27 Ravi Pratap <ravi@ximian.com>
29270 * expression.cs (UserImplicitCast::Resolve): Fix bug.
29272 2001-09-27 Ravi Pratap <ravi@ximian.com>
29274 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
29275 I had introduced long ago (what's new ?).
29277 * expression.cs (UserImplicitCast::CanConvert): Static method to do
29278 the work of all the checking.
29279 (ConvertImplicit): Call CanConvert and only then create object if necessary.
29280 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
29282 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
29283 that is the right way.
29285 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
29286 overloading resolution. Use everywhere instead of cutting and pasting code.
29288 (Binary::ResolveOperator): Use MakeUnionSet.
29290 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
29291 we have to convert to bool types. Not complete yet.
29293 2001-09-27 Miguel de Icaza <miguel@ximian.com>
29295 * typemanager.cs (TypeManager::CSharpName): support ushort.
29297 * expression.cs (Expression::TryImplicitIntConversion): Attempts
29298 to provide an expression that performsn an implicit constant int
29299 conversion (section 6.1.6).
29300 (Expression::ConvertImplicitRequired): Reworked to include
29301 implicit constant expression conversions.
29303 (Expression::ConvertNumericExplicit): Finished.
29305 (Invocation::Emit): If InstanceExpression is null, then it means
29306 that we perform a call on this.
29308 2001-09-26 Miguel de Icaza <miguel@ximian.com>
29310 * expression.cs (Unary::Emit): Remove some dead code.
29311 (Probe): Implement Resolve and Emit for `is'.
29312 (Expression::ConvertImplicitRequired): Attempt to do constant
29313 expression conversions here. Maybe should be moved to
29314 ConvertImplicit, but I am not sure.
29315 (Expression::ImplicitLongConstantConversionPossible,
29316 Expression::ImplicitIntConstantConversionPossible): New functions
29317 that tell whether is it possible to apply an implicit constant
29318 expression conversion.
29320 (ConvertNumericExplicit): Started work on explicit numeric
29323 * cs-parser.jay: Update operator constants.
29325 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
29326 (Parameters::GetSignature): Hook up VerifyArgs here.
29327 (Parameters::VerifyArgs): Verifies that no two arguments have the
29330 * class.cs (Operator): Update the operator names to reflect the
29331 ones that the spec expects (as we are just stringizing the
29334 * expression.cs (Unary::ResolveOperator): Fix bug: Use
29335 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
29336 previous usage did only work for our methods.
29337 (Expression::ConvertImplicit): Handle decimal implicit numeric
29338 conversions as well.
29339 (Expression::InternalTypeConstructor): Used to invoke constructors
29340 on internal types for default promotions.
29342 (Unary::Emit): Implement special handling for the pre/post
29343 increment/decrement for overloaded operators, as they need to have
29344 the same semantics as the other operators.
29346 (Binary::ResolveOperator): ditto.
29347 (Invocation::ConversionExists): ditto.
29348 (UserImplicitCast::Resolve): ditto.
29350 2001-09-26 Ravi Pratap <ravi@ximian.com>
29352 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
29353 operator, return after emitting body. Regression tests pass again !
29355 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
29356 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
29357 (Invocation::OverloadResolve): Ditto.
29358 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
29360 * everywhere : update calls to the above methods accordingly.
29362 2001-09-26 Miguel de Icaza <miguel@ximian.com>
29364 * assign.cs (Assign): Make it inherit from ExpressionStatement.
29366 * expression.cs (ExpressionStatement): New base class used for
29367 expressions that can appear in statements, so that we can provide
29368 an alternate path to generate expression that do not leave a value
29371 (Expression::Emit, and all the derivatives): We no longer return
29372 whether a value is left on the stack or not. Every expression
29373 after being emitted leaves a single value on the stack.
29375 * codegen.cs (EmitContext::EmitStatementExpression): Use the
29376 facilties of ExpressionStatement if possible.
29378 * cs-parser.jay: Update statement_expression.
29380 2001-09-25 Miguel de Icaza <miguel@ximian.com>
29382 * driver.cs: Change the wording of message
29384 2001-09-25 Ravi Pratap <ravi@ximian.com>
29386 * expression.cs (Binary::ResolveOperator): Had forgottten to set
29387 the type of the expression to the return type of the method if
29388 we have an overloaded operator match ! The regression tests pass again !
29389 (Unary::ResolveOperator): Ditto.
29391 * expression.cs (Invocation::ConversionExists): Correct the member lookup
29392 to find "op_Implicit", not "implicit" ;-)
29393 (UserImplicitCast): New class to take care of user-defined implicit conversions.
29394 (ConvertImplicit, ForceConversion): Take TypeContainer argument
29396 * everywhere : Correct calls to the above accordingly.
29398 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
29399 (ConvertImplicit): Do user-defined conversion if it exists.
29401 2001-09-24 Miguel de Icaza <miguel@ximian.com>
29403 * assign.cs: track location.
29404 (Resolve): Use implicit conversions on assignment.
29406 * literal.cs: Oops. Not good, Emit of short access values should
29407 pass (Bytes) or the wrong argument will be selected.
29409 * expression.cs (Unary::Emit): Emit code for -expr.
29411 (Unary::ResolveOperator): Handle `Substract' for non-constants
29412 (substract from zero from the non-constants).
29413 Deal with Doubles as well.
29415 (Expression::ConvertImplicitRequired): New routine that reports an
29416 error if no implicit conversion exists.
29418 (Invocation::OverloadResolve): Store the converted implicit
29419 expressions if we make them
29421 2001-09-24 Ravi Pratap <ravi@ximian.com>
29423 * class.cs (ConstructorInitializer): Take a Location argument.
29424 (ConstructorBaseInitializer): Same here.
29425 (ConstructorThisInitializer): Same here.
29427 * cs-parser.jay : Update all calls accordingly.
29429 * expression.cs (Unary, Binary, New): Take location argument.
29430 Update accordingly everywhere.
29432 * cs-parser.jay : Update all calls to the above to take a location
29435 * class.cs : Ditto.
29437 2001-09-24 Ravi Pratap <ravi@ximian.com>
29439 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
29440 (Invocation::BetterConversion): Same here
29441 (Invocation::ConversionExists): Ditto.
29443 (Invocation::ConversionExists): Implement.
29445 2001-09-22 Ravi Pratap <ravi@ximian.com>
29447 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
29448 Also take an additional TypeContainer argument.
29450 * All over : Pass in TypeContainer as argument to OverloadResolve.
29452 * typemanager.cs (CSharpName): Update to check for the string type and return
29455 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
29458 2001-09-21 Ravi Pratap <ravi@ximian.com>
29460 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
29461 (Invocation::BetterFunction): Implement.
29462 (Invocation::BetterConversion): Implement.
29463 (Invocation::ConversionExists): Skeleton, no implementation yet.
29465 Okay, things work fine !
29467 2001-09-21 Miguel de Icaza <miguel@ximian.com>
29469 * typemanager.cs: declare and load enum_type, delegate_type and
29472 * expression.cs (Expression::Emit): Now emit returns a value that
29473 tells whether a value is left on the stack or not. This strategy
29474 might be reveted tomorrow with a mechanism that would address
29475 multiple assignments.
29476 (Expression::report118): Utility routine to report mismatches on
29479 (Unary::Report23): Report impossible type/operator combination
29482 (Unary::IsIncrementableNumber): Whether the type can be
29483 incremented or decremented with add.
29484 (Unary::ResolveOperator): Also allow enumerations to be bitwise
29486 (Unary::ResolveOperator): Implement ++, !, ~,
29488 (Invocation::Emit): Deal with new Emit convetion.
29490 * All Expression derivatives: Updated their Emit method to return
29491 whether they leave values on the stack or not.
29493 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
29494 stack for expressions that are statements.
29496 2001-09-20 Miguel de Icaza <miguel@ximian.com>
29498 * expression.cs (LValue): New interface. Must be implemented by
29500 (LocalVariableReference, ParameterReference, FieldExpr): Implement
29503 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
29504 interface for generating code, simplifies the code.
29506 2001-09-20 Ravi Pratap <ravi@ximian.com>
29508 * expression.cs (everywhere): Comment out return statements in ::Resolve
29509 methods to avoid the warnings.
29511 2001-09-20 Miguel de Icaza <miguel@ximian.com>
29513 * driver.cs (parse): Report error 2001 if we can not open the
29516 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
29519 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
29522 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
29523 otherwise nested blocks end up with the same index.
29525 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
29527 * expression.cs: Instead of having FIXMEs in the Resolve
29528 functions, throw exceptions so it is obvious that we are facing a
29531 * cs-parser.jay (invocation_expression): Pass Location information.
29533 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
29534 Use a basename for those routines because .NET does not like paths
29537 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
29540 2001-09-19 Miguel de Icaza <miguel@ximian.com>
29542 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
29543 are loading the correct data types (throws an exception if not).
29544 (TypeManager::InitCoreTypes): Use CoreLookupType
29546 * expression.cs (Unary::ResolveOperator): return the child
29547 expression for expressions which are just +expr.
29548 (Unary::ResolveOperator): Return negative literals for -LITERAL
29549 expressions (otherwise they are Unary {Literal}).
29550 (Invocation::Badness): Take into account `Implicit constant
29551 expression conversions'.
29553 * literal.cs (LongLiteral): Implement long literal class.
29554 (IntLiteral): export the `Value' of the intliteral.
29556 2001-09-19 Ravi Pratap <ravi@ximian.com>
29558 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
29560 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
29561 instead of 'Operator'
29563 * expression.cs (Binary::ResolveOperator): Update accordingly.
29564 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
29567 * cs-parser.jay (unary_expression): Update to use the new names.
29569 * gen-treedump.cs (GetUnary): Same here.
29571 * expression.cs (Unary::Resolve): Implement.
29572 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
29573 operators are found instead of making noise ;-)
29574 (Unary::ResolveOperator): New method to do precisely the same thing which
29575 Binary::ResolveOperator does for Binary expressions.
29576 (Unary.method, .Arguments): Add.
29577 (Unary::OperName): Implement.
29578 (Unary::ForceConversion): Copy and Paste !
29580 * class.cs (Operator::Define): Fix a small bug for the case when we have
29583 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
29584 for the inbuilt operators. Only overloading works for now ;-)
29586 2001-09-18 Miguel de Icaza <miguel@ximian.com>
29588 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
29589 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
29591 * expression.cs (This::Emit): Implement.
29592 (This::Resolve): Implement.
29593 (TypeOf:Resolve): Implement.
29594 (Expression::ResolveSimpleName): Add an implicit this to instance
29596 (MemberAccess::Resolve): Deal with Parameters and Fields.
29597 Bind instance variable to Field expressions.
29598 (FieldExpr::Instance): New field used to track the expression that
29599 represents the object instance.
29600 (FieldExpr::Resolve): Track potential errors from MemberLookup not
29602 (FieldExpr::Emit): Implement.
29604 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
29605 the last instruction contains a return opcode to avoid generating
29606 the last `ret' instruction (this generates correct code, and it is
29607 nice to pass the peverify output).
29609 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
29610 initializer for static and instance variables.
29611 (Constructor::Emit): Allow initializer to be null in the case of
29612 static constructors. Only emit initializer for instance
29615 (TypeContainer::FindMembers): Return a null array if there are no
29618 Also fix the code for the MemberTypes.Method branch, as it was not
29619 scanning that for operators (or tried to access null variables before).
29621 * assign.cs (Assign::Emit): Handle instance and static fields.
29625 * driver.cs: Stop compilation if there are parse errors.
29627 * cs-parser.jay (constructor_declaration): Provide default base
29628 initializer for non-static constructors.
29629 (constructor_declarator): Do not provide a default base
29630 initializers if none was specified.
29631 Catch the fact that constructors should not have parameters.
29633 * class.cs: Do not emit parent class initializers for static
29634 constructors, that should be flagged as an error.
29636 2001-09-18 Ravi Pratap <ravi@ximian.com>
29638 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
29639 Move back code into TypeContainer::Populate.
29641 2001-09-18 Ravi Pratap <ravi@ximian.com>
29643 * class.cs (TypeContainer::AddConstructor): Fix the check to
29644 compare against Name, not Basename.
29645 (Operator::OpType): Change Plus and Minus to Add and Subtract.
29647 * cs-parser.jay : Update accordingly.
29649 * class.cs (TypeContainer::FindMembers): For the case where we are searching
29650 for methods, don't forget to look into the operators too.
29651 (RegisterMethodBuilder): Helper method to take care of this for
29652 methods, constructors and operators.
29653 (Operator::Define): Completely revamp.
29654 (Operator.OperatorMethod, MethodName): New fields.
29655 (TypeContainer::Populate): Move the registering of builders into
29656 RegisterMethodBuilder.
29657 (Operator::Emit): Re-write.
29659 * expression.cs (Binary::Emit): Comment out code path to emit method
29660 invocation stuff for the case when we have a user defined operator. I am
29661 just not able to get it right !
29663 2001-09-17 Miguel de Icaza <miguel@ximian.com>
29665 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
29668 (Expression::MemberLookup): Provide a version that allows to
29669 specify the MemberTypes and BindingFlags.
29671 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
29672 so it was not fetching variable information from outer blocks.
29674 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
29675 Beforefieldinit as it was buggy.
29677 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
29678 that Ravi put here.
29680 * class.cs (Constructor::Emit): Only emit if block is not null.
29681 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
29682 deal with this by semantically definining it as if the user had
29685 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
29686 constructors as we now "emit" them at a higher level.
29688 (TypeContainer::DefineDefaultConstructor): Used to define the
29689 default constructors if none was provided.
29691 (ConstructorInitializer): Add methods Resolve and Emit.
29693 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
29695 2001-09-17 Ravi Pratap <ravi@ximian.com>
29697 * class.cs (TypeContainer::EmitDefaultConstructor): Register
29698 the default constructor builder with our hashtable for methodbuilders
29701 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
29702 and argument_count is 0 in which case we have a match.
29703 (Binary::ResolveOperator): More null checking and miscellaneous coding
29706 2001-09-17 Ravi Pratap <ravi@ximian.com>
29708 * rootcontext.cs (IsNameSpace): Compare against null.
29710 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
29712 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
29713 and Unary::Operator.
29715 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
29718 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
29719 we have overloaded operators.
29720 (Binary::ResolveOperator): Implement the part which does the operator overload
29723 * class.cs (Operator::Emit): Implement.
29724 (TypeContainer::Emit): Emit the operators we have too.
29726 * expression.cs (Binary::Emit): Update to emit the appropriate code for
29727 the case when we have a user-defined operator.
29729 2001-09-17 Miguel de Icaza <miguel@ximian.com>
29731 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
29733 2001-09-16 Ravi Pratap <ravi@ximian.com>
29735 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
29736 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
29737 (Constructor::Emit): Implement.
29738 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
29739 if we have no work to do.
29740 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
29743 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
29744 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
29746 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
29749 2001-09-15 Ravi Pratap <ravi@ximian.com>
29751 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
29753 (Tree::RecordNamespace): Method to do what the name says ;-)
29754 (Tree::Namespaces): Property to get at the namespaces hashtable.
29756 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
29759 * rootcontext.cs (IsNamespace): Fixed it :-)
29761 2001-09-14 Miguel de Icaza <miguel@ximian.com>
29763 * class.cs (TypeContainer::FindMembers): Add support for
29765 (MethodCore): New class that encapsulates both the shared aspects
29766 of a Constructor and a Method.
29767 (Method, Constructor): Factored pieces into MethodCore.
29769 * driver.cs: Added --fatal which makes errors throw exceptions.
29770 Load System assembly as well as part of the standard library.
29772 * report.cs: Allow throwing exceptions on errors for debugging.
29774 * modifiers.cs: Do not use `parent', instead use the real type
29775 container to evaluate permission settings.
29777 * class.cs: Put Ravi's patch back in. He is right, and we will
29778 have to cope with the
29780 2001-09-14 Ravi Pratap <ravi@ximian.com>
29782 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
29783 FamORAssem, not FamANDAssem.
29785 2001-09-14 Miguel de Icaza <miguel@ximian.com>
29787 * driver.cs: Added --parse option that only parses its input files
29790 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
29791 incorrect. IsTopLevel is not used to tell whether an object is
29792 root_types or not (that can be achieved by testing this ==
29793 root_types). But to see if this is a top-level *class* (not
29794 necessarly our "toplevel" container).
29796 2001-09-14 Ravi Pratap <ravi@ximian.com>
29798 * enum.cs (Enum::Define): Modify to call the Lookup method on the
29799 parent instead of a direct call to GetType.
29801 2001-09-14 Ravi Pratap <ravi@ximian.com>
29803 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
29804 Modifiers.TypeAttr. This should just be a call to that method.
29806 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
29807 object so that we can determine if we are top-level or not.
29809 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
29812 * enum.cs (Enum::Define): Ditto.
29814 * modifiers.cs (FieldAttr): Re-write.
29816 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
29817 (TypeContainer::HaveStaticConstructor): New property to provide access
29818 to precisely that info.
29820 * modifiers.cs (MethodAttr): Re-write.
29821 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
29823 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
29824 of top-level types as claimed.
29826 2001-09-13 Miguel de Icaza <miguel@ximian.com>
29828 * expression.cs (MemberLookup): Fruitless attempt to lookup
29829 constructors. Maybe I need to emit default constructors? That
29830 might be it (currently .NET emits this for me automatically).
29831 (Invocation::OverloadResolve): Cope with Arguments == null.
29832 (Invocation::EmitArguments): new function, shared by the new
29833 constructor and us.
29834 (Invocation::Emit): Handle static and instance methods. Emit
29835 proper call instruction for virtual or non-virtual invocations.
29836 (New::Emit): Implement.
29837 (New::Resolve): Implement.
29838 (MemberAccess:Resolve): Implement.
29839 (MethodGroupExpr::InstanceExpression): used conforming to the spec
29840 to track instances.
29841 (FieldExpr::Resolve): Set type.
29843 * support.cs: Handle empty arguments.
29845 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
29846 SimpleLookup): Auxiliary routines to help parse a qualifier
29849 Update qualifier_identifier rule.
29851 * codegen.cs: Removed debugging messages.
29853 * class.cs: Make this a global thing, this acts just as a "key" to
29854 objects that we might have around.
29856 (Populate): Only initialize method_builders_to_methods once.
29858 * expression.cs (PropertyExpr): Initialize type from the
29861 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
29862 Resolve pattern. Attempt to implicitly convert value to boolean.
29865 * expression.cs: Set the type for the int32/int32 argument case.
29866 (Binary::ResolveOperator): Set the return type to boolean for
29867 comparission operators
29869 * typemanager.cs: Remove debugging print code.
29871 (Invocation::Resolve): resolve type.
29873 * class.cs: Allocate a MemberInfo of the correct size, as the code
29874 elsewhere depends on the test to reflect the correct contents.
29876 (Method::) Keep track of parameters, due to System.Reflection holes
29878 (TypeContainer::Populate): Keep track of MethodBuilders to Method
29881 (TypeContainer::FindMembers): Use ArrayList and then copy an array
29882 of the exact size and return that.
29884 (Class::LookupMethodByBuilder): New function that maps
29885 MethodBuilders to its methods. Required to locate the information
29886 on methods because System.Reflection bit us again.
29888 * support.cs: New file, contains an interface ParameterData and
29889 two implementations: ReflectionParameters and InternalParameters
29890 used to access Parameter information. We will need to grow this
29893 * expression.cs (Invocation::GetParameterData): implement a cache
29894 and a wrapper around the ParameterData creation for methods.
29895 (Invocation::OverloadResolve): Use new code.
29897 2001-09-13 Ravi Pratap <ravi@ximian.com>
29899 * class.cs (TypeContainer::EmitField): Remove and move into
29900 (Field::Define): here and modify accordingly.
29901 (Field.FieldBuilder): New member.
29902 (TypeContainer::Populate): Update accordingly.
29903 (TypeContainer::FindMembers): Implement.
29905 2001-09-13 Miguel de Icaza <miguel@ximian.com>
29907 * statement.cs: (VariableInfo::VariableType): New field to be
29908 initialized with the full type once it is resolved.
29910 2001-09-12 Miguel de Icaza <miguel@ximian.com>
29912 * parameter.cs (GetParameterInfo): Use a type cache to compute
29913 things only once, and to reuse this information
29915 * expression.cs (LocalVariableReference::Emit): Implement.
29916 (OpcodeCast::Emit): fix.
29918 (ParameterReference::Resolve): Implement.
29919 (ParameterReference::Emit): Implement.
29921 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
29922 that are expressions need to stay as Expressions.
29924 * typemanager.cs (CSharpName): Returns the C# name of a type if
29927 * expression.cs (Expression::ConvertImplicit): New function that
29928 implements implicit type conversions.
29930 (Expression::ImplicitReferenceConversion): Implements implicit
29931 reference conversions.
29933 (EmptyCast): New type for transparent casts.
29935 (OpcodeCast): New type for casts of types that are performed with
29936 a sequence of bytecodes.
29938 (BoxedCast): New type used for casting value types into reference
29939 types. Emits a box opcode.
29941 (Binary::DoNumericPromotions): Implements numeric promotions of
29942 and computation of the Binary::Type.
29944 (Binary::EmitBranchable): Optimization.
29946 (Binary::Emit): Implement code emission for expressions.
29948 * typemanager.cs (TypeManager): Added two new core types: sbyte
29951 2001-09-12 Ravi Pratap <ravi@ximian.com>
29953 * class.cs (TypeContainer::FindMembers): Method which does exactly
29954 what Type.FindMembers does, only we don't have to use reflection. No
29955 implementation yet.
29957 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
29958 typecontainer objects as we need to get at them.
29959 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
29961 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
29962 typecontainer object.
29964 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
29965 of just a Report object.
29967 2001-09-11 Ravi Pratap <ravi@ximian.com>
29969 * class.cs (Event::Define): Go back to using the prefixes "add_" and
29971 (TypeContainer::Populate): Now define the delegates of the type too.
29972 (TypeContainer.Delegates): Property to access the list of delegates defined
29975 * delegates.cs (Delegate::Define): Implement partially.
29977 * modifiers.cs (TypeAttr): Handle more flags.
29979 2001-09-11 Ravi Pratap <ravi@ximian.com>
29981 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
29983 (Operator::Define): Re-write logic to get types by using the LookupType method
29984 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
29985 (Indexer::Define): Ditto.
29986 (Event::Define): Ditto.
29987 (Property::Define): Ditto.
29989 2001-09-10 Ravi Pratap <ravi@ximian.com>
29991 * class.cs (TypeContainer::Populate): Now define operators too.
29992 (TypeContainer.Operators): New property to access the list of operators
29994 (Operator.OperatorMethodBuilder): New member to hold the method builder
29995 for the operator we are defining.
29996 (Operator::Define): Implement.
29998 2001-09-10 Ravi Pratap <ravi@ximian.com>
30000 * class.cs (Event::Define): Make the prefixes of the accessor methods
30001 addOn_ and removeOn_
30003 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
30004 of the location being passed in too. Ideally, this should go later since all
30005 error reporting should be done through the Report object.
30007 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
30008 (Populate): Iterate thru the indexers we have and define them too.
30009 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
30010 for the get and set accessors.
30011 (Indexer::Define): Implement.
30013 2001-09-09 Miguel de Icaza <miguel@ximian.com>
30015 * expression.cs (Binary::Resolve): Beginning of it. I scratched
30016 my previous implementation, did not work.
30018 * typemanager.cs: Add a couple of missing types (the longs).
30020 * literal.cs: Use TypeManager.bool_type instead of getting it.
30022 * expression.cs (EventExpr): New kind of expressions.
30023 (Expressio::ExprClassFromMemberInfo): finish
30025 2001-09-08 Miguel de Icaza <miguel@ximian.com>
30027 * assign.cs: Emit stores to static fields differently.
30029 2001-09-08 Ravi Pratap <ravi@ximian.com>
30031 * Merge in changes and adjust code to tackle conflicts. Backed out my
30032 code in Assign::Resolve ;-)
30034 2001-09-08 Ravi Pratap <ravi@ximian.com>
30036 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
30037 instead Report.Error and also pass in the location.
30038 (CSharpParser::Lexer): New readonly property to return the reference
30039 to the Tokenizer object.
30040 (declare_local_variables): Use Report.Error with location instead of plain
30044 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
30045 (Operator.CheckBinaryOperator): Ditto.
30047 * cs-parser.jay (operator_declarator): Update accordingly.
30049 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
30050 (CheckBinaryOperator): Same here.
30052 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
30053 on the name without any prefixes of namespace names etc. This is because we
30054 already might have something already fully qualified like
30055 'System.Console.WriteLine'
30057 * assign.cs (Resolve): Begin implementation. Stuck ;-)
30059 2001-09-07 Ravi Pratap <ravi@ximian.com>
30061 * cs-tokenizer.cs (location): Return a string which also contains
30064 * expression.cs (ElementAccess): New class for expressions of the
30065 type 'element access.'
30066 (BaseAccess): New class for expressions of the type 'base access.'
30067 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
30070 * cs-parser.jay (element_access): Implement action.
30071 (base_access): Implement actions.
30072 (checked_expression, unchecked_expression): Implement.
30074 * cs-parser.jay (local_variable_type): Correct and implement.
30075 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
30077 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
30079 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
30080 name and the specifiers.
30082 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
30084 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
30085 making them all public ;-)
30087 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
30090 2001-09-07 Miguel de Icaza <miguel@ximian.com>
30092 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
30094 (FieldExpr, PropertyExprs): New resolved expressions.
30095 (SimpleName::MemberStaticCheck): Perform static checks for access
30096 to non-static fields on static methods. Maybe this should be
30097 generalized for MemberAccesses.
30098 (SimpleName::ResolveSimpleName): More work on simple name
30101 * cs-parser.jay (primary_expression/qualified_identifier): track
30102 the parameter index.
30104 * codegen.cs (CodeGen::Save): Catch save exception, report error.
30105 (EmitContext::EmitBoolExpression): Chain to expression generation
30106 instead of temporary hack.
30107 (::EmitStatementExpression): Put generic expression code generation.
30109 * assign.cs (Assign::Emit): Implement variable assignments to
30110 local variables, parameters and fields.
30112 2001-09-06 Miguel de Icaza <miguel@ximian.com>
30114 * statement.cs (Block::GetVariableInfo): New method, returns the
30115 VariableInfo for a variable name in a block.
30116 (Block::GetVariableType): Implement in terms of GetVariableInfo
30118 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
30119 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
30121 2001-09-06 Ravi Pratap <ravi@ximian.com>
30123 * cs-parser.jay (operator_declaration): Continue on my quest : update
30124 to take attributes argument.
30125 (event_declaration): Ditto.
30126 (enum_declaration): Ditto.
30127 (indexer_declaration): Ditto.
30129 * class.cs (Operator::Operator): Update constructor accordingly.
30130 (Event::Event): Ditto.
30132 * delegate.cs (Delegate::Delegate): Same here.
30134 * enum.cs (Enum::Enum): Same here.
30136 2001-09-05 Ravi Pratap <ravi@ximian.com>
30138 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
30140 * ../tests/cs0658.cs : New file to demonstrate error 0658.
30142 * attribute.cs (Attributes): New class to encapsulate all attributes which were
30143 being passed around as an arraylist.
30144 (Attributes::AddAttribute): Method to add attribute sections.
30146 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
30147 (struct_declaration): Update accordingly.
30148 (constant_declaration): Update.
30149 (field_declaration): Update.
30150 (method_header): Update.
30151 (fixed_parameter): Update.
30152 (parameter_array): Ditto.
30153 (property_declaration): Ditto.
30154 (destructor_declaration): Ditto.
30156 * class.cs (Struct::Struct): Update constructors accordingly.
30157 (Class::Class): Ditto.
30158 (Field::Field): Ditto.
30159 (Method::Method): Ditto.
30160 (Property::Property): Ditto.
30161 (TypeContainer::OptAttribute): update property's return type.
30163 * interface.cs (Interface.opt_attributes): New member.
30164 (Interface::Interface): Update to take the extra Attributes argument.
30166 * parameter.cs (Parameter::Parameter): Ditto.
30168 * constant.cs (Constant::Constant): Ditto.
30170 * interface.cs (InterfaceMemberBase): New OptAttributes field.
30171 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
30172 the attributes as a parameter.
30173 (InterfaceProperty): Update constructor call.
30174 (InterfaceEvent): Ditto.
30175 (InterfaceMethod): Ditto.
30176 (InterfaceIndexer): Ditto.
30178 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
30179 pass the attributes too.
30180 (interface_event_declaration): Ditto.
30181 (interface_property_declaration): Ditto.
30182 (interface_method_declaration): Ditto.
30183 (interface_declaration): Ditto.
30185 2001-09-05 Miguel de Icaza <miguel@ximian.com>
30187 * class.cs (Method::Define): Track the "static Main" definition to
30188 create an entry point.
30190 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
30191 EntryPoint if we find it.
30193 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
30194 (EmitContext::ig): Make this variable public.
30196 * driver.cs: Make the default output file be the first file name
30197 with the .exe extension.
30199 Detect empty compilations
30201 Handle various kinds of output targets. Handle --target and
30202 rename -t to --dumper.
30204 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
30205 methods inherited from Expression return now an Expression. This
30206 will is used during the tree rewriting as we resolve them during
30209 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
30210 the spec. Missing entirely is the information about
30211 accessability of elements of it.
30213 (Expression::ExprClassFromMemberInfo): New constructor for
30214 Expressions that creates a fully initialized Expression based on
30215 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
30218 (Invocation::Resolve): Begin implementing resolution of invocations.
30220 * literal.cs (StringLiteral): Implement Emit.
30222 2001-09-05 Ravi Pratap <ravi@ximian.com>
30224 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
30227 2001-09-04 Ravi Pratap <ravi@ximian.com>
30229 * cs-parser.jay (attribute_arguments): Implement actions.
30230 (attribute): Fix bug in production. Implement action.
30231 (attribute_list): Implement.
30232 (attribute_target): Implement.
30233 (attribute_target_specifier, opt_target_specifier): Implement
30234 (CheckAttributeTarget): New method to check if the attribute target
30236 (attribute_section): Implement.
30237 (opt_attributes): Implement.
30239 * attribute.cs : New file to handle attributes.
30240 (Attribute): Class to hold attribute info.
30242 * cs-parser.jay (opt_attribute_target_specifier): Remove production
30243 (attribute_section): Modify production to use 2 different rules to
30244 achieve the same thing. 1 s/r conflict down !
30245 Clean out commented, useless, non-reducing dimension_separator rules.
30247 * class.cs (TypeContainer.attributes): New member to hold list
30248 of attributes for a type.
30249 (Struct::Struct): Modify to take one more argument, the attribute list.
30250 (Class::Class): Ditto.
30251 (Field::Field): Ditto.
30252 (Method::Method): Ditto.
30253 (Property::Property): Ditto.
30255 * cs-parser.jay (struct_declaration): Update constructor call to
30256 pass in the attributes too.
30257 (class_declaration): Ditto.
30258 (constant_declaration): Ditto.
30259 (field_declaration): Ditto.
30260 (method_header): Ditto.
30261 (fixed_parameter): Ditto.
30262 (parameter_array): Ditto.
30263 (property_declaration): Ditto.
30265 * constant.cs (Constant::Constant): Update constructor similarly.
30266 Use System.Collections.
30268 * parameter.cs (Parameter::Parameter): Update as above.
30270 2001-09-02 Ravi Pratap <ravi@ximian.com>
30272 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
30273 (TypeContainer.delegates): New member to hold list of delegates.
30275 * cs-parser.jay (delegate_declaration): Implement the action correctly
30276 this time as I seem to be on crack ;-)
30278 2001-09-02 Miguel de Icaza <miguel@ximian.com>
30280 * rootcontext.cs (RootContext::IsNamespace): new function, used to
30281 tell whether an identifier represents a namespace.
30283 * expression.cs (NamespaceExpr): A namespace expression, used only
30284 temporarly during expression resolution.
30285 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
30286 utility functions to resolve names on expressions.
30288 2001-09-01 Miguel de Icaza <miguel@ximian.com>
30290 * codegen.cs: Add hook for StatementExpressions.
30292 * class.cs: Fix inverted test for static flag in methods.
30294 2001-09-02 Ravi Pratap <ravi@ximian.com>
30296 * class.cs (Operator::CheckUnaryOperator): Correct error number used
30297 to make it coincide with MS' number.
30298 (Operator::CheckBinaryOperator): Ditto.
30300 * ../errors/errors.txt : Remove error numbers added earlier.
30302 * ../errors/cs1019.cs : Test case for error # 1019
30304 * ../errros/cs1020.cs : Test case for error # 1020
30306 * cs-parser.jay : Clean out commented cruft.
30307 (dimension_separators, dimension_separator): Comment out. Ostensibly not
30308 used anywhere - non-reducing rule.
30309 (namespace_declarations): Non-reducing rule - comment out.
30311 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
30312 with TypeContainer::AddEnum.
30314 * delegate.cs : New file for delegate handling classes.
30315 (Delegate): Class for declaring delegates.
30317 * makefile : Update.
30319 * cs-parser.jay (delegate_declaration): Implement.
30321 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
30323 * class.cs (Event::Define): Implement.
30324 (Event.EventBuilder): New member.
30326 * class.cs (TypeContainer::Populate): Update to define all enums and events
30328 (Events): New property for the events arraylist we hold. Shouldn't we move to using
30329 readonly fields for all these cases ?
30331 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
30333 * class.cs (Property): Revamp to use the convention of making fields readonly.
30334 Accordingly modify code elsewhere.
30336 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
30337 the Define method of the Property class.
30339 * class.cs : Clean up applied patch and update references to variables etc. Fix
30341 (TypeContainer::Populate): Update to define all the properties we have. Also
30342 define all enumerations.
30344 * enum.cs (Define): Implement.
30346 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
30348 * cs-parser.jay (overloadable_operator): The semantic value is an
30349 enum of the Operator class.
30350 (operator_declarator): Implement actions.
30351 (operator_declaration): Implement.
30353 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
30354 validity of definitions.
30355 (Operator::CheckBinaryOperator): Static method to check for binary operators
30356 (TypeContainer::AddOperator): New method to add an operator to a type.
30358 * cs-parser.jay (indexer_declaration): Added line to actually call the
30359 AddIndexer method so it gets added ;-)
30361 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
30362 already taken care of by the MS compiler ?
30364 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
30366 * class.cs (Operator): New class for operator declarations.
30367 (Operator::OpType): Enum for the various operators.
30369 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
30371 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
30372 ostensibly handle this in semantic analysis.
30374 * cs-parser.jay (general_catch_clause): Comment out
30375 (specific_catch_clauses, specific_catch_clause): Ditto.
30376 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
30377 (catch_args, opt_catch_args): New productions.
30378 (catch_clause): Rewrite to use the new productions above
30379 (catch_clauses): Modify accordingly.
30380 (opt_catch_clauses): New production to use in try_statement
30381 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
30382 and re-write the code in the actions to extract the specific and
30383 general catch clauses by being a little smart ;-)
30385 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
30386 Hooray, try and catch statements parse fine !
30388 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30390 * statement.cs (Block::GetVariableType): Fix logic to extract the type
30391 string from the hashtable of variables.
30393 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
30394 I end up making that mistake ;-)
30395 (catch_clauses): Fixed gross error which made Key and Value of the
30396 DictionaryEntry the same : $1 !!
30398 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30400 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
30402 * cs-parser.jay (event_declaration): Correct to remove the semicolon
30403 when the add and remove accessors are specified.
30405 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
30407 * cs-parser.jay (IndexerDeclaration): New helper class to hold
30408 information about indexer_declarator.
30409 (indexer_declarator): Implement actions.
30410 (parsing_indexer): New local boolean used to keep track of whether
30411 we are parsing indexers or properties. This is necessary because
30412 implicit_parameters come into picture even for the get accessor in the
30413 case of an indexer.
30414 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
30416 * class.cs (Indexer): New class for indexer declarations.
30417 (TypeContainer::AddIndexer): New method to add an indexer to a type.
30418 (TypeContainer::indexers): New member to hold list of indexers for the
30421 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
30423 * cs-parser.jay (add_accessor_declaration): Implement action.
30424 (remove_accessor_declaration): Implement action.
30425 (event_accessors_declaration): Implement
30426 (variable_declarators): swap statements for first rule - trivial.
30428 * class.cs (Event): New class to hold information about event
30430 (TypeContainer::AddEvent): New method to add an event to a type
30431 (TypeContainer::events): New member to hold list of events.
30433 * cs-parser.jay (event_declaration): Implement actions.
30435 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
30437 * cs-parser.jay (dim_separators): Implement. Make it a string
30438 concatenating all the commas together, just as they appear.
30439 (opt_dim_separators): Modify accordingly
30440 (rank_specifiers): Update accordingly. Basically do the same
30441 thing - instead, collect the brackets here.
30442 (opt_rank_sepcifiers): Modify accordingly.
30443 (array_type): Modify to actually return the complete type string
30444 instead of ignoring the rank_specifiers.
30445 (expression_list): Implement to collect the expressions
30446 (variable_initializer): Implement. We make it a list of expressions
30447 essentially so that we can handle the array_initializer case neatly too.
30448 (variable_initializer_list): Implement.
30449 (array_initializer): Make it a list of variable_initializers
30450 (opt_array_initializer): Modify accordingly.
30452 * expression.cs (New::NType): Add enumeration to help us
30453 keep track of whether we have an object/delegate creation
30454 or an array creation.
30455 (New:NewType, New::Rank, New::Indices, New::Initializers): New
30456 members to hold data about array creation.
30457 (New:New): Modify to update NewType
30458 (New:New): New Overloaded contructor for the array creation
30461 * cs-parser.jay (array_creation_expression): Implement to call
30462 the overloaded New constructor.
30464 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
30466 * class.cs (TypeContainer::Constructors): Return member
30467 constructors instead of returning null.
30469 2001-08-26 Miguel de Icaza <miguel@ximian.com>
30471 * typemanager.cs (InitCoreTypes): Initialize the various core
30472 types after we have populated the type manager with the user
30473 defined types (this distinction will be important later while
30474 compiling corlib.dll)
30476 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
30477 on Expression Classification. Now all expressions have a method
30478 `Resolve' and a method `Emit'.
30480 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
30481 generation from working. Also add some temporary debugging
30484 2001-08-24 Miguel de Icaza <miguel@ximian.com>
30486 * codegen.cs: Lots of code generation pieces. This is only the
30487 beginning, will continue tomorrow with more touches of polish. We
30488 handle the fundamentals of if, while, do, for, return. Others are
30489 trickier and I need to start working on invocations soon.
30491 * gen-treedump.cs: Bug fix, use s.Increment here instead of
30494 * codegen.cs (EmitContext): New struct, used during code
30495 emission to keep a context. Most of the code generation will be
30498 * cs-parser.jay: Add embedded blocks to the list of statements of
30499 this block. So code generation proceeds in a top down fashion.
30501 2001-08-23 Miguel de Icaza <miguel@ximian.com>
30503 * statement.cs: Add support for multiple child blocks.
30505 2001-08-22 Miguel de Icaza <miguel@ximian.com>
30507 * codegen.cs (EmitCode): New function, will emit the code for a
30508 Block of code given a TypeContainer and its ILGenerator.
30510 * statement.cs (Block): Standard public readonly optimization.
30511 (Block::Block constructors): Link children.
30512 (Block::Child): Child Linker.
30513 (Block::EmitVariables): Emits IL variable declarations.
30515 * class.cs: Drop support for MethodGroups here, delay until
30517 (Method::): Applied the same simplification that I did before, and
30518 move from Properties to public readonly fields.
30519 (Method::ParameterTypes): Returns the parameter types for the
30520 function, and implements a cache that will be useful later when I
30521 do error checking and the semantic analysis on the methods is
30523 (Constructor::GetCallingConvention): Renamed from CallingConvetion
30524 and made a method, optional argument tells whether this is a class
30525 or a structure to apply the `has-this' bit.
30526 (Method::GetCallingConvention): Implement, returns the calling
30528 (Method::Define): Defines the type, a second pass is performed
30529 later to populate the methods.
30531 (Constructor::ParameterTypes): implement a cache similar to the
30532 one on Method::ParameterTypes, useful later when we do semantic
30535 (TypeContainer::EmitMethod): New method. Emits methods.
30537 * expression.cs: Removed MethodGroup class from here.
30539 * parameter.cs (Parameters::GetCallingConvention): new method.
30541 2001-08-21 Miguel de Icaza <miguel@ximian.com>
30543 * class.cs (TypeContainer::Populate): Drop RootContext from the
30546 (Constructor::CallingConvention): Returns the calling convention.
30547 (Constructor::ParameterTypes): Returns the constructor parameter
30550 (TypeContainer::AddConstructor): Keep track of default constructor
30551 and the default static constructor.
30553 (Constructor::) Another class that starts using `public readonly'
30554 instead of properties.
30556 (Constructor::IsDefault): Whether this is a default constructor.
30558 (Field::) use readonly public fields instead of properties also.
30560 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
30561 track of static constructors; If none is used, turn on
30562 BeforeFieldInit in the TypeAttributes.
30564 * cs-parser.jay (opt_argument_list): now the return can be null
30565 for the cases where there are no arguments.
30567 (constructor_declarator): If there is no implicit `base' or
30568 `this', then invoke the default parent constructor.
30570 * modifiers.cs (MethodAttr): New static function maps a set of
30571 modifiers flags into a MethodAttributes enum
30572 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
30573 MethodAttr, TypeAttr to represent the various mappings where the
30574 modifiers are used.
30575 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
30577 2001-08-19 Miguel de Icaza <miguel@ximian.com>
30579 * parameter.cs (GetParameterInfo): Fix bug where there would be no
30582 * interface.cs (PopulateIndexer): Implemented the code generator
30583 for interface indexers.
30585 2001-08-17 Miguel de Icaza <miguel@ximian.com>
30587 * interface.cs (InterfaceMemberBase): Now we track the new status
30590 (PopulateProperty): Implement property population. Woohoo! Got
30591 Methods and Properties going today.
30593 Removed all the properties for interfaces, and replaced them with
30594 `public readonly' fields.
30596 2001-08-16 Miguel de Icaza <miguel@ximian.com>
30598 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
30599 initialize their hashtables/arraylists only when they are needed
30600 instead of doing this always.
30602 * parameter.cs: Handle refs and out parameters.
30604 * cs-parser.jay: Use an ArrayList to construct the arguments
30605 instead of the ParameterCollection, and then cast that to a
30608 * parameter.cs: Drop the use of ParameterCollection and use
30609 instead arrays of Parameters.
30611 (GetParameterInfo): Use the Type, not the Name when resolving
30614 2001-08-13 Miguel de Icaza <miguel@ximian.com>
30616 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
30617 and instead use public readonly fields.
30619 * class.cs: Put back walking code for type containers.
30621 2001-08-11 Miguel de Icaza <miguel@ximian.com>
30623 * class.cs (MakeConstant): Code to define constants.
30625 * rootcontext.cs (LookupType): New function. Used to locate types
30628 2001-08-08 Miguel de Icaza <miguel@ximian.com>
30630 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
30631 this System.Reflection code is. Kudos to Microsoft
30633 * typemanager.cs: Implement a type cache and avoid loading all
30634 types at boot time. Wrap in LookupType the internals. This made
30635 the compiler so much faster. Wow. I rule!
30637 * driver.cs: Make sure we always load mscorlib first (for
30638 debugging purposes, nothing really important).
30640 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
30641 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
30643 * rootcontext.cs: Lookup types on their namespace; Lookup types
30644 on namespaces that have been imported using the `using' keyword.
30646 * class.cs (TypeContainer::TypeAttr): Virtualize.
30647 (Class::TypeAttr): Return attributes suitable for this bad boy.
30648 (Struct::TypeAttr): ditto.
30649 Handle nested classes.
30650 (TypeContainer::) Remove all the type visiting code, it is now
30651 replaced with the rootcontext.cs code
30653 * rootcontext.cs (GetClassBases): Added support for structs.
30655 2001-08-06 Miguel de Icaza <miguel@ximian.com>
30657 * interface.cs, statement.cs, class.cs, parameter.cs,
30658 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
30659 Drop use of TypeRefs, and use strings instead.
30661 2001-08-04 Miguel de Icaza <miguel@ximian.com>
30665 * class.cs (Struct::Struct): set the SEALED flags after
30666 checking the modifiers.
30667 (TypeContainer::TypeAttr): new property, returns the
30668 TypeAttributes for a class.
30670 * cs-parser.jay (type_list): Oops, list production was creating a
30671 new list of base types.
30673 * rootcontext.cs (StdLib): New property.
30674 (GetInterfaceTypeByName): returns an interface by type name, and
30675 encapsulates error handling here.
30676 (GetInterfaces): simplified.
30677 (ResolveTree): Encapsulated all the tree resolution here.
30678 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
30681 * driver.cs: Add support for --nostdlib, to avoid loading the
30682 default assemblies.
30683 (Main): Do not put tree resolution here.
30685 * rootcontext.cs: Beginning of the class resolution.
30687 2001-08-03 Miguel de Icaza <miguel@ximian.com>
30689 * rootcontext.cs: Provide better error reporting.
30691 * cs-parser.jay (interface_base): set our $$ to be interfaces.
30693 * rootcontext.cs (CreateInterface): Handle the case where there
30694 are no parent interfaces.
30696 (CloseTypes): Routine to flush types at the end.
30697 (CreateInterface): Track types.
30698 (GetInterfaces): Returns an array of Types from the list of
30699 defined interfaces.
30701 * typemanager.c (AddUserType): Mechanism to track user types (puts
30702 the type on the global type hash, and allows us to close it at the
30705 2001-08-02 Miguel de Icaza <miguel@ximian.com>
30707 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
30708 RecordInterface instead.
30710 * cs-parser.jay: Updated to reflect changes above.
30712 * decl.cs (Definition): Keep track of the TypeBuilder type that
30713 represents this type here. Not sure we will use it in the long
30714 run, but wont hurt for now.
30716 * driver.cs: Smaller changes to accomodate the new code.
30718 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
30721 * rootcontext.cs (CreateInterface): New method, used to create
30722 the System.TypeBuilder type for interfaces.
30723 (ResolveInterfaces): new entry point to resolve the interface
30725 (CodeGen): Property, used to keep track of the code generator.
30727 2001-07-26 Miguel de Icaza <miguel@ximian.com>
30729 * cs-parser.jay: Add a second production for delegate_declaration
30732 (enum_body): Put an opt_comma here instead of putting it on
30733 enum_body or enum_member_declarations so we can handle trailing
30734 commas on enumeration members. Gets rid of a shift/reduce.
30736 (type_list): Need a COMMA in the middle.
30738 (indexer_declaration): Tell tokenizer to recognize get/set
30740 * Remove old targets.
30742 * Re-add the parser target.
30744 2001-07-13 Simon Cozens <simon@simon-cozens.org>
30746 * cs-parser.jay: Add precendence rules for a number of operators
30747 ot reduce the number of shift/reduce conflicts in the grammar.
30749 2001-07-17 Miguel de Icaza <miguel@ximian.com>
30751 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
30754 Get rid of old crufty code.
30756 * rootcontext.cs: Use this to keep track of the parsed
30757 representation and the defined types available to the program.
30759 * gen-treedump.cs: adjust for new convention.
30761 * type.cs: Split out the type manager, and the assembly builder
30764 * typemanager.cs: the type manager will live here now.
30766 * cil-codegen.cs: And the code generator here.
30768 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
30770 * makefile: Fixed up for easy making.
30772 2001-07-13 Simon Cozens <simon@simon-cozens.org>
30774 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
30777 (unary_expression): Expand pre_increment_expression and
30778 post_decrement_expression to reduce a shift/reduce.
30780 2001-07-11 Simon Cozens
30782 * cs-tokenizer.cs: Hex numbers should begin with a 0.
30784 Improve allow_keyword_as_indent name.
30786 2001-06-19 Miguel de Icaza <miguel@ximian.com>
30788 * Adjustments for Beta2.
30790 2001-06-13 Miguel de Icaza <miguel@ximian.com>
30792 * decl.cs: Added `Define' abstract method.
30793 (InTransit): new property, used to catch recursive definitions.
30795 * interface.cs: Implement `Define'.
30797 * modifiers.cs: Map Modifiers.constants to
30798 System.Reflection.TypeAttribute flags.
30800 * class.cs: Keep track of types and user-defined types.
30801 (BuilderInit): New method for creating an assembly
30802 (ResolveType): New function to launch the resolution process, only
30803 used by interfaces for now.
30805 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
30806 that are inserted into the name space.
30808 2001-06-08 Miguel de Icaza <miguel@ximian.com>
30810 * ARGH. I have screwed up my tree so many times due to the use of
30811 rsync rather than using CVS. Going to fix this at once.
30813 * driver.cs: Objetify driver. Load assemblies, use assemblies to
30816 2001-06-07 Miguel de Icaza <miguel@ximian.com>
30818 * Experiment successful: Use System.Type rather that our own
30821 2001-05-25 Miguel de Icaza <miguel@ximian.com>
30823 * cs-parser.jay: Removed nsAliases from here.
30825 Use new namespaces, handle `using XXX;'
30827 * namespace.cs: Reimplemented namespace handling, use a recursive
30828 definition of the class. Now we can keep track of using clauses
30829 and catch invalid using clauses.
30831 2001-05-24 Miguel de Icaza <miguel@ximian.com>
30833 * gen-treedump.cs: Adapted for all the renaming.
30835 * expression.cs (Expression): this class now has a Type property
30836 which returns an expression Type.
30838 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
30839 `Type', as this has a different meaning now in the base
30841 2001-05-22 Miguel de Icaza <miguel@ximian.com>
30843 * interface.cs, class.cs: Removed from all the sources the
30844 references to signature computation, as we can not do method
30845 signature computation during the parsing time, as we are not
30846 trying to solve at that point distinguishing:
30850 void a (NS.Blah x) {}
30853 Which depending on the context might be valid or not, as we do not
30854 know if Blah is the same thing as NS.Blah at that point.
30856 * Redid everything so the code uses TypeRefs now instead of
30857 Types. TypeRefs are just temporary type placeholders, that need
30858 to be resolved. They initially have a pointer to a string and the
30859 current scope in which they are used. This is used later by the
30860 compiler to resolve the reference to an actual Type.
30862 * DeclSpace is no longer a CIR.Type, and neither are
30863 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
30864 are all DeclSpaces, but no Types.
30866 * type.cs (TypeRefManager): This implements the TypeRef manager,
30867 which keeps track of all the types that need to be resolved after
30868 the parsing has finished.
30870 2001-05-13 Miguel de Icaza <miguel@ximian.com>
30872 * ARGH. We are going to have to store `foreach' as a class rather
30873 than resolving it, as we need to verify error 1579 after name
30874 resolution. *OR* we could keep a flag that says `This request to
30875 IEnumerator comes from a foreach statement' which we can then use
30876 to generate the error.
30878 2001-05-10 Miguel de Icaza <miguel@ximian.com>
30880 * class.cs (TypeContainer.AddMethod): we now add methods to the
30881 MethodGroup instead of the method hashtable.
30883 * expression.cs: Add MethodGroup abstraction, which gets us one
30884 step closer to the specification in the way we handle method
30887 * cs-parser.jay (primary_expression): qualified_identifier now
30888 tried to match up an identifier to a local variable reference or
30889 to a parameter reference.
30891 current_local_parameters is now a parser global variable that
30892 points to the current parameters for the block, used during name
30895 (property_declaration): Now creates an implicit `value' argument to
30898 2001-05-09 Miguel de Icaza <miguel@ximian.com>
30900 * parameter.cs: Do not use `param' arguments as part of the
30901 signature, per the spec.
30903 2001-05-08 Miguel de Icaza <miguel@ximian.com>
30905 * decl.cs: Base class for classes, structs and interfaces. This
30906 is the "Declaration Space"
30908 * cs-parser.jay: Use CheckDef for checking declaration errors
30909 instead of having one on each function.
30911 * class.cs: Factor out some code for handling error handling in
30912 accordance to the "Declarations" section in the "Basic Concepts"
30913 chapter in the ECMA C# spec.
30915 * interface.cs: Make all interface member classes derive from
30916 InterfaceMemberBase.
30918 2001-05-07 Miguel de Icaza <miguel@ximian.com>
30920 * Many things: all interfaces are parsed and generated in
30921 gen-treedump. Support for member variables, constructors,
30922 destructors, properties, constants is there.
30924 Beginning of the IL backend, but very little done, just there for
30927 2001-04-29 Miguel de Icaza <miguel@ximian.com>
30929 * cs-parser.jay: Fix labeled statement.
30931 * cs-tokenizer.cs (escape): Escape " and ' always.
30932 ref_line, ref_name: keep track of the line/filename as instructed
30933 by #line by the compiler.
30936 2001-04-27 Miguel de Icaza <miguel@ximian.com>
30938 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
30939 to match the values in System.CodeDOM.
30941 Divid renamed to Divide.
30943 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
30945 (Statements.set): remove.
30947 * System.CodeDOM/CodeCatchClause.cs: always have a valid
30950 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
30951 falseStatements always have valid values.
30953 * cs-parser.jay: Use System.CodeDOM now.